Rebase to virt-v2v 2.7.17

related: RHEL-81735
virt-v2v fails to convert XFS guest with dirty filesystem
resolves: RHEL-95365
This commit is contained in:
Richard W.M. Jones 2025-06-05 15:55:15 +01:00
parent c2d8e8a08a
commit 18d87c62d1
17 changed files with 91 additions and 3529 deletions

View File

@ -0,0 +1,53 @@
From 2e7c03b967e2c5bbe01a0c9cc255238d19c46540 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 5 Jun 2025 15:32:35 +0100
Subject: [PATCH] convert: Replay dirty log for XFS filesystems before running
xfs_repair
Reported-by: Vera Wu
Thanks: Eric Sandeen, Ming Xie
Fixes: https://issues.redhat.com/browse/RHEL-95365
Fixes: commit 78ffb68d4f1ef8af776c24537feaf832fd3ec7e9
---
convert/convert.ml | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/convert/convert.ml b/convert/convert.ml
index a6e0d532..ad0b82b1 100644
--- a/convert/convert.ml
+++ b/convert/convert.ml
@@ -83,7 +83,7 @@ let rec convert input_disks options source =
(* Check (fsck) the filesystems before conversion. *)
message (f_"Checking filesystem integrity before conversion");
- do_fsck g;
+ do_fsck ~before:true g;
(* Detect firmware. *)
message (f_"Detecting if this guest uses BIOS or UEFI to boot");
@@ -237,7 +237,7 @@ and do_fstrim g inspect =
* If fsck returns an error then the conversion will fail. We do not
* attempt to do any repairs.
*)
-and do_fsck g =
+and do_fsck ?(before=false) g =
let fses = g#list_filesystems () in
List.iter (function
| dev, _ when String.starts_with "btrfsvol:" dev ->
@@ -261,6 +261,16 @@ and do_fsck g =
g#e2fsck ~forceno:true dev
| dev, "xfs" ->
+ if before then (
+ (* xfs_repair cannot replay the dirty log, only the kernel can,
+ * so we must first mount then unmount the filesystem, and then
+ * we can run xfs_repair. Unlike what is documented, xfs_repair
+ * doesn't return 2 in this case. Mount r/o is fine as that
+ * will still replay the log (RHEL-95365)
+ *)
+ Fun.protect ~finally:g#umount_all (fun () -> g#mount_ro dev "/");
+ );
+
if g#xfs_repair ~nomodify:true dev <> 0 then
error (f_"detected errors on the XFS filesystem on %s") dev

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 06a2e0eee5a970ab5bc7aa3595d21fff3ca5a8cb Mon Sep 17 00:00:00 2001
From 93c1b119526fffc5d31acc1bcb96223b0a9f0ac9 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 30 Aug 2015 03:21:57 -0400
Subject: [PATCH] RHEL: Fixes for libguestfs-winsupport.
@ -19,7 +19,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=2187961#c1
7 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/convert/convert.ml b/convert/convert.ml
index a6e0d532..cf2b09cd 100644
index ad0b82b1..6e14524f 100644
--- a/convert/convert.ml
+++ b/convert/convert.ml
@@ -53,6 +53,7 @@ let rec convert input_disks options source =
@ -136,7 +136,7 @@ index bfe04904..eeddcb86 100755
# We also update the Registry several times, for firstboot, and (ONLY
diff --git a/tests/test-windows-phony.sh b/tests/test-windows-phony.sh
index 4e931731..007e6dc9 100755
index fa5f6a17..3f5dfe5e 100755
--- a/tests/test-windows-phony.sh
+++ b/tests/test-windows-phony.sh
@@ -71,6 +71,17 @@ mktest ()
@ -157,10 +157,12 @@ index 4e931731..007e6dc9 100755
firstboot_dir="/Program Files/Guestfs/Firstboot"
mktest "is-dir \"$firstboot_dir\"" true
mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
@@ -80,5 +91,5 @@ mktest "ls \"$virtio_dir\"" "$(cat test-phony-$guestname-ls.txt)"
@@ -80,7 +91,7 @@ mktest "ls \"$virtio_dir\"" "$(cat test-phony-$guestname-ls.txt)"
osinfo_name="${guestname%-32}"
mktest "inspect-get-osinfo /dev/sda2" "$osinfo_name"
-guestfish --ro -a "$d/$guestname-sda" -i < "$script" > "$response"
+guestfish --ro -a "$d/$guestname-sda" < "$script" > "$response"
diff -u "$expected" "$response"
# host osinfo-db may be too old for win2k25

View File

@ -1,60 +0,0 @@
From db1908226ce901b73953732edcba8a20087422c4 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 20 May 2025 08:23:39 +0100
Subject: [PATCH] convert: Use e2fsck -n flag when checking ext2/3/4
filesystems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When checking the fedora-30 image from virt-builder:
$ virt-v2v -i disk fedora-30.img -o null
...
[ 68.4] Checking filesystem integrity before conversion
virt-v2v: error: libguestfs error: e2fsck: e2fsck 1.47.1 (20-May-2024)
e2fsck: need terminal for interactive repairs
Use the e2fsck -n flag to avoid this problem.
This flag is described as:
-n Open the file system read-only, and assume an answer of `no' to
all questions. Allows e2fsck to be used non-interactively. This
option may not be specified at the same time as the -p or -y op
tions.
Updates: commit 78ffb68d4f1ef8af776c24537feaf832fd3ec7e9
Updates: https://issues.redhat.com/browse/RHEL-91931
---
convert/convert.ml | 2 +-
m4/guestfs-libraries.m4 | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/convert/convert.ml b/convert/convert.ml
index 0ed7a884..a6e0d532 100644
--- a/convert/convert.ml
+++ b/convert/convert.ml
@@ -258,7 +258,7 @@ and do_fsck g =
);
| dev, "ext4" ->
- g#e2fsck dev (* ~correct:false is the default *)
+ g#e2fsck ~forceno:true dev
| dev, "xfs" ->
if g#xfs_repair ~nomodify:true dev <> 0 then
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
index 4f5b745a..fa13e0f6 100644
--- a/m4/guestfs-libraries.m4
+++ b/m4/guestfs-libraries.m4
@@ -21,7 +21,8 @@ dnl Of course we need libguestfs.
dnl
dnl We need libguestfs 1.55.6 for guestfs_sh_out.
dnl We need libguestfs 1.55.12 for guestfs_btrfs_scrub_full.
-PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.55.12])
+dnl We need libguestfs 1.55.13 for guestfs_e2fsck FORCENO flag.
+PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.55.13])
printf "libguestfs version is "; $PKG_CONFIG --modversion libguestfs
dnl And libnbd.

View File

@ -1,4 +1,4 @@
From 4382b17eca2a79bfef6d946c0309ea2634e832c0 Mon Sep 17 00:00:00 2001
From b0dbc17126e5851c8d96ba01d8827ef9764cb919 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 28 Sep 2014 19:14:43 +0100
Subject: [PATCH] RHEL: v2v: Select correct qemu binary for -o qemu mode

View File

@ -1,4 +1,4 @@
From bb7343b579d5979f3c06c67ebbc741fd5783b2eb Mon Sep 17 00:00:00 2001
From 902f3a34c30c3b04e0a25baf17a303eb7679acb1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 30 Sep 2014 10:50:27 +0100
Subject: [PATCH] RHEL: v2v: Disable the --qemu-boot / -oo qemu-boot option

View File

@ -1,4 +1,4 @@
From bb0cfcc4d20f05ac66d58f665c9211ebff408859 Mon Sep 17 00:00:00 2001
From 2bfee23bfabfc5b4a61e4886acf8de23844eb94c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 24 Apr 2015 09:45:41 -0400
Subject: [PATCH] RHEL: Fix list of supported sound cards to match RHEL qemu

View File

@ -1,4 +1,4 @@
From 4a97d6141b9cbd8057632fb6dee6ade419e54d62 Mon Sep 17 00:00:00 2001
From bbf6820152876487310a3945935c10fc28465668 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 2 Mar 2017 14:21:37 +0100
Subject: [PATCH] RHEL: v2v: -i disk: force VNC as display (RHBZ#1372671)

View File

@ -1,4 +1,4 @@
From 5444014742fe120079b1b3e680c82bff47e7fc6d Mon Sep 17 00:00:00 2001
From d663ded91ff04fea676f5f8df91e33c252f3c3e4 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 26 Mar 2019 09:42:25 +0100
Subject: [PATCH] RHEL: point to KB for supported v2v hypervisors/guests

View File

@ -1,4 +1,4 @@
From c993b68877a7749cf725d135c20093f42a20ed26 Mon Sep 17 00:00:00 2001
From f122df7aa9ece794c218fdb1c067f615574862d2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 8 Jul 2024 09:35:54 +0100
Subject: [PATCH] RHEL: Remove input from Xen

View File

@ -1,4 +1,4 @@
From e1caa762c70b5e904a34d89ea8face5007a24258 Mon Sep 17 00:00:00 2001
From 6d16a6c76a5d1ae2a6e259b969a1de3fa4e42173 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 30 Jun 2021 11:15:52 +0100
Subject: [PATCH] RHEL: Remove -o glance

View File

@ -1,4 +1,4 @@
From f69c4c9cbb617ce49fcd04307b4aca19d1c65d30 Mon Sep 17 00:00:00 2001
From b192b37492e6db2b35dd1e78700dcecdd2d46d33 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 5 Jul 2022 11:58:09 +0100
Subject: [PATCH] RHEL: tests: Remove btrfs test

View File

@ -1,4 +1,4 @@
From 2ec1b0dc2d1902a99b6ce3a79c9e0c58f43a83b4 Mon Sep 17 00:00:00 2001
From 8eded5d846ad265b2c73e986b38e6d572544101c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 28 Apr 2023 12:28:19 +0100
Subject: [PATCH] RHEL: Remove --block-driver option

View File

@ -1,4 +1,4 @@
From 4c8b8d6f6bb68a82a49a0ecf87b6365d11ac02e4 Mon Sep 17 00:00:00 2001
From 71196cb1c4180e5a107da9d3f1aeba27e637e703 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 8 Jul 2024 09:56:54 +0100
Subject: [PATCH] RHEL: Remove -o ovirt, -o ovirt-upload and -o vdsm modes

View File

@ -1,4 +1,4 @@
From a70126f1e0fb793086ad86dc3b0d89b9bc09b19c Mon Sep 17 00:00:00 2001
From 7070cae9b9c239786c2cbaa61e8a091b5dd77ba2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 9 Jul 2024 11:30:09 +0100
Subject: [PATCH] RHEL: Add warning about virt-v2v-in-place not being supported

View File

@ -1,2 +1,2 @@
SHA512 (virt-v2v-2.7.16.tar.gz) = 321512ab4773616d0ff8ad21268617e20097a8f6b44850497fce2d5830727c49aca82b0142eca775447522b1d29edef82afd062cf01c2c84388b0193a73902f8
SHA512 (virt-v2v-2.7.16.tar.gz.sig) = da589c28af55801305a9fbe2463907a91ec7cf75ba438096ab844065cb7b0ad44208541260047bcd6bdd938230689bc4c685f4ca6cb95fc095eaa660213d9687
SHA512 (virt-v2v-2.7.17.tar.gz) = 72b476ca6f0198ddd1ac9f52b834bc6720374b86d52014a3707ba42a0bfdb2098a8a8f76bae6b01c222c1d83c60909e472fc4ad000e057faad337fce49299a15
SHA512 (virt-v2v-2.7.17.tar.gz.sig) = a196e3e2100777a714c11e9adb7f8bf49bb626b57ec5ec7db9bf459a2942d3523fd4801aacffc0354357b5054fd69e1dfc222c7a254ff6b53f55d8832dea8295

View File

@ -6,8 +6,8 @@
Name: virt-v2v
Epoch: 1
Version: 2.7.16
Release: 2%{?dist}
Version: 2.7.17
Release: 1%{?dist}
Summary: Convert a virtual machine to run on KVM
License: GPL-2.0-or-later AND LGPL-2.0-or-later
@ -27,20 +27,19 @@ Source3: copy-patches.sh
# https://github.com/libguestfs/virt-v2v/commits/rhel-10.1
# Patches.
Patch0001: 0001-m4-Add-junk-required-to-make-AM_GNU_GETTEXT-work.patch
Patch0002: 0002-convert-Use-e2fsck-n-flag-when-checking-ext2-3-4-fil.patch
Patch0003: 0003-RHEL-Fixes-for-libguestfs-winsupport.patch
Patch0004: 0004-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch
Patch0005: 0005-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch
Patch0006: 0006-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch
Patch0007: 0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
Patch0008: 0008-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
Patch0009: 0009-RHEL-Remove-input-from-Xen.patch
Patch0010: 0010-RHEL-Remove-o-glance.patch
Patch0011: 0011-RHEL-tests-Remove-btrfs-test.patch
Patch0012: 0012-RHEL-Remove-block-driver-option.patch
Patch0013: 0013-RHEL-Remove-o-ovirt-o-ovirt-upload-and-o-vdsm-modes.patch
Patch0014: 0014-RHEL-Add-warning-about-virt-v2v-in-place-not-being-s.patch
Patch0001: 0001-convert-Replay-dirty-log-for-XFS-filesystems-before-.patch
Patch0002: 0002-RHEL-Fixes-for-libguestfs-winsupport.patch
Patch0003: 0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch
Patch0004: 0004-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch
Patch0005: 0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch
Patch0006: 0006-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
Patch0007: 0007-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
Patch0008: 0008-RHEL-Remove-input-from-Xen.patch
Patch0009: 0009-RHEL-Remove-o-glance.patch
Patch0010: 0010-RHEL-tests-Remove-btrfs-test.patch
Patch0011: 0011-RHEL-Remove-block-driver-option.patch
Patch0012: 0012-RHEL-Remove-o-ovirt-o-ovirt-upload-and-o-vdsm-modes.patch
Patch0013: 0013-RHEL-Add-warning-about-virt-v2v-in-place-not-being-s.patch
%if !0%{?rhel}
# libguestfs hasn't been built on i686 for a while since there is no
@ -331,8 +330,8 @@ done
%changelog
* Tue May 20 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.16-2
- Rebase to virt-v2v 2.7.16
* Thu Jun 05 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.17-1
- Rebase to virt-v2v 2.7.17
related: RHEL-81735
- Fix virt-v2v -v --install dnf5 error
resolves: RHEL-83288
@ -356,6 +355,8 @@ done
resolves: RHEL-89993
- Run filesystem check before and after conversion
resolves: RHEL-91931
- virt-v2v fails to convert XFS guest with dirty filesystem
resolves: RHEL-95365
* Tue Feb 11 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.1-4
- Rebase to virt-v2v 2.7.1