WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH V6 1/3] libxl: Introduce libxl_internal_types.idl.

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH V6 1/3] libxl: Introduce libxl_internal_types.idl.
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Thu, 30 Jun 2011 18:30:43 +0100
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Thu, 30 Jun 2011 10:33:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1309455045-3062-1-git-send-email-anthony.perard@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1309455045-3062-1-git-send-email-anthony.perard@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libxl/Makefile                       |   16 +++++++++-------
 tools/libxl/gentypes.py                    |   15 ++++++++-------
 tools/libxl/libxl_internal.h               |    1 +
 tools/libxl/{libxl.idl => libxl_types.idl} |    0
 tools/libxl/libxl_types_internal.idl       |   10 ++++++++++
 5 files changed, 28 insertions(+), 14 deletions(-)
 rename tools/libxl/{libxl.idl => libxl_types.idl} (100%)
 create mode 100644 tools/libxl/libxl_types_internal.idl

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index bfe9c58..a95cd5d 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)
 
@@ -51,8 +51,8 @@ $(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
 $(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 
 testenum.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
-testenum.c: libxl.idl gentest.py
-       $(PYTHON) gentest.py libxl.idl testenum.c.new
+testenum.c: libxl_types.idl gentest.py
+       $(PYTHON) gentest.py libxl_types.idl testenum.c.new
        mv testenum.c.new testenum.c
 
 .PHONY: all
@@ -79,13 +79,15 @@ _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_%.h _libxl_%.c: libxl.idl gen%.py libxl%.py
-       $(PYTHON) gen$*.py libxl.idl __libxl_$*.h __libxl_$*.c
-       mv __libxl_$*.h _libxl_$*.h
-       mv __libxl_$*.c _libxl_$*.c
+_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
+       mv __libxl_type$*.h _libxl_type$*.h
+       mv __libxl_type$*.c _libxl_type$*.c
 
 libxenlight.so: libxenlight.so.$(MAJOR)
        ln -sf $< $@
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index c9a3d9c..5188b66 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -162,9 +162,10 @@ if __name__ == '__main__':
     print "outputting libxl type definitions to %s" % header
 
     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.
@@ -172,9 +173,9 @@ if __name__ == '__main__':
  * This file is autogenerated by
  * "%s"
  */
- 
-""" % " ".join(sys.argv))
-        
+
+""" % (header_define, header_define, " ".join(sys.argv)))
+
     for ty in types:
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.destructor_fn is not None:
@@ -185,7 +186,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()
     
     impl = sys.argv[3]
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 47752e5..71eb189 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.idl b/tools/libxl/libxl_types.idl
similarity index 100%
rename from tools/libxl/libxl.idl
rename to tools/libxl/libxl_types.idl
diff --git a/tools/libxl/libxl_types_internal.idl 
b/tools/libxl/libxl_types_internal.idl
new file mode 100644
index 0000000..d993298
--- /dev/null
+++ b/tools/libxl/libxl_types_internal.idl
@@ -0,0 +1,10 @@
+
+libxl__qmp_message_type  = Enumeration("qmp_message_type", [
+    (1, "QMP"),
+    (2, "return"),
+    (3, "error"),
+    (4, "event"),
+    (5, "invalid"),
+    ],
+    namespace = "libxl__")
+
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>