[PATCH v3 2/2] virtlogd: add missing netserver refcount increment on reload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After virNetDaemonAddServerPostExec call in virtlogd we should have
netserver refcount set to 2. One goes to netdaemon servers hashtable
and one goes to virtlogd own reference to netserver. Let's add
missing increment in virNetDaemonAddServerPostExec itself while holding
daemon lock.

We also have to unref new extra ref after virtlockd call to virNetDaemonAddServerPostExec.
---
 src/locking/lock_daemon.c | 1 +
 src/rpc/virnetdaemon.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index fe3eaf9..41a06b2 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -275,6 +275,7 @@ virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged)
                                               virLockDaemonClientFree,
                                               (void*)(intptr_t)(privileged ? 0x1 : 0x0))))
         goto error;
+    virObjectUnref(srv);
 
     return lockd;
 
diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index 495bc4b..f3e3ffe 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -312,6 +312,7 @@ virNetDaemonAddServerPostExec(virNetDaemonPtr dmn,
 
     if (virHashAddEntry(dmn->servers, serverName, srv) < 0)
         goto error;
+    virObjectRef(srv);
 
     virJSONValueFree(object);
     virObjectUnlock(dmn);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux