Re: [PATCH 3/3] qemu_validate: Reject virtiofs with bootindex on s390x with CCW

2024-04-22 Thread Boris Fiuczynski

Reviewed-by: Boris Fiuczynski 

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 'https://issues.redhat.com/browse/RHEL-22728
Signed-off-by: Peter Krempa
---
  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
___
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-le...@lists.libvirt.org


[PATCH 3/3] qemu_validate: Reject virtiofs with bootindex on s390x with CCW

2024-04-22 Thread Peter Krempa
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 'https://issues.redhat.com/browse/RHEL-22728
Signed-off-by: Peter Krempa 
---
 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 00..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 00..833b91d574
--- /dev/null
+++ b/tests/qemuxmlconfdata/vhost-user-fs-ccw-bootindex.xml
@@ -0,0 +1,38 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219136
+  1
+  
+
+  
+  
+hvm
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-s390x
+
+  
+  
+  
+  
+
+
+
+  
+
+
+
+  
+  
+  
+  
+  
+
+  
+
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 @@
   
   
 
+
+  
+  
+  
+  
+  
+  
+
 
 
 
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
@@