From nobody Mon May 6 01:10:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551290892626569.6520332802136; Wed, 27 Feb 2019 10:08:12 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9797DC066812; Wed, 27 Feb 2019 18:08:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 630BA61469; Wed, 27 Feb 2019 18:08:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9BCD2181A00A; Wed, 27 Feb 2019 18:08:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1RI87E2022139 for ; Wed, 27 Feb 2019 13:08:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6404918C54; Wed, 27 Feb 2019 18:08:07 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C6A66BF64 for ; Wed, 27 Feb 2019 18:08:06 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 27 Feb 2019 19:08:00 +0100 Message-Id: <20190227180801.30947-2-abologna@redhat.com> In-Reply-To: <20190227180801.30947-1-abologna@redhat.com> References: <20190227180801.30947-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] tests: Add simple guests with graphics to qemuxml2argv X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 27 Feb 2019 18:08:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" These are similar to the existing simple headless guests, but also include a graphical output and some input devices. Input files were generated by running $ virt-install \ --name guest --os-variant fedora29 \ --vcpus 4 --memory 4096 --disk size=3D5 \ --graphics vnc \ --print-xml followed by minor tweaks. Signed-off-by: Andrea Bolognani Reviewed-by: Cole Robinson --- .../aarch64-virt-graphics.aarch64-latest.args | 59 +++++++++++++++++++ .../aarch64-virt-graphics.xml | 50 ++++++++++++++++ .../ppc64-pseries-graphics.ppc64-latest.args | 48 +++++++++++++++ .../ppc64-pseries-graphics.xml | 44 ++++++++++++++ .../x86_64-pc-graphics.x86_64-latest.args | 51 ++++++++++++++++ tests/qemuxml2argvdata/x86_64-pc-graphics.xml | 55 +++++++++++++++++ .../x86_64-q35-graphics.x86_64-latest.args | 59 +++++++++++++++++++ .../qemuxml2argvdata/x86_64-q35-graphics.xml | 55 +++++++++++++++++ tests/qemuxml2argvtest.c | 6 ++ 9 files changed, 427 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-la= test.args create mode 100644 tests/qemuxml2argvdata/aarch64-virt-graphics.xml create mode 100644 tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-lat= est.args create mode 100644 tests/qemuxml2argvdata/ppc64-pseries-graphics.xml create mode 100644 tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest= .args create mode 100644 tests/qemuxml2argvdata/x86_64-pc-graphics.xml create mode 100644 tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-lates= t.args create mode 100644 tests/qemuxml2argvdata/x86_64-q35-graphics.xml diff --git a/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.ar= gs b/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args new file mode 100644 index 0000000000..46111a5f23 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args @@ -0,0 +1,59 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine virt,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,gic-version=3D2 \ +-drive file=3D/usr/share/AAVMF/AAVMF_CODE.fd,if=3Dpflash,format=3Draw,unit= =3D0,\ +readonly=3Don \ +-drive file=3D/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=3Dpflash,format= =3Draw,\ +unit=3D1 \ +-m 4096 \ +-realtime mlock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 33844184-97c0-4cc0-aa7d-206f5803530b \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device pcie-root-port,port=3D0xa,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr= =3D0x1.0x2 \ +-device pcie-root-port,port=3D0xb,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,addr= =3D0x1.0x3 \ +-device pcie-root-port,port=3D0xc,chassis=3D5,id=3Dpci.5,bus=3Dpcie.0,addr= =3D0x1.0x4 \ +-device pcie-root-port,port=3D0xd,chassis=3D6,id=3Dpci.6,bus=3Dpcie.0,addr= =3D0x1.0x5 \ +-device pcie-root-port,port=3D0xe,chassis=3D7,id=3Dpci.7,bus=3Dpcie.0,addr= =3D0x1.0x6 \ +-device qemu-xhci,p2=3D15,p3=3D15,id=3Dusb,bus=3Dpci.2,addr=3D0x0 \ +-device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.3,addr=3D0x0 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.4,addr=3D0x0 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-scsi0-0-0-0 \ +-device scsi-hd,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D0,drive=3Ddriv= e-scsi0-0-0-0,\ +id=3Dscsi0-0-0-0,bootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:53:45:a5= ,bus=3Dpci.1,\ +addr=3D0x0 \ +-chardev pty,id=3Dcharserial0 \ +-serial chardev:charserial0 \ +-chardev socket,id=3Dcharchannel0,fd=3D1729,server,nowait \ +-device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,\ +id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ +-device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ +-device usb-kbd,id=3Dinput1,bus=3Dusb.0,port=3D2 \ +-vnc 127.0.0.1:0 \ +-device virtio-gpu-pci,id=3Dvideo0,max_outputs=3D1,bus=3Dpci.6,addr=3D0x0 \ +-object rng-random,id=3Dobjrng0,filename=3D/dev/urandom \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.5,addr=3D0x0 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/aarch64-virt-graphics.xml b/tests/qemux= ml2argvdata/aarch64-virt-graphics.xml new file mode 100644 index 0000000000..95aef91beb --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-virt-graphics.xml @@ -0,0 +1,50 @@ + + guest + 33844184-97c0-4cc0-aa7d-206f5803530b + + + + + + 4194304 + 4194304 + 4 + + hvm + /usr/share/AAVMF/AAVMF_CODE.f= d + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + + + + + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + + + + + + + + + + + + /dev/urandom + + + diff --git a/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.arg= s b/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.args new file mode 100644 index 0000000000..1c6c25ed24 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.args @@ -0,0 +1,48 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-realtime mlock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid b35969f7-e7cf-4d90-a9a0-4dd9000f9824 \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device qemu-xhci,p2=3D15,p3=3D15,id=3Dusb,bus=3Dpci.0,addr=3D0x2 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x3 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:a2:44:92= ,bus=3Dpci.0,\ +addr=3D0x1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-chardev socket,id=3Dcharchannel0,fd=3D1729,server,nowait \ +-device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,\ +id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ +-device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ +-device usb-kbd,id=3Dinput1,bus=3Dusb.0,port=3D2 \ +-device usb-mouse,id=3Dinput2,bus=3Dusb.0,port=3D3 \ +-vnc 127.0.0.1:0 \ +-device VGA,id=3Dvideo0,vgamem_mb=3D16,bus=3Dpci.0,addr=3D0x7 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x5 \ +-object rng-random,id=3Dobjrng0,filename=3D/dev/urandom \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.0,addr=3D0x6 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-pseries-graphics.xml b/tests/qemu= xml2argvdata/ppc64-pseries-graphics.xml new file mode 100644 index 0000000000..3d54a4f171 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-pseries-graphics.xml @@ -0,0 +1,44 @@ + + guest + b35969f7-e7cf-4d90-a9a0-4dd9000f9824 + + + + + + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + + + + + + + + + + + + /dev/urandom + + + diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args b= /tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args new file mode 100644 index 0000000000..ed8205204f --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.x86_64-latest.args @@ -0,0 +1,51 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-realtime mlock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 2c0abd3d-8f18-42c0-a132-9708213aaac9 \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc,driftfix=3Dslew \ +-global kvm-pit.lost_tick_policy=3Ddelay \ +-no-hpet \ +-no-shutdown \ +-global PIIX4_PM.disable_s3=3D1 \ +-global PIIX4_PM.disable_s4=3D1 \ +-boot strict=3Don \ +-device qemu-xhci,p2=3D15,p3=3D15,id=3Dusb,bus=3Dpci.0,addr=3D0x4 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x5 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:4c:e3:86= ,bus=3Dpci.0,\ +addr=3D0x3 \ +-chardev pty,id=3Dcharserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-chardev socket,id=3Dcharchannel0,fd=3D1729,server,nowait \ +-device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,\ +id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ +-device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ +-vnc 127.0.0.1:0 \ +-device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,\ +vram64_size_mb=3D0,vgamem_mb=3D16,max_outputs=3D1,bus=3Dpci.0,addr=3D0x2 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x7 \ +-object rng-random,id=3Dobjrng0,filename=3D/dev/urandom \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.0,addr=3D0x8 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/x86_64-pc-graphics.xml b/tests/qemuxml2= argvdata/x86_64-pc-graphics.xml new file mode 100644 index 0000000000..03745eabf4 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-pc-graphics.xml @@ -0,0 +1,55 @@ + + guest + 2c0abd3d-8f18-42c0-a132-9708213aaac9 + + + + + + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + + + + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + + + + /dev/urandom + + + diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args = b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args new file mode 100644 index 0000000000..54a1095704 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.x86_64-latest.args @@ -0,0 +1,59 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine q35,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-realtime mlock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 61288c03-0b0d-4f1e-9496-0f0256f2e013 \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc,driftfix=3Dslew \ +-global kvm-pit.lost_tick_policy=3Ddelay \ +-no-hpet \ +-no-shutdown \ +-global ICH9-LPC.disable_s3=3D1 \ +-global ICH9-LPC.disable_s4=3D1 \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x10,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,\ +multifunction=3Don,addr=3D0x2 \ +-device pcie-root-port,port=3D0x11,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,add= r=3D0x2.0x1 \ +-device pcie-root-port,port=3D0x12,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,add= r=3D0x2.0x2 \ +-device pcie-root-port,port=3D0x13,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,add= r=3D0x2.0x3 \ +-device pcie-root-port,port=3D0x14,chassis=3D5,id=3Dpci.5,bus=3Dpcie.0,add= r=3D0x2.0x4 \ +-device pcie-root-port,port=3D0x15,chassis=3D6,id=3Dpci.6,bus=3Dpcie.0,add= r=3D0x2.0x5 \ +-device pcie-root-port,port=3D0x16,chassis=3D7,id=3Dpci.7,bus=3Dpcie.0,add= r=3D0x2.0x6 \ +-device qemu-xhci,p2=3D15,p3=3D15,id=3Dusb,bus=3Dpci.2,addr=3D0x0 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.3,addr=3D0x0 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.4,addr=3D0x0,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:d2:70:0b= ,bus=3Dpci.1,\ +addr=3D0x0 \ +-chardev pty,id=3Dcharserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-chardev socket,id=3Dcharchannel0,fd=3D1729,server,nowait \ +-device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,\ +id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ +-device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ +-vnc 127.0.0.1:0 \ +-device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,\ +vram64_size_mb=3D0,vgamem_mb=3D16,max_outputs=3D1,bus=3Dpcie.0,addr=3D0x1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.5,addr=3D0x0 \ +-object rng-random,id=3Dobjrng0,filename=3D/dev/urandom \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.6,addr=3D0x0 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/x86_64-q35-graphics.xml b/tests/qemuxml= 2argvdata/x86_64-q35-graphics.xml new file mode 100644 index 0000000000..56db898e64 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-q35-graphics.xml @@ -0,0 +1,55 @@ + + guest + 61288c03-0b0d-4f1e-9496-0f0256f2e013 + + + + + + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + + + + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + + + + /dev/urandom + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index dd4f73a5fb..01fcc91664 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3004,6 +3004,12 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("x86_64-pc-headless", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-q35-headless", "x86_64"); =20 + /* Simple guests with graphics for various architectures */ + DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-graphics", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-pseries-graphics", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-pc-graphics", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-q35-graphics", "x86_64"); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 01:10:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551290900663691.4100917613922; Wed, 27 Feb 2019 10:08:20 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AB6930BDCCF; Wed, 27 Feb 2019 18:08:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 210A61691E; Wed, 27 Feb 2019 18:08:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DAE95181A12A; Wed, 27 Feb 2019 18:08:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1RI88mZ022147 for ; Wed, 27 Feb 2019 13:08:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3A9BF18C54; Wed, 27 Feb 2019 18:08:08 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B3AA26BF65 for ; Wed, 27 Feb 2019 18:08:07 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 27 Feb 2019 19:08:01 +0100 Message-Id: <20190227180801.30947-3-abologna@redhat.com> In-Reply-To: <20190227180801.30947-1-abologna@redhat.com> References: <20190227180801.30947-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: Allow creating ppc64 guests with graphics and no USB mouse X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 27 Feb 2019 18:08:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The existing behavior for ppc64 guests is to always add a USB keyboard and mouse combo if graphics are present; unfortunately, this means any attempt to use a USB tablet will cause both pointing devices to show up in the guest, which in turn will result in poor user experience. We can't just stop adding the USB mouse or start adding a USB tablet instead, because existing applications and user might rely on the current behavior; however, we can avoid adding the USB mouse if a USB tablet is already present, thus allowing users and applications to create guests that contain a single pointing device. https://bugzilla.redhat.com/show_bug.cgi?id=3D1683681 Signed-off-by: Andrea Bolognani Reviewed-by: Cole Robinson --- src/qemu/qemu_domain.c | 20 +++++++++++++++++++ .../ppc64-pseries-graphics.ppc64-latest.args | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 59fe1eb401..915795ab84 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3476,6 +3476,26 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390) && def->memballoon) def->memballoon->model =3D VIR_DOMAIN_MEMBALLOON_MODEL_NONE; =20 + if (addDefaultUSBMouse) { + bool hasUSBTablet =3D false; + size_t j; + + for (j =3D 0; j < def->ninputs; j++) { + if (def->inputs[j]->type =3D=3D VIR_DOMAIN_INPUT_TYPE_TABLET && + def->inputs[j]->bus =3D=3D VIR_DOMAIN_INPUT_BUS_USB) { + hasUSBTablet =3D true; + break; + } + } + + /* Historically, we have automatically added USB keyboard and + * mouse to some guests. While the former device is generally + * safe to have, adding the latter is undesiderable if a USB + * tablet is already present in the guest */ + if (hasUSBTablet) + addDefaultUSBMouse =3D false; + } + if (addDefaultUSBKBD && def->ngraphics > 0 && virDomainDefMaybeAddInput(def, diff --git a/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.arg= s b/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.args index 1c6c25ed24..b81648f078 100644 --- a/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.args +++ b/tests/qemuxml2argvdata/ppc64-pseries-graphics.ppc64-latest.args @@ -37,7 +37,6 @@ addr=3D0x1 \ id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ -device usb-tablet,id=3Dinput0,bus=3Dusb.0,port=3D1 \ -device usb-kbd,id=3Dinput1,bus=3Dusb.0,port=3D2 \ --device usb-mouse,id=3Dinput2,bus=3Dusb.0,port=3D3 \ -vnc 127.0.0.1:0 \ -device VGA,id=3Dvideo0,vgamem_mb=3D16,bus=3Dpci.0,addr=3D0x7 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x5 \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list