]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuValidateDomainDeviceDefNetwork: Require shared memory for all vhost-user interfaces
authorPeter Krempa <pkrempa@redhat.com>
Tue, 11 Mar 2025 08:01:12 +0000 (09:01 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 12 Mar 2025 11:56:58 +0000 (12:56 +0100)
Currently we produce only a warning into the log if a non-passt
vhost-user interface is configured with shared memory.

Since we do make it fatal with all other vhost-user types, fix the check
to trigger also for normal-vhost-user interfaces.

Since passt-based vhost-user interfaces are checked separately the check
will no longer be required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_validate.c
tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err

index f117441eceffddd712e408abb5821b9a09d9c66a..4ef944addb6b131d1039b1cb6581424cd69b6737 100644 (file)
@@ -1850,12 +1850,6 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
         return -1;
     }
 
-    if (net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
-        net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
-        if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "interface type=\"vhostuser\" backend type=\"passt\"") < 0)
-            return -1;
-    }
-
     if (net->type == VIR_DOMAIN_NET_TYPE_VDPA) {
         if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_VHOST_VDPA)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -1879,6 +1873,9 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
                            _("'reconnect' attribute is not supported when source mode='server' for <interface type='vhostuser'>"));
             return -1;
         }
+
+        if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "interface") < 0)
+            return -1;
     }
 
     if (!virDomainNetIsVirtioModel(net)) {
index 274af5c7228006bb56d58893941e1fc7616ec3ec..babde17518e87be9d86f94a16ca8a3259d4fc7ab 100644 (file)
@@ -1 +1 @@
-unsupported configuration: 'interface type="vhostuser" backend type="passt"' requires shared memory
+unsupported configuration: 'interface' requires shared memory