]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
remote: don't populate daemon path if autostart is not required
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 24 May 2021 13:58:12 +0000 (14:58 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 4 Jun 2021 10:42:59 +0000 (11:42 +0100)
When deciding what socket to connect to, we build the daemon path
that we need to autostart. This path only needs to be populated
if we actually intend to use autostart.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/remote/remote_sockets.c

index 6d33b69467192d83e845f359b39e91555e8654f1..cce6703e75ec25ef7fb9099a12205c8de4fe2488 100644 (file)
@@ -232,12 +232,16 @@ remoteGetUNIXSocket(remoteDriverTransport transport,
         return NULL;
     }
 
-    if (!(*daemon_path = virFileFindResourceFull(daemon_name,
-                                                 NULL, NULL,
-                                                 abs_top_builddir "/src",
-                                                 SBINDIR,
-                                                 env_name)))
-        return NULL;
+    if (flags & REMOTE_DRIVER_OPEN_AUTOSTART) {
+        if (!(*daemon_path = virFileFindResourceFull(daemon_name,
+                                                     NULL, NULL,
+                                                     abs_top_builddir "/src",
+                                                     SBINDIR,
+                                                     env_name)))
+            return NULL;
+    } else {
+        *daemon_path = NULL;
+    }
 
     VIR_DEBUG("Chosen UNIX sockname=%s daemon_path=%s with mode=%s",
               sock_name, NULLSTR(*daemon_path),