Preserve testing of the MMIO use case in case when GPEX is complied out
of qemu.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
...s => riscv64-virt-pci.riscv64-latest.args} | 8 +++++---
....args => riscv64-virt.riscv64-latest.args} | 10 ++++++----
tests/qemuxml2argvtest.c | 10 ++++++----
...ml => riscv64-virt-pci.riscv64-latest.xml} | 0
...rt.xml => riscv64-virt.riscv64-latest.xml} | 20 +++++++++++++++++--
tests/qemuxml2xmltest.c | 6 ++----
6 files changed, 37 insertions(+), 17 deletions(-)
rename tests/qemuxml2argvdata/{riscv64-virt-pci.args =>
riscv64-virt-pci.riscv64-latest.args} (67%)
rename tests/qemuxml2argvdata/{riscv64-virt.args => riscv64-virt.riscv64-latest.args}
(67%)
rename tests/qemuxml2xmloutdata/{riscv64-virt-pci.xml =>
riscv64-virt-pci.riscv64-latest.xml} (100%)
rename tests/qemuxml2xmloutdata/{riscv64-virt.xml => riscv64-virt.riscv64-latest.xml}
(53%)
diff --git a/tests/qemuxml2argvdata/riscv64-virt-pci.args
b/tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args
similarity index 67%
rename from tests/qemuxml2argvdata/riscv64-virt-pci.args
rename to tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args
index d981bfe2c7..b6c16591ee 100644
--- a/tests/qemuxml2argvdata/riscv64-virt-pci.args
+++ b/tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args
@@ -9,10 +9,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-riscv64/.config \
/usr/bin/qemu-system-riscv64 \
-name guest=riscv64,debug-threads=on \
-S \
--object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-riscv64/master-key.aes \
--machine virt,usb=off,dump-guest-core=off \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-riscv64/master-key.aes"}'
\
+-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \
-accel tcg \
-m 2048 \
+-object
'{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}'
\
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid fd65fc03-8838-4c4d-9d8d-395802488790 \
@@ -28,6 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-riscv64/.config \
-append root=/dev/vda \
-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/images/riscv64.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}'
\
--device
virtio-blk-pci,bus=pcie.0,addr=0x1,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
+-device
'{"driver":"virtio-blk-pci","bus":"pcie.0","addr":"0x1","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}'
\
-audiodev
'{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/riscv64-virt.args
b/tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args
similarity index 67%
rename from tests/qemuxml2argvdata/riscv64-virt.args
rename to tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args
index 05f8752120..3a770d77ff 100644
--- a/tests/qemuxml2argvdata/riscv64-virt.args
+++ b/tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args
@@ -9,10 +9,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-riscv64/.config \
/usr/bin/qemu-system-riscv64 \
-name guest=riscv64,debug-threads=on \
-S \
--object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-riscv64/master-key.aes \
--machine virt,usb=off,dump-guest-core=off \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-riscv64/master-key.aes"}'
\
+-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \
-accel tcg \
-m 2048 \
+-object
'{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}'
\
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid fd65fc03-8838-4c4d-9d8d-395802488790 \
@@ -28,9 +29,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-riscv64/.config \
-append 'console=ttyS0 ro root=/dev/vda' \
-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/images/stage4-disk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}'
\
--device virtio-blk-device,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
+-device
'{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}'
\
-chardev pty,id=charserial0 \
-serial chardev:charserial0 \
-audiodev
'{"id":"audio1","driver":"none"}' \
--device virtio-balloon-device,id=balloon0 \
+-device
'{"driver":"virtio-balloon-device","id":"balloon0"}'
\
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 90d96f2109..db846c1ea4 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2911,10 +2911,12 @@ mymain(void)
DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages");
DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly");
- DO_TEST("riscv64-virt",
- QEMU_CAPS_DEVICE_VIRTIO_MMIO);
- DO_TEST("riscv64-virt-pci",
- QEMU_CAPS_OBJECT_GPEX);
+ /* The generic pcie bridge emulation device can be compiled out of qemu. */
+ DO_TEST_CAPS_ARCH_LATEST_FULL("riscv64-virt", "riscv64",
+ ARG_QEMU_CAPS_DEL,
+ QEMU_CAPS_OBJECT_GPEX,
+ QEMU_CAPS_LAST);
+ DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-pci", "riscv64");
DO_TEST_CAPS_LATEST("virtio-transitional");
DO_TEST_CAPS_LATEST("virtio-non-transitional");
diff --git a/tests/qemuxml2xmloutdata/riscv64-virt-pci.xml
b/tests/qemuxml2xmloutdata/riscv64-virt-pci.riscv64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/riscv64-virt-pci.xml
rename to tests/qemuxml2xmloutdata/riscv64-virt-pci.riscv64-latest.xml
diff --git a/tests/qemuxml2xmloutdata/riscv64-virt.xml
b/tests/qemuxml2xmloutdata/riscv64-virt.riscv64-latest.xml
similarity index 53%
rename from tests/qemuxml2xmloutdata/riscv64-virt.xml
rename to tests/qemuxml2xmloutdata/riscv64-virt.riscv64-latest.xml
index 8a5c5dd985..9868f3ae12 100644
--- a/tests/qemuxml2xmloutdata/riscv64-virt.xml
+++ b/tests/qemuxml2xmloutdata/riscv64-virt.riscv64-latest.xml
@@ -20,8 +20,24 @@
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/stage4-disk.img'/>
<target dev='vda' bus='virtio'/>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x01'
slot='0x00' function='0x0'/>
</disk>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='1' port='0x8'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='pci' index='2'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='2' port='0x9'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='3'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='3' port='0xa'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
<serial type='pty'>
<target type='system-serial' port='0'>
<model name='16550a'/>
@@ -32,7 +48,7 @@
</console>
<audio id='1' type='none'/>
<memballoon model='virtio'>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x02'
slot='0x00' function='0x0'/>
</memballoon>
</devices>
</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 787e51956f..c29734f086 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1176,10 +1176,8 @@ mymain(void)
DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages");
DO_TEST_CAPS_LATEST("vhost-user-fs-sock");
- DO_TEST("riscv64-virt",
- QEMU_CAPS_DEVICE_VIRTIO_MMIO);
- DO_TEST("riscv64-virt-pci",
- QEMU_CAPS_OBJECT_GPEX);
+ DO_TEST_CAPS_ARCH_LATEST("riscv64-virt", "riscv64");
+ DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-pci", "riscv64");
DO_TEST_CAPS_LATEST("x86-kvm-32-on-64");
--
2.39.2