libxl: generate a _dispose function for all Aggregate types
authorIan Campbell <ian.campbell@citrix.com>
Thu, 1 Mar 2012 12:26:13 +0000 (12:26 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 1 Mar 2012 12:26:13 +0000 (12:26 +0000)
commit9dc5f1364dac38ab6c3e831a576d31e73c62426b
tree22f6c2a9cad8ad7e10ba6e301f0a311009731dac
parentcad39d78f05280ce17b224df73b3fad4078e5a9d
libxl: generate a _dispose function for all Aggregate types

Don't special case types which we happen to know do not contain allocated data
such that in the future if this changes we do not need to add an API. Although
there is likely to be latent bugs in callers due to this having the API in old
libraries mean that when callers are fixed they will not need to make special
arrangements to handle old and new versions of the library.

Adds dispose functions for:
 - libxl_dominfo
 - libxl_cpupoolinfo
 - libxl_physinfo
 - libxl_sched_credit
 - libxl_sched_credit2

I have attempted to fix any latent bugs in xl by inspection but have not
bothered with libxl (on the basis that internally the library is allowed to
make these sorts of assumptions and because it was looking like a very invasive
job and that more would only creep in anyway).

Several callsites use libxl_domain_info to check for the presence of a domain
and throw away the actual info. As a convenience accept a NULL info pointer and
just return the status.

Also fix a memory leak in libxl_domain_list.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl_types.idl
tools/libxl/libxl_utils.c
tools/libxl/xl_cmdimpl.c