diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-01-24 13:47:25 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-01-24 15:56:14 +0000 |
commit | d08806adfc5d111b4b6c761540ff508d3f25b66e (patch) | |
tree | 58bcd51e9cd8e7a41a27b439dde83f34d765e4b7 /src/guestfs.c | |
parent | b7122eaa58ccd153a8c39bc3b6f890755c5df089 (diff) | |
download | libguestfs-d08806adfc5d111b4b6c761540ff508d3f25b66e.tar.gz libguestfs-d08806adfc5d111b4b6c761540ff508d3f25b66e.tar.xz libguestfs-d08806adfc5d111b4b6c761540ff508d3f25b66e.zip |
Enable running the daemon under valgrind.
This commit allows you to run the daemon under valgrind. You have to
enable it at configure time:
./configure --enable-valgrind-daemon
This should *not* be done for production builds.
When this feature is enabled, valgrind is added to the appliance and
the daemon is run under valgrind. Log messages from valgrind are
passed back over a virtio-serial channel into a file called
'valgrind.log.$PID' in the top build directory.
Running 'make check', 'make extra-tests' etc causes many
valgrind.log.* files to be created which must be examined by hand.
Diffstat (limited to 'src/guestfs.c')
-rw-r--r-- | src/guestfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/guestfs.c b/src/guestfs.c index 31968e4e..3607eaad 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -190,9 +190,17 @@ guestfs_close (guestfs_h *g) if (g->autosync && g->state == READY) guestfs_internal_autosync (g); + /* If we are valgrinding the daemon, then we *don't* want to kill + * the subprocess because we want the final valgrind messages sent + * when we close sockets below. However for normal production use, + * killing the subprocess is the right thing to do (in case the + * daemon or qemu is not responding). + */ +#ifndef VALGRIND_DAEMON /* Kill the qemu subprocess. */ if (g->state != CONFIG) guestfs_kill_subprocess (g); +#endif /* Run user close callbacks. */ guestfs___call_callbacks_void (g, GUESTFS_EVENT_CLOSE); |