From 211690d47b25e1c9c973cb1fbf7d69da46445464 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 20 Jan 2022 12:46:17 +0000 Subject: [PATCH] Fix virt-v2v hang when given incorrect vpx:// URL resolves: rhbz#2041886 --- ...about-setting-up-the-input-and-outpu.patch | 549 ++++++++++++++++++ ...t-Fix-graphics-element-port-autoport.patch | 78 +++ ...-qemu-Use-correct-device-name-for-vs.patch | 69 +++ ...obsolete-Fedora-versions-start-testi.patch | 41 ++ 0007-tests-Drop-test-of-centos-6.patch | 37 ++ ...nt-Ubuntu-versions-add-Ubuntu-20.04-.patch | 33 ++ ...nd-add-newer-RHEL-versions-to-the-te.patch | 37 ++ ...virt-builder-update-when-testing-Win.patch | 52 ++ ...rim.sh-Use-of-qcow2-to-preserve-outp.patch | 32 + ...se-qemu-nbd-shared-0-flag-to-allow-m.patch | 41 ++ ...emuNBD.ml-Use-qemu-nbd-discard-unmap.patch | 33 ++ ...correct-qemu-binary-for-o-qemu-mode-.patch | 4 +- ...-the-qemu-boot-oo-qemu-boot-option-R.patch | 6 +- ...-supported-sound-cards-to-match-RHEL.patch | 2 +- ...RHEL-Fixes-for-libguestfs-winsupport.patch | 2 +- ...sk-force-VNC-as-display-RHBZ-1372671.patch | 4 +- ...-mention-SUSE-Xen-hosts-RHBZ-1430203.patch | 2 +- ...-for-supported-v2v-hypervisors-guest.patch | 2 +- ....patch => 0021-RHEL-Disable-o-glance.patch | 4 +- ...0022-RHEL-Remove-the-in-place-option.patch | 4 +- virt-v2v.spec | 37 +- 21 files changed, 1042 insertions(+), 27 deletions(-) create mode 100644 0003-Restore-message-about-setting-up-the-input-and-outpu.patch create mode 100644 0004-output-o-libvirt-Fix-graphics-element-port-autoport.patch create mode 100644 0005-output-o-libvirt-qemu-Use-correct-device-name-for-vs.patch create mode 100644 0006-tests-Drop-some-obsolete-Fedora-versions-start-testi.patch create mode 100644 0007-tests-Drop-test-of-centos-6.patch create mode 100644 0008-tests-Drop-ancient-Ubuntu-versions-add-Ubuntu-20.04-.patch create mode 100644 0009-tests-Drop-old-and-add-newer-RHEL-versions-to-the-te.patch create mode 100644 0010-tests-Don-t-use-virt-builder-update-when-testing-Win.patch create mode 100644 0011-tests-test-v2v-trim.sh-Use-of-qcow2-to-preserve-outp.patch create mode 100644 0012-lib-qemuNBD.ml-Use-qemu-nbd-shared-0-flag-to-allow-m.patch create mode 100644 0013-lib-qemuNBD.ml-Use-qemu-nbd-discard-unmap.patch rename 0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch => 0014-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch (91%) rename 0004-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch => 0015-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch (96%) rename 0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch => 0016-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch (92%) rename 0006-RHEL-Fixes-for-libguestfs-winsupport.patch => 0017-RHEL-Fixes-for-libguestfs-winsupport.patch (98%) rename 0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch => 0018-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch (89%) rename 0008-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch => 0019-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch (91%) rename 0009-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch => 0020-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch (97%) rename 0010-RHEL-Disable-o-glance.patch => 0021-RHEL-Disable-o-glance.patch (98%) rename 0011-RHEL-Remove-the-in-place-option.patch => 0022-RHEL-Remove-the-in-place-option.patch (98%) diff --git a/0003-Restore-message-about-setting-up-the-input-and-outpu.patch b/0003-Restore-message-about-setting-up-the-input-and-outpu.patch new file mode 100644 index 0000000..4f77cd1 --- /dev/null +++ b/0003-Restore-message-about-setting-up-the-input-and-outpu.patch @@ -0,0 +1,549 @@ +From 924aa8b70a64e9b076f8f56328a2b49650ab713c Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 13:10:45 +0000 +Subject: [PATCH] Restore message about setting up the input and output +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Old virt-v2v would print a summary of the input and output options +before connecting to the input/output, looking something like this: + + [ 0.2] Opening the source -i libvirt -ic [etc] + +This gave reassurance that virt-v2v was doing something in the case +where the source was slow or unreachable. In particular if you use +-i libvirt with a vCenter URL, and the URL is wrong, libvirt hangs for +a few minutes without printing anything. + +Modular virt-v2v rearranged things so the connecting phase was silent, +which meant that in the case above virt-v2v appeared to hang for a few +minutes printing nothing at all. + +This change adds to_string functions to all the input and output +methods and uses them to print a message like: + + [ 0.0] Setting up the source: -i libvirt -ic [etc] + +The hang still happens, but at least it's now clear where it's hanging. + +Note the old "Opening the source" message now refers to libguestfs +connecting to the NBD source disk pipeline. + +Typical full output looks like this: + + $ virt-v2v -i disk /var/tmp/fedora-35.img -o disk -os /var/tmp/out + [ 0.0] Setting up the source: -i disk /var/tmp/fedora-35.img + [ 1.1] Opening the source + [ 5.9] Inspecting the source + [ 11.5] Checking for sufficient free disk space in the guest + [ 11.5] Converting Fedora Linux 35 (Thirty Five) to run on KVM + virt-v2v: warning: /files/boot/grub2/device.map/hd0 references unknown + device "vda". You may have to fix this entry manually after conversion. + virt-v2v: This guest has virtio drivers installed. + [ 57.4] Mapping filesystem data to avoid copying unused and blank areas + [ 61.0] Closing the overlay + [ 61.7] Assigning disks to buses + [ 61.7] Checking if the guest needs BIOS or UEFI to boot + [ 61.7] Setting up the destination: -o disk -os /var/tmp/out + [ 62.8] Copying disk 1/1 + █ 100% [****************************************] + [ 81.7] Creating output metadata + [ 81.7] Finishing off + +Reported-by: Xiaodai Wang +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2041886 +Fixes: commit 255722cbf39afc0b012e2ac00d16fa6ba2f8c21f +Reviewed-by: Laszlo Ersek +--- + input/input.ml | 1 + + input/input.mli | 4 ++++ + input/input_disk.ml | 2 ++ + input/input_libvirt.ml | 10 ++++++++++ + input/input_ova.ml | 2 ++ + input/input_vcenter_https.ml | 9 +++++++++ + input/input_vddk.ml | 9 +++++++++ + input/input_vmx.ml | 2 ++ + input/input_xen_ssh.ml | 9 +++++++++ + output/output.ml | 1 + + output/output.mli | 4 ++++ + output/output_disk.ml | 6 ++++++ + output/output_glance.ml | 2 ++ + output/output_json.ml | 6 ++++++ + output/output_libvirt.ml | 6 ++++++ + output/output_null.ml | 2 ++ + output/output_openstack.ml | 16 ++++++++++++++++ + output/output_qemu.ml | 6 ++++++ + output/output_rhv.ml | 2 ++ + output/output_rhv_upload.ml | 9 +++++++++ + output/output_vdsm.ml | 2 ++ + tests/test-v2v-i-vmx-1.expected | 1 + + tests/test-v2v-i-vmx-2.expected | 1 + + tests/test-v2v-i-vmx-3.expected | 1 + + tests/test-v2v-i-vmx-4.expected | 1 + + tests/test-v2v-i-vmx-5.expected | 1 + + tests/test-v2v-i-vmx.sh | 3 +++ + tests/test-v2v-print-source.sh | 3 +++ + v2v/v2v.ml | 4 ++++ + 29 files changed, 125 insertions(+) + +diff --git a/input/input.ml b/input/input.ml +index 00474bec..b1175fa3 100644 +--- a/input/input.ml ++++ b/input/input.ml +@@ -26,6 +26,7 @@ type options = { + } + + module type INPUT = sig ++ val to_string : options -> string list -> string + val setup : string -> options -> string list -> Types.source + val query_input_options : unit -> unit + end +diff --git a/input/input.mli b/input/input.mli +index 4f899b1d..b61df3e9 100644 +--- a/input/input.mli ++++ b/input/input.mli +@@ -26,6 +26,10 @@ type options = { + } + + module type INPUT = sig ++ val to_string : options -> string list -> string ++ (** [to_string options args] converts the source to a printable ++ string (for messages). *) ++ + val setup : string -> options -> string list -> Types.source + (** [setup dir options args] + +diff --git a/input/input_disk.ml b/input/input_disk.ml +index bcdaf78c..2b21950a 100644 +--- a/input/input_disk.ml ++++ b/input/input_disk.ml +@@ -142,6 +142,8 @@ and detect_local_input_format { input_format } filenames = + get_format formats + + module Disk = struct ++ let to_string options args = String.concat " " ("-i disk" :: args) ++ + let setup dir options args = + disk_source dir options args + +diff --git a/input/input_libvirt.ml b/input/input_libvirt.ml +index f20082c2..33f61086 100644 +--- a/input/input_libvirt.ml ++++ b/input/input_libvirt.ml +@@ -129,6 +129,14 @@ and libvirt_xml_source _ args = + source, disks + + module Libvirt_ = struct ++ let to_string options args = ++ let xs = "-i libvirt" :: args in ++ let xs = ++ match options.input_conn with ++ | Some ic -> ("-ic " ^ ic) :: xs ++ | None -> xs in ++ String.concat " " xs ++ + let setup dir options args = + let source, data = libvirt_source options args in + libvirt_servers dir data; +@@ -139,6 +147,8 @@ module Libvirt_ = struct + end + + module LibvirtXML = struct ++ let to_string options args = String.concat " " ("-i libvirtxml" :: args) ++ + let setup dir options args = + let source, data = libvirt_xml_source options args in + libvirt_servers dir data; +diff --git a/input/input_ova.ml b/input/input_ova.ml +index 0115f771..19c22d55 100644 +--- a/input/input_ova.ml ++++ b/input/input_ova.ml +@@ -229,6 +229,8 @@ and error_missing_href href = + error (f_"-i ova: OVF references file ‘%s’ which was not found in the OVA archive") href + + module OVA = struct ++ let to_string options args = String.concat " " ("-i ova" :: args) ++ + let setup dir options args = + ova_source dir options args + +diff --git a/input/input_vcenter_https.ml b/input/input_vcenter_https.ml +index 24ac927d..bcefed16 100644 +--- a/input/input_vcenter_https.ml ++++ b/input/input_vcenter_https.ml +@@ -117,6 +117,15 @@ let rec vcenter_https_source dir options args = + source + + module VCenterHTTPS = struct ++ let to_string options args = ++ let xs = args in ++ let xs = ++ match options.input_conn with ++ | Some ic -> ("-ic " ^ ic) :: xs ++ | None -> xs in ++ let xs = "-i libvirt" :: xs in ++ String.concat " " xs ++ + let setup dir options args = + vcenter_https_source dir options args + +diff --git a/input/input_vddk.ml b/input/input_vddk.ml +index 1cfb7f5e..b9a0b8bf 100644 +--- a/input/input_vddk.ml ++++ b/input/input_vddk.ml +@@ -193,6 +193,15 @@ and vddk_source dir options args = + source + + module VDDK = struct ++ let to_string options args = ++ let xs = "-it vddk" :: args in ++ let xs = ++ match options.input_conn with ++ | Some ic -> ("-ic " ^ ic) :: xs ++ | None -> xs in ++ let xs = "-i libvirt" :: xs in ++ String.concat " " xs ++ + let setup dir options args = + vddk_source dir options args + +diff --git a/input/input_vmx.ml b/input/input_vmx.ml +index 9065e857..6e8948f9 100644 +--- a/input/input_vmx.ml ++++ b/input/input_vmx.ml +@@ -118,6 +118,8 @@ and absolute_path_from_other_file other_filename filename = + else (Filename.dirname (absolute_path other_filename)) // filename + + module VMX = struct ++ let to_string options args = String.concat " " ("-i vmx" :: args) ++ + let setup dir options args = + vmx_source dir options args + +diff --git a/input/input_xen_ssh.ml b/input/input_xen_ssh.ml +index cb8b1f91..f18ac5cf 100644 +--- a/input/input_xen_ssh.ml ++++ b/input/input_xen_ssh.ml +@@ -112,6 +112,15 @@ let rec xen_ssh_source dir options args = + source + + module XenSSH = struct ++ let to_string options args = ++ let xs = args in ++ let xs = ++ match options.input_conn with ++ | Some ic -> ("-ic " ^ ic) :: xs ++ | None -> xs in ++ let xs = "-i libvirt" :: xs in ++ String.concat " " xs ++ + let setup dir options args = + xen_ssh_source dir options args + +diff --git a/output/output.ml b/output/output.ml +index 101da82a..659d20ac 100644 +--- a/output/output.ml ++++ b/output/output.ml +@@ -38,6 +38,7 @@ type options = { + + module type OUTPUT = sig + type t ++ val to_string : options -> string + val setup : string -> options -> Types.source -> t + val finalize : string -> options -> + Types.source -> Types.inspect -> Types.target_meta -> +diff --git a/output/output.mli b/output/output.mli +index 03d71daf..ced22161 100644 +--- a/output/output.mli ++++ b/output/output.mli +@@ -30,6 +30,10 @@ module type OUTPUT = sig + type t + (** Opaque data used by the output mode. *) + ++ val to_string : options -> string ++ (** [to_string options] converts the destination to a printable ++ string (for messages). *) ++ + val setup : string -> options -> Types.source -> t + (** [setup dir options source] + +diff --git a/output/output_disk.ml b/output/output_disk.ml +index eca3c727..386d031b 100644 +--- a/output/output_disk.ml ++++ b/output/output_disk.ml +@@ -96,6 +96,12 @@ and disk_finalize dir source inspect target_meta + module Disk = struct + type t = unit + ++ let to_string options = ++ "-o disk" ^ ++ match options.output_storage with ++ | Some os -> " -os " ^ os ++ | None -> "" ++ + let setup dir options source = + if options.output_options <> [] then + error (f_"no -oo (output options) are allowed here"); +diff --git a/output/output_glance.ml b/output/output_glance.ml +index 0d7838dd..85cbe58e 100644 +--- a/output/output_glance.ml ++++ b/output/output_glance.ml +@@ -122,6 +122,8 @@ and glance_finalize dir source inspect target_meta output_format tmpdir = + module Glance = struct + type t = string + ++ let to_string options = "-o glance" ++ + let setup dir options source = + if options.output_options <> [] then + error (f_"no -oo (output options) are allowed here"); +diff --git a/output/output_json.ml b/output/output_json.ml +index bb0cdfeb..88fb4778 100644 +--- a/output/output_json.ml ++++ b/output/output_json.ml +@@ -134,6 +134,12 @@ and json_path os output_name json_disks_pattern i = + module Json = struct + type t = unit + ++ let to_string options = ++ "-o json" ^ ++ match options.output_storage with ++ | Some os -> " -os " ^ os ++ | None -> "" ++ + let setup dir options source = + let data = json_parse_options options in + let output_name = get_output_name options source in +diff --git a/output/output_libvirt.ml b/output/output_libvirt.ml +index 52c45401..20333363 100644 +--- a/output/output_libvirt.ml ++++ b/output/output_libvirt.ml +@@ -198,6 +198,12 @@ and target_features_of_capabilities_doc doc arch = + module Libvirt_ = struct + type t = string * string + ++ let to_string options = ++ "-o libvirt" ^ ++ match options.output_storage with ++ | Some os -> " -os " ^ os ++ | None -> "" ++ + let setup dir options source = + if options.output_options <> [] then + error (f_"no -oo (output options) are allowed here"); +diff --git a/output/output_null.ml b/output/output_null.ml +index 34fbd6e1..56fb7ec6 100644 +--- a/output/output_null.ml ++++ b/output/output_null.ml +@@ -76,6 +76,8 @@ and null_servers dir disks output_name = + module Null = struct + type t = unit + ++ let to_string options = "-o null" ++ + let setup dir options source = + if options.output_options <> [] then + error (f_"no -oo (output options) are allowed here"); +diff --git a/output/output_openstack.ml b/output/output_openstack.ml +index 334a1fc2..6e52ddb3 100644 +--- a/output/output_openstack.ml ++++ b/output/output_openstack.ml +@@ -462,6 +462,22 @@ and iso_time = + module Openstack = struct + type t = string list + ++ let to_string options = ++ (* Try to get the server-id since it seems useful to display ++ * that for diagnostics. ++ *) ++ let server_id = ref None in ++ List.iter ( ++ function ++ | "server-id", v -> server_id := Some v ++ | _ -> () ++ ) options.output_options; ++ ++ "-o openstack" ^ ++ (match !server_id with ++ | None -> "" ++ | Some id -> sprintf " -oo server-id=%s" id) ++ + let setup dir options source = + let data = openstack_parse_options options in + let output_name = get_output_name options source in +diff --git a/output/output_qemu.ml b/output/output_qemu.ml +index 0aac1eba..3d5d6782 100644 +--- a/output/output_qemu.ml ++++ b/output/output_qemu.ml +@@ -315,6 +315,12 @@ and qemu_finalize dir source inspect target_meta + module QEMU = struct + type t = unit + ++ let to_string options = ++ "-o qemu" ^ ++ match options.output_storage with ++ | Some os -> " -os " ^ os ++ | None -> "" ++ + let setup dir options source = + let data = qemu_parse_options options in + let output_name = get_output_name options source in +diff --git a/output/output_rhv.ml b/output/output_rhv.ml +index 6a67b7aa..a386b9a5 100644 +--- a/output/output_rhv.ml ++++ b/output/output_rhv.ml +@@ -266,6 +266,8 @@ and check_storage_domain domain_class os mp = + module RHV = struct + type t = string * string * string * string list * string list * int64 list + ++ let to_string options = "-o rhv" ++ + let setup dir options source = + if options.output_options <> [] then + error (f_"no -oo (output options) are allowed here"); +diff --git a/output/output_rhv_upload.ml b/output/output_rhv_upload.ml +index 91e7be45..4d8dc1c1 100644 +--- a/output/output_rhv_upload.ml ++++ b/output/output_rhv_upload.ml +@@ -444,6 +444,15 @@ module RHVUpload = struct + JSON.field list * string option * string option * + string option * string + ++ let to_string options = ++ "-o rhv-upload" ^ ++ (match options.output_conn with ++ | Some oc -> " -oc " ^ oc ++ | None -> "") ^ ++ (match options.output_storage with ++ | Some os -> " -os " ^ os ++ | None -> "") ++ + let setup dir options source = + let data = rhv_upload_parse_options options in + let output_name = get_output_name options source in +diff --git a/output/output_vdsm.ml b/output/output_vdsm.ml +index ce0d5b5e..676ecf00 100644 +--- a/output/output_vdsm.ml ++++ b/output/output_vdsm.ml +@@ -212,6 +212,8 @@ and vdsm_finalize dir source inspect target_meta + module VDSM = struct + type t = string * string * int64 list + ++ let to_string options = "-o vdsm" ++ + let setup dir options source = + let data = vdsm_parse_options options in + let output_name = get_output_name options source in +diff --git a/tests/test-v2v-i-vmx-1.expected b/tests/test-v2v-i-vmx-1.expected +index bca99c48..59e2c5d3 100644 +--- a/tests/test-v2v-i-vmx-1.expected ++++ b/tests/test-v2v-i-vmx-1.expected +@@ -1,3 +1,4 @@ ++ + Source guest information (--print-source option): + + source name: BZ1308535_21disks +diff --git a/tests/test-v2v-i-vmx-2.expected b/tests/test-v2v-i-vmx-2.expected +index e56777c8..576d347b 100644 +--- a/tests/test-v2v-i-vmx-2.expected ++++ b/tests/test-v2v-i-vmx-2.expected +@@ -1,3 +1,4 @@ ++ + Source guest information (--print-source option): + + source name: Fedora 20 +diff --git a/tests/test-v2v-i-vmx-3.expected b/tests/test-v2v-i-vmx-3.expected +index 47e4d25e..102e82eb 100644 +--- a/tests/test-v2v-i-vmx-3.expected ++++ b/tests/test-v2v-i-vmx-3.expected +@@ -1,3 +1,4 @@ ++ + Source guest information (--print-source option): + + source name: RHEL 7.1 UEFI +diff --git a/tests/test-v2v-i-vmx-4.expected b/tests/test-v2v-i-vmx-4.expected +index dd731294..0d772855 100644 +--- a/tests/test-v2v-i-vmx-4.expected ++++ b/tests/test-v2v-i-vmx-4.expected +@@ -1,3 +1,4 @@ ++ + Source guest information (--print-source option): + + source name: Windows 7 x64 +diff --git a/tests/test-v2v-i-vmx-5.expected b/tests/test-v2v-i-vmx-5.expected +index cfddcda7..1b8e15bf 100644 +--- a/tests/test-v2v-i-vmx-5.expected ++++ b/tests/test-v2v-i-vmx-5.expected +@@ -1,3 +1,4 @@ ++ + Source guest information (--print-source option): + + source name: MSEdge - Win10_preview +diff --git a/tests/test-v2v-i-vmx.sh b/tests/test-v2v-i-vmx.sh +index f2fda66d..db870bea 100755 +--- a/tests/test-v2v-i-vmx.sh ++++ b/tests/test-v2v-i-vmx.sh +@@ -29,6 +29,8 @@ set -x + + skip_if_skipped + ++export LANG=C ++ + export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools" + export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win" + +@@ -52,6 +54,7 @@ for i in 1 2 3 4 5; do + # Normalize the print-source output. + mv test-v2v-i-vmx-$i.actual test-v2v-i-vmx-$i.actual.old + sed \ ++ -e "s,.*Setting up the source.*,," \ + -e "s,.*Opening the source.*,," \ + -e "s,$(pwd),," \ + < test-v2v-i-vmx-$i.actual.old > test-v2v-i-vmx-$i.actual +diff --git a/tests/test-v2v-print-source.sh b/tests/test-v2v-print-source.sh +index c4717361..e46fd126 100755 +--- a/tests/test-v2v-print-source.sh ++++ b/tests/test-v2v-print-source.sh +@@ -27,6 +27,8 @@ set -x + skip_if_skipped + requires test -f ../test-data/phony-guests/windows.img + ++export LANG=C ++ + d=test-v2v-print-source.d + rm -rf $d + cleanup_fn rm -r $d +@@ -39,6 +41,7 @@ $VG virt-v2v --debug-gc \ + + mv $d/output $d/output.orig + < $d/output.orig \ ++grep -v 'Setting up the source' | + grep -v 'Opening the source' | + grep -v 'Source guest information' | + sed -e 's,/.*/windows.img,windows.img,' | +diff --git a/v2v/v2v.ml b/v2v/v2v.ml +index 47e6e937..d74cc21f 100644 +--- a/v2v/v2v.ml ++++ b/v2v/v2v.ml +@@ -532,6 +532,8 @@ read the man page virt-v2v(1). + } in + + (* Start the input module (runs an NBD server in the background). *) ++ message (f_"Setting up the source: %s") ++ (Input_module.to_string input_options args); + let source = Input_module.setup tmpdir input_options args in + + (* If --print-source then print the source metadata and exit. *) +@@ -548,6 +550,8 @@ read the man page virt-v2v(1). + unlink (tmpdir // "convert"); + + (* Start the output module (runs an NBD server in the background). *) ++ message (f_"Setting up the destination: %s") ++ (Output_module.to_string output_options); + let output_t = Output_module.setup tmpdir output_options source in + + (* Debug the v2vdir. *) +-- +2.31.1 + diff --git a/0004-output-o-libvirt-Fix-graphics-element-port-autoport.patch b/0004-output-o-libvirt-Fix-graphics-element-port-autoport.patch new file mode 100644 index 0000000..a5befe4 --- /dev/null +++ b/0004-output-o-libvirt-Fix-graphics-element-port-autoport.patch @@ -0,0 +1,78 @@ +From 4c3d0b8b3b4b99ac613b612f05e0810d64381999 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 16:16:55 +0000 +Subject: [PATCH] output: -o libvirt: Fix element port/autoport + +According to https://libvirt.org/formatdomain.html only vnc and sdl +graphics types support port/autoport. + +In addition, autoport='yes' is the non-deprecated replacement for +port='-1'. Since we don't need to support ancient libvirt, we don't +need to keep adding port='-1' in the autoport case. virt-xml-validate +rejects our XML if it has both attributes. + +Thanks: Martin Kletzander +Reviewed-by: Laszlo Ersek +--- + output/create_libvirt_xml.ml | 22 ++++++++++------------ + tests/test-v2v-i-ova.xml | 2 +- + 2 files changed, 11 insertions(+), 13 deletions(-) + +diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml +index 87bfab17..93ceb803 100644 +--- a/output/create_libvirt_xml.ml ++++ b/output/create_libvirt_xml.ml +@@ -435,13 +435,18 @@ let create_libvirt_xml ?pool source inspect + + let graphics = + match source.s_display with +- | None -> e "graphics" [ "type", "vnc" ] [] ++ | None -> ++ e "graphics" [ "type", "vnc"; "autoport", "yes" ] [] + | Some { s_display_type = Window } -> + e "graphics" [ "type", "sdl" ] [] +- | Some { s_display_type = VNC } -> +- e "graphics" [ "type", "vnc" ] [] +- | Some { s_display_type = Spice } -> +- e "graphics" [ "type", "spice" ] [] in ++ | Some { s_display_type = VNC; s_port = Some p } -> ++ e "graphics" [ "type", "vnc"; "port", string_of_int p ] [] ++ | Some { s_display_type = VNC; s_port = None } -> ++ e "graphics" [ "type", "vnc"; "autoport", "yes" ] [] ++ | Some { s_display_type = Spice; s_port = Some p } -> ++ e "graphics" [ "type", "spice"; "port", string_of_int p ] [] ++ | Some { s_display_type = Spice; s_port = None } -> ++ e "graphics" [ "type", "spice"; "autoport", "yes" ] [] in + + (match source.s_display with + | Some { s_keymap = Some km } -> append_attr ("keymap", km) graphics +@@ -469,13 +474,6 @@ let create_libvirt_xml ?pool source inspect + append_child sub graphics + ) + | None -> ()); +- (match source.s_display with +- | Some { s_port = Some p } -> +- append_attr ("autoport", "no") graphics; +- append_attr ("port", string_of_int p) graphics +- | Some { s_port = None } | None -> +- append_attr ("autoport", "yes") graphics; +- append_attr ("port", "-1") graphics); + List.push_back devices graphics; + + let sound = +diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml +index 2b6a8de0..e72c1db3 100644 +--- a/tests/test-v2v-i-ova.xml ++++ b/tests/test-v2v-i-ova.xml +@@ -41,7 +41,7 @@ + +- ++ + + /dev/urandom + +-- +2.31.1 + diff --git a/0005-output-o-libvirt-qemu-Use-correct-device-name-for-vs.patch b/0005-output-o-libvirt-qemu-Use-correct-device-name-for-vs.patch new file mode 100644 index 0000000..f79ef89 --- /dev/null +++ b/0005-output-o-libvirt-qemu-Use-correct-device-name-for-vs.patch @@ -0,0 +1,69 @@ +From 4f6b143c1cb32a29cbd3ff04635ba220e5db82ed Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 16:21:50 +0000 +Subject: [PATCH] output: -o libvirt, qemu: Use correct device name for vsock + +According to https://libvirt.org/formatdomain.html#vsock it's +not . There is also no model="none", we just omit it if not +present. + +According to https://wiki.qemu.org/Features/VirtioVsock the qemu +parameter is -device vhost-vsock-pci. + +Fixes: 05f780c16f0135c657615520c2245b42de1efc3e +Reviewed-by: Laszlo Ersek +--- + output/create_libvirt_xml.ml | 8 ++------ + output/output_qemu.ml | 4 +--- + tests/test-v2v-i-ova.xml | 1 - + 3 files changed, 3 insertions(+), 10 deletions(-) + +diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml +index 93ceb803..30c23973 100644 +--- a/output/create_libvirt_xml.ml ++++ b/output/create_libvirt_xml.ml +@@ -511,12 +511,8 @@ let create_libvirt_xml ?pool source inspect + e "address" ["type", "isa"; "iobase", "0x505"] [] + ] + ); +- List.push_back devices ( +- e "viosock" +- ["model", +- if guestcaps.gcaps_virtio_socket then virtio_model else "none"] +- [] +- ); ++ if guestcaps.gcaps_virtio_socket then ++ List.push_back devices (e "vsock" ["model", virtio_model] []); + + (* Standard devices added to every guest. *) + List.push_back_list devices [ +diff --git a/output/output_qemu.ml b/output/output_qemu.ml +index 3d5d6782..10ec8904 100644 +--- a/output/output_qemu.ml ++++ b/output/output_qemu.ml +@@ -277,9 +277,7 @@ and qemu_finalize dir source inspect target_meta + if guestcaps.gcaps_isa_pvpanic then + arg_list "-device" ["pvpanic"; "ioport=0x505"]; + if guestcaps.gcaps_virtio_socket then +- arg "-viosock" "virtio" +- else +- arg "-viosock" "none"; ++ arg "-device" "vhost-vsock-pci"; + + (* Add a serial console to Linux guests. *) + if inspect.i_type = "linux" then +diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml +index e72c1db3..1915dd40 100644 +--- a/tests/test-v2v-i-ova.xml ++++ b/tests/test-v2v-i-ova.xml +@@ -46,7 +46,6 @@ + /dev/urandom + + +- + + + +-- +2.31.1 + diff --git a/0006-tests-Drop-some-obsolete-Fedora-versions-start-testi.patch b/0006-tests-Drop-some-obsolete-Fedora-versions-start-testi.patch new file mode 100644 index 0000000..03ca77a --- /dev/null +++ b/0006-tests-Drop-some-obsolete-Fedora-versions-start-testi.patch @@ -0,0 +1,41 @@ +From 5b82ed259868c0a40733858606a2b6dd793b8504 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 16:10:34 +0000 +Subject: [PATCH] tests: Drop some obsolete Fedora versions, start testing F35 + +For very old Fedora versions, it's no longer possible to download the +packages (required by virt-builder --update). We get this error: + +Error: Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try again + +I also dropped Fedora 23 and 29. Although those can be updated, it's +not really worth testing long-obsolete versions of Fedora. More +useful is testing the long-term stable equivalents (ie. CentOS and +RHEL). + +I did however add the current version of Fedora (35) because it's +worth testing that current Fedora conversions work. + +Reviewed-by: Laszlo Ersek +--- + tests/Makefile.am | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 222b5872..b4d3a5b5 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -142,9 +142,7 @@ real_guests_scripts = \ + test-v2v-conversion-of-debian-7.sh \ + test-v2v-conversion-of-debian-8.sh \ + test-v2v-conversion-of-debian-9.sh \ +- test-v2v-conversion-of-fedora-20.sh \ +- test-v2v-conversion-of-fedora-23.sh \ +- test-v2v-conversion-of-fedora-29.sh \ ++ test-v2v-conversion-of-fedora-35.sh \ + test-v2v-conversion-of-opensuse-13.1.sh \ + test-v2v-conversion-of-opensuse-13.2.sh \ + test-v2v-conversion-of-opensuse-42.1.sh \ +-- +2.31.1 + diff --git a/0007-tests-Drop-test-of-centos-6.patch b/0007-tests-Drop-test-of-centos-6.patch new file mode 100644 index 0000000..9082154 --- /dev/null +++ b/0007-tests-Drop-test-of-centos-6.patch @@ -0,0 +1,37 @@ +From ea6a9a814ec737d543cca3920402a9fb69ba932d Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 17:07:25 +0000 +Subject: [PATCH] tests: Drop test of centos-6 + +The image cannot be updated, see error below. In any case we are +testing a RHEL 6 image so it is not really necessary to continue to +test CentOS 6. + +Loaded plugins: fastestmirror, security +Setting up Update Process +Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again +YumRepo Error: All mirror URLs are not using ftp, http[s] or file. + Eg. Invalid release/repo/arch combination/ +removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt +virt-builder: error: yum -y update: command exited with an error + +Reviewed-by: Laszlo Ersek +--- + tests/Makefile.am | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index b4d3a5b5..11c29676 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -136,7 +136,6 @@ check-root: + # try to convert. This is only used by 'make check-slow'. + + real_guests_scripts = \ +- test-v2v-conversion-of-centos-6.sh \ + test-v2v-conversion-of-centos-7.0.sh \ + test-v2v-conversion-of-debian-6.sh \ + test-v2v-conversion-of-debian-7.sh \ +-- +2.31.1 + diff --git a/0008-tests-Drop-ancient-Ubuntu-versions-add-Ubuntu-20.04-.patch b/0008-tests-Drop-ancient-Ubuntu-versions-add-Ubuntu-20.04-.patch new file mode 100644 index 0000000..7c382b7 --- /dev/null +++ b/0008-tests-Drop-ancient-Ubuntu-versions-add-Ubuntu-20.04-.patch @@ -0,0 +1,33 @@ +From 0b76aca004792263f31bcab38e4de19f645d3def Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 17:12:25 +0000 +Subject: [PATCH] tests: Drop ancient Ubuntu versions, add Ubuntu 20.04 LTS + +Ubuntu 14.04 failed in the --update command. These versions are out +of standard support (5 years) so drop them from testing. Add Ubuntu 20.04. + +Reviewed-by: Laszlo Ersek +--- + tests/Makefile.am | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 11c29676..3e828558 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -149,11 +149,9 @@ real_guests_scripts = \ + test-v2v-conversion-of-rhel-6.8.sh \ + test-v2v-conversion-of-rhel-7.0.sh \ + test-v2v-conversion-of-rhel-7.2.sh \ +- test-v2v-conversion-of-ubuntu-10.04.sh \ +- test-v2v-conversion-of-ubuntu-12.04.sh \ +- test-v2v-conversion-of-ubuntu-14.04.sh \ + test-v2v-conversion-of-ubuntu-16.04.sh \ + test-v2v-conversion-of-ubuntu-18.04.sh \ ++ test-v2v-conversion-of-ubuntu-20.04.sh \ + test-v2v-conversion-of-windows-6.2-server.sh \ + test-v2v-conversion-of-windows-6.3-server.sh \ + test-v2v-conversion-of-windows-10.0-server.sh +-- +2.31.1 + diff --git a/0009-tests-Drop-old-and-add-newer-RHEL-versions-to-the-te.patch b/0009-tests-Drop-old-and-add-newer-RHEL-versions-to-the-te.patch new file mode 100644 index 0000000..ed711f1 --- /dev/null +++ b/0009-tests-Drop-old-and-add-newer-RHEL-versions-to-the-te.patch @@ -0,0 +1,37 @@ +From c2702313af33be1c140c31a63213a5deaceccd3f Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 18:00:04 +0000 +Subject: [PATCH] tests: Drop old and add newer RHEL versions to the tests + +Let's try to test only the latest versions of RHEL that we have in the +internal (to Red Hat) virt-builder repository. + +Reviewed-by: Laszlo Ersek +[Laszlo reviewed an earlier version of this patch. I updated it with +a more consistent rationale and list of RHEL versions] +--- + tests/Makefile.am | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 3e828558..4b66cb0d 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -145,10 +145,10 @@ real_guests_scripts = \ + test-v2v-conversion-of-opensuse-13.1.sh \ + test-v2v-conversion-of-opensuse-13.2.sh \ + test-v2v-conversion-of-opensuse-42.1.sh \ +- test-v2v-conversion-of-rhel-5.10.sh \ +- test-v2v-conversion-of-rhel-6.8.sh \ +- test-v2v-conversion-of-rhel-7.0.sh \ +- test-v2v-conversion-of-rhel-7.2.sh \ ++ test-v2v-conversion-of-rhel-5.11.sh \ ++ test-v2v-conversion-of-rhel-6.10.sh \ ++ test-v2v-conversion-of-rhel-7.9.sh \ ++ test-v2v-conversion-of-rhel-8.4.sh \ + test-v2v-conversion-of-ubuntu-16.04.sh \ + test-v2v-conversion-of-ubuntu-18.04.sh \ + test-v2v-conversion-of-ubuntu-20.04.sh \ +-- +2.31.1 + diff --git a/0010-tests-Don-t-use-virt-builder-update-when-testing-Win.patch b/0010-tests-Don-t-use-virt-builder-update-when-testing-Win.patch new file mode 100644 index 0000000..e07bf23 --- /dev/null +++ b/0010-tests-Don-t-use-virt-builder-update-when-testing-Win.patch @@ -0,0 +1,52 @@ +From 0ec1a0ef2ec62fb97952d48cdddbdbd3bf8394a7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 17:10:56 +0000 +Subject: [PATCH] tests: Don't use virt-builder --update when testing Windows + conversions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The error was: + +virt-builder: error: cannot use ‘--update’ because no package manager +has been detected for this guest OS. + +If this guest OS is a common one with ordinary package management then this +may have been caused by a failure of libguestfs inspection. + +For OSes such as Windows that lack package management, this is not +possible. Try using one of the ‘--firstboot*’ flags instead (described +in the manual). + +Reviewed-by: Laszlo Ersek +--- + tests/test-v2v-conversion-of.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/tests/test-v2v-conversion-of.sh b/tests/test-v2v-conversion-of.sh +index 232c6300..5a974d1b 100755 +--- a/tests/test-v2v-conversion-of.sh ++++ b/tests/test-v2v-conversion-of.sh +@@ -61,8 +61,17 @@ case "$guestname" in + ;; + esac + ++# Don't try to update Windows versions. ++case "$guestname" in ++ windows*) ++ ;; ++ *) ++ extra[${#extra[*]}]='--update' ++ ;; ++esac ++ + # Build a guest (using virt-builder). +-virt-builder "$guestname" --quiet -o "$disk" "${extra[@]}" --update ++virt-builder "$guestname" --quiet -o "$disk" "${extra[@]}" + + # Create some minimal test metadata. + cat > "$xml" < +Date: Wed, 19 Jan 2022 18:21:47 +0000 +Subject: [PATCH] tests/test-v2v-trim.sh: Use -of qcow2 to preserve output + format + +Old virt-v2v used the same output format as input format when doing +disk to disk copies. Modular virt-v2v doesn't do this, it requires +using -of to set the output format to the same as the input format if +that is desired. + +Reviewed-by: Laszlo Ersek +--- + tests/test-v2v-trim.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test-v2v-trim.sh b/tests/test-v2v-trim.sh +index 8eab4792..ed6c031d 100755 +--- a/tests/test-v2v-trim.sh ++++ b/tests/test-v2v-trim.sh +@@ -66,7 +66,7 @@ fi + + virt-v2v --debug-gc \ + -i disk $d/fedora.qcow2 \ +- -o local -os $d ++ -o local -of qcow2 -os $d + + # Test the libvirt XML metadata and a disk was created. + test -f $d/fedora.xml +-- +2.31.1 + diff --git a/0012-lib-qemuNBD.ml-Use-qemu-nbd-shared-0-flag-to-allow-m.patch b/0012-lib-qemuNBD.ml-Use-qemu-nbd-shared-0-flag-to-allow-m.patch new file mode 100644 index 0000000..6e83f70 --- /dev/null +++ b/0012-lib-qemuNBD.ml-Use-qemu-nbd-shared-0-flag-to-allow-m.patch @@ -0,0 +1,41 @@ +From a6aa06d4999129f44ae84310e950b8c3a4620fe5 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 18:35:40 +0000 +Subject: [PATCH] lib/qemuNBD.ml: Use qemu-nbd --shared=0 flag to allow + multiple connections + +qemu-nbd --shared (-e) flag controls how many clients can connect +concurrently. 0 means unlimited. + +We want to allow the sockets to be queried by other processes while +virt-v2v is running and it should be safe to do this. The default +configuration of qemu-nbd doesn't allow this so add --shared=0. + +Note this does not (in current qemu) enable multi-conn because we +aren't using the -r (read-only) flag. + +Reviewed-by: Laszlo Ersek +--- + lib/qemuNBD.ml | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml +index 12d083ae..89c93d70 100644 +--- a/lib/qemuNBD.ml ++++ b/lib/qemuNBD.ml +@@ -90,7 +90,11 @@ let run_unix ?socket { disk; snapshot; format } = + (* Construct the qemu-nbd command line. *) + let args = ref [] in + List.push_back_list args +- ["qemu-nbd"; "-t"; "--pid-file"; pidfile; "--socket"; socket]; ++ ["qemu-nbd"; ++ "-t"; ++ "--shared=0"; ++ "--pid-file"; pidfile; ++ "--socket"; socket]; + + (* -s adds a protective overlay. *) + if snapshot then List.push_back args "-s"; +-- +2.31.1 + diff --git a/0013-lib-qemuNBD.ml-Use-qemu-nbd-discard-unmap.patch b/0013-lib-qemuNBD.ml-Use-qemu-nbd-discard-unmap.patch new file mode 100644 index 0000000..669218e --- /dev/null +++ b/0013-lib-qemuNBD.ml-Use-qemu-nbd-discard-unmap.patch @@ -0,0 +1,33 @@ +From 0d880dc288a10f29f6e52066514435c73af97be3 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 19 Jan 2022 18:54:11 +0000 +Subject: [PATCH] lib/qemuNBD.ml: Use qemu-nbd --discard=unmap + +The default for qemu-nbd is to ignore discard requests. This meant +that for input files in qcow2 format the "Mapping ..." (ie. fstrim) +step did nothing, all the work was ignored and we copied deleted data +over to the destination. + +This was detected by the test-v2v-trim.sh test. + +Fixes: commit 255722cbf39afc0b012e2ac00d16fa6ba2f8c21f +Reviewed-by: Laszlo Ersek +--- + lib/qemuNBD.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml +index 89c93d70..54139ce0 100644 +--- a/lib/qemuNBD.ml ++++ b/lib/qemuNBD.ml +@@ -93,6 +93,7 @@ let run_unix ?socket { disk; snapshot; format } = + ["qemu-nbd"; + "-t"; + "--shared=0"; ++ "--discard=unmap"; + "--pid-file"; pidfile; + "--socket"; socket]; + +-- +2.31.1 + diff --git a/0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch b/0014-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch similarity index 91% rename from 0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch rename to 0014-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch index dce82c0..db71365 100644 --- a/0003-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch +++ b/0014-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch @@ -1,4 +1,4 @@ -From 802cb1194c935d70194713491785537344fa816a Mon Sep 17 00:00:00 2001 +From 98136e9ac3544011a42c9f37b8b0903a99d8e2b3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 28 Sep 2014 19:14:43 +0100 Subject: [PATCH] RHEL: v2v: Select correct qemu binary for -o qemu mode @@ -16,7 +16,7 @@ support cases. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/output_qemu.ml b/output/output_qemu.ml -index 0aac1eba..c4265703 100644 +index 10ec8904..67f7cbcf 100644 --- a/output/output_qemu.ml +++ b/output/output_qemu.ml @@ -119,7 +119,7 @@ and qemu_finalize dir source inspect target_meta diff --git a/0004-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch b/0015-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch similarity index 96% rename from 0004-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch rename to 0015-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch index 094f262..e555c16 100644 --- a/0004-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch +++ b/0015-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch @@ -1,4 +1,4 @@ -From 2647de6f58908eb11ff5a156793fba2926a6cdd5 Mon Sep 17 00:00:00 2001 +From 6054ba787194dd2f80711181680fa5825006274d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Sep 2014 10:50:27 +0100 Subject: [PATCH] RHEL: v2v: Disable the --qemu-boot / -oo qemu-boot option @@ -81,7 +81,7 @@ index 3d0e00a3..04f3efd2 100644 =item B<--quiet> diff --git a/output/output_qemu.ml b/output/output_qemu.ml -index c4265703..822e4c72 100644 +index 67f7cbcf..376de27d 100644 --- a/output/output_qemu.ml +++ b/output/output_qemu.ml @@ -52,6 +52,9 @@ and qemu_parse_options options = @@ -95,7 +95,7 @@ index c4265703..822e4c72 100644 let output_storage = match options.output_storage with diff --git a/v2v/v2v.ml b/v2v/v2v.ml -index 47e6e937..503dfb55 100644 +index d74cc21f..a384bc05 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -277,8 +277,6 @@ let rec main () = diff --git a/0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch b/0016-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch similarity index 92% rename from 0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch rename to 0016-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch index 0edac9f..44ecfa1 100644 --- a/0005-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch +++ b/0016-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch @@ -1,4 +1,4 @@ -From f3ade6efd92f4bb6bf8f00af9b7f70dc4a3125f5 Mon Sep 17 00:00:00 2001 +From 9c7dfbd938c877d73a31d3c929615f5d084b69b1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 24 Apr 2015 09:45:41 -0400 Subject: [PATCH] RHEL: Fix list of supported sound cards to match RHEL qemu diff --git a/0006-RHEL-Fixes-for-libguestfs-winsupport.patch b/0017-RHEL-Fixes-for-libguestfs-winsupport.patch similarity index 98% rename from 0006-RHEL-Fixes-for-libguestfs-winsupport.patch rename to 0017-RHEL-Fixes-for-libguestfs-winsupport.patch index 3faff05..7eb6bcd 100644 --- a/0006-RHEL-Fixes-for-libguestfs-winsupport.patch +++ b/0017-RHEL-Fixes-for-libguestfs-winsupport.patch @@ -1,4 +1,4 @@ -From 952fea38a35476bc5c3b050380459ebe38006975 Mon Sep 17 00:00:00 2001 +From ca4a2bf5162b7a1f10c9648727e48cd5f5a054fb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 30 Aug 2015 03:21:57 -0400 Subject: [PATCH] RHEL: Fixes for libguestfs-winsupport. diff --git a/0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch b/0018-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch similarity index 89% rename from 0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch rename to 0018-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch index 616ecd2..ad6d09a 100644 --- a/0007-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch +++ b/0018-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch @@ -1,4 +1,4 @@ -From 2362280ee8e20806830c1c74d31faed728c8acc0 Mon Sep 17 00:00:00 2001 +From 84f507669b3bdbe45f07a780126bfe9618fd46b9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 2 Mar 2017 14:21:37 +0100 Subject: [PATCH] RHEL: v2v: -i disk: force VNC as display (RHBZ#1372671) @@ -9,7 +9,7 @@ The SDL output mode is not supported in RHEL's qemu-kvm. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/input_disk.ml b/input/input_disk.ml -index bcdaf78c..ba19f4b3 100644 +index 2b21950a..524a44bc 100644 --- a/input/input_disk.ml +++ b/input/input_disk.ml @@ -70,7 +70,7 @@ let rec disk_source dir options args = diff --git a/0008-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch b/0019-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch similarity index 91% rename from 0008-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch rename to 0019-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch index 8b0b2ff..48bb792 100644 --- a/0008-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch +++ b/0019-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch @@ -1,4 +1,4 @@ -From b06fd19cd5c8a1201c27ff70d9e7ae1849380091 Mon Sep 17 00:00:00 2001 +From 6492261edc9d238f18232f5a446741233a11a88d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 8 Mar 2017 11:03:40 +0100 Subject: [PATCH] RHEL: v2v: do not mention SUSE Xen hosts (RHBZ#1430203) diff --git a/0009-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch b/0020-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch similarity index 97% rename from 0009-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch rename to 0020-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch index 8c2d154..8f08e2f 100644 --- a/0009-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch +++ b/0020-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch @@ -1,4 +1,4 @@ -From f95371e7a61ae3ec8181cd330e36f13d41ad908f Mon Sep 17 00:00:00 2001 +From d7c1e5f4c842e3a32b62a8368cdf701c3586d1a4 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 26 Mar 2019 09:42:25 +0100 Subject: [PATCH] RHEL: point to KB for supported v2v hypervisors/guests diff --git a/0010-RHEL-Disable-o-glance.patch b/0021-RHEL-Disable-o-glance.patch similarity index 98% rename from 0010-RHEL-Disable-o-glance.patch rename to 0021-RHEL-Disable-o-glance.patch index bc4a87a..9ebc232 100644 --- a/0010-RHEL-Disable-o-glance.patch +++ b/0021-RHEL-Disable-o-glance.patch @@ -1,4 +1,4 @@ -From 194556661001b51a38a8807ae257e0c19161fe17 Mon Sep 17 00:00:00 2001 +From 5c74b51e6f7c731e38bad465ece91cc292363f9f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 30 Jun 2021 11:15:52 +0100 Subject: [PATCH] RHEL: Disable -o glance @@ -169,7 +169,7 @@ index c0db9115..074b5e16 100755 set -e set -x diff --git a/v2v/v2v.ml b/v2v/v2v.ml -index 503dfb55..39fef0fa 100644 +index a384bc05..0a69c8e5 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -205,7 +205,6 @@ let rec main () = diff --git a/0011-RHEL-Remove-the-in-place-option.patch b/0022-RHEL-Remove-the-in-place-option.patch similarity index 98% rename from 0011-RHEL-Remove-the-in-place-option.patch rename to 0022-RHEL-Remove-the-in-place-option.patch index 96f7ea1..b04a022 100644 --- a/0011-RHEL-Remove-the-in-place-option.patch +++ b/0022-RHEL-Remove-the-in-place-option.patch @@ -1,4 +1,4 @@ -From 1f53577af560347d1460ead3e7699f376c5853b8 Mon Sep 17 00:00:00 2001 +From fbdb4d5c9700a77cedaa2c015e7608b2f7dd113d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 2 Dec 2021 11:56:05 +0000 Subject: [PATCH] RHEL: Remove the --in-place option @@ -101,7 +101,7 @@ index 7c101513..4f89d2b2 100644 The I<--machine-readable> option can be used to make the output more diff --git a/v2v/v2v.ml b/v2v/v2v.ml -index 39fef0fa..a1143b68 100644 +index 0a69c8e5..1c74f01f 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -183,7 +183,6 @@ let rec main () = diff --git a/virt-v2v.spec b/virt-v2v.spec index 2ab9ff3..253a85b 100644 --- a/virt-v2v.spec +++ b/virt-v2v.spec @@ -15,7 +15,7 @@ Name: virt-v2v Epoch: 1 Version: 1.45.97 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Convert a virtual machine to run on KVM License: GPLv2+ @@ -53,15 +53,26 @@ ExclusiveArch: x86_64 # Patches. Patch0001: 0001-output-o-json-Allow-oo-output-options-to-work.patch Patch0002: 0002-input-xen-Fix-assertion-error-when-importing-from-re.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 +Patch0003: 0003-Restore-message-about-setting-up-the-input-and-outpu.patch +Patch0004: 0004-output-o-libvirt-Fix-graphics-element-port-autoport.patch +Patch0005: 0005-output-o-libvirt-qemu-Use-correct-device-name-for-vs.patch +Patch0006: 0006-tests-Drop-some-obsolete-Fedora-versions-start-testi.patch +Patch0007: 0007-tests-Drop-test-of-centos-6.patch +Patch0008: 0008-tests-Drop-ancient-Ubuntu-versions-add-Ubuntu-20.04-.patch +Patch0009: 0009-tests-Drop-old-and-add-newer-RHEL-versions-to-the-te.patch +Patch0010: 0010-tests-Don-t-use-virt-builder-update-when-testing-Win.patch +Patch0011: 0011-tests-test-v2v-trim.sh-Use-of-qcow2-to-preserve-outp.patch +Patch0012: 0012-lib-qemuNBD.ml-Use-qemu-nbd-shared-0-flag-to-allow-m.patch +Patch0013: 0013-lib-qemuNBD.ml-Use-qemu-nbd-discard-unmap.patch +Patch0014: 0014-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch +Patch0015: 0015-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch +Patch0016: 0016-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch +Patch0017: 0017-RHEL-Fixes-for-libguestfs-winsupport.patch +Patch0018: 0018-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch +Patch0019: 0019-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch +Patch0020: 0020-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch +Patch0021: 0021-RHEL-Disable-o-glance.patch +Patch0022: 0022-RHEL-Remove-the-in-place-option.patch %endif %if 0%{patches_touch_autotools} @@ -79,7 +90,7 @@ BuildRequires: bash-completion BuildRequires: file-devel BuildRequires: gettext-devel BuildRequires: jansson-devel -BuildRequires: libnbd-devel +BuildRequires: libnbd-devel >= 1.10.3 BuildRequires: libosinfo-devel BuildRequires: libvirt-daemon-kvm BuildRequires: libvirt-devel @@ -302,7 +313,7 @@ popd %changelog -* Mon Jan 17 2022 Richard W.M. Jones - 1:1.45.97-1 +* Mon Jan 17 2022 Richard W.M. Jones - 1:1.45.97-2 - Rebase to upstream 1.45.97. resolves: rhbz#2011713 - Add virtio-transitional for older guests when converting to q35 @@ -313,6 +324,8 @@ popd resolves: rhbz#2041852 - output: -o json: Allow -oo (output options) to work resolves: rhbz#2041850 +- Fix virt-v2v hang when given incorrect vpx:// URL + resolves: rhbz#2041886 * Thu Dec 23 2021 Laszlo Ersek - 1:1.45.95-3 - output_rhv: restrict block status collection to the old RHV output