diff mbox

rpc: daemon: Fix virtlog/virtlock daemon reload

Message ID 0160acc9af83740242aa6e773e117e1b05753474.1460557066.git.crobinso@redhat.com
State Accepted
Commit 9b69f02243f2abec4170576dfe28f8a4bb398b4e
Headers show

Commit Message

Cole Robinson April 13, 2016, 2:17 p.m. UTC
Trying to reload/SIGUSR1 virtlogd or virtlockd fails with:

error : virNetDaemonRun:747 : internal error: Not all servers restored, cannot run server

Commit 252610f7 changed the daemon state json to allow tracking
multiple servers. However it missed clearing dmn->srvObject after
the json is empty, like the previous code paths handled.  Later on in
virNewDaemonRun, dmn->srvObject is expected to be empty otherwise we
throw the above error.

https://bugzilla.redhat.com/show_bug.cgi?id=1311013
---
 src/rpc/virnetdaemon.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.7.3

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

Patch

diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index c99914d..dcc89fa 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -293,6 +293,10 @@  virNetDaemonAddServerPostExec(virNetDaemonPtr dmn,
             goto error;
         }
 
+        if (virJSONValueObjectKeysNumber(dmn->srvObject) == 0) {
+            virJSONValueFree(dmn->srvObject);
+            dmn->srvObject = NULL;
+        }
     }
 
     srv = virNetServerNewPostExecRestart(object,