From 85840592151ccea9f807c77aee8f951db961fb34 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 20 Nov 2013 13:25:14 +0000 Subject: [PATCH] Remove patch which is now upstream. --- ...tream-btrfs-device-add-command-now-n.patch | 79 ------------------- libguestfs.spec | 5 -- 2 files changed, 84 deletions(-) delete mode 100644 0001-daemon-btrfs-Upstream-btrfs-device-add-command-now-n.patch diff --git a/0001-daemon-btrfs-Upstream-btrfs-device-add-command-now-n.patch b/0001-daemon-btrfs-Upstream-btrfs-device-add-command-now-n.patch deleted file mode 100644 index d63d548..0000000 --- a/0001-daemon-btrfs-Upstream-btrfs-device-add-command-now-n.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 59596810b009744316941da8ef18b7e75b503b9f Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 15 Nov 2013 09:05:43 +0000 -Subject: [PATCH] daemon: btrfs: Upstream 'btrfs device add' command now needs - '--force' option to work. - -However earlier versions didn't have the --force option, so we -have to detect it. ---- - daemon/btrfs.c | 35 +++++++++++++++++++++++++++++++---- - 1 file changed, 31 insertions(+), 4 deletions(-) - -diff --git a/daemon/btrfs.c b/daemon/btrfs.c -index 765dec6..0b877f8 100644 ---- a/daemon/btrfs.c -+++ b/daemon/btrfs.c -@@ -588,14 +588,29 @@ do_btrfs_filesystem_balance (const char *fs) - return 0; - } - -+/* Test if 'btrfs device add' needs the --force option (added -+ * c.2013-09) in order to work. -+ */ -+static int -+test_btrfs_device_add_needs_force (void) -+{ -+ int r; -+ CLEANUP_FREE char *out = NULL, *err = NULL; -+ -+ r = command (&out, &err, "btrfs", "device", "add", "--help", NULL); -+ if (r == -1) { -+ reply_with_error ("%s: %s", "btrfs device add --help", err); -+ return -1; -+ } -+ -+ return strstr (out, "--force") != NULL; -+} -+ - int - do_btrfs_device_add (char *const *devices, const char *fs) - { -+ static int btrfs_device_add_needs_force = -1; - size_t nr_devices = count_strings (devices); -- -- if (nr_devices == 0) -- return 0; -- - size_t MAX_ARGS = nr_devices + 8; - const char *argv[MAX_ARGS]; - size_t i = 0, j; -@@ -603,6 +618,15 @@ do_btrfs_device_add (char *const *devices, const char *fs) - CLEANUP_FREE char *err = NULL; - int r; - -+ if (nr_devices == 0) -+ return 0; -+ -+ if (btrfs_device_add_needs_force == -1) { -+ btrfs_device_add_needs_force = test_btrfs_device_add_needs_force (); -+ if (btrfs_device_add_needs_force == -1) -+ return -1; -+ } -+ - fs_buf = sysroot_path (fs); - if (fs_buf == NULL) { - reply_with_perror ("malloc"); -@@ -613,6 +637,9 @@ do_btrfs_device_add (char *const *devices, const char *fs) - ADD_ARG (argv, i, "device"); - ADD_ARG (argv, i, "add"); - -+ if (btrfs_device_add_needs_force) -+ ADD_ARG (argv, i, "--force"); -+ - for (j = 0; j < nr_devices; ++j) - ADD_ARG (argv, i, devices[j]); - --- -1.8.3.1 - diff --git a/libguestfs.spec b/libguestfs.spec index 43ce1f3..64e7db2 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -19,9 +19,6 @@ License: LGPLv2+ URL: http://libguestfs.org/ Source0: http://libguestfs.org/download/1.25-development/%{name}-%{version}.tar.gz -# Upstream patch to fix btrfs tests. -Patch1: 0001-daemon-btrfs-Upstream-btrfs-device-add-command-now-n.patch - # Basic build requirements: BuildRequires: perl(Pod::Simple) BuildRequires: perl(Pod::Man) @@ -570,8 +567,6 @@ for %{name}. %prep %setup -q -%patch1 -p1 - if [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then # For sVirt to work, the local temporary directory we use in the # tests must be labelled the same way as /tmp.