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-changelog

[Xen-changelog] [xen-unstable] libxl: Add get/set_default_namespace in l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Add get/set_default_namespace in libxltypes.py.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 01 Oct 2011 03:33:12 +0100
Delivery-date: Fri, 30 Sep 2011 19:33:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1317310101 -3600
# Node ID f5ee5ad45425ec82b97cac7ff7fd4a34f424aa9d
# Parent  a543e10211f72d568e4bfac23eeee45b595b7753
libxl: Add get/set_default_namespace in libxltypes.py.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r a543e10211f7 -r f5ee5ad45425 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Thu Sep 29 16:28:20 2011 +0100
+++ b/tools/libxl/libxl_types.idl       Thu Sep 29 16:28:21 2011 +0100
@@ -3,6 +3,8 @@
 # Builtin libxl types
 #
 
+namespace("libxl_")
+
 libxl_domid = Builtin("domid")
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
diff -r a543e10211f7 -r f5ee5ad45425 tools/libxl/libxltypes.py
--- a/tools/libxl/libxltypes.py Thu Sep 29 16:28:20 2011 +0100
+++ b/tools/libxl/libxltypes.py Thu Sep 29 16:28:21 2011 +0100
@@ -8,10 +8,23 @@
 DIR_OUT  = 2
 DIR_BOTH = 3
 
+_default_namespace = ""
+def namespace(s):
+    if type(s) != str:
+        raise TypeError, "Require a string for the default namespace."
+    global _default_namespace
+    _default_namespace = s
+
+def _get_default_namespace():
+    global _default_namespace
+    return _default_namespace
+
+
 class Type(object):
     def __init__(self, typename, **kwargs):
         self.comment = kwargs.setdefault('comment', None)
-        self.namespace = kwargs.setdefault('namespace', "libxl_")
+        self.namespace = kwargs.setdefault('namespace',
+                _get_default_namespace())
         self.dir = kwargs.setdefault('dir', DIR_BOTH)
         if self.dir not in [DIR_NONE, DIR_IN, DIR_OUT, DIR_BOTH]:
             raise ValueError
@@ -256,7 +269,8 @@
         elif isinstance(t,type(object)) and issubclass(t, Type):
             globs[n] = t
         elif n in ['PASS_BY_REFERENCE', 'PASS_BY_VALUE',
-                   'DIR_NONE', 'DIR_IN', 'DIR_OUT', 'DIR_BOTH']:
+                   'DIR_NONE', 'DIR_IN', 'DIR_OUT', 'DIR_BOTH',
+                   'namespace']:
             globs[n] = t
 
     try:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: Add get/set_default_namespace in libxltypes.py., Xen patchbot-unstable <=