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/xenstore | |
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/xenstore')
-rw-r--r-- | tools/xenstore/xenstored_domain.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index d1d59f9f6f..53fb68f21d 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -22,6 +22,7 @@ #include <unistd.h> #include <stdlib.h> #include <stdarg.h> +#include <xenctrl.h> #include "utils.h" #include "talloc.h" @@ -32,7 +33,7 @@ #include <xenctrl.h> -static int *xc_handle; +static xc_interface **xc_handle; static evtchn_port_t virq_port; int xce_handle = -1; @@ -538,7 +539,7 @@ void do_is_domain_introduced(struct connection *conn, const char *domid_str) static int close_xc_handle(void *_handle) { - xc_interface_close(*(int *)_handle); + xc_interface_close(*(xc_interface**)_handle); return 0; } @@ -584,12 +585,12 @@ int domain_init(void) { int rc; - xc_handle = talloc(talloc_autofree_context(), int); + xc_handle = talloc(talloc_autofree_context(), xc_interface*); if (!xc_handle) barf_perror("Failed to allocate domain handle"); - *xc_handle = xc_interface_open(); - if (*xc_handle < 0) + *xc_handle = xc_interface_open(0,0,0); + if (!*xc_handle) barf_perror("Failed to open connection to hypervisor"); talloc_set_destructor(xc_handle, close_xc_handle); |