aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_tbuf.c
diff options
context:
space:
mode:
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-11-22 16:31:16 +0100
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-11-22 16:31:16 +0100
commita22292f2bb59bda113d820fa7da5629408fac98d (patch)
treec5e423a69d01967f816f3d6dc761bff77e53bcce /tools/libxc/xc_tbuf.c
parent10edfe8abf0512c380bc2bb4d79af9460558f815 (diff)
downloadxen-a22292f2bb59bda113d820fa7da5629408fac98d.tar.gz
xen-a22292f2bb59bda113d820fa7da5629408fac98d.tar.bz2
xen-a22292f2bb59bda113d820fa7da5629408fac98d.zip
Make it possible to run valgrind on code linked with the libxc libraries.
Valgrind cannot see when a hypercall has initialised entries in a data structure, so appropriate memsets have been placed before using dom0_op_t, privcmd_hypercall_t, and a couple of miscellaneous blocks passed into this layer. This initialises the block so that valgrind considers it to be valid, but the data therein will be immediately overwritten by the hypercall, all being well. These changes are semantically neutral if -DVALGRIND is not set. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxc/xc_tbuf.c')
-rw-r--r--tools/libxc/xc_tbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index b47cde2867..b9a5e51a01 100644
--- a/tools/libxc/xc_tbuf.c
+++ b/tools/libxc/xc_tbuf.c
@@ -10,7 +10,7 @@
int xc_tbuf_enable(int xc_handle, int enable)
{
- dom0_op_t op;
+ DECLARE_DOM0_OP;
op.cmd = DOM0_TBUFCONTROL;
op.interface_version = DOM0_INTERFACE_VERSION;
@@ -24,7 +24,7 @@ int xc_tbuf_enable(int xc_handle, int enable)
int xc_tbuf_set_size(int xc_handle, uint32_t size)
{
- dom0_op_t op;
+ DECLARE_DOM0_OP;
op.cmd = DOM0_TBUFCONTROL;
op.interface_version = DOM0_INTERFACE_VERSION;
@@ -37,7 +37,7 @@ int xc_tbuf_set_size(int xc_handle, uint32_t size)
int xc_tbuf_get_size(int xc_handle, uint32_t *size)
{
int rc;
- dom0_op_t op;
+ DECLARE_DOM0_OP;
op.cmd = DOM0_TBUFCONTROL;
op.interface_version = DOM0_INTERFACE_VERSION;