diff --git a/configure.ac b/configure.ac
index d6f64e59d..42e5103c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1599,7 +1599,6 @@ AC_CONFIG_FILES([Makefile
tests/disk-labels/Makefile
tests/guests/Makefile
tests/guests/guests.xml
- tests/guests/guests-all-good.xml
tests/hotplug/Makefile
tests/luks/Makefile
tests/lvm/Makefile
diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am
index 023c37a1c..49e33eb9d 100644
--- a/tests/guests/Makefile.am
+++ b/tests/guests/Makefile.am
@@ -37,9 +37,7 @@ EXTRA_DIST = \
guest-aux/minimal-hive \
guests.xml.in
-# This is 'check_DATA' because we don't need it until 'make check'
-# time and we need the tools we have built in order to make it.
-check_DATA = \
+disk_images = \
blank-disk.img \
blank-part.img \
blank-fs.img \
@@ -53,6 +51,10 @@ check_DATA = \
ubuntu.img \
windows.img
+# This is 'check_DATA' because we don't need it until 'make check'
+# time and we need the tools we have built in order to make it.
+check_DATA = $(disk_images) guests-all-good.xml
+
CLEANFILES = $(check_DATA) stamp-fedora-md.img *.tmp.*
# Macro to display some information about each created disk, which
@@ -143,6 +145,11 @@ guest-aux/windows-system: guest-aux/windows-system.reg
hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $<
mv $@-t $@
+guests-all-good.xml: $(disk_images) guest-aux/make-guests-all-good.pl
+ rm -f $@ $@-t
+ guest-aux/make-guests-all-good.pl $(disk_images) > $@-t
+ mv $@-t $@
+
# Don't construct the guests in parallel. In automake 1.13, check_DATA
# was changed so it can now run in parallel, but this causes everything
# to fall over on machines with limited memory.
diff --git a/tests/guests/guest-aux/make-guests-all-good.pl b/tests/guests/guest-aux/make-guests-all-good.pl
new file mode 100755
index 000000000..abe055319
--- /dev/null
+++ b/tests/guests/guest-aux/make-guests-all-good.pl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+# libguestfs
+# Copyright (C) 2013 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Make the ../guests-all-good.xml file.
+
+use strict;
+use warnings;
+
+my $outdir = `pwd`; chomp $outdir;
+
+print <<__EOT__;
+
+
+__EOT__
+
+foreach (@ARGV) {
+ my $name = $_;
+ $name =~ s/.img//;
+
+ if (-f $_ && -s $_) {
+ print <<__EOT__;
+
+ $name
+ 1048576
+
+ hvm
+
+
+
+
+
+
+
+
+
+
+__EOT__
+ }
+}
+
+print "";
diff --git a/tests/guests/guests-all-good.xml.in b/tests/guests/guests-all-good.xml.in
deleted file mode 100644
index a8cae1933..000000000
--- a/tests/guests/guests-all-good.xml.in
+++ /dev/null
@@ -1,224 +0,0 @@
-
-
-
-
- blank-bootroot
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- blank-bootrootlv
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- blank-disk
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- blank-fs
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- blank-part
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- debian
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- fedora-btrfs
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- fedora
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- fedora-md1
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- fedora-md2
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- ubuntu
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-
- windows
- 1048576
-
- hvm
-
-
-
-
-
-
-
-
-
-
-
-