From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:55 +0000 (-0700) Subject: Changes to support valgrind with Tools X-Git-Tag: stable-10.2.0~618 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb680f5b3f1f6b079ec214cf214738c99f4716c4;p=thirdparty%2Fopen-vm-tools.git Changes to support valgrind with Tools Allow Tools to be built with valgrind support. With these changes, adding "export USE_VALGRIND=1" in Local.mk will build a version of Tools that works with valgrind. Also includes a change to turn off appLoader for vmtoosld and toolbox-cmd. --- diff --git a/open-vm-tools/services/vmtoolsd/mainLoop.c b/open-vm-tools/services/vmtoolsd/mainLoop.c index e541ab60e..98633430c 100644 --- a/open-vm-tools/services/vmtoolsd/mainLoop.c +++ b/open-vm-tools/services/vmtoolsd/mainLoop.c @@ -419,7 +419,14 @@ ToolsCore_Setup(ToolsServiceState *state) #else state->ctx.mainLoop = g_main_loop_new(gctx, FALSE); #endif + /* + * Valgrind can't handle the backdoor check. + */ +#ifdef USE_VALGRIND + state->ctx.isVMware = TRUE; +#else state->ctx.isVMware = VmCheck_IsVirtualWorld(); +#endif g_main_context_unref(gctx); g_type_init(); diff --git a/open-vm-tools/toolbox/toolbox-cmd.c b/open-vm-tools/toolbox/toolbox-cmd.c index 1fd91e8dc..92a53e47d 100644 --- a/open-vm-tools/toolbox/toolbox-cmd.c +++ b/open-vm-tools/toolbox/toolbox-cmd.c @@ -435,12 +435,16 @@ main(int argc, // IN: length of command line arguments /* * Check if we are in a VM + * + * Valgrind can't handle the backdoor check, so don't bother. */ +#ifndef USE_VALGRIND if (!VmCheck_IsVirtualWorld()) { g_printerr(SU_(error.novirtual, "%s must be run inside a virtual machine.\n"), argv[0]); goto exit; } +#endif /* * Parse the command line optional arguments