# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1282143677 -3600
# Node ID 6315b60118071a50e53f1ce3d959528538ed665f
# Parent a02fd486972239cb17683f69dc8a506df21ef0d3
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.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r a02fd4869722 -r 6315b6011807 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py Wed Aug 18 16:01:17 2010 +0100
+++ b/tools/libxl/gentypes.py Wed Aug 18 16:01:17 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 a02fd4869722 -r 6315b6011807 tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl Wed Aug 18 16:01:17 2010 +0100
+++ b/tools/libxl/libxl.idl Wed Aug 18 16:01:17 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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|