From 7ea970047b634645ff63fd4158ef20abfd01fb4d93f08bf62fb62064d961b2bd Mon Sep 17 00:00:00 2001 From: Larry Dewey Date: Tue, 21 Jan 2020 19:38:19 +0000 Subject: [PATCH] Accepting request 766144 from home:ldewey:branches:Virtualization Removing previous commit. OBS-URL: https://build.opensuse.org/request/show/766144 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=449 --- ...44-sparsify-ignore-read-only-devices.patch | 44 ------------ ...-readonly-btrfs-snapshots-RHBZ-10796.patch | 68 ------------------- libguestfs.spec | 4 -- 3 files changed, 116 deletions(-) delete mode 100644 4bb3c44-sparsify-ignore-read-only-devices.patch delete mode 100644 864c2ee-sparsify-ignore-readonly-btrfs-snapshots-RHBZ-10796.patch diff --git a/4bb3c44-sparsify-ignore-read-only-devices.patch b/4bb3c44-sparsify-ignore-read-only-devices.patch deleted file mode 100644 index fa409c2..0000000 --- a/4bb3c44-sparsify-ignore-read-only-devices.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4bb3c44a286beb0dd8cdf337d64d8ce71e361dd6 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Mon, 2 Feb 2015 15:02:31 +0100 -Subject: [PATCH] sparsify: ignore read-only devices - -In copy mode, make sure to not zero-free-space devices mounted as -read-only, as we cannot write to them. - -Related to RHBZ#1079625. ---- - sparsify/copying.ml | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/sparsify/copying.ml b/sparsify/copying.ml -index 43f108bdc..9f788b94c 100644 ---- a/sparsify/copying.ml -+++ b/sparsify/copying.ml -@@ -235,6 +235,13 @@ You can ignore this warning or change it to a hard failure using the - with Not_found -> false - in - -+ let is_readonly_device mp = -+ let statvfs = g#statvfs mp in -+ let flags = statvfs.G.flag in -+ (* 0x01 is ST_RDONLY in Linux' GNU libc. *) -+ flags <> -1_L && (flags &^ 0x1_L) <> 0_L -+ in -+ - List.iter ( - fun fs -> - if not (is_ignored fs) && not (is_read_only_lv fs) then ( -@@ -252,6 +259,9 @@ You can ignore this warning or change it to a hard failure using the - if is_readonly_btrfs_snapshot fs "/" then ( - if not quiet then - printf (f_"Skipping %s, as it is a read-only btrfs snapshot.\n%!") fs; -+ ) else if is_readonly_device "/" then ( -+ if not quiet then -+ printf (f_"Skipping %s, as it is a read-only device.\n%!") fs; - ) else ( - if not quiet then - printf (f_"Fill free space in %s with zero ...\n%!") fs; --- -2.24.1 - diff --git a/864c2ee-sparsify-ignore-readonly-btrfs-snapshots-RHBZ-10796.patch b/864c2ee-sparsify-ignore-readonly-btrfs-snapshots-RHBZ-10796.patch deleted file mode 100644 index a9d0c1f..0000000 --- a/864c2ee-sparsify-ignore-readonly-btrfs-snapshots-RHBZ-10796.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 864c2ee371f65388b18e737136663986cfc9eb08 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Mon, 2 Feb 2015 14:50:52 +0100 -Subject: [PATCH] sparsify: ignore read-only btrfs snapshots (RHBZ#1079625) - -In copy mode, make sure to not zero-free-space read-only btrfs -snapshots, as we cannot write to them. ---- - sparsify/copying.ml | 28 +++++++++++++++++++++++++--- - 1 file changed, 25 insertions(+), 3 deletions(-) - -diff --git a/sparsify/copying.ml b/sparsify/copying.ml -index 165dd6e93..43f108bdc 100644 ---- a/sparsify/copying.ml -+++ b/sparsify/copying.ml -@@ -208,6 +208,11 @@ You can ignore this warning or change it to a hard failure using the - * and selected swap partitions. - *) - let filesystems = g#list_filesystems () in -+ let btrfs_filesystems = List.filter ( -+ fun (fs, fstype) -> -+ fstype = "btrfs" -+ ) filesystems in -+ let btrfs_filesystems = List.map fst btrfs_filesystems in - let filesystems = List.map fst filesystems in - let filesystems = List.sort compare filesystems in - -@@ -218,6 +223,18 @@ You can ignore this warning or change it to a hard failure using the - - let is_read_only_lv = is_read_only_lv g in - -+ let is_readonly_btrfs_snapshot fs mp = -+ try -+ let is_btrfs = List.mem fs btrfs_filesystems in -+ if is_btrfs then ( -+ try -+ let vol_info = g#btrfs_subvolume_show mp in -+ string_find (List.assoc "Flags" vol_info) "readonly" <> -1 -+ with G.Error _ -> false -+ ) else false -+ with Not_found -> false -+ in -+ - List.iter ( - fun fs -> - if not (is_ignored fs) && not (is_read_only_lv fs) then ( -@@ -232,10 +249,15 @@ You can ignore this warning or change it to a hard failure using the - with _ -> false in - - if mounted then ( -- if not quiet then -- printf (f_"Fill free space in %s with zero ...\n%!") fs; -+ if is_readonly_btrfs_snapshot fs "/" then ( -+ if not quiet then -+ printf (f_"Skipping %s, as it is a read-only btrfs snapshot.\n%!") fs; -+ ) else ( -+ if not quiet then -+ printf (f_"Fill free space in %s with zero ...\n%!") fs; - -- g#zero_free_space "/" -+ g#zero_free_space "/" -+ ) - ) else ( - let is_linux_x86_swap = - (* Look for the signature for Linux swap on i386. --- -2.24.1 - diff --git a/libguestfs.spec b/libguestfs.spec index f64f32e..1693294 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -147,8 +147,6 @@ Patch1: 0a55098f-builder-repository-fix-compute_short_id-for-sles-X.0.pa Patch2: fd43730e-error-with-uninstall-option-on-SUSE.patch Patch3: 70407cd622-inspection-Parse-os-release-opensuse-leap-as-opensus.patch Patch4: 28bd06227b-inspect-handle-os-release-opensuse-tumbleweed-as-ope.patch -Patch5: 864c2ee-sparsify-ignore-readonly-btrfs-snapshots-RHBZ-10796.patch -Patch6: 4bb3c44-sparsify-ignore-read-only-devices.patch # Pending upstram review Patch50: 0001-Introduce-a-wrapper-around-xmlParseURI.patch @@ -569,8 +567,6 @@ It can import a variety of guest operating systems from libvirt-managed hosts. %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 %patch50 -p1 %patch51 -p1 %patch52 -p1