From 5903e6d5414b1a9580a63c29afff1788cec6c91e Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Mon, 12 Dec 2016 16:07:25 +0100 Subject: [PATCH] virt plugin: fail init with no libvirt connection Even though we handle disconnection and reconnection in the read() callback, we expect the libvirt connection to be available most of the time, including the init() stage. Thus, let's fail init() if the connection is not available. Signed-off-by: Francesco Romani --- src/virt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/virt.c b/src/virt.c index 242d0d33..93f9aee3 100644 --- a/src/virt.c +++ b/src/virt.c @@ -740,7 +740,8 @@ static int lv_init(void) { if (virInitialize() != 0) return -1; - lv_connect(); + if (lv_connect() != 0) + return -1; DEBUG(PLUGIN_NAME " plugin: starting %i instances", nr_instances); -- 2.11.0