All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xensource.com>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH V9 3/7] libxl: Introduce libxl_internal_types.idl.
Date: Thu, 29 Sep 2011 12:37:53 +0100	[thread overview]
Message-ID: <1317296277-2838-4-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1317296277-2838-1-git-send-email-anthony.perard@citrix.com>

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/Makefile                 |    4 +++-
 tools/libxl/gentypes.py              |    9 +++++----
 tools/libxl/libxl_internal.h         |    1 +
 tools/libxl/libxl_types_internal.idl |    9 +++++++++
 4 files changed, 18 insertions(+), 5 deletions(-)
 create mode 100644 tools/libxl/libxl_types_internal.idl

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 330ee6e..1f6b418 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -35,7 +35,7 @@ LIBXL_OBJS-$(CONFIG_IA64) += libxl_nocpuid.o
 LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
 			libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o \
 			libxl_internal.o libxl_utils.o libxl_uuid.o $(LIBXL_OBJS-y)
-LIBXL_OBJS += _libxl_types.o libxl_flask.o
+LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
 
 $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl)
 
@@ -81,8 +81,10 @@ _libxl_paths.h: genpath
 libxl_paths.c: _libxl_paths.h
 
 libxl.h: _libxl_types.h
+libxl_internal.h: _libxl_types_internal.h
 
 $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): libxl.h
+$(LIBXL_OBJS): libxl_internal.h
 
 _libxl_type%.h _libxl_type%.c: libxl_type%.idl gentypes.py libxltypes.py
 	$(PYTHON) gentypes.py libxl_type$*.idl __libxl_type$*.h __libxl_type$*.c
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index c66a33c..ecf5f15 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -150,8 +150,9 @@ if __name__ == '__main__':
 
     f = open(header, "w")
 
-    f.write("""#ifndef __LIBXL_TYPES_H
-#define __LIBXL_TYPES_H
+    header_define = header.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
 
 /*
  * DO NOT EDIT.
@@ -160,7 +161,7 @@ if __name__ == '__main__':
  * "%s"
  */
 
-""" % " ".join(sys.argv))
+""" % (header_define, header_define, " ".join(sys.argv)))
 
     for ty in types:
         f.write(libxl_C_type_define(ty) + ";\n")
@@ -172,7 +173,7 @@ if __name__ == '__main__':
             f.write("extern libxl_enum_string_table %s_string_table[];\n" % (ty.typename))
         f.write("\n")
 
-    f.write("""#endif /* __LIBXL_TYPES_H */\n""")
+    f.write("""#endif /* %s */\n""" % (header_define))
     f.close()
 
     print "outputting libxl type implementations to %s" % impl
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b431632..29cdba4 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -35,6 +35,7 @@
 
 #include "flexarray.h"
 #include "libxl_utils.h"
+#include "_libxl_types_internal.h"
 
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
new file mode 100644
index 0000000..20236a6
--- /dev/null
+++ b/tools/libxl/libxl_types_internal.idl
@@ -0,0 +1,9 @@
+namespace("libxl__")
+
+libxl__qmp_message_type  = Enumeration("qmp_message_type", [
+    (1, "QMP"),
+    (2, "return"),
+    (3, "error"),
+    (4, "event"),
+    (5, "invalid"),
+    ])
-- 
Anthony PERARD

  parent reply	other threads:[~2011-09-29 11:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 11:37 [PATCH V9 0/7] Introduce a QMP client Anthony PERARD
2011-09-29 11:37 ` [PATCH V9 1/7] libxl: Rename libxl.idl to libxl_types.idl Anthony PERARD
2011-09-29 11:37 ` [PATCH V9 2/7] libxl: Add get/set_default_namespace in libxltypes.py Anthony PERARD
2011-09-29 11:37 ` Anthony PERARD [this message]
2011-09-29 11:37 ` [PATCH V9 4/7] libxl: Introduce libxl__realloc Anthony PERARD
2011-09-29 11:37 ` [PATCH V9 5/7] libxl: Intruduce libxl__strndup Anthony PERARD
2011-09-29 11:37 ` [PATCH V9 6/7] libxl: Introduce JSON parsing stuff Anthony PERARD
2011-09-29 11:37 ` [PATCH V9 7/7] libxl: Introduce a QMP client Anthony PERARD
2011-09-29 11:54   ` Ian Campbell
2011-09-29 12:43     ` Anthony PERARD
2011-09-29 15:38 ` [PATCH V9 0/7] " Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317296277-2838-4-git-send-email-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.