The remoteDriverTransport and remoteDriverMode enums are going to be
needed by source files beyond the remote driver client.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/remote/Makefile.inc.am | 2 ++
src/remote/remote_driver.c | 41 +-----------------------------
src/remote/remote_sockets.c | 39 +++++++++++++++++++++++++++++
src/remote/remote_sockets.h | 50 +++++++++++++++++++++++++++++++++++++
4 files changed, 92 insertions(+), 40 deletions(-)
create mode 100644 src/remote/remote_sockets.c
create mode 100644 src/remote/remote_sockets.h
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 80f4aad782..2191e5b900 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -13,6 +13,8 @@ REMOTE_DRIVER_GENERATED = \
$(NULL)
REMOTE_DRIVER_SOURCES = \
+ remote/remote_sockets.c \
+ remote/remote_sockets.h \
remote/remote_driver.c \
remote/remote_driver.h \
$(NULL)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index c8f5858bd1..30dea6c1ea 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -38,6 +38,7 @@
#include "virbuffer.h"
#include "remote_driver.h"
#include "remote_protocol.h"
+#include "remote_sockets.h"
#include "lxc_protocol.h"
#include "qemu_protocol.h"
#include "viralloc.h"
@@ -54,46 +55,6 @@
VIR_LOG_INIT("remote.remote_driver");
-typedef enum {
- REMOTE_DRIVER_TRANSPORT_TLS,
- REMOTE_DRIVER_TRANSPORT_UNIX,
- REMOTE_DRIVER_TRANSPORT_SSH,
- REMOTE_DRIVER_TRANSPORT_LIBSSH2,
- REMOTE_DRIVER_TRANSPORT_EXT,
- REMOTE_DRIVER_TRANSPORT_TCP,
- REMOTE_DRIVER_TRANSPORT_LIBSSH,
-
- REMOTE_DRIVER_TRANSPORT_LAST,
-} remoteDriverTransport;
-
-VIR_ENUM_DECL(remoteDriverTransport);
-VIR_ENUM_IMPL(remoteDriverTransport,
- REMOTE_DRIVER_TRANSPORT_LAST,
- "tls",
- "unix",
- "ssh",
- "libssh2",
- "ext",
- "tcp",
- "libssh");
-
-typedef enum {
- /* Try to figure out the "best" choice magically */
- REMOTE_DRIVER_MODE_AUTO,
- /* Always use the legacy libvirtd */
- REMOTE_DRIVER_MODE_LEGACY,
- /* Always use the per-driver virt*d daemons */
- REMOTE_DRIVER_MODE_DIRECT,
-
- REMOTE_DRIVER_MODE_LAST
-} remoteDriverMode;
-
-VIR_ENUM_DECL(remoteDriverMode);
-VIR_ENUM_IMPL(remoteDriverMode,
- REMOTE_DRIVER_MODE_LAST,
- "auto",
- "legacy",
- "direct");
#if SIZEOF_LONG < 8
# define HYPER_TO_TYPE(_type, _to, _from) \
diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c
new file mode 100644
index 0000000000..0662cbad14
--- /dev/null
+++ b/src/remote/remote_sockets.c
@@ -0,0 +1,39 @@
+/*
+ * remote_sockets.c: helpers for getting remote driver socket paths
+ *
+ * Copyright (C) 2007-2019 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <
http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+
+#include "remote_sockets.h"
+
+VIR_ENUM_IMPL(remoteDriverTransport,
+ REMOTE_DRIVER_TRANSPORT_LAST,
+ "tls",
+ "unix",
+ "ssh",
+ "libssh2",
+ "ext",
+ "tcp",
+ "libssh");
+
+VIR_ENUM_IMPL(remoteDriverMode,
+ REMOTE_DRIVER_MODE_LAST,
+ "auto",
+ "legacy",
+ "direct");
diff --git a/src/remote/remote_sockets.h b/src/remote/remote_sockets.h
new file mode 100644
index 0000000000..1d4ae3f9c1
--- /dev/null
+++ b/src/remote/remote_sockets.h
@@ -0,0 +1,50 @@
+/*
+ * remote_sockets.h: helpers for getting remote driver socket paths
+ *
+ * Copyright (C) 2007-2020 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <
http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "virenum.h"
+
+typedef enum {
+ REMOTE_DRIVER_TRANSPORT_TLS,
+ REMOTE_DRIVER_TRANSPORT_UNIX,
+ REMOTE_DRIVER_TRANSPORT_SSH,
+ REMOTE_DRIVER_TRANSPORT_LIBSSH2,
+ REMOTE_DRIVER_TRANSPORT_EXT,
+ REMOTE_DRIVER_TRANSPORT_TCP,
+ REMOTE_DRIVER_TRANSPORT_LIBSSH,
+
+ REMOTE_DRIVER_TRANSPORT_LAST,
+} remoteDriverTransport;
+
+VIR_ENUM_DECL(remoteDriverTransport);
+
+typedef enum {
+ /* Try to figure out the "best" choice magically */
+ REMOTE_DRIVER_MODE_AUTO,
+ /* Always use the legacy libvirtd */
+ REMOTE_DRIVER_MODE_LEGACY,
+ /* Always use the per-driver virt*d daemons */
+ REMOTE_DRIVER_MODE_DIRECT,
+
+ REMOTE_DRIVER_MODE_LAST
+} remoteDriverMode;
+
+VIR_ENUM_DECL(remoteDriverMode);
--
2.26.2