virt plugin: Use lv_disconnect on shutdown
authorFrancesco Romani <fromani@redhat.com>
Tue, 13 Dec 2016 15:34:24 +0000 (16:34 +0100)
committerFrancesco Romani <fromani@redhat.com>
Tue, 13 Dec 2016 15:34:42 +0000 (16:34 +0100)
Avoiding duplication of the code and let's use
the new lv_disconnect() helper in the lv_shutdown() callback.

Signed-off-by: Francesco Romani <fromani@redhat.com>
src/virt.c

index 471bdd7..4dce6e0 100644 (file)
@@ -1178,9 +1178,7 @@ static int lv_shutdown(void) {
     lv_fini_instance(i);
   }
 
-  if (conn != NULL)
-    virConnectClose(conn);
-  conn = NULL;
+  lv_disconnect();
 
   ignorelist_free(il_domains);
   il_domains = NULL;