Throughout all of our network driver code we assume that
dnsmasqPid of value -1 means the network has no dnsmasq process
running. There are plenty of calls to:
virNetworkObjSetDnsmasqPid(obj, -1);
or:
pid_t dnsmasqPid = virNetworkObjGetDnsmasqPid(obj);
if (dnsmasqPid > 0) ...;
Now, a virNetworkObj is created via virNetworkObjNew() which
might as well set this de-facto default value.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/virnetworkobj.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c
index 1726fc381f..b8b86da06f 100644
--- a/src/conf/virnetworkobj.c
+++ b/src/conf/virnetworkobj.c
@@ -117,6 +117,7 @@ virNetworkObjNew(void)
ignore_value(virBitmapSetBit(obj->classIdMap, 2));
obj->ports = virHashNew(virNetworkObjPortFree);
+ obj->dnsmasqPid = (pid_t)-1;
virObjectLock(obj);
--
2.39.2