int *tapfd,
unsigned int flags)
{
+ const char *const bridgeHelperDirs[] = {
+ "/usr/libexec",
+ "/usr/lib/qemu",
+ "/usr/lib",
+ NULL,
+ };
g_autoptr(virCommand) cmd = NULL;
+ g_autofree char *bridgeHelperPath = NULL;
char *errbuf = NULL, *cmdstr = NULL;
int pair[2] = { -1, -1 };
return -1;
}
- if (!virFileIsExecutable(cfg->bridgeHelperName)) {
+ bridgeHelperPath = virFindFileInPathFull(cfg->bridgeHelperName, bridgeHelperDirs);
+
+ if (!bridgeHelperPath) {
virReportSystemError(errno, _("'%1$s' is not a suitable bridge helper"),
cfg->bridgeHelperName);
return -1;
}
- cmd = virCommandNew(cfg->bridgeHelperName);
+ VIR_DEBUG("Using qemu-bridge-helper: %s", bridgeHelperPath);
+
+ cmd = virCommandNew(bridgeHelperPath);
if (flags & VIR_NETDEV_TAP_CREATE_VNET_HDR)
virCommandAddArgFormat(cmd, "--use-vnet");
virCommandAddArgFormat(cmd, "--br=%s", brname);
int
qemuProcessStartManagedPRDaemon(virDomainObj *vm)
{
+ const char *const prHelperDirs[] = {
+ "/usr/libexec",
+ NULL,
+ };
qemuDomainObjPrivate *priv = vm->privateData;
virQEMUDriver *driver = priv->driver;
g_autoptr(virQEMUDriverConfig) cfg = NULL;
int errfd = -1;
+ g_autofree char *prHelperPath = NULL;
g_autofree char *pidfile = NULL;
g_autofree char *socketPath = NULL;
pid_t cpid = -1;
cfg = virQEMUDriverGetConfig(driver);
- if (!virFileIsExecutable(cfg->prHelperName)) {
+ prHelperPath = virFindFileInPathFull(cfg->prHelperName, prHelperDirs);
+
+ if (!prHelperPath) {
virReportSystemError(errno, _("'%1$s' is not a suitable pr helper"),
cfg->prHelperName);
goto cleanup;
}
+ VIR_DEBUG("Using qemu-pr-helper: %s", prHelperPath);
+
if (!(pidfile = qemuProcessBuildPRHelperPidfilePath(vm)))
goto cleanup;
goto cleanup;
}
- if (!(cmd = virCommandNewArgList(cfg->prHelperName,
+ if (!(cmd = virCommandNewArgList(prHelperPath,
"-k", socketPath,
NULL)))
goto cleanup;
if (virPidFileReadPath(pidfile, &cpid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("pr helper %1$s didn't show up"),
- cfg->prHelperName);
+ prHelperPath);
goto cleanup;
}
if (saferead(errfd, errbuf, sizeof(errbuf) - 1) < 0) {
virReportSystemError(errno,
_("pr helper %1$s died unexpectedly"),
- cfg->prHelperName);
+ prHelperPath);
} else {
virReportError(VIR_ERR_OPERATION_FAILED,
_("pr helper died and reported: %1$s"), errbuf);