[libvirt] [PATCH] rpc: daemon: Fix virtlog/virtlock daemon reload

Martin Kletzander mkletzan at redhat.com
Wed Apr 13 14:44:21 UTC 2016


On Wed, Apr 13, 2016 at 10:17:46AM -0400, Cole Robinson wrote:
>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(+)
>

I don't know why I expected the object to be deleted when we steal all
the keys =)  Sorry for that and thanks for this.  ACK.

>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,
>--
>2.7.3
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160413/d2248dba/attachment-0001.sig>


More information about the libvir-list mailing list