This enum will shortly be used by the remote driver sockets helper
methods too.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/remote/remote_driver.c | 28 +++++++++++-----------------
src/remote/remote_sockets.h | 7 +++++++
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 0bacd0bc4b..6b615b9286 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -650,12 +650,6 @@ static virNetClientProgramEvent qemuEvents[] = {
(xdrproc_t)xdr_qemu_domain_monitor_event_msg },
};
-enum virDrvOpenRemoteFlags {
- VIR_DRV_OPEN_REMOTE_RO = (1 << 0),
- VIR_DRV_OPEN_REMOTE_USER = (1 << 1), /* Use the per-user socket path */
- VIR_DRV_OPEN_REMOTE_AUTOSTART = (1 << 2), /* Autostart a per-user daemon */
-};
-
static void
remoteClientCloseFunc(virNetClient *client G_GNUC_UNUSED,
@@ -789,7 +783,7 @@ doRemoteOpen(virConnectPtr conn,
/* Historically we didn't allow ssh tunnel with session mode,
* since we can't construct the accurate path remotely,
* so we can default to modern virt-ssh-helper */
- if (flags & VIR_DRV_OPEN_REMOTE_USER)
+ if (flags & REMOTE_DRIVER_OPEN_USER)
proxy = VIR_NET_CLIENT_PROXY_NATIVE;
else
proxy = VIR_NET_CLIENT_PROXY_AUTO;
@@ -923,8 +917,8 @@ doRemoteOpen(virConnectPtr conn,
case REMOTE_DRIVER_TRANSPORT_LIBSSH2:
if (!sockname &&
!(sockname = remoteGetUNIXSocket(transport, mode, driver_str,
- flags & VIR_DRV_OPEN_REMOTE_RO,
- flags & VIR_DRV_OPEN_REMOTE_USER,
+ flags & REMOTE_DRIVER_OPEN_RO,
+ flags & REMOTE_DRIVER_OPEN_USER,
&daemon_name)))
goto failed;
break;
@@ -986,7 +980,7 @@ doRemoteOpen(virConnectPtr conn,
netcat,
sockname,
name,
- flags & VIR_DRV_OPEN_REMOTE_RO,
+ flags & REMOTE_DRIVER_OPEN_RO,
auth,
conn->uri);
if (!priv->client)
@@ -1010,7 +1004,7 @@ doRemoteOpen(virConnectPtr conn,
netcat,
sockname,
name,
- flags & VIR_DRV_OPEN_REMOTE_RO,
+ flags & REMOTE_DRIVER_OPEN_RO,
auth,
conn->uri);
if (!priv->client)
@@ -1021,7 +1015,7 @@ doRemoteOpen(virConnectPtr conn,
#ifndef WIN32
case REMOTE_DRIVER_TRANSPORT_UNIX:
- if (flags & VIR_DRV_OPEN_REMOTE_AUTOSTART) {
+ if (flags & REMOTE_DRIVER_OPEN_AUTOSTART) {
const char *env_name = remoteGetDaemonPathEnv();
if (!(daemonPath = virFileFindResourceFull(daemon_name,
NULL, NULL,
@@ -1032,7 +1026,7 @@ doRemoteOpen(virConnectPtr conn,
}
if (!(priv->client = virNetClientNewUNIX(sockname,
- flags &
VIR_DRV_OPEN_REMOTE_AUTOSTART,
+ flags &
REMOTE_DRIVER_OPEN_AUTOSTART,
daemonPath)))
goto failed;
@@ -1054,7 +1048,7 @@ doRemoteOpen(virConnectPtr conn,
netcat,
sockname,
name,
- flags & VIR_DRV_OPEN_REMOTE_RO)))
+ flags & REMOTE_DRIVER_OPEN_RO)))
goto failed;
priv->is_secure = 1;
@@ -1277,13 +1271,13 @@ remoteConnectOpen(virConnectPtr conn,
goto cleanup;
if (flags & VIR_CONNECT_RO)
- rflags |= VIR_DRV_OPEN_REMOTE_RO;
+ rflags |= REMOTE_DRIVER_OPEN_RO;
remoteGetURIDaemonInfo(conn->uri, transport, &user, &autostart);
if (user)
- rflags |= VIR_DRV_OPEN_REMOTE_USER;
+ rflags |= REMOTE_DRIVER_OPEN_USER;
if (autostart)
- rflags |= VIR_DRV_OPEN_REMOTE_AUTOSTART;
+ rflags |= REMOTE_DRIVER_OPEN_AUTOSTART;
ret = doRemoteOpen(conn, priv, driver, transport, auth, conf, rflags);
if (ret != VIR_DRV_OPEN_SUCCESS) {
diff --git a/src/remote/remote_sockets.h b/src/remote/remote_sockets.h
index b3e0ce7da4..749389700e 100644
--- a/src/remote/remote_sockets.h
+++ b/src/remote/remote_sockets.h
@@ -48,6 +48,13 @@ typedef enum {
REMOTE_DRIVER_MODE_LAST
} remoteDriverMode;
+typedef enum {
+ REMOTE_DRIVER_OPEN_RO = (1 << 0), /* Use the read-only socket path */
+ REMOTE_DRIVER_OPEN_USER = (1 << 1), /* Use the per-user socket path */
+ REMOTE_DRIVER_OPEN_AUTOSTART = (1 << 2), /* Autostart a per-user daemon */
+} remoteDriverOpenFlags;
+
+
VIR_ENUM_DECL(remoteDriverMode);
int
--
2.31.1