commit 88f5280cbdbfd98ecea236c753aaff5d2f4f7e09
Author: Richard W.M. Jones <rjones(a)redhat.com>
Date: Fri Aug 31 23:18:26 2012 +0100
Upstream to 1.19.37.
- Update patches from 'oldlinux' branch.
- Skip more tests that would fail in RHEL 5.
- Require febootstrap >= 3.20.
....c-Include-config.h-in-this-generated-fil.patch | 29 --
...-Allow-rsync-test-to-be-skipped-by-settin.patch | 28 ++
...h-copyright-and-license-GPLv2-notices-to-.patch | 194 ++++++++++
...emove-checks-which-fail-with-ancient-qemu.patch | 40 +-
...L-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch | 8 +-
...ace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch | 8 +-
...t-use-C99-style-variable-decls-in-for-loo.patch | 48 +--
...tch => 0007-EPEL-5-Remove-Erlang-bindings.patch | 22 +-
0008-EPEL-5-Define-le64toh-if-not-defined.patch | 33 --
...ve-GObject-GObject-Introspection-GJS-bind.patch | 52 ++-
....patch => 0009-EPEL-5-Remove-PHP-bindings.patch | 20 +-
...L-5-Define-le64toh-le32toh-if-not-defined.patch | 39 ++
...> 0011-EPEL-5-Add-gnulib-utimensat-module.patch | 14 +-
...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 | 20 +-
...null-vmchannel-back-for-qemu-without-virt.patch | 74 ++--
...sify-Fix-command-line-options-for-old-qem.patch | 38 --
0017-EPEL-5-Disable-libvirt-attach-method.patch | 25 ++
...5-Fix-blkid-to-return-LVM2_member-for-PVs.patch | 8 +-
...sify-Fix-command-line-options-for-old-qem.patch | 42 +++
... 0020-EPEL-5-Remove-Fedora-MD-test-images.patch | 23 +-
...> 0021-EPEL-5-Add-mkisofs-to-package-list.patch | 8 +-
...1-second-pause-after-unmounting-any-files.patch | 10 +-
0023-EPEL-5-podwrapper-Remove-HTML-output.patch | 123 +++++++
0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch | 28 ++
...rt-Mac-OS-X-Use-libtool-mode-execute-inst.patch | 89 +++++
0026-EPEL-5-Don-t-use-sgabios.patch | 33 ++
...rt-daemon-Remove-e2prog-hack-only-needed-.patch | 383 ++++++++++++++++++++
0028-EPEL-5-Disable-tar-xz-test.patch | 26 ++
...re-sparsify-error-if-qemu-img-help-is-kil.patch | 26 ++
libguestfs.spec | 70 +++--
33 files changed, 1279 insertions(+), 314 deletions(-)
---
diff --git a/0001-tests-rsync-Allow-rsync-test-to-be-skipped-by-settin.patch
b/0001-tests-rsync-Allow-rsync-test-to-be-skipped-by-settin.patch
new file mode 100644
index 0000000..695d372
--- /dev/null
+++ b/0001-tests-rsync-Allow-rsync-test-to-be-skipped-by-settin.patch
@@ -0,0 +1,28 @@
+From d754f4a5a30e0473754004c187b919dcc05e8f6f Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Fri, 31 Aug 2012 19:05:51 +0100
+Subject: [PATCH 01/29] tests/rsync: Allow rsync test to be skipped by setting
SKIP_TEST_RSYNC_SH=1.
+
+---
+ tests/rsync/test-rsync.sh | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/tests/rsync/test-rsync.sh b/tests/rsync/test-rsync.sh
+index e7f62f9..0aa7477 100755
+--- a/tests/rsync/test-rsync.sh
++++ b/tests/rsync/test-rsync.sh
+@@ -24,6 +24,11 @@ set -e
+
+ guestfish=../../fish/guestfish
+
++if [ -n "$SKIP_TEST_RSYNC_SH" ]; then
++ echo "$0: test skipped because environment variable is set."
++ exit 77
++fi
++
+ # Check we have the rsync command.
+ if ! rsync --help >/dev/null 2>&1; then
+ echo "$0: skipping test because local rsync command is not available"
+--
+1.7.4.1
+
diff --git a/0002-tests-Attach-copyright-and-license-GPLv2-notices-to-.patch
b/0002-tests-Attach-copyright-and-license-GPLv2-notices-to-.patch
new file mode 100644
index 0000000..0e14bb2
--- /dev/null
+++ b/0002-tests-Attach-copyright-and-license-GPLv2-notices-to-.patch
@@ -0,0 +1,194 @@
+From a1d981edeae120a0523d0974c703f1a956202415 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Fri, 31 Aug 2012 19:12:27 +0100
+Subject: [PATCH 02/29] tests: Attach copyright and license (GPLv2+) notices to various
test scripts.
+
+For some reason these tests did not have license notices.
+---
+ cat/test-virt-cat.sh | 16 ++++++++++++++++
+ cat/test-virt-filesystems.sh | 16 ++++++++++++++++
+ cat/test-virt-ls.sh | 16 ++++++++++++++++
+ df/test-virt-df.sh | 16 ++++++++++++++++
+ edit/test-virt-edit.sh | 16 ++++++++++++++++
+ tools/test-virt-list-filesystems.sh | 16 ++++++++++++++++
+ tools/test-virt-tar.sh | 16 ++++++++++++++++
+ 7 files changed, 112 insertions(+), 0 deletions(-)
+
+diff --git a/cat/test-virt-cat.sh b/cat/test-virt-cat.sh
+index 7984456..5c05156 100755
+--- a/cat/test-virt-cat.sh
++++ b/cat/test-virt-cat.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2009-2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+diff --git a/cat/test-virt-filesystems.sh b/cat/test-virt-filesystems.sh
+index e664e1a..b413bac 100755
+--- a/cat/test-virt-filesystems.sh
++++ b/cat/test-virt-filesystems.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2009-2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+diff --git a/cat/test-virt-ls.sh b/cat/test-virt-ls.sh
+index b7b02a3..9cfe9db 100755
+--- a/cat/test-virt-ls.sh
++++ b/cat/test-virt-ls.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+diff --git a/df/test-virt-df.sh b/df/test-virt-df.sh
+index af503a3..dd5abf6 100755
+--- a/df/test-virt-df.sh
++++ b/df/test-virt-df.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2009-2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+diff --git a/edit/test-virt-edit.sh b/edit/test-virt-edit.sh
+index 865e35b..a587dc6 100755
+--- a/edit/test-virt-edit.sh
++++ b/edit/test-virt-edit.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2009-2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+diff --git a/tools/test-virt-list-filesystems.sh b/tools/test-virt-list-filesystems.sh
+index 210ea13..89f7d33 100755
+--- a/tools/test-virt-list-filesystems.sh
++++ b/tools/test-virt-list-filesystems.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2009-2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+diff --git a/tools/test-virt-tar.sh b/tools/test-virt-tar.sh
+index 1417989..6c4a644 100755
+--- a/tools/test-virt-tar.sh
++++ b/tools/test-virt-tar.sh
+@@ -1,4 +1,20 @@
+ #!/bin/bash -
++# libguestfs
++# Copyright (C) 2009-2012 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ export LANG=C
+ set -e
+--
+1.7.4.1
+
diff --git a/0001-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
b/0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
similarity index 64%
rename from 0001-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
rename to 0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
index 1d7743a..5dd39c7 100644
--- a/0001-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
+++ b/0003-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
@@ -1,20 +1,20 @@
-From ec832ebaab57328aae0e403ddbb68830a0af0fbc Mon Sep 17 00:00:00 2001
+From e09b9ab89d5ab3617c5fc9636a576411a6e673ec Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sat, 16 Jun 2012 10:19:39 +0100
-Subject: [PATCH 01/20] EPEL 5: Remove checks which fail with ancient qemu.
+Subject: [PATCH 03/29] EPEL 5: Remove checks which fail with ancient qemu.
-Note that g->qemu_version and g->qemu_devices will both
+Note that g->app.qemu_version and g->app.qemu_devices will both
be empty strings.
---
- configure.ac | 57 ---------------------------------------------------------
- src/launch.c | 14 ++------------
+ configure.ac | 57 ------------------------------------------------
+ src/launch-appliance.c | 14 +----------
2 files changed, 2 insertions(+), 69 deletions(-)
diff --git a/configure.ac b/configure.ac
-index dc2a103..75d2c5e 100644
+index 21aa292..0db1176 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -573,63 +573,6 @@ This could be a very old version of qemu, or qemu might not be
+@@ -588,63 +588,6 @@ This could be a very old version of qemu, or qemu might not be
working.
])
fi
@@ -40,16 +40,16 @@ index dc2a103..75d2c5e 100644
- AC_MSG_FAILURE([$QEMU version must be >= 1.0.])
- fi
-
-- AC_MSG_CHECKING([that $QEMU -machine accel=kvm:tcg -device ? works])
-- if $QEMU -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1;
then
+- AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works])
+- if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD
2>&1; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-- AC_MSG_FAILURE([$QEMU -machine accel=kvm:tcg -device ? doesn't work.])
+- AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't
work.])
- fi
-
- AC_MSG_CHECKING([for virtio-serial support in $QEMU])
-- if $QEMU $QEMU_OPTIONS -machine accel=kvm:tcg -device \? 2>&1 | grep -sq
virtio-serial; then
+- if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 |
grep -sq virtio-serial; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
@@ -78,28 +78,28 @@ index dc2a103..75d2c5e 100644
fi
dnl Enable packet dumps when in verbose mode. This generates lots
-diff --git a/src/launch.c b/src/launch.c
-index 3cd16f4..3bb41ae 100644
---- a/src/launch.c
-+++ b/src/launch.c
-@@ -1394,18 +1394,8 @@ test_qemu (guestfs_h *g)
+diff --git a/src/launch-appliance.c b/src/launch-appliance.c
+index 328cd19..3ebaa7b 100644
+--- a/src/launch-appliance.c
++++ b/src/launch-appliance.c
+@@ -772,18 +772,8 @@ test_qemu (guestfs_h *g)
return -1;
}
- snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -nographic -version
2>/dev/null",
- g->qemu);
-
-- if (test_qemu_cmd (g, cmd, &g->qemu_version) == -1)
+- 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->qemu_devices) == -1)
+- if (test_qemu_cmd (g, cmd, &g->app.qemu_devices) == -1)
- goto qemu_error;
-+ g->qemu_version = safe_strdup (g, "");
-+ g->qemu_devices = safe_strdup (g, "");
++ g->app.qemu_version = safe_strdup (g, "");
++ g->app.qemu_devices = safe_strdup (g, "");
return 0;
}
diff --git a/0002-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
b/0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
similarity index 94%
rename from 0002-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
rename to 0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
index 2418333..027e944 100644
--- a/0002-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
+++ b/0004-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
@@ -1,17 +1,17 @@
-From 0caa5ea6b7ec3db3e2959c9d94d530728feded92 Mon Sep 17 00:00:00 2001
+From 8a40ce033a717b4d78b150aedcd831c7b63719ad Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sat, 16 Jun 2012 10:23:19 +0100
-Subject: [PATCH 02/20] EPEL 5: Remove AS_ECHO_N for ancient autoconf.
+Subject: [PATCH 04/29] EPEL 5: Remove AS_ECHO_N for ancient autoconf.
---
configure.ac | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/configure.ac b/configure.ac
-index 75d2c5e..6bcb86e 100644
+index 0db1176..7f20c5a 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1311,33 +1311,33 @@ echo
+@@ -1346,33 +1346,33 @@ echo
echo "Daemon .............................. $enable_daemon"
echo "Appliance ........................... $enable_appliance"
echo "QEMU ................................ $QEMU $QEMU_OPTIONS"
diff --git a/0003-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
b/0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
similarity index 73%
rename from 0003-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
rename to 0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
index 1f54b56..5f55433 100644
--- a/0003-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
+++ b/0005-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
@@ -1,17 +1,17 @@
-From 8574fda19307d84ec72472c650c81cebe7a8ec81 Mon Sep 17 00:00:00 2001
+From a62e60ccfcc25b5ea14ec05cb99478412323dc33 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sat, 16 Jun 2012 10:46:20 +0100
-Subject: [PATCH 03/20] EPEL 5: Replace macro AC_STRUCT_DIRENT_D_TYPE for ancient
autoconf.
+Subject: [PATCH 05/29] 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 6bcb86e..5e67931 100644
+index 7f20c5a..4e141f6 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -176,7 +176,7 @@ dnl Check sizeof long.
+@@ -190,7 +190,7 @@ dnl Check sizeof long.
AC_CHECK_SIZEOF([long])
dnl Check if dirent (readdir) supports d_type member.
diff --git a/0004-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
b/0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
similarity index 70%
rename from 0004-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
rename to 0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
index e74dd5e..fe497b5 100644
--- a/0004-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
+++ b/0006-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
@@ -1,19 +1,19 @@
-From bbce9576f61fc2a5108950fb85a2a1de300e5888 Mon Sep 17 00:00:00 2001
+From 091fecaaaa729dbef19a5cb87e4e2b2c80f2a4ef Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sat, 16 Jun 2012 13:55:44 +0100
-Subject: [PATCH 04/20] EPEL 5: Don't use C99-style variable decls in for-loop.
+Subject: [PATCH 06/29] 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 | 22 ++++++++++++++--------
- 3 files changed, 20 insertions(+), 11 deletions(-)
+ src/inspect-fs-unix.c | 19 ++++++++++++-------
+ 3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/daemon/md.c b/daemon/md.c
-index 0e2f704..7baaab8 100644
+index 4281b4e..0f5d8f5 100644
--- a/daemon/md.c
+++ b/daemon/md.c
-@@ -202,7 +202,8 @@ do_list_md_devices (void)
+@@ -204,7 +204,8 @@ do_list_md_devices (void)
goto error;
}
@@ -23,7 +23,7 @@ index 0e2f704..7baaab8 100644
size_t len = strlen (mds.gl_pathv[i]) - strlen (PREFIX) - strlen (SUFFIX);
#define DEV "/dev/md"
-@@ -278,7 +279,8 @@ do_md_detail(const char *md)
+@@ -280,7 +281,8 @@ do_md_detail(const char *md)
* case */
if (STRPREFIX (line, "MD_")) {
line += 3;
@@ -34,10 +34,10 @@ index 0e2f704..7baaab8 100644
}
}
diff --git a/generator/generator_bindtests.ml b/generator/generator_bindtests.ml
-index 76e5f38..8cf2fec 100644
+index 54c46fa..6b0e328 100644
--- a/generator/generator_bindtests.ml
+++ b/generator/generator_bindtests.ml
-@@ -185,7 +185,8 @@ print_strings (char *const *argv)
+@@ -247,7 +247,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";
@@ -47,11 +47,11 @@ index 76e5f38..8cf2fec 100644
pr " r->val[i].pv_size = i;\n";
pr " }\n";
pr " return r;\n"
-diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c
-index 06936c2..4dc9f6e 100644
---- a/src/inspect_fs_unix.c
-+++ b/src/inspect_fs_unix.c
-@@ -918,7 +918,8 @@ uuid_hash(const void *x, size_t table_size)
+diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
+index c00e69b..231dbd3 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)
const md_uuid *a = x;
size_t h = a->uuid[0];
@@ -61,7 +61,7 @@ index 06936c2..4dc9f6e 100644
h ^= a->uuid[i];
}
-@@ -931,7 +932,8 @@ uuid_cmp(const void *x, const void *y)
+@@ -932,7 +933,8 @@ uuid_cmp(const void *x, const void *y)
const md_uuid *a = x;
const md_uuid *b = y;
@@ -71,7 +71,7 @@ index 06936c2..4dc9f6e 100644
if (a->uuid[i] != b->uuid[i]) return 0;
}
-@@ -995,8 +997,9 @@ map_app_md_devices (guestfs_h *g, Hash_table **map)
+@@ -996,8 +998,9 @@ map_app_md_devices (guestfs_h *g, Hash_table **map)
mds = guestfs_list_md_devices(g);
if (mds == NULL) goto error;
@@ -83,7 +83,7 @@ index 06936c2..4dc9f6e 100644
if (detail == NULL) goto error;
/* Iterate over keys until we find uuid */
-@@ -1116,7 +1119,8 @@ map_md_devices(guestfs_h *g, Hash_table **map)
+@@ -1117,7 +1120,8 @@ map_md_devices(guestfs_h *g, Hash_table **map)
mdadm_app_free);
if (!*map) g->abort_cb();
@@ -93,17 +93,7 @@ index 06936c2..4dc9f6e 100644
/* 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);
-@@ -1241,7 +1245,8 @@ resolve_fstab_device (guestfs_h *g, const char *spec, Hash_table
*md_map)
-
- /* Calculate the numerical index of the disk */
- i = disk[0] - 'a';
-- for (char *p = disk + 1; *p != '\0'; p++) {
-+ char *p;
-+ for (p = disk + 1; *p != '\0'; p++) {
- i += 1; i *= 26;
- i += *p - 'a';
- }
-@@ -1335,7 +1340,8 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
+@@ -1433,7 +1437,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. */
@@ -113,7 +103,7 @@ index 06936c2..4dc9f6e 100644
if (guestfs_exists(g, *i) == 0) continue;
int64_t size = guestfs_filesize (g, *i);
-@@ -1373,7 +1379,7 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
+@@ -1471,7 +1476,7 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
#define EXCL " and . != \""
#define EXCL_LEN (strlen(EXCL))
diff --git a/0005-EPEL-5-Remove-Erlang-bindings.patch
b/0007-EPEL-5-Remove-Erlang-bindings.patch
similarity index 84%
rename from 0005-EPEL-5-Remove-Erlang-bindings.patch
rename to 0007-EPEL-5-Remove-Erlang-bindings.patch
index 5ffd7a5..ca0932b 100644
--- a/0005-EPEL-5-Remove-Erlang-bindings.patch
+++ b/0007-EPEL-5-Remove-Erlang-bindings.patch
@@ -1,7 +1,7 @@
-From 90d6987412c2f9e413f826c6e52bc24fa5de5723 Mon Sep 17 00:00:00 2001
+From 12e28180ebe9dc15490ce183399ff11d2fbe0e2b Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sat, 16 Jun 2012 14:34:25 +0100
-Subject: [PATCH 05/20] EPEL 5: Remove Erlang bindings.
+Subject: [PATCH 07/29] EPEL 5: Remove Erlang bindings.
---
Makefile.am | 3 ---
@@ -10,10 +10,10 @@ Subject: [PATCH 05/20] EPEL 5: Remove Erlang bindings.
3 files changed, 0 insertions(+), 28 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index be9191c..6bd6047 100644
+index c71c66a..281864f 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -84,9 +84,6 @@ endif
+@@ -88,9 +88,6 @@ endif
if HAVE_PHP
SUBDIRS += php
endif
@@ -24,10 +24,10 @@ index be9191c..6bd6047 100644
SUBDIRS += gobject
endif
diff --git a/configure.ac b/configure.ac
-index 5e67931..399a726 100644
+index 4e141f6..deace63 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1115,25 +1115,6 @@ AS_IF([test "x$enable_php" != "xno"],
+@@ -1146,25 +1146,6 @@ AS_IF([test "x$enable_php" != "xno"],
])
AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test
"x$PHPIZE" != "xno"])
@@ -53,7 +53,7 @@ index 5e67931..399a726 100644
dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
AS_IF([test "x$PERL" != "xno"],
[
-@@ -1242,8 +1223,6 @@ AC_CONFIG_FILES([Makefile
+@@ -1273,8 +1254,6 @@ AC_CONFIG_FILES([Makefile
daemon/Makefile
df/Makefile
edit/Makefile
@@ -62,7 +62,7 @@ index 5e67931..399a726 100644
examples/Makefile
fish/Makefile
format/Makefile
-@@ -1325,8 +1304,6 @@ echo -n "Haskell bindings .................... "
+@@ -1360,8 +1339,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
@@ -72,18 +72,18 @@ index 5e67931..399a726 100644
echo -n "Perl virt tools ..................... "
if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else
echo "no"; fi
diff --git a/po/POTFILES b/po/POTFILES
-index 747b341..3e3f300 100644
+index 19cb0b5..2942d79 100644
--- a/po/POTFILES
+++ b/po/POTFILES
-@@ -91,8 +91,6 @@ df/domains.c
+@@ -95,8 +95,6 @@ df/domains.c
df/main.c
df/output.c
edit/virt-edit.c
-erlang/erl-guestfs-proto.c
-erlang/erl-guestfs.c
fish/alloc.c
+ fish/cmds-gperf.c
fish/cmds.c
- fish/cmds_gperf.c
--
1.7.4.1
diff --git a/0006-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
b/0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
similarity index 80%
rename from 0006-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
rename to 0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
index bc7ac6f..4419ff3 100644
--- a/0006-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
+++ b/0008-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
@@ -1,19 +1,19 @@
-From cffb90f873293433eb9dcc1d30e75effedc1fe5c Mon Sep 17 00:00:00 2001
+From 471ed5723343032ce7eaf083f672cf12e337a524 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sat, 16 Jun 2012 14:35:06 +0100
-Subject: [PATCH 06/20] EPEL 5: Remove GObject / GObject Introspection / GJS bindings.
+Subject: [PATCH 08/29] EPEL 5: Remove GObject / GObject Introspection / GJS bindings.
---
Makefile.am | 3 --
configure.ac | 68 ----------------------------------------------------------
- po/POTFILES | 42 -----------------------------------
- 3 files changed, 0 insertions(+), 113 deletions(-)
+ po/POTFILES | 58 -------------------------------------------------
+ 3 files changed, 0 insertions(+), 129 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 6bd6047..88e3815 100644
+index 281864f..710a81c 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -84,9 +84,6 @@ endif
+@@ -88,9 +88,6 @@ endif
if HAVE_PHP
SUBDIRS += php
endif
@@ -24,10 +24,10 @@ index 6bd6047..88e3815 100644
# Unconditional because nothing is built yet.
SUBDIRS += csharp
diff --git a/configure.ac b/configure.ac
-index 399a726..4d60102 100644
+index deace63..1a37987 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1136,67 +1136,6 @@ AS_IF([test "x$PERL" != "xno"],
+@@ -1167,67 +1167,6 @@ AS_IF([test "x$PERL" != "xno"],
AM_CONDITIONAL([HAVE_TOOLS],
[test "x$PERL" != "xno" && test
"x$missing_perl_modules" != "xyes"])
@@ -95,7 +95,7 @@ index 399a726..4d60102 100644
dnl Library versioning.
MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
AC_SUBST(MAX_PROC_NR)
-@@ -1230,9 +1169,6 @@ AC_CONFIG_FILES([Makefile
+@@ -1261,9 +1200,6 @@ AC_CONFIG_FILES([Makefile
generator/Makefile
gnulib/lib/Makefile
gnulib/tests/Makefile
@@ -105,7 +105,7 @@ index 399a726..4d60102 100644
haskell/Makefile
inspector/Makefile
java/Makefile
-@@ -1310,10 +1246,6 @@ if test "x$HAVE_TOOLS_TRUE" = "x"; then echo
"yes"; else echo "no"; fi
+@@ -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"
@@ -117,15 +117,15 @@ index 399a726..4d60102 100644
if test "x$HAVE_GNU_GETTEXT_TRUE" = "x"; then echo "yes";
else echo "no"; fi
echo
diff --git a/po/POTFILES b/po/POTFILES
-index 3e3f300..3e87532 100644
+index 2942d79..c9c592c 100644
--- a/po/POTFILES
+++ b/po/POTFILES
-@@ -130,48 +130,6 @@ fish/time.c
- fish/virt.c
+@@ -134,64 +134,6 @@ fish/tilde.c
+ fish/time.c
format/format.c
fuse/guestmount.c
-gobject/src/optargs-add_domain.c
--gobject/src/optargs-add_drive_opts.c
+-gobject/src/optargs-add_drive.c
-gobject/src/optargs-btrfs_filesystem_resize.c
-gobject/src/optargs-btrfs_fsck.c
-gobject/src/optargs-compress_device_out.c
@@ -136,23 +136,37 @@ index 3e3f300..3e87532 100644
-gobject/src/optargs-copy_file_to_file.c
-gobject/src/optargs-e2fsck.c
-gobject/src/optargs-fstrim.c
+-gobject/src/optargs-grep.c
+-gobject/src/optargs-hivex_open.c
-gobject/src/optargs-inspect_get_icon.c
+-gobject/src/optargs-internal_test.c
-gobject/src/optargs-md_create.c
+-gobject/src/optargs-mkfs.c
-gobject/src/optargs-mkfs_btrfs.c
--gobject/src/optargs-mkfs_opts.c
+-gobject/src/optargs-mkswap.c
-gobject/src/optargs-mount_9p.c
-gobject/src/optargs-mount_local.c
-gobject/src/optargs-ntfsclone_out.c
-gobject/src/optargs-ntfsfix.c
--gobject/src/optargs-ntfsresize_opts.c
+-gobject/src/optargs-ntfsresize.c
+-gobject/src/optargs-rsync.c
+-gobject/src/optargs-rsync_in.c
+-gobject/src/optargs-rsync_out.c
-gobject/src/optargs-set_e2attrs.c
--gobject/src/optargs-test0.c
+-gobject/src/optargs-tar_in.c
+-gobject/src/optargs-tar_out.c
-gobject/src/optargs-tune2fs.c
+-gobject/src/optargs-umount.c
-gobject/src/optargs-umount_local.c
+-gobject/src/optargs-xfs_admin.c
+-gobject/src/optargs-xfs_growfs.c
+-gobject/src/optargs-xfs_repair.c
-gobject/src/session.c
-gobject/src/struct-application.c
-gobject/src/struct-btrfssubvolume.c
-gobject/src/struct-dirent.c
+-gobject/src/struct-hivex_node.c
+-gobject/src/struct-hivex_value.c
-gobject/src/struct-inotify_event.c
-gobject/src/struct-int_bool.c
-gobject/src/struct-isoinfo.c
@@ -163,12 +177,14 @@ index 3e3f300..3e87532 100644
-gobject/src/struct-partition.c
-gobject/src/struct-stat.c
-gobject/src/struct-statvfs.c
+-gobject/src/struct-utsname.c
-gobject/src/struct-version.c
-gobject/src/struct-xattr.c
+-gobject/src/struct-xfsinfo.c
-gobject/src/tristate.c
inspector/virt-inspector.c
java/com_redhat_et_libguestfs_GuestFS.c
- ocaml/guestfs_c.c
+ ocaml/guestfs-c-actions.c
--
1.7.4.1
diff --git a/0007-EPEL-5-Remove-PHP-bindings.patch
b/0009-EPEL-5-Remove-PHP-bindings.patch
similarity index 82%
rename from 0007-EPEL-5-Remove-PHP-bindings.patch
rename to 0009-EPEL-5-Remove-PHP-bindings.patch
index 90a355c..3927c77 100644
--- a/0007-EPEL-5-Remove-PHP-bindings.patch
+++ b/0009-EPEL-5-Remove-PHP-bindings.patch
@@ -1,7 +1,7 @@
-From 03db70c2ea3c259134cef2b638dc3ea5056ae1d6 Mon Sep 17 00:00:00 2001
+From f4a1318f01f19b2503c29c6cae9a2cdaf695bee1 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sun, 17 Jun 2012 23:01:43 +0100
-Subject: [PATCH 07/20] EPEL 5: Remove PHP bindings.
+Subject: [PATCH 09/29] EPEL 5: Remove PHP bindings.
---
Makefile.am | 3 ---
@@ -10,10 +10,10 @@ Subject: [PATCH 07/20] EPEL 5: Remove PHP bindings.
3 files changed, 0 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 88e3815..5175bf3 100644
+index 710a81c..9d67397 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -81,9 +81,6 @@ endif
+@@ -85,9 +85,6 @@ endif
if HAVE_HASKELL
SUBDIRS += haskell
endif
@@ -24,10 +24,10 @@ index 88e3815..5175bf3 100644
# Unconditional because nothing is built yet.
SUBDIRS += csharp
diff --git a/configure.ac b/configure.ac
-index 4d60102..1b1c22f 100644
+index 1a37987..4f94be9 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1101,20 +1101,6 @@ AS_IF([test "x$enable_haskell" != "xno"],
+@@ -1132,20 +1132,6 @@ AS_IF([test "x$enable_haskell" != "xno"],
AM_CONDITIONAL([HAVE_HASKELL],
[test "x$GHC" != "xno"])
@@ -48,7 +48,7 @@ index 4d60102..1b1c22f 100644
dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
AS_IF([test "x$PERL" != "xno"],
[
-@@ -1179,7 +1165,6 @@ AC_CONFIG_FILES([Makefile
+@@ -1210,7 +1196,6 @@ AC_CONFIG_FILES([Makefile
perl/Makefile
perl/Makefile.PL
perl/examples/Makefile
@@ -56,7 +56,7 @@ index 4d60102..1b1c22f 100644
po-docs/Makefile
po-docs/ja/Makefile
po-docs/uk/Makefile
-@@ -1238,8 +1223,6 @@ echo -n "Java bindings ....................... "
+@@ -1273,8 +1258,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
@@ -66,10 +66,10 @@ index 4d60102..1b1c22f 100644
echo -n "Perl virt tools ..................... "
if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else
echo "no"; fi
diff --git a/po/POTFILES b/po/POTFILES
-index 3e87532..0e06f4e 100644
+index c9c592c..7609f47 100644
--- a/po/POTFILES
+++ b/po/POTFILES
-@@ -139,7 +139,6 @@ perl/Guestfs.c
+@@ -142,7 +142,6 @@ perl/Guestfs.c
perl/bindtests.pl
perl/lib/Sys/Guestfs.pm
perl/lib/Sys/Guestfs/Lib.pm
diff --git a/0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
b/0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
new file mode 100644
index 0000000..274bbe1
--- /dev/null
+++ b/0010-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch
@@ -0,0 +1,39 @@
+From e8eed32149ea9a6d20f6bddc2da0dcf13e213297 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Sun, 17 Jun 2012 22:17:06 +0100
+Subject: [PATCH 10/29] 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
+--- a/src/inspect-fs-windows.c
++++ b/src/inspect-fs-windows.c
+@@ -44,6 +44,22 @@
+ #include "guestfs-internal-actions.h"
+ #include "guestfs_protocol.h"
+
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#ifndef le64toh
++#define le64toh(x) (x)
++#endif
++#ifndef le32toh
++#define le32toh(x) (x)
++#endif
++#else /* __BYTE_ORDER == __BIG_ENDIAN */
++#ifndef le64toh
++#define le64toh(x) bswap_64 (x)
++#endif
++#ifndef le32toh
++#define le32toh(x) bswap_32 (x)
++#endif
++#endif
++
+ /* Compile all the regular expressions once when the shared library is
+ * loaded. PCRE is thread safe so we're supposedly OK here if
+ * multiple threads call into the libguestfs API functions below
+--
+1.7.4.1
+
diff --git a/0009-EPEL-5-Add-gnulib-utimensat-module.patch
b/0011-EPEL-5-Add-gnulib-utimensat-module.patch
similarity index 73%
rename from 0009-EPEL-5-Add-gnulib-utimensat-module.patch
rename to 0011-EPEL-5-Add-gnulib-utimensat-module.patch
index f9fe6cb..3a10b32 100644
--- a/0009-EPEL-5-Add-gnulib-utimensat-module.patch
+++ b/0011-EPEL-5-Add-gnulib-utimensat-module.patch
@@ -1,7 +1,7 @@
-From f14d4f6577e5ca9689e38be35bf6322731d43399 Mon Sep 17 00:00:00 2001
+From e794f3a5d7f5016d8e059e2158407365c85f2060 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sun, 17 Jun 2012 22:58:58 +0100
-Subject: [PATCH 09/20] EPEL 5: Add gnulib utimensat module.
+Subject: [PATCH 11/29] EPEL 5: Add gnulib utimensat module.
This function is missing in RHEL 5-era kernels.
---
@@ -10,10 +10,10 @@ This function is missing in RHEL 5-era kernels.
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/bootstrap b/bootstrap
-index dd5006c..feb67f0 100755
+index be0dfe4..de6e506 100755
--- a/bootstrap
+++ b/bootstrap
-@@ -84,6 +84,7 @@ strndup
+@@ -88,6 +88,7 @@ strndup
symlinkat
sys_select
sys_wait
@@ -22,7 +22,7 @@ index dd5006c..feb67f0 100755
vc-list-files
warnings
diff --git a/m4/.gitignore b/m4/.gitignore
-index 7fa447d..efc04be 100644
+index 78b0628..936fc97 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -53,6 +53,7 @@
@@ -31,9 +31,9 @@ index 7fa447d..efc04be 100644
/fseeko.m4
+/fstatat.m4
/fstat.m4
+ /fstatat.m4
/fsusage.m4
- /ftell.m4
-@@ -235,6 +236,7 @@
+@@ -238,6 +239,7 @@
/usleep.m4
/utimbuf.m4
/utimecmp.m4
diff --git a/0010-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
b/0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
similarity index 82%
rename from 0010-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
rename to 0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
index 7acec7d..f90b874 100644
--- a/0010-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
+++ b/0012-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
@@ -1,7 +1,7 @@
-From 293789946c9f39603307c5481acff06d18299685 Mon Sep 17 00:00:00 2001
+From 8a94bcf3b9d1c53f1f988abaa0c1439df8271216 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sun, 17 Jun 2012 23:00:16 +0100
-Subject: [PATCH 10/20] EPEL 5: Old ocamlopt didn't support debugging (-g option).
+Subject: [PATCH 12/29] EPEL 5: Old ocamlopt didn't support debugging (-g option).
---
ocaml/Makefile.am | 2 +-
@@ -11,10 +11,10 @@ Subject: [PATCH 10/20] 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 232edb7..aac27a2 100644
+index 8264574..1a8baf2 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
-@@ -45,7 +45,7 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so
+@@ -44,7 +44,7 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so
if HAVE_OCAML
OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX
@@ -24,7 +24,7 @@ index 232edb7..aac27a2 100644
noinst_DATA = mlguestfs.cma mlguestfs.cmxa META
diff --git a/resize/Makefile.am b/resize/Makefile.am
-index b613bb7..ab9033f 100644
+index fc69aa7..d0d9c9c 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -62,7 +62,7 @@ OCAMLPACKAGES += -package gettext-stub
@@ -37,7 +37,7 @@ index b613bb7..ab9033f 100644
virt-resize: $(OBJECTS)
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
-index 5df30a8..4ed4254 100644
+index d36dcdd..c1a7ee9 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -61,7 +61,7 @@ OCAMLPACKAGES += -package gettext-stub
@@ -50,10 +50,10 @@ index 5df30a8..4ed4254 100644
virt-sparsify: $(OBJECTS)
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
-index 7d20e10..a9be3f9 100644
+index 2ee9abf..b2934cb 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
-@@ -122,7 +122,7 @@ OCAMLPACKAGES += -package gettext-stub
+@@ -106,7 +106,7 @@ OCAMLPACKAGES += -package gettext-stub
endif
OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
diff --git a/0011-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
b/0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
similarity index 84%
rename from 0011-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
rename to 0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
index 02d56ca..f3b4183 100644
--- a/0011-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
+++ b/0013-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
@@ -1,17 +1,17 @@
-From 3526cb18a65ee6766c68f401e0b0ef2c6506e53e Mon Sep 17 00:00:00 2001
+From 9f894c4f11a01fe7f9de3d236672b675a987ad3d Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Mon, 18 Jun 2012 08:35:14 +0100
-Subject: [PATCH 11/20] EPEL 5: Replace format6 with format4 in OCaml gettext routines.
+Subject: [PATCH 13/29] 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 1b1c22f..c684e24 100644
+index 4f94be9..ae5d3d2 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -786,14 +786,14 @@ EOF
+@@ -805,14 +805,14 @@ EOF
cat <<EOF >>$output
module Gettext = struct
external s_ : string -> string = "%identity"
diff --git a/0012-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
b/0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
similarity index 79%
rename from 0012-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
rename to 0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
index 008adee..830c553 100644
--- a/0012-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
+++ b/0014-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
@@ -1,7 +1,7 @@
-From ea45202e070a592ff5cadabf053dee607a765056 Mon Sep 17 00:00:00 2001
+From 2c715fb5835d0bf3b24d94023065780586c82dc6 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Mon, 18 Jun 2012 12:18:35 +0100
-Subject: [PATCH 12/20] EPEL 5: Pass --preserve-dup-deps explicitly to libtool.
+Subject: [PATCH 14/29] 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 c684e24..6dc1aa9 100644
+index ae5d3d2..426a77b 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1128,7 +1128,7 @@ AC_SUBST(MAX_PROC_NR)
+@@ -1159,7 +1159,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/0013-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
b/0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
similarity index 62%
rename from 0013-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
rename to 0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
index 597fd21..92f3683 100644
--- a/0013-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
+++ b/0015-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
@@ -1,17 +1,17 @@
-From 1a9f894cbc2467c3b79f20a6de74a9070f8f30ef Mon Sep 17 00:00:00 2001
+From 967f72bfafe273039df3e69032be2bedb4137072 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Mon, 18 Jun 2012 17:21:30 +0100
-Subject: [PATCH 13/20] EPEL 5: Remove id= from -drive parameter on qemu command line.
+Subject: [PATCH 15/29] EPEL 5: Remove id= from -drive parameter on qemu command line.
---
- src/launch.c | 5 ++---
+ src/launch-appliance.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
-diff --git a/src/launch.c b/src/launch.c
-index 3bb41ae..2037a67 100644
---- a/src/launch.c
-+++ b/src/launch.c
-@@ -722,7 +722,7 @@ launch_appliance (guestfs_h *g)
+diff --git a/src/launch-appliance.c b/src/launch-appliance.c
+index 3ebaa7b..4d63101 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];
add_cmdline (g, "-drive");
@@ -20,14 +20,14 @@ index 3bb41ae..2037a67 100644
appliance, virtio_scsi ? "none" : "virtio",
cachemode);
add_cmdline (g, buf2);
-@@ -1568,12 +1568,11 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t
index)
+@@ -932,12 +932,11 @@ 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",
drv->readonly ? ",snapshot=on" : "",
- drv->use_cache_off ? ",cache=off" : "",
+ drv->use_cache_none ? ",cache=none" : "",
drv->format ? ",format=" : "",
drv->format ? drv->format : "",
- index,
diff --git a/0014-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
b/0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
similarity index 87%
rename from 0014-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
rename to 0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
index 99f7935..f662e7c 100644
--- a/0014-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
+++ b/0016-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
@@ -1,19 +1,19 @@
-From 1bf6cb7241d8d76e40b5e89f5219da681d98350a Mon Sep 17 00:00:00 2001
+From 46019c0f7b49ffa351c6a21e6e6122c8e54d14fc Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Mon, 18 Jun 2012 16:06:34 +0100
-Subject: [PATCH 14/20] EPEL 5: Add "null vmchannel" back for qemu without
virtio-serial support.
+Subject: [PATCH 16/29] EPEL 5: Add "null vmchannel" back for qemu without
virtio-serial support.
---
- appliance/init | 4 +-
- daemon/guestfsd.c | 99 +++++++++++++++++++++++++--
- src/launch.c | 196 ++++++++++++++++++++++++++++++++++++++---------------
+ appliance/init | 4 +-
+ daemon/guestfsd.c | 99 ++++++++++++++++++++++--
+ src/launch-appliance.c | 196 ++++++++++++++++++++++++++++++++++--------------
3 files changed, 233 insertions(+), 66 deletions(-)
diff --git a/appliance/init b/appliance/init
-index bfc0952..47e088c 100755
+index f9818b6..bdb30c4 100755
--- a/appliance/init
+++ b/appliance/init
-@@ -75,10 +75,10 @@ hwclock -u -s
+@@ -77,10 +77,10 @@ hwclock -u -s
ip addr add 127.0.0.1/8 brd + dev lo scope host
ip link set dev lo up
@@ -27,10 +27,10 @@ index bfc0952..47e088c 100755
# Scan for MDs.
mdadm -As --auto=yes --run
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
-index b09f74e..eedd3cc 100644
+index e6d5fde..ba1a48b 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
-@@ -112,9 +112,6 @@ int autosync_umount = 1;
+@@ -115,9 +115,6 @@ int autosync_umount = 1;
/* Not used explicitly, but required by the gnulib 'error' module. */
const char *program_name = "guestfsd";
@@ -40,7 +40,7 @@ index b09f74e..eedd3cc 100644
static void
usage (void)
{
-@@ -133,6 +130,7 @@ main (int argc, char *argv[])
+@@ -136,6 +133,7 @@ main (int argc, char *argv[])
};
int c;
char *cmdline;
@@ -48,7 +48,7 @@ index b09f74e..eedd3cc 100644
ignore_value (chdir ("/"));
-@@ -204,8 +202,6 @@ main (int argc, char *argv[])
+@@ -207,8 +205,6 @@ main (int argc, char *argv[])
printf ("could not read linux command line\n");
}
@@ -57,7 +57,7 @@ index b09f74e..eedd3cc 100644
#ifndef WIN32
/* Make sure SIGPIPE doesn't kill us. */
struct sigaction sa;
-@@ -247,9 +243,94 @@ main (int argc, char *argv[])
+@@ -250,9 +246,94 @@ main (int argc, char *argv[])
*/
copy_lvm ();
@@ -154,7 +154,7 @@ index b09f74e..eedd3cc 100644
fprintf (stderr,
"\n"
"Failed to connect to virtio-serial channel.\n"
-@@ -263,7 +344,7 @@ main (int argc, char *argv[])
+@@ -266,7 +347,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 +163,7 @@ index b09f74e..eedd3cc 100644
exit (EXIT_FAILURE);
}
-@@ -283,6 +364,8 @@ main (int argc, char *argv[])
+@@ -286,6 +367,8 @@ main (int argc, char *argv[])
xdr_destroy (&xdr);
@@ -172,26 +172,28 @@ index b09f74e..eedd3cc 100644
/* Enter the main loop, reading and performing actions. */
main_loop (sock);
-diff --git a/src/launch.c b/src/launch.c
-index 2037a67..4d02c62 100644
---- a/src/launch.c
-+++ b/src/launch.c
-@@ -73,10 +73,14 @@
+diff --git a/src/launch-appliance.c b/src/launch-appliance.c
+index 4d63101..59ca93c 100644
+--- a/src/launch-appliance.c
++++ b/src/launch-appliance.c
+@@ -36,12 +36,16 @@
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
+#define NETWORK "10.0.2.0/24"
+#define ROUTER "10.0.2.2"
+
- static int launch_appliance (guestfs_h *g);
- static int64_t timeval_diff (const struct timeval *x, const struct timeval *y);
+ static int is_openable (guestfs_h *g, const char *path, int flags);
static void print_qemu_command_line (guestfs_h *g, char **argv);
- static int connect_unix_socket (guestfs_h *g, const char *sock);
-+static int check_peer_euid (guestfs_h *g, int sock, uid_t *rtn);
static int qemu_supports (guestfs_h *g, const char *option);
static int qemu_supports_device (guestfs_h *g, const char *device_name);
static int qemu_supports_virtio_scsi (guestfs_h *g);
-@@ -549,7 +553,9 @@ launch_appliance (guestfs_h *g)
+ static char *qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index);
++static int check_peer_euid (guestfs_h *g, int sock, uid_t *rtn);
+
+ /* 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)
int r;
int wfd[2], rfd[2];
char guestfsd_sock[256];
@@ -202,7 +204,7 @@ index 2037a67..4d02c62 100644
/* At present you must add drives before starting the appliance. In
* future when we enable hotplugging you won't need to do this.
-@@ -585,37 +591,43 @@ launch_appliance (guestfs_h *g)
+@@ -157,37 +163,43 @@ launch_appliance (guestfs_h *g, const char *arg)
if (qemu_supports (g, NULL) == -1)
goto cleanup0;
@@ -261,7 +263,7 @@ index 2037a67..4d02c62 100644
if (!g->direct) {
if (pipe (wfd) == -1 || pipe (rfd) == -1) {
perrorf (g, "pipe");
-@@ -796,30 +808,20 @@ launch_appliance (guestfs_h *g)
+@@ -370,23 +382,9 @@ launch_appliance (guestfs_h *g, const char *arg)
if (qemu_supports (g, "-rtc-td-hack"))
add_cmdline (g, "-rtc-td-hack");
@@ -284,6 +286,12 @@ index 2037a67..4d02c62 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");
+
- /* Set up virtio-serial for the communications channel. */
- add_cmdline (g, "-chardev");
- snprintf (buf, sizeof buf, "socket,path=%s,id=channel0", guestfsd_sock);
@@ -303,7 +311,7 @@ index 2037a67..4d02c62 100644
#ifdef VALGRIND_DAEMON
/* Set up virtio-serial channel for valgrind messages. */
-@@ -831,14 +833,6 @@ launch_appliance (guestfs_h *g)
+@@ -414,14 +416,6 @@ launch_appliance (guestfs_h *g, const char *arg)
add_cmdline (g,
"virtserialport,chardev=valgrind,name=org.libguestfs.valgrind");
#endif
@@ -318,7 +326,7 @@ index 2037a67..4d02c62 100644
#if defined(__arm__)
#define SERIAL_CONSOLE "ttyAMA0"
#else
-@@ -859,11 +853,13 @@ launch_appliance (guestfs_h *g)
+@@ -442,11 +436,13 @@ launch_appliance (guestfs_h *g, const char *arg)
LINUX_CMDLINE
"%s " /* (root) */
"%s " /* (selinux) */
@@ -332,7 +340,7 @@ index 2037a67..4d02c62 100644
g->verbose ? "guestfs_verbose=1" : "",
getenv ("TERM") ? : "linux",
g->append ? g->append : "");
-@@ -1036,19 +1032,30 @@ launch_appliance (guestfs_h *g)
+@@ -619,19 +615,30 @@ launch_appliance (guestfs_h *g, const char *arg)
g->state = LAUNCHING;
@@ -374,7 +382,7 @@ index 2037a67..4d02c62 100644
/* Close the listening socket. */
if (close (g->sock) != 0) {
-@@ -1590,6 +1597,83 @@ drive_name (size_t index, char *ret)
+@@ -954,6 +961,83 @@ guestfs___drive_name (size_t index, char *ret)
return ret;
}
@@ -455,9 +463,9 @@ index 2037a67..4d02c62 100644
+ return -1;
+}
+
- /* You had to call this function after launch in versions <= 1.0.70,
- * but it is now a no-op.
- */
+ static int
+ shutdown_appliance (guestfs_h *g)
+ {
--
1.7.4.1
diff --git a/0017-EPEL-5-Disable-libvirt-attach-method.patch
b/0017-EPEL-5-Disable-libvirt-attach-method.patch
new file mode 100644
index 0000000..3134136
--- /dev/null
+++ b/0017-EPEL-5-Disable-libvirt-attach-method.patch
@@ -0,0 +1,25 @@
+From b3995d6a0c981983dbb311a698f2c044e286406b Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Thu, 30 Aug 2012 17:57:46 +0100
+Subject: [PATCH 17/29] 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
+--- a/src/launch-libvirt.c
++++ b/src/launch-libvirt.c
+@@ -66,7 +66,7 @@
+ MIN_LIBVIRT_MINOR * 1000 + \
+ MIN_LIBVIRT_MICRO)
+
+-#if defined(HAVE_LIBVIRT) && \
++#if 0 && defined(HAVE_LIBVIRT) && \
+ LIBVIR_VERSION_NUMBER >= MIN_LIBVIRT_VERSION && \
+ defined(HAVE_LIBXML2)
+
+--
+1.7.4.1
+
diff --git a/0015-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
b/0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
similarity index 83%
rename from 0015-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
rename to 0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
index a4c7d60..1e49b69 100644
--- a/0015-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
+++ b/0018-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
@@ -1,7 +1,7 @@
-From 1a242d8084c7376a51b7ea0a8b53db79b11b04bf Mon Sep 17 00:00:00 2001
+From f27a26238699e4ffb004ee496cd1249fcff2d2a6 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Fri, 22 Jun 2012 10:06:47 +0100
-Subject: [PATCH 15/20] EPEL 5: Fix blkid to return "LVM2_member" for PVs.
+Subject: [PATCH 18/29] EPEL 5: Fix blkid to return "LVM2_member" for PVs.
Old blkid in RHEL 5 didn't return the right thing for PVs.
---
@@ -9,10 +9,10 @@ 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 7cc7889..32168a3 100644
+index b6bc22d..310de94 100644
--- a/daemon/blkid.c
+++ b/daemon/blkid.c
-@@ -51,6 +51,26 @@ get_blkid_tag (const char *device, const char *tag)
+@@ -53,6 +53,26 @@ get_blkid_tag (const char *device, const char *tag)
free (err);
if (r == 2) { /* means UUID etc not found */
diff --git a/0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
b/0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
new file mode 100644
index 0000000..601f276
--- /dev/null
+++ b/0019-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
@@ -0,0 +1,42 @@
+From 16065fe8654dc6bba9517ba969b7291ce60602e4 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)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.
+
+This didn't have -o backing_file etc. Use old -b and -F options instead.
+---
+ sparsify/sparsify.ml | 18 ++++++------------
+ 1 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml
+index 379ccf4..9041ca2 100644
+--- a/sparsify/sparsify.ml
++++ b/sparsify/sparsify.ml
+@@ -207,18 +207,12 @@ let overlaydisk =
+
+ (* Create it with the indisk as the backing file. *)
+ let cmd =
+- let options =
+- let backing_file_option =
+- [sprintf "backing_file=%s" (replace_str indisk ","
",,")] in
+- let backing_fmt_option =
+- match format with
+- | None -> []
+- | Some fmt -> [sprintf "backing_fmt=%s" fmt] in
+- let version3 =
+- if qemu_img_version >= 1.1 then ["compat=1.1"] else [] in
+- backing_file_option @ backing_fmt_option @ version3 in
+- sprintf "qemu-img create -f qcow2 -o %s %s > /dev/null"
+- (Filename.quote (String.concat "," options)) (Filename.quote tmp) in
++ sprintf "qemu-img create -f qcow2%s -b %s %s > /dev/null"
++ (match format with
++ | None -> ""
++ | Some fmt -> sprintf " -F %s" fmt)
++ (replace_str indisk "," ",,")
++ (Filename.quote tmp) in
+ if verbose then
+ printf "%s\n%!" cmd;
+ if Sys.command cmd <> 0 then
+--
+1.7.4.1
+
diff --git a/0017-EPEL-5-Remove-Fedora-MD-test-images.patch
b/0020-EPEL-5-Remove-Fedora-MD-test-images.patch
similarity index 64%
rename from 0017-EPEL-5-Remove-Fedora-MD-test-images.patch
rename to 0020-EPEL-5-Remove-Fedora-MD-test-images.patch
index 8318d4a..38f669b 100644
--- a/0017-EPEL-5-Remove-Fedora-MD-test-images.patch
+++ b/0020-EPEL-5-Remove-Fedora-MD-test-images.patch
@@ -1,16 +1,16 @@
-From a61d5f78cad9d28df1955dc33755a5d822dca208 Mon Sep 17 00:00:00 2001
+From c91abaaa5ff64af96a543f698f71f4deff0cbcb9 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Fri, 22 Jun 2012 13:15:49 +0100
-Subject: [PATCH 17/20] EPEL 5: Remove Fedora MD test images.
+Subject: [PATCH 20/29] 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 | 15 +--------------
- 1 files changed, 1 insertions(+), 14 deletions(-)
+ tests/guests/Makefile.am | 12 +-----------
+ 1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am
-index 77ce61b..ad8ca5a 100644
+index a05dceb..d98f12d 100644
--- a/tests/guests/Makefile.am
+++ b/tests/guests/Makefile.am
@@ -38,7 +38,7 @@ EXTRA_DIST = \
@@ -20,11 +20,11 @@ index 77ce61b..ad8ca5a 100644
-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
+ CLEANFILES = $(check_DATA) stamp-fedora-md.img *.tmp.*
-@@ -51,19 +51,6 @@ fedora.img: guest-aux/make-fedora-img.pl \
- LAYOUT=partitions \
- ../../run --test $<
+@@ -48,16 +48,6 @@ fedora.img: guest-aux/make-fedora-img.pl \
+ guest-aux/fedora-packages.db
+ SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test $<
-# Make a (dummy) Fedora image using md devices
-fedora-md1.img fedora-md2.img: stamp-fedora-md.img
@@ -33,10 +33,7 @@ index 77ce61b..ad8ca5a 100644
- guest-aux/fedora-name.db \
- guest-aux/fedora-packages.db
- rm -f $@
-- TMPDIR=$(top_builddir) \
-- SRCDIR=$(srcdir) \
-- LAYOUT=partitions-md \
-- ../../run --test $<
+- SRCDIR=$(srcdir) LAYOUT=partitions-md $(top_builddir)/run --test $<
- touch $@
-
guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
diff --git a/0018-EPEL-5-Add-mkisofs-to-package-list.patch
b/0021-EPEL-5-Add-mkisofs-to-package-list.patch
similarity index 74%
rename from 0018-EPEL-5-Add-mkisofs-to-package-list.patch
rename to 0021-EPEL-5-Add-mkisofs-to-package-list.patch
index 81b491c..06bcdd9 100644
--- a/0018-EPEL-5-Add-mkisofs-to-package-list.patch
+++ b/0021-EPEL-5-Add-mkisofs-to-package-list.patch
@@ -1,7 +1,7 @@
-From f111929f1b5c1c5a4091cf66608370cda539eccb Mon Sep 17 00:00:00 2001
+From 529c3b172f2171029de72946745628ef1446159f Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Fri, 22 Jun 2012 14:46:43 +0100
-Subject: [PATCH 18/20] EPEL 5: Add mkisofs to package list.
+Subject: [PATCH 21/29] 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 f7dab2c..0e29868 100644
+index 6d412cb..5167f83 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
-@@ -111,6 +111,7 @@ lsscsi
+@@ -114,6 +114,7 @@ lsscsi
lvm2
lzop
mdadm
diff --git a/0019-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
b/0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
similarity index 76%
rename from 0019-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
rename to 0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
index 66ea197..c7fc8a5 100644
--- a/0019-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
+++ b/0022-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
@@ -1,7 +1,7 @@
-From 7da9fb725679c81fb641b97e502bad75815df65c Mon Sep 17 00:00:00 2001
+From 9a62a5956168d4ec4d02898318ac8ca325451e9c Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones(a)redhat.com>
Date: Fri, 22 Jun 2012 21:58:32 +0100
-Subject: [PATCH 19/20] EPEL 5: Add 1 second pause after unmounting any filesystem.
+Subject: [PATCH 22/29] 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,10 +24,10 @@ which fails without this is:
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/daemon/mount.c b/daemon/mount.c
-index 0661eb8..6cfe3e3 100644
+index c84faaf..1e8aac1 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
-@@ -216,6 +216,9 @@ do_umount (const char *pathordevice)
+@@ -237,6 +237,9 @@ do_umount (const char *pathordevice,
free (err);
@@ -37,7 +37,7 @@ index 0661eb8..6cfe3e3 100644
return 0;
}
-@@ -376,6 +379,9 @@ do_umount_all (void)
+@@ -397,6 +400,9 @@ do_umount_all (void)
free_stringslen (mounts.argv, mounts.size);
diff --git a/0023-EPEL-5-podwrapper-Remove-HTML-output.patch
b/0023-EPEL-5-podwrapper-Remove-HTML-output.patch
new file mode 100644
index 0000000..66017c1
--- /dev/null
+++ b/0023-EPEL-5-podwrapper-Remove-HTML-output.patch
@@ -0,0 +1,123 @@
+From 1645ec8ff0b395886bdb86525599a3cbb5bd892d Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Thu, 30 Aug 2012 18:01:00 +0100
+Subject: [PATCH 23/29] 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(-)
+
+diff --git a/podwrapper.pl.in b/podwrapper.pl.in
+index b8b0459..389c398 100755
+--- a/podwrapper.pl.in
++++ b/podwrapper.pl.in
+@@ -25,7 +25,6 @@ use Getopt::Long;
+ use Pod::Man;
+ use Pod::Simple;
+ use Pod::Simple::Text;
+-use Pod::Simple::XHTML;
+ use File::Basename;
+
+ =encoding utf8
+@@ -403,96 +402,6 @@ if ($man) {
+ print "$progname: wrote $man\n";
+ }
+
+-# Output HTML.
+-SUBHTML: {
+- # Subclass Pod::Simple::XHTML. See the documentation.
+- package Podwrapper::XHTML;
+-
+- use vars qw(@ISA $VERSION);
+- @ISA = qw(Pod::Simple::XHTML);
+- $VERSION = $package_version;
+-
+- # Pod::Simple::XHTML returns uppercase identifiers, whereas the
+- # old pod2html returns lowercase ones.
+- sub idify
+- {
+- my $self = shift;
+- my $id = $self->SUPER::idify (@_);
+- lc ($id);
+- }
+-
+- sub is_a_libguestfs_page
+- {
+- local $_ = shift;
+-
+- return 1 if /^Sys::Guestfs/;
+- return 1 if /^virt-/;
+- return 1 if /^libguestf/;
+- return 1 if /^guestf/;
+- return 1 if /^guestmount/;
+- return 1 if /^hivex/;
+- return 1 if /^febootstrap/;
+- return 0;
+- }
+-
+- sub resolve_pod_page_link
+- {
+- my $self = shift;
+- my $podname = $_[0]; # eg. "Sys::Guestfs", can be undef
+- my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef
+- my $r = "";
+- if (defined $podname) {
+- return $self->SUPER::resolve_pod_page_link (@_)
+- unless is_a_libguestfs_page ($podname);
+- $r .= "$podname.3.html"
+- }
+- $r .= "#" . $self->idify ($anchor, 1) if defined $anchor;
+- $r;
+- }
+-
+- sub resolve_man_page_link
+- {
+- my $self = shift;
+- my $name = $_[0]; # eg. "virt-make-fs(1)", can be undef
+- my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef
+- my $r = "";
+- if (defined $name) {
+- return $self->SUPER::resolve_man_page_link (@_)
+- unless is_a_libguestfs_page ($name);
+- $name =~ s/\((.*)\)$/.$1/;
+- $r .= "$name.html";
+- }
+- $r .= "#" . $self->idify ($anchor, 1) if defined $anchor;
+- $r;
+- }
+-
+- # For some reason Pod::Simple::XHTML usually cannot find a
+- # title for the page. This defaults the HTML <title> field
+- # to the same as the man page name.
+- sub default_title { $name }
+-}
+-
+-if ($html) {
+- mkdir "$abs_top_builddir/html";
+-
+- my $parser = Podwrapper::XHTML->new;
+- my $output;
+- $parser->output_string (\$output);
+- # Added in Pod::Simple 3.16, 2011-03-14.
+- eval { $parser->html_charset ("UTF-8") };
+- $parser->html_css ("pod.css");
+- $parser->index (1);
+- $parser->parse_string_document ($content);
+-
+- # Hack for Perl 5.16.
+- $output =~ s{/>pod.css<}{/>\n<};
+-
+- open OUT, ">$html" or die "$progname: $html: $!";
+- print OUT $output or die "$progname: $html: $!";
+- close OUT or die "$progname: $html: $!";
+- print "$progname: wrote $html\n";
+-}
+-
+ # Output text.
+ if ($text) {
+ my $parser = Pod::Simple::Text->new;
+--
+1.7.4.1
+
diff --git a/0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
b/0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
new file mode 100644
index 0000000..eac3f64
--- /dev/null
+++ b/0024-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch
@@ -0,0 +1,28 @@
+From 29a84bcdba66c82a4d5d4e9dfff36f0ecb1a93b0 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Thu, 30 Aug 2012 18:16:18 +0100
+Subject: [PATCH 24/29] 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
+method.
+---
+ podwrapper.pl.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/podwrapper.pl.in b/podwrapper.pl.in
+index 389c398..ee6d871 100755
+--- a/podwrapper.pl.in
++++ b/podwrapper.pl.in
+@@ -373,7 +373,7 @@ SUBMAN: {
+ package Podwrapper::Man;
+
+ use vars qw(@ISA $VERSION);
+- @ISA = qw(Pod::Man);
++ @ISA = qw(Pod::Simple::Text);
+ $VERSION = $package_version;
+
+ # Override the L<> method.
+--
+1.7.4.1
+
diff --git a/0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
b/0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
new file mode 100644
index 0000000..04f5bdd
--- /dev/null
+++ b/0025-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch
@@ -0,0 +1,89 @@
+From 9bd511139e5a3ac43cbfa4121a33c3859e021597 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)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"
+
+This reverts commit 61c9ea496e0579bb7d1bcf496595d66c3f08cfec.
+---
+ ocaml/Makefile.am | 16 ++++++++--------
+ 1 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
+index 1a8baf2..44803a2 100644
+--- a/ocaml/Makefile.am
++++ b/ocaml/Makefile.am
+@@ -106,7 +106,7 @@ noinst_DATA += \
+
+ bindtests.bc: bindtests.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(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
+
+ t/guestfs_500_mount_local.bc: t/guestfs_500_mount_local.cmo mlguestfs.cma
+ mkdir -p t
+- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute
\
++ LD_LIBRARY_PATH=../src/.libs \
+ $(OCAMLFIND) ocamlc -custom $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma
$< -o $@
+
+ t/guestfs_500_mount_local.opt: t/guestfs_500_mount_local.cmx mlguestfs.cmxa
+--
+1.7.4.1
+
diff --git a/0026-EPEL-5-Don-t-use-sgabios.patch b/0026-EPEL-5-Don-t-use-sgabios.patch
new file mode 100644
index 0000000..5a06653
--- /dev/null
+++ b/0026-EPEL-5-Don-t-use-sgabios.patch
@@ -0,0 +1,33 @@
+From d1061a6d55fe69906722aa655adb17ff1966f10d Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Fri, 31 Aug 2012 10:24:06 +0100
+Subject: [PATCH 26/29] EPEL 5: Don't use sgabios.
+
+Old qemu doesn't support '-device' parameter.
+---
+ src/launch-appliance.c | 9 ---------
+ 1 files changed, 0 insertions(+), 9 deletions(-)
+
+diff --git a/src/launch-appliance.c b/src/launch-appliance.c
+index 59ca93c..529c372 100644
+--- a/src/launch-appliance.c
++++ b/src/launch-appliance.c
+@@ -386,15 +386,6 @@ launch_appliance (guestfs_h *g, const char *arg)
+ add_cmdline (g, "-serial");
+ add_cmdline (g, "stdio");
+
+- /* 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/0027-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
new file mode 100644
index 0000000..28e12ae
--- /dev/null
+++ b/0027-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch
@@ -0,0 +1,383 @@
+From 382825b54551d09fb38bba03c1a0adf7ecf50937 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)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)."
+
+This reverts commit 163e030ee13644ad9efe1e078aff47b879657333.
+---
+ daemon/daemon.h | 2 +
+ daemon/ext2.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++-------
+ daemon/labels.c | 6 ++-
+ daemon/mkfs.c | 8 +++-
+ 4 files changed, 111 insertions(+), 18 deletions(-)
+
+diff --git a/daemon/daemon.h b/daemon/daemon.h
+index a483208..1734e40 100644
+--- a/daemon/daemon.h
++++ b/daemon/daemon.h
+@@ -174,6 +174,8 @@ extern int filesystem_available (const char *filesystem);
+ extern int sync_disks (void);
+
+ /*-- in ext2.c --*/
++extern int e2prog (char *name); /* Massive hack for RHEL 5. */
++
+ /* Confirmed this is true up to ext4 from the Linux sources. */
+ #define EXT2_LABEL_MAX 16
+
+diff --git a/daemon/ext2.c b/daemon/ext2.c
+index 40b36d2..d4ebf90 100644
+--- a/daemon/ext2.c
++++ b/daemon/ext2.c
+@@ -31,6 +31,7 @@
+
+ #define MAX_ARGS 64
+
++
+ GUESTFSD_EXT_CMD(str_tune2fs, tune2fs);
+ GUESTFSD_EXT_CMD(str_e2fsck, e2fsck);
+ GUESTFSD_EXT_CMD(str_resize2fs, resize2fs);
+@@ -38,6 +39,32 @@ GUESTFSD_EXT_CMD(str_mke2fs, mke2fs);
+ GUESTFSD_EXT_CMD(str_lsattr, lsattr);
+ GUESTFSD_EXT_CMD(str_chattr, chattr);
+
++/* Choose which tools like mke2fs to use. For RHEL 5 (only) there
++ * is a special set of tools which support ext2/3/4. eg. On RHEL 5,
++ * mke2fs only supports ext2/3, but mke4fs supports ext2/3/4.
++ *
++ * We specify e4fsprogs in the package list to ensure it is loaded
++ * if it exists.
++ */
++int
++e2prog (char *name)
++{
++ char *p = strstr (name, "e2");
++ if (!p) return 0;
++ p++;
++
++ *p = '4';
++ if (prog_exists (name))
++ return 0;
++
++ *p = '2';
++ if (prog_exists (name))
++ return 0;
++
++ reply_with_error ("cannot find required program %s", name);
++ return -1;
++}
++
+ char **
+ do_tune2fs_l (const char *device)
+ {
+@@ -46,7 +73,11 @@ do_tune2fs_l (const char *device)
+ char *p, *pend, *colon;
+ DECLARE_STRINGSBUF (ret);
+
+- r = command (&out, &err, str_tune2fs, "-l", device, NULL);
++ char prog[] = "tune2fs";
++ if (e2prog (prog) == -1)
++ return NULL;
++
++ 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)
+ int r;
+ char *err;
+
+- r = command (NULL, &err, str_tune2fs, "-U", uuid, device, NULL);
++ char prog[] = "tune2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
++ 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)
+ {
+ char *err;
+ int r, mounted;
++ char prog[] = "e2fsck";
++
++ if (e2prog (prog) == -1)
++ return -1;
+
+ mounted = is_device_mounted (device);
+ if (mounted == -1)
+ return -1;
+
+ if (!mounted) {
+- r = command (NULL, &err, str_e2fsck, "-fy", device, NULL);
++ r = command (NULL, &err, 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;
+ int r;
+
++ char prog[] = "resize2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ if (if_not_mounted_run_e2fsck (device) == -1)
+ return -1;
+
+- r = command (NULL, &err, str_resize2fs, device, NULL);
++ 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;
+ int r;
+
++ char prog[] = "resize2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ /* 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)
+ char buf[32];
+ snprintf (buf, sizeof buf, "%" PRIi64 "K", size);
+
+- r = command (NULL, &err, str_resize2fs, device, buf, NULL);
++ 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;
+ int r;
+
++ char prog[] = "resize2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ if (if_not_mounted_run_e2fsck (device) == -1)
+ return -1;
+
+- r = command (NULL, &err, str_resize2fs, "-M", device, NULL);
++ 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;
+ size_t i = 0;
+ int r;
++ char prog[] = "e2fsck";
++
++ if (e2prog (prog) == -1)
++ return -1;
+
+ /* Default if not selected. */
+ if (!(optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK))
+@@ -279,7 +334,7 @@ do_e2fsck (const char *device,
+ return -1;
+ }
+
+- ADD_ARG (argv, i, str_e2fsck);
++ ADD_ARG (argv, i, prog);
+ ADD_ARG (argv, i, "-f");
+
+ if (correct)
+@@ -322,11 +377,15 @@ do_mke2journal (int blocksize, const char *device)
+ char *err;
+ int r;
+
++ char prog[] = "mke2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ char blocksize_s[32];
+ snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
+
+ 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;
+ int r;
+
++ char prog[] = "mke2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ 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);
+
+ r = command (NULL, &err,
+- str_mke2fs, "-F", "-O", "journal_dev",
"-b", blocksize_s,
++ prog, "-F", "-O", "journal_dev",
"-b", blocksize_s,
+ "-L", label,
+ device, NULL);
+ if (r == -1) {
+@@ -373,11 +436,15 @@ do_mke2journal_U (int blocksize, const char *uuid, const char
*device)
+ char *err;
+ int r;
+
++ char prog[] = "mke2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ char blocksize_s[32];
+ snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize);
+
+ 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;
+ int r;
+
++ char prog[] = "mke2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ 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);
+
+ r = command (NULL, &err,
+- str_mke2fs, "-F", "-t", fstype, "-J", jdev,
"-b", blocksize_s,
++ prog, "-F", "-t", fstype, "-J", jdev,
"-b", blocksize_s,
+ 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;
+ int r;
+
++ char prog[] = "mke2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ 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);
+
+ r = command (NULL, &err,
+- str_mke2fs, "-F", "-t", fstype, "-J", jdev,
"-b", blocksize_s,
++ prog, "-F", "-t", fstype, "-J", jdev,
"-b", blocksize_s,
+ 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;
+ int r;
+
++ char prog[] = "mke2fs";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ 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);
+
+ r = command (NULL, &err,
+- str_mke2fs, "-F", "-t", fstype, "-J", jdev,
"-b", blocksize_s,
++ prog, "-F", "-t", fstype, "-J", jdev,
"-b", blocksize_s,
+ device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+@@ -495,6 +574,7 @@ do_tune2fs (const char *device, /* only required parameter */
+ size_t i = 0;
+ int r;
+ char *err;
++ 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 */
+ char reservedblockscount_s[64];
+ char user_s[64];
+
+- ADD_ARG (argv, i, str_tune2fs);
++ if (e2prog (prog) == -1)
++ return -1;
++
++ ADD_ARG (argv, i, prog);
+
+ if (optargs_bitmask & GUESTFS_TUNE2FS_FORCE_BITMASK) {
+ if (force)
+@@ -611,7 +694,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
+--- a/daemon/labels.c
++++ b/daemon/labels.c
+@@ -36,13 +36,17 @@ e2label (const char *device, const char *label)
+ int r;
+ char *err;
+
++ char prog[] = "e2label";
++ if (e2prog (prog) == -1)
++ return -1;
++
+ if (strlen (label) > EXT2_LABEL_MAX) {
+ reply_with_error ("%s: ext2 labels are limited to %d bytes",
+ label, EXT2_LABEL_MAX);
+ return -1;
+ }
+
+- r = command (NULL, &err, str_e2label, device, label, NULL);
++ r = command (NULL, &err, prog, device, label, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ free (err);
+diff --git a/daemon/mkfs.c b/daemon/mkfs.c
+index 241d346..c8c47b6 100644
+--- a/daemon/mkfs.c
++++ b/daemon/mkfs.c
+@@ -46,6 +46,7 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
+ char sectorsize_str[32];
+ int r;
+ char *err;
++ 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,
+ * the mkfs program "eats" some options, in particular the -F
+ * option.
+ */
+- if (extfs)
+- ADD_ARG (argv, i, str_mke2fs);
++ if (extfs) {
++ if (e2prog (mke2fs) == -1)
++ return -1;
++ ADD_ARG (argv, i, mke2fs);
++ }
+ else
+ ADD_ARG (argv, i, str_mkfs);
+
+--
+1.7.4.1
+
diff --git a/0028-EPEL-5-Disable-tar-xz-test.patch
b/0028-EPEL-5-Disable-tar-xz-test.patch
new file mode 100644
index 0000000..160c59b
--- /dev/null
+++ b/0028-EPEL-5-Disable-tar-xz-test.patch
@@ -0,0 +1,26 @@
+From e54f632085f5dde039defc7e77e91b10fb86f3d5 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)redhat.com>
+Date: Fri, 31 Aug 2012 14:59:25 +0100
+Subject: [PATCH 28/29] EPEL 5: Disable tar --xz test.
+
+Although xz is available, ancient tar didn't have the --xz option.
+---
+ generator/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>." };
+ [["mkdir"; "/tar_in_gz"];
+ ["tar_in"; "../data/helloworld.tar.gz";
"/tar_in_gz"; "gzip"];
+ ["cat"; "/tar_in_gz/hello"]], "hello\n");
+- InitScratchFS, IfAvailable "xz", TestOutput (
++ InitScratchFS, Disabled, TestOutput (
+ [["mkdir"; "/tar_in_xz"];
+ ["tar_in"; "../data/helloworld.tar.xz";
"/tar_in_xz"; "xz"];
+ ["cat"; "/tar_in_xz/hello"]], "hello\n")
+--
+1.7.4.1
+
diff --git a/0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
b/0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
new file mode 100644
index 0000000..6dad227
--- /dev/null
+++ b/0029-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch
@@ -0,0 +1,26 @@
+From 5b867468273b5fb9e8f6775b859dba9250d03ea5 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones(a)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.
+
+---
+ 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
+--- a/sparsify/sparsify.ml
++++ b/sparsify/sparsify.ml
+@@ -168,8 +168,7 @@ let qemu_img_version =
+ let stat = close_process_in chan in
+ (match stat with
+ | WEXITED _ -> ()
+- | WSIGNALED i ->
+- error (f_"external command '%s' killed by signal %d") cmd i
++ | WSIGNALED i -> ()
+ | WSTOPPED i ->
+ error (f_"external command '%s' stopped by signal %d") cmd i
+ );
+--
+1.7.4.1
+
diff --git a/libguestfs.spec b/libguestfs.spec
index 2fe53c7..b754023 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.13
-Release: 4%{?dist}
+Version: 1.19.37
+Release: 1%{?dist}
License: LGPLv2+
Group: Development/Libraries
URL:
http://libguestfs.org/
@@ -41,33 +41,40 @@ BuildRequires: autoconf, automake, libtool
# These patches come from the "oldlinux" branch upstream.
#
https://github.com/libguestfs/libguestfs/commits/oldlinux
-Patch0001: 0001-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch
-Patch0002: 0002-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch
-Patch0003: 0003-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch
-Patch0004: 0004-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch
-Patch0005: 0005-EPEL-5-Remove-Erlang-bindings.patch
-Patch0006: 0006-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch
-Patch0007: 0007-EPEL-5-Remove-PHP-bindings.patch
-Patch0008: 0008-EPEL-5-Define-le64toh-if-not-defined.patch
-Patch0009: 0009-EPEL-5-Add-gnulib-utimensat-module.patch
-Patch0010: 0010-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch
-Patch0011: 0011-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch
-Patch0012: 0012-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch
-Patch0013: 0013-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch
-Patch0014: 0014-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch
-Patch0015: 0015-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch
-Patch0016: 0016-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch
-Patch0017: 0017-EPEL-5-Remove-Fedora-MD-test-images.patch
-Patch0018: 0018-EPEL-5-Add-mkisofs-to-package-list.patch
-Patch0019: 0019-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
-
-# Upstream in libguestfs >= 1.19.14.
-Patch0020: 0001-src-actions.c-Include-config.h-in-this-generated-fil.patch
+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
# Basic build requirements:
BuildRequires: /usr/bin/pod2man
BuildRequires: /usr/bin/pod2text
-BuildRequires: febootstrap >= 3.18
+BuildRequires: febootstrap >= 3.20
BuildRequires: hivex-devel >= 1.2.7-7
BuildRequires: perl-hivex
BuildRequires: augeas-devel >= 0.5.0
@@ -225,7 +232,7 @@ BuildRequires: git
# Runtime requires:
Requires: kvm
-Requires: febootstrap-supermin-helper >= 3.18
+Requires: febootstrap-supermin-helper >= 3.20
# For libguestfs-test-tool.
Requires: mkisofs
@@ -676,6 +683,11 @@ export SKIP_TEST_UTIMENS_3=1
# Timing problem in this test.
export SKIP_TEST_SWAPON_LABEL=1
+# 9p is not supported in this qemu.
+export SKIP_TEST_9P_SH=1
+
+# rsync doesn't work because of different IP addresses.
+export SKIP_TEST_RSYNC_SH=1
%if %{runtests}
make check
@@ -878,6 +890,12 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Sat Sep 1 2012 Richard W.M. Jones <rjones(a)redhat.com> - 1:1.19.37-1
+- Upstream to 1.19.37.
+- Update patches from 'oldlinux' branch.
+- Skip more tests that would fail in RHEL 5.
+- Require febootstrap >= 3.20.
+
* Wed Jun 27 2012 Richard W.M. Jones <rjones(a)redhat.com> - 1:1.19.13-4
- New upstream version 1.19.13.
- Update patches.