if (!(priv = virObjectLockableNew(remoteAdminPrivClass)))
goto error;
- if (!(priv->client = virNetClientNewUNIX(sock_path, false, NULL)))
+ if (!(priv->client = virNetClientNewUNIX(sock_path, NULL)))
goto error;
if (!(priv->program = virNetClientProgramNew(ADMIN_PROGRAM,
goto error;
if (!(client = virNetClientNewUNIX(lockdpath,
- daemonPath != NULL,
daemonPath)))
goto error;
goto error;
if (!(client = virNetClientNewUNIX(logdpath,
- daemonPath != NULL,
daemonPath)))
goto error;
sockpath = g_strdup_printf("%s/%s.sock", socketdir, vm->def->name);
- if (!(mon->client = virNetClientNewUNIX(sockpath, false, NULL)))
+ if (!(mon->client = virNetClientNewUNIX(sockpath, NULL)))
goto error;
if (virNetClientRegisterAsyncIO(mon->client) < 0)
break;
case MIGRATION_DEST_CONNECT_SOCKET:
if (virNetSocketNewConnectUNIX(spec->dest.socket.path,
- false, NULL,
- &sock) == 0) {
+ NULL, &sock) == 0) {
fd_qemu = virNetSocketDupFD(sock, true);
virObjectUnref(sock);
}
#ifndef WIN32
case REMOTE_DRIVER_TRANSPORT_UNIX:
if (!(priv->client = virNetClientNewUNIX(sockname,
- flags & REMOTE_DRIVER_OPEN_AUTOSTART,
daemon_path)))
goto failed;
flags,
&daemon_path);
- if (virNetSocketNewConnectUNIX(sock_path, flags & REMOTE_DRIVER_OPEN_AUTOSTART,
- daemon_path, &sock) < 0) {
+ if (virNetSocketNewConnectUNIX(sock_path, daemon_path, &sock) < 0) {
g_printerr(_("%s: cannot connect to '%s': %s\n"),
argv[0], sock_path, virGetLastErrorMessage());
exit(EXIT_FAILURE);
virNetClient *virNetClientNewUNIX(const char *path,
- bool spawnDaemon,
- const char *binary)
+ const char *spawnDaemonPath)
{
virNetSocket *sock;
- if (virNetSocketNewConnectUNIX(path, spawnDaemon, binary, &sock) < 0)
+ if (virNetSocketNewConnectUNIX(path, spawnDaemonPath, &sock) < 0)
return NULL;
return virNetClientNew(sock, NULL);
bool readonly);
virNetClient *virNetClientNewUNIX(const char *path,
- bool spawnDaemon,
- const char *binary);
+ const char *spawnDaemonPath);
virNetClient *virNetClientNewTCP(const char *nodename,
const char *service,
#ifndef WIN32
int virNetSocketNewConnectUNIX(const char *path,
- bool spawnDaemon,
- const char *binary,
+ const char *spawnDaemonPath,
virNetSocket **retsock)
{
char *lockpath = NULL;
int ret = -1;
bool daemonLaunched = false;
- VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon,
- NULLSTR(binary));
+ VIR_DEBUG("path=%s spawnDaemonPath=%s", path, NULLSTR(spawnDaemonPath));
memset(&localAddr, 0, sizeof(localAddr));
memset(&remoteAddr, 0, sizeof(remoteAddr));
remoteAddr.len = sizeof(remoteAddr.data.un);
- if (spawnDaemon) {
- g_autofree char *binname = NULL;
-
- if (!binary) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Auto-spawn of daemon requested, "
- "but no binary specified"));
- goto cleanup;
- }
-
- binname = g_path_get_basename(binary);
+ if (spawnDaemonPath) {
+ g_autofree char *binname = g_path_get_basename(spawnDaemonPath);
rundir = virGetUserRuntimeDirectory();
if (g_mkdir_with_parents(rundir, 0700) < 0) {
VIR_DEBUG("connect() failed: retries=%d errno=%d", retries, errno);
retries--;
- if (!spawnDaemon ||
+ if (!spawnDaemonPath ||
retries == 0 ||
(errno != ENOENT && errno != ECONNREFUSED)) {
virReportSystemError(errno, _("Failed to connect socket to '%s'"),
}
if (!daemonLaunched) {
- if (virNetSocketForkDaemon(binary) < 0)
+ if (virNetSocketForkDaemon(spawnDaemonPath) < 0)
goto cleanup;
daemonLaunched = true;
}
#else
int virNetSocketNewConnectUNIX(const char *path G_GNUC_UNUSED,
- bool spawnDaemon G_GNUC_UNUSED,
- const char *binary G_GNUC_UNUSED,
+ const char *spawnDaemonPath,
virNetSocket **retsock G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
virNetSocket **addr);
int virNetSocketNewConnectUNIX(const char *path,
- bool spawnDaemon,
- const char *binary,
+ const char *spawnDaemonPath,
virNetSocket **addr);
int virNetSocketNewConnectCommand(virCommand *cmd,
virNetSocket *csock = NULL;
if (data->path) {
- if (virNetSocketNewConnectUNIX(data->path, false,
+ if (virNetSocketNewConnectUNIX(data->path,
NULL, &csock) < 0)
return;
} else {
if (virNetSocketListen(lsock, 0) < 0)
goto cleanup;
- if (virNetSocketNewConnectUNIX(path, false, NULL, &csock) < 0)
+ if (virNetSocketNewConnectUNIX(path, NULL, &csock) < 0)
goto cleanup;
if (STRNEQ(virNetSocketLocalAddrStringSASL(csock), "127.0.0.1;0")) {