diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-04-12 17:44:47 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-04-12 17:44:47 +0100 |
commit | e5f63f2ca9c3d437cfc717f6ccbdecf7804e6b3e (patch) | |
tree | 44bdda2fcbc680760145b6fb82f00b2fad6dec35 /tools/libxl/libxl_utils.h | |
parent | 0ac8d8f1693527efd5f3a20ba8662f80434a1597 (diff) | |
download | xen-e5f63f2ca9c3d437cfc717f6ccbdecf7804e6b3e.tar.gz xen-e5f63f2ca9c3d437cfc717f6ccbdecf7804e6b3e.tar.bz2 xen-e5f63f2ca9c3d437cfc717f6ccbdecf7804e6b3e.zip |
xl: Remove some duplicated boilerplate. (Improves logging slightly.)
We remove six lines of boilerplate from the top of each function, and
instead have a single struct libxl_ctx which is initialised once at
the top of main.
Likewise we wrap domain_qualifier_to_domid in a new function
find_domain, which does the error handling, and stores the domid and
the specified name (if applicable).
This reduces the size of xl.c by 7% (!)
As a beneficial side effect, the earlier call to libxl_ctx_set_log in
main makes some lost messages appear.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_utils.h')
-rw-r--r-- | tools/libxl/libxl_utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h index 4c04c46dea..5d8018109a 100644 --- a/tools/libxl/libxl_utils.h +++ b/tools/libxl/libxl_utils.h @@ -19,7 +19,7 @@ #include "libxl.h" unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned int smp_cpus); -int libxl_name_to_domid(struct libxl_ctx *ctx, char *name, uint32_t *domid); +int libxl_name_to_domid(struct libxl_ctx *ctx, const char *name, uint32_t *domid); char *libxl_domid_to_name(struct libxl_ctx *ctx, uint32_t domid); int libxl_get_stubdom_id(struct libxl_ctx *ctx, int guest_domid); int libxl_is_stubdom(struct libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid); |