]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to support valgrind with Tools
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:55 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:55 +0000 (11:22 -0700)
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.

open-vm-tools/services/vmtoolsd/mainLoop.c
open-vm-tools/toolbox/toolbox-cmd.c

index e541ab60e768e676359db162f57814c383de246c..98633430c1bf1d0b4907004707edf17424f9b715 100644 (file)
@@ -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();
index 1fd91e8dca3308182cc1524a40fe84c14d1bf224..92a53e47d0b9ab157429419751eb9589e057be49 100644 (file)
@@ -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