From 398d4a7e71aa8482cc46d9f6277f5816b3c156d9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 30 Oct 2025 11:30:24 +0000 Subject: [PATCH] Fix ESP conversion if C:\Windows\Temp has alternate case resolves: RHEL-125117 --- ...Fix-ESP-conversion-if-C-Windows-Temp.patch | 70 +++++++++++++++++++ virt-v2v.spec | 7 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 0060-convert-windows-Fix-ESP-conversion-if-C-Windows-Temp.patch diff --git a/0060-convert-windows-Fix-ESP-conversion-if-C-Windows-Temp.patch b/0060-convert-windows-Fix-ESP-conversion-if-C-Windows-Temp.patch new file mode 100644 index 0000000..3454264 --- /dev/null +++ b/0060-convert-windows-Fix-ESP-conversion-if-C-Windows-Temp.patch @@ -0,0 +1,70 @@ +From 7f4e6125495f309190b8205c759d198228d8a7d6 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 28 Oct 2025 11:34:22 +0000 +Subject: [PATCH] convert: windows: Fix ESP conversion if C:\Windows\Temp has + alternate case + +We found a Windows guest which had the expected C:\Windows\Temp path, +but the actual name was TEMP rather than Temp. It's unclear if this +had been renamed, or if Windows can create this normally. In any +case, the unexpected casing caused this failure: + + virt-v2v: error: libguestfs error: mkdtemp: /Windows/Temp/ESP_XXXXXX: No such file or directory + +We have to use g#case_sensitive_path here since the directory is on +NTFS. + +I also removed the hard-coded "\Windows" in favour of %systemroot%, +and fixed the indentation. + +Fixes: https://issues.redhat.com/browse/RHEL-124569 +Reported-by: Ulhas Surse +(cherry picked from commit 277ddd1a9b84d9c1b1fa93ef9a2e7f52b68d7930) +(cherry picked from commit 0b1c9ccf4c5808db323554c5d55ded2c345ebcb9) +--- + convert/convert_windows.ml | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml +index d5a57d6e..b80128a7 100644 +--- a/convert/convert_windows.ml ++++ b/convert/convert_windows.ml +@@ -961,21 +961,25 @@ let convert (g : G.guestfs) source inspect i_firmware + match i_firmware with + | Firmware.I_BIOS -> () + | I_UEFI esp_list -> +- let esp_temp_path = g#mkdtemp "/Windows/Temp/ESP_XXXXXX" in +- let uefi_arch = get_uefi_arch_suffix inspect.i_arch in ++ let esp_temp_path = ++ let temp = inspect.i_windows_systemroot ^ "/Temp" in ++ let mp = g#case_sensitive_path temp in ++ let template = mp ^ "/ESP_XXXXXX" in ++ g#mkdtemp template in ++ let uefi_arch = get_uefi_arch_suffix inspect.i_arch in + +- List.iter ( +- fun dev_path -> +- g#mount dev_path esp_temp_path; +- fix_win_uefi_bcd esp_temp_path; +- (match uefi_arch with +- | Some uefi_arch -> fix_win_uefi_fallback esp_temp_path uefi_arch +- | None -> () +- ); +- g#umount esp_temp_path; +- ) esp_list; ++ List.iter ( ++ fun dev_path -> ++ g#mount dev_path esp_temp_path; ++ fix_win_uefi_bcd esp_temp_path; ++ (match uefi_arch with ++ | Some uefi_arch -> fix_win_uefi_fallback esp_temp_path uefi_arch ++ | None -> () ++ ); ++ g#umount esp_temp_path; ++ ) esp_list; + +- g#rmdir esp_temp_path ++ g#rmdir esp_temp_path + in + + do_convert () diff --git a/virt-v2v.spec b/virt-v2v.spec index 803bea7..ee24aef 100644 --- a/virt-v2v.spec +++ b/virt-v2v.spec @@ -8,7 +8,7 @@ Name: virt-v2v Epoch: 1 Version: 2.7.1 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Convert a virtual machine to run on KVM License: GPL-2.0-or-later AND LGPL-2.0-or-later @@ -87,6 +87,7 @@ Patch0056: 0056-vddk-Remove-io-vddk-noextents-option.patch Patch0057: 0057-Modify-configure_pnputil_install-script-to-check.patch Patch0058: 0058-Ignore-ERROR_NO_MORE_ITEMS-status-from-PnPUtil.patch Patch0059: 0059-remove-timeout-before-installing-virtio-win-drivers.patch +Patch0060: 0060-convert-windows-Fix-ESP-conversion-if-C-Windows-Temp.patch %if !0%{?rhel} # libguestfs hasn't been built on i686 for a while since there is no @@ -390,6 +391,10 @@ make -C tests TESTS=test-fedora-luks-on-lvm-conversion.sh check %changelog +* Thu Oct 30 2025 Richard W.M. Jones - 1:2.7.1-17 +- Fix ESP conversion if C:\Windows\Temp has alternate case + resolves: RHEL-125117 + * Fri Jul 18 2025 Richard W.M. Jones - 1:2.7.1-16 - mlcustomize: Remove dnf --verbose option resolves: RHEL-83289