From 5cc436c1d2b3b0be3f42104582f53eec3969b43a Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 28 May 2010 09:30:19 +0100 Subject: 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 --- tools/xenmon/setmask.c | 2 +- tools/xenmon/xenbaked.c | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'tools/xenmon') diff --git a/tools/xenmon/setmask.c b/tools/xenmon/setmask.c index 676dd6dcf7..2cc20d5b5d 100644 --- a/tools/xenmon/setmask.c +++ b/tools/xenmon/setmask.c @@ -43,7 +43,7 @@ int main(int argc, char * argv[]) struct xen_sysctl sysctl; int ret; - int xc_handle = xc_interface_open(); + xc_interface *xc_handle = xc_interface_open(0,0,0); sysctl.cmd = XEN_SYSCTL_tbuf_op; sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION; sysctl.u.tbuf_op.cmd = XEN_SYSCTL_TBUFOP_get_info; diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c index 33860f8e79..f44a3e8c44 100644 --- a/tools/xenmon/xenbaked.c +++ b/tools/xenmon/xenbaked.c @@ -328,10 +328,10 @@ static void wait_for_event(void) static void get_tbufs(unsigned long *mfn, unsigned long *size) { - int xc_handle = xc_interface_open(); + xc_interface *xc_handle = xc_interface_open(0,0,0); int ret; - if ( xc_handle < 0 ) + if ( !xc_handle ) { exit(EXIT_FAILURE); } @@ -349,7 +349,7 @@ static void get_tbufs(unsigned long *mfn, unsigned long *size) static void disable_tracing(void) { - int xc_handle = xc_interface_open(); + xc_interface *xc_handle = xc_interface_open(0,0,0); xc_tbuf_disable(xc_handle); xc_interface_close(xc_handle); } @@ -365,12 +365,12 @@ static void disable_tracing(void) static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num, unsigned long tinfo_size) { - int xc_handle; + xc_interface *xc_handle; static struct t_struct tbufs = { 0 }; int i; - xc_handle = xc_interface_open(); - if ( xc_handle < 0 ) + xc_handle = xc_interface_open(0,0,0); + if ( !xc_handle ) { exit(EXIT_FAILURE); } @@ -434,7 +434,7 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num, static unsigned int get_num_cpus(void) { xc_physinfo_t physinfo = { 0 }; - int xc_handle = xc_interface_open(); + xc_interface *xc_handle = xc_interface_open(0,0,0); int ret; ret = xc_physinfo(xc_handle, &physinfo); @@ -773,7 +773,8 @@ static int indexof(int domid) { int idx; xc_dominfo_t dominfo[NDOMAINS]; - int xc_handle, ndomains; + xc_interface *xc_handle; + int ndomains; if (domid < 0) { // shouldn't happen printf("bad domain id: %d\r\n", domid); @@ -792,7 +793,7 @@ static int indexof(int domid) } // call domaininfo hypercall to try and garbage collect unused entries - xc_handle = xc_interface_open(); + xc_handle = xc_interface_open(0,0,0); ndomains = xc_domain_getinfo(xc_handle, 0, NDOMAINS, dominfo); xc_interface_close(xc_handle); -- cgit v1.2.3