Support running QEMU on Valgrind
commitc2a8238a2c1e37a2ae6d628a2b7bd95d1b5f1a89
authorStefan Weil <sw@weilnetz.de>
Mon, 31 Oct 2011 20:29:46 +0000 (31 21:29 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 1 Nov 2011 15:04:05 +0000 (1 10:04 -0500)
tree9145ea9b66a101772df527a4a9981aa3a7e31093
parentec38d39827df4450fa08fc28f725542afa8c350f
Support running QEMU on Valgrind

Valgrind is a tool which can automatically detect many kinds of bugs.

Running QEMU on Valgrind with x86_64 hosts was not possible because
Valgrind aborts when memalign is called with an alignment larger than
1 MiB. QEMU normally uses 2 MiB on Linux x86_64.

Now the alignment is reduced to the page size when QEMU is running on
Valgrind.

v2:
Instead of using the macro RUNNING_ON_VALGRIND from valgrind.h,
the patch now uses a hack from libvirt which tests for the pre-loaded
vgpreload_*.so shared libraries. This avoids the need for valgrind.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
oslib-posix.c