From patchwork Wed Apr 13 14:17:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 65725 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp38820qge; Wed, 13 Apr 2016 07:20:43 -0700 (PDT) X-Received: by 10.194.90.76 with SMTP id bu12mr10065373wjb.79.1460557242944; Wed, 13 Apr 2016 07:20:42 -0700 (PDT) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id sb1si40063683wjb.43.2016.04.13.07.20.42 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 13 Apr 2016 07:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3DEHskb006583; Wed, 13 Apr 2016 10:17:55 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3DEHq7n014589 for ; Wed, 13 Apr 2016 10:17:52 -0400 Received: from colepc.redhat.com (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3DEHpc2007649; Wed, 13 Apr 2016 10:17:51 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 13 Apr 2016 10:17:46 -0400 Message-Id: <0160acc9af83740242aa6e773e117e1b05753474.1460557066.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] rpc: daemon: Fix virtlog/virtlock daemon reload X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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 --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,