]> xenbits.xensource.com Git - libvirt.git/commitdiff
drivers: use g_strdup in probe functions
authorJán Tomko <jtomko@redhat.com>
Sun, 20 Oct 2019 10:41:35 +0000 (12:41 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 21 Oct 2019 10:51:55 +0000 (12:51 +0200)
The callers expect '1' on a successful probe,
so return 1 just like VIR_STRDUP would.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/bhyve/bhyve_driver.c
src/libxl/libxl_driver.c
src/lxc/lxc_driver.c
src/openvz/openvz_driver.c
src/vbox/vbox_common.c

index 52e1895052e2c6a5c0dcf2f811afbd749bc580dd..db3d71f2b211ce61c47177078c5a1f84a2d304ee 100644 (file)
@@ -185,7 +185,8 @@ bhyveConnectURIProbe(char **uri)
     if (bhyve_driver == NULL)
         return 0;
 
-    return VIR_STRDUP(*uri, "bhyve:///system");
+    *uri = g_strdup("bhyve:///system");
+    return 1;
 }
 
 
index 14bd62b383f707897ccd9c9ccd12016975981c48..eaa35481ed6cea3b119d5a970289afc49401716d 100644 (file)
@@ -855,7 +855,8 @@ libxlConnectURIProbe(char **uri)
     if (libxl_driver == NULL)
         return 0;
 
-    return VIR_STRDUP(*uri, "xen:///system");
+    *uri = g_strdup("xen:///system");
+    return 1;
 }
 
 
index 7c2e6cf56126d5a6b129cd169fe411e63a7d43c1..65d17aba8e164e514fa3eec0430031ab0dd96f5c 100644 (file)
@@ -128,7 +128,8 @@ lxcConnectURIProbe(char **uri)
     if (lxc_driver == NULL)
         return 0;
 
-    return VIR_STRDUP(*uri, "lxc:///system");
+    *uri = g_strdup("lxc:///system");
+    return 1;
 }
 
 
index d1153edd009c105197f98643b154facb13d6653e..bf399986a74e60abd1a6f32e08fb0bc9c0fdb8e6 100644 (file)
@@ -1317,7 +1317,8 @@ openvzConnectURIProbe(char **uri)
     if (access("/proc/vz", W_OK) < 0)
         return 0;
 
-    return VIR_STRDUP(*uri, "openvz:///system");
+    *uri = g_strdup("openvz:///system");
+    return 1;
 }
 
 
index 02c0a894e7124676f38083f75443698b4003bcd3..94a79bde643af3bcd8b4f2c7effa4207d6ac90f2 100644 (file)
@@ -502,7 +502,8 @@ vboxAttachStorageControllers(virDomainDefPtr def,
 static int
 vboxConnectURIProbe(char **uri)
 {
-    return VIR_STRDUP(*uri, geteuid() ? "vbox:///session" : "vbox:///system");
+    *uri = g_strdup(geteuid() ? "vbox:///session" : "vbox:///system");
+    return 1;
 }