From 5d2b6dccb14fdcc99c9661b0163937b3026161b5 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 6 May 2025 16:22:44 +0300 Subject: [PATCH 1/2] Import OL --- ...trim.c-Issue-sync_disks-after-fstrim.patch | 29 ++++++++++++++ ...strim.c-Run-the-fstrim-command-twice.patch | 40 +++++++++++++++++++ .../1000-Add-Oracle-Linux-identifier.patch | 39 ++++++++++++++++++ SOURCES/copy-patches.sh | 0 SPECS/libguestfs.spec | 21 ++++++++-- 5 files changed, 125 insertions(+), 4 deletions(-) create mode 100644 SOURCES/0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch create mode 100644 SOURCES/0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch create mode 100644 SOURCES/1000-Add-Oracle-Linux-identifier.patch mode change 100755 => 100644 SOURCES/copy-patches.sh diff --git a/SOURCES/0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch b/SOURCES/0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch new file mode 100644 index 0000000..474410c --- /dev/null +++ b/SOURCES/0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch @@ -0,0 +1,29 @@ +From 0349d30afcf1d345c1b4f9090447a561c944c8e5 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 25 Apr 2025 15:24:43 +0100 +Subject: [PATCH] daemon/fstrim.c: Issue sync_disks after fstrim + +Thanks: Eric Sandeen +(cherry picked from commit e127edcafc95c75bf484bf2199eb746a392c58c0) +--- + daemon/fstrim.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/daemon/fstrim.c b/daemon/fstrim.c +index f6869042..3928f8bb 100644 +--- a/daemon/fstrim.c ++++ b/daemon/fstrim.c +@@ -116,5 +116,13 @@ do_fstrim (const char *path, + if (verbose) + fprintf (stderr, "%s\n", out); + ++ /* Sync the disks again. In practice we always call fstrim ++ * expecting that afterwards the results are visible in the qemu ++ * devices backing the guest. Depending on the Linux filesystem, ++ * fstrim may issue asynch discard requests, so it's not necessarily ++ * true that everything has been written out before this point. ++ */ ++ sync_disks (); ++ + return 0; + } diff --git a/SOURCES/0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch b/SOURCES/0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch new file mode 100644 index 0000000..c3013ca --- /dev/null +++ b/SOURCES/0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch @@ -0,0 +1,40 @@ +From 4c7c0bca7a433ad03cdbc9128f53a1904758f8fb Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 25 Apr 2025 15:14:24 +0100 +Subject: [PATCH] daemon/fstrim.c: Run the fstrim command twice + +In upstream kernels, for XFS, you may have to run fstrim twice for it +to be effective. + +Fixes: https://issues.redhat.com/browse/RHEL-88508 +Related: https://issues.redhat.com/browse/RHEL-88450 +Thanks: Eric Sandeen +(cherry picked from commit ca87485eea79d2c8943458f8f4ff12e72ce2eb0b) +--- + daemon/fstrim.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/daemon/fstrim.c b/daemon/fstrim.c +index 3928f8bb..474ef72d 100644 +--- a/daemon/fstrim.c ++++ b/daemon/fstrim.c +@@ -101,8 +101,19 @@ do_fstrim (const char *path, + ADD_ARG (argv, i, buf); + ADD_ARG (argv, i, NULL); + ++ /* Run the command twice to workaround ++ * https://issues.redhat.com/browse/RHEL-88450 ++ */ ++ r = commandv (&out, &err, argv); ++ if (r == -1) goto error; ++ if (verbose) ++ fprintf (stderr, "%s\n", out); ++ free (out); out = NULL; ++ free (err); err = NULL; ++ + r = commandv (&out, &err, argv); + if (r == -1) { ++ error: + /* If the error is about the kernel operation not being supported + * for this filesystem type, then return errno ENOTSUP here. + */ diff --git a/SOURCES/1000-Add-Oracle-Linux-identifier.patch b/SOURCES/1000-Add-Oracle-Linux-identifier.patch new file mode 100644 index 0000000..2780691 --- /dev/null +++ b/SOURCES/1000-Add-Oracle-Linux-identifier.patch @@ -0,0 +1,39 @@ +From 39e25217dccb4b49f2ab481f0b026f1498973647 Mon Sep 17 00:00:00 2001 +From: Darren Archibald +Date: Mon, 3 Oct 2022 09:55:14 -0700 +Subject: [PATCH] Add Oracle Linux identifier + +Signed-off-by: Darren Archibald +--- + daemon/inspect_fs_unix.ml | 1 + + m4/guestfs-appliance.m4 | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml +index d8dce60..ee89ff0 100644 +--- a/daemon/inspect_fs_unix.ml ++++ b/daemon/inspect_fs_unix.ml +@@ -159,6 +159,7 @@ and distro_of_os_release_id = function + | "pardus" -> Some DISTRO_PARDUS + | "pld" -> Some DISTRO_PLD_LINUX + | "rhel" -> Some DISTRO_RHEL ++ | "ol" -> Some DISTRO_ORACLE_LINUX + | "rocky" -> Some DISTRO_ROCKY + | "sles" | "sled" -> Some DISTRO_SLES + | "ubuntu" -> Some DISTRO_UBUNTU +diff --git a/m4/guestfs-appliance.m4 b/m4/guestfs-appliance.m4 +index 4e671d2..dc06d1a 100644 +--- a/m4/guestfs-appliance.m4 ++++ b/m4/guestfs-appliance.m4 +@@ -114,7 +114,7 @@ if test "x$ENABLE_APPLIANCE" = "xyes"; then + fi ) | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@' + )" + AS_CASE([$DISTRO], +- [FEDORA | RHEL | CENTOS | ALMALINUX | CLOUDLINUX \ ++ [FEDORA | RHEL | OL | CENTOS | ALMALINUX | CLOUDLINUX \ + | ROCKY | VIRTUOZZO], + [DISTRO=REDHAT], + [OPENSUSE* | SLED | SLES],[DISTRO=SUSE], +-- +2.39.3 + diff --git a/SOURCES/copy-patches.sh b/SOURCES/copy-patches.sh old mode 100755 new mode 100644 diff --git a/SPECS/libguestfs.spec b/SPECS/libguestfs.spec index 95936a9..dbc943d 100644 --- a/SPECS/libguestfs.spec +++ b/SPECS/libguestfs.spec @@ -45,7 +45,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.50.2 -Release: 3%{?dist} +Release: 4.0.1%{?dist} License: LGPLv2+ # Build only for architectures that have a kernel @@ -139,6 +139,10 @@ Patch0045: 0045-generator-Fix-implementation-of-FUUID-for-OCaml-func.patch Patch0046: 0046-Update-common-submodule.patch Patch0047: 0047-daemon-Rewrite-pvs-vgs-lvs-full-APIs-in-OCaml.patch Patch0048: 0048-daemon-inspect-Resolve-Ubuntu-22-dev-disk-by-id-dm-u.patch +Patch0049: 0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch +Patch0050: 0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch + +Patch1000: 1000-Add-Oracle-Linux-identifier.patch %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel @@ -254,9 +258,7 @@ BuildRequires: attr BuildRequires: augeas-libs BuildRequires: bash BuildRequires: binutils -%if !0%{?rhel} BuildRequires: btrfs-progs -%endif BuildRequires: bzip2 BuildRequires: clevis-luks BuildRequires: coreutils @@ -587,7 +589,7 @@ guests. Install this package if you want libguestfs to be able to inspect non-Linux guests and display icons from them. The only reason this is a separate package is to avoid core libguestfs -having to depend on Perl. See https://bugzilla.redhat.com/1194158 +having to depend on Perl. %package bash-completion @@ -806,6 +808,7 @@ fi %endif --without-java \ --disable-erlang \ + --with-extra-packages="btrfs-progs" \ $extra # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the @@ -1155,6 +1158,16 @@ rm ocaml/html/.gitignore %changelog +* Sun May 04 2025 EL Errata - 1.50.2-4.0.1 +- Add btrfs-progs to the packages installed in the appliance [Orabug: 34137448] +- Replace upstream references from a description tag +- Fix build on Oracle Linux [Orabug: 29319324] +- Set DISTRO_ORACLE_LINUX correspeonding to ol + +* Wed Apr 30 2025 Richard W.M. Jones - 1:1.50.2-4 +- Run the fstrim command twice to workaround RHEL 9.5 kernel trimming bug + resolves: RHEL-89045 + * Tue Apr 29 2025 Richard W.M. Jones - 1:1.50.2-3 - Fix virt-v2v conversion of split /usr Ubuntu 22+ resolves: RHEL-88803 From 48070c5d69e1d58b24662f702767d45c33f10ebb Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 6 May 2025 16:35:18 +0300 Subject: [PATCH 2/2] Revert OL changes --- .../1000-Add-Oracle-Linux-identifier.patch | 39 ------------------- SOURCES/copy-patches.sh | 0 SPECS/libguestfs.spec | 15 ++----- 3 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 SOURCES/1000-Add-Oracle-Linux-identifier.patch mode change 100644 => 100755 SOURCES/copy-patches.sh diff --git a/SOURCES/1000-Add-Oracle-Linux-identifier.patch b/SOURCES/1000-Add-Oracle-Linux-identifier.patch deleted file mode 100644 index 2780691..0000000 --- a/SOURCES/1000-Add-Oracle-Linux-identifier.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 39e25217dccb4b49f2ab481f0b026f1498973647 Mon Sep 17 00:00:00 2001 -From: Darren Archibald -Date: Mon, 3 Oct 2022 09:55:14 -0700 -Subject: [PATCH] Add Oracle Linux identifier - -Signed-off-by: Darren Archibald ---- - daemon/inspect_fs_unix.ml | 1 + - m4/guestfs-appliance.m4 | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml -index d8dce60..ee89ff0 100644 ---- a/daemon/inspect_fs_unix.ml -+++ b/daemon/inspect_fs_unix.ml -@@ -159,6 +159,7 @@ and distro_of_os_release_id = function - | "pardus" -> Some DISTRO_PARDUS - | "pld" -> Some DISTRO_PLD_LINUX - | "rhel" -> Some DISTRO_RHEL -+ | "ol" -> Some DISTRO_ORACLE_LINUX - | "rocky" -> Some DISTRO_ROCKY - | "sles" | "sled" -> Some DISTRO_SLES - | "ubuntu" -> Some DISTRO_UBUNTU -diff --git a/m4/guestfs-appliance.m4 b/m4/guestfs-appliance.m4 -index 4e671d2..dc06d1a 100644 ---- a/m4/guestfs-appliance.m4 -+++ b/m4/guestfs-appliance.m4 -@@ -114,7 +114,7 @@ if test "x$ENABLE_APPLIANCE" = "xyes"; then - fi ) | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@' - )" - AS_CASE([$DISTRO], -- [FEDORA | RHEL | CENTOS | ALMALINUX | CLOUDLINUX \ -+ [FEDORA | RHEL | OL | CENTOS | ALMALINUX | CLOUDLINUX \ - | ROCKY | VIRTUOZZO], - [DISTRO=REDHAT], - [OPENSUSE* | SLED | SLES],[DISTRO=SUSE], --- -2.39.3 - diff --git a/SOURCES/copy-patches.sh b/SOURCES/copy-patches.sh old mode 100644 new mode 100755 diff --git a/SPECS/libguestfs.spec b/SPECS/libguestfs.spec index dbc943d..80ca092 100644 --- a/SPECS/libguestfs.spec +++ b/SPECS/libguestfs.spec @@ -45,7 +45,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.50.2 -Release: 4.0.1%{?dist} +Release: 4%{?dist} License: LGPLv2+ # Build only for architectures that have a kernel @@ -142,8 +142,6 @@ Patch0048: 0048-daemon-inspect-Resolve-Ubuntu-22-dev-disk-by-id-dm-u.patch Patch0049: 0049-daemon-fstrim.c-Issue-sync_disks-after-fstrim.patch Patch0050: 0050-daemon-fstrim.c-Run-the-fstrim-command-twice.patch -Patch1000: 1000-Add-Oracle-Linux-identifier.patch - %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel %endif @@ -258,7 +256,9 @@ BuildRequires: attr BuildRequires: augeas-libs BuildRequires: bash BuildRequires: binutils +%if !0%{?rhel} BuildRequires: btrfs-progs +%endif BuildRequires: bzip2 BuildRequires: clevis-luks BuildRequires: coreutils @@ -589,7 +589,7 @@ guests. Install this package if you want libguestfs to be able to inspect non-Linux guests and display icons from them. The only reason this is a separate package is to avoid core libguestfs -having to depend on Perl. +having to depend on Perl. See https://bugzilla.redhat.com/1194158 %package bash-completion @@ -808,7 +808,6 @@ fi %endif --without-java \ --disable-erlang \ - --with-extra-packages="btrfs-progs" \ $extra # 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the @@ -1158,12 +1157,6 @@ rm ocaml/html/.gitignore %changelog -* Sun May 04 2025 EL Errata - 1.50.2-4.0.1 -- Add btrfs-progs to the packages installed in the appliance [Orabug: 34137448] -- Replace upstream references from a description tag -- Fix build on Oracle Linux [Orabug: 29319324] -- Set DISTRO_ORACLE_LINUX correspeonding to ol - * Wed Apr 30 2025 Richard W.M. Jones - 1:1.50.2-4 - Run the fstrim command twice to workaround RHEL 9.5 kernel trimming bug resolves: RHEL-89045