On Wed, 2012-05-02 at 18:30 +0200, Dario Faggioli wrote: > > > + > > > + if (use_cpus>= b_info->max_vcpus) { > > > + rc = 0; > > > + break; > > > + } > > Hmm -- there's got to be a better way to find out the minimum number > > of nodes to house a given number of vcpus than just starting at 1 > > and re-trying until we have enough. > > ... > > However, if what you mean is I could check beforehand whether or not > the > user provided configuration will give us enough CPUs and avoid testing > scenarios that are guaranteed to fail, then I agree and I'll reshape > the > code to look like that. > Actually, thinking more about this, I'm not even sure I can do what I stated above. In fact, I don't think I can assume the number of CPUs each node is made up of to be known, without actually checking it for the specific node(s) I want to try using. What if some CPUs are off-line and stuff like that? I might have to recheck, but reading topology information takes on/offline-ness into account, which is something I lose if I assume some static x number of CPUs in each node. Also, are we sure archs with different number of CPUs in different nodes won't ever exist? :-P Finally, consider this is likely going to change when we will have some mechanism for taking the actual load on the CPUs into account, so maybe it's not worth spending much time on it right now. So, given what we currently export wrt topology, and all the above, I'm not sure I can see any cleverer way of figuring our how many CPUs/nodes I need than explicitly counting them (for what it counts, xend is also doing the same AFAIUI :-) ). Thoughts? Thanks and Regards, Dario -- <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)