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

Cole Robinson crobinso at redhat.com
Thu Dec 24 16:33:56 UTC 2015


On 12/15/2015 08:06 AM, Kevin Zhao wrote:
> 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"):
> 

Thanks for the report, indeed our behavior is wrong. But this fix isn't
correct... spice is only supported for qemu running on x86 _host_, it doesn't
have anything to do with the qemu emulated arch. I pushed a patch with the
proper fix:

commit 33ca0fff7dab62bfa64a24bcdd1d862a9c17245f
Author: Cole Robinson <crobinso at redhat.com>
Date:   Tue Dec 15 21:06:19 2015 +0800

    Only use spice on x86

    qemu isn't compiled with spice support for non-x86

    Reported-by: Kevin Zhao <kevinzs at linux.vnet.ibm.com>


- Cole




More information about the virt-tools-list mailing list