[libguestfs/el5] Rebase to upstream stable branch version 1.20.3.

Richard W.M. Jones rjones at fedoraproject.org
Sat Mar 9 22:40:56 UTC 2013


commit b03e9cf3c7b781aa7025d7cfdbc160cc01447326
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Mar 9 21:02:00 2013 +0000

    Rebase to upstream stable branch version 1.20.3.

 .gitignore                                         |    1 +
 ...module-mkstemps-for-RHEL-5-glibc-which-la.patch |   37 ++++
 ...-Allow-rsync-test-to-be-skipped-by-settin.patch |   28 ---
 ...ect-Add-macro-for-be32toh-if-one-is-not-d.patch |   48 +++++
 ...h-copyright-and-license-GPLv2-notices-to-.patch |  194 --------------------
 ...elated-checks-from-autoconf-to-extconf.rb.patch |   67 +++++++
 ...emove-checks-which-fail-with-ancient-qemu.patch |   58 ++++---
 ...L-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch |   41 ++--
 ...ace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch |   10 +-
 ...t-use-C99-style-variable-decls-in-for-loo.patch |   73 +++++---
 ...tch => 0008-EPEL-5-Remove-Erlang-bindings.patch |   40 ++--
 ...ve-GObject-GObject-Introspection-GJS-bind.patch |   85 ++++-----
 ....patch => 0010-EPEL-5-Remove-PHP-bindings.patch |   65 ++++----
 ...L-5-Define-le64toh-le32toh-if-not-defined.patch |    6 +-
 ...> 0012-EPEL-5-Add-gnulib-utimensat-module.patch |   24 +--
 ...ocamlopt-didn-t-support-debugging-g-optio.patch |   16 +-
 ...ace-format6-with-format4-in-OCaml-gettext.patch |    8 +-
 ...s-preserve-dup-deps-explicitly-to-libtool.patch |    8 +-
 ...ve-id-from-drive-parameter-on-qemu-comman.patch |   24 ++-
 ...null-vmchannel-back-for-qemu-without-virt.patch |  132 +++++++++-----
 ...0018-EPEL-5-Disable-libvirt-attach-method.patch |    8 +-
 ...5-Fix-blkid-to-return-LVM2_member-for-PVs.patch |   10 +-
 ...sify-Fix-command-line-options-for-old-qem.patch |    8 +-
 ... 0021-EPEL-5-Remove-Fedora-MD-test-images.patch |   28 ++--
 ...> 0022-EPEL-5-Add-mkisofs-to-package-list.patch |    8 +-
 ...1-second-pause-after-unmounting-any-files.patch |   14 +-
 ...0024-EPEL-5-podwrapper-Remove-HTML-output.patch |   13 +-
 ... 0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch |    8 +-
 0026-EPEL-5-Don-t-use-sgabios.patch                |   33 ----
 ...rt-Mac-OS-X-Use-libtool-mode-execute-inst.patch |   22 +-
 0027-EPEL-5-Don-t-use-sgabios.patch                |   35 ++++
 ...rt-daemon-Remove-e2prog-hack-only-needed-.patch |  129 +++++++-------
 ....patch => 0029-EPEL-5-Disable-tar-xz-test.patch |   16 +-
 ...re-sparsify-error-if-qemu-img-help-is-kil.patch |    6 +-
 ...rt-daemon-remove-call-to-obsolete-udevset.patch |   44 +++++
 0032-EPEL-5-No-libtoolize-install-option.patch     |   25 +++
 0033-EPEL-5-Disable-valgrind.patch                 |   28 +++
 0034-EPEL-5-Remove-Linux-capabilities.patch        |   34 ++++
 ...-Use-old-rake-rdoctask-and-rake-gempackag.patch |   44 +++++
 ...Custom-replacement-for-Unix.isatty-stdout.patch |   58 ++++++
 bootstrap                                          |   10 +-
 libguestfs.spec                                    |   79 +++++----
 sources                                            |    4 +-
 43 files changed, 938 insertions(+), 691 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5bb46e2..5612c4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 /noarch/
 /libguestfs-*.tar.gz
 /gnulib-4fb7ea20122.tar.gz
+/gnulib-4a8c422f.tar.gz
diff --git a/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch b/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch
new file mode 100644
index 0000000..01e7213
--- /dev/null
+++ b/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch
@@ -0,0 +1,37 @@
+From 5706aaf0542fb67ba9398076f2531911bdd95dd3 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Sat, 9 Mar 2013 18:36:09 +0000
+Subject: [PATCH 01/36] gnulib: Use module mkstemps for RHEL 5 glibc which lacked this function.
+
+---
+ bootstrap     |    1 +
+ m4/.gitignore |    1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/bootstrap b/bootstrap
+index be0dfe4..931646b 100755
+--- a/bootstrap
++++ b/bootstrap
+@@ -68,6 +68,7 @@ maintainer-makefile
+ manywarnings
+ memmem
+ mkdtemp
++mkstemps
+ netdb
+ netinet_in
+ openat
+diff --git a/m4/.gitignore b/m4/.gitignore
+index 0d903b7..b827552 100644
+--- a/m4/.gitignore
++++ b/m4/.gitignore
+@@ -138,6 +138,7 @@
+ /mgetgroups.m4
+ /mkdir.m4
+ /mkdtemp.m4
++/mkstemps.m4
+ /mmap-anon.m4
+ /mode_t.m4
+ /msvc-inval.m4
+-- 
+1.7.4.1
+
diff --git a/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch b/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch
new file mode 100644
index 0000000..90131ba
--- /dev/null
+++ b/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch
@@ -0,0 +1,48 @@
+From 1fe7310e8564915508158f68e9d2f3187f7bdfbe Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 8 Mar 2013 20:16:04 +0000
+Subject: [PATCH 02/36] RHEL 5: inspect: Add macro for be32toh if one is not defined in the header files.
+
+---
+ configure.ac       |    1 +
+ src/inspect-apps.c |   12 ++++++++++++
+ 2 files changed, 13 insertions(+), 0 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9d73c67..7a6df55 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -279,6 +279,7 @@ AC_CHECK_HEADERS([\
+ 
+ dnl Functions.
+ AC_CHECK_FUNCS([\
++    be32toh \
+     fsync \
+     futimens \
+     getxattr \
+diff --git a/src/inspect-apps.c b/src/inspect-apps.c
+index 135adf7..747985e 100644
+--- a/src/inspect-apps.c
++++ b/src/inspect-apps.c
+@@ -32,6 +32,18 @@
+ #include <endian.h>
+ #endif
+ 
++/* be32toh is usually a macro definend in <endian.h>, but it might be
++ * a function in some system so check both, and if neither is defined
++ * then define be32toh for RHEL 5.
++ */
++#if !defined(HAVE_BE32TOH) && !defined(be32toh)
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define be32toh(x) __bswap_32 (x)
++#else
++#define be32toh(x) (x)
++#endif
++#endif
++
+ #include <pcre.h>
+ 
+ #include "xstrtol.h"
+-- 
+1.7.4.1
+
diff --git a/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch b/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch
new file mode 100644
index 0000000..9d35657
--- /dev/null
+++ b/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch
@@ -0,0 +1,67 @@
+From d736ed25f446fdf5544b36f5139c69b2cbce961b Mon Sep 17 00:00:00 2001
+From: Hilko Bengen <bengen at hilluzination.de>
+Date: Thu, 7 Mar 2013 19:59:26 +0100
+Subject: [PATCH 03/36] Move Ruby-related checks from autoconf to extconf.rb; add extra check for rb_alloc_func_t
+
+Ruby ships its own config.h which may or may not define the same
+relevant constants as our autoconf-generated config.h. Instead of
+trying to specify the exact path to the wanted header file we may just
+as well simply use Ruby's autoconf-inspired checks and macros.
+(cherry picked from commit 0ee24ccf8adb080260a5bb4260593cafe7bc016d)
+---
+ configure.ac                   |    8 --------
+ generator/ruby.ml              |    3 +++
+ ruby/ext/guestfs/extconf.rb.in |    4 ++++
+ 3 files changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7a6df55..897e303 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1161,14 +1161,6 @@ AS_IF([test "x$enable_ruby" != "xno"],[
+             AC_MSG_RESULT([-l$libruby])
+             AC_CHECK_LIB([$libruby],[ruby_init],
+                          [have_libruby=1],[have_libruby=])
+-
+-            dnl Symbols that we substitute when missing.
+-            AS_IF([test -n "$have_libruby"],[
+-                old_LIBS="$LIBS"
+-                LIBS="$LIBS -l$libruby"
+-                AC_CHECK_FUNCS([rb_hash_lookup])
+-                LIBS="$old_LIBS"
+-            ])
+         ],[
+             AC_MSG_RESULT([not found])
+         ])
+diff --git a/generator/ruby.ml b/generator/ruby.ml
+index db16e2a..6065875 100644
+--- a/generator/ruby.ml
++++ b/generator/ruby.ml
+@@ -688,6 +688,9 @@ Init__guestfs (void)
+   e_Error = rb_define_class_under (m_guestfs, \"Error\", rb_eStandardError);
+ 
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
++#ifndef HAVE_TYPE_RB_ALLOC_FUNC_T
++#define rb_alloc_func_t void*
++#endif
+   rb_define_alloc_func (c_guestfs, (rb_alloc_func_t) ruby_guestfs_create);
+ #endif
+ 
+diff --git a/ruby/ext/guestfs/extconf.rb.in b/ruby/ext/guestfs/extconf.rb.in
+index e358551..e4c7441 100644
+--- a/ruby/ext/guestfs/extconf.rb.in
++++ b/ruby/ext/guestfs/extconf.rb.in
+@@ -29,6 +29,10 @@ unless have_library("guestfs", "guestfs_create", "guestfs.h")
+   raise "libguestfs not found"
+ end
+ 
++have_func("rb_hash_lookup")
++have_func("rb_define_alloc_func")
++have_type("rb_alloc_func_t")
++
+ $CFLAGS =
+   "#{$CFLAGS} @CFLAGS@ -DGUESTFS_PRIVATE=1 " <<
+   "@WARN_CFLAGS@ @WERROR_CFLAGS@"
+-- 
+1.7.4.1
+
diff --git a/0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch b/0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
similarity index 62%
rename from 0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
rename to 0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
index 5dd39c7..6b45790 100644
--- a/0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
+++ b/0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
@@ -1,20 +1,20 @@
-From e09b9ab89d5ab3617c5fc9636a576411a6e673ec Mon Sep 17 00:00:00 2001
+From b1c9301708b4e4d456ef45ccb2afbd22f38d0584 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sat, 16 Jun 2012 10:19:39 +0100
-Subject: [PATCH 03/29] EPEL 5: Remove checks which fail with ancient qemu.
+Subject: [PATCH 04/36] EPEL 5: Remove checks which fail with ancient qemu.
 
 Note that g->app.qemu_version and g->app.qemu_devices will both
 be empty strings.
 ---
  configure.ac           |   57 ------------------------------------------------
- src/launch-appliance.c |   14 +----------
- 2 files changed, 2 insertions(+), 69 deletions(-)
+ src/launch-appliance.c |   23 +-----------------
+ 2 files changed, 2 insertions(+), 78 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 21aa292..0db1176 100644
+index 897e303..c1388ff 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -588,63 +588,6 @@ This could be a very old version of qemu, or qemu might not be
+@@ -677,63 +677,6 @@ This could be a very old version of qemu, or qemu might not be
  working.
  ])
      fi
@@ -79,30 +79,42 @@ index 21aa292..0db1176 100644
  
  dnl Enable packet dumps when in verbose mode.  This generates lots
 diff --git a/src/launch-appliance.c b/src/launch-appliance.c
-index 328cd19..3ebaa7b 100644
+index a86a8cc..10f63f1 100644
 --- a/src/launch-appliance.c
 +++ b/src/launch-appliance.c
-@@ -772,18 +772,8 @@ test_qemu (guestfs_h *g)
-     return -1;
-   }
+@@ -767,30 +767,11 @@ test_qemu (guestfs_h *g)
+   if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0)
+     goto error;
  
--  snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -nographic -version 2>/dev/null",
--            g->qemu);
--
--  if (test_qemu_cmd (g, cmd, &g->app.qemu_version) == -1)
--    goto qemu_error;
--
--  snprintf (cmd, sizeof cmd,
--            "LC_ALL=C '%s' -nographic -machine accel=kvm:tcg -device '?' 2>&1",
--            g->qemu);
--
--  if (test_qemu_cmd (g, cmd, &g->app.qemu_devices) == -1)
--    goto qemu_error;
+-  guestfs___cmd_add_arg (cmd2, g->qemu);
+-  guestfs___cmd_add_arg (cmd2, "-nographic");
+-  guestfs___cmd_add_arg (cmd2, "-version");
+-  guestfs___cmd_set_stdout_callback (cmd2, read_all, &g->app.qemu_version,
+-                                     CMD_STDOUT_FLAG_WHOLE_BUFFER);
+-  r = guestfs___cmd_run (cmd2);
+-  if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0)
+-    goto error;
 +  g->app.qemu_version = safe_strdup (g, "");
+ 
+   parse_qemu_version (g);
+ 
+-  guestfs___cmd_add_arg (cmd3, g->qemu);
+-  guestfs___cmd_add_arg (cmd3, "-nographic");
+-  guestfs___cmd_add_arg (cmd3, "-machine");
+-  guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg");
+-  guestfs___cmd_add_arg (cmd3, "-device");
+-  guestfs___cmd_add_arg (cmd3, "?");
+-  guestfs___cmd_clear_capture_errors (cmd3);
+-  guestfs___cmd_set_stderr_to_stdout (cmd3);
+-  guestfs___cmd_set_stdout_callback (cmd3, read_all, &g->app.qemu_devices,
+-                                     CMD_STDOUT_FLAG_WHOLE_BUFFER);
+-  r = guestfs___cmd_run (cmd3);
+-  if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0)
+-    goto error;
 +  g->app.qemu_devices = safe_strdup (g, "");
  
    return 0;
- }
+ 
 -- 
 1.7.4.1
 
diff --git a/0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch b/0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
similarity index 71%
rename from 0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
rename to 0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
index 027e944..dab321b 100644
--- a/0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
+++ b/0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
@@ -1,26 +1,35 @@
-From 8a40ce033a717b4d78b150aedcd831c7b63719ad Mon Sep 17 00:00:00 2001
+From bb3f18070e589c6be3e6a8d9e20cbf88cf9a8cdb Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sat, 16 Jun 2012 10:23:19 +0100
-Subject: [PATCH 04/29] EPEL 5: Remove AS_ECHO_N for ancient autoconf.
+Subject: [PATCH 05/36] EPEL 5: Remove AS_ECHO_N for ancient autoconf.
 
 ---
- configure.ac |   26 +++++++++++++-------------
- 1 files changed, 13 insertions(+), 13 deletions(-)
+ configure.ac |   28 ++++++++++++++--------------
+ 1 files changed, 14 insertions(+), 14 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 0db1176..7f20c5a 100644
+index c1388ff..38998ee 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1346,33 +1346,33 @@ echo
- echo    "Daemon .............................. $enable_daemon"
- echo    "Appliance ........................... $enable_appliance"
- echo    "QEMU ................................ $QEMU $QEMU_OPTIONS"
+@@ -1525,33 +1525,33 @@ echo       "Appliance ........................... $enable_appliance"
+ echo       "QEMU ................................ $QEMU $QEMU_OPTIONS"
+ echo       "guestfish and C-based virt tools .... yes"
+ echo       "FUSE filesystem ..................... $enable_fuse"
+-AS_ECHO_N(["GNU gettext for i18n ................ "])
++echo -n "GNU gettext for i18n ................ "
+ if test "x$HAVE_GNU_GETTEXT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -AS_ECHO_N(["OCaml bindings ...................... "])
 +echo -n "OCaml bindings ...................... "
  if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+-AS_ECHO_N(["OCaml-based virt tools .............. "])
++echo -n "OCaml-based virt tools .............. "
+ if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -AS_ECHO_N(["Perl bindings ....................... "])
 +echo -n "Perl bindings ....................... "
  if test "x$HAVE_PERL_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+-AS_ECHO_N(["Perl-based virt tools ............... "])
++echo -n "Perl-based virt tools ............... "
+ if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -AS_ECHO_N(["Python bindings ..................... "])
 +echo -n "Python bindings ..................... "
  if test "x$HAVE_PYTHON_TRUE" = "x"; then echo "yes"; else echo "no"; fi
@@ -39,23 +48,15 @@ index 0db1176..7f20c5a 100644
 -AS_ECHO_N(["Erlang bindings ..................... "])
 +echo -n "Erlang bindings ..................... "
  if test "x$HAVE_ERLANG_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo    "guestfish and C virt tools .......... yes"
--AS_ECHO_N(["Perl virt tools ..................... "])
-+echo -n "Perl virt tools ..................... "
- if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi
--AS_ECHO_N(["OCaml virt tools .................... "])
-+echo -n "OCaml virt tools .................... "
- if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo "FUSE filesystem ..................... $enable_fuse"
+-AS_ECHO_N(["Lua bindings ........................ "])
++echo -n "Lua bindings ........................ "
+ if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -AS_ECHO_N(["gobject bindings .................... "])
 +echo -n "gobject bindings .................... "
  if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -AS_ECHO_N(["gobject introspection ............... "])
 +echo -n "gobject introspection ............... "
  if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi
--AS_ECHO_N(["GNU gettext for i18n ................ "])
-+echo -n "GNU gettext for i18n ................ "
- if test "x$HAVE_GNU_GETTEXT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
  echo
  echo "If any optional component is configured 'no' when you expected 'yes'"
 -- 
diff --git a/0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch b/0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
similarity index 66%
rename from 0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
rename to 0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
index 5f55433..ddf6e97 100644
--- a/0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
+++ b/0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
@@ -1,18 +1,18 @@
-From a62e60ccfcc25b5ea14ec05cb99478412323dc33 Mon Sep 17 00:00:00 2001
+From 21e884d68eefc155a07eb184e650637b90b4780b Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sat, 16 Jun 2012 10:46:20 +0100
-Subject: [PATCH 05/29] EPEL 5: Replace macro AC_STRUCT_DIRENT_D_TYPE for ancient autoconf.
+Subject: [PATCH 06/36] EPEL 5: Replace macro AC_STRUCT_DIRENT_D_TYPE for ancient autoconf.
 
 ---
  configure.ac |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 7f20c5a..4e141f6 100644
+index 38998ee..ad2897d 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -190,7 +190,7 @@ dnl Check sizeof long.
- AC_CHECK_SIZEOF([long])
+@@ -251,7 +251,7 @@ The code will still compile, but is likely to leak memory and other
+ resources when it runs.])])
  
  dnl Check if dirent (readdir) supports d_type member.
 -AC_STRUCT_DIRENT_D_TYPE
diff --git a/0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch b/0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
similarity index 57%
rename from 0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
rename to 0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
index fe497b5..3c74034 100644
--- a/0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
+++ b/0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
@@ -1,19 +1,34 @@
-From 091fecaaaa729dbef19a5cb87e4e2b2c80f2a4ef Mon Sep 17 00:00:00 2001
+From a0be4e9a2503869dd90e94f4cfa4dbde7e85a1ee Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sat, 16 Jun 2012 13:55:44 +0100
-Subject: [PATCH 06/29] EPEL 5: Don't use C99-style variable decls in for-loop.
+Subject: [PATCH 07/36] EPEL 5: Don't use C99-style variable decls in for-loop.
 
 ---
- daemon/md.c                      |    6 ++++--
- generator/generator_bindtests.ml |    3 ++-
- src/inspect-fs-unix.c            |   19 ++++++++++++-------
- 3 files changed, 18 insertions(+), 10 deletions(-)
+ daemon/btrfs.c         |    3 ++-
+ daemon/md.c            |    6 ++++--
+ generator/bindtests.ml |    3 ++-
+ src/inspect-fs-unix.c  |   17 +++++++++++------
+ 4 files changed, 19 insertions(+), 10 deletions(-)
 
+diff --git a/daemon/btrfs.c b/daemon/btrfs.c
+index 81ce5f5..7053642 100644
+--- a/daemon/btrfs.c
++++ b/daemon/btrfs.c
+@@ -388,7 +388,8 @@ do_btrfs_subvolume_list (const char *fs)
+     goto error;
+   }
+ 
+-  for (size_t i = 0; i < nr_subvolumes; ++i) {
++  size_t i;
++  for (i = 0; i < nr_subvolumes; ++i) {
+     /* To avoid allocations, reuse the 'line' buffer to store the
+      * path.  Thus we don't need to free 'line', since it will be
+      * freed by the calling (XDR) code.
 diff --git a/daemon/md.c b/daemon/md.c
-index 4281b4e..0f5d8f5 100644
+index b302a8c..d106783 100644
 --- a/daemon/md.c
 +++ b/daemon/md.c
-@@ -204,7 +204,8 @@ do_list_md_devices (void)
+@@ -201,7 +201,8 @@ do_list_md_devices (void)
      goto error;
    }
  
@@ -23,7 +38,7 @@ index 4281b4e..0f5d8f5 100644
      size_t len = strlen (mds.gl_pathv[i]) - strlen (PREFIX) - strlen (SUFFIX);
  
  #define DEV "/dev/md"
-@@ -280,7 +281,8 @@ do_md_detail(const char *md)
+@@ -277,7 +278,8 @@ do_md_detail(const char *md)
         * case */
        if (STRPREFIX (line, "MD_")) {
          line += 3;
@@ -33,11 +48,11 @@ index 4281b4e..0f5d8f5 100644
            *j = c_tolower (*j);
          }
        }
-diff --git a/generator/generator_bindtests.ml b/generator/generator_bindtests.ml
-index 54c46fa..6b0e328 100644
---- a/generator/generator_bindtests.ml
-+++ b/generator/generator_bindtests.ml
-@@ -247,7 +247,8 @@ print_strings (guestfs_h *g, char *const *argv)
+diff --git a/generator/bindtests.ml b/generator/bindtests.ml
+index 55c39cb..6650547 100644
+--- a/generator/bindtests.ml
++++ b/generator/bindtests.ml
+@@ -250,7 +250,8 @@ print_strings (guestfs_h *g, char *const *argv)
               pr "  r = safe_calloc (g, sizeof *r, 1);\n";
               pr "  r->len = len;\n";
               pr "  r->val = safe_calloc (g, r->len, sizeof *r->val);\n";
@@ -48,10 +63,10 @@ index 54c46fa..6b0e328 100644
               pr "  }\n";
               pr "  return r;\n"
 diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
-index c00e69b..231dbd3 100644
+index 40f797d..0917a8d 100644
 --- a/src/inspect-fs-unix.c
 +++ b/src/inspect-fs-unix.c
-@@ -919,7 +919,8 @@ uuid_hash(const void *x, size_t table_size)
+@@ -994,7 +994,8 @@ uuid_hash(const void *x, size_t table_size)
    const md_uuid *a = x;
  
    size_t h = a->uuid[0];
@@ -61,7 +76,7 @@ index c00e69b..231dbd3 100644
      h ^= a->uuid[i];
    }
  
-@@ -932,7 +933,8 @@ uuid_cmp(const void *x, const void *y)
+@@ -1007,7 +1008,8 @@ uuid_cmp(const void *x, const void *y)
    const md_uuid *a = x;
    const md_uuid *b = y;
  
@@ -71,29 +86,27 @@ index c00e69b..231dbd3 100644
      if (a->uuid[i] != b->uuid[i]) return 0;
    }
  
-@@ -996,8 +998,9 @@ map_app_md_devices (guestfs_h *g, Hash_table **map)
+@@ -1071,7 +1073,8 @@ map_app_md_devices (guestfs_h *g, Hash_table **map)
    mds = guestfs_list_md_devices(g);
    if (mds == NULL) goto error;
  
 -  for (char **md = mds; *md != NULL; md++) {
--    char **detail = guestfs_md_detail(g, *md);
-+  char **md, **detail;
++  char **md;
 +  for (md = mds; *md != NULL; md++) {
-+    detail = guestfs_md_detail(g, *md);
+     CLEANUP_FREE_STRING_LIST char **detail = guestfs_md_detail (g, *md);
      if (detail == NULL) goto error;
  
-     /* Iterate over keys until we find uuid */
-@@ -1117,7 +1120,8 @@ map_md_devices(guestfs_h *g, Hash_table **map)
+@@ -1182,7 +1185,8 @@ map_md_devices(guestfs_h *g, Hash_table **map)
                                     mdadm_app_free);
    if (!*map) g->abort_cb();
  
--  for (char **match = matches; *match != NULL; match++) {
-+  char **match;
-+  for (match = matches; *match != NULL; match++) {
+-  for (char **m = matches; *m != NULL; m++) {
++  char **m;
++  for (m = matches; *m != NULL; m++) {
      /* Get device name and uuid for each array */
-     char *dev_path = safe_asprintf(g, "%s/devicename", *match);
-     char *dev = guestfs_aug_get(g, dev_path);
-@@ -1433,7 +1437,8 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
+     CLEANUP_FREE char *dev_path = safe_asprintf (g, "%s/devicename", *m);
+     char *dev = guestfs_aug_get (g, dev_path);
+@@ -1475,7 +1479,8 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
                       int (*f) (guestfs_h *, struct inspect_fs *))
  {
    /* Security: Refuse to do this if a config file is too large. */
@@ -103,7 +116,7 @@ index c00e69b..231dbd3 100644
      if (guestfs_exists(g, *i) == 0) continue;
  
      int64_t size = guestfs_filesize (g, *i);
-@@ -1471,7 +1476,7 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
+@@ -1514,7 +1519,7 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
  
  #define EXCL " and . != \""
  #define EXCL_LEN (strlen(EXCL))
diff --git a/0007-EPEL-5-Remove-Erlang-bindings.patch b/0008-EPEL-5-Remove-Erlang-bindings.patch
similarity index 70%
rename from 0007-EPEL-5-Remove-Erlang-bindings.patch
rename to 0008-EPEL-5-Remove-Erlang-bindings.patch
index ca0932b..951f864 100644
--- a/0007-EPEL-5-Remove-Erlang-bindings.patch
+++ b/0008-EPEL-5-Remove-Erlang-bindings.patch
@@ -1,7 +1,7 @@
-From 12e28180ebe9dc15490ce183399ff11d2fbe0e2b Mon Sep 17 00:00:00 2001
+From 55d66110bf342aa05c54cf1ee5c3f83bbd98bb3f Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sat, 16 Jun 2012 14:34:25 +0100
-Subject: [PATCH 07/29] EPEL 5: Remove Erlang bindings.
+Subject: [PATCH 08/36] EPEL 5: Remove Erlang bindings.
 
 ---
  Makefile.am  |    3 ---
@@ -10,31 +10,31 @@ Subject: [PATCH 07/29] EPEL 5: Remove Erlang bindings.
  3 files changed, 0 insertions(+), 28 deletions(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index c71c66a..281864f 100644
+index 842008a..340a6d6 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -88,9 +88,6 @@ endif
+@@ -91,9 +91,6 @@ endif
  if HAVE_PHP
  SUBDIRS += php
  endif
 -if HAVE_ERLANG
 -SUBDIRS += erlang erlang/examples
 -endif
- if HAVE_GOBJECT
- SUBDIRS += gobject
+ if HAVE_LUA
+ SUBDIRS += lua lua/examples
  endif
 diff --git a/configure.ac b/configure.ac
-index 4e141f6..deace63 100644
+index ad2897d..6f72688 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1146,25 +1146,6 @@ AS_IF([test "x$enable_php" != "xno"],
-         ])
+@@ -1290,25 +1290,6 @@ AS_IF([test "x$enable_php" != "xno"],[
+ ])
  AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"])
  
 -dnl Erlang
 -ERLANG=no
 -AC_ARG_ENABLE([erlang],
--    AS_HELP_STRING([--disable-erlang], [Disable Erlang language bindings]),
+-    AS_HELP_STRING([--disable-erlang], [disable Erlang language bindings]),
 -         [],
 -         [enable_erlang=yes])
 -# NB: Don't use AS_IF here: it doesn't work.
@@ -50,10 +50,10 @@ index 4e141f6..deace63 100644
 -fi
 -AM_CONDITIONAL([HAVE_ERLANG], [test "x$ERLANG" != "xno" && test "x$ERLC" != "xno"])
 -
- dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
- AS_IF([test "x$PERL" != "xno"],
-         [
-@@ -1273,8 +1254,6 @@ AC_CONFIG_FILES([Makefile
+ dnl Lua
+ AC_ARG_ENABLE([lua],
+     AS_HELP_STRING([--disable-lua], [disable Lua language bindings]),
+@@ -1442,8 +1423,6 @@ AC_CONFIG_FILES([Makefile
                   daemon/Makefile
                   df/Makefile
                   edit/Makefile
@@ -62,20 +62,20 @@ index 4e141f6..deace63 100644
                   examples/Makefile
                   fish/Makefile
                   format/Makefile
-@@ -1360,8 +1339,6 @@ echo -n "Haskell bindings .................... "
+@@ -1545,8 +1524,6 @@ echo -n "Haskell bindings .................... "
  if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi
  echo -n "PHP bindings ........................ "
  if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -echo -n "Erlang bindings ..................... "
 -if test "x$HAVE_ERLANG_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo    "guestfish and C virt tools .......... yes"
- echo -n "Perl virt tools ..................... "
- if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+ echo -n "Lua bindings ........................ "
+ if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+ echo -n "gobject bindings .................... "
 diff --git a/po/POTFILES b/po/POTFILES
-index 19cb0b5..2942d79 100644
+index 1c272b8..e51d543 100644
 --- a/po/POTFILES
 +++ b/po/POTFILES
-@@ -95,8 +95,6 @@ df/domains.c
+@@ -101,8 +101,6 @@ df/domains.c
  df/main.c
  df/output.c
  edit/virt-edit.c
diff --git a/0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch b/0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
similarity index 70%
rename from 0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
rename to 0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
index 4419ff3..d2e0129 100644
--- a/0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
+++ b/0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
@@ -1,21 +1,21 @@
-From 471ed5723343032ce7eaf083f672cf12e337a524 Mon Sep 17 00:00:00 2001
+From f31016c7d8e57fa6cdb22506c7fadf0a408fbbfe Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sat, 16 Jun 2012 14:35:06 +0100
-Subject: [PATCH 08/29] EPEL 5: Remove GObject / GObject Introspection / GJS bindings.
+Subject: [PATCH 09/36] EPEL 5: Remove GObject / GObject Introspection / GJS bindings.
 
 ---
  Makefile.am  |    3 --
- configure.ac |   68 ----------------------------------------------------------
- po/POTFILES  |   58 -------------------------------------------------
- 3 files changed, 0 insertions(+), 129 deletions(-)
+ configure.ac |   60 -------------------------------------------------------
+ po/POTFILES  |   63 ----------------------------------------------------------
+ 3 files changed, 0 insertions(+), 126 deletions(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index 281864f..710a81c 100644
+index 340a6d6..ee680dc 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -88,9 +88,6 @@ endif
- if HAVE_PHP
- SUBDIRS += php
+@@ -94,9 +94,6 @@ endif
+ if HAVE_LUA
+ SUBDIRS += lua lua/examples
  endif
 -if HAVE_GOBJECT
 -SUBDIRS += gobject
@@ -24,50 +24,41 @@ index 281864f..710a81c 100644
  # Unconditional because nothing is built yet.
  SUBDIRS += csharp
 diff --git a/configure.ac b/configure.ac
-index deace63..1a37987 100644
+index 6f72688..d596c52 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1167,67 +1167,6 @@ AS_IF([test "x$PERL" != "xno"],
+@@ -1341,58 +1341,6 @@ AS_IF([test "x$PERL" != "xno"],[
  AM_CONDITIONAL([HAVE_TOOLS],
      [test "x$PERL" != "xno" && test "x$missing_perl_modules" != "xyes"])
  
 -dnl gobject library
 -AC_ARG_ENABLE([gobject],
--    AS_HELP_STRING([--disable-gobject], [Disable GObject bindings]),
+-    AS_HELP_STRING([--disable-gobject], [disable GObject bindings]),
 -    [],
 -    [enable_gobject=yes])
--AS_IF(
--  [test "x$enable_gobject" != "xno"],
--  [
--    PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.26.0],
--      [
+-AS_IF([test "x$enable_gobject" != "xno"],[
+-    PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.26.0],[
 -        AC_SUBST([GOBJECT_CFLAGS])
 -        AC_SUBST([GOBJECT_LIBS])
 -        AC_DEFINE([HAVE_GOBJECT],[1],
--                  [gobject library found at compile time.])
--      ],
--      [AC_MSG_WARN([gobject library not found, gobject binding will be disabled])]
--    )
+-                  [GObject library found at compile time.])
+-    ],
+-    [AC_MSG_WARN([gobject library not found, gobject binding will be disabled])])
 -
--    PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0],
--      [
+-    PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0],[
 -        AC_SUBST([GIO_CFLAGS])
 -        AC_SUBST([GIO_LIBS])
 -        AC_DEFINE([HAVE_GIO],[1],
 -                  [gio library found at compile time.])
--      ],
--      [AC_MSG_WARN([gio library not found, gobject binding will be disabled])]
--    )
--  ]
--)
+-    ],
+-    [AC_MSG_WARN([gio library not found, gobject binding will be disabled])])
+-])
 -AM_CONDITIONAL([HAVE_GOBJECT],
 -               [test "x$GOBJECT_LIBS" != "x" -a "x$GIO_LIBS" != "x"])
 -
 -AC_CHECK_PROG([GJS],[gjs],[gjs])
--AS_IF(
--  [test "x$GJS" = "x"],
--  [AC_MSG_WARN([gjs not found, gobject bindtests will not run])]
--)
+-AS_IF([test "x$GJS" = "x"],
+-      [AC_MSG_WARN([gjs not found, gobject bindtests will not run])])
 -
 -dnl gobject introspection
 -m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
@@ -87,40 +78,41 @@ index deace63..1a37987 100644
 -
 -# check for gtk-doc
 -m4_ifdef([GTK_DOC_CHECK], [
--GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+-    GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
 -],[
--AM_CONDITIONAL([ENABLE_GTK_DOC], false)
+-    AM_CONDITIONAL([ENABLE_GTK_DOC], false)
 -])
 -
  dnl Library versioning.
  MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
  AC_SUBST(MAX_PROC_NR)
-@@ -1261,9 +1200,6 @@ AC_CONFIG_FILES([Makefile
+@@ -1430,10 +1378,6 @@ AC_CONFIG_FILES([Makefile
                   generator/Makefile
                   gnulib/lib/Makefile
                   gnulib/tests/Makefile
+-                 gobject/libguestfs-gobject-1.0.pc
 -                 gobject/Makefile
 -                 gobject/docs/Makefile
 -                 gobject/docs/guestfs-docs.sgml
                   haskell/Makefile
                   inspector/Makefile
                   java/Makefile
-@@ -1345,10 +1281,6 @@ if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo -n "OCaml virt tools .................... "
- if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo "FUSE filesystem ..................... $enable_fuse"
+@@ -1526,10 +1470,6 @@ echo -n "PHP bindings ........................ "
+ if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+ echo -n "Lua bindings ........................ "
+ if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -echo -n "gobject bindings .................... "
 -if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -echo -n "gobject introspection ............... "
 -if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo -n "GNU gettext for i18n ................ "
- if test "x$HAVE_GNU_GETTEXT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
  echo
+ echo "If any optional component is configured 'no' when you expected 'yes'"
+ echo "then you should check the preceding messages."
 diff --git a/po/POTFILES b/po/POTFILES
-index 2942d79..c9c592c 100644
+index e51d543..1d6227c 100644
 --- a/po/POTFILES
 +++ b/po/POTFILES
-@@ -134,64 +134,6 @@ fish/tilde.c
+@@ -140,69 +140,6 @@ fish/tilde.c
  fish/time.c
  format/format.c
  fuse/guestmount.c
@@ -140,10 +132,14 @@ index 2942d79..c9c592c 100644
 -gobject/src/optargs-hivex_open.c
 -gobject/src/optargs-inspect_get_icon.c
 -gobject/src/optargs-internal_test.c
+-gobject/src/optargs-internal_test_63_optargs.c
+-gobject/src/optargs-internal_test_only_optargs.c
 -gobject/src/optargs-md_create.c
+-gobject/src/optargs-mke2fs.c
 -gobject/src/optargs-mkfs.c
 -gobject/src/optargs-mkfs_btrfs.c
 -gobject/src/optargs-mkswap.c
+-gobject/src/optargs-mktemp.c
 -gobject/src/optargs-mount_9p.c
 -gobject/src/optargs-mount_local.c
 -gobject/src/optargs-ntfsclone_out.c
@@ -163,6 +159,7 @@ index 2942d79..c9c592c 100644
 -gobject/src/optargs-xfs_repair.c
 -gobject/src/session.c
 -gobject/src/struct-application.c
+-gobject/src/struct-application2.c
 -gobject/src/struct-btrfssubvolume.c
 -gobject/src/struct-dirent.c
 -gobject/src/struct-hivex_node.c
@@ -184,7 +181,7 @@ index 2942d79..c9c592c 100644
 -gobject/src/tristate.c
  inspector/virt-inspector.c
  java/com_redhat_et_libguestfs_GuestFS.c
- ocaml/guestfs-c-actions.c
+ lua/lua-guestfs.c
 -- 
 1.7.4.1
 
diff --git a/0009-EPEL-5-Remove-PHP-bindings.patch b/0010-EPEL-5-Remove-PHP-bindings.patch
similarity index 50%
rename from 0009-EPEL-5-Remove-PHP-bindings.patch
rename to 0010-EPEL-5-Remove-PHP-bindings.patch
index 3927c77..457d761 100644
--- a/0009-EPEL-5-Remove-PHP-bindings.patch
+++ b/0010-EPEL-5-Remove-PHP-bindings.patch
@@ -1,54 +1,53 @@
-From f4a1318f01f19b2503c29c6cae9a2cdaf695bee1 Mon Sep 17 00:00:00 2001
+From 1671ac91128a3f54b9a3761aa8583f0fa07d7a6f Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sun, 17 Jun 2012 23:01:43 +0100
-Subject: [PATCH 09/29] EPEL 5: Remove PHP bindings.
+Subject: [PATCH 10/36] EPEL 5: Remove PHP bindings.
 
 ---
  Makefile.am  |    3 ---
- configure.ac |   17 -----------------
+ configure.ac |   16 ----------------
  po/POTFILES  |    1 -
- 3 files changed, 0 insertions(+), 21 deletions(-)
+ 3 files changed, 0 insertions(+), 20 deletions(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index 710a81c..9d67397 100644
+index ee680dc..d263c0d 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -85,9 +85,6 @@ endif
+@@ -88,9 +88,6 @@ endif
  if HAVE_HASKELL
  SUBDIRS += haskell
  endif
 -if HAVE_PHP
 -SUBDIRS += php
 -endif
- 
- # Unconditional because nothing is built yet.
- SUBDIRS += csharp
+ if HAVE_LUA
+ SUBDIRS += lua lua/examples
+ endif
 diff --git a/configure.ac b/configure.ac
-index 1a37987..4f94be9 100644
+index d596c52..944df72 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1132,20 +1132,6 @@ AS_IF([test "x$enable_haskell" != "xno"],
- AM_CONDITIONAL([HAVE_HASKELL],
-     [test "x$GHC" != "xno"])
+@@ -1277,19 +1277,6 @@ AS_IF([test "x$enable_haskell" != "xno"],[
+ ])
+ AM_CONDITIONAL([HAVE_HASKELL],[test "x$GHC" != "xno"])
  
 -dnl PHP
 -PHP=no
 -AC_ARG_ENABLE([php],
--        AS_HELP_STRING([--disable-php], [Disable PHP language bindings]),
--        [],
--        [enable_php=yes])
--AS_IF([test "x$enable_php" != "xno"],
--        [
--        PHP=
--        AC_CHECK_PROG([PHP],[php],[php],[no])
--        AC_CHECK_PROG([PHPIZE],[phpize],[phpize],[no])
--        ])
+-    AS_HELP_STRING([--disable-php], [disable PHP language bindings]),
+-    [],
+-    [enable_php=yes])
+-AS_IF([test "x$enable_php" != "xno"],[
+-    PHP=
+-    AC_CHECK_PROG([PHP],[php],[php],[no])
+-    AC_CHECK_PROG([PHPIZE],[phpize],[phpize],[no])
+-])
 -AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"])
 -
- dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
- AS_IF([test "x$PERL" != "xno"],
-         [
-@@ -1210,7 +1196,6 @@ AC_CONFIG_FILES([Makefile
+ dnl Lua
+ AC_ARG_ENABLE([lua],
+     AS_HELP_STRING([--disable-lua], [disable Lua language bindings]),
+@@ -1390,7 +1377,6 @@ AC_CONFIG_FILES([Makefile
                   perl/Makefile
                   perl/Makefile.PL
                   perl/examples/Makefile
@@ -56,27 +55,27 @@ index 1a37987..4f94be9 100644
                   po-docs/Makefile
                   po-docs/ja/Makefile
                   po-docs/uk/Makefile
-@@ -1273,8 +1258,6 @@ echo -n "Java bindings ....................... "
+@@ -1466,8 +1452,6 @@ echo -n "Java bindings ....................... "
  if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
  echo -n "Haskell bindings .................... "
  if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 -echo -n "PHP bindings ........................ "
 -if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi
- echo    "guestfish and C virt tools .......... yes"
- echo -n "Perl virt tools ..................... "
- if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+ echo -n "Lua bindings ........................ "
+ if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+ echo
 diff --git a/po/POTFILES b/po/POTFILES
-index c9c592c..7609f47 100644
+index 1d6227c..eda59e1 100644
 --- a/po/POTFILES
 +++ b/po/POTFILES
-@@ -142,7 +142,6 @@ perl/Guestfs.c
+@@ -149,7 +149,6 @@ perl/Guestfs.c
  perl/bindtests.pl
  perl/lib/Sys/Guestfs.pm
  perl/lib/Sys/Guestfs/Lib.pm
 -php/extension/guestfs_php.c
  python/guestfs-py-byhand.c
  python/guestfs-py.c
- rescue/virt-rescue.c
+ rescue/test-virt-rescue.pl
 -- 
 1.7.4.1
 
diff --git a/0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch b/0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
similarity index 85%
rename from 0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
rename to 0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
index 274bbe1..dcb2cab 100644
--- a/0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
+++ b/0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
@@ -1,14 +1,14 @@
-From e8eed32149ea9a6d20f6bddc2da0dcf13e213297 Mon Sep 17 00:00:00 2001
+From 90271bd375465a71437724287d814c0ca7237d18 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sun, 17 Jun 2012 22:17:06 +0100
-Subject: [PATCH 10/29] EPEL 5: Define le64toh, le32toh if not defined.
+Subject: [PATCH 11/36] EPEL 5: Define le64toh, le32toh if not defined.
 
 ---
  src/inspect-fs-windows.c |   16 ++++++++++++++++
  1 files changed, 16 insertions(+), 0 deletions(-)
 
 diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c
-index e972e97..d14fed6 100644
+index a979775..1afaf26 100644
 --- a/src/inspect-fs-windows.c
 +++ b/src/inspect-fs-windows.c
 @@ -44,6 +44,22 @@
diff --git a/0011-EPEL-5-Add-gnulib-utimensat-module.patch b/0012-EPEL-5-Add-gnulib-utimensat-module.patch
similarity index 55%
rename from 0011-EPEL-5-Add-gnulib-utimensat-module.patch
rename to 0012-EPEL-5-Add-gnulib-utimensat-module.patch
index 3a10b32..413ac45 100644
--- a/0011-EPEL-5-Add-gnulib-utimensat-module.patch
+++ b/0012-EPEL-5-Add-gnulib-utimensat-module.patch
@@ -1,19 +1,19 @@
-From e794f3a5d7f5016d8e059e2158407365c85f2060 Mon Sep 17 00:00:00 2001
+From fae035aa5c616179c1c6b638ac14f5f268bf41c2 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sun, 17 Jun 2012 22:58:58 +0100
-Subject: [PATCH 11/29] EPEL 5: Add gnulib utimensat module.
+Subject: [PATCH 12/36] EPEL 5: Add gnulib utimensat module.
 
 This function is missing in RHEL 5-era kernels.
 ---
  bootstrap     |    1 +
- m4/.gitignore |    2 ++
- 2 files changed, 3 insertions(+), 0 deletions(-)
+ m4/.gitignore |    1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/bootstrap b/bootstrap
-index be0dfe4..de6e506 100755
+index 931646b..da650ca 100755
 --- a/bootstrap
 +++ b/bootstrap
-@@ -88,6 +88,7 @@ strndup
+@@ -89,6 +89,7 @@ strndup
  symlinkat
  sys_select
  sys_wait
@@ -22,18 +22,10 @@ index be0dfe4..de6e506 100755
  vc-list-files
  warnings
 diff --git a/m4/.gitignore b/m4/.gitignore
-index 78b0628..936fc97 100644
+index b827552..a76d36f 100644
 --- a/m4/.gitignore
 +++ b/m4/.gitignore
-@@ -53,6 +53,7 @@
- /fpurge.m4
- /freading.m4
- /fseeko.m4
-+/fstatat.m4
- /fstat.m4
- /fstatat.m4
- /fsusage.m4
-@@ -238,6 +239,7 @@
+@@ -239,6 +239,7 @@
  /usleep.m4
  /utimbuf.m4
  /utimecmp.m4
diff --git a/0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch b/0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
similarity index 82%
rename from 0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
rename to 0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
index f90b874..34fa3f5 100644
--- a/0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
+++ b/0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
@@ -1,7 +1,7 @@
-From 8a94bcf3b9d1c53f1f988abaa0c1439df8271216 Mon Sep 17 00:00:00 2001
+From c7a9bdeeb7f3ae457c384cf62b664b978502932f Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Sun, 17 Jun 2012 23:00:16 +0100
-Subject: [PATCH 12/29] EPEL 5: Old ocamlopt didn't support debugging (-g option).
+Subject: [PATCH 13/36] EPEL 5: Old ocamlopt didn't support debugging (-g option).
 
 ---
  ocaml/Makefile.am    |    2 +-
@@ -11,7 +11,7 @@ Subject: [PATCH 12/29] EPEL 5: Old ocamlopt didn't support debugging (-g option)
  4 files changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
-index 8264574..1a8baf2 100644
+index 5e8cba5..48ddc2c 100644
 --- a/ocaml/Makefile.am
 +++ b/ocaml/Makefile.am
 @@ -44,7 +44,7 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so
@@ -24,7 +24,7 @@ index 8264574..1a8baf2 100644
  noinst_DATA = mlguestfs.cma mlguestfs.cmxa META
  
 diff --git a/resize/Makefile.am b/resize/Makefile.am
-index fc69aa7..d0d9c9c 100644
+index c69ab44..542ae9a 100644
 --- a/resize/Makefile.am
 +++ b/resize/Makefile.am
 @@ -62,7 +62,7 @@ OCAMLPACKAGES += -package gettext-stub
@@ -37,10 +37,10 @@ index fc69aa7..d0d9c9c 100644
  virt-resize: $(OBJECTS)
  	$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
 diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
-index d36dcdd..c1a7ee9 100644
+index b5eba63..329d801 100644
 --- a/sparsify/Makefile.am
 +++ b/sparsify/Makefile.am
-@@ -61,7 +61,7 @@ OCAMLPACKAGES += -package gettext-stub
+@@ -58,7 +58,7 @@ OCAMLPACKAGES += -package gettext-stub
  endif
  
  OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
@@ -50,10 +50,10 @@ index d36dcdd..c1a7ee9 100644
  virt-sparsify: $(OBJECTS)
  	$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
 diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
-index 2ee9abf..b2934cb 100644
+index e16a19d..392dd91 100644
 --- a/sysprep/Makefile.am
 +++ b/sysprep/Makefile.am
-@@ -106,7 +106,7 @@ OCAMLPACKAGES += -package gettext-stub
+@@ -108,7 +108,7 @@ OCAMLPACKAGES += -package gettext-stub
  endif
  
  OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
diff --git a/0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch b/0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
similarity index 84%
rename from 0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
rename to 0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
index f3b4183..c117981 100644
--- a/0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
+++ b/0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
@@ -1,17 +1,17 @@
-From 9f894c4f11a01fe7f9de3d236672b675a987ad3d Mon Sep 17 00:00:00 2001
+From 154de10cc6f0b318d120523ca97306bcce6de872 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Mon, 18 Jun 2012 08:35:14 +0100
-Subject: [PATCH 13/29] EPEL 5: Replace format6 with format4 in OCaml gettext routines.
+Subject: [PATCH 14/36] EPEL 5: Replace format6 with format4 in OCaml gettext routines.
 
 ---
  configure.ac |   10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 4f94be9..ae5d3d2 100644
+index 944df72..c72038c 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -805,14 +805,14 @@ EOF
+@@ -961,14 +961,14 @@ EOF
              cat <<EOF >>$output
  module Gettext = struct
    external s_ : string -> string = "%identity"
diff --git a/0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch b/0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
similarity index 79%
rename from 0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
rename to 0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
index 830c553..ec78af4 100644
--- a/0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
+++ b/0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
@@ -1,7 +1,7 @@
-From 2c715fb5835d0bf3b24d94023065780586c82dc6 Mon Sep 17 00:00:00 2001
+From fedc248bd1f29c608530e81cbf39aa36e056c85b Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Mon, 18 Jun 2012 12:18:35 +0100
-Subject: [PATCH 14/29] EPEL 5: Pass --preserve-dup-deps explicitly to libtool.
+Subject: [PATCH 15/36] EPEL 5: Pass --preserve-dup-deps explicitly to libtool.
 
 See this thread:
 https://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00162.html
@@ -10,10 +10,10 @@ https://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00162.html
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index ae5d3d2..426a77b 100644
+index c72038c..d26b815 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1159,7 +1159,7 @@ AC_SUBST(MAX_PROC_NR)
+@@ -1334,7 +1334,7 @@ AC_SUBST(MAX_PROC_NR)
  
  dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files
  dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html
diff --git a/0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch b/0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
similarity index 53%
rename from 0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
rename to 0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
index 92f3683..f568c67 100644
--- a/0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
+++ b/0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
@@ -1,35 +1,37 @@
-From 967f72bfafe273039df3e69032be2bedb4137072 Mon Sep 17 00:00:00 2001
+From ad25114b2b3f996d476b6fd22608a811f86eb92f Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Mon, 18 Jun 2012 17:21:30 +0100
-Subject: [PATCH 15/29] EPEL 5: Remove id= from -drive parameter on qemu command line.
+Subject: [PATCH 16/36] EPEL 5: Remove id= from -drive parameter on qemu command line.
 
 ---
  src/launch-appliance.c |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)
 
 diff --git a/src/launch-appliance.c b/src/launch-appliance.c
-index 3ebaa7b..4d63101 100644
+index 10f63f1..62ab76e 100644
 --- a/src/launch-appliance.c
 +++ b/src/launch-appliance.c
-@@ -296,7 +296,7 @@ launch_appliance (guestfs_h *g, const char *arg)
- 
-       char buf2[PATH_MAX + 64];
+@@ -339,7 +339,7 @@ launch_appliance (guestfs_h *g, const char *arg)
+       size_t buf2_len = strlen (appliance) + 64;
+       char buf2[buf2_len];
        add_cmdline (g, "-drive");
--      snprintf (buf2, sizeof buf2, "file=%s,snapshot=on,id=appliance,if=%s%s",
-+      snprintf (buf2, sizeof buf2, "file=%s,snapshot=on,if=%s%s",
+-      snprintf (buf2, buf2_len, "file=%s,snapshot=on,id=appliance,if=%s%s",
++      snprintf (buf2, buf2_len, "file=%s,snapshot=on,if=%s%s",
                  appliance, virtio_scsi ? "none" : "virtio", cachemode);
        add_cmdline (g, buf2);
  
-@@ -932,12 +932,11 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index)
+@@ -957,14 +957,13 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index)
    else
      iface = "virtio";
  
--  snprintf (&r[i], len-i, "%s%s%s%s,id=hd%zu,if=%s",
-+  snprintf (&r[i], len-i, "%s%s%s%s,if=%s",
+-  snprintf (&r[i], len-i, "%s%s%s%s%s%s,id=hd%zu,if=%s",
++  snprintf (&r[i], len-i, "%s%s%s%s%s%s,if=%s",
              drv->readonly ? ",snapshot=on" : "",
              drv->use_cache_none ? ",cache=none" : "",
              drv->format ? ",format=" : "",
              drv->format ? drv->format : "",
+             drv->disk_label ? ",serial=" : "",
+             drv->disk_label ? drv->disk_label : "",
 -            index,
              iface);
  
diff --git a/0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch b/0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
similarity index 77%
rename from 0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
rename to 0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
index f662e7c..d0fe18c 100644
--- a/0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
+++ b/0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
@@ -1,16 +1,18 @@
-From 46019c0f7b49ffa351c6a21e6e6122c8e54d14fc Mon Sep 17 00:00:00 2001
+From 16a1d7d70609283c75ddcfd59b2289d4411519ba Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Mon, 18 Jun 2012 16:06:34 +0100
-Subject: [PATCH 16/29] EPEL 5: Add "null vmchannel" back for qemu without virtio-serial support.
+Subject: [PATCH 17/36] EPEL 5: Add "null vmchannel" back for qemu without virtio-serial support.
 
 ---
  appliance/init         |    4 +-
  daemon/guestfsd.c      |   99 ++++++++++++++++++++++--
+ src/guestfs-internal.h |    2 +-
  src/launch-appliance.c |  196 ++++++++++++++++++++++++++++++++++--------------
- 3 files changed, 233 insertions(+), 66 deletions(-)
+ src/launch.c           |    4 +-
+ 5 files changed, 236 insertions(+), 69 deletions(-)
 
 diff --git a/appliance/init b/appliance/init
-index f9818b6..bdb30c4 100755
+index dee4efc..813cd20 100755
 --- a/appliance/init
 +++ b/appliance/init
 @@ -77,10 +77,10 @@ hwclock -u -s
@@ -27,10 +29,10 @@ index f9818b6..bdb30c4 100755
  # Scan for MDs.
  mdadm -As --auto=yes --run
 diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
-index e6d5fde..ba1a48b 100644
+index 254e0ea..bcb836a 100644
 --- a/daemon/guestfsd.c
 +++ b/daemon/guestfsd.c
-@@ -115,9 +115,6 @@ int autosync_umount = 1;
+@@ -118,9 +118,6 @@ int autosync_umount = 1;
  /* Not used explicitly, but required by the gnulib 'error' module. */
  const char *program_name = "guestfsd";
  
@@ -40,7 +42,7 @@ index e6d5fde..ba1a48b 100644
  static void
  usage (void)
  {
-@@ -136,6 +133,7 @@ main (int argc, char *argv[])
+@@ -139,6 +136,7 @@ main (int argc, char *argv[])
    };
    int c;
    char *cmdline;
@@ -48,7 +50,7 @@ index e6d5fde..ba1a48b 100644
  
    ignore_value (chdir ("/"));
  
-@@ -207,8 +205,6 @@ main (int argc, char *argv[])
+@@ -210,8 +208,6 @@ main (int argc, char *argv[])
        printf ("could not read linux command line\n");
    }
  
@@ -57,7 +59,7 @@ index e6d5fde..ba1a48b 100644
  #ifndef WIN32
    /* Make sure SIGPIPE doesn't kill us. */
    struct sigaction sa;
-@@ -250,9 +246,94 @@ main (int argc, char *argv[])
+@@ -253,9 +249,94 @@ main (int argc, char *argv[])
     */
    copy_lvm ();
  
@@ -154,7 +156,7 @@ index e6d5fde..ba1a48b 100644
      fprintf (stderr,
               "\n"
               "Failed to connect to virtio-serial channel.\n"
-@@ -266,7 +347,7 @@ main (int argc, char *argv[])
+@@ -269,7 +350,7 @@ main (int argc, char *argv[])
               "output to the libguestfs developers, either in a bug report\n"
               "or on the libguestfs redhat com mailing list.\n"
               "\n");
@@ -163,7 +165,7 @@ index e6d5fde..ba1a48b 100644
      exit (EXIT_FAILURE);
    }
  
-@@ -286,6 +367,8 @@ main (int argc, char *argv[])
+@@ -300,6 +381,8 @@ main (int argc, char *argv[])
  
    xdr_destroy (&xdr);
  
@@ -172,13 +174,26 @@ index e6d5fde..ba1a48b 100644
    /* Enter the main loop, reading and performing actions. */
    main_loop (sock);
  
+diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
+index dab8224..a40682a 100644
+--- a/src/guestfs-internal.h
++++ b/src/guestfs-internal.h
+@@ -510,7 +510,7 @@ extern void guestfs___rollback_drives (guestfs_h *g, size_t);
+ extern void guestfs___launch_failed_error (guestfs_h *g);
+ extern void guestfs___add_dummy_appliance_drive (guestfs_h *g);
+ extern void guestfs___free_drives (guestfs_h *g);
+-extern char *guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags);
++extern char *guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags, const char *vmchannel);
+ #define APPLIANCE_COMMAND_LINE_IS_TCG 1
+ 
+ /* launch-appliance.c */
 diff --git a/src/launch-appliance.c b/src/launch-appliance.c
-index 4d63101..59ca93c 100644
+index 62ab76e..570f6cf 100644
 --- a/src/launch-appliance.c
 +++ b/src/launch-appliance.c
-@@ -36,12 +36,16 @@
- #include "guestfs-internal-actions.h"
- #include "guestfs_protocol.h"
+@@ -74,12 +74,16 @@ free_regexps (void)
+   pcre_free (re_major_minor);
+ }
  
 +#define NETWORK "10.0.2.0/24"
 +#define ROUTER "10.0.2.2"
@@ -193,7 +208,7 @@ index 4d63101..59ca93c 100644
  
  /* Functions to build up the qemu command line.  These are only run
   * in the child process so no clean-up is required.
-@@ -127,7 +131,9 @@ launch_appliance (guestfs_h *g, const char *arg)
+@@ -169,7 +173,9 @@ launch_appliance (guestfs_h *g, const char *arg)
    int r;
    int wfd[2], rfd[2];
    char guestfsd_sock[256];
@@ -201,10 +216,10 @@ index 4d63101..59ca93c 100644
 +  struct sockaddr_in addr;
 +  socklen_t addrlen = sizeof addr;
 +  int null_vmchannel_port;
- 
-   /* At present you must add drives before starting the appliance.  In
-    * future when we enable hotplugging you won't need to do this.
-@@ -157,37 +163,43 @@ launch_appliance (guestfs_h *g, const char *arg)
+   CLEANUP_FREE char *kernel = NULL, *initrd = NULL, *appliance = NULL;
+   int has_appliance_drive;
+   uint32_t size;
+@@ -203,37 +209,43 @@ launch_appliance (guestfs_h *g, const char *arg)
    if (qemu_supports (g, NULL) == -1)
      goto cleanup0;
  
@@ -263,7 +278,7 @@ index 4d63101..59ca93c 100644
    if (!g->direct) {
      if (pipe (wfd) == -1 || pipe (rfd) == -1) {
        perrorf (g, "pipe");
-@@ -370,23 +382,9 @@ launch_appliance (guestfs_h *g, const char *arg)
+@@ -412,23 +424,9 @@ launch_appliance (guestfs_h *g, const char *arg)
      if (qemu_supports (g, "-rtc-td-hack"))
        add_cmdline (g, "-rtc-td-hack");
  
@@ -286,11 +301,11 @@ index 4d63101..59ca93c 100644
      add_cmdline (g, "stdio");
 -#endif
  
-     /* Use sgabios instead of vgabios.  This means we'll see BIOS
-      * messages on the serial port, and also works around this bug
-@@ -397,12 +395,16 @@ launch_appliance (guestfs_h *g, const char *arg)
-     add_cmdline (g, "-device");
-     add_cmdline (g, "sga");
+     if (qemu_supports_device (g, "Serial Graphics Adapter")) {
+       /* Use sgabios instead of vgabios.  This means we'll see BIOS
+@@ -441,12 +439,16 @@ launch_appliance (guestfs_h *g, const char *arg)
+       add_cmdline (g, "sga");
+     }
  
 -    /* Set up virtio-serial for the communications channel. */
 -    add_cmdline (g, "-chardev");
@@ -311,7 +326,7 @@ index 4d63101..59ca93c 100644
  
  #ifdef VALGRIND_DAEMON
      /* Set up virtio-serial channel for valgrind messages. */
-@@ -414,14 +416,6 @@ launch_appliance (guestfs_h *g, const char *arg)
+@@ -458,14 +460,6 @@ launch_appliance (guestfs_h *g, const char *arg)
      add_cmdline (g, "virtserialport,chardev=valgrind,name=org.libguestfs.valgrind");
  #endif
  
@@ -323,24 +338,19 @@ index 4d63101..59ca93c 100644
 -      add_cmdline (g, "virtio-net-pci,netdev=usernet");
 -    }
 -
- #if defined(__arm__)
- #define SERIAL_CONSOLE "ttyAMA0"
- #else
-@@ -442,11 +436,13 @@ launch_appliance (guestfs_h *g, const char *arg)
-               LINUX_CMDLINE
-               "%s "             /* (root) */
-               "%s "             /* (selinux) */
-+              "%s "             /* (vmchannel) */
-               "%s "             /* (verbose) */
-               "TERM=%s "        /* (TERM environment variable) */
-               "%s",             /* (append) */
-               appliance_root,
-               g->selinux ? "selinux=1 enforcing=0" : "selinux=0",
-+              vmchannel,
-               g->verbose ? "guestfs_verbose=1" : "",
-               getenv ("TERM") ? : "linux",
-               g->append ? g->append : "");
-@@ -619,19 +615,30 @@ launch_appliance (guestfs_h *g, const char *arg)
+     add_cmdline (g, "-kernel");
+     add_cmdline (g, kernel);
+     add_cmdline (g, "-initrd");
+@@ -473,7 +467,7 @@ launch_appliance (guestfs_h *g, const char *arg)
+ 
+     add_cmdline (g, "-append");
+     CLEANUP_FREE char *cmdline =
+-      guestfs___appliance_command_line (g, appliance_dev, 0);
++      guestfs___appliance_command_line (g, appliance_dev, 0, vmchannel);
+     add_cmdline (g, cmdline);
+ 
+     /* Finish off the command line. */
+@@ -617,19 +611,30 @@ launch_appliance (guestfs_h *g, const char *arg)
  
    g->state = LAUNCHING;
  
@@ -382,7 +392,7 @@ index 4d63101..59ca93c 100644
  
    /* Close the listening socket. */
    if (close (g->sock) != 0) {
-@@ -954,6 +961,83 @@ guestfs___drive_name (size_t index, char *ret)
+@@ -981,6 +986,83 @@ guestfs___drive_name (size_t index, char *ret)
    return ret;
  }
  
@@ -464,8 +474,36 @@ index 4d63101..59ca93c 100644
 +}
 +
  static int
- shutdown_appliance (guestfs_h *g)
+ shutdown_appliance (guestfs_h *g, int check_for_errors)
+ {
+diff --git a/src/launch.c b/src/launch.c
+index 7c37667..b634b32 100644
+--- a/src/launch.c
++++ b/src/launch.c
+@@ -809,7 +809,7 @@ guestfs__get_state (guestfs_h *g)
+ 
+ char *
+ guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev,
+-                                  int flags)
++                                  int flags, const char *vmchannel)
  {
+   char *term = getenv ("TERM");
+   char *ret;
+@@ -837,12 +837,14 @@ guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev,
+      " cgroup_disable=memory"   /* saves us about 5 MB of RAM */
+      " root=%s"                 /* root (appliance_dev) */
+      " %s"                      /* selinux */
++     " %s"                      /* vmchannel */
+      "%s"                       /* verbose */
+      " TERM=%s"                 /* TERM environment variable */
+      "%s%s",                    /* append */
+      lpj_s,
+      appliance_dev,
+      g->selinux ? "selinux=1 enforcing=0" : "selinux=0",
++     vmchannel,
+      g->verbose ? " guestfs_verbose=1" : "",
+      term ? term : "linux",
+      g->append ? " " : "", g->append ? g->append : "");
 -- 
 1.7.4.1
 
diff --git a/0017-EPEL-5-Disable-libvirt-attach-method.patch b/0018-EPEL-5-Disable-libvirt-attach-method.patch
similarity index 76%
rename from 0017-EPEL-5-Disable-libvirt-attach-method.patch
rename to 0018-EPEL-5-Disable-libvirt-attach-method.patch
index 3134136..852aa80 100644
--- a/0017-EPEL-5-Disable-libvirt-attach-method.patch
+++ b/0018-EPEL-5-Disable-libvirt-attach-method.patch
@@ -1,17 +1,17 @@
-From b3995d6a0c981983dbb311a698f2c044e286406b Mon Sep 17 00:00:00 2001
+From 4285778047a444c8f5fb09c09d4e5ea59a7c0c33 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Thu, 30 Aug 2012 17:57:46 +0100
-Subject: [PATCH 17/29] EPEL 5: Disable libvirt attach method.
+Subject: [PATCH 18/36] EPEL 5: Disable libvirt attach method.
 
 ---
  src/launch-libvirt.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
-index 9f14add..96e72d2 100644
+index e549ae8..c013dee 100644
 --- a/src/launch-libvirt.c
 +++ b/src/launch-libvirt.c
-@@ -66,7 +66,7 @@
+@@ -72,7 +72,7 @@
                               MIN_LIBVIRT_MINOR * 1000 + \
                               MIN_LIBVIRT_MICRO)
  
diff --git a/0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch b/0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
similarity index 82%
rename from 0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
rename to 0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
index 1e49b69..64f8c5a 100644
--- a/0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
+++ b/0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
@@ -1,7 +1,7 @@
-From f27a26238699e4ffb004ee496cd1249fcff2d2a6 Mon Sep 17 00:00:00 2001
+From 33bfbbf0f983f6c84131c3ae96d71cad6665dc37 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 22 Jun 2012 10:06:47 +0100
-Subject: [PATCH 18/29] EPEL 5: Fix blkid to return "LVM2_member" for PVs.
+Subject: [PATCH 19/36] EPEL 5: Fix blkid to return "LVM2_member" for PVs.
 
 Old blkid in RHEL 5 didn't return the right thing for PVs.
 ---
@@ -9,11 +9,11 @@ Old blkid in RHEL 5 didn't return the right thing for PVs.
  1 files changed, 20 insertions(+), 0 deletions(-)
 
 diff --git a/daemon/blkid.c b/daemon/blkid.c
-index b6bc22d..310de94 100644
+index 64919dd..6d94a38 100644
 --- a/daemon/blkid.c
 +++ b/daemon/blkid.c
-@@ -53,6 +53,26 @@ get_blkid_tag (const char *device, const char *tag)
-   free (err);
+@@ -51,6 +51,26 @@ get_blkid_tag (const char *device, const char *tag)
+   }
  
    if (r == 2) {                 /* means UUID etc not found */
 +    if (STREQ (tag, "TYPE") && STREQ (out, "")) {
diff --git a/0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch b/0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
similarity index 87%
rename from 0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
rename to 0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
index 601f276..473d58d 100644
--- a/0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
+++ b/0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
@@ -1,7 +1,7 @@
-From 16065fe8654dc6bba9517ba969b7291ce60602e4 Mon Sep 17 00:00:00 2001
+From 158e74b852d369d83fa194bd6329d7a82d47fa8c Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 22 Jun 2012 10:24:48 +0100
-Subject: [PATCH 19/29] EPEL 5: sparsify: Fix command line options for old qemu-img.
+Subject: [PATCH 20/36] EPEL 5: sparsify: Fix command line options for old qemu-img.
 
 This didn't have -o backing_file etc.  Use old -b and -F options instead.
 ---
@@ -9,10 +9,10 @@ This didn't have -o backing_file etc.  Use old -b and -F options instead.
  1 files changed, 6 insertions(+), 12 deletions(-)
 
 diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml
-index 379ccf4..9041ca2 100644
+index f77f4eb..5ee2adb 100644
 --- a/sparsify/sparsify.ml
 +++ b/sparsify/sparsify.ml
-@@ -207,18 +207,12 @@ let overlaydisk =
+@@ -228,18 +228,12 @@ let overlaydisk =
  
    (* Create it with the indisk as the backing file. *)
    let cmd =
diff --git a/0020-EPEL-5-Remove-Fedora-MD-test-images.patch b/0021-EPEL-5-Remove-Fedora-MD-test-images.patch
similarity index 54%
rename from 0020-EPEL-5-Remove-Fedora-MD-test-images.patch
rename to 0021-EPEL-5-Remove-Fedora-MD-test-images.patch
index 38f669b..187cb21 100644
--- a/0020-EPEL-5-Remove-Fedora-MD-test-images.patch
+++ b/0021-EPEL-5-Remove-Fedora-MD-test-images.patch
@@ -1,28 +1,28 @@
-From c91abaaa5ff64af96a543f698f71f4deff0cbcb9 Mon Sep 17 00:00:00 2001
+From 61d883225c87a58f8df1ab9d6e17cdb7a7425d97 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 22 Jun 2012 13:15:49 +0100
-Subject: [PATCH 20/29] EPEL 5: Remove Fedora MD test images.
+Subject: [PATCH 21/36] EPEL 5: Remove Fedora MD test images.
 
 On RHEL 5, mdadm is not able to create md devices with aliases,
 eg. '/dev/md/boot'.
 ---
- tests/guests/Makefile.am |   12 +-----------
- 1 files changed, 1 insertions(+), 11 deletions(-)
+ tests/guests/Makefile.am |   12 ------------
+ 1 files changed, 0 insertions(+), 12 deletions(-)
 
 diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am
-index a05dceb..d98f12d 100644
+index f5570e9..3e8443f 100644
 --- a/tests/guests/Makefile.am
 +++ b/tests/guests/Makefile.am
-@@ -38,7 +38,7 @@ EXTRA_DIST = \
+@@ -47,8 +47,6 @@ check_DATA = \
+ 	blank-bootrootlv.img \
+ 	debian.img \
+ 	fedora.img \
+-	fedora-md1.img \
+-	fedora-md2.img \
+ 	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 = debian.img fedora.img fedora-md1.img fedora-md2.img ubuntu.img windows.img
-+check_DATA = debian.img fedora.img ubuntu.img windows.img
- 
- CLEANFILES = $(check_DATA) stamp-fedora-md.img *.tmp.*
- 
-@@ -48,16 +48,6 @@ fedora.img: guest-aux/make-fedora-img.pl \
+@@ -70,16 +68,6 @@ fedora.img: guest-aux/make-fedora-img.pl \
  		guest-aux/fedora-packages.db
  	SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test $<
  
diff --git a/0021-EPEL-5-Add-mkisofs-to-package-list.patch b/0022-EPEL-5-Add-mkisofs-to-package-list.patch
similarity index 74%
rename from 0021-EPEL-5-Add-mkisofs-to-package-list.patch
rename to 0022-EPEL-5-Add-mkisofs-to-package-list.patch
index 06bcdd9..53125b4 100644
--- a/0021-EPEL-5-Add-mkisofs-to-package-list.patch
+++ b/0022-EPEL-5-Add-mkisofs-to-package-list.patch
@@ -1,7 +1,7 @@
-From 529c3b172f2171029de72946745628ef1446159f Mon Sep 17 00:00:00 2001
+From 80df69f2d15f83bd748c4eb592bf7c0e4462c985 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 22 Jun 2012 14:46:43 +0100
-Subject: [PATCH 21/29] EPEL 5: Add mkisofs to package list.
+Subject: [PATCH 22/36] EPEL 5: Add mkisofs to package list.
 
 This package contains the 'isoinfo' program which is required
 to implement the corresponding API and for tests to pass.
@@ -10,10 +10,10 @@ to implement the corresponding API and for tests to pass.
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/appliance/packagelist.in b/appliance/packagelist.in
-index 6d412cb..5167f83 100644
+index d7c2639..803a694 100644
 --- a/appliance/packagelist.in
 +++ b/appliance/packagelist.in
-@@ -114,6 +114,7 @@ lsscsi
+@@ -129,6 +129,7 @@ lsscsi
  lvm2
  lzop
  mdadm
diff --git a/0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch b/0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
similarity index 74%
rename from 0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
rename to 0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
index c7fc8a5..bff4e50 100644
--- a/0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
+++ b/0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
@@ -1,7 +1,7 @@
-From 9a62a5956168d4ec4d02898318ac8ca325451e9c Mon Sep 17 00:00:00 2001
+From 999fad1fc600a50e51dc019b7d9c53cb735734cd Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 22 Jun 2012 21:58:32 +0100
-Subject: [PATCH 22/29] EPEL 5: Add 1 second pause after unmounting any filesystem.
+Subject: [PATCH 23/36] EPEL 5: Add 1 second pause after unmounting any filesystem.
 
 This fixes the test-charset-fidelity test case.  A simpler example
 which fails without this is:
@@ -24,12 +24,12 @@ which fails without this is:
  1 files changed, 6 insertions(+), 0 deletions(-)
 
 diff --git a/daemon/mount.c b/daemon/mount.c
-index c84faaf..1e8aac1 100644
+index af92834..30a8a8c 100644
 --- a/daemon/mount.c
 +++ b/daemon/mount.c
-@@ -237,6 +237,9 @@ do_umount (const char *pathordevice,
- 
-   free (err);
+@@ -228,6 +228,9 @@ do_umount (const char *pathordevice,
+     return -1;
+   }
  
 +  /* RHEL 5 only. */
 +  sleep (1);
@@ -37,7 +37,7 @@ index c84faaf..1e8aac1 100644
    return 0;
  }
  
-@@ -397,6 +400,9 @@ do_umount_all (void)
+@@ -386,6 +389,9 @@ do_umount_all (void)
  
    free_stringslen (mounts.argv, mounts.size);
  
diff --git a/0023-EPEL-5-podwrapper-Remove-HTML-output.patch b/0024-EPEL-5-podwrapper-Remove-HTML-output.patch
similarity index 90%
rename from 0023-EPEL-5-podwrapper-Remove-HTML-output.patch
rename to 0024-EPEL-5-podwrapper-Remove-HTML-output.patch
index 66017c1..80f1db0 100644
--- a/0023-EPEL-5-podwrapper-Remove-HTML-output.patch
+++ b/0024-EPEL-5-podwrapper-Remove-HTML-output.patch
@@ -1,16 +1,16 @@
-From 1645ec8ff0b395886bdb86525599a3cbb5bd892d Mon Sep 17 00:00:00 2001
+From 371194e75da68e141c2a33dba53c863ebd8bf329 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Thu, 30 Aug 2012 18:01:00 +0100
-Subject: [PATCH 23/29] EPEL 5: podwrapper: Remove HTML output.
+Subject: [PATCH 24/36] EPEL 5: podwrapper: Remove HTML output.
 
 It requires perl Pod::Simple::XHTML which did not exist in
 RHEL 5 era.
 ---
- podwrapper.pl.in |   91 ------------------------------------------------------
- 1 files changed, 0 insertions(+), 91 deletions(-)
+ podwrapper.pl.in |   92 ------------------------------------------------------
+ 1 files changed, 0 insertions(+), 92 deletions(-)
 
 diff --git a/podwrapper.pl.in b/podwrapper.pl.in
-index b8b0459..389c398 100755
+index cb6e9b2..53a13cd 100755
 --- a/podwrapper.pl.in
 +++ b/podwrapper.pl.in
 @@ -25,7 +25,6 @@ use Getopt::Long;
@@ -21,7 +21,7 @@ index b8b0459..389c398 100755
  use File::Basename;
  
  =encoding utf8
-@@ -403,96 +402,6 @@ if ($man) {
+@@ -417,97 +416,6 @@ if ($man) {
      print "$progname: wrote $man\n";
  }
  
@@ -54,6 +54,7 @@ index b8b0459..389c398 100755
 -        return 1 if /^guestmount/;
 -        return 1 if /^hivex/;
 -        return 1 if /^febootstrap/;
+-        return 1 if /^supermin/;
 -        return 0;
 -    }
 -
diff --git a/0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch b/0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
similarity index 76%
rename from 0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
rename to 0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
index eac3f64..57c58a8 100644
--- a/0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
+++ b/0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
@@ -1,7 +1,7 @@
-From 29a84bcdba66c82a4d5d4e9dfff36f0ecb1a93b0 Mon Sep 17 00:00:00 2001
+From deedfc2c5b28d95bd4d305034379fa584e939cb9 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Thu, 30 Aug 2012 18:16:18 +0100
-Subject: [PATCH 24/29] EPEL 5: podwrapper: Don't use Pod::Man.
+Subject: [PATCH 25/36] EPEL 5: podwrapper: Don't use Pod::Man.
 
 This unfortunately means the man pages are generated as plain text.
 However that's necessary as Pod::Man does not have an output_string
@@ -11,10 +11,10 @@ method.
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/podwrapper.pl.in b/podwrapper.pl.in
-index 389c398..ee6d871 100755
+index 53a13cd..415fa67 100755
 --- a/podwrapper.pl.in
 +++ b/podwrapper.pl.in
-@@ -373,7 +373,7 @@ SUBMAN: {
+@@ -387,7 +387,7 @@ SUBMAN: {
      package Podwrapper::Man;
  
      use vars qw(@ISA $VERSION);
diff --git a/0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch b/0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
similarity index 84%
rename from 0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
rename to 0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
index 04f5bdd..c407135 100644
--- a/0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
+++ b/0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
@@ -1,7 +1,7 @@
-From 9bd511139e5a3ac43cbfa4121a33c3859e021597 Mon Sep 17 00:00:00 2001
+From e08f04f9c508fa0748453a0a2631d3373d7c67b4 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Thu, 30 Aug 2012 18:19:28 +0100
-Subject: [PATCH 25/29] EPEL 5: Revert "Mac OS X: Use libtool --mode=execute instead of LD_LIBRARY_PATH"
+Subject: [PATCH 26/36] EPEL 5: Revert "Mac OS X: Use libtool --mode=execute instead of LD_LIBRARY_PATH"
 
 This reverts commit 61c9ea496e0579bb7d1bcf496595d66c3f08cfec.
 ---
@@ -9,10 +9,10 @@ This reverts commit 61c9ea496e0579bb7d1bcf496595d66c3f08cfec.
  1 files changed, 8 insertions(+), 8 deletions(-)
 
 diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
-index 1a8baf2..44803a2 100644
+index 48ddc2c..b5dbd5f 100644
 --- a/ocaml/Makefile.am
 +++ b/ocaml/Makefile.am
-@@ -106,7 +106,7 @@ noinst_DATA += \
+@@ -114,7 +114,7 @@ noinst_DATA += \
  
  bindtests.bc: bindtests.cmo mlguestfs.cma
  	mkdir -p t
@@ -21,7 +21,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
  
  bindtests.opt: bindtests.cmx mlguestfs.cmxa
-@@ -115,7 +115,7 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa
+@@ -123,7 +123,7 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa
  
  t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma
  	mkdir -p t
@@ -30,7 +30,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
  
  t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
-@@ -124,7 +124,7 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
+@@ -132,7 +132,7 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
  
  t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma
  	mkdir -p t
@@ -39,7 +39,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
  
  t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
-@@ -133,7 +133,7 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
+@@ -141,7 +141,7 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
  
  t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma
  	mkdir -p t
@@ -48,7 +48,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@
  
  t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
-@@ -142,7 +142,7 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
+@@ -150,7 +150,7 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
  
  t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma
  	mkdir -p t
@@ -57,7 +57,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
  
  t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
-@@ -151,7 +151,7 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
+@@ -159,7 +159,7 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
  
  t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma
  	mkdir -p t
@@ -66,7 +66,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
  
  t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
-@@ -160,7 +160,7 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
+@@ -168,7 +168,7 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
  
  t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma
  	mkdir -p t
@@ -75,7 +75,7 @@ index 1a8baf2..44803a2 100644
  	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
  
  t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
-@@ -169,7 +169,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
+@@ -177,7 +177,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
  
  t/guestfs_500_mount_local.bc: t/guestfs_500_mount_local.cmo mlguestfs.cma
  	mkdir -p t
diff --git a/0027-EPEL-5-Don-t-use-sgabios.patch b/0027-EPEL-5-Don-t-use-sgabios.patch
new file mode 100644
index 0000000..2528eb1
--- /dev/null
+++ b/0027-EPEL-5-Don-t-use-sgabios.patch
@@ -0,0 +1,35 @@
+From 84c0abdf9bd1cc84dc3cd6d0fcd85ffd8a33f7e5 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 31 Aug 2012 10:24:06 +0100
+Subject: [PATCH 27/36] EPEL 5: Don't use sgabios.
+
+Old qemu doesn't support '-device' parameter.
+---
+ src/launch-appliance.c |   11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+diff --git a/src/launch-appliance.c b/src/launch-appliance.c
+index 570f6cf..ee815aa 100644
+--- a/src/launch-appliance.c
++++ b/src/launch-appliance.c
+@@ -428,17 +428,6 @@ launch_appliance (guestfs_h *g, const char *arg)
+     add_cmdline (g, "-serial");
+     add_cmdline (g, "stdio");
+ 
+-    if (qemu_supports_device (g, "Serial Graphics Adapter")) {
+-      /* Use sgabios instead of vgabios.  This means we'll see BIOS
+-       * messages on the serial port, and also works around this bug
+-       * in qemu 1.1.0:
+-       * https://bugs.launchpad.net/qemu/+bug/1021649
+-       * QEmu has included sgabios upstream since just before 1.0.
+-       */
+-      add_cmdline (g, "-device");
+-      add_cmdline (g, "sga");
+-    }
+-
+     /* Null vmchannel. */
+     add_cmdline (g, "-net");
+     add_cmdline (g, "user,vlan=0,net=" NETWORK);
+-- 
+1.7.4.1
+
diff --git a/0027-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch b/0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
similarity index 75%
rename from 0027-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
rename to 0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
index 28e12ae..79a227e 100644
--- a/0027-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
+++ b/0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
@@ -1,7 +1,7 @@
-From 382825b54551d09fb38bba03c1a0adf7ecf50937 Mon Sep 17 00:00:00 2001
+From 437b53bab6f8594ea4b84c881fc75cb86df29490 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 31 Aug 2012 13:48:18 +0100
-Subject: [PATCH 27/29] EPEL 5: Revert "daemon: Remove e2prog hack (only needed for RHEL 5)."
+Subject: [PATCH 28/36] EPEL 5: Revert "daemon: Remove e2prog hack (only needed for RHEL 5)."
 
 This reverts commit 163e030ee13644ad9efe1e078aff47b879657333.
 ---
@@ -12,10 +12,10 @@ This reverts commit 163e030ee13644ad9efe1e078aff47b879657333.
  4 files changed, 111 insertions(+), 18 deletions(-)
 
 diff --git a/daemon/daemon.h b/daemon/daemon.h
-index a483208..1734e40 100644
+index a7371ea..ec0fa3d 100644
 --- a/daemon/daemon.h
 +++ b/daemon/daemon.h
-@@ -174,6 +174,8 @@ extern int filesystem_available (const char *filesystem);
+@@ -185,6 +185,8 @@ extern int filesystem_available (const char *filesystem);
  extern int sync_disks (void);
  
  /*-- in ext2.c --*/
@@ -25,12 +25,12 @@ index a483208..1734e40 100644
  #define EXT2_LABEL_MAX 16
  
 diff --git a/daemon/ext2.c b/daemon/ext2.c
-index 40b36d2..d4ebf90 100644
+index e4548d6..297c477 100644
 --- a/daemon/ext2.c
 +++ b/daemon/ext2.c
 @@ -31,6 +31,7 @@
  
- #define MAX_ARGS 64
+ #define MAX_ARGS 128
  
 +
  GUESTFSD_EXT_CMD(str_tune2fs, tune2fs);
@@ -81,10 +81,10 @@ index 40b36d2..d4ebf90 100644
 +  r = command (&out, &err, prog, "-l", device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-     free (err);
-@@ -142,7 +173,11 @@ do_set_e2uuid (const char *device, const char *uuid)
+     return NULL;
+@@ -131,7 +162,11 @@ do_set_e2uuid (const char *device, const char *uuid)
    int r;
-   char *err;
+   CLEANUP_FREE char *err = NULL;
  
 -  r = command (NULL, &err, str_tune2fs, "-U", uuid, device, NULL);
 +  char prog[] = "tune2fs";
@@ -94,10 +94,10 @@ index 40b36d2..d4ebf90 100644
 +  r = command (NULL, &err, prog, "-U", uuid, device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-     free (err);
-@@ -165,13 +200,17 @@ if_not_mounted_run_e2fsck (const char *device)
+     return -1;
+@@ -152,6 +187,10 @@ if_not_mounted_run_e2fsck (const char *device)
  {
-   char *err;
+   CLEANUP_FREE char *err = NULL;
    int r, mounted;
 +  char prog[] = "e2fsck";
 +
@@ -106,16 +106,17 @@ index 40b36d2..d4ebf90 100644
  
    mounted = is_device_mounted (device);
    if (mounted == -1)
-     return -1;
- 
+@@ -160,7 +199,7 @@ if_not_mounted_run_e2fsck (const char *device)
    if (!mounted) {
--    r = command (NULL, &err, str_e2fsck, "-fy", device, NULL);
-+    r = command (NULL, &err, prog, "-fy", device, NULL);
+     r = commandf (NULL, &err,
+                   COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
+-                  str_e2fsck, "-fy", device, NULL);
++                  prog, "-fy", device, NULL);
      if (r == -1) {
        reply_with_error ("%s", err);
-       free (err);
-@@ -189,10 +228,14 @@ do_resize2fs (const char *device)
-   char *err;
+       return -1;
+@@ -176,10 +215,14 @@ do_resize2fs (const char *device)
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "resize2fs";
@@ -129,9 +130,9 @@ index 40b36d2..d4ebf90 100644
 +  r = command (NULL, &err, prog, device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-     free (err);
-@@ -209,6 +252,10 @@ do_resize2fs_size (const char *device, int64_t size)
-   char *err;
+     return -1;
+@@ -194,6 +237,10 @@ do_resize2fs_size (const char *device, int64_t size)
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "resize2fs";
@@ -141,7 +142,7 @@ index 40b36d2..d4ebf90 100644
    /* resize2fs itself may impose additional limits.  Since we are
     * going to use the 'K' suffix however we can only work with whole
     * kilobytes.
-@@ -226,7 +273,7 @@ do_resize2fs_size (const char *device, int64_t size)
+@@ -211,7 +258,7 @@ do_resize2fs_size (const char *device, int64_t size)
    char buf[32];
    snprintf (buf, sizeof buf, "%" PRIi64 "K", size);
  
@@ -149,9 +150,9 @@ index 40b36d2..d4ebf90 100644
 +  r = command (NULL, &err, prog, device, buf, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-     free (err);
-@@ -243,10 +290,14 @@ do_resize2fs_M (const char *device)
-   char *err;
+     return -1;
+@@ -226,10 +273,14 @@ do_resize2fs_M (const char *device)
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "resize2fs";
@@ -165,9 +166,9 @@ index 40b36d2..d4ebf90 100644
 +  r = command (NULL, &err, prog, "-M", device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-     free (err);
-@@ -267,6 +318,10 @@ do_e2fsck (const char *device,
-   char *err;
+     return -1;
+@@ -248,6 +299,10 @@ do_e2fsck (const char *device,
+   CLEANUP_FREE char *err = NULL;
    size_t i = 0;
    int r;
 +  char prog[] = "e2fsck";
@@ -177,7 +178,7 @@ index 40b36d2..d4ebf90 100644
  
    /* Default if not selected. */
    if (!(optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK))
-@@ -279,7 +334,7 @@ do_e2fsck (const char *device,
+@@ -260,7 +315,7 @@ do_e2fsck (const char *device,
      return -1;
    }
  
@@ -186,8 +187,8 @@ index 40b36d2..d4ebf90 100644
    ADD_ARG (argv, i, "-f");
  
    if (correct)
-@@ -322,11 +377,15 @@ do_mke2journal (int blocksize, const char *device)
-   char *err;
+@@ -303,13 +358,17 @@ do_mke2journal (int blocksize, const char *device)
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "mke2fs";
@@ -197,14 +198,16 @@ index 40b36d2..d4ebf90 100644
    char blocksize_s[32];
    snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
  
+   wipe_device_before_mkfs (device);
+ 
    r = command (NULL, &err,
 -               str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s,
 +               prog, "-F", "-O", "journal_dev", "-b", blocksize_s,
                 device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-@@ -344,6 +403,10 @@ do_mke2journal_L (int blocksize, const char *label, const char *device)
-   char *err;
+@@ -325,6 +384,10 @@ do_mke2journal_L (int blocksize, const char *label, const char *device)
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "mke2fs";
@@ -214,8 +217,8 @@ index 40b36d2..d4ebf90 100644
    if (strlen (label) > EXT2_LABEL_MAX) {
      reply_with_error ("%s: ext2 labels are limited to %d bytes",
                        label, EXT2_LABEL_MAX);
-@@ -354,7 +417,7 @@ do_mke2journal_L (int blocksize, const char *label, const char *device)
-   snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
+@@ -337,7 +400,7 @@ do_mke2journal_L (int blocksize, const char *label, const char *device)
+   wipe_device_before_mkfs (device);
  
    r = command (NULL, &err,
 -               str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s,
@@ -223,8 +226,8 @@ index 40b36d2..d4ebf90 100644
                 "-L", label,
                 device, NULL);
    if (r == -1) {
-@@ -373,11 +436,15 @@ do_mke2journal_U (int blocksize, const char *uuid, const char *device)
-   char *err;
+@@ -354,13 +417,17 @@ do_mke2journal_U (int blocksize, const char *uuid, const char *device)
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "mke2fs";
@@ -234,14 +237,16 @@ index 40b36d2..d4ebf90 100644
    char blocksize_s[32];
    snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
  
+   wipe_device_before_mkfs (device);
+ 
    r = command (NULL, &err,
 -               str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s,
 +               prog, "-F", "-O", "journal_dev", "-b", blocksize_s,
                 "-U", uuid,
                 device, NULL);
    if (r == -1) {
-@@ -397,6 +464,10 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device,
-   char *err;
+@@ -378,6 +445,10 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device,
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "mke2fs";
@@ -251,8 +256,8 @@ index 40b36d2..d4ebf90 100644
    char blocksize_s[32];
    snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
  
-@@ -405,7 +476,7 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device,
-   snprintf (jdev, len+32, "device=%s", journal);
+@@ -388,7 +459,7 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device,
+   wipe_device_before_mkfs (device);
  
    r = command (NULL, &err,
 -               str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s,
@@ -260,8 +265,8 @@ index 40b36d2..d4ebf90 100644
                 device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-@@ -424,6 +495,10 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device,
-   char *err;
+@@ -405,6 +476,10 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device,
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "mke2fs";
@@ -271,8 +276,8 @@ index 40b36d2..d4ebf90 100644
    if (strlen (label) > EXT2_LABEL_MAX) {
      reply_with_error ("%s: ext2 labels are limited to %d bytes",
                        label, EXT2_LABEL_MAX);
-@@ -438,7 +513,7 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device,
-   snprintf (jdev, len+32, "device=LABEL=%s", label);
+@@ -421,7 +496,7 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device,
+   wipe_device_before_mkfs (device);
  
    r = command (NULL, &err,
 -               str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s,
@@ -280,8 +285,8 @@ index 40b36d2..d4ebf90 100644
                 device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-@@ -457,6 +532,10 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device,
-   char *err;
+@@ -438,6 +513,10 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device,
+   CLEANUP_FREE char *err = NULL;
    int r;
  
 +  char prog[] = "mke2fs";
@@ -291,8 +296,8 @@ index 40b36d2..d4ebf90 100644
    char blocksize_s[32];
    snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
  
-@@ -465,7 +544,7 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device,
-   snprintf (jdev, len+32, "device=UUID=%s", uuid);
+@@ -448,7 +527,7 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device,
+   wipe_device_before_mkfs (device);
  
    r = command (NULL, &err,
 -               str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s,
@@ -300,15 +305,15 @@ index 40b36d2..d4ebf90 100644
                 device, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-@@ -495,6 +574,7 @@ do_tune2fs (const char *device, /* only required parameter */
+@@ -476,6 +555,7 @@ do_tune2fs (const char *device, /* only required parameter */
    size_t i = 0;
    int r;
-   char *err;
+   CLEANUP_FREE char *err = NULL;
 +  char prog[] = "tune2fs";
    char maxmountcount_s[64];
    char mountcount_s[64];
    char group_s[64];
-@@ -503,7 +583,10 @@ do_tune2fs (const char *device, /* only required parameter */
+@@ -484,7 +564,10 @@ do_tune2fs (const char *device, /* only required parameter */
    char reservedblockscount_s[64];
    char user_s[64];
  
@@ -320,22 +325,22 @@ index 40b36d2..d4ebf90 100644
  
    if (optargs_bitmask & GUESTFS_TUNE2FS_FORCE_BITMASK) {
      if (force)
-@@ -611,7 +694,7 @@ do_tune2fs (const char *device, /* only required parameter */
+@@ -592,7 +675,7 @@ do_tune2fs (const char *device, /* only required parameter */
  
    r = commandv (NULL, &err, argv);
    if (r == -1) {
 -    reply_with_error ("%s: %s", device, err);
 +    reply_with_error ("%s: %s: %s", prog, device, err);
-     free (err);
      return -1;
    }
+ 
 diff --git a/daemon/labels.c b/daemon/labels.c
-index ead6b46..347cc07 100644
+index 2fda354..9f08a07 100644
 --- a/daemon/labels.c
 +++ b/daemon/labels.c
 @@ -36,13 +36,17 @@ e2label (const char *device, const char *label)
    int r;
-   char *err;
+   CLEANUP_FREE char *err = NULL;
  
 +  char prog[] = "e2label";
 +  if (e2prog (prog) == -1)
@@ -351,20 +356,20 @@ index ead6b46..347cc07 100644
 +  r = command (NULL, &err, prog, device, label, NULL);
    if (r == -1) {
      reply_with_error ("%s", err);
-     free (err);
+     return -1;
 diff --git a/daemon/mkfs.c b/daemon/mkfs.c
-index 241d346..c8c47b6 100644
+index ff0f2fc..88dea8b 100644
 --- a/daemon/mkfs.c
 +++ b/daemon/mkfs.c
-@@ -46,6 +46,7 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
+@@ -45,6 +45,7 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
    char sectorsize_str[32];
    int r;
-   char *err;
+   CLEANUP_FREE char *err = NULL;
 +  char mke2fs[] = "mke2fs";
    int extfs = 0;
  
    if (STREQ (fstype, "ext2") || STREQ (fstype, "ext3") ||
-@@ -56,8 +57,11 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
+@@ -55,8 +56,11 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
     * the mkfs program "eats" some options, in particular the -F
     * option.
     */
diff --git a/0028-EPEL-5-Disable-tar-xz-test.patch b/0029-EPEL-5-Disable-tar-xz-test.patch
similarity index 62%
rename from 0028-EPEL-5-Disable-tar-xz-test.patch
rename to 0029-EPEL-5-Disable-tar-xz-test.patch
index 160c59b..e6bb6e4 100644
--- a/0028-EPEL-5-Disable-tar-xz-test.patch
+++ b/0029-EPEL-5-Disable-tar-xz-test.patch
@@ -1,18 +1,18 @@
-From e54f632085f5dde039defc7e77e91b10fb86f3d5 Mon Sep 17 00:00:00 2001
+From e1a657f74be5dc3f349732112e68c7f2064a95b8 Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 31 Aug 2012 14:59:25 +0100
-Subject: [PATCH 28/29] EPEL 5: Disable tar --xz test.
+Subject: [PATCH 29/36] EPEL 5: Disable tar --xz test.
 
 Although xz is available, ancient tar didn't have the --xz option.
 ---
- generator/generator_actions.ml |    2 +-
+ generator/actions.ml |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
-diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
-index 79ed8f4..89c553f 100644
---- a/generator/generator_actions.ml
-+++ b/generator/generator_actions.ml
-@@ -3655,7 +3655,7 @@ To get the checksums for many files, use C<guestfs_checksums_out>." };
+diff --git a/generator/actions.ml b/generator/actions.ml
+index 06e4211..aa69db3 100644
+--- a/generator/actions.ml
++++ b/generator/actions.ml
+@@ -4105,7 +4105,7 @@ To get the checksums for many files, use C<guestfs_checksums_out>." };
          [["mkdir"; "/tar_in_gz"];
           ["tar_in"; "../data/helloworld.tar.gz"; "/tar_in_gz"; "gzip"];
           ["cat"; "/tar_in_gz/hello"]], "hello\n");
diff --git a/0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch b/0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
similarity index 80%
rename from 0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
rename to 0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
index 6dad227..c273275 100644
--- a/0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
+++ b/0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
@@ -1,14 +1,14 @@
-From 5b867468273b5fb9e8f6775b859dba9250d03ea5 Mon Sep 17 00:00:00 2001
+From aeb92a6862d385ece1280baabb5bc03214a2ed4f Mon Sep 17 00:00:00 2001
 From: Richard W.M. Jones <rjones at redhat.com>
 Date: Fri, 31 Aug 2012 22:12:59 +0100
-Subject: [PATCH 29/29] EPEL 5: Ignore sparsify error if qemu-img --help is killed by a signal.
+Subject: [PATCH 30/36] EPEL 5: Ignore sparsify error if qemu-img --help is killed by a signal.
 
 ---
  sparsify/sparsify.ml |    3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)
 
 diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml
-index 9041ca2..21c0a14 100644
+index 5ee2adb..0606ebe 100644
 --- a/sparsify/sparsify.ml
 +++ b/sparsify/sparsify.ml
 @@ -168,8 +168,7 @@ let qemu_img_version =
diff --git a/0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch b/0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch
new file mode 100644
index 0000000..f3c20d7
--- /dev/null
+++ b/0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch
@@ -0,0 +1,44 @@
+From 5d30392d9083428a4ad64cc7389cd9adc18979d9 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Mon, 3 Sep 2012 11:04:39 +0100
+Subject: [PATCH 31/36] EPEL 5: Revert "daemon: remove call to obsolete udevsettle"
+
+This reverts commit b6413f8dbef92c46c4baf9499366716a166f2163.
+---
+ daemon/guestfsd.c |    8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
+index bcb836a..44d7f77 100644
+--- a/daemon/guestfsd.c
++++ b/daemon/guestfsd.c
+@@ -54,6 +54,7 @@
+ #include "daemon.h"
+ 
+ GUESTFSD_EXT_CMD(str_udevadm, udevadm);
++GUESTFSD_EXT_CMD(str_udevsettle, udevsettle);
+ 
+ static char *read_cmdline (void);
+ 
+@@ -1392,11 +1393,18 @@ random_name (char *template)
+  *
+  * Use 'udevadm settle' after certain commands, but don't be too
+  * fussed if it fails.
++ *
++ * 'udevsettle' was the old name for this command (RHEL 5).  This was
++ * deprecated in favour of 'udevadm settle'.  The old 'udevsettle'
++ * command was left as a symlink.  Then in Fedora 13 the old symlink
++ * remained but it stopped working (RHBZ#548121), so we have to be
++ * careful not to assume that we can use 'udevsettle' if it exists.
+  */
+ void
+ udev_settle (void)
+ {
+   (void) command (NULL, NULL, str_udevadm, "settle", NULL);
++  (void) command (NULL, NULL, str_udevsettle, NULL);
+ }
+ 
+ /* Use by the CLEANUP_* macros.  Do not call these directly. */
+-- 
+1.7.4.1
+
diff --git a/0032-EPEL-5-No-libtoolize-install-option.patch b/0032-EPEL-5-No-libtoolize-install-option.patch
new file mode 100644
index 0000000..e9add75
--- /dev/null
+++ b/0032-EPEL-5-No-libtoolize-install-option.patch
@@ -0,0 +1,25 @@
+From f941916d6d765a1afae4c0d2e833c4d10fd5c39c Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 8 Mar 2013 19:09:21 +0000
+Subject: [PATCH 32/36] EPEL 5: No libtoolize --install option.
+
+---
+ bootstrap |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bootstrap b/bootstrap
+index da650ca..4de0c0e 100755
+--- a/bootstrap
++++ b/bootstrap
+@@ -29,7 +29,7 @@ GNULIB_SRCDIR=.gnulib
+ # Autoreconf runs aclocal before libtoolize, which causes spurious
+ # warnings if the initial aclocal is confused by the libtoolized
+ # (or worse out-of-date) macro directory.
+-libtoolize --copy --install
++libtoolize --copy
+ 
+ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
+ <$gnulib_tool || exit
+-- 
+1.7.4.1
+
diff --git a/0033-EPEL-5-Disable-valgrind.patch b/0033-EPEL-5-Disable-valgrind.patch
new file mode 100644
index 0000000..321878b
--- /dev/null
+++ b/0033-EPEL-5-Disable-valgrind.patch
@@ -0,0 +1,28 @@
+From e4ac2bc51e0ef216f57e961414f13a3be6c1fbdd Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 8 Mar 2013 19:19:43 +0000
+Subject: [PATCH 33/36] EPEL 5: Disable valgrind.
+
+Ancient automake didn't have AM_SUBST_NOTMAKE.
+---
+ configure.ac |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d26b815..7978cad 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -848,8 +848,8 @@ AS_IF([test "x$VALGRIND" != "xno"],[
+     # No valgrind, so substitute VG with something that will break.
+     VG=VALGRIND_IS_NOT_INSTALLED
+ ])
+-AC_SUBST([VG])
+-AM_SUBST_NOTMAKE([VG])
++dnl AC_SUBST([VG])
++dnl AM_SUBST_NOTMAKE([VG])
+ 
+ dnl Enable profiling?
+ AC_ARG_ENABLE([code-profiling],
+-- 
+1.7.4.1
+
diff --git a/0034-EPEL-5-Remove-Linux-capabilities.patch b/0034-EPEL-5-Remove-Linux-capabilities.patch
new file mode 100644
index 0000000..31cac4b
--- /dev/null
+++ b/0034-EPEL-5-Remove-Linux-capabilities.patch
@@ -0,0 +1,34 @@
+From 24654a3936d14c985776ef7264fc57a3553d7328 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 8 Mar 2013 20:20:23 +0000
+Subject: [PATCH 34/36] EPEL 5: Remove Linux capabilities.
+
+Linux file capabilities are not supported in RHEL 5, and the
+cap_*_file functions don't exist in the libcap library (although
+confusingly they are in the header file).
+---
+ configure.ac |    8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7978cad..0150d4e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -731,14 +731,6 @@ AC_CHECK_LIB([acl],[acl_from_text],[
+     ], [])
+ ],[AC_MSG_WARN([POSIX acl library not found])])
+ 
+-dnl Linux capabilities library (libcap) (highly recommended)
+-AC_CHECK_LIB([cap],[cap_from_text],[
+-    AC_CHECK_HEADER([sys/capability.h],[
+-        AC_SUBST([CAP_LIBS], [-lcap])
+-        AC_DEFINE([HAVE_CAP], [1], [Define to 1 if the Linux capabilities library (libcap) is available.])
+-    ], [])
+-],[AC_MSG_WARN([Linux capabilities library (libcap) not found])])
+-
+ dnl libvirt (highly recommended)
+ AC_ARG_WITH([libvirt],[
+     AS_HELP_STRING([--without-libvirt],
+-- 
+1.7.4.1
+
diff --git a/0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch b/0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch
new file mode 100644
index 0000000..d195538
--- /dev/null
+++ b/0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch
@@ -0,0 +1,44 @@
+From 1b46d0a8391a4a643df3a35c7310eb4cd21fb2c1 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Sat, 9 Mar 2013 19:24:29 +0000
+Subject: [PATCH 35/36] EPEL 5: ruby: Use old rake/rdoctask and rake/gempackagetask.
+
+The 'begin ... rescue' code is supposed to ensure these old packages
+are required, but for reasons not understood this doesn't work on
+ancient Ruby 1.8.5 in RHEL 5.
+---
+ ruby/Rakefile.in |   15 +++------------
+ 1 files changed, 3 insertions(+), 12 deletions(-)
+
+diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in
+index f832abd..76f00ec 100644
+--- a/ruby/Rakefile.in
++++ b/ruby/Rakefile.in
+@@ -20,21 +20,12 @@ require 'rake/clean'
+ require 'rake/testtask'
+ 
+ # Used to be rake/rdoctask.  Now it's rdoc/task.
+-begin
+-  require 'rdoc/task'
+-rescue
+-  require 'rake/rdoctask'
+-end
++require 'rake/rdoctask'
+ 
+ # Used to be rake/gempackagetask.  Now it's rubygems/package_task.  Also
+ # we need to use the appropriate class name below.
+-begin
+-  require 'rubygems/package_task'
+-  gempackagetask='Gem::PackageTask'
+-rescue
+-  require 'rake/gempackagetask'
+-  gempackagetask='Rake::GemPackageTask'
+-end
++require 'rake/gempackagetask'
++gempackagetask='Rake::GemPackageTask'
+ 
+ PKG_NAME='@PACKAGE_NAME@'
+ PKG_VERSION='@PACKAGE_VERSION@'
+-- 
+1.7.4.1
+
diff --git a/0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch b/0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch
new file mode 100644
index 0000000..dfd9918
--- /dev/null
+++ b/0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch
@@ -0,0 +1,58 @@
+From 8421edcf024f7328da721a8ac52f349290ed5714 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Sat, 9 Mar 2013 19:25:33 +0000
+Subject: [PATCH 36/36] EPEL 5: Custom replacement for 'Unix.isatty stdout'.
+
+Unix.isatty missing on RHEL 5-era OCaml.
+---
+ resize/progress-c.c |   10 ++++++++++
+ resize/progress.ml  |    3 ++-
+ 2 files changed, 12 insertions(+), 1 deletions(-)
+
+diff --git a/resize/progress-c.c b/resize/progress-c.c
+index 2f25bbc..2813d0c 100644
+--- a/resize/progress-c.c
++++ b/resize/progress-c.c
+@@ -22,6 +22,7 @@
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <locale.h>
+ 
+ #include <caml/alloc.h>
+@@ -103,3 +104,12 @@ virt_resize_progress_bar_set (value barv,
+ 
+   CAMLreturn (Val_unit);
+ }
++
++/* RHEL 5-era ocaml didn't have Unix.isatty. */
++value
++virt_resize_isatty_stdout (value unitv)
++{
++  CAMLparam1 (unitv);
++
++  CAMLreturn (isatty(1) ? Val_true : Val_false);
++}
+diff --git a/resize/progress.ml b/resize/progress.ml
+index 7a94c6c..1ff73c2 100644
+--- a/resize/progress.ml
++++ b/resize/progress.ml
+@@ -28,12 +28,13 @@ external progress_bar_reset : progress_bar -> unit
+   = "virt_resize_progress_bar_reset"
+ external progress_bar_set : progress_bar -> int64 -> int64 -> unit
+   = "virt_resize_progress_bar_set"
++external isatty_stdout : unit -> bool = "virt_resize_isatty_stdout"
+ 
+ let set_up_progress_bar ?(machine_readable = false) (g : Guestfs.guestfs) =
+   (* Only display progress bars if the machine_readable flag is set or
+    * the output is a tty.
+    *)
+-  if machine_readable || isatty stdout then (
++  if machine_readable || isatty_stdout () then (
+     (* Initialize the C mini library. *)
+     let bar = progress_bar_init ~machine_readable in
+ 
+-- 
+1.7.4.1
+
diff --git a/bootstrap b/bootstrap
index dd5006c..be0dfe4 100755
--- a/bootstrap
+++ b/bootstrap
@@ -47,6 +47,7 @@ connect
 dup3
 error
 filevercmp
+fstatat
 fsusage
 fts
 full-read
@@ -65,11 +66,13 @@ ignore-value
 lock
 maintainer-makefile
 manywarnings
+memmem
 mkdtemp
 netdb
 netinet_in
 openat
 perror
+pipe2
 pread
 progname
 read-file
@@ -78,6 +81,7 @@ select
 setenv
 sleep
 socket
+stat-time
 strchrnul
 strerror
 strndup
@@ -94,8 +98,12 @@ xstrtoll
 xvasprintf
 '
 
+# If any tests fail, avoid including them by adding them to
+# this list.
+avoid="--avoid=dummy --avoid=getlogin_r-tests"
+
 $gnulib_tool			\
-  --avoid=dummy			\
+  $avoid			\
   --with-tests			\
   --m4-base=m4			\
   --source-base=gnulib/lib	\
diff --git a/libguestfs.spec b/libguestfs.spec
index 577a55a..768cbd8 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -21,8 +21,8 @@
 Summary:       Access and modify virtual machine disk images
 Name:          libguestfs
 Epoch:         1
-Version:       1.19.37
-Release:       5%{?dist}
+Version:       1.20.3
+Release:       1%{?dist}
 License:       LGPLv2+
 Group:         Development/Libraries
 URL:           http://libguestfs.org/
@@ -35,41 +35,48 @@ ExclusiveArch: x86_64
 # We have to update gnulib (in a patch) hence unfortunately ...
 Source10:      bootstrap
 Source11:      dot-gitmodules
-Source12:      gnulib-4fb7ea20122.tar.gz
+Source12:      gnulib-4a8c422f.tar.gz
 
 BuildRequires: autoconf, automake, libtool
 
 # These patches come from the "oldlinux" branch upstream.
 # https://github.com/libguestfs/libguestfs/commits/oldlinux
-Patch0001:     0001-tests-rsync-Allow-rsync-test-to-be-skipped-by-settin.patch
-Patch0002:     0002-tests-Attach-copyright-and-license-GPLv2-notices-to-.patch
-Patch0003:     0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
-Patch0004:     0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
-Patch0005:     0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
-Patch0006:     0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
-Patch0007:     0007-EPEL-5-Remove-Erlang-bindings.patch
-Patch0008:     0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
-Patch0009:     0009-EPEL-5-Remove-PHP-bindings.patch
-Patch0010:     0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
-Patch0011:     0011-EPEL-5-Add-gnulib-utimensat-module.patch
-Patch0012:     0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
-Patch0013:     0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
-Patch0014:     0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
-Patch0015:     0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
-Patch0016:     0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
-Patch0017:     0017-EPEL-5-Disable-libvirt-attach-method.patch
-Patch0018:     0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
-Patch0019:     0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
-Patch0020:     0020-EPEL-5-Remove-Fedora-MD-test-images.patch
-Patch0021:     0021-EPEL-5-Add-mkisofs-to-package-list.patch
-Patch0022:     0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
-Patch0023:     0023-EPEL-5-podwrapper-Remove-HTML-output.patch
-Patch0024:     0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
-Patch0025:     0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
-Patch0026:     0026-EPEL-5-Don-t-use-sgabios.patch
-Patch0027:     0027-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
-Patch0028:     0028-EPEL-5-Disable-tar-xz-test.patch
-Patch0029:     0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
+Patch0001:     0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch
+Patch0002:     0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch
+Patch0003:     0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch
+Patch0004:     0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
+Patch0005:     0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
+Patch0006:     0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
+Patch0007:     0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
+Patch0008:     0008-EPEL-5-Remove-Erlang-bindings.patch
+Patch0009:     0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
+Patch0010:     0010-EPEL-5-Remove-PHP-bindings.patch
+Patch0011:     0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
+Patch0012:     0012-EPEL-5-Add-gnulib-utimensat-module.patch
+Patch0013:     0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
+Patch0014:     0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
+Patch0015:     0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
+Patch0016:     0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
+Patch0017:     0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
+Patch0018:     0018-EPEL-5-Disable-libvirt-attach-method.patch
+Patch0019:     0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
+Patch0020:     0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
+Patch0021:     0021-EPEL-5-Remove-Fedora-MD-test-images.patch
+Patch0022:     0022-EPEL-5-Add-mkisofs-to-package-list.patch
+Patch0023:     0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
+Patch0024:     0024-EPEL-5-podwrapper-Remove-HTML-output.patch
+Patch0025:     0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
+Patch0026:     0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
+Patch0027:     0027-EPEL-5-Don-t-use-sgabios.patch
+Patch0028:     0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
+Patch0029:     0029-EPEL-5-Disable-tar-xz-test.patch
+Patch0030:     0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
+Patch0031:     0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch
+Patch0032:     0032-EPEL-5-No-libtoolize-install-option.patch
+Patch0033:     0033-EPEL-5-Disable-valgrind.patch
+Patch0034:     0034-EPEL-5-Remove-Linux-capabilities.patch
+Patch0035:     0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch
+Patch0036:     0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch
 
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
@@ -532,7 +539,7 @@ Requires:      jpackage-utils
 %prep
 %setup -q
 
-cp %{SOURCE10} .
+cp %{SOURCE10} bootstrap
 cp %{SOURCE11} .gitmodules
 zcat %{SOURCE12} | tar xf -
 
@@ -720,6 +727,9 @@ fi
 # Remove static-linked Java bindings.
 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
 
+# Remove guestfsd man page.
+rm $RPM_BUILD_ROOT%{_mandir}/man8/guestfsd.8*
+
 # Move installed documentation back to the source directory so
 # we can install it using a %%doc rule.
 mv $RPM_BUILD_ROOT%{_docdir}/libguestfs installed-docs
@@ -892,6 +902,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sat Mar  9 2013 Richard W.M. Jones <rjones at redhat.com> - 1:1.20.3-1
+- Rebase to upstream stable branch version 1.20.3.
+
 * Thu Jan 31 2013 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.37-5
 - Bump and rebuild.
 
diff --git a/sources b/sources
index 26d01ba..a016bb5 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-f2577d577727581a1eee95df18bf5624  gnulib-4fb7ea20122.tar.gz
-b3977ca4537914dc45c2427b019333c8  libguestfs-1.19.37.tar.gz
+a5717d7d3975a141c553dd8a8633d5dd  libguestfs-1.20.3.tar.gz
+da5f7fcd0f48f4e17dca4ce33a52cc7a  gnulib-4a8c422f.tar.gz


More information about the scm-commits mailing list