drivers: use g_strdup in probe functions

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>
This commit is contained in:
Ján Tomko 2019-10-20 12:41:35 +02:00
parent ea5bb994cb
commit 94c98eb550
5 changed files with 10 additions and 5 deletions

View 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;
}

View 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;
}

View 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;
}

View 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;
}

View 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;
}