From patchwork Mon Jun 27 18:28:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 70949 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1205260qgy; Mon, 27 Jun 2016 11:32:47 -0700 (PDT) X-Received: by 10.55.128.198 with SMTP id b189mr23790200qkd.76.1467052365830; Mon, 27 Jun 2016 11:32:45 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id u126si18349683qkf.254.2016.06.27.11.32.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jun 2016 11:32:45 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 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 mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5RISgK9035442; Mon, 27 Jun 2016 14:28:43 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u5RISf6U029612 for ; Mon, 27 Jun 2016 14:28:41 -0400 Received: from colepc.redhat.com (ovpn-116-79.rdu2.redhat.com [10.10.116.79]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5RISeu8004400; Mon, 27 Jun 2016 14:28:41 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 27 Jun 2016 14:28:39 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virt-admin: Call virInitialize to fix startup crash 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 Similar to what virsh and virt-login-shell do https://bugzilla.redhat.com/show_bug.cgi?id=1350315 --- I can't actually reproduce the bug, the backtrace is similar to 97973ebb7 which added the same fix for virt-login-shell, and that commit also mentions the randomness of reproducing... tools/virt-admin.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 4acac65..7bff5c3 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1371,6 +1371,11 @@ main(int argc, char **argv) return EXIT_FAILURE; } + if (virInitialize() < 0) { + vshError(ctl, "%s", _("Failed to initialize libvirt")); + return EXIT_FAILURE; + } + virFileActivateDirOverride(argv[0]); if (!vshInit(ctl, cmdGroups, NULL))