mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
conf: Initialize _virNetworkObj::dnsmasqPid to -1 in virNetworkObjNew()
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
212dfa94ee
commit
004d5141c5
@ -117,6 +117,7 @@ virNetworkObjNew(void)
|
||||
ignore_value(virBitmapSetBit(obj->classIdMap, 2));
|
||||
|
||||
obj->ports = virHashNew(virNetworkObjPortFree);
|
||||
obj->dnsmasqPid = (pid_t)-1;
|
||||
|
||||
virObjectLock(obj);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user