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

[Xen-changelog] [xen-unstable] libxl: do not generate a destructor for data types which do not require one



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1282227881 -3600
# Node ID 1ba7cbf9683b159ec56a8a77d856296ea681898b
# Parent  24f6507f0156e2943464909bab09cc0ba3d25af3
libxl: do not generate a destructor for data types which do not require one

libxl_dominfo, libxl_poolinfo, libxl_vminfo, libxl_domain_build_state,
libxl_physinfo and libxl_sched_credit contain no members which require
destruction so omit the auto generated destructor.

As an exception continue to generate destructors for libxl_device_*
and libxl_{devtype}* even if they have no interesting members so that
all device types can be treated the same without special knowledge
about the type contents being required.

[PATCH 08 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/gentypes.py |    2 +-
 tools/libxl/libxl.idl   |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff -r 24f6507f0156 -r 1ba7cbf9683b tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py   Thu Aug 19 15:21:29 2010 +0100
+++ b/tools/libxl/gentypes.py   Thu Aug 19 15:24:41 2010 +0100
@@ -150,7 +150,7 @@ if __name__ == '__main__':
 
 """ % " ".join(sys.argv))
 
-    for ty in [t for t in types if t.autogenerate_destructor]:
+    for ty in [t for t in types if t.destructor_fn is not None and 
t.autogenerate_destructor]:
         f.write("void %s(%s *p)\n" % (ty.destructor_fn, ty.typename))
         f.write("{\n")
         f.write(libxl_C_type_destroy(ty, "p", True))
diff -r 24f6507f0156 -r 1ba7cbf9683b tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl     Thu Aug 19 15:21:29 2010 +0100
+++ b/tools/libxl/libxl.idl     Thu Aug 19 15:24:41 2010 +0100
@@ -40,16 +40,16 @@ SHUTDOWN_* constant."""),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
-    ])
+    ], destructor_fn=None)
 
 libxl_poolinfo = Struct("poolinfo", [
     ("poolid", uint32)
-    ])
+    ], destructor_fn=None)
 
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", domid),
-    ])
+    ], destructor_fn=None)
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -132,7 +132,7 @@ libxl_domain_build_state = Struct("domai
     ("store_mfn",    unsigned_long),
     ("console_port", uint32),
     ("console_mfn",  unsigned_long),
-    ])
+    ], destructor_fn=None)
 
 libxl_device_model_info = Struct("device_model_info",[
     ("domid",            integer),
@@ -308,12 +308,12 @@ libxl_physinfo = Struct("physinfo", [
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
     ("phys_cap", uint32),
-    ])
+    ], destructor_fn=None)
 
 libxl_sched_credit = Struct("sched_credit", [
     ("weight", integer),
     ("cap", integer),
-    ])
+    ], destructor_fn=None)
 
 libxl_net2info = Struct("net2info", [
     ("backend", string),

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.