[virt-tools-list] [virt-manager][PATCH v1 1/2] Modify the default graphics device to "vnc" for ppc64 and ppc64le

Kevin Zhao kevinzs at linux.vnet.ibm.com
Tue Dec 15 13:06:19 UTC 2015


Modify the default graphics device to "vnc",since the powerpc
does't support spice devices.Otherwise, virt-manager can not
be used in ppc64 and ppc64le hardware.So that change  make
virt-manager supports arch "ppc64" and "ppc64le".Also add
a test case to cover this change.
---
 .../compare/virt-install-ppc64le-cdrom-f22.xml     | 39 ++++++++++++++++++++++
 tests/clitest.py                                   |  2 +-
 virtinst/guest.py                                  |  3 ++
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 tests/cli-test-xml/compare/virt-install-ppc64le-cdrom-f22.xml

diff --git a/tests/cli-test-xml/compare/virt-install-ppc64le-cdrom-f22.xml b/tests/cli-test-xml/compare/virt-install-ppc64le-cdrom-f22.xml
new file mode 100644
index 0000000..c710169
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-ppc64le-cdrom-f22.xml
@@ -0,0 +1,39 @@
+<domain type="kvm">
+  <name>foobar</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <memory>1048576</memory>
+  <currentMemory>1048576</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch="ppc64le" machine="pseries">hvm</type>
+    <boot dev="cdrom"/>
+    <boot dev="hd"/>
+  </os>
+  <clock offset="utc"/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>destroy</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <disk type="file" device="disk">
+      <driver name="qemu" type="qcow2"/>
+      <source file="/dev/default-pool/testvol1.img"/>
+      <target dev="sda" bus="scsi"/>
+    </disk>
+    <disk type="file" device="cdrom">
+      <driver name="qemu" type="raw"/>
+      <source file="/tmp/__virtinst_cli_exist1.img"/>
+      <target dev="sdb" bus="scsi"/>
+      <readonly/>
+    </disk>
+    <interface type="network">
+      <source network="default"/>
+      <mac address="52:54:00:43:b4:20"/>
+    </interface>
+    <graphics type="vnc" port="-1"/>
+    <console type="pty"/>
+    <video>
+      <model type="vga"/>
+    </video>
+  </devices>
+</domain>
diff --git a/tests/clitest.py b/tests/clitest.py
index 994b415..f2085cc 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -702,7 +702,7 @@ c.add_compare("--connect %(URI-KVM-AARCH64)s --disk %(EXISTIMG1)s --import --os-
 c.add_compare("--arch ppc64 --machine pseries --boot network --disk %(EXISTIMG1)s --os-variant fedora20 --network none", "ppc64-pseries-f20")
 c.add_compare("--arch ppc64 --boot network --disk %(EXISTIMG1)s --os-variant fedora20 --network none", "ppc64-machdefault-f20")
 c.add_compare("--connect %(URI-KVM-PPC64LE)s --import --disk %(EXISTIMG1)s --os-variant fedora20", "ppc64le-kvm-import")
-
+c.add_compare("--arch ppc64 --machine pseries --connect %(URI-KVM-PPC64LE)s --disk %(EXISTIMG1)s --disk %(EXISTIMG3)s,device=cdrom --os-variant fedora22", "ppc64le-cdrom-f22")
 # s390x tests
 c.add_compare("--arch s390x --machine s390-ccw-virtio --connect %(URI-KVM-S390X)s --boot kernel=/kernel.img,initrd=/initrd.img --disk %(EXISTIMG1)s --disk %(EXISTIMG3)s,device=cdrom --os-variant fedora21", "s390x-cdrom")
 c.add_compare("--arch s390x --machine s390-ccw-virtio --connect %(URI-KVM-S390X-KVMIBM)s --boot kernel=/kernel.img,initrd=/initrd.img --disk %(EXISTIMG1)s --disk %(EXISTIMG3)s,device=cdrom --os-variant fedora21 --watchdog diag288,action=reset", "s390x-cdrom-KVMIBM")
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 6284b1f..f075345 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1125,6 +1125,9 @@ class Guest(XMLBuilder):
                               "Using vnc.")
                 gtype = "vnc"
 
+            if self.os.is_ppc64():
+                gtype = "vnc"
+
             gfx.type = gtype
 
         for dev in self.get_devices("graphics"):
-- 
1.9.1




More information about the virt-tools-list mailing list