From: Martin Kletzander Date: Tue, 3 Sep 2024 07:07:54 +0000 (+0200) Subject: network: Try to read dnsmasq PIDs for inactive networks too X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=74a22c09be73ed536b677e5db3a50d00540683f6;p=libvirt.git network: Try to read dnsmasq PIDs for inactive networks too Just in case one needs a clean up. Resolves: https://issues.redhat.com/browse/RHEL-50968 Signed-off-by: Martin Kletzander Reviewed-by: Laine Stump --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index ebdb39d074..3ef3444da2 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -492,8 +492,9 @@ networkUpdateState(virNetworkObj *obj, if (virNetworkObjIsActive(obj)) virNetworkObjPortForEach(obj, networkUpdatePort, obj); - /* Try and read dnsmasq pids of active networks */ - if (virNetworkObjIsActive(obj) && def->ips && (def->nips > 0)) { + /* Try and read dnsmasq pids of both active and inactive networks, just in + * case a network became inactive and we need to clean up. */ + if (def->ips && (def->nips > 0)) { const char *binpath = NULL; pid_t dnsmasqPid;