aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xg_private.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:30:19 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:30:19 +0100
commit5cc436c1d2b3b0be3f42104582f53eec3969b43a (patch)
tree1e30ade146ee7287c486d1309b5d3d2c69a2d9b9 /tools/libxc/xg_private.c
parent7f9a888af4b65cb8c22cea3c8295d30d0fedd623 (diff)
downloadxen-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/xg_private.c')
-rw-r--r--tools/libxc/xg_private.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/libxc/xg_private.c b/tools/libxc/xg_private.c
index 457001ce25..98098dbadd 100644
--- a/tools/libxc/xg_private.c
+++ b/tools/libxc/xg_private.c
@@ -11,7 +11,8 @@
#include "xg_private.h"
-char *xc_read_image(const char *filename, unsigned long *size)
+char *xc_read_image(xc_interface *xch,
+ const char *filename, unsigned long *size)
{
int kernel_fd = -1;
gzFile kernel_gfd = NULL;
@@ -86,7 +87,8 @@ char *xc_read_image(const char *filename, unsigned long *size)
return image;
}
-char *xc_inflate_buffer(const char *in_buf, unsigned long in_size,
+char *xc_inflate_buffer(xc_interface *xch,
+ const char *in_buf, unsigned long in_size,
unsigned long *out_size)
{
int sts;
@@ -147,14 +149,14 @@ char *xc_inflate_buffer(const char *in_buf, unsigned long in_size,
/*******************/
int pin_table(
- int xc_handle, unsigned int type, unsigned long mfn, domid_t dom)
+ xc_interface *xch, unsigned int type, unsigned long mfn, domid_t dom)
{
struct mmuext_op op;
op.cmd = type;
op.arg1.mfn = mfn;
- if ( xc_mmuext_op(xc_handle, &op, 1, dom) < 0 )
+ if ( xc_mmuext_op(xch, &op, 1, dom) < 0 )
return 1;
return 0;
@@ -174,7 +176,7 @@ unsigned long csum_page(void *page)
}
__attribute__((weak))
- int xc_hvm_build(int xc_handle,
+ int xc_hvm_build(xc_interface *xch,
uint32_t domid,
int memsize,
const char *image_name)