
On Mon, Mar 26, 2007 at 08:39:16PM +0100, Daniel P. Berrange wrote:
On Fri, Mar 23, 2007 at 12:24:57PM -0700, David Lutterkort wrote:
I noticed that the guest capabilities on a xen dom0 always contain both the pae and nonpae feature - AFAIK, you can't mix pae/nonpae guests and hosts, and only one of the features should be there.
So it turned out to be a bit more complicated. The <guest> blocks are supposed to be keyed off (machine,os-type) tuples eg (i686,xen) or (x86_64,hvm), etc. The impl was in fact though doing a linear conversion from Xen's /sys/hypervisor/properties/capabilities which is keyed off a (machine,os-type,flags) tuple (where flags==pae). So we needed to collapse one level of cardinaility from the Xen data - hence the <pae/> & <nonpae/> flags can both be used at once.
Anyway the collapsing was not correct, so I'm attaching a patch to address that. This does a couple of other things too
Patch looks fine,
- Re-factors xenGetCapabilities so that it merely opens the /proc & /sysfs files and then passes the handle down to xenMakeCapabilitiesXML method. - Adds a huge test suite which has a library of various cpuinfo & capabilities files from various archs and calls xenMakeCapabilitiesXML with all of them
That is great !
- Removes the <emulator> element from paravirt <guest> block since it is only relevant to HVM.
I remember wondering a bit about the empty element a couple of weeks ago, good :-)
- Adds PowerPC support
Just one nitpick, what about raising an error at the unknown case in the switch: /* XXX surely no other Xen archs exist */ thanks a lot, being able to regression test more code is really cool ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/