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

[libvirt] [PATCH 06/15] Add admin protocol



For now there's only CONNECT_OPEN procedure.

Signed-off-by: Martin Kletzander <mkletzan redhat com>
---
 .gitignore                 |  1 +
 cfg.mk                     |  2 +-
 src/Makefile.am            | 13 +++++++++-
 src/admin/admin_protocol.x | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 src/admin_protocol-structs |  8 +++++++
 5 files changed, 82 insertions(+), 2 deletions(-)
 create mode 100644 src/admin/admin_protocol.x
 create mode 100644 src/admin_protocol-structs

diff --git a/.gitignore b/.gitignore
index 9d09709..56916cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -110,6 +110,7 @@
 /src/access/viraccessapichecklxc.h
 /src/access/viraccessapicheckqemu.c
 /src/access/viraccessapicheckqemu.h
+/src/admin/admin_protocol.[ch]
 /src/esx/*.generated.*
 /src/hyperv/*.generated.*
 /src/libvirt*.def
diff --git a/cfg.mk b/cfg.mk
index 9ba2134..09803e4 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,5 +1,5 @@
 # Customize Makefile.maint.                           -*- makefile -*-
-# Copyright (C) 2008-2014 Red Hat, Inc.
+# Copyright (C) 2008-2015 Red Hat, Inc.
 # Copyright (C) 2003-2008 Free Software Foundation, Inc.

 # This program is free software: you can redistribute it and/or modify
diff --git a/src/Makefile.am b/src/Makefile.am
index d6245bd..b1044a7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -393,6 +393,16 @@ REMOTE_DRIVER_SOURCES =						\
 EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
 		$(REMOTE_DRIVER_GENERATED)

+ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x
+
+ADMIN_PROTOCOL_GENERATED = \
+		admin/admin_protocol.c	\
+		admin/admin_protocol.h
+
+EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
+BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
+MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)
+
 # Ensure that we don't change the struct or member names or member ordering
 # in remote_protocol.x  The embedded perl below needs a few comments, and
 # presumes you know what pdwtags output looks like:
@@ -2070,7 +2080,8 @@ RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
 		  $(srcdir)/remote/lxc_protocol.x \
 		  $(srcdir)/remote/qemu_protocol.x \
 		  $(srcdir)/lxc/lxc_monitor_protocol.x \
-		  $(srcdir)/locking/lock_protocol.x
+		  $(srcdir)/locking/lock_protocol.x \
+		  $(srcdir)/admin/admin_protocol.x

 libvirt_functions.stp: $(RPC_PROBE_FILES) $(srcdir)/rpc/gensystemtap.pl
 	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gensystemtap.pl $(RPC_PROBE_FILES) > $@
diff --git a/src/admin/admin_protocol.x b/src/admin/admin_protocol.x
new file mode 100644
index 0000000..3e1b28e
--- /dev/null
+++ b/src/admin/admin_protocol.x
@@ -0,0 +1,60 @@
+/* -*- c -*-
+ * admin_protocol.x: private protocol for communicating between
+ *   remote_internal driver and libvirtd.  This protocol is
+ *   internal and may change at any time.
+ *
+ * Copyright (C) 2014-2015 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/>.
+ *
+ * Author: Martin Kletzander <mkletzan redhat com>
+ */
+
+%#include "remote_protocol.h"
+
+
+/*----- Protocol. -----*/
+struct admin_connect_open_args {
+    unsigned int flags;
+};
+
+
+/* Define the program number, protocol version and procedure numbers here. */
+const ADMIN_PROGRAM = 0x06900690;
+const ADMIN_PROTOCOL_VERSION = 1;
+
+enum admin_procedure {
+    /* Each function must be preceded by a comment providing one or
+     * more annotations:
+     *
+     * - @generate: none|client|server|both
+     *
+     *   Whether to generate the dispatch stubs for the server
+     *   and/or client code.
+     *
+     * - @readstream: paramnumber
+     * - @writestream: paramnumber
+     *
+     *   The @readstream or @writestream annotations let daemon and src/remote
+     *   create a stream.  The direction is defined from the src/remote point
+     *   of view.  A readstream transfers data from daemon to src/remote.  The
+     *   <paramnumber> specifies at which offset the stream parameter is inserted
+     *   in the function parameter list.
+     */
+    /**
+     * @generate: none
+     */
+    ADMIN_PROC_CONNECT_OPEN = 1
+};
diff --git a/src/admin_protocol-structs b/src/admin_protocol-structs
new file mode 100644
index 0000000..6b2460d
--- /dev/null
+++ b/src/admin_protocol-structs
@@ -0,0 +1,8 @@
+/* -*- c -*- */
+struct admin_connect_open_args {
+    unsigned int flags;
+};
+
+enum admin_procedure {
+    ADMIN_PROC_CONNECT_OPEN = 1,
+};
-- 
2.3.5


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