Updating the VmCheck_IsVirtualWorld() function to assume that if the
open-vm-tools build was configured with "--enable-valgrind", the tools
will be used on a VMware hypervisor for memory leak detection. In this
case, simply return TRUE and avoid touching the backdoor.
The "backdoor" touch test cannot be handled by Valgrind.
* environment.
*
* Return value:
- * TRUE if we're in a virtual machine, FALSE otherwise.
+ * TRUE if we're in a virtual machine or a Linux compilation using Valgrind,
+ * FALSE otherwise.
*
* Side effects:
* None.
uint32 dummy;
#if !defined(WINNT_DDK)
+#ifdef USE_VALGRIND
+ /*
+ * Valgrind can't handle the backdoor check.
+ */
+ return TRUE;
+#endif
#if defined VM_X86_ANY
char *hypervisorSig;
uint32 i;
#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();
VMTools_ConfigLogging("toolboxcmd", conf, FALSE, FALSE);
VMTools_BindTextDomain(VMW_TEXT_DOMAIN, NULL, NULL);
- /*
- * 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