]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
call virDomainNetNotifyActualDevice() for all interface types
authorLaine Stump <laine@redhat.com>
Fri, 8 Jan 2021 05:36:31 +0000 (00:36 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 8 Jan 2021 16:34:49 +0000 (11:34 -0500)
Now that this function can be called regardless of interface type (and
whether or not we have a conn for the network driver), let's actually
call it for all interface types. This will assure that we re-connect
any disconnected bridge devices for <interface type='bridge'> as
mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1730084#c26
(until now we've only been reconnecting bridge devices for <interface
type='network'>)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/libxl/libxl_driver.c
src/lxc/lxc_process.c
src/qemu/qemu_process.c

index d58af1a869ce46f0673c21358f49c567ec4e4332..40d8c3d174891c1247212e4ca0b20c25b95d9627 100644 (file)
@@ -367,11 +367,10 @@ libxlReconnectNotifyNets(virDomainDefPtr def)
         if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT)
             virNetDevReserveName(net->ifname);
 
-        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
-            if (!conn && !(conn = virGetConnectNetwork()))
-                continue;
-            virDomainNetNotifyActualDevice(conn, def, net);
-        }
+        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK && !conn)
+            conn = virGetConnectNetwork();
+
+        virDomainNetNotifyActualDevice(conn, def, net);
     }
 
     virObjectUnref(conn);
index 2266e2cc402ef98bbe20765f102148f1de2a045a..0b6895bbd49cba6e14375f681568ca5a4c9ce52d 100644 (file)
@@ -1663,11 +1663,10 @@ virLXCProcessReconnectNotifyNets(virDomainDefPtr def)
             break;
         }
 
-        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
-            if (!conn && !(conn = virGetConnectNetwork()))
-                continue;
-            virDomainNetNotifyActualDevice(conn, def, net);
-        }
+        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK && !conn)
+            conn = virGetConnectNetwork();
+
+        virDomainNetNotifyActualDevice(conn, def, net);
     }
 
     virObjectUnref(conn);
index f0a698ba3d85104a850b495c54c68bf23707386c..202d867289a04e5d08abfec8b98037328c4a1499 100644 (file)
@@ -3411,11 +3411,10 @@ qemuProcessNotifyNets(virDomainDefPtr def)
             break;
         }
 
-        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
-            if (!conn && !(conn = virGetConnectNetwork()))
-                continue;
-            virDomainNetNotifyActualDevice(conn, def, net);
-        }
+        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK && !conn)
+            conn = virGetConnectNetwork();
+
+        virDomainNetNotifyActualDevice(conn, def, net);
     }
 }