[PATCH v3 05/11] admin: Do not generate remoteAdminConnect{Open, Close}

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

 



As we plan to add more and more logic to remote connecting methods,
these cannot be generated from admin_protocol.x anymore. Instead,
this patch implements these to methods explicitly.
---
 src/admin/admin_protocol.x |  4 ++--
 src/admin/admin_remote.c   | 45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/src/admin/admin_protocol.x b/src/admin/admin_protocol.x
index cfc92ff..d0ca1a3 100644
--- a/src/admin/admin_protocol.x
+++ b/src/admin/admin_protocol.x
@@ -64,12 +64,12 @@ enum admin_procedure {
      *   in the function parameter list.
      */
     /**
-     * @generate: client
+     * @generate: none
      */
     ADMIN_PROC_CONNECT_OPEN = 1,
 
     /**
-     * @generate: client
+     * @generate: none
      */
     ADMIN_PROC_CONNECT_CLOSE = 2
 };
diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index b8e6607..2c02ba6 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -101,6 +101,51 @@ call(virAdmConnectPtr conn,
 
 #include "admin_client.h"
 
+static int
+remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
+{
+    int rv = -1;
+    remoteAdminPrivPtr priv = conn->privateData;
+    admin_connect_open_args args;
+
+    virObjectLock(priv);
+
+    args.flags = flags;
+
+    if (call(conn, 0, ADMIN_PROC_CONNECT_OPEN,
+             (xdrproc_t)xdr_admin_connect_open_args, (char *)&args,
+             (xdrproc_t)xdr_void, (char *)NULL) == -1) {
+        goto done;
+    }
+
+    rv = 0;
+
+ done:
+    virObjectUnlock(priv);
+    return rv;
+}
+
+static int
+remoteAdminConnectClose(virAdmConnectPtr conn)
+{
+    int rv = -1;
+    remoteAdminPrivPtr priv = conn->privateData;
+
+    virObjectLock(priv);
+
+    if (call(conn, 0, ADMIN_PROC_CONNECT_CLOSE,
+             (xdrproc_t)xdr_void, (char *)NULL,
+             (xdrproc_t)xdr_void, (char *)NULL) == -1) {
+        goto done;
+    }
+
+    rv = 0;
+
+ done:
+    virObjectUnlock(priv);
+    return rv;
+}
+
 static void
 remoteAdminPrivFree(void *opaque)
 {
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]