[PATCH 0/3] qemu_validate: Reject virtiofs with bootindex on s390 with ccw bus

qemu doesn't support booting there and thus doesn't even expose bootindex. Peter Krempa (3): qemuxmlconftest: Add test case for virtiofs on s390 using 'ccw' addresses qemuxmlconftest: Decouple input and output files of 'vhost-user-fs-hugepage' case qemu_validate: Reject virtiofs with bootindex on s390x with CCW src/qemu/qemu_validate.c | 19 ++-- ...ost-user-fs-ccw-bootindex.s390x-latest.err | 1 + .../vhost-user-fs-ccw-bootindex.xml | 38 ++++++++ .../vhost-user-fs-ccw.s390x-latest.args | 37 ++++++++ .../vhost-user-fs-ccw.s390x-latest.xml | 43 +++++++++ tests/qemuxmlconfdata/vhost-user-fs-ccw.xml | 40 +++++++++ ...vhost-user-fs-hugepages.x86_64-latest.args | 2 + .../vhost-user-fs-hugepages.x86_64-latest.xml | 87 ++++++++++++++++++- .../vhost-user-fs-hugepages.xml | 8 ++ tests/qemuxmlconftest.c | 3 + 10 files changed, 272 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.s390x-latest.err create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.xml mode change 120000 => 100644 tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml -- 2.44.0

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- .../vhost-user-fs-ccw.s390x-latest.args | 37 ++++++++++++++++ .../vhost-user-fs-ccw.s390x-latest.xml | 43 +++++++++++++++++++ tests/qemuxmlconfdata/vhost-user-fs-ccw.xml | 40 +++++++++++++++++ tests/qemuxmlconftest.c | 2 + 4 files changed, 122 insertions(+) create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.xml diff --git a/tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.args b/tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.args new file mode 100644 index 0000000000..f7bc39111f --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.args @@ -0,0 +1,37 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel tcg \ +-cpu qemu \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-file","id":"s390.ram","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","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 '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ +-chardev socket,id=chr-vu-fs0,path=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/fs0-fs.sock \ +-device '{"driver":"vhost-user-fs-ccw","id":"fs0","chardev":"chr-vu-fs0","tag":"mount_tag","devno":"fe.0.0001"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0002"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.xml b/tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.xml new file mode 100644 index 0000000000..efd58a8fa3 --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.xml @@ -0,0 +1,43 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <memoryBacking> + <access mode='shared'/> + </memoryBacking> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <controller type='pci' index='0' model='pci-root'/> + <filesystem type='mount' accessmode='passthrough'> + <driver type='virtiofs'/> + <binary path='/usr/libexec/virtiofsd'/> + <source dir='/tmp'/> + <target dir='mount_tag'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </filesystem> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/vhost-user-fs-ccw.xml b/tests/qemuxmlconfdata/vhost-user-fs-ccw.xml new file mode 100644 index 0000000000..adcb9649ed --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-ccw.xml @@ -0,0 +1,40 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <memoryBacking> + <access mode='shared'/> + </memoryBacking> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + </disk> + <controller type='pci' index='0' model='pci-root'/> + <filesystem type='mount' accessmode='passthrough'> + <driver type='virtiofs'/> + <binary path='/usr/libexec/virtiofsd'/> + <source dir='/tmp'/> + <target dir='mount_tag'/> + </filesystem> + <audio id='1' type='none'/> + <memballoon model='virtio'> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 1f9e8edef9..f9ea849f60 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2854,6 +2854,8 @@ mymain(void) DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages"); DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly"); + DO_TEST_CAPS_ARCH_LATEST("vhost-user-fs-ccw", "s390x"); + DO_TEST_CAPS_LATEST("virtio-transitional"); DO_TEST_CAPS_LATEST("virtio-non-transitional"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-transitional-not-supported"); -- 2.44.0

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> On 4/22/24 16:57, Peter Krempa wrote:
Signed-off-by: Peter Krempa<pkrempa@redhat.com> --- .../vhost-user-fs-ccw.s390x-latest.args | 37 ++++++++++++++++ .../vhost-user-fs-ccw.s390x-latest.xml | 43 +++++++++++++++++++ tests/qemuxmlconfdata/vhost-user-fs-ccw.xml | 40 +++++++++++++++++ tests/qemuxmlconftest.c | 2 + 4 files changed, 122 insertions(+) create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw.xml
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Replace symlink by a real output file so that we can also test updates to input file. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- .../vhost-user-fs-hugepages.x86_64-latest.xml | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) mode change 120000 => 100644 tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml diff --git a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml deleted file mode 120000 index c48a0a74b5..0000000000 --- a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml +++ /dev/null @@ -1 +0,0 @@ -vhost-user-fs-hugepages.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml new file mode 100644 index 0000000000..d319f2926e --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml @@ -0,0 +1,78 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <memoryBacking> + <hugepages> + <page size='2048' unit='KiB'/> + </hugepages> + <access mode='shared'/> + </memoryBacking> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + </os> + <features> + <acpi/> + <apic/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + <numa> + <cell id='0' cpus='0-1' memory='2097152' unit='KiB' memAccess='shared'/> + </numa> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/var/lib/libvirt/images/guest.qcow2'/> + <target dev='vda' bus='virtio'/> + <boot order='1'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </disk> + <controller type='usb' index='0' model='none'/> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <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> + <controller type='pci' index='4' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='4' port='0xb'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/> + </controller> + <filesystem type='mount' accessmode='passthrough'> + <driver type='virtiofs'/> + <binary path='/usr/libexec/virtiofsd'/> + <source dir='/path'/> + <target dir='mount_tag'/> + <boot order='2'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </filesystem> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <watchdog model='itco' action='reset'/> + <memballoon model='none'/> + </devices> +</domain> -- 2.44.0

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> On 4/22/24 16:57, Peter Krempa wrote:
Replace symlink by a real output file so that we can also test updates to input file.
Signed-off-by: Peter Krempa<pkrempa@redhat.com> --- .../vhost-user-fs-hugepages.x86_64-latest.xml | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) mode change 120000 => 100644 tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

The CCW variant of the 'vhost-user-fs' device in qemu doesn't deliberately support the 'bootindex' attribute as the machine is unable to boot from such device. Reject '<boot order' on non-PCI virtiofs, add tests validating that it's rejected as well as that virtiofs on PCI-based hosts but without address specified will be accepted. Resolves: https://issues.redhat.com/browse/RHEL-22728 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_validate.c | 19 +++++++--- ...ost-user-fs-ccw-bootindex.s390x-latest.err | 1 + .../vhost-user-fs-ccw-bootindex.xml | 38 +++++++++++++++++++ ...vhost-user-fs-hugepages.x86_64-latest.args | 2 + .../vhost-user-fs-hugepages.x86_64-latest.xml | 8 ++++ .../vhost-user-fs-hugepages.xml | 8 ++++ tests/qemuxmlconftest.c | 1 + 7 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.s390x-latest.err create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index fd7b90e47d..b02da95c1e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4495,12 +4495,21 @@ qemuValidateDomainDeviceDefFS(virDomainFSDef *fs, if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "virtiofs") < 0) { return -1; } - if (fs->info.bootIndex && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOST_USER_FS_BOOTINDEX)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("setting virtiofs boot order is not supported with this QEMU binary")); - return -1; + + if (fs->info.bootIndex) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOST_USER_FS_BOOTINDEX)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting virtiofs boot order is not supported with this QEMU binary")); + return -1; + } + + if (fs->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting virtiofs boot order is supported only with PCI bus")); + return -1; + } } + break; case VIR_DOMAIN_FS_DRIVER_TYPE_MTP: diff --git a/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.s390x-latest.err b/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.s390x-latest.err new file mode 100644 index 0000000000..d865421bc7 --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.s390x-latest.err @@ -0,0 +1 @@ +unsupported configuration: setting virtiofs boot order is supported only with PCI bus diff --git a/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml b/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml new file mode 100644 index 0000000000..833b91d574 --- /dev/null +++ b/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml @@ -0,0 +1,38 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <memoryBacking> + <access mode='shared'/> + </memoryBacking> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + <filesystem type="mount" accessmode="passthrough"> + <target dir="mount_tag"/> + <source dir="/tmp"/> + <binary path="/usr/libexec/virtiofsd"/> + <boot order="2"/> + <driver type="virtiofs" /> + </filesystem> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.args b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.args index 8a7a2fea0b..51fada2721 100644 --- a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.args +++ b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.args @@ -36,6 +36,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -device '{"driver":"virtio-blk-pci","bus":"pci.4","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ -chardev socket,id=chr-vu-fs0,path=/var/lib/libvirt/qemu/domain--1-guest/fs0-fs.sock \ -device '{"driver":"vhost-user-fs-pci","id":"fs0","chardev":"chr-vu-fs0","tag":"mount_tag","bootindex":2,"bus":"pci.1","addr":"0x0"}' \ +-chardev socket,id=chr-vu-fs1,path=/var/lib/libvirt/qemu/domain--1-guest/fs1-fs.sock \ +-device '{"driver":"vhost-user-fs-pci","id":"fs1","chardev":"chr-vu-fs1","tag":"mount_tag2","bootindex":3,"bus":"pci.2","addr":"0x0"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -global ICH9-LPC.noreboot=off \ -watchdog-action reset \ diff --git a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml index d319f2926e..8e8d24257e 100644 --- a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.x86_64-latest.xml @@ -69,6 +69,14 @@ <boot order='2'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </filesystem> + <filesystem type='mount' accessmode='passthrough'> + <driver type='virtiofs'/> + <binary path='/usr/libexec/virtiofsd'/> + <source dir='/path'/> + <target dir='mount_tag2'/> + <boot order='3'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </filesystem> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.xml b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.xml index d319f2926e..a55d9d605a 100644 --- a/tests/qemuxmlconfdata/vhost-user-fs-hugepages.xml +++ b/tests/qemuxmlconfdata/vhost-user-fs-hugepages.xml @@ -69,6 +69,14 @@ <boot order='2'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </filesystem> + <!-- following virtiofs is deliberately without address to prove bootindex validation --> + <filesystem type='mount' accessmode='passthrough'> + <driver type='virtiofs'/> + <binary path='/usr/libexec/virtiofsd'/> + <source dir='/path'/> + <target dir='mount_tag2'/> + <boot order='3'/> + </filesystem> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index f9ea849f60..6165bb6f1d 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2855,6 +2855,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly"); DO_TEST_CAPS_ARCH_LATEST("vhost-user-fs-ccw", "s390x"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("vhost-user-fs-ccw-bootindex", "s390x"); DO_TEST_CAPS_LATEST("virtio-transitional"); DO_TEST_CAPS_LATEST("virtio-non-transitional"); -- 2.44.0

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> On 4/22/24 16:57, Peter Krempa wrote:
The CCW variant of the 'vhost-user-fs' device in qemu doesn't deliberately support the 'bootindex' attribute as the machine is unable to boot from such device.
Reject '<boot order' on non-PCI virtiofs, add tests validating that it's rejected as well as that virtiofs on PCI-based hosts but without address specified will be accepted.
Resolves:https://issues.redhat.com/browse/RHEL-22728 Signed-off-by: Peter Krempa<pkrempa@redhat.com> --- src/qemu/qemu_validate.c | 19 +++++++--- ...ost-user-fs-ccw-bootindex.s390x-latest.err | 1 + .../vhost-user-fs-ccw-bootindex.xml | 38 +++++++++++++++++++ ...vhost-user-fs-hugepages.x86_64-latest.args | 2 + .../vhost-user-fs-hugepages.x86_64-latest.xml | 8 ++++ .../vhost-user-fs-hugepages.xml | 8 ++++ tests/qemuxmlconftest.c | 1 + 7 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.s390x-latest.err create mode 100644 tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (2)
-
Boris Fiuczynski
-
Peter Krempa