From 002f0ff4f3f0a52891336d089b7d7a320b5e1822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Mon, 24 May 2021 12:23:12 +0100 Subject: [PATCH] remote: use virtproxyd if no URI is given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- src/remote/remote_sockets.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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); + 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"); - - if (driver) - direct_sock_name = remoteGetUNIXSocketHelper(transport, direct_daemon, flags); - 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;