summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Hrdina <phrdina@redhat.com>2016-06-16 12:00:51 +0200
committerPavel Hrdina <phrdina@redhat.com>2016-06-16 12:16:49 +0200
commitde9cd87fda742dfd5e9a14cf4b68c60e574d3e3d (patch)
tree7318e3289e96389e380d14680cfe7e1a09a57972
parent5ecc2b440a8e34e00a0c4192c94030428102f0cb (diff)
downloadvirt-manager-de9cd87fda742dfd5e9a14cf4b68c60e574d3e3d.tar.gz
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>
-rw-r--r--tests/cli-test-xml/compare/virt-install-xen-hvm.xml2
-rw-r--r--tests/cli-test-xml/compare/virt-install-xen-pv.xml2
-rw-r--r--virtinst/capabilities.py7
3 files changed, 8 insertions, 3 deletions
diff --git a/tests/cli-test-xml/compare/virt-install-xen-hvm.xml b/tests/cli-test-xml/compare/virt-install-xen-hvm.xml
index 746cce8c..59c9daf1 100644
--- a/tests/cli-test-xml/compare/virt-install-xen-hvm.xml
+++ b/tests/cli-test-xml/compare/virt-install-xen-hvm.xml
@@ -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"/>
diff --git a/tests/cli-test-xml/compare/virt-install-xen-pv.xml b/tests/cli-test-xml/compare/virt-install-xen-pv.xml
index e0b0f0a2..fd886a41 100644
--- a/tests/cli-test-xml/compare/virt-install-xen-pv.xml
+++ b/tests/cli-test-xml/compare/virt-install-xen-pv.xml
@@ -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>
diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py
index 4fa17246..a056c3f1 100644
--- a/virtinst/capabilities.py
+++ b/virtinst/capabilities.py
@@ -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"