From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elena Ufimtseva Subject: Re: [PATCH v10 5/9] libxl: vnuma types declararion Date: Tue, 16 Sep 2014 08:57:27 -0400 Message-ID: References: <1409718258-3276-1-git-send-email-ufimtseva@gmail.com> <1409718258-3276-3-git-send-email-ufimtseva@gmail.com> <1409760274.15505.9.camel@kazak.uk.xensource.com> <1409826927.15057.22.camel@kazak.uk.xensource.com> <1410851777.20720.4.camel@Abyss> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8643906815265240330==" Return-path: In-Reply-To: <1410851777.20720.4.camel@Abyss> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Keir Fraser , Ian Campbell , Stefano Stabellini , George Dunlap , Matt Wilson , Li Yechen , Ian Jackson , "xen-devel@lists.xen.org" , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============8643906815265240330== Content-Type: multipart/alternative; boundary=001a113a9e6c27a15105032e4b85 --001a113a9e6c27a15105032e4b85 Content-Type: text/plain; charset=UTF-8 On Tue, Sep 16, 2014 at 3:16 AM, Dario Faggioli wrote: > On Tue, 2014-09-16 at 02:17 -0400, Elena Ufimtseva wrote: > > > > > Then I would take the rest and wrap them in a libxl_vnode_info > > struct: > > > > libxl_vnode_info = Struct("libxl_vnode_info", [ > > ("mem", MemKB), # Size of this node's memory > > ("distances", Array(...)), # Distances from this node to > > the others (single dimensional array) > > ("pnode", TYPE), # which pnode this vnode is associated > > with > > ]) > > > > Then in the (b|c)_config > > ("vnuma_nodes", Array(libxl_vnode_info...)) > > > > > > Hi Ian > > > > > > Is there a better mechanism to parse first vnuma_nodes, and within it > > to parse distances array? > > > Parse? Why parse? The above is the suggested look of the _libxl_ > interface, not of the xl config file. > > For the xl config file, IMO, what you have in place is already fine, > with the modification of the name of the various options, as I mentioned > in one of my review message. > > > So lets say config will be looking like this: > > > > > > vnuma_nodes = [ a b c, d e f, g e k,... ] > > but c, f, k cannot be arrays. Parser does not expect to have one more > > string withing each element of a topmost string. > > > No need for the config file to look like this! > > In the config file, you can have: > > vnodes=4 > vnodes_memory=[1024, 1024, 2048, 2048] > vnodes_distances=[20, 40] > > etc. > > Then, while parsing, you fill the libxl data structures defined in the > IDL file as Ian suggested. > > > So this does not work: > > > > > > vnuma_nodes = [ a b "distance array1", d e "distance array2", ...] > > also this does not work: > > > > > > vnuma_node = [ [], [], [], ..] > > Looks like that I was trying to avoid with emulating multi dimensional > > array for distance still persists here. > > > > > > Maybe you know some tricky way to get around this? > > > The trick is, just don't do that!! :-P > Thank you Dario, makes sense, I somehow thought about parsing instead ) > > Regards, > Dario > > -- > <> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://about.me/dario.faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) > > -- Elena --001a113a9e6c27a15105032e4b85 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, Sep 16, 2014 at 3:16 AM, Dario Faggioli <<= a href=3D"mailto:dario.faggioli@citrix.com" target=3D"_blank">dario.faggiol= i@citrix.com> wrote:
On Tue, 2014-09-16 at 02:17 -0400, Elena Ufimtseva wrote:

>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Then I would take the rest and wrap t= hem in a libxl_vnode_info
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0libxl_vnode_info =3D Struct("lib= xl_vnode_info", [
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("mem", MemKB= ), # Size of this node's memory
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("distances",= Array(...)), # Distances from this node to
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the others (single dimensional array)=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("pnode", TYP= E), # which pnode this vnode is associated
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0with
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0])
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Then in the (b|c)_config
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("vnuma_nodes&quo= t;, Array(libxl_vnode_info...))
>
>
> Hi Ian
>
>
> Is there a better mechanism to parse first vnuma_nodes, and within it<= br> > to parse distances array?
>
Parse? Why parse? The above is the suggested look of the _libxl_
interface, not of the xl config file.

For the xl config file, IMO, what you have in place is already fine,
with the modification of the name of the various options, as I mentioned in one of my review message.

> So lets say config will be looking like this:
>
>
> vnuma_nodes =3D [ a b c, d e f, g e k,... ]
> but c, f, k cannot be arrays. Parser does not expect to have one more<= br> > string withing each element of a topmost string.
>
No need for the config file to look like this!

In the config file, you can have:

vnodes=3D4
vnodes_memory=3D[1024, 1024, 2048, 2048]
vnodes_distances=3D[20, 40]

etc.

Then, while parsing, you fill the libxl data structures defined in the
IDL file as Ian suggested.

> So this does not work:
>
>
> vnuma_nodes=C2=A0 =3D=C2=A0 [ a b "distance array1", d e &qu= ot;distance array2", ...]
> also this does not work:
>
>
> vnuma_node =3D [ [], [], [], ..]
> Looks like that I was trying to avoid with emulating multi dimensional=
> array for distance still persists here.
>
>
> Maybe you know some tricky way to get around this?
>
The trick is, just don't do that!!=C2=A0 :-P

Thank you Dario, makes sense, I somehow thought about pars= ing instead )

Regards,
Dario

--
<<This happens because I choose it to happen!>> (Raistlin Majer= e)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)




--
= Elena
--001a113a9e6c27a15105032e4b85-- --===============8643906815265240330== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8643906815265240330==--