Our virBuildPath() constructs a path from given arguments.
Exactly like g_build_filename(), except the latter is more
generic as it uses backslashes on Windows. Therefore, replace the
former with the latter.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
g_autofree char *path = NULL;
g_autoptr(virCommand) cmd = NULL;
- virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr);
+ path = g_build_filename(LIBVIRT_HOOK_DIR, drvstr, NULL);
cmd = virCommandNew(path);
{
g_autofree char *path = NULL;
- virBuildPath(&path, SYSFS_FC_RPORT_PATH, rport);
+ path = g_build_filename(SYSFS_FC_RPORT_PATH, rport, NULL);
return virFileExists(path);
}
return -1;
}
- virBuildPath(&path, LIBVIRT_HOOK_DIR, driver);
+ path = g_build_filename(LIBVIRT_HOOK_DIR, driver, NULL);
if (!virFileExists(path)) {
VIR_DEBUG("No hook script %s", path);
if (extra == NULL)
extra = "-";
- virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr);
+ path = g_build_filename(LIBVIRT_HOOK_DIR, drvstr, NULL);
script_ret = 1;
*pf = NULL;
- virBuildPath(&device_link, vf_sysfs_path, "physfn");
+ device_link = g_build_filename(vf_sysfs_path, "physfn", NULL);
if ((*pf = virPCIGetDeviceAddressFromSysfsLink(device_link))) {
VIR_DEBUG("PF for VF device '%s': " VIR_PCI_DEVICE_ADDRESS_FMT,
return -1;
}
- virBuildPath(&pcidev_sysfs_net_path, device_link_sysfs_path, "net");
+ pcidev_sysfs_net_path = g_build_filename(device_link_sysfs_path, "net", NULL);
if (virDirOpenQuiet(&dir, pcidev_sysfs_net_path) < 0) {
/* this *isn't* an error - caller needs to check for netname == NULL */