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 <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Martin Kletzander 2024-09-03 10:34:55 +02:00
parent 02b57caf5e
commit 97ed0574ea

View File

@ -489,6 +489,7 @@ networkUpdateState(virNetworkObj *obj,
return -1;
}
if (virNetworkObjIsActive(obj))
virNetworkObjPortForEach(obj, networkUpdatePort, obj);
/* Try and read dnsmasq pids of active networks */