]> xenbits.xensource.com Git - libvirt.git/commitdiff
network: Do not update network ports for inactive networks
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 3 Sep 2024 08:34:55 +0000 (10:34 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 17 Sep 2024 07:40:34 +0000 (09:40 +0200)
The semantic does not change since inside networkUpdatePort() (well,
networkNotifyPort, for which the former is a wrapper) exits for inactive
networks, but with an error we can easily avoid with this patch.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/network/bridge_driver.c

index 915211d1b590424384aaea029a1a18487d17149d..5b510a222cd2792ef3c12dc66d888a2179ca499b 100644 (file)
@@ -489,7 +489,8 @@ networkUpdateState(virNetworkObj *obj,
         return -1;
     }
 
-    virNetworkObjPortForEach(obj, networkUpdatePort, obj);
+    if (virNetworkObjIsActive(obj))
+        virNetworkObjPortForEach(obj, networkUpdatePort, obj);
 
     /* Try and read dnsmasq pids of active networks */
     if (virNetworkObjIsActive(obj) && def->ips && (def->nips > 0)) {