[libvirt] [PATCH 24/29] remote: open secondary drivers via remote driver if needed

Ján Tomko jtomko at redhat.com
Fri Jul 12 13:58:12 UTC 2019


On Thu, Jul 11, 2019 at 05:05:11PM +0100, Daniel P. Berrangé wrote:
>When the client has a connection to one of the hypervisor specific
>daemons (eg virtqemud), the app may still expect to use the secondary
>driver APIs (storage, network, etc). None of these will be registered in
>the hypervisor daemon, so we must explicitly open a connection to each
>of the daemons for the secondary drivers we need.
>
>Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
>---
> src/remote/remote_daemon_dispatch.c | 82 ++++++++++++++++++++++++-----
> 1 file changed, 69 insertions(+), 13 deletions(-)
>
>diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
>index 856c5e48e7..c8a605c709 100644
>--- a/src/remote/remote_daemon_dispatch.c
>+++ b/src/remote/remote_daemon_dispatch.c

[...]

>+        VIR_DEBUG("Secret driver found");
>+        priv->secretConn = virObjectRef(priv->conn);
>+    } else if (STREQ(type, "storage")) {
>+        VIR_DEBUG("Storage driver found");
>+        priv->storageConn = virObjectRef(priv->conn);
>+
>+        /* Co-open the secret driver, as apps using the storage driver may well
>+         * need access to secrets for storage auth
>+         */
>+        OPEN_DRIVER(secretConn, getuid == 0 ? "secret:///system" : "secret:///session");

getuid()

>+    } else {
>+#endif /* LIBVIRTD */
>+        VIR_DEBUG("Pointing secondary drivers to primary");
>+        priv->interfaceConn = virObjectRef(priv->conn);
>+        priv->networkConn = virObjectRef(priv->conn);
>+        priv->nodedevConn = virObjectRef(priv->conn);
>+        priv->nwfilterConn = virObjectRef(priv->conn);
>+        priv->secretConn = virObjectRef(priv->conn);
>+        priv->storageConn = virObjectRef(priv->conn);
>+#ifndef LIBVIRTD

Jano
-------------- 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/20190712/d6881917/attachment-0001.sig>


More information about the libvir-list mailing list