From dd04127f3d80512d2a0a6a7f2bc15e763a0c3883 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 18 Aug 2021 11:12:15 +0100 Subject: [PATCH] Fix conversion of Windows BitLocker guests resolves: rhbz#1994984 --- ...-Remove-o-rhv-upload-oa-preallocated.patch | 2 +- ...load-Remove-restriction-on-oa-sparse.patch | 2 +- ...correct-qemu-binary-for-o-qemu-mode-.patch | 2 +- ...le-the-qemu-boot-option-RHBZ-1147313.patch | 2 +- ...-supported-sound-cards-to-match-RHEL.patch | 2 +- ...-Fix-tests-for-libguestfs-winsupport.patch | 2 +- ...Disable-the-virt-v2v-in-place-option.patch | 2 +- ...sk-force-VNC-as-display-RHBZ-1372671.patch | 2 +- ...-mention-SUSE-Xen-hosts-RHBZ-1430203.patch | 2 +- ...-for-supported-v2v-hypervisors-guest.patch | 2 +- 0011-RHEL-9-Disable-o-glance.patch | 2 +- ...ot-fix-NTFS-heads-in-Windows-Vista-a.patch | 80 +++++++++++++++++++ virt-v2v.spec | 7 +- 13 files changed, 97 insertions(+), 12 deletions(-) create mode 100644 0012-v2v-windows-Do-not-fix-NTFS-heads-in-Windows-Vista-a.patch diff --git a/0001-Revert-v2v-Remove-o-rhv-upload-oa-preallocated.patch b/0001-Revert-v2v-Remove-o-rhv-upload-oa-preallocated.patch index f922f3e..a596368 100644 --- a/0001-Revert-v2v-Remove-o-rhv-upload-oa-preallocated.patch +++ b/0001-Revert-v2v-Remove-o-rhv-upload-oa-preallocated.patch @@ -1,7 +1,7 @@ From 4d5509a98823cc0b8930678716b862adbd2c0b81 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 6 Aug 2021 13:01:28 +0100 -Subject: [PATCH 01/11] Revert "v2v: Remove -o rhv-upload -oa preallocated" +Subject: [PATCH 01/12] Revert "v2v: Remove -o rhv-upload -oa preallocated" This reverts commit 18084f90d9dd9092831cb3487039328981796291. --- diff --git a/0002-RHEL-v2v-rhv-upload-Remove-restriction-on-oa-sparse.patch b/0002-RHEL-v2v-rhv-upload-Remove-restriction-on-oa-sparse.patch index c1a1163..6abff63 100644 --- a/0002-RHEL-v2v-rhv-upload-Remove-restriction-on-oa-sparse.patch +++ b/0002-RHEL-v2v-rhv-upload-Remove-restriction-on-oa-sparse.patch @@ -1,7 +1,7 @@ From abe3c7539b6221e8ab3cc35ee3d58b1aa06bbef4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 14 May 2018 10:16:58 +0100 -Subject: [PATCH 02/11] RHEL: v2v: rhv-upload: Remove restriction on -oa +Subject: [PATCH 02/12] RHEL: v2v: rhv-upload: Remove restriction on -oa sparse. See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681 diff --git a/0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch b/0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch index b32b106..6857062 100644 --- a/0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch +++ b/0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch @@ -1,7 +1,7 @@ From 0839ba57487b73cfb684ea495280db5d946f667a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 28 Sep 2014 19:14:43 +0100 -Subject: [PATCH 03/11] RHEL: v2v: Select correct qemu binary for -o qemu mode +Subject: [PATCH 03/12] RHEL: v2v: Select correct qemu binary for -o qemu mode (RHBZ#1147313). RHEL does not have qemu-system-x86_64 (etc), and in addition the diff --git a/0004-RHEL-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch b/0004-RHEL-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch index 9a77b34..230bfc3 100644 --- a/0004-RHEL-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch +++ b/0004-RHEL-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch @@ -1,7 +1,7 @@ From bb55b78b68e6e8039734eb1d7af22b455f8fbdc2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Sep 2014 10:50:27 +0100 -Subject: [PATCH 04/11] RHEL: v2v: Disable the --qemu-boot option +Subject: [PATCH 04/12] RHEL: v2v: Disable the --qemu-boot option (RHBZ#1147313). This cannot work because there is no Gtk or SDL output mode diff --git a/0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch b/0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch index f93f057..b8812aa 100644 --- a/0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch +++ b/0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch @@ -1,7 +1,7 @@ From 49385571ce5967f8d9a102e935f201ee9c22326d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 24 Apr 2015 09:45:41 -0400 -Subject: [PATCH 05/11] RHEL: Fix list of supported sound cards to match RHEL +Subject: [PATCH 05/12] RHEL: Fix list of supported sound cards to match RHEL qemu (RHBZ#1176493). --- diff --git a/0006-RHEL-Fix-tests-for-libguestfs-winsupport.patch b/0006-RHEL-Fix-tests-for-libguestfs-winsupport.patch index 402b09e..ff2817e 100644 --- a/0006-RHEL-Fix-tests-for-libguestfs-winsupport.patch +++ b/0006-RHEL-Fix-tests-for-libguestfs-winsupport.patch @@ -1,7 +1,7 @@ From db2150a5d790c35fb23c6d9d6b29e602482ce555 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 30 Aug 2015 03:21:57 -0400 -Subject: [PATCH 06/11] RHEL: Fix tests for libguestfs-winsupport. +Subject: [PATCH 06/12] RHEL: Fix tests for libguestfs-winsupport. It doesn't let us use guestfish for arbitrary Windows edits. --- diff --git a/0007-RHEL-v2v-Disable-the-virt-v2v-in-place-option.patch b/0007-RHEL-v2v-Disable-the-virt-v2v-in-place-option.patch index 66041e7..df36eac 100644 --- a/0007-RHEL-v2v-Disable-the-virt-v2v-in-place-option.patch +++ b/0007-RHEL-v2v-Disable-the-virt-v2v-in-place-option.patch @@ -1,7 +1,7 @@ From 3b69cfa365c7b014ca81b09e857ab294cff04914 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 Jan 2016 11:53:42 -0500 -Subject: [PATCH 07/11] RHEL: v2v: Disable the virt-v2v --in-place option. +Subject: [PATCH 07/12] RHEL: v2v: Disable the virt-v2v --in-place option. This disables the virt-v2v --in-place option which we do not wish to support in RHEL. diff --git a/0008-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch b/0008-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch index cd2c206..cf31f28 100644 --- a/0008-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch +++ b/0008-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch @@ -1,7 +1,7 @@ From e57a5dafc00b3b5737824977aad0feb0ec497a1f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 2 Mar 2017 14:21:37 +0100 -Subject: [PATCH 08/11] RHEL: v2v: -i disk: force VNC as display (RHBZ#1372671) +Subject: [PATCH 08/12] RHEL: v2v: -i disk: force VNC as display (RHBZ#1372671) The SDL output mode is not supported in RHEL's qemu-kvm. --- diff --git a/0009-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch b/0009-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch index 06db995..bdf0b68 100644 --- a/0009-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch +++ b/0009-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch @@ -1,7 +1,7 @@ From aa5cf3ba5d10400ee6d6c63dd77c711b6fdec116 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 8 Mar 2017 11:03:40 +0100 -Subject: [PATCH 09/11] RHEL: v2v: do not mention SUSE Xen hosts (RHBZ#1430203) +Subject: [PATCH 09/12] RHEL: v2v: do not mention SUSE Xen hosts (RHBZ#1430203) They are not supported in RHEL. --- diff --git a/0010-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch b/0010-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch index f00865c..5d10d09 100644 --- a/0010-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch +++ b/0010-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch @@ -1,7 +1,7 @@ From ccaae02ef3f081b544eca82f3652ca50ac5566a9 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 26 Mar 2019 09:42:25 +0100 -Subject: [PATCH 10/11] RHEL: point to KB for supported v2v hypervisors/guests +Subject: [PATCH 10/12] RHEL: point to KB for supported v2v hypervisors/guests --- docs/virt-v2v-support.pod | 104 ++------------------------------------ diff --git a/0011-RHEL-9-Disable-o-glance.patch b/0011-RHEL-9-Disable-o-glance.patch index 1336f6c..564bd7d 100644 --- a/0011-RHEL-9-Disable-o-glance.patch +++ b/0011-RHEL-9-Disable-o-glance.patch @@ -1,7 +1,7 @@ From 7edb403ee54153c64205915c0bd1d177c0094ee0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 30 Jun 2021 11:15:52 +0100 -Subject: [PATCH 11/11] RHEL 9: Disable -o glance +Subject: [PATCH 11/12] RHEL 9: Disable -o glance Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1977539 --- diff --git a/0012-v2v-windows-Do-not-fix-NTFS-heads-in-Windows-Vista-a.patch b/0012-v2v-windows-Do-not-fix-NTFS-heads-in-Windows-Vista-a.patch new file mode 100644 index 0000000..802fb03 --- /dev/null +++ b/0012-v2v-windows-Do-not-fix-NTFS-heads-in-Windows-Vista-a.patch @@ -0,0 +1,80 @@ +From 5581ad03910a3b0d198176453c92ad714343697d Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 18 Aug 2021 11:00:12 +0100 +Subject: [PATCH 12/12] v2v: windows: Do not fix NTFS heads in Windows Vista + and later + +Setting/adjusting the number of drive heads in the NTFS header is only +necessary for ancient versions of Windows. Modern versions ignore +this. In addition this operation broke when we added BitLocker +support. Only do this for ancient Windows 2000/XP and skip it for +everything else. + +Reported-by: Ming Xie +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1994984 +(cherry picked from commit 0a394c5c2f802098c9e481b4bacee7821e5dd0ae) +--- + v2v/convert_windows.ml | 44 ++++++++++++++++++++++-------------------- + 1 file changed, 23 insertions(+), 21 deletions(-) + +diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml +index 52e45599..1ed1d59e 100644 +--- a/v2v/convert_windows.ml ++++ b/v2v/convert_windows.ml +@@ -710,30 +710,32 @@ if errorlevel 3010 exit /b 0 + however, as this is specific to Windows 2003 it lists location + 0x1A as unused. + *) +- let rootpart = inspect.i_root in ++ if inspect.i_major_version < 6 (* is Windows 2000/XP *) then ( ++ let rootpart = inspect.i_root in + +- (* Ignore if the rootpart is something like /dev/sda. RHBZ#1276540. *) +- if not (g#is_whole_device rootpart) then ( +- (* Check that the root device contains NTFS magic. *) +- let magic = g#pread_device rootpart 8 3L in +- if magic = "NTFS " then ( +- (* Get the size of the whole disk containing the root partition. *) +- let rootdev = g#part_to_dev rootpart in (* eg. /dev/sda *) +- let size = g#blockdev_getsize64 rootdev in ++ (* Ignore if the rootpart is something like /dev/sda. RHBZ#1276540. *) ++ if not (g#is_whole_device rootpart) then ( ++ (* Check that the root device contains NTFS magic. *) ++ let magic = g#pread_device rootpart 8 3L in ++ if magic = "NTFS " then ( ++ (* Get the size of the whole disk containing the root partition. *) ++ let rootdev = g#part_to_dev rootpart in (* eg. /dev/sda *) ++ let size = g#blockdev_getsize64 rootdev in + +- let heads = (* refer to the table above *) +- if size < 2114445312L then 0x40 +- else if size < 4228374780L then 0x80 +- else 0xff in ++ let heads = (* refer to the table above *) ++ if size < 2114445312L then 0x40 ++ else if size < 4228374780L then 0x80 ++ else 0xff in + +- (* Update NTFS's idea of the number of heads. This is an +- * unsigned 16 bit little-endian integer, offset 0x1a from the +- * beginning of the partition. +- *) +- let b = Bytes.create 2 in +- Bytes.unsafe_set b 0 (Char.chr heads); +- Bytes.unsafe_set b 1 '\000'; +- ignore (g#pwrite_device rootpart (Bytes.to_string b) 0x1a_L) ++ (* Update NTFS's idea of the number of heads. This is an ++ * unsigned 16 bit little-endian integer, offset 0x1a from the ++ * beginning of the partition. ++ *) ++ let b = Bytes.create 2 in ++ Bytes.unsafe_set b 0 (Char.chr heads); ++ Bytes.unsafe_set b 1 '\000'; ++ ignore (g#pwrite_device rootpart (Bytes.to_string b) 0x1a_L) ++ ) + ) + ) + +-- +2.31.1 + diff --git a/virt-v2v.spec b/virt-v2v.spec index 059334b..1a96b00 100644 --- a/virt-v2v.spec +++ b/virt-v2v.spec @@ -15,7 +15,7 @@ Name: virt-v2v Epoch: 1 Version: 1.45.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Convert a virtual machine to run on KVM License: GPLv2+ @@ -61,6 +61,7 @@ Patch9008: 0008-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch Patch9009: 0009-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch Patch9010: 0010-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch Patch9011: 0011-RHEL-9-Disable-o-glance.patch +Patch9012: 0012-v2v-windows-Do-not-fix-NTFS-heads-in-Windows-Vista-a.patch %endif %if 0%{patches_touch_autotools} @@ -287,6 +288,10 @@ popd %changelog +* Wed Aug 18 2021 Richard W.M. Jones - 1:1.45.3-3 +- Fix conversion of Windows BitLocker guests + resolves: rhbz#1994984 + * Tue Aug 10 2021 Mohan Boddu - 1:1.45.3-2 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688