[libvirt] [PATCH] virt-admin: Call virInitialize to fix startup crash

Cole Robinson crobinso at redhat.com
Mon Jun 27 18:28:39 UTC 2016


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(+)

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))
-- 
2.7.4




More information about the libvir-list mailing list