From: Daniel P. Berrangé Date: Mon, 24 May 2021 11:23:12 +0000 (+0100) Subject: remote: use virtproxyd if no URI is given X-Git-Tag: v7.5.0-rc1~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=002f0ff4f3f0a52891336d089b7d7a320b5e1822;p=thirdparty%2Flibvirt.git remote: use virtproxyd if no URI is given When the default driver mode requests the modular daemons, we still defaulted to spawning libvirtd if the URI was NULL, because we don't know which driver specific daemon to spawn. virtproxyd has logic that can handle this as it is used for compatibility when accepting incoming TCP connections with a NULL URI. Reviewed-by: Ján Tomko Signed-off-by: Daniel P. Berrangé --- diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c index cce6703e75..ed4e4a329c 100644 --- a/src/remote/remote_sockets.c +++ b/src/remote/remote_sockets.c @@ -171,14 +171,15 @@ remoteGetUNIXSocket(remoteDriverTransport transport, remoteDriverModeTypeToString(mode), driver, flags); - if (driver) + if (driver) { direct_daemon = g_strdup_printf("virt%sd", driver); - - legacy_daemon = g_strdup("libvirtd"); - - if (driver) direct_sock_name = remoteGetUNIXSocketHelper(transport, direct_daemon, flags); + } else { + direct_daemon = g_strdup("virtproxyd"); + direct_sock_name = remoteGetUNIXSocketHelper(transport, "libvirt", flags); + } + legacy_daemon = g_strdup("libvirtd"); legacy_sock_name = remoteGetUNIXSocketHelper(transport, "libvirt", flags); if (mode == REMOTE_DRIVER_MODE_AUTO) { @@ -187,14 +188,12 @@ remoteGetUNIXSocket(remoteDriverTransport transport, mode = REMOTE_DRIVER_MODE_DIRECT; } else if (virFileExists(legacy_sock_name)) { mode = REMOTE_DRIVER_MODE_LEGACY; - } else if (driver) { + } else { /* * This constant comes from the configure script and * maps to either the direct or legacy mode constant */ mode = REMOTE_DRIVER_MODE_DEFAULT; - } else { - mode = REMOTE_DRIVER_MODE_LEGACY; } } else { mode = REMOTE_DRIVER_MODE_LEGACY;