[libvirt PATCH 06/10] remote: don't populate daemon path if autostart is not required

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/remote/remote_sockets.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c
index 6d33b69467..cce6703e75 100644
--- a/src/remote/remote_sockets.c
+++ b/src/remote/remote_sockets.c
@@ -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),
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux