]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_extdevice: Make qemuExtDevicesHasDevice() check def->nets
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 13 Feb 2023 15:01:32 +0000 (16:01 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Feb 2023 15:21:26 +0000 (16:21 +0100)
We can have external helper processes running for domain
<interface/> too (e.g. slirp or passt). But this is not reflected
in qemuExtDevicesHasDevice() which simply ignores these.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/qemu/qemu_extdevice.c

index fdefe59215c476de3beee04c4577bfb684eea9d2..47e97f35655240fa4b8a9e4115a2fe26d1418071 100644 (file)
@@ -296,6 +296,17 @@ qemuExtDevicesHasDevice(virDomainDef *def)
             return true;
     }
 
+    for (i = 0; i < def->nnets; i++) {
+        virDomainNetDef *net = def->nets[i];
+
+        if (QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp)
+            return true;
+
+        if (net->type == VIR_DOMAIN_NET_TYPE_USER &&
+            net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST)
+            return true;
+    }
+
     for (i = 0; i < def->ntpms; i++) {
         if (def->tpms[i]->type == VIR_DOMAIN_TPM_TYPE_EMULATOR)
             return true;