qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Support running QEMU on Valgrind


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] Support running QEMU on Valgrind
Date: Mon, 31 Oct 2011 18:22:48 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Oct 30, 2011 at 01:07:26PM +0100, Stefan Weil wrote:
> 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.
> 
> valgrind.h is a copy from Valgrind svn trunk r12226 with trailing
> whitespace stripped but otherwise unmodified, so it still raises lots
> of errors when checked with scripts/checkpatch.pl.
> 
> It is included here to avoid a dependency on Valgrind.

In libvirt we do the following fun hack to avoid a build dep on valgrind:

    const char *ld = getenv("LD_PRELOAD");
    if (ld && strstr(ld, "vgpreload")) {
        fprintf(stderr, "Running under valgrind, disabling driver\n");
        return 0;
    }

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]