diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-05-28 09:30:19 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-05-28 09:30:19 +0100 |
commit | 5cc436c1d2b3b0be3f42104582f53eec3969b43a (patch) | |
tree | 1e30ade146ee7287c486d1309b5d3d2c69a2d9b9 /tools/libxc/xc_dom.h | |
parent | 7f9a888af4b65cb8c22cea3c8295d30d0fedd623 (diff) | |
download | xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.tar.gz xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.tar.bz2 xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.zip |
libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).
Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.
There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.
All libxc callers have been adjusted accordingly.
Also update QEMU_TAG for corresponding qemu change.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_dom.h')
-rw-r--r-- | tools/libxc/xc_dom.h | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h index 58d3f496de..8d8cf5bf96 100644 --- a/tools/libxc/xc_dom.h +++ b/tools/libxc/xc_dom.h @@ -93,7 +93,7 @@ struct xc_dom_image { unsigned int xenstore_evtchn; xen_pfn_t shared_info_mfn; - int guest_xc; + xc_interface *xch; domid_t guest_domid; int8_t vhpt_size_log2; /* for IA64 */ int8_t superpages; @@ -153,13 +153,16 @@ void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks); /* --- main functions ---------------------------------------------- */ -struct xc_dom_image *xc_dom_allocate(const char *cmdline, const char *features); +struct xc_dom_image *xc_dom_allocate(xc_interface *xch, + const char *cmdline, const char *features); void xc_dom_release_phys(struct xc_dom_image *dom); void xc_dom_release(struct xc_dom_image *dom); int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb); -size_t xc_dom_check_gzip(void *blob, size_t ziplen); -int xc_dom_do_gunzip(void *src, size_t srclen, void *dst, size_t dstlen); +size_t xc_dom_check_gzip(xc_interface *xch, + void *blob, size_t ziplen); +int xc_dom_do_gunzip(xc_interface *xch, + void *src, size_t srclen, void *dst, size_t dstlen); int xc_dom_try_gunzip(struct xc_dom_image *dom, void **blob, size_t * size); int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename); @@ -170,11 +173,12 @@ int xc_dom_ramdisk_mem(struct xc_dom_image *dom, const void *mem, size_t memsize); int xc_dom_parse_image(struct xc_dom_image *dom); -struct xc_dom_arch *xc_dom_find_arch_hooks(char *guest_type); +struct xc_dom_arch *xc_dom_find_arch_hooks(xc_interface *xch, char *guest_type); int xc_dom_build_image(struct xc_dom_image *dom); int xc_dom_update_guest_p2m(struct xc_dom_image *dom); -int xc_dom_boot_xen_init(struct xc_dom_image *dom, int xc, domid_t domid); +int xc_dom_boot_xen_init(struct xc_dom_image *dom, xc_interface *xch, + domid_t domid); int xc_dom_boot_mem_init(struct xc_dom_image *dom); void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn, xen_pfn_t count); @@ -183,15 +187,17 @@ int xc_dom_compat_check(struct xc_dom_image *dom); /* --- debugging bits ---------------------------------------------- */ -extern FILE *xc_dom_logfile; +int xc_dom_loginit(xc_interface *xch); -void xc_dom_loginit(void); -int xc_dom_printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); -int xc_dom_panic_func(const char *file, int line, xc_error_code err, +void xc_dom_printf(xc_interface *xch, const char *fmt, ...) + __attribute__ ((format(printf, 2, 3))); +void xc_dom_panic_func(xc_interface *xch, + const char *file, int line, xc_error_code err, const char *fmt, ...) - __attribute__ ((format(printf, 4, 5))); -#define xc_dom_panic(err, fmt, args...) \ - xc_dom_panic_func(__FILE__, __LINE__, err, fmt, ## args) + __attribute__ ((format(printf, 5, 6))); + +#define xc_dom_panic(xch, err, fmt, args...) \ + xc_dom_panic_func(xch, __FILE__, __LINE__, err, fmt, ## args) #define xc_dom_trace(mark) \ xc_dom_printf("%s:%d: trace %s\n", __FILE__, __LINE__, mark) |