[libvirt PATCH 05/10] remote: change socket helper to return full daemon path

Ján Tomko jtomko at jtomko.net
Wed May 26 15:20:02 UTC 2021


On a Wednesday in 2021, Daniel P. Berrangé wrote:
>The remoteGetUNIXSocket method currently just returns the daemon name
>and the caller then converts this to a path. Except the SSH helper
>didn't do this, so it was relying on later code expanding $PATH, and
>this doesn't allow for build root overrides.
>
>Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
>---
> src/remote/remote_driver.c     | 33 +++-------------------------
> src/remote/remote_sockets.c    | 39 +++++++++++++++++++++++++++++-----
> src/remote/remote_sockets.h    |  2 +-
> src/remote/remote_ssh_helper.c |  6 +++---
> 4 files changed, 41 insertions(+), 39 deletions(-)
>
>diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
>index d03369b168..e4e412dd01 100644
>--- a/src/remote/remote_driver.c
>+++ b/src/remote/remote_driver.c
>@@ -1013,19 +996,9 @@ doRemoteOpen(virConnectPtr conn,
>
> #ifndef WIN32
>     case REMOTE_DRIVER_TRANSPORT_UNIX:
>-        if (flags & REMOTE_DRIVER_OPEN_AUTOSTART) {
>-            const char *env_name = remoteGetDaemonPathEnv();
>-            if (!(daemonPath = virFileFindResourceFull(daemon_name,
>-                                                       NULL, NULL,
>-                                                       abs_top_builddir "/src",
>-                                                       SBINDIR,
>-                                                       env_name)))
>-                goto failed;
>-        }
>-
>         if (!(priv->client = virNetClientNewUNIX(sockname,
>                                                  flags & REMOTE_DRIVER_OPEN_AUTOSTART,
>-                                                 daemonPath)))
>+                                                 daemon_path)))

This removes the last usage of daemonPath in this function:

src/remote/remote_driver.c:733:22: error: unused variable 'daemonPath' [-Werror,-Wunused-variable]
     g_autofree char *daemonPath = NULL;

Jano

>             goto failed;
>
>         priv->is_secure = 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210526/dd2e5e68/attachment-0001.sig>


More information about the libvir-list mailing list