import virt-v2v-1.42.0-18.module+el8.6.0+13447+4b5d0856
This commit is contained in:
parent
260e9577f7
commit
7195ef6b59
@ -37,5 +37,5 @@ index 7df17b29..4d0b8639 100644
|
||||
let get_domain conn name =
|
||||
let dom =
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -210,5 +210,5 @@ index 120a52f7..3cbca9d7 100644
|
||||
-val input_libvirt_xen_ssh : Libvirt.rw Libvirt.Connect.t Lazy.t -> string option -> Xml.uri -> string -> string -> Types.input
|
||||
+val input_libvirt_xen_ssh : Libvirt.rw Libvirt.Connect.t Lazy.t -> string -> string option -> Xml.uri -> string -> string -> Types.input
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -30,5 +30,5 @@ index c28a4ced..4c128b0c 100644
|
||||
let headers =
|
||||
List.map (
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -93,5 +93,5 @@ index 05553c4f..5a1fba0f 100644
|
||||
(match pool with
|
||||
| None ->
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -47,5 +47,5 @@ index 979c3773..402dfd0e 100644
|
||||
)
|
||||
else cmd, [] in
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -45,5 +45,5 @@ index 402dfd0e..bfda91a7 100644
|
||||
(* Caching extents speeds up qemu-img, especially its consecutive
|
||||
* block_status requests with req_one=1.
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -112,5 +112,5 @@ index bfda91a7..47832011 100644
|
||||
let run cmd =
|
||||
let sock, _ = Nbdkit.run_unix cmd in
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -53,5 +53,5 @@ index 47832011..f5e91911 100644
|
||||
Nbdkit.add_arg cmd "password" ("+" ^ password_file) in
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -40,5 +40,5 @@ index 1ab6bb4d..497840c2 100644
|
||||
typedef OsinfoDb *OsinfoDb_t;
|
||||
typedef OsinfoOs *OsinfoOs_t;
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -56,5 +56,5 @@ index a00fa8af..74934eb4 100644
|
||||
=item B<--mac> aa:bb:cc:dd:ee:ffB<:network:>out
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -22,5 +22,5 @@ index 03c5339..8379039 100644
|
||||
+If there are multiple encrypted devices then you may need to supply
|
||||
+multiple keys on stdin, one per line.
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -122,5 +122,5 @@ index 249137ab..3b74f307 100644
|
||||
|
||||
let no_trim_warning _ =
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -29,5 +29,5 @@ index 4d0b8639..1a24b049 100644
|
||||
function
|
||||
| { Libvirt.Connect.typ = Libvirt.Connect.CredentialPassphrase } -> password
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -29,5 +29,5 @@ index be3a3c5e..85d08265 100644
|
||||
let flag = Qemuopts.flag cmd
|
||||
and arg = Qemuopts.arg cmd
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -101,5 +101,5 @@ index 3b74f307..df69e2e0 100644
|
||||
output_format, output_alloc
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -30,5 +30,5 @@ index ccbb9d68..c2940582 100644
|
||||
(* Find the UEFI firmware. *)
|
||||
let find_uefi_firmware guest_arch =
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -75,5 +75,5 @@ index f1da222a..ff94fe39 100755
|
||||
|
||||
# We also update the Registry several times, for firstboot, and (ONLY
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -282,5 +282,5 @@ index df69e2e0..7b79d462 100644
|
||||
let error_option_cannot_be_used_in_output_mode mode opt =
|
||||
error (f_"-o %s: %s option cannot be used in this output mode") mode opt
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -22,5 +22,5 @@ index d146e84c..4e403003 100644
|
||||
s_video = None;
|
||||
s_sound = None;
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -22,5 +22,5 @@ index 3b3cf0f0..32da2848 100644
|
||||
=head1 INPUT FROM XEN
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -85,5 +85,5 @@ index d3e6260e..471102da 100644
|
||||
types.StorageDomain(
|
||||
name=params['output_storage'],
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -23,5 +23,5 @@ index 33c5e9a2..b1ea8f9d 100644
|
||||
type script = {
|
||||
tmpdir : string; (* Temporary directory. *)
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -121,5 +121,5 @@ index 8333366b..a5150907 100644
|
||||
=head2 Guest firmware
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -384,5 +384,5 @@ index 73edff2c..a58ff433 100644
|
||||
info (f_"Overlay saved as %s [--debug-overlays]") saved_filename
|
||||
) overlays
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -30,5 +30,5 @@ index 179b0edf..fdc04b02 100644
|
||||
(* List of Cinder volume IDs. *)
|
||||
val mutable volume_ids = []
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -40,5 +40,5 @@ index ba26949f..f2f7b95c 100644
|
||||
(*----------------------------------------------------------------------*)
|
||||
(* Perform the conversion of the Windows guest. *)
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -133,5 +133,5 @@ index f2f7b95c..84db742f 100644
|
||||
(*----------------------------------------------------------------------*)
|
||||
(* Perform the conversion of the Windows guest. *)
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -58,5 +58,5 @@ index 84db742f..44cef5ed 100644
|
||||
(*----------------------------------------------------------------------*)
|
||||
(* Perform the conversion of the Windows guest. *)
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -79,5 +79,5 @@ index 471102da..7cd6dea6 100644
|
||||
except:
|
||||
cancel_transfer(connection, transfer)
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -33,5 +33,5 @@ index 44cef5ed..4d844e2d 100644
|
||||
msi_path msi_path msi_path in
|
||||
Firstboot.add_firstboot_script g inspect.i_root
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -28,5 +28,5 @@ index 4d844e2d..33fbd410 100644
|
||||
(* Install RHEV-APT only if appropriate for the output hypervisor. *)
|
||||
if output#install_rhev_apt then (
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -23,5 +23,5 @@ index a5150907..1ffc0f9d 100644
|
||||
=item UEFI on oVirt or RHV
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -43,5 +43,5 @@ index 78623d97..f5a3abad 100644
|
||||
Virt-v2v adds metadata for the guest to Glance, describing such things
|
||||
as the guest operating system and what drivers it requires. The
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -148,5 +148,5 @@ index a58ff433..1f8d0138 100644
|
||||
| TargetURI _ ->
|
||||
(* XXX For the moment we assume that qemu URI outputs
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -38,5 +38,5 @@ index f5e91911..7c177e35 100644
|
||||
(* Caching extents speeds up qemu-img, especially its consecutive
|
||||
* block_status requests with req_one=1.
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -33,5 +33,5 @@ index e4df920e..ae8964dd 100644
|
||||
|
||||
L<virt-v2v(1)>.
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -127,5 +127,5 @@ index 1f8d0138..bde51885 100644
|
||||
if files > 0L && ffree < needed_inodes then
|
||||
error (f_"not enough available inodes for conversion on filesystem ‘%s’. %Ld inodes available < %Ld inodes needed")
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -26,5 +26,5 @@ index 4e00cd61..b8256bad 100644
|
||||
| Some QXL, false ->
|
||||
error (f_"there is no QXL driver for this version of Windows (%d.%d %s). virt-v2v looks for this driver in %s")
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -24,5 +24,5 @@ index 1ffc0f9d..a9bfffab 100644
|
||||
=item UEFI on oVirt or RHV
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -56,5 +56,5 @@ index bde51885..8af86687 100644
|
||||
| _ -> 10
|
||||
in
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -175,5 +175,5 @@ index 7cd6dea6..61ade1a8 100644
|
||||
|
||||
def transfer_supports_format():
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -76,5 +76,5 @@ index 33fbd410..13de10cb 100644
|
||||
)
|
||||
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -271,5 +271,5 @@ index 4c128b0c..ead03364 100644
|
||||
|
||||
(* Return the struct. *)
|
||||
--
|
||||
2.18.4
|
||||
2.27.0
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
From 84cb43440a2ad143eb7474a028b1b1549cb8c0f1 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 12 Nov 2021 08:47:55 +0000
|
||||
Subject: [PATCH] convert/convert_windows.ml: Handle date formats with dots
|
||||
instead of /
|
||||
|
||||
If the ShortDatePattern is yy.M.d (as can happen for US locale) we may
|
||||
not always reformat the date for schtasks.exe correctly. For
|
||||
explanation and testing see:
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1895323#c46 (- #c50)
|
||||
|
||||
Thanks: Xiaodai Wang for suggesting the fix and testing it
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1895323
|
||||
(cherry picked from commit d9dc6c42ae64ba92993dbd9477f003ba73fcfa2f)
|
||||
---
|
||||
v2v/convert_windows.ml | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
|
||||
index 13de10cb..6c7440aa 100644
|
||||
--- a/v2v/convert_windows.ml
|
||||
+++ b/v2v/convert_windows.ml
|
||||
@@ -422,12 +422,15 @@ popd
|
||||
and configure_qemu_ga files =
|
||||
List.iter (
|
||||
fun msi_path ->
|
||||
- (* Windows is a trashfire. https://stackoverflow.com/a/18730884 *)
|
||||
+ (* Windows is a trashfire.
|
||||
+ * https://stackoverflow.com/a/18730884
|
||||
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1895323
|
||||
+ *)
|
||||
let fb_script = sprintf "\
|
||||
echo Removing any previously scheduled qemu-ga installation
|
||||
schtasks.exe /Delete /TN Firstboot-qemu-ga /F
|
||||
echo Scheduling delayed installation of qemu-ga from %s
|
||||
-powershell.exe -command \"$d = (get-date).AddSeconds(120); $FormatHack = ($([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortDatePattern) -replace 'M+/', 'MM/') -replace 'd+/', 'dd/'; schtasks.exe /Create /SC ONCE /ST $d.ToString('HH:mm') /SD $d.ToString($FormatHack) /RU SYSTEM /TN Firstboot-qemu-ga /TR \\\"C:\\%s /forcerestart /qn /l+*vx C:\\%s.log\\\"\"
|
||||
+powershell.exe -command \"$d = (get-date).AddSeconds(120); $FormatHack = (($([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortDatePattern) -replace 'y+', 'yyyy') -replace 'M+', 'MM') -replace 'd+', 'dd'; schtasks.exe /Create /SC ONCE /ST $d.ToString('HH:mm') /SD $d.ToString($FormatHack) /RU SYSTEM /TN Firstboot-qemu-ga /TR \\\"C:\\%s /forcerestart /qn /l+*vx C:\\%s.log\\\"\"
|
||||
"
|
||||
msi_path msi_path msi_path in
|
||||
Firstboot.add_firstboot_script g inspect.i_root
|
||||
--
|
||||
2.27.0
|
||||
|
211
SOURCES/0046-v2v-Force-format-of-input-to-be-specified.patch
Normal file
211
SOURCES/0046-v2v-Force-format-of-input-to-be-specified.patch
Normal file
@ -0,0 +1,211 @@
|
||||
From 350baba10cbef38f7e2829927c2768c7f913e82f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 23 Nov 2021 09:58:50 +0000
|
||||
Subject: [PATCH] v2v: Force format of input to be specified
|
||||
|
||||
qemu 6.1 unnecessarily insists on the backing format of files being
|
||||
set. Change the type of the input disk so the format is no longer an
|
||||
option, but must be set by the input mode.
|
||||
|
||||
This change is only required on the 1.44 branch, since modular
|
||||
virt-v2v uses the qemu-nbd -s (snapshot) option to do the equivalent
|
||||
which seems to handle the backing format automatically.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2025769
|
||||
Reported-by: Vera Wu
|
||||
(cherry picked from commit 40cfe6da0861ca6360f670e254c71ed923a0402f)
|
||||
---
|
||||
v2v/input_disk.ml | 2 +-
|
||||
v2v/input_libvirt_vcenter_https.ml | 2 +-
|
||||
v2v/input_libvirt_vddk.ml | 2 +-
|
||||
v2v/input_vmx.ml | 2 +-
|
||||
v2v/parse_libvirt_xml.ml | 13 +++++++++----
|
||||
v2v/parse_ovf_from_ova.ml | 2 +-
|
||||
v2v/types.ml | 9 +++------
|
||||
v2v/types.mli | 2 +-
|
||||
v2v/v2v.ml | 19 +++++++------------
|
||||
9 files changed, 25 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml
|
||||
index 4e403003..beaa9a4d 100644
|
||||
--- a/v2v/input_disk.ml
|
||||
+++ b/v2v/input_disk.ml
|
||||
@@ -64,7 +64,7 @@ class input_disk input_format disk = object
|
||||
let disk = {
|
||||
s_disk_id = 0;
|
||||
s_qemu_uri = disk_absolute;
|
||||
- s_format = Some format;
|
||||
+ s_format = format;
|
||||
s_controller = None;
|
||||
} in
|
||||
|
||||
diff --git a/v2v/input_libvirt_vcenter_https.ml b/v2v/input_libvirt_vcenter_https.ml
|
||||
index ed2e5eed..f3c55b79 100644
|
||||
--- a/v2v/input_libvirt_vcenter_https.ml
|
||||
+++ b/v2v/input_libvirt_vcenter_https.ml
|
||||
@@ -84,7 +84,7 @@ object (self)
|
||||
(* The libvirt ESX driver doesn't normally specify a format, but
|
||||
* the format of the -flat file is *always* raw, so force it here.
|
||||
*)
|
||||
- { disk with s_qemu_uri = qemu_uri; s_format = Some "raw" }
|
||||
+ { disk with s_qemu_uri = qemu_uri; s_format = "raw" }
|
||||
) disks in
|
||||
|
||||
source, disks
|
||||
diff --git a/v2v/input_libvirt_vddk.ml b/v2v/input_libvirt_vddk.ml
|
||||
index 75fd146e..9463f6ba 100644
|
||||
--- a/v2v/input_libvirt_vddk.ml
|
||||
+++ b/v2v/input_libvirt_vddk.ml
|
||||
@@ -187,7 +187,7 @@ object (self)
|
||||
(* nbdkit always presents us with the raw disk blocks from
|
||||
* the guest, so force the format to raw here.
|
||||
*)
|
||||
- { disk with s_qemu_uri = qemu_uri; s_format = Some "raw" }
|
||||
+ { disk with s_qemu_uri = qemu_uri; s_format = "raw" }
|
||||
) disks in
|
||||
|
||||
source, disks
|
||||
diff --git a/v2v/input_vmx.ml b/v2v/input_vmx.ml
|
||||
index 7a7647e5..a4ed999a 100644
|
||||
--- a/v2v/input_vmx.ml
|
||||
+++ b/v2v/input_vmx.ml
|
||||
@@ -190,7 +190,7 @@ and find_hdds ?bandwidth input_password vmx vmx_source
|
||||
let uri, format = qemu_uri_of_filename ?bandwidth input_password
|
||||
vmx_source filename in
|
||||
let s = { s_disk_id = (-1);
|
||||
- s_qemu_uri = uri; s_format = Some format;
|
||||
+ s_qemu_uri = uri; s_format = format;
|
||||
s_controller = Some controller } in
|
||||
Some (c, t, s)
|
||||
| _ -> None
|
||||
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
|
||||
index fffc5a24..27e08135 100644
|
||||
--- a/v2v/parse_libvirt_xml.ml
|
||||
+++ b/v2v/parse_libvirt_xml.ml
|
||||
@@ -270,9 +270,10 @@ let parse_libvirt_xml ?bandwidth ?conn xml =
|
||||
|
||||
let format =
|
||||
match xpath_string "driver/@type" with
|
||||
- | Some "aio" -> Some "raw" (* Xen wierdness *)
|
||||
- | None -> None
|
||||
- | Some format -> Some format in
|
||||
+ | Some "aio" -> "raw" (* Xen wierdness *)
|
||||
+ | Some format -> format
|
||||
+ | None ->
|
||||
+ error (f_"<disk><driver type=\"format\"> attribute is missing from the libvirt XML") in
|
||||
|
||||
(* The <disk type='...'> attribute may be 'block', 'file',
|
||||
* 'network' or 'volume'. We ignore any other types.
|
||||
@@ -339,7 +340,11 @@ let parse_libvirt_xml ?bandwidth ?conn xml =
|
||||
let xpath_string = Xpath_helpers.xpath_string xpathctx in
|
||||
|
||||
(* Use the format specified in the volume itself. *)
|
||||
- let format = xpath_string "/volume/target/format/@type" in
|
||||
+ let format =
|
||||
+ match xpath_string "/volume/target/format/@type" with
|
||||
+ | Some format -> format
|
||||
+ | None ->
|
||||
+ error (f_"<volume><target>.<format type=\"format\"> attribute is missing from the libvirt XML of volume %s") vol in
|
||||
|
||||
(match xpath_string "/volume/@type" with
|
||||
| None | Some "file" ->
|
||||
diff --git a/v2v/parse_ovf_from_ova.ml b/v2v/parse_ovf_from_ova.ml
|
||||
index 758718a2..bc795166 100644
|
||||
--- a/v2v/parse_ovf_from_ova.ml
|
||||
+++ b/v2v/parse_ovf_from_ova.ml
|
||||
@@ -157,7 +157,7 @@ and parse_disks xpathctx =
|
||||
source_disk = {
|
||||
s_disk_id = i;
|
||||
s_qemu_uri = "";
|
||||
- s_format = Some "vmdk";
|
||||
+ s_format = "vmdk";
|
||||
s_controller = controller;
|
||||
};
|
||||
href = href;
|
||||
diff --git a/v2v/types.ml b/v2v/types.ml
|
||||
index 53daefed..e04bfacf 100644
|
||||
--- a/v2v/types.ml
|
||||
+++ b/v2v/types.ml
|
||||
@@ -56,7 +56,7 @@ and source_firmware =
|
||||
and source_disk = {
|
||||
s_disk_id : int;
|
||||
s_qemu_uri : string;
|
||||
- s_format : string option;
|
||||
+ s_format : string;
|
||||
s_controller : s_controller option;
|
||||
}
|
||||
and s_controller = Source_IDE | Source_SATA | Source_SCSI |
|
||||
@@ -197,11 +197,8 @@ and string_of_source_firmware = function
|
||||
|
||||
and string_of_source_disk { s_qemu_uri = qemu_uri; s_format = format;
|
||||
s_controller = controller } =
|
||||
- sprintf "\t%s%s%s"
|
||||
- qemu_uri
|
||||
- (match format with
|
||||
- | None -> ""
|
||||
- | Some format -> " (" ^ format ^ ")")
|
||||
+ sprintf "\t%s (%s)%s"
|
||||
+ qemu_uri format
|
||||
(match controller with
|
||||
| None -> ""
|
||||
| Some controller -> " [" ^ string_of_controller controller ^ "]")
|
||||
diff --git a/v2v/types.mli b/v2v/types.mli
|
||||
index a9b0a70e..61a19eea 100644
|
||||
--- a/v2v/types.mli
|
||||
+++ b/v2v/types.mli
|
||||
@@ -103,7 +103,7 @@ and source_firmware =
|
||||
and source_disk = {
|
||||
s_disk_id : int; (** A unique ID for each source disk. *)
|
||||
s_qemu_uri : string; (** QEMU URI of source disk. *)
|
||||
- s_format : string option; (** Format. *)
|
||||
+ s_format : string; (** Format of source disk. *)
|
||||
s_controller : s_controller option; (** Controller, eg. IDE, SCSI. *)
|
||||
}
|
||||
(** A source disk. *)
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 8af86687..203b93f1 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -293,12 +293,11 @@ and create_overlays source_disks =
|
||||
* should allow us to fstrim/blkdiscard and avoid copying
|
||||
* significant parts of the data over the wire.
|
||||
*)
|
||||
- let options =
|
||||
- "compat=1.1" ^
|
||||
- (match format with None -> ""
|
||||
- | Some fmt -> ",backing_fmt=" ^ fmt) in
|
||||
- let cmd = [ "qemu-img"; "create"; "-q"; "-f"; "qcow2"; "-b"; qemu_uri;
|
||||
- "-o"; options; overlay_file ] in
|
||||
+ let cmd = [ "qemu-img"; "create"; "-q";
|
||||
+ "-o"; "compat=1.1";
|
||||
+ "-b"; qemu_uri; "-F"; format;
|
||||
+ "-f"; "qcow2";
|
||||
+ overlay_file ] in
|
||||
if run_command cmd <> 0 then
|
||||
error (f_"qemu-img command failed, see earlier errors");
|
||||
|
||||
@@ -344,7 +343,7 @@ and populate_overlays g overlays =
|
||||
and populate_disks g source_disks =
|
||||
List.iter (
|
||||
fun ({s_qemu_uri = qemu_uri; s_format = format}) ->
|
||||
- g#add_drive_opts qemu_uri ?format ~cachemode:"unsafe"
|
||||
+ g#add_drive_opts qemu_uri ~format ~cachemode:"unsafe"
|
||||
~discard:"besteffort"
|
||||
) source_disks
|
||||
|
||||
@@ -604,11 +603,7 @@ and get_target_formats cmdline output overlays =
|
||||
| None ->
|
||||
match cmdline.output_format with
|
||||
| Some format -> format
|
||||
- | None ->
|
||||
- match ov.ov_source.s_format with
|
||||
- | Some format -> format
|
||||
- | None ->
|
||||
- error (f_"disk %s (%s) has no defined format.\n\nThe input metadata did not define the disk format (eg. raw/qcow2/etc) of this disk, and so virt-v2v will try to autodetect the format when reading it.\n\nHowever because the input format was not defined, we do not know what output format you want to use. You have two choices: either define the original format in the source metadata, or use the ‘-of’ option to force the output format.") ov.ov_sd ov.ov_source.s_qemu_uri in
|
||||
+ | None -> ov.ov_source.s_format in
|
||||
|
||||
(* What really happens here is that the call to #disk_create
|
||||
* below fails if the format is not raw or qcow2. We would
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,44 @@
|
||||
From 992af0707ad54d39ec707da6daa6c4ca7c3fc69a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 24 Nov 2021 11:23:38 +0000
|
||||
Subject: [PATCH] v2v: Cope with libvirt vpx/esx driver which does not set
|
||||
format
|
||||
|
||||
See discussion in this bug:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2026199
|
||||
|
||||
Fixes: commit 40cfe6da0861ca6360f670e254c71ed923a0402f
|
||||
(cherry picked from commit 59dc3293a9b4fdf11da8571c50e3e5badbb511c2)
|
||||
---
|
||||
v2v/parse_libvirt_xml.ml | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
|
||||
index 27e08135..e65fbf4a 100644
|
||||
--- a/v2v/parse_libvirt_xml.ml
|
||||
+++ b/v2v/parse_libvirt_xml.ml
|
||||
@@ -273,7 +273,11 @@ let parse_libvirt_xml ?bandwidth ?conn xml =
|
||||
| Some "aio" -> "raw" (* Xen wierdness *)
|
||||
| Some format -> format
|
||||
| None ->
|
||||
- error (f_"<disk><driver type=\"format\"> attribute is missing from the libvirt XML") in
|
||||
+ (* Some libvirt drivers don't set the format. Typically
|
||||
+ * this is the vpx/esx driver (see RHBZ#2026199). We
|
||||
+ * can assume "raw", as it will be overwritten later.
|
||||
+ *)
|
||||
+ "raw" in
|
||||
|
||||
(* The <disk type='...'> attribute may be 'block', 'file',
|
||||
* 'network' or 'volume'. We ignore any other types.
|
||||
@@ -344,7 +348,7 @@ let parse_libvirt_xml ?bandwidth ?conn xml =
|
||||
match xpath_string "/volume/target/format/@type" with
|
||||
| Some format -> format
|
||||
| None ->
|
||||
- error (f_"<volume><target>.<format type=\"format\"> attribute is missing from the libvirt XML of volume %s") vol in
|
||||
+ error (f_"<volume><target><format type=\"format\"> attribute is missing from the libvirt XML of volume %s") vol in
|
||||
|
||||
(match xpath_string "/volume/@type" with
|
||||
| None | Some "file" ->
|
||||
--
|
||||
2.27.0
|
||||
|
@ -10,7 +10,7 @@
|
||||
Name: virt-v2v
|
||||
Epoch: 1
|
||||
Version: 1.42.0
|
||||
Release: 16%{?dist}
|
||||
Release: 18%{?dist}
|
||||
Summary: Convert a virtual machine to run on KVM
|
||||
|
||||
License: GPLv2+
|
||||
@ -80,6 +80,9 @@ Patch0041: 0041-v2v-Increase-Linux-minimum-root-filesystem-to-100-MB.patch
|
||||
Patch0042: 0042-v2v-rhv-upload-plugin-Fix-waiting-for-finalize.patch
|
||||
Patch0043: 0043-v2v-windows-Do-not-fix-NTFS-heads-in-Windows-Vista-a.patch
|
||||
Patch0044: 0044-v2v-vcenter-Implement-cookie-scripts.patch
|
||||
Patch0045: 0045-convert-convert_windows.ml-Handle-date-formats-with-.patch
|
||||
Patch0046: 0046-v2v-Force-format-of-input-to-be-specified.patch
|
||||
Patch0047: 0047-v2v-Cope-with-libvirt-vpx-esx-driver-which-does-not-.patch
|
||||
|
||||
# Patches which apply to the common/ submodule.
|
||||
# These have to be hand-modified.
|
||||
@ -323,6 +326,15 @@ rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-v2v-test-harness.1*
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Nov 24 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.42.0-18
|
||||
- Additional fix for backing file specified without backing format
|
||||
related: rhbz#2025769
|
||||
|
||||
* Tue Nov 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.42.0-17
|
||||
- Correct regexps used to fix schtasks command
|
||||
- Fix backing file specified without backing format
|
||||
resolves: rhbz#2023279, rhbz#2025769
|
||||
|
||||
* Fri Oct 29 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.42.0-16
|
||||
- Implement cookie scripts for more reliable vCenter/HTTPS transfers
|
||||
resolves: rhbz#2018173
|
||||
|
Loading…
Reference in New Issue
Block a user