Run filesystem check before and after conversion

Further fix required for ext2/3/4 guests

related: RHEL-91931
This commit is contained in:
Richard W.M. Jones 2025-05-20 14:49:51 +01:00
parent 56e69c32f4
commit c2d8e8a08a
15 changed files with 3525 additions and 29 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
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 0d45fc75dd8150fcb51db6bf847afebfdfd332d4 Mon Sep 17 00:00:00 2001 From 06a2e0eee5a970ab5bc7aa3595d21fff3ca5a8cb Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 30 Aug 2015 03:21:57 -0400 Date: Sun, 30 Aug 2015 03:21:57 -0400
Subject: [PATCH] RHEL: Fixes for libguestfs-winsupport. 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(-) 7 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/convert/convert.ml b/convert/convert.ml diff --git a/convert/convert.ml b/convert/convert.ml
index 0ed7a884..cd7e9ce3 100644 index a6e0d532..cf2b09cd 100644
--- a/convert/convert.ml --- a/convert/convert.ml
+++ b/convert/convert.ml +++ b/convert/convert.ml
@@ -53,6 +53,7 @@ let rec convert input_disks options source = @@ -53,6 +53,7 @@ let rec convert input_disks options source =

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
Name: virt-v2v Name: virt-v2v
Epoch: 1 Epoch: 1
Version: 2.7.16 Version: 2.7.16
Release: 1%{?dist} Release: 2%{?dist}
Summary: Convert a virtual machine to run on KVM Summary: Convert a virtual machine to run on KVM
License: GPL-2.0-or-later AND LGPL-2.0-or-later License: GPL-2.0-or-later AND LGPL-2.0-or-later
@ -27,18 +27,20 @@ Source3: copy-patches.sh
# https://github.com/libguestfs/virt-v2v/commits/rhel-10.1 # https://github.com/libguestfs/virt-v2v/commits/rhel-10.1
# Patches. # Patches.
Patch0001: 0001-RHEL-Fixes-for-libguestfs-winsupport.patch Patch0001: 0001-m4-Add-junk-required-to-make-AM_GNU_GETTEXT-work.patch
Patch0002: 0002-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch Patch0002: 0002-convert-Use-e2fsck-n-flag-when-checking-ext2-3-4-fil.patch
Patch0003: 0003-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch Patch0003: 0003-RHEL-Fixes-for-libguestfs-winsupport.patch
Patch0004: 0004-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch Patch0004: 0004-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch
Patch0005: 0005-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch Patch0005: 0005-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch
Patch0006: 0006-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch Patch0006: 0006-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch
Patch0007: 0007-RHEL-Remove-input-from-Xen.patch Patch0007: 0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
Patch0008: 0008-RHEL-Remove-o-glance.patch Patch0008: 0008-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
Patch0009: 0009-RHEL-tests-Remove-btrfs-test.patch Patch0009: 0009-RHEL-Remove-input-from-Xen.patch
Patch0010: 0010-RHEL-Remove-block-driver-option.patch Patch0010: 0010-RHEL-Remove-o-glance.patch
Patch0011: 0011-RHEL-Remove-o-ovirt-o-ovirt-upload-and-o-vdsm-modes.patch Patch0011: 0011-RHEL-tests-Remove-btrfs-test.patch
Patch0012: 0012-RHEL-Add-warning-about-virt-v2v-in-place-not-being-s.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
%if !0%{?rhel} %if !0%{?rhel}
# libguestfs hasn't been built on i686 for a while since there is no # libguestfs hasn't been built on i686 for a while since there is no
@ -63,7 +65,7 @@ BuildRequires: /usr/bin/pod2man
BuildRequires: gcc BuildRequires: gcc
BuildRequires: ocaml >= 4.08 BuildRequires: ocaml >= 4.08
BuildRequires: libguestfs-devel >= 1:1.55.12-1 BuildRequires: libguestfs-devel >= 1:1.55.13-1
BuildRequires: augeas-devel BuildRequires: augeas-devel
BuildRequires: bash-completion BuildRequires: bash-completion
BuildRequires: file-devel BuildRequires: file-devel
@ -108,7 +110,7 @@ BuildRequires: glibc-static
BuildRequires: gnupg2 BuildRequires: gnupg2
%endif %endif
Requires: libguestfs%{?_isa} >= 1:1.55.12-1 Requires: libguestfs%{?_isa} >= 1:1.55.13-1
Requires: guestfs-tools >= 1.49.7-1 Requires: guestfs-tools >= 1.49.7-1
# XFS is the default filesystem in Fedora and RHEL. # XFS is the default filesystem in Fedora and RHEL.
@ -329,7 +331,7 @@ done
%changelog %changelog
* Mon May 19 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.16-1 * Tue May 20 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.16-2
- Rebase to virt-v2v 2.7.16 - Rebase to virt-v2v 2.7.16
related: RHEL-81735 related: RHEL-81735
- Fix virt-v2v -v --install dnf5 error - Fix virt-v2v -v --install dnf5 error