virtinst.capabilities: return recommended machine for XEN

This is required in order to ask for correct domcapabilities.  If you don't
specify any machine libvirt will return domcapabilities for default machine
which is xenpv.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-06-16 12:00:51 +02:00
parent 5ecc2b440a
commit de9cd87fda
3 changed files with 8 additions and 3 deletions

View File

@ -5,7 +5,7 @@
<currentMemory>65536</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
<type arch="x86_64" machine="xenfv">hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev="cdrom"/>
<boot dev="hd"/>

View File

@ -5,7 +5,7 @@
<currentMemory>65536</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">linux</type>
<type arch="x86_64" machine="xenpv">linux</type>
<kernel>/tmp/virtinst-vmlinuz.</kernel>
<initrd>/tmp/virtinst-initrd.img.</initrd>
<cmdline>method=tests/cli-test-xml/faketree</cmdline>

View File

@ -350,9 +350,14 @@ class _CapsInfo(object):
# For any other HV just let libvirt get us the default, these
# are the only ones we've tested.
if not self.conn.is_test() and not self.conn.is_qemu():
if (not self.conn.is_test() and
not self.conn.is_qemu() and
not self.conn.is_xen()):
return None
if self.conn.is_xen() and len(self.machines):
return self.machines[0]
if (self.arch in ["ppc64", "ppc64le"] and
"pseries" in self.machines):
return "pseries"