From: Martin Kletzander Date: Tue, 3 Sep 2024 08:34:55 +0000 (+0200) Subject: network: Do not update network ports for inactive networks X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=97ed0574ea6c528aadbbbedf1f47bc4d909a0745;p=libvirt.git network: Do not update network ports for inactive networks 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 Reviewed-by: Laine Stump --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 915211d1b5..5b510a222c 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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)) {