---
docs/guestfs-hacking.pod | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
index c357717..419a4c2 100644
--- a/docs/guestfs-hacking.pod
+++ b/docs/guestfs-hacking.pod
@@ -274,8 +274,7 @@ the automake documentation for details.
Runs a subset of the test suite under valgrind.
-Any F<Makefile.am> in the tree that has a C<check-valgrind:> target
-will be run by this rule.
+See L</VALGRIND> below.
=item C<make check-valgrind-local-guests>
@@ -383,6 +382,35 @@ Do:
=back
+=head2 VALGRIND
+
+When you do C<make check-valgrind>, it searches for any F<Makefile.am>
+in the tree that has a C<check-valgrind:> target and runs it.
+
+Writing the F<Makefile.am> and tests correctly to use valgrind and
+working with automake parallel tests is subtle.
+
+If your tests are run via a shell script wrapper, then in the wrapper
+use:
+
+ $VG virt-foo
+
+and in the F<Makefile.am> use:
+
+ check-valgrind:
+ make VG="$(top_builddir)/run @VG@" check
+
+However, if your binaries run directly from the C<TESTS> rule, you
+have to modify the F<Makefile.am> like this:
+
+ LOG_COMPILER = $(VG)
+
+ check-valgrind:
+ make VG="@VG@" check
+
+In either case, check that the right program is being tested by
+examining the F<tmp/valgrind*> log files carefully.
+
=head1 SUBMITTING PATCHES
Submit patches to the mailing list:
--
2.5.0