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

[Xen-changelog] [xen master] libxl: idl: add Enumeration.value_namespace property



commit a99d55edd4044a3c2f34067046f1a81c9415274b
Author:     Rob Hoes <rob.hoes@xxxxxxxxxx>
AuthorDate: Wed Nov 6 17:49:46 2013 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Nov 11 15:38:27 2013 +0000

    libxl: idl: add Enumeration.value_namespace property
    
    This allows setting the namespace for values of an Enumeration to be 
different
    from the namespace of the Enumeration itself.
    
    Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/idl.py  |    5 ++++-
 tools/libxl/idl.txt |    7 +++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
index f4908dd..e4dc79b 100644
--- a/tools/libxl/idl.py
+++ b/tools/libxl/idl.py
@@ -136,7 +136,7 @@ class EnumerationValue(object):
 
         self.valuename = str.upper(name)
         self.rawname = str.upper(enum.rawname) + "_" + self.valuename
-        self.name = str.upper(enum.namespace) + self.rawname
+        self.name = str.upper(enum.value_namespace) + self.rawname
         self.value = value
 
 class Enumeration(Type):
@@ -144,6 +144,9 @@ class Enumeration(Type):
         kwargs.setdefault('dispose_fn', None)
         Type.__init__(self, typename, **kwargs)
 
+        self.value_namespace = kwargs.setdefault('value_namespace',
+            self.namespace)
+
         self.values = []
         for v in values:
             # (value, name)
diff --git a/tools/libxl/idl.txt b/tools/libxl/idl.txt
index 019acbe..439aede 100644
--- a/tools/libxl/idl.txt
+++ b/tools/libxl/idl.txt
@@ -90,6 +90,13 @@ Complex type-Classes
 idl.Enumeration
 
   A class representing an enumeration (named integer values).
+  This class has one property besides the ones defined for the Type
+  class:
+
+  Enumeration.value_namespace: (default: namespace)
+
+    The namespace in which the values of the Enumeration (see below) reside.
+    This prefix is prepended to the name of the value.
 
   The values are available in the list Enumeration.values. Each
   element in the list is of type idl.EnumerationValue.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.