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 18:23:32 +0000 |
| commit | d2e1e8871eaf7f93ea76a7fa2fde96388d3138ea (patch) | |
| tree | 312b0a0a6d3cedb311c9f3e59317a4b865213bb1 /src/launch.c | |
| parent | 09336d6dbb79f52d893a1b2478cc72da44772287 (diff) | |
| download | libguestfs-d2e1e8871eaf7f93ea76a7fa2fde96388d3138ea.tar.gz libguestfs-d2e1e8871eaf7f93ea76a7fa2fde96388d3138ea.tar.xz libguestfs-d2e1e8871eaf7f93ea76a7fa2fde96388d3138ea.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.
(cherry picked from commit d08806adfc5d111b4b6c761540ff508d3f25b66e)
Diffstat (limited to 'src/launch.c')
| -rw-r--r-- | src/launch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/launch.c b/src/launch.c index 1af74b99..4e2fba9d 100644 --- a/src/launch.c +++ b/src/launch.c @@ -703,6 +703,16 @@ launch_appliance (guestfs_h *g) add_cmdline (g, "-device"); add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0"); +#ifdef VALGRIND_DAEMON + /* Set up virtio-serial channel for valgrind messages. */ + add_cmdline (g, "-chardev"); + snprintf (buf, sizeof buf, "file,path=%s/valgrind.log.%d,id=valgrind", + VALGRIND_LOG_PATH, getpid ()); + add_cmdline (g, buf); + add_cmdline (g, "-device"); + add_cmdline (g, "virtserialport,chardev=valgrind,name=org.libguestfs.valgrind"); +#endif + /* Enable user networking. */ if (g->enable_network) { add_cmdline (g, "-netdev"); |
