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