Rebase to upstream 1.45.98.

Add check for sufficient free space in the host
resolves: rhbz#2051394
Update documentation of -ip for conversions from VMware over HTTPS
related: rhbz#1960087
-o rhv-upload: Keep connections alive (2032324)
-o rhv-upload: Improve conversion performance (2039255)
This commit is contained in:
Richard W.M. Jones 2022-02-10 19:50:35 +00:00
parent 4b8820ac0b
commit 991b284375
34 changed files with 52 additions and 2316 deletions

View File

@ -1,4 +1,4 @@
From 98136e9ac3544011a42c9f37b8b0903a99d8e2b3 Mon Sep 17 00:00:00 2001
From c35ce051106e727244e006647a5a0285fda822ae 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
@ -29,5 +29,5 @@ index 10ec8904..67f7cbcf 100644
let flag = Qemuopts.flag cmd
and arg = Qemuopts.arg cmd
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,31 +0,0 @@
From cdde7864f65c7c3cf3400b978a52ade727402e17 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 18 Jan 2022 12:21:05 +0000
Subject: [PATCH] output: -o json: Allow -oo (output options) to work
Because of an incorrect error message added during modularisation it
was not possible to use the -o json -oo output options. Remove the
bogus error message.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2041850
Reported-by: Xiaodai Wang
---
output/output_json.ml | 2 --
1 file changed, 2 deletions(-)
diff --git a/output/output_json.ml b/output/output_json.ml
index 770eb8ca..bb0cdfeb 100644
--- a/output/output_json.ml
+++ b/output/output_json.ml
@@ -135,8 +135,6 @@ module Json = struct
type t = unit
let setup dir options source =
- if options.output_options <> [] then
- error (f_"no -oo (output options) are allowed here");
let data = json_parse_options options in
let output_name = get_output_name options source in
let disks = get_disks dir in
--
2.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From 6054ba787194dd2f80711181680fa5825006274d Mon Sep 17 00:00:00 2001
From 635fe323354faf2d3eb790c4fe8caddfd7422e7b 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
@ -44,7 +44,7 @@ index a5f155cb..3a2e6238 100644
=item B<-o json -os> C<DIRECTORY>
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
index 3d0e00a3..04f3efd2 100644
index 615c6eff..41417856 100644
--- a/docs/virt-v2v.pod
+++ b/docs/virt-v2v.pod
@@ -141,11 +141,6 @@ Since F<guest-domain.xml> contains the path(s) to the guest disk
@ -95,7 +95,7 @@ index 67f7cbcf..376de27d 100644
let output_storage =
match options.output_storage with
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index d74cc21f..a384bc05 100644
index f18f5680..fea69545 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -277,8 +277,6 @@ let rec main () =
@ -108,5 +108,5 @@ index d74cc21f..a384bc05 100644
s_"How to choose root filesystem";
[ L"vddk-config" ], Getopt.String ("filename", set_input_option_compat "vddk-config"),
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,100 +0,0 @@
From f3180e3c0ef59ab52983903ff806014a4a3171a5 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 18 Jan 2022 12:37:51 +0000
Subject: [PATCH] input: xen: Fix assertion error when importing from remote
block device
We never supported this because OpenSSH sftp server does not know how
to open and get the size of a block device. Before modular virt-v2v,
we would detect this situation and print an error:
virt-v2v: error: guest disk sda appears to be zero bytes in size.
There could be several reasons for this:
Check that the guest doesn't really have a zero-sized disk. virt-v2v
cannot convert such a guest.
If you are converting a guest from an ssh source and the guest has a disk
on a block device (eg. on a host partition or host LVM LV), then
conversions of this type are not supported. See the virt-v2v-input-xen(1)
manual for a workaround.
This error was lost in the conversion to modularity, but in any case
the proper way to detect this is in the input_xen driver itself.
In addition to this, when we removed the old virt-v2v-copy-to-local
tool, the text referring to the workaround in the manual became
meaningless, so I added the (ugly, manual) workaround that you have to
do back into the manual, minus the bit about the tool that we removed.
In future we could consider other ways to convert a remote block
device over SSH transparently. (Sending a "dd" command, maybe?)
I also checked what happens when we try to convert an empty disk, and
it fails during inspection with a reasonable error message, so we
don't need to do anything to restore the above error:
$ virt-v2v -i disk /var/tmp/empty -o null
[ 1.1] Opening the source
[ 7.0] Inspecting the source
virt-v2v: error: inspection could not detect the source guest (or physical
machine).
Assuming that you are running virt-v2v/virt-p2v on a source which is
supported (and not, for example, a blank disk), then this should not
happen.
No root device found in this operating system image.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2041852
Reported-by: Xiaodai Wang
---
docs/virt-v2v-input-xen.pod | 5 +++++
input/input_xen_ssh.ml | 12 +++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/docs/virt-v2v-input-xen.pod b/docs/virt-v2v-input-xen.pod
index 857a7095..c4948e5e 100644
--- a/docs/virt-v2v-input-xen.pod
+++ b/docs/virt-v2v-input-xen.pod
@@ -99,6 +99,11 @@ This happens because the qemu ssh block driver that we use to access
remote disks uses the ssh sftp protocol, and this protocol cannot
correctly detect the size of host block devices.
+The workaround is to copy the block device from the remote Xen
+server to a regular local file, copy the libvirt guest XML,
+adjust the C<disk> element to point to the local file, and use
+C<-i libvirtxml> mode instead.
+
=head1 SEE ALSO
L<virt-v2v(1)>.
diff --git a/input/input_xen_ssh.ml b/input/input_xen_ssh.ml
index 5bb46bde..cb8b1f91 100644
--- a/input/input_xen_ssh.ml
+++ b/input/input_xen_ssh.ml
@@ -87,9 +87,19 @@ let rec xen_ssh_source dir options args =
On_exit.unlink socket;
match d_type with
- | BlockDev _ | NBD _ | HTTP _ -> (* These should never happen? *)
+ | NBD _ | HTTP _ -> (* These should never happen? *)
assert false
+ | BlockDev _ ->
+ (* Conversion from a remote block device over SSH isn't
+ * supported because OpenSSH sftp server doesn't know how
+ * to get the size of a block device. Therefore we disallow
+ * this and refer users to the manual.
+ *)
+ error (f_"input from xen over ssh does not support disks stored on \
+ remote block devices. See virt-v2v-input-xen(1) \
+ section \"Xen or ssh conversions from block devices\".")
+
| LocalFile path ->
let cor = dir // "convert" in
let bandwidth = options.bandwidth in
--
2.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From 9c7dfbd938c877d73a31d3c929615f5d084b69b1 Mon Sep 17 00:00:00 2001
From f066cbf7f6ad2f7e3c48b079a062d90e5d699567 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
@ -30,5 +30,5 @@ index 4c8998c2..7b16dd8b 100644
(* Find the UEFI firmware. *)
let find_uefi_firmware guest_arch =
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,549 +0,0 @@
From 924aa8b70a64e9b076f8f56328a2b49650ab713c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From ca4a2bf5162b7a1f10c9648727e48cd5f5a054fb Mon Sep 17 00:00:00 2001
From f92a657fe3889af3ab1f1abaa62de9ed3ee9d5aa 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.
@ -26,7 +26,7 @@ index f78e87ef..d61d7fb4 100644
(* Setting the number of vCPUs allows parallel mkinitrd, but make
* sure this is not too large because each vCPU consumes guest RAM.
diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
index 1c5c148e..b3a35a0a 100644
index 5254322c..301f7544 100644
--- a/convert/windows_virtio.ml
+++ b/convert/windows_virtio.ml
@@ -283,6 +283,7 @@ and copy_from_virtio_win g inspect srcdir destdir filter missing =
@ -100,5 +100,5 @@ index a4cf191d..1ff41f6a 100755
# We also update the Registry several times, for firstboot, and (ONLY
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,78 +0,0 @@
From 4c3d0b8b3b4b99ac613b612f05e0810d64381999 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 19 Jan 2022 16:16:55 +0000
Subject: [PATCH] output: -o libvirt: Fix <graphics/> 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 <lersek@redhat.com>
---
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 @@
<video>
<model type='vga' vram='16384' heads='1'/>
</video>
- <graphics type='vnc' autoport='yes' port='-1'/>
+ <graphics type='vnc' autoport='yes'/>
<rng model='virtio-transitional'>
<backend model='random'>/dev/urandom</backend>
</rng>
--
2.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From 84f507669b3bdbe45f07a780126bfe9618fd46b9 Mon Sep 17 00:00:00 2001
From 8711440e202048a9d7dfc471e33966ca98cd426e 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)
@ -22,5 +22,5 @@ index 2b21950a..524a44bc 100644
s_sound = None;
s_disks = s_disks;
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,69 +0,0 @@
From 4f6b143c1cb32a29cbd3ff04635ba220e5db82ed Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <vsock/>
not <viosock/>. 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 <lersek@redhat.com>
---
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 @@
<backend model='random'>/dev/urandom</backend>
</rng>
<memballoon model='virtio-transitional'/>
- <viosock model='none'/>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<console type='pty'/>
--
2.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From 6492261edc9d238f18232f5a446741233a11a88d Mon Sep 17 00:00:00 2001
From 9144b6272f14e149efb2fe2d8792ef91f94d3d14 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)
@ -22,5 +22,5 @@ index c4948e5e..97727b8f 100644
=head1 INPUT FROM XEN
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,41 +0,0 @@
From 5b82ed259868c0a40733858606a2b6dd793b8504 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From d7c1e5f4c842e3a32b62a8368cdf701c3586d1a4 Mon Sep 17 00:00:00 2001
From b14e17c2cfbf5bcb8880cf5972612bcac46e52f7 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
@ -123,5 +123,5 @@ index 9815f51f..1ffc0f9d 100644
=head2 Guest firmware
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,37 +0,0 @@
From ea6a9a814ec737d543cca3920402a9fb69ba932d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From 5c74b51e6f7c731e38bad465ece91cc292363f9f Mon Sep 17 00:00:00 2001
From 415b9b0bff55a349145027349ab7c9b421696154 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
@ -100,7 +100,7 @@ index f5a3abad..1ab356e8 100644
=head1 AUTHOR
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
index 04f3efd2..7c101513 100644
index 41417856..c7def4f7 100644
--- a/docs/virt-v2v.pod
+++ b/docs/virt-v2v.pod
@@ -432,14 +432,6 @@ See L</Networks and bridges> below.
@ -118,7 +118,7 @@ index 04f3efd2..7c101513 100644
=item B<-o> B<json>
Set the output method to I<json>.
@@ -1162,11 +1154,6 @@ and output methods may use disk space, as outlined in the table below.
@@ -1167,11 +1159,6 @@ and output methods may use disk space, as outlined in the table below.
This temporarily places a full copy of the uncompressed source disks
in C<$VIRT_V2V_TMPDIR> (or F</var/tmp>).
@ -130,7 +130,7 @@ index 04f3efd2..7c101513 100644
=item I<-o local>
=item I<-o qemu>
@@ -1351,13 +1338,6 @@ instance.
@@ -1355,13 +1342,6 @@ instance.
Because of how Cinder volumes are presented as F</dev> block devices,
using I<-o openstack> normally requires that virt-v2v is run as root.
@ -169,7 +169,7 @@ index c0db9115..074b5e16 100755
set -e
set -x
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index a384bc05..0a69c8e5 100644
index fea69545..a1c7a7c7 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -205,7 +205,6 @@ let rec main () =
@ -215,5 +215,5 @@ index a384bc05..0a69c8e5 100644
| `RHV_Upload -> (module Output_rhv_upload.RHVUpload)
| `RHV -> (module Output_rhv.RHV)
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,33 +0,0 @@
From 0b76aca004792263f31bcab38e4de19f645d3def Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,4 +1,4 @@
From fbdb4d5c9700a77cedaa2c015e7608b2f7dd113d Mon Sep 17 00:00:00 2001
From 3eb3474d4f2b94cffd593995cdadc8d4e559b54f 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
@ -6,12 +6,12 @@ Subject: [PATCH] RHEL: Remove the --in-place option
This disables the virt-v2v --in-place option which we do not
wish to support in RHEL.
---
docs/virt-v2v.pod | 51 +----------------------------------------------
docs/virt-v2v.pod | 49 -----------------------------------------------
v2v/v2v.ml | 8 --------
2 files changed, 1 insertion(+), 58 deletions(-)
2 files changed, 57 deletions(-)
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
index 7c101513..4f89d2b2 100644
index c7def4f7..942e5991 100644
--- a/docs/virt-v2v.pod
+++ b/docs/virt-v2v.pod
@@ -8,10 +8,6 @@ virt-v2v - Convert a guest to use KVM
@ -59,16 +59,7 @@ index 7c101513..4f89d2b2 100644
=item B<-io> OPTION=VALUE
Set input option(s) related to the current input mode or transport.
@@ -1278,7 +1254,7 @@ have at least 100 available inodes.
=head3 Minimum free space check in the host
You must have sufficient free space in the host directory used to
-store large temporary overlays (except in I<--in-place> mode). To
+store large temporary overlays. To
find out which directory this is, use:
$ df -h "`guestfish get-cachedir`"
@@ -1410,31 +1386,6 @@ that instead.
@@ -1414,31 +1390,6 @@ that instead.
</devices>
</domain>
@ -101,7 +92,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 0a69c8e5..1c74f01f 100644
index a1c7a7c7..44ba6fae 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -183,7 +183,6 @@ let rec main () =
@ -148,5 +139,5 @@ index 0a69c8e5..1c74f01f 100644
pr "mac-option\n";
pr "bandwidth-option\n";
--
2.19.1.3.g30247aa5d201
2.31.1

View File

@ -1,37 +0,0 @@
From c2702313af33be1c140c31a63213a5deaceccd3f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
[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.19.1.3.g30247aa5d201

View File

@ -1,52 +0,0 @@
From 0ec1a0ef2ec62fb97952d48cdddbdbd3bf8394a7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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" <<EOF
--
2.19.1.3.g30247aa5d201

View File

@ -1,32 +0,0 @@
From 26361e035043ecec5b24d53f59978438a52e634d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,41 +0,0 @@
From a6aa06d4999129f44ae84310e950b8c3a4620fe5 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,33 +0,0 @@
From 0d880dc288a10f29f6e52066514435c73af97be3 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 <lersek@redhat.com>
---
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.19.1.3.g30247aa5d201

View File

@ -1,45 +0,0 @@
From 2a3b0da09e3a89eb9a6c84fd6015367ba3022e24 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 25 Jan 2022 10:06:37 +0000
Subject: [PATCH] input: libvirt: Share a single connection to the source NBD
server
When using virt-p2v from RHEL 7, it starts a very old qemu-nbd server
(probably 1.5.3) which required the --shared parameter to enable
sharing even in read-only mode. Since it doesn't pass this parameter
only a single connection at a time is allowed, and further connections
will deadlock. Note that later versions of qemu-nbd changed this so
that read-only connections permit sharing automatically.
In modular virt-v2v we now use nbdkit-nbd-plugin to proxy the
connection to virt-p2v / qemu-nbd. When you connect to this multiple
times, as virt-v2v does, it will make multiple connections to the
backend qemu-nbd. This will cause a deadlock.
We can use the nbdkit-nbd-plugin shared=true flag to enable the plugin
to share a single connection to the backend between multiple nbdkit
clients.
Reported-by: Tingting Zheng
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2044911
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 20019b5cadc1434ac09842e2045a7d5635561835)
---
input/input_libvirt.ml | 1 +
1 file changed, 1 insertion(+)
diff --git a/input/input_libvirt.ml b/input/input_libvirt.ml
index 33f61086..42050c15 100644
--- a/input/input_libvirt.ml
+++ b/input/input_libvirt.ml
@@ -76,6 +76,7 @@ and libvirt_servers dir disks =
Nbdkit.add_filter cmd "cow";
Nbdkit.add_arg cmd "hostname" hostname;
Nbdkit.add_arg cmd "port" (string_of_int port);
+ Nbdkit.add_arg cmd "shared" "true";
let _, pid = Nbdkit.run_unix ~socket cmd in
(* --exit-with-parent should ensure nbdkit is cleaned
--
2.19.1.3.g30247aa5d201

View File

@ -1,52 +0,0 @@
From aef0dcabe2257c234e1acb745f016b61824af014 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 25 Jan 2022 10:39:49 +0000
Subject: [PATCH] v2v: Send nbdinfo debug information to stderr not stdout
When running in verbose mode (virt-v2v -vx) debug messages are
supposed to only be written to stderr. This allows virt-p2v and other
wrappers to separate ordinary progress messages and warnings, from
debugging information.
However when we added nbdinfo output (only printed in verbose mode),
the output was wrongly sent to stdout instead of stderr. You can show
this as follows:
$ virt-v2v -vx -i disk /var/tmp/fedora-35.qcow2 -o null 2>/dev/null
[ 0.0] Setting up the source: -i disk /var/tmp/fedora-35.qcow2
[ 1.0] Opening the source
... some messages elided ...
protocol: newstyle-fixed without TLS <-- debug output to stdout
export="":
export-size: 6442450944 (6G)
content: DOS/MBR boot sector
uri: nbd+unix:///?socket=/tmp/v2v.Xqvaml/in0
... etc ...
This patch sends the nbdinfo debugging output to stderr instead.
Reported-by: Tingting Zheng
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2044922
Fixes: commit 255722cbf39afc0b012e2ac00d16fa6ba2f8c21f
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 68af35d48ca845133ede948d36ee351d171e3de8)
---
v2v/v2v.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 1c74f01f..92546940 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -616,7 +616,7 @@ and nbdcopy output_alloc input_uri output_uri =
*)
and nbdinfo ?(content = false) uri =
let cmd =
- sprintf "nbdinfo%s %s"
+ sprintf "nbdinfo%s %s >&2"
(if content then " --content" else " --no-content") (quote uri) in
ignore (Sys.command cmd)
--
2.19.1.3.g30247aa5d201

View File

@ -1,112 +0,0 @@
From 0210e940c9bd7bbfda9654feea13cb3baccb1a00 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 1 Feb 2022 09:54:06 +0000
Subject: [PATCH] input: Require -ip password for vCenter over HTTPS
As far as I've ever seen, you always need a password to access the
/folder directory of a VMware server. If the password isn't specified
to virt-v2v using the -ip option then it used to try to ask for it
interactively when virt-v2v started. Actually it asked for the
password several times -- at least twice.
After we added the cookie-script feature (commit 2b9a11743b "v2v:
vcenter: Implement cookie scripts.") it tries to ask interactively at
random points during the conversion, which is obviously bad from a UI
point of view but also because the password is requested without a
prompt looks like a hang.
We could solve this by prompting for a password. But virt-v2v is not
primarily an interactive tool and it's an easier fix is to require the
caller to use the -ip passwordfile option (in this particular mode).
Reported-by: Xinyu Li
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1960087
(cherry picked from commit 8abc07a8589a48c79cc65159640e0d8ab3c9b261)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
docs/virt-v2v-input-vmware.pod | 12 ++++++++++++
input/input_vcenter_https.ml | 12 +++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/docs/virt-v2v-input-vmware.pod b/docs/virt-v2v-input-vmware.pod
index d0a3f742..584eba38 100644
--- a/docs/virt-v2v-input-vmware.pod
+++ b/docs/virt-v2v-input-vmware.pod
@@ -24,6 +24,7 @@ virt-v2v-input-vmware - Using virt-v2v to convert guests from VMware
virt-v2v
-ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1'
+ -ip passwordfile
"GUEST NAME" [-o* options]
=head1 DESCRIPTION
@@ -389,6 +390,9 @@ will need to URI-escape that character using C<%5c>: C<DOMAIN%5cUSER>
(5c is the hexadecimal ASCII code for backslash.) Other punctuation
may also have to be escaped.
+The user's password must be supplied in a local file using the
+separate I<-ip> parameter.
+
=item C<server>
is the vCenter Server (I<not> hypervisor).
@@ -472,11 +476,19 @@ B<If the above commands do not work, then virt-v2v is not going to
work either>. Fix your libvirt configuration and/or your VMware
vCenter Server before continuing.
+=head2 vCenter: Supplying the password
+
+The vCenter password (usually for the root account, or the account
+specified by C<user@> in the vpx URL) has to be written to a local
+file, and the name of that file specified on the virt-v2v command line
+using I<-ip passwordfile>.
+
=head2 vCenter: Importing a guest
To import a particular guest from vCenter Server, do:
$ virt-v2v -ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1' \
+ -ip passwordfile \
"Windows 2003" \
-o local -os /var/tmp
diff --git a/input/input_vcenter_https.ml b/input/input_vcenter_https.ml
index bcefed16..fd5b4017 100644
--- a/input/input_vcenter_https.ml
+++ b/input/input_vcenter_https.ml
@@ -53,6 +53,13 @@ let rec vcenter_https_source dir options args =
| _ ->
error (f_"-i libvirt: expecting a libvirt guest name on the command line") in
+ (* -ip is required in this mode, see RHBZ#1960087 *)
+ let password_file =
+ match options.input_password with
+ | Some file -> file
+ | None ->
+ error (f_"-i libvirt: expecting -ip passwordfile parameter for vCenter connection") in
+
(* -ic must be set and it must contain a server. This is
* enforced by virt-v2v.
*)
@@ -76,8 +83,7 @@ let rec vcenter_https_source dir options args =
(* Connect to the hypervisor. *)
let conn =
- let auth = Libvirt_utils.auth_for_password_file
- ?password_file:options.input_password () in
+ let auth = Libvirt_utils.auth_for_password_file ~password_file () in
Libvirt.Connect.connect_auth ~name:input_conn auth in
(* Parse the libvirt XML. *)
@@ -109,7 +115,7 @@ let rec vcenter_https_source dir options args =
let cor = dir // "convert" in
let pid = VCenter.start_nbdkit_for_path
?bandwidth:options.bandwidth
- ~cor ?password_file:options.input_password
+ ~cor ~password_file
dcPath uri server path socket in
On_exit.kill pid
) disks;
--
2.19.1.3.g30247aa5d201

View File

@ -1,131 +0,0 @@
From 887d374cc3a910db9794e12f2b13bd6c2a43d036 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:13 +0100
Subject: [PATCH] convert/windows_virtio: fix copy_from_libosinfo <->
VIRTIO_WIN priority
Commit 258e4b718d5d introduced the "copy_from_libosinfo" branch in
"copy_drivers" with higher priority than the existent
"copy_from_virtio_win".
This introduced a conflict with the documentation ("docs/virt-v2v.pod").
The documentation stated (and still states) that the VIRTIO_WIN env var,
when set, dictates where virt-v2v look for the virtio-win drivers. The
conflict is that, even in case we set VIRTIO_WIN, virt-v2v still consults
libosinfo first.
Skip the "copy_from_libosinfo" branch in case VIRTIO_WIN is set, plus
explain in the documentation that VIRTIO_WIN, when set, overrides
libosinfo.
NOTE: the necessity of this fix is made apparent by the next patch in the
series. Namely, "copy_from_libosinfo" has a bug in the architecture
filter. Once we fix that bug in the next patch, *and* install (e.g.)
"virtio-win-1.9.24-4.el8.noarch" on the conversion host, the "i-ova" test
case will suddenly prefer the virtio drivers exposed via libosinfo, in
spite of the "tests/test-v2v-i-ova.sh" script explicitly setting
VIRTIO_WIN to "test-data/fake-virtio-win". The symptom is that the pvpanic
device will be enabled in the domain XML, due to it being supported by the
actual (not fake) virtio-win drivers.
Fixes: 258e4b718d5d80c79634fe864c8c52b12e41777c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20220201123219.9317-2-lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
(cherry picked from commit be39049582fbd167c92062a4e63d10f13474aea0)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/windows_virtio.ml | 12 ++++++------
docs/virt-v2v.pod | 24 +++++++++++++++++-------
2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
index b3a35a0a..46e6350a 100644
--- a/convert/windows_virtio.ml
+++ b/convert/windows_virtio.ml
@@ -29,14 +29,14 @@ open Utils
module G = Guestfs
-let virtio_win =
- try Sys.getenv "VIRTIO_WIN"
+let virtio_win, virtio_win_from_env =
+ try Sys.getenv "VIRTIO_WIN", true
with Not_found ->
- try Sys.getenv "VIRTIO_WIN_DIR" (* old name for VIRTIO_WIN *)
+ try Sys.getenv "VIRTIO_WIN_DIR" (* old name for VIRTIO_WIN *), true
with Not_found ->
let iso = Config.datadir // "virtio-win" // "virtio-win.iso" in
- if Sys.file_exists iso then iso
- else Config.datadir // "virtio-win"
+ (if Sys.file_exists iso then iso
+ else Config.datadir // "virtio-win"), false
let scsi_class_guid = "{4D36E97B-E325-11CE-BFC1-08002BE10318}"
let viostor_legacy_pciid = "VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00"
@@ -228,7 +228,7 @@ and ddb_regedits inspect drv_name drv_pciid =
* been copied.
*)
and copy_drivers g inspect driverdir =
- [] <> copy_from_libosinfo g inspect driverdir ||
+ (not virtio_win_from_env && [] <> copy_from_libosinfo g inspect driverdir) ||
[] <> copy_from_virtio_win g inspect "/" driverdir
virtio_iso_path_matches_guest_os
(fun () ->
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
index 4f89d2b2..2836b509 100644
--- a/docs/virt-v2v.pod
+++ b/docs/virt-v2v.pod
@@ -875,7 +875,12 @@ below.
Ubuntu 10.04+ All versions support virtio
Windows Drivers are installed from the ISO or directory pointed
- to by "VIRTIO_WIN" environment variable if present
+ to by the "VIRTIO_WIN" environment variable if present.
+ If the "VIRTIO_WIN" environment variable is absent
+ (which is the recommended setting), then libosinfo is
+ consulted first, for driver files that are locally
+ available on the conversion host.
+
=head2 RHEL 4: SELinux relabel appears to hang forever
@@ -1514,15 +1519,20 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests.
=item C<VIRTIO_WIN>
-This is where virtio drivers for Windows are searched for. It can be
-a directory I<or> point to F<virtio-win.iso> (CD ROM image containing
-drivers).
+This is an override for where virtio drivers for Windows are searched
+for. It can be a directory I<or> point to F<virtio-win.iso> (CD ROM
+image containing drivers).
-If unset, then we look for drivers in whichever of these paths
-is found first:
+If unset, then we look for drivers via whichever of these methods
+succeeds first:
=over 4
+=item C<osinfo-db>
+
+Load osinfo data from the default paths, and attempt to find drivers via
+libosinfo lookup. This is the preferred method.
+
=item F</usr/share/virtio-win/virtio-win.iso>
The ISO containing virtio drivers for Windows.
@@ -1530,7 +1540,7 @@ The ISO containing virtio drivers for Windows.
=item F</usr/share/virtio-win>
The exploded tree of virtio drivers for Windows. This is
-usually incomplete, hence the ISO is preferred.
+usually incomplete, hence the least preferred method.
=back
--
2.19.1.3.g30247aa5d201

View File

@ -1,60 +0,0 @@
From 5f32e9ac9f501ce9bcae3ddcc8fa8ea8a1e873e0 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:14 +0100
Subject: [PATCH] convert/windows_virtio: map 32-bit arch name from libguestfs
to osinfo
For Windows guests, the "inspect.i_arch" field is ultimately determined in
libguestfs, on the following call path:
inspect_os [daemon/inspect.ml]
check_for_filesystem_on [daemon/inspect_fs.ml]
check_filesystem [daemon/inspect_fs.ml]
check_windows_root [daemon/inspect_fs_windows.ml]
check_windows_arch [daemon/inspect_fs_windows.ml]
file_architecture [daemon/filearch.ml]
file_architecture_of_magic [daemon/filearch.ml]
where the last function maps "PE32 executable" to "i386".
(As of libguestfs commit 5858c2cf6c24.)
However, in osinfo-db (as of commit 72c69622e6db), the
"data/schema/osinfo.rng.in" schema calls the same architecture "i686".
Perform this mapping in the "copy_from_libosinfo" function explicitly: the
filter currently throws away all "i686" drivers from libosinfo because
they don't match "i386" from libguestfs.
(There is no such problem with "x86_64".)
Fixes: 258e4b718d5d80c79634fe864c8c52b12e41777c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220201123219.9317-3-lersek@redhat.com>
(cherry picked from commit 70d77100eee2c341359bcd76962478419d1f0548)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/windows_virtio.ml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
index 46e6350a..1d8b0cb0 100644
--- a/convert/windows_virtio.ml
+++ b/convert/windows_virtio.ml
@@ -416,6 +416,11 @@ and copy_from_libosinfo g inspect destdir =
)
in
let { i_osinfo = osinfo; i_arch = arch } = inspect in
+ (* The architecture that "inspect.i_arch" from libguestfs
+ * ("daemon/filearch.ml") calls "i386", the osinfo-db schema
+ * ("data/schema/osinfo.rng.in") calls "i686".
+ *)
+ let arch = if arch = "i386" then "i686" else arch in
try
let os = Libosinfo_utils.get_os_by_short_id osinfo in
let drivers = os#get_device_drivers () in
--
2.19.1.3.g30247aa5d201

View File

@ -1,176 +0,0 @@
From b6bfcce0340b2c602b42df8fceff68be83db3fe9 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:15 +0100
Subject: [PATCH] convert/libosinfo: factor out
v2v_osinfo_device_list_to_value_list()
Move the guts of v2v_osinfo_os_get_all_devices() to a new static function
called v2v_osinfo_device_list_to_value_list().
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220201123219.9317-4-lersek@redhat.com>
(cherry picked from commit 9045c87d3a6f43a4063f6b52d05c6dcf7e051319)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/libosinfo-c.c | 126 +++++++++++++++++++++++-------------------
1 file changed, 68 insertions(+), 58 deletions(-)
diff --git a/convert/libosinfo-c.c b/convert/libosinfo-c.c
index ec7c06d3..bc5816f6 100644
--- a/convert/libosinfo-c.c
+++ b/convert/libosinfo-c.c
@@ -210,59 +210,6 @@ glist_to_value_list (GList *list)
CAMLreturn (rv);
}
-value
-v2v_osinfo_os_get_device_drivers (value osv)
-{
- CAMLparam1 (osv);
- CAMLlocal4 (rv, v, vi, copyv);
- OsinfoDeviceDriverList *list;
- gint i, len;
-
- list = osinfo_os_get_device_drivers (OsinfoOs_t_val (osv));
- len = osinfo_list_get_length (OSINFO_LIST(list));
-
- rv = Val_emptylist;
- for (i = len - 1; i >= 0; --i) {
- OsinfoDeviceDriver *driver;
- const gchar *str;
- gboolean b;
- GList *l;
- gint64 i64;
-
- driver = OSINFO_DEVICE_DRIVER(osinfo_list_get_nth (OSINFO_LIST(list), i));
-
- vi = caml_alloc (6, 0);
- str = osinfo_device_driver_get_architecture (driver);
- copyv = caml_copy_string (str);
- Store_field (vi, 0, copyv);
- str = osinfo_device_driver_get_location (driver);
- copyv = caml_copy_string (str);
- Store_field (vi, 1, copyv);
- b = osinfo_device_driver_get_pre_installable (driver);
- Store_field (vi, 2, Val_bool (b));
- b = osinfo_device_driver_get_signed (driver);
- Store_field (vi, 3, Val_bool (b));
-#if IS_LIBOSINFO_VERSION(1, 7, 0)
- i64 = osinfo_device_driver_get_priority (driver);
-#else
- /* Same as OSINFO_DEVICE_DRIVER_DEFAULT_PRIORITY in libosinfo 1.7.0+. */
- i64 = 50;
-#endif
- copyv = caml_copy_int64 (i64);
- Store_field (vi, 4, copyv);
- l = osinfo_device_driver_get_files (driver);
- Store_field (vi, 5, glist_to_value_list (l));
- g_list_free (l);
-
- v = caml_alloc (2, 0);
- Store_field (v, 0, vi);
- Store_field (v, 1, rv);
- rv = v;
- }
-
- CAMLreturn (rv);
-}
-
/* Collect OsinfoDevice properties from two levels:
*
* - The OSINFO_ENTITY_PROP_ID property, originating from the OsinfoEntity base
@@ -288,17 +235,15 @@ static const char * const device_prop[] = {
};
#define NUM_DEVICE_PROPS (sizeof device_prop / sizeof device_prop[0])
-value
-v2v_osinfo_os_get_all_devices (value osv)
+static value
+v2v_osinfo_device_list_to_value_list (OsinfoDeviceList *dev_list)
{
- CAMLparam1 (osv);
+ CAMLparam0 ();
CAMLlocal4 (retvalv, linkv, propsv, copyv);
- g_autoptr (OsinfoDeviceList) dev_list = NULL;
OsinfoList *ent_list;
gint ent_nr;
retvalv = Val_emptylist;
- dev_list = osinfo_os_get_all_devices (OsinfoOs_t_val (osv), NULL);
ent_list = OSINFO_LIST (dev_list);
ent_nr = osinfo_list_get_length (ent_list);
@@ -328,3 +273,68 @@ v2v_osinfo_os_get_all_devices (value osv)
CAMLreturn (retvalv);
}
+
+value
+v2v_osinfo_os_get_device_drivers (value osv)
+{
+ CAMLparam1 (osv);
+ CAMLlocal4 (rv, v, vi, copyv);
+ OsinfoDeviceDriverList *list;
+ gint i, len;
+
+ list = osinfo_os_get_device_drivers (OsinfoOs_t_val (osv));
+ len = osinfo_list_get_length (OSINFO_LIST(list));
+
+ rv = Val_emptylist;
+ for (i = len - 1; i >= 0; --i) {
+ OsinfoDeviceDriver *driver;
+ const gchar *str;
+ gboolean b;
+ GList *l;
+ gint64 i64;
+
+ driver = OSINFO_DEVICE_DRIVER(osinfo_list_get_nth (OSINFO_LIST(list), i));
+
+ vi = caml_alloc (6, 0);
+ str = osinfo_device_driver_get_architecture (driver);
+ copyv = caml_copy_string (str);
+ Store_field (vi, 0, copyv);
+ str = osinfo_device_driver_get_location (driver);
+ copyv = caml_copy_string (str);
+ Store_field (vi, 1, copyv);
+ b = osinfo_device_driver_get_pre_installable (driver);
+ Store_field (vi, 2, Val_bool (b));
+ b = osinfo_device_driver_get_signed (driver);
+ Store_field (vi, 3, Val_bool (b));
+#if IS_LIBOSINFO_VERSION(1, 7, 0)
+ i64 = osinfo_device_driver_get_priority (driver);
+#else
+ /* Same as OSINFO_DEVICE_DRIVER_DEFAULT_PRIORITY in libosinfo 1.7.0+. */
+ i64 = 50;
+#endif
+ copyv = caml_copy_int64 (i64);
+ Store_field (vi, 4, copyv);
+ l = osinfo_device_driver_get_files (driver);
+ Store_field (vi, 5, glist_to_value_list (l));
+ g_list_free (l);
+
+ v = caml_alloc (2, 0);
+ Store_field (v, 0, vi);
+ Store_field (v, 1, rv);
+ rv = v;
+ }
+
+ CAMLreturn (rv);
+}
+
+value
+v2v_osinfo_os_get_all_devices (value osv)
+{
+ CAMLparam1 (osv);
+ CAMLlocal1 (retvalv);
+ g_autoptr (OsinfoDeviceList) dev_list = NULL;
+
+ dev_list = osinfo_os_get_all_devices (OsinfoOs_t_val (osv), NULL);
+ retvalv = v2v_osinfo_device_list_to_value_list (dev_list);
+ CAMLreturn (retvalv);
+}
--
2.19.1.3.g30247aa5d201

View File

@ -1,130 +0,0 @@
From a90a23fe48225775bef65829b83c14b3c940d093 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:16 +0100
Subject: [PATCH] convert/libosinfo: retrieve the device list for
OsinfoDeviceDriver
The OsinfoDeviceDriver class supports the
osinfo_device_driver_get_devices() method, we've just had no use for that
thus far.
Using the previously extracted v2v_osinfo_device_list_to_value_list()
function, we can now relatively easily OCaml-ify the list of devices that
a driver supports. (We'll use this functionality in a subsequent patch.)
(Notably, osinfo_device_driver_get_devices() is marked "transfer none",
unlike osinfo_os_get_all_devices(), which is marked "transfer full".)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220201123219.9317-5-lersek@redhat.com>
(cherry picked from commit 27816bd952b609b45e98670fe538b621f3d254e4)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/libosinfo-c.c | 6 ++++++
convert/libosinfo.ml | 19 ++++++++++---------
convert/libosinfo.mli | 19 ++++++++++---------
3 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/convert/libosinfo-c.c b/convert/libosinfo-c.c
index bc5816f6..93357fd9 100644
--- a/convert/libosinfo-c.c
+++ b/convert/libosinfo-c.c
@@ -292,6 +292,7 @@ v2v_osinfo_os_get_device_drivers (value osv)
gboolean b;
GList *l;
gint64 i64;
+ OsinfoDeviceList *dev_list;
driver = OSINFO_DEVICE_DRIVER(osinfo_list_get_nth (OSINFO_LIST(list), i));
@@ -317,6 +318,11 @@ v2v_osinfo_os_get_device_drivers (value osv)
l = osinfo_device_driver_get_files (driver);
Store_field (vi, 5, glist_to_value_list (l));
g_list_free (l);
+ dev_list = osinfo_device_driver_get_devices (driver);
+ v = (dev_list == NULL) ?
+ Val_emptylist :
+ v2v_osinfo_device_list_to_value_list (dev_list);
+ Store_field (vi, 6, v);
v = caml_alloc (2, 0);
Store_field (v, 0, vi);
diff --git a/convert/libosinfo.ml b/convert/libosinfo.ml
index 78271be2..8ea0a279 100644
--- a/convert/libosinfo.ml
+++ b/convert/libosinfo.ml
@@ -23,15 +23,6 @@ open Common_gettext.Gettext
type osinfo_db_t
type osinfo_os_t
-type osinfo_device_driver = {
- architecture : string;
- location : string;
- pre_installable : bool;
- signed : bool;
- priority : int64;
- files : string list;
-}
-
type osinfo_device = {
id : string;
vendor : string;
@@ -44,6 +35,16 @@ type osinfo_device = {
subsystem : string;
}
+type osinfo_device_driver = {
+ architecture : string;
+ location : string;
+ pre_installable : bool;
+ signed : bool;
+ priority : int64;
+ files : string list;
+ devices : osinfo_device list;
+}
+
external osinfo_os_get_id : osinfo_os_t -> string = "v2v_osinfo_os_get_id"
external osinfo_os_get_device_drivers : osinfo_os_t -> osinfo_device_driver list = "v2v_osinfo_os_get_device_drivers"
external osinfo_os_get_devices : osinfo_os_t -> osinfo_device list = "v2v_osinfo_os_get_all_devices"
diff --git a/convert/libosinfo.mli b/convert/libosinfo.mli
index 1ece7b41..aa436370 100644
--- a/convert/libosinfo.mli
+++ b/convert/libosinfo.mli
@@ -20,15 +20,6 @@
type osinfo_os_t
-type osinfo_device_driver = {
- architecture : string;
- location : string;
- pre_installable : bool;
- signed : bool;
- priority : int64;
- files : string list;
-}
-
type osinfo_device = {
id : string;
vendor : string;
@@ -41,6 +32,16 @@ type osinfo_device = {
subsystem : string;
}
+type osinfo_device_driver = {
+ architecture : string;
+ location : string;
+ pre_installable : bool;
+ signed : bool;
+ priority : int64;
+ files : string list;
+ devices : osinfo_device list;
+}
+
class osinfo_os : osinfo_os_t -> object
method get_id : unit -> string
(** Return the ID. *)
--
2.19.1.3.g30247aa5d201

View File

@ -1,96 +0,0 @@
From 61a0a01b1f6166bb03e04ef7dcb23f0559ea08fe Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:17 +0100
Subject: [PATCH] convert/libosinfo_utils: debug-log the devices supported by a
driver
While at it, put each file of a driver "pack" on a separate line, and
print "Driver:", "Files:" and "Devices:" headers as well.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220201123219.9317-6-lersek@redhat.com>
(cherry picked from commit 32e3d19e9fe437e957591fa3b18ec981053e9196)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/libosinfo_utils.ml | 21 +++++++++++----------
convert/libosinfo_utils.mli | 6 +++---
convert/windows_virtio.ml | 2 +-
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/convert/libosinfo_utils.ml b/convert/libosinfo_utils.ml
index 77f22272..f0d70ffd 100644
--- a/convert/libosinfo_utils.ml
+++ b/convert/libosinfo_utils.ml
@@ -33,16 +33,6 @@ let get_os_by_short_id os =
debug "libosinfo: loaded OS: %s" (os#get_id ());
os
-let string_of_osinfo_device_driver { Libosinfo.architecture; location;
- pre_installable; signed; priority;
- files } =
- Printf.sprintf "%s: [%s, %s, %s, priority %Ld] %s"
- location architecture
- (if pre_installable then "pre-installable" else "not pre-installable")
- (if signed then "signed" else "unsigned")
- priority
- (String.concat " " files)
-
let string_of_osinfo_device_list dev_list =
(* Turn the fields of an "osinfo_device" record into a list. *)
@@ -78,6 +68,17 @@ let string_of_osinfo_device_list dev_list =
String.concat "\n"
(List.map (fun dev -> columnate (listify dev) max_widths) dev_list)
+let string_of_osinfo_device_driver { Libosinfo.architecture; location;
+ pre_installable; signed; priority;
+ files; devices } =
+ Printf.sprintf "%s: [%s, %s, %s, priority %Ld]\nFiles:\n%s\nDevices:\n%s"
+ location architecture
+ (if pre_installable then "pre-installable" else "not pre-installable")
+ (if signed then "signed" else "unsigned")
+ priority
+ (String.concat "\n" files)
+ (string_of_osinfo_device_list devices)
+
type os_support = {
q35 : bool;
vio10 : bool;
diff --git a/convert/libosinfo_utils.mli b/convert/libosinfo_utils.mli
index ab77ec97..67be16c4 100644
--- a/convert/libosinfo_utils.mli
+++ b/convert/libosinfo_utils.mli
@@ -25,12 +25,12 @@ val get_os_by_short_id : string -> Libosinfo.osinfo_os
Raise [Not_found] in case there is no matching OS.
*)
-val string_of_osinfo_device_driver : Libosinfo.osinfo_device_driver -> string
-(** Convert a [osinfo_device_driver] to a printable string for debugging. *)
-
val string_of_osinfo_device_list : Libosinfo.osinfo_device list -> string
(** Convert an [osinfo_device] list to a printable string for debugging. *)
+val string_of_osinfo_device_driver : Libosinfo.osinfo_device_driver -> string
+(** Convert a [osinfo_device_driver] to a printable string for debugging. *)
+
type os_support = {
q35 : bool;
vio10 : bool;
diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
index 1d8b0cb0..3e542631 100644
--- a/convert/windows_virtio.ml
+++ b/convert/windows_virtio.ml
@@ -412,7 +412,7 @@ and copy_from_libosinfo g inspect destdir =
let debug_drivers =
List.iter (
fun d ->
- debug "\t%s" (Libosinfo_utils.string_of_osinfo_device_driver d)
+ debug "Driver: %s" (Libosinfo_utils.string_of_osinfo_device_driver d)
)
in
let { i_osinfo = osinfo; i_arch = arch } = inspect in
--
2.19.1.3.g30247aa5d201

View File

@ -1,154 +0,0 @@
From 9725e53665bc64858ce3dd17aa1e365a3bb6e9da Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:18 +0100
Subject: [PATCH] convert/libosinfo_utils: extract "best_driver" from
"windows_virtio.ml"
The "copy_from_libosinfo" function in "windows_virtio.ml" filters and
sorts the driver list from libosinfo in order to find the best driver.
Move this logic to a separate function (called "best_driver") in the
Libosinfo_utils module.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220201123219.9317-7-lersek@redhat.com>
(cherry picked from commit 42c4bf8ea222d50cf562e9e49568a70fb2d05bca)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/libosinfo_utils.ml | 35 +++++++++++++++++++++++++++++
convert/libosinfo_utils.mli | 12 ++++++++++
convert/windows_virtio.ml | 44 +------------------------------------
3 files changed, 48 insertions(+), 43 deletions(-)
diff --git a/convert/libosinfo_utils.ml b/convert/libosinfo_utils.ml
index f0d70ffd..8504e2b2 100644
--- a/convert/libosinfo_utils.ml
+++ b/convert/libosinfo_utils.ml
@@ -79,6 +79,41 @@ let string_of_osinfo_device_driver { Libosinfo.architecture; location;
(String.concat "\n" files)
(string_of_osinfo_device_list devices)
+let best_driver drivers arch =
+ let debug_drivers =
+ List.iter (fun d -> debug "Driver: %s" (string_of_osinfo_device_driver d))
+ (* The architecture that "inspect.i_arch" from libguestfs
+ * ("daemon/filearch.ml") calls "i386", the osinfo-db schema
+ * ("data/schema/osinfo.rng.in") calls "i686".
+ *)
+ and arch = if arch = "i386" then "i686" else arch in
+ debug "libosinfo drivers before filtering:";
+ debug_drivers drivers;
+ let drivers =
+ List.filter (
+ fun { Libosinfo.architecture; location; pre_installable } ->
+ if architecture <> arch || not pre_installable then
+ false
+ else
+ try
+ (match Xml.parse_uri location with
+ | { Xml.uri_scheme = Some scheme;
+ Xml.uri_path = Some _ } when scheme = "file" -> true
+ | _ -> false
+ )
+ with Invalid_argument _ -> false
+ ) drivers in
+ debug "libosinfo drivers after filtering:";
+ debug_drivers drivers;
+ let drivers =
+ List.sort (
+ fun { Libosinfo.priority = prioA } { Libosinfo.priority = prioB } ->
+ compare prioB prioA
+ ) drivers in
+ if drivers = [] then
+ raise Not_found;
+ List.hd drivers
+
type os_support = {
q35 : bool;
vio10 : bool;
diff --git a/convert/libosinfo_utils.mli b/convert/libosinfo_utils.mli
index 67be16c4..14991bc2 100644
--- a/convert/libosinfo_utils.mli
+++ b/convert/libosinfo_utils.mli
@@ -31,6 +31,18 @@ val string_of_osinfo_device_list : Libosinfo.osinfo_device list -> string
val string_of_osinfo_device_driver : Libosinfo.osinfo_device_driver -> string
(** Convert a [osinfo_device_driver] to a printable string for debugging. *)
+val best_driver : Libosinfo.osinfo_device_driver list ->
+ string ->
+ Libosinfo.osinfo_device_driver
+(** [best_driver drivers arch] picks the best driver from [drivers] as follows:
+ - filters out drivers that:
+ - target a different architecture,
+ - are not pre-installable,
+ - have an invalid or non-local URL;
+ - sorts the remaining drivers by priority, like libosinfo does;
+ - picks the top driver of the sorted list.
+ Raises Not_found if no driver in [drivers] survives filtering. *)
+
type os_support = {
q35 : bool;
vio10 : bool;
diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
index 3e542631..301f7544 100644
--- a/convert/windows_virtio.ml
+++ b/convert/windows_virtio.ml
@@ -409,53 +409,11 @@ and virtio_iso_path_matches_qemu_ga path inspect =
* Returns list of copied files.
*)
and copy_from_libosinfo g inspect destdir =
- let debug_drivers =
- List.iter (
- fun d ->
- debug "Driver: %s" (Libosinfo_utils.string_of_osinfo_device_driver d)
- )
- in
let { i_osinfo = osinfo; i_arch = arch } = inspect in
- (* The architecture that "inspect.i_arch" from libguestfs
- * ("daemon/filearch.ml") calls "i386", the osinfo-db schema
- * ("data/schema/osinfo.rng.in") calls "i686".
- *)
- let arch = if arch = "i386" then "i686" else arch in
try
let os = Libosinfo_utils.get_os_by_short_id osinfo in
let drivers = os#get_device_drivers () in
- debug "libosinfo drivers before filtering:"; debug_drivers drivers;
- (*
- * Filter out drivers that we cannot use:
- * - for a different architecture
- * - non-pre-installable ones
- * - location is an invalid URL, or a non-local one
- *)
- let drivers =
- List.filter (
- fun { Libosinfo.architecture; location; pre_installable } ->
- if architecture <> arch || not pre_installable then
- false
- else
- try
- (match Xml.parse_uri location with
- | { Xml.uri_scheme = Some scheme;
- Xml.uri_path = Some _ } when scheme = "file" -> true
- | _ -> false
- )
- with Invalid_argument _ -> false
- ) drivers in
- debug "libosinfo drivers after filtering:"; debug_drivers drivers;
- (* Sort the drivers by priority, like libosinfo does. *)
- let drivers =
- List.sort (
- fun { Libosinfo.priority = prioA } { Libosinfo.priority = prioB } ->
- compare prioB prioA
- ) drivers in
- (* Any driver available? *)
- if drivers = [] then
- raise Not_found;
- let driver = List.hd drivers in
+ let driver = Libosinfo_utils.best_driver drivers arch in
let uri = Xml.parse_uri driver.Libosinfo.location in
let basedir =
match uri.Xml.uri_path with
--
2.19.1.3.g30247aa5d201

View File

@ -1,152 +0,0 @@
From 728dab8031b59bb3fd5f8e53786b05df51d35311 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 1 Feb 2022 13:32:19 +0100
Subject: [PATCH] convert/convert_windows: consult "best driver"'s dev list for
virtio-1.0
Life would be too simple if we could just call osinfo_os_get_all_devices()
for determining virtio-1.0 support for Windows guests. Now that we've
extracted the libosinfo logic that identifies the "best" virtio driver
(for copying its files into the guest), fetch the list of devices
supported by the same "best driver" as well. Use that list, in addition to
the one from osinfo_os_get_all_devices(), for determining (Q35 and)
virtio-1.0 support.
Thankfully this mess is not needed when converting Linux guests.
With this, we need to revert the data for three Windows-based test cases
to their pre-f0cea012d018 status (modulo intermediary commits 4f6b143c1cb3
("output: -o libvirt, qemu: Use correct device name for vsock",
2022-01-20) and 4c3d0b8b3b4b ("output: -o libvirt: Fix <graphics/> element
port/autoport", 2022-01-20)). The reason is that those tests all set the
VIRTIO_WIN environment variable, in which case we simply assume
"virtio_1_0 = true" on the fallback ("Not_found" exception) branch.
Fixes: f0cea012d0183edf6f7b769c28d5038593f3fe6a
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2043333
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20220201123219.9317-8-lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
(cherry picked from commit cacedec64072609c5203437a378aea2ab9a0e659)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
convert/convert_windows.ml | 26 +++++++++++++++++++++++---
convert/windows_virtio.mli | 6 +++++-
tests/test-v2v-cdrom.expected | 2 +-
tests/test-v2v-floppy.expected | 2 +-
tests/test-v2v-i-ova.xml | 8 ++++----
5 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml
index 1c2d17f2..7bdcaf52 100644
--- a/convert/convert_windows.ml
+++ b/convert/convert_windows.ml
@@ -242,12 +242,32 @@ let convert (g : G.guestfs) _ inspect _ static_ips =
match inspect.i_arch with
| ("i386"|"x86_64") ->
(try
+ (* Fall back to the decision that's based on the year that the OS
+ * was released in under three circumstances:
+ * - the user specified the location of the Windows virtio drivers
+ * through an environment variable, or
+ * - "Libosinfo_utils.get_os_by_short_id" fails to look up the OS,
+ * or
+ * - "Libosinfo_utils.best_driver" cannot find any matching driver.
+ * In each of these cases, a "Not_found" exception is raised. This
+ * behavior exactly mirrors that of "Windows_virtio.copy_drivers".
+ *)
+ if Windows_virtio.virtio_win_from_env then
+ raise Not_found;
let os = Libosinfo_utils.get_os_by_short_id inspect.i_osinfo in
- let devices = os#get_devices () in
- debug "libosinfo devices for OS \"%s\":\n%s" inspect.i_osinfo
+ let devices = os#get_devices ()
+ and drivers = os#get_device_drivers () in
+ let best_drv_devs =
+ (Libosinfo_utils.best_driver drivers inspect.i_arch).devices in
+ debug "libosinfo internal devices for OS \"%s\":\n%s"
+ inspect.i_osinfo
(Libosinfo_utils.string_of_osinfo_device_list devices);
+ debug "libosinfo \"best driver\" devices for OS \"%s\":\n%s"
+ inspect.i_osinfo
+ (Libosinfo_utils.string_of_osinfo_device_list best_drv_devs);
let { Libosinfo_utils.q35; vio10 } =
- Libosinfo_utils.os_support_of_osinfo_device_list devices in
+ Libosinfo_utils.os_support_of_osinfo_device_list
+ (devices @ best_drv_devs) in
(if q35 then Q35 else I440FX), vio10
with
| Not_found ->
diff --git a/convert/windows_virtio.mli b/convert/windows_virtio.mli
index 53603d24..a92cc01d 100644
--- a/convert/windows_virtio.mli
+++ b/convert/windows_virtio.mli
@@ -16,7 +16,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*)
-(** Functions for installing Windows virtio drivers. *)
+(** Values and functions for installing Windows virtio drivers. *)
+
+val virtio_win_from_env : bool
+(** [virtio_win_from_env] is true iff at least one of the VIRTIO_WIN and
+ VIRTIO_WIN_DIR variables is present in the environment. *)
val install_drivers
: Registry.t -> Types.inspect ->
diff --git a/tests/test-v2v-cdrom.expected b/tests/test-v2v-cdrom.expected
index b9504929..17bd152d 100644
--- a/tests/test-v2v-cdrom.expected
+++ b/tests/test-v2v-cdrom.expected
@@ -1,4 +1,4 @@
- <disk type='file' device='disk' model='virtio-transitional'>
+ <disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<target dev='vda' bus='virtio'/>
</disk>
diff --git a/tests/test-v2v-floppy.expected b/tests/test-v2v-floppy.expected
index f4b67954..a718c21f 100644
--- a/tests/test-v2v-floppy.expected
+++ b/tests/test-v2v-floppy.expected
@@ -1,4 +1,4 @@
- <disk type='file' device='disk' model='virtio-transitional'>
+ <disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<target dev='vda' bus='virtio'/>
</disk>
diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml
index 1915dd40..6b8cda62 100644
--- a/tests/test-v2v-i-ova.xml
+++ b/tests/test-v2v-i-ova.xml
@@ -21,7 +21,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <disk type='file' device='disk' model='virtio-transitional'>
+ <disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='TestOva-sda'/>
<target dev='vda' bus='virtio'/>
@@ -36,16 +36,16 @@
</disk>
<interface type='bridge'>
<source bridge='VM Network'/>
- <model type='virtio-transitional'/>
+ <model type='virtio'/>
</interface>
<video>
<model type='vga' vram='16384' heads='1'/>
</video>
<graphics type='vnc' autoport='yes'/>
- <rng model='virtio-transitional'>
+ <rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
</rng>
- <memballoon model='virtio-transitional'/>
+ <memballoon model='virtio'/>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<console type='pty'/>
--
2.19.1.3.g30247aa5d201

View File

@ -1,2 +1,2 @@
SHA512 (virt-v2v-1.45.97.tar.gz) = 9f3725099237e705142fe9563f73d34362771f2cb82af7fd976462f25a9301ec97cbecb5cd70a22903f6df16ab45354619a19e5369e29c86a58f19151664356a
SHA512 (virt-v2v-1.45.97.tar.gz.sig) = 6bc57719d5acbe8ccc895280bf3f585b31a1d87cc927d98f1f7a8a169634a69ca0787265d10e55616c0bcb430f63e8c39a41e65b439bc0ff2e90439c2f003ccd
SHA512 (virt-v2v-1.45.98.tar.gz) = a709ae109675064b0b96f8fa7e9d2ef37d9f557f1aa9d8f9152bb15a814e5539af4d5569b44a10229dbf7e62ff4d6f6361f71393ac6a614e3d737548ee131746
SHA512 (virt-v2v-1.45.98.tar.gz.sig) = 1e98fb61bcdfcf2f8b9a3ab3b39d2b2dee73cdd40a43aefb97fe4671afa121373f7d8ba111e6a39a001e50901508341fed76ed0bd313df3991c81f1ead2868f2

View File

@ -14,8 +14,8 @@
Name: virt-v2v
Epoch: 1
Version: 1.45.97
Release: 4%{?dist}
Version: 1.45.98
Release: 1%{?dist}
Summary: Convert a virtual machine to run on KVM
License: GPLv2+
@ -51,38 +51,15 @@ ExclusiveArch: x86_64
# Downstream (RHEL-only) patches.
%if 0%{?rhel}
# Patches.
Patch0001: 0001-output-o-json-Allow-oo-output-options-to-work.patch
Patch0002: 0002-input-xen-Fix-assertion-error-when-importing-from-remote-block-device.patch
Patch0003: 0003-Restore-message-about-setting-up-the-input-and-output.patch
Patch0004: 0004-output-o-libvirt-Fix-graphics-element-port-autoport.patch
Patch0005: 0005-output-o-libvirt-qemu-Use-correct-device-name-for-vsock.patch
Patch0006: 0006-tests-Drop-some-obsolete-Fedora-versions-start-testing-F35.patch
Patch0007: 0007-tests-Drop-test-of-centos-6.patch
Patch0008: 0008-tests-Drop-ancient-Ubuntu-versions-add-Ubuntu-20.04-LTS.patch
Patch0009: 0009-tests-Drop-old-and-add-newer-RHEL-versions-to-the-tests.patch
Patch0010: 0010-tests-Don-t-use-virt-builder-update-when-testing-Windows-conversions.patch
Patch0011: 0011-tests-test-v2v-trim.sh-Use-of-qcow2-to-preserve-output-format.patch
Patch0012: 0012-lib-qemuNBD.ml-Use-qemu-nbd-shared-0-flag-to-allow-multiple-connections.patch
Patch0013: 0013-lib-qemuNBD.ml-Use-qemu-nbd-discard-unmap.patch
Patch0014: 0014-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-RHBZ-1147313.patch
Patch0015: 0015-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-RHBZ-1147313.patch
Patch0016: 0016-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL-qemu-RHBZ-1176493.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-guests.patch
Patch0021: 0021-RHEL-Disable-o-glance.patch
Patch0022: 0022-RHEL-Remove-the-in-place-option.patch
Patch0023: 0023-input-libvirt-Share-a-single-connection-to-the-source-NBD-server.patch
Patch0024: 0024-v2v-Send-nbdinfo-debug-information-to-stderr-not-stdout.patch
Patch0025: 0025-input-Require-ip-password-for-vCenter-over-HTTPS.patch
Patch0026: 0026-convert-windows_virtio-fix-copy_from_libosinfo-VIRTIO_WIN-priority.patch
Patch0027: 0027-convert-windows_virtio-map-32-bit-arch-name-from-libguestfs-to-osinfo.patch
Patch0028: 0028-convert-libosinfo-factor-out-v2v_osinfo_device_list_to_value_list.patch
Patch0029: 0029-convert-libosinfo-retrieve-the-device-list-for-OsinfoDeviceDriver.patch
Patch0030: 0030-convert-libosinfo_utils-debug-log-the-devices-supported-by-a-driver.patch
Patch0031: 0031-convert-libosinfo_utils-extract-best_driver-from-windows_virtio.ml.patch
Patch0032: 0032-convert-convert_windows-consult-best-driver-s-dev-list-for-virtio-1.0.patch
Patch0001: 0001-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch
Patch0002: 0002-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch
Patch0003: 0003-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch
Patch0004: 0004-RHEL-Fixes-for-libguestfs-winsupport.patch
Patch0005: 0005-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
Patch0006: 0006-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch
Patch0007: 0007-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
Patch0008: 0008-RHEL-Disable-o-glance.patch
Patch0009: 0009-RHEL-Remove-the-in-place-option.patch
%endif
%if 0%{patches_touch_autotools}
@ -324,6 +301,15 @@ popd
%changelog
* Thu Feb 10 2022 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.98-1
- Rebase to upstream 1.45.98.
- Add check for sufficient free space in the host
resolves: rhbz#2051394
- Update documentation of -ip for conversions from VMware over HTTPS
related: rhbz#1960087
- -o rhv-upload: Keep connections alive (2032324)
- -o rhv-upload: Improve conversion performance (2039255)
* Wed Feb 2 2022 Laszlo Ersek <lersek@redhat.com> - 1:1.45.97-4
- v2v import from vCenter fails when using interactive password because
cookie-script tries to be interactive