mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
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:
parent
ea5bb994cb
commit
94c98eb550
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user