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_memshr.c | |
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_memshr.c')
-rw-r--r-- | tools/libxc/xc_memshr.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/libxc/xc_memshr.c b/tools/libxc/xc_memshr.c index 1d54a38f7e..7fca923de3 100644 --- a/tools/libxc/xc_memshr.c +++ b/tools/libxc/xc_memshr.c @@ -25,7 +25,7 @@ #include <xen/memory.h> #include <xen/grant_table.h> -int xc_memshr_control(int xc_handle, +int xc_memshr_control(xc_interface *xch, uint32_t domid, int enable) { @@ -39,10 +39,10 @@ int xc_memshr_control(int xc_handle, op->op = XEN_DOMCTL_MEM_SHARING_OP_CONTROL; op->u.enable = enable; - return do_domctl(xc_handle, &domctl); + return do_domctl(xch, &domctl); } -int xc_memshr_nominate_gfn(int xc_handle, +int xc_memshr_nominate_gfn(xc_interface *xch, uint32_t domid, unsigned long gfn, uint64_t *handle) @@ -58,13 +58,13 @@ int xc_memshr_nominate_gfn(int xc_handle, op->op = XEN_DOMCTL_MEM_SHARING_OP_NOMINATE_GFN; op->u.nominate.u.gfn = gfn; - ret = do_domctl(xc_handle, &domctl); + ret = do_domctl(xch, &domctl); if(!ret) *handle = op->u.nominate.handle; return ret; } -int xc_memshr_nominate_gref(int xc_handle, +int xc_memshr_nominate_gref(xc_interface *xch, uint32_t domid, grant_ref_t gref, uint64_t *handle) @@ -80,13 +80,13 @@ int xc_memshr_nominate_gref(int xc_handle, op->op = XEN_DOMCTL_MEM_SHARING_OP_NOMINATE_GREF; op->u.nominate.u.grant_ref = gref; - ret = do_domctl(xc_handle, &domctl); + ret = do_domctl(xch, &domctl); if(!ret) *handle = op->u.nominate.handle; return ret; } -int xc_memshr_share(int xc_handle, +int xc_memshr_share(xc_interface *xch, uint64_t source_handle, uint64_t client_handle) { @@ -101,10 +101,10 @@ int xc_memshr_share(int xc_handle, op->u.share.source_handle = source_handle; op->u.share.client_handle = client_handle; - return do_domctl(xc_handle, &domctl); + return do_domctl(xch, &domctl); } -int xc_memshr_domain_resume(int xc_handle, +int xc_memshr_domain_resume(xc_interface *xch, uint32_t domid) { DECLARE_DOMCTL; @@ -116,10 +116,10 @@ int xc_memshr_domain_resume(int xc_handle, op = &(domctl.u.mem_sharing_op); op->op = XEN_DOMCTL_MEM_SHARING_OP_RESUME; - return do_domctl(xc_handle, &domctl); + return do_domctl(xch, &domctl); } -int xc_memshr_debug_gfn(int xc_handle, +int xc_memshr_debug_gfn(xc_interface *xch, uint32_t domid, unsigned long gfn) { @@ -133,10 +133,10 @@ int xc_memshr_debug_gfn(int xc_handle, op->op = XEN_DOMCTL_MEM_SHARING_OP_DEBUG_GFN; op->u.debug.u.gfn = gfn; - return do_domctl(xc_handle, &domctl); + return do_domctl(xch, &domctl); } -int xc_memshr_debug_mfn(int xc_handle, +int xc_memshr_debug_mfn(xc_interface *xch, uint32_t domid, unsigned long mfn) { @@ -150,10 +150,10 @@ int xc_memshr_debug_mfn(int xc_handle, op->op = XEN_DOMCTL_MEM_SHARING_OP_DEBUG_MFN; op->u.debug.u.mfn = mfn; - return do_domctl(xc_handle, &domctl); + return do_domctl(xch, &domctl); } -int xc_memshr_debug_gref(int xc_handle, +int xc_memshr_debug_gref(xc_interface *xch, uint32_t domid, grant_ref_t gref) { @@ -167,6 +167,6 @@ int xc_memshr_debug_gref(int xc_handle, op->op = XEN_DOMCTL_MEM_SHARING_OP_DEBUG_GREF; op->u.debug.u.gref = gref; - return do_domctl(xc_handle, &domctl); + return do_domctl(xch, &domctl); } |