]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libxc: Remove valgrind conditional sections from libxc
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 15 Apr 2014 18:18:42 +0000 (19:18 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 16 Apr 2014 16:08:54 +0000 (17:08 +0100)
The ifdef sections are not enabled at all in tree, and their justification is
out of date now that Xen hypercall support exists upstream in valgrind.

This also removes a commented-out tweak to CFLAGS in the libxc Makefile which
is not being used, and becomes stale given this patch.  In the unlikely event
that any developers were using the line, the results can be more easily
achieved by tweaking APPEND_CFLAGS in the environment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/Makefile
tools/libxc/xc_private.c
tools/libxc/xc_private.h
tools/libxc/xc_tmem.c

index 2cca2b2e88f6e161da359812d3c5b3cde397be48..a74b19e001480a467bdb7fefcbd1218b435bd9b7 100644 (file)
@@ -95,10 +95,6 @@ CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
 
 CFLAGS += $(PTHREAD_CFLAGS)
 
-# Define this to make it possible to run valgrind on code linked with these
-# libraries.
-#CFLAGS   += -DVALGRIND -O0 -ggdb3
-
 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
 
index 33ed15bf1eba6a758c9e47182b25ece936d6a59d..0e1889258b51e0a5ae1d138e46430e086a0f8a0a 100644 (file)
@@ -588,10 +588,6 @@ int xc_get_pfn_list(xc_interface *xch,
     DECLARE_HYPERCALL_BOUNCE(pfn_buf, max_pfns * sizeof(*pfn_buf), XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     int ret;
 
-#ifdef VALGRIND
-    memset(pfn_buf, 0, max_pfns * sizeof(*pfn_buf));
-#endif
-
     if ( xc_hypercall_bounce_pre(xch, pfn_buf) )
     {
         PERROR("xc_get_pfn_list: pfn_buf bounce failed");
@@ -707,11 +703,6 @@ int xc_version(xc_interface *xch, int cmd, void *arg)
         return -ENOMEM;
     }
 
-#ifdef VALGRIND
-    if (sz != 0)
-        memset(hypercall_bounce_get(bounce), 0, sz);
-#endif
-
     rc = do_xen_version(xch, cmd, HYPERCALL_BUFFER(arg));
 
     if ( sz != 0 )
index bd2eb86b07195bdb2b97c8d3db58ac199c502470..670a82d3cfbb0c42e926fdc7cebf00841952de67 100644 (file)
 
 #include <xen/sys/privcmd.h>
 
-/* valgrind cannot see when a hypercall has filled in some values.  For this
-   reason, we must zero the privcmd_hypercall_t or domctl/sysctl instance
-   before a call, if using valgrind.  */
-#ifdef VALGRIND
-#define DECLARE_HYPERCALL privcmd_hypercall_t hypercall = { 0 }
-#define DECLARE_DOMCTL struct xen_domctl domctl = { 0 }
-#define DECLARE_SYSCTL struct xen_sysctl sysctl = { 0 }
-#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op = { 0 }
-#define DECLARE_FLASK_OP struct xen_flask_op op = { 0 }
-#else
 #define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
 #define DECLARE_DOMCTL struct xen_domctl domctl
 #define DECLARE_SYSCTL struct xen_sysctl sysctl
 #define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
 #define DECLARE_FLASK_OP struct xen_flask_op op
-#endif
 
 #undef PAGE_SHIFT
 #undef PAGE_SIZE
index 61e154930a622650fa8b0d4b3f7c0536a34ccfd6..3261e10d8efa24df914b6a0c9b1ce00ef7fe313d 100644 (file)
@@ -70,11 +70,6 @@ int xc_tmem_control(xc_interface *xch,
     op.u.ctrl.oid[1] = 0;
     op.u.ctrl.oid[2] = 0;
 
-#ifdef VALGRIND
-    if (arg1 != 0)
-        memset(buf, 0, arg1);
-#endif
-
     if ( subop == TMEMC_LIST && arg1 != 0 )
     {
         if ( buf == NULL )
@@ -120,11 +115,6 @@ int xc_tmem_control_oid(xc_interface *xch,
     op.u.ctrl.oid[1] = oid.oid[1];
     op.u.ctrl.oid[2] = oid.oid[2];
 
-#ifdef VALGRIND
-    if (arg1 != 0)
-        memset(buf, 0, arg1);
-#endif
-
     if ( subop == TMEMC_LIST && arg1 != 0 )
     {
         if ( buf == NULL )