Improve the error message for -i vmx with a .vmdk file
resolves: RHEL-19564
This commit is contained in:
parent
29228bce64
commit
9871c4190e
40
0003-input-parse_vmx.ml-Reject-VMDK-files.patch
Normal file
40
0003-input-parse_vmx.ml-Reject-VMDK-files.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 6f2536bd9fbc335d3fb460d8c3317664d0bd813a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 19 Dec 2023 12:53:56 +0000
|
||||
Subject: [PATCH] input/parse_vmx.ml: Reject VMDK files
|
||||
|
||||
Instead of the confusing warnings printed before, it now prints
|
||||
an error indicating the incorrect input format:
|
||||
|
||||
$ virt-v2v -i vmx -it ssh ssh://root@xxx/vmfs/volumes/esx8.0-function/Auto-esx8.0-rhell9.3-efi-with-empty-cdrom/Auto-esx8.0-rhell9.3-efi-with-empty-cdrom.vmdk -ip /tmp/passwd -o null
|
||||
virt-v2v: error: input file is a VMDK (disk image), but we are expecting a
|
||||
VMX (VMware metadata)
|
||||
|
||||
Reported-by: Ming Xie
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-19564
|
||||
---
|
||||
input/parse_vmx.ml | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/input/parse_vmx.ml b/input/parse_vmx.ml
|
||||
index 65d5a0ed..43d05bf3 100644
|
||||
--- a/input/parse_vmx.ml
|
||||
+++ b/input/parse_vmx.ml
|
||||
@@ -274,6 +274,17 @@ let rec parse_file vmx_filename =
|
||||
parse_string str
|
||||
|
||||
and parse_string str =
|
||||
+ (* Reject VMDK files early, since in virt-v2v we have seen users try
|
||||
+ * to pass a .vmdk file as a .vmx file. Luckily this is easy to
|
||||
+ * do with the whole file as a string.
|
||||
+ *)
|
||||
+ if String.is_prefix str "VMDK" ||
|
||||
+ String.is_prefix str "KDMV" ||
|
||||
+ String.is_prefix str "# Disk DescriptorFile\n" then
|
||||
+ error "input file is a VMDK (disk image), but we are expecting a \
|
||||
+ VMX (VMware metadata)";
|
||||
+
|
||||
+ (* Split the input into lines. *)
|
||||
let lines = String.nsplit "\n" str in
|
||||
|
||||
(* I've never seen any VMX file with CR-LF endings, and VMware
|
@ -1,4 +1,4 @@
|
||||
From 714eb855ca5924245c5831f5f008306b7d1f6a2a Mon Sep 17 00:00:00 2001
|
||||
From 9a814bbb788b8c1e353ac16a3117af7ebdea7f96 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
|
@ -1,4 +1,4 @@
|
||||
From 419ab62f882db17dcbe32c1f1c80be51dfb00fec Mon Sep 17 00:00:00 2001
|
||||
From 601bcb0602e1944c4350ce612dd838e0e6895f6a 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
|
@ -1,4 +1,4 @@
|
||||
From dc27eb1d7634879fdd666b4526382d35718e8d61 Mon Sep 17 00:00:00 2001
|
||||
From 5dfbc9275e29c24d8c31652379e76b9cc7cb2988 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
|
@ -1,4 +1,4 @@
|
||||
From 8a04c776067ea059092d2e6435b3f1a34eadd42f Mon Sep 17 00:00:00 2001
|
||||
From 1ea4fcbb9e4794cd59efe482cf122608dd0a0689 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.
|
@ -1,4 +1,4 @@
|
||||
From 249864cdb71388d9ffa18b32f2dc68ee38446c0b Mon Sep 17 00:00:00 2001
|
||||
From 68a5971a7b214e2d29c4ccba23efef4e0624e294 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)
|
@ -1,4 +1,4 @@
|
||||
From 6f681ece3f020326a472055e343847ee4e865a13 Mon Sep 17 00:00:00 2001
|
||||
From a291a35c4b51455707c5f2540994324c784f0d5c Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 8 Mar 2017 11:03:40 +0100
|
||||
Subject: [PATCH] RHEL: v2v: do not mention SUSE Xen hosts (RHBZ#1430203)
|
@ -1,4 +1,4 @@
|
||||
From 53ab6bfebc6c9b6076ca40d8e295215d59a3ff2e Mon Sep 17 00:00:00 2001
|
||||
From 5ddad54bc131bbdd88c39640957924c077e5456e 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
|
@ -1,4 +1,4 @@
|
||||
From 26a872919340dc1b319b9b9d00f818154a544b1f Mon Sep 17 00:00:00 2001
|
||||
From 8ccb0f161424ba54fb48cc8b6c9734eeca49267f 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: Disable -o glance
|
@ -1,4 +1,4 @@
|
||||
From eec1c6b2e7fe8a9dec3f1d7092ea6738fd166885 Mon Sep 17 00:00:00 2001
|
||||
From 6ea8c70cbebdfb1a12bbcd2d57b5c6c157369478 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Dec 2021 11:56:05 +0000
|
||||
Subject: [PATCH] RHEL: Remove the --in-place option
|
@ -1,4 +1,4 @@
|
||||
From 9bb2e6380eaa0131c43a8cc5e6b4bbdb02380b96 Mon Sep 17 00:00:00 2001
|
||||
From 3bf6f17ce219c24931701addc986ab953c9446d5 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Jul 2022 11:56:54 +0100
|
||||
Subject: [PATCH] RHEL 9: -oo compressed: Remove nbdcopy version check and test
|
@ -1,4 +1,4 @@
|
||||
From 4db6cbedc3e71b05e9defd356e7289bf01e2b985 Mon Sep 17 00:00:00 2001
|
||||
From 7f9cacaaa25ec7beed6ca21b758cfd6f2204ca19 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 9: tests: Remove btrfs test
|
@ -1,4 +1,4 @@
|
||||
From e8def768b455b6e09c00fa48265a876acbc75837 Mon Sep 17 00:00:00 2001
|
||||
From a126df43b1155d7ab2fea8beb2b36baee7b83264 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 9: Remove --block-driver option
|
@ -16,7 +16,7 @@
|
||||
Name: virt-v2v
|
||||
Epoch: 1
|
||||
Version: 2.3.7
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Convert a virtual machine to run on KVM
|
||||
|
||||
License: GPL-2.0-or-later AND LGPL-2.0-or-later
|
||||
@ -38,18 +38,19 @@ Source3: copy-patches.sh
|
||||
# Patches.
|
||||
Patch0001: 0001-ocaml-dep.sh-Add-common-mlcustomize-to-list-of-direc.patch
|
||||
Patch0002: 0002-Update-common-submodule.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-Fixes-for-libguestfs-winsupport.patch
|
||||
Patch0007: 0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
|
||||
Patch0008: 0008-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch
|
||||
Patch0009: 0009-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
|
||||
Patch0010: 0010-RHEL-Disable-o-glance.patch
|
||||
Patch0011: 0011-RHEL-Remove-the-in-place-option.patch
|
||||
Patch0012: 0012-RHEL-9-oo-compressed-Remove-nbdcopy-version-check-an.patch
|
||||
Patch0013: 0013-RHEL-9-tests-Remove-btrfs-test.patch
|
||||
Patch0014: 0014-RHEL-9-Remove-block-driver-option.patch
|
||||
Patch0003: 0003-input-parse_vmx.ml-Reject-VMDK-files.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-Fixes-for-libguestfs-winsupport.patch
|
||||
Patch0008: 0008-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
|
||||
Patch0009: 0009-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch
|
||||
Patch0010: 0010-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
|
||||
Patch0011: 0011-RHEL-Disable-o-glance.patch
|
||||
Patch0012: 0012-RHEL-Remove-the-in-place-option.patch
|
||||
Patch0013: 0013-RHEL-9-oo-compressed-Remove-nbdcopy-version-check-an.patch
|
||||
Patch0014: 0014-RHEL-9-tests-Remove-btrfs-test.patch
|
||||
Patch0015: 0015-RHEL-9-Remove-block-driver-option.patch
|
||||
|
||||
%if !0%{?rhel}
|
||||
# libguestfs hasn't been built on i686 for a while since there is no
|
||||
@ -353,6 +354,10 @@ make -C tests TESTS=test-v2v-fedora-luks-on-lvm-conversion.sh check
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Dec 19 2023 Richard W.M. Jones <rjones@redhat.com> - 1:2.3.7-2
|
||||
- Improve the error message for -i vmx with a .vmdk file
|
||||
resolves: RHEL-19564
|
||||
|
||||
* Mon Dec 11 2023 Richard W.M. Jones <rjones@redhat.com> - 1:2.3.7-1
|
||||
- Rebase to virt-v2v 2.3.7
|
||||
- -it ssh: Double quote ssh command which tests remote file exists
|
||||
|
Loading…
Reference in New Issue
Block a user