]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemuxml: Fix and enable default-video-type* tests
authorPeter Krempa <pkrempa@redhat.com>
Wed, 22 Jan 2020 10:56:09 +0000 (11:56 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 27 Jan 2020 13:55:03 +0000 (14:55 +0100)
The tests prefixed default-video* were enabled only for the xml2xml
testing and used impossible configurations.

Enable them for xml2argv testing fix them:
1) aarch64: remove pointless cpu mode
2) s390x: remove pointless cpu and use existing machine type
3) riscv: remove pointless cpu
4) x86: remove pointless cpu and use existing machine type
5) ppc65: use correct machine type and enable USB

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 files changed:
tests/qemuxml2argvdata/default-video-type-aarch64.aarch64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/default-video-type-aarch64.xml
tests/qemuxml2argvdata/default-video-type-ppc64.ppc64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/default-video-type-ppc64.xml
tests/qemuxml2argvdata/default-video-type-riscv64.riscv64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/default-video-type-riscv64.xml
tests/qemuxml2argvdata/default-video-type-s390x.s390x-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/default-video-type-s390x.xml
tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.xml
tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/default-video-type-aarch64.aarch64-latest.xml
tests/qemuxml2xmloutdata/default-video-type-ppc64.ppc64-latest.xml
tests/qemuxml2xmloutdata/default-video-type-riscv64.riscv64-latest.xml
tests/qemuxml2xmloutdata/default-video-type-s390x.s390x-latest.xml
tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-0.xml
tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-1.xml

diff --git a/tests/qemuxml2argvdata/default-video-type-aarch64.aarch64-latest.args b/tests/qemuxml2argvdata/default-video-type-aarch64.aarch64-latest.args
new file mode 100644 (file)
index 0000000..4eaeaa5
--- /dev/null
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-default-video-type-a \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-default-video-type-a/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-default-video-type-a/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-default-video-type-a/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 \
+-name guest=default-video-type-aarch64-test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-default-video-type-a/master-key.aes \
+-machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=3 \
+-m 1024 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
+addr=0x1 \
+-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
+-vnc 127.0.0.1:0 \
+-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.1,addr=0x0 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
index f7d2d5d94a4d30bfef4e1b66a2a5cfd7e3da9b67..5c008813cc4679f741cafa7d4b7bfa7ad350ef6c 100644 (file)
@@ -6,7 +6,6 @@
   <os>
     <type arch='aarch64' machine='virt'>hvm</type>
   </os>
-  <cpu mode='host-passthrough'/>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
diff --git a/tests/qemuxml2argvdata/default-video-type-ppc64.ppc64-latest.args b/tests/qemuxml2argvdata/default-video-type-ppc64.ppc64-latest.args
new file mode 100644 (file)
index 0000000..795c5a5
--- /dev/null
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-default-video-type-p \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-default-video-type-p/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-default-video-type-p/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-default-video-type-p/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 \
+-name guest=default-video-type-ppc64-test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-default-video-type-p/master-key.aes \
+-machine pseries,accel=kvm,usb=off,dump-guest-core=off \
+-cpu host \
+-m 1024 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
+-device usb-kbd,id=input0,bus=usb.0,port=1 \
+-device usb-mouse,id=input1,bus=usb.0,port=2 \
+-vnc 127.0.0.1:0 \
+-device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
index ea5b966cfdb500bc324ed07c15e97c807129948a..6f9ccdbaf1fe1840c1f2ba7e0fdca285654ad44e 100644 (file)
@@ -4,12 +4,11 @@
   <memory unit='KiB'>1048576</memory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='ppc64' machine='virt'>hvm</type>
+    <type arch='ppc64' machine='pseries'>hvm</type>
   </os>
   <cpu mode='host-passthrough'/>
   <devices>
     <emulator>/usr/bin/qemu-system-ppc64</emulator>
-    <controller type='usb' index='0' model='none'/>
     <memballoon model='none'/>
     <graphics type='vnc'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/default-video-type-riscv64.riscv64-latest.args b/tests/qemuxml2argvdata/default-video-type-riscv64.riscv64-latest.args
new file mode 100644 (file)
index 0000000..c4acaaf
--- /dev/null
@@ -0,0 +1,34 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-default-video-type-r \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-default-video-type-r/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-default-video-type-r/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-default-video-type-r/.config \
+QEMU_AUDIO_DRV=spice \
+/usr/bin/qemu-system-riscv64 \
+-name guest=default-video-type-riscv64-test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-default-video-type-r/master-key.aes \
+-machine virt,accel=tcg,usb=off,dump-guest-core=off \
+-m 1024 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
+addr=0x1 \
+-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
+-spice port=0,seamless-migration=on \
+-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.1,addr=0x0 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
index 55f6fa9391a48648ba72858e03fb6609cecba577..97e239f5ea3488249802d0ff754d9a0649ad6c08 100644 (file)
@@ -6,7 +6,6 @@
   <os>
     <type arch='riscv64' machine='virt'>hvm</type>
   </os>
-  <cpu mode='host-passthrough'/>
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
     <controller type='usb' index='0' model='none'/>
diff --git a/tests/qemuxml2argvdata/default-video-type-s390x.s390x-latest.args b/tests/qemuxml2argvdata/default-video-type-s390x.s390x-latest.args
new file mode 100644 (file)
index 0000000..441270d
--- /dev/null
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-default-video-type-s \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-default-video-type-s/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-default-video-type-s/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-default-video-type-s/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name guest=default-video-type-s390x-test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-default-video-type-s/master-key.aes \
+-machine s390-ccw-virtio,accel=kvm,usb=off,dump-guest-core=off \
+-m 1024 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-vnc 127.0.0.1:0 \
+-device virtio-gpu-ccw,id=video0,max_outputs=1,devno=fe.0.0000 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
index fe402d2c7f7924578dcc1f7ed1b681469284340a..275b4c21a33ce3702fe03511fffde4515d6fc84a 100644 (file)
@@ -4,9 +4,8 @@
   <memory unit='KiB'>1048576</memory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='s390x' machine='virt'>hvm</type>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
   </os>
-  <cpu mode='host-passthrough'/>
   <devices>
     <emulator>/usr/bin/qemu-system-s390x</emulator>
     <controller type='usb' index='0' model='none'/>
index 2c753fe227fbcfbb1bc1b4475de3b7970ac5721c..2142db8d1f014c7c0992a1b081776c6935677445 100644 (file)
@@ -4,9 +4,8 @@
   <memory unit='KiB'>1048576</memory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='x86_64' machine='virt'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
   </os>
-  <cpu mode='host-passthrough'/>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <controller type='usb' index='0' model='none'/>
index 2c753fe227fbcfbb1bc1b4475de3b7970ac5721c..2142db8d1f014c7c0992a1b081776c6935677445 100644 (file)
@@ -4,9 +4,8 @@
   <memory unit='KiB'>1048576</memory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='x86_64' machine='virt'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
   </os>
-  <cpu mode='host-passthrough'/>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <controller type='usb' index='0' model='none'/>
index eb6a637c7a52ccfc05df7cfd2bef53778becf7ea..6f8887b4093de9b5130180fc8a38d646d400cfee 100644 (file)
@@ -2112,6 +2112,11 @@ mymain(void)
     DO_TEST_PARSE_ERROR("video-invalid-multiple-devices", NONE);
     DO_TEST_PARSE_ERROR("default-video-type-x86_64-caps-test-0", NONE);
 
+    DO_TEST_CAPS_ARCH_LATEST("default-video-type-aarch64", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("default-video-type-ppc64", "ppc64");
+    DO_TEST_CAPS_ARCH_LATEST("default-video-type-riscv64", "riscv64");
+    DO_TEST_CAPS_ARCH_LATEST("default-video-type-s390x", "s390x");
+
     DO_TEST("virtio-rng-default",
             QEMU_CAPS_DEVICE_VIRTIO_RNG,
             QEMU_CAPS_OBJECT_RNG_RANDOM);
index 1efea62f6fe78ac9c975210188aff2c02583410c..a47435163fa7a81514f8c69373b51a9875732ef1 100644 (file)
@@ -11,7 +11,6 @@
   <features>
     <gic version='3'/>
   </features>
-  <cpu mode='host-passthrough' check='none'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
index 6c4bd5ef8b5002a3c02db8fdddb1026283799962..52bf8a1590bca968f2525bde15f36d908d7ad05c 100644 (file)
@@ -5,7 +5,7 @@
   <currentMemory unit='KiB'>1048576</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='ppc64' machine='virt'>hvm</type>
+    <type arch='ppc64' machine='pseries'>hvm</type>
     <boot dev='hd'/>
   </os>
   <cpu mode='host-passthrough' check='none'/>
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-ppc64</emulator>
-    <controller type='usb' index='0' model='none'/>
-    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='usb' index='0' model='pci-ohci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+    </controller>
     <input type='keyboard' bus='usb'/>
     <input type='mouse' bus='usb'/>
     <graphics type='vnc' port='-1' autoport='yes'>
@@ -24,8 +29,9 @@
     </graphics>
     <video>
       <model type='vga' vram='16384' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
     </video>
     <memballoon model='none'/>
+    <panic model='pseries'/>
   </devices>
 </domain>
index ebb3bfe980edac2ce56529bb5e3873ac7d4195d9..56d4b34ab7d91106ca9eb008763b948bd72d4678 100644 (file)
@@ -8,7 +8,6 @@
     <type arch='riscv64' machine='virt'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu mode='host-passthrough' check='none'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
index d4ccf82712fccf8dae8a4ddef2961e71f3910e45..b12d768eab5680b996cc5b8f76ce388caaf0cb81 100644 (file)
@@ -5,10 +5,9 @@
   <currentMemory unit='KiB'>1048576</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='s390x' machine='virt'>hvm</type>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu mode='host-passthrough' check='none'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -22,9 +21,7 @@
     </graphics>
     <video>
       <model type='virtio' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'>
-        <zpci uid='0x0001' fid='0x00000000'/>
-      </address>
+      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
     </video>
     <memballoon model='none'/>
     <panic model='s390'/>
index 645019c23061f316f10724bab602b6b012af7678..47b2c7cbc966b5b5450425c1426b0bda119d5c35 100644 (file)
@@ -5,10 +5,9 @@
   <currentMemory unit='KiB'>1048576</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='x86_64' machine='virt'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu mode='host-passthrough' check='none'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -24,7 +23,7 @@
     </graphics>
     <video>
       <model type='vga' vram='16384' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
     </video>
     <memballoon model='none'/>
   </devices>
index f763b6902eafcedea470ebdac946732d5679a524..340cfef56f38745f604da927e1668b0c0fccc0e6 100644 (file)
@@ -5,10 +5,9 @@
   <currentMemory unit='KiB'>1048576</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='x86_64' machine='virt'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu mode='host-passthrough' check='none'/>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -24,7 +23,7 @@
     </graphics>
     <video>
       <model type='cirrus' vram='16384' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
     </video>
     <memballoon model='none'/>
   </devices>