Import OL
This commit is contained in:
parent
0ea419d57c
commit
410eb4df87
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
SOURCES/libguestfs.keyring
|
||||
SOURCES/virt-v2v-2.5.6.tar.gz
|
||||
SOURCES/virt-v2v-2.7.1.tar.gz
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
|
||||
7c49844a2ffb54d6fcb58eca1dbf57b110d5d47e SOURCES/virt-v2v-2.5.6.tar.gz
|
||||
e25884dd89561fc32072849c1cbc7b020ce75b34 SOURCES/virt-v2v-2.7.1.tar.gz
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From 7800049c5612e6ffb30be7f8862d147d82976ae8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 31 Jul 2024 10:09:50 +0100
|
||||
Subject: [PATCH] docs: Note that --mac len field is now optional
|
||||
|
||||
Reported-by: Ming Xie
|
||||
Updates: commit 159fda411d2f75b087106e7293d273ae142c9fbe
|
||||
---
|
||||
docs/virt-v2v.pod | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index b53face6..dfe92d77 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -394,9 +394,9 @@ Force a particular interface (controlled by its MAC address) to have a
|
||||
static IP address after boot.
|
||||
|
||||
The fields in the parameter are: C<ipaddr> is the IP address. C<gw>
|
||||
-is the optional gateway IP address. C<len> is the subnet mask length
|
||||
-(an integer). The final parameters are zero or more nameserver IP
|
||||
-addresses.
|
||||
+is the optional gateway IP address. C<len> is the optional subnet
|
||||
+mask length (an integer). The final parameters are zero or more
|
||||
+nameserver IP addresses.
|
||||
|
||||
This option can be supplied zero or more times.
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
From 8dd5577174fe23ace5ecba7a81d2516315a0b301 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 30 Oct 2024 10:16:35 +0000
|
||||
Subject: [PATCH] lib: OVF: Add preliminary support for Windows Server 2025
|
||||
|
||||
Unfortunately support has not yet been added to oVirt. However I have
|
||||
inferred the correct ostype value based on existing entries.
|
||||
|
||||
Also pull in the following commit from the common submodule:
|
||||
|
||||
Richard W.M. Jones (1):
|
||||
mlcustomize: Add heuristic support for Windows Server 2025
|
||||
|
||||
Related: https://issues.redhat.com/browse/RHEL-65009
|
||||
Related: https://issues.redhat.com/browse/RHEL-65010
|
||||
Reported-by: Ming Xie
|
||||
---
|
||||
common | 2 +-
|
||||
lib/create_ovf.ml | 4 +++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
Submodule common e9eea65a..2d42128e:
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml
|
||||
index 88c1c8cf..7e46f318 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.ml
|
||||
+++ b/common/mlcustomize/inject_virtio_win.ml
|
||||
@@ -522,6 +522,8 @@ and virtio_iso_path_matches_guest_os t path =
|
||||
(10, 0, not_client, ((=) "win2k19"))
|
||||
else if pathelem "2k22" || pathelem "win2022" then
|
||||
(10, 0, not_client, ((=) "win2k22"))
|
||||
+ else if pathelem "2k25" || pathelem "win2025" then
|
||||
+ (10, 0, not_client, ((=) "win2k25"))
|
||||
else
|
||||
raise Not_found in
|
||||
|
||||
diff --git a/lib/create_ovf.ml b/lib/create_ovf.ml
|
||||
index f0b32e01..e2c19b08 100644
|
||||
--- a/lib/create_ovf.ml
|
||||
+++ b/lib/create_ovf.ml
|
||||
@@ -242,10 +242,11 @@ and get_ostype = function
|
||||
| "win2k16" -> "windows_2016x64"
|
||||
| "win2k19" -> "windows_2019x64"
|
||||
| "win2k22" -> "windows_2022"
|
||||
+ | "win2k25" -> "windows_2025"
|
||||
| _ ->
|
||||
warning (f_"unknown Windows 10 variant: %s (%s)")
|
||||
osinfo product;
|
||||
- "windows_2022"
|
||||
+ "windows_2025"
|
||||
)
|
||||
|
||||
| { i_type = typ; i_distro = distro;
|
||||
@@ -448,6 +449,7 @@ and get_ovirt_osid = function
|
||||
| "win2k16" -> (* windows_2016x64 *) 29
|
||||
| "win2k19" -> (* windows_2019x64 *) 31
|
||||
| "win2k22" -> (* windows_2022 *) 37
|
||||
+ (*| "win2k25" -> (* windows_2025 *) not yet known - 2024/10 *)
|
||||
| _ ->
|
||||
warning (f_"unknown Windows 10 variant: %s (%s)")
|
||||
osinfo product;
|
||||
@ -1,4 +1,4 @@
|
||||
From ed515103ba0d4054c7000568b39df42abb503f3c Mon Sep 17 00:00:00 2001
|
||||
From 76d765ce4b8ea64a9b2c36b68ceacd1517c62aa7 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 28 Sep 2014 19:14:43 +0100
|
||||
Subject: [PATCH] RHEL: v2v: Select correct qemu binary for -o qemu mode
|
||||
@ -1,207 +0,0 @@
|
||||
From c57ec4fd5d4942d2320aec4a6b01977dabb87f83 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 1 Aug 2024 09:01:47 +0100
|
||||
Subject: [PATCH] convert: More robust qemu-ga installation, change paths
|
||||
|
||||
Add a commit from the common submodule to attempt to make qemu-ga
|
||||
installation more robust on Windows.
|
||||
|
||||
Rename network configuration Powershell script from "v2vnetcf" to
|
||||
"network-configuration". I also dropped the ".ps1" extension as the
|
||||
modified Firstboot.add_firstboot_powershell function now adds this.
|
||||
|
||||
Update the common submodule to get these changes:
|
||||
|
||||
Richard W.M. Jones (3):
|
||||
mlcustomize: Use Start-Process -Wait to run qemu-ga installer
|
||||
mlcustomize: Add Firstboot.firstboot_dir function
|
||||
mlcustomize: Place powershell scripts into <firstboot_dir>\Temp
|
||||
---
|
||||
common | 2 +-
|
||||
convert/convert_windows.ml | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
Submodule common ae639ba3..d489469f:
|
||||
diff --git a/common/mlcustomize/firstboot.ml b/common/mlcustomize/firstboot.ml
|
||||
index 4b9b910b..3bbba714 100644
|
||||
--- a/common/mlcustomize/firstboot.ml
|
||||
+++ b/common/mlcustomize/firstboot.ml
|
||||
@@ -239,7 +239,22 @@ WantedBy=%s
|
||||
end
|
||||
|
||||
module Windows = struct
|
||||
- let rec install_service (g : Guestfs.guestfs) root =
|
||||
+ (* Create and return the firstboot directory. *)
|
||||
+ let create_firstboot_dir (g : Guestfs.guestfs) =
|
||||
+ let rec loop firstboot_dir firstboot_dir_win = function
|
||||
+ | [] -> firstboot_dir, firstboot_dir_win
|
||||
+ | dir :: path ->
|
||||
+ let firstboot_dir =
|
||||
+ if firstboot_dir = "" then "/" ^ dir else firstboot_dir // dir in
|
||||
+ let firstboot_dir_win = firstboot_dir_win ^ "\\" ^ dir in
|
||||
+ let firstboot_dir = g#case_sensitive_path firstboot_dir in
|
||||
+ g#mkdir_p firstboot_dir;
|
||||
+ loop firstboot_dir firstboot_dir_win path
|
||||
+ in
|
||||
+ loop "" "C:" ["Program Files"; "Guestfs"; "Firstboot"]
|
||||
+
|
||||
+ let rec install_service (g : Guestfs.guestfs) root
|
||||
+ firstboot_dir firstboot_dir_win =
|
||||
(* Either rhsrvany.exe or pvvxsvc.exe must exist.
|
||||
*
|
||||
* (Check also that it's not a dangling symlink but a real file).
|
||||
@@ -254,20 +269,7 @@ module Windows = struct
|
||||
error (f_"One of rhsrvany.exe or pvvxsvc.exe is missing in %s. One of them is required in order to install Windows firstboot scripts. You can get one by building rhsrvany (https://github.com/rwmjones/rhsrvany)")
|
||||
(virt_tools_data_dir ()) in
|
||||
|
||||
- (* Create a directory for firstboot files in the guest. *)
|
||||
- let firstboot_dir, firstboot_dir_win =
|
||||
- let rec loop firstboot_dir firstboot_dir_win = function
|
||||
- | [] -> firstboot_dir, firstboot_dir_win
|
||||
- | dir :: path ->
|
||||
- let firstboot_dir =
|
||||
- if firstboot_dir = "" then "/" ^ dir else firstboot_dir // dir in
|
||||
- let firstboot_dir_win = firstboot_dir_win ^ "\\" ^ dir in
|
||||
- let firstboot_dir = g#case_sensitive_path firstboot_dir in
|
||||
- g#mkdir_p firstboot_dir;
|
||||
- loop firstboot_dir firstboot_dir_win path
|
||||
- in
|
||||
- loop "" "C:" ["Program Files"; "Guestfs"; "Firstboot"] in
|
||||
-
|
||||
+ (* Create a directory for firstboot scripts in the guest. *)
|
||||
g#mkdir_p (firstboot_dir // "scripts");
|
||||
|
||||
(* Copy pvvxsvc or rhsrvany to the guest. *)
|
||||
@@ -339,11 +341,25 @@ echo uninstalling firstboot service
|
||||
"PWD", REG_SZ firstboot_dir_win ];
|
||||
] in
|
||||
reg_import reg regedits
|
||||
- );
|
||||
-
|
||||
- firstboot_dir
|
||||
+ )
|
||||
end
|
||||
|
||||
+let firstboot_dir (g : Guestfs.guestfs) root =
|
||||
+ let typ = g#inspect_get_type root in
|
||||
+
|
||||
+ match typ with
|
||||
+ | "linux" ->
|
||||
+ let dir = Linux.firstboot_dir in
|
||||
+ g#mkdir_p dir;
|
||||
+ dir, None
|
||||
+
|
||||
+ | "windows" ->
|
||||
+ let dir, dir_win = Windows.create_firstboot_dir g in
|
||||
+ dir, Some dir_win
|
||||
+
|
||||
+ | _ ->
|
||||
+ error (f_"guest type %s is not supported") typ
|
||||
+
|
||||
let script_count = ref 0
|
||||
|
||||
let add_firstboot_script (g : Guestfs.guestfs) root ?(prio = 5000) name
|
||||
@@ -363,7 +379,8 @@ let add_firstboot_script (g : Guestfs.guestfs) root ?(prio = 5000) name
|
||||
g#chmod 0o755 filename
|
||||
|
||||
| "windows", _ ->
|
||||
- let firstboot_dir = Windows.install_service g root in
|
||||
+ let firstboot_dir, firstboot_dir_win = Windows.create_firstboot_dir g in
|
||||
+ Windows.install_service g root firstboot_dir firstboot_dir_win;
|
||||
let filename = firstboot_dir // "scripts" // filename ^ ".bat" in
|
||||
g#write filename (String.unix2dos content)
|
||||
|
||||
@@ -382,15 +399,18 @@ let add_firstboot_powershell g root ?prio name code =
|
||||
*)
|
||||
assert (g#inspect_get_type root = "windows");
|
||||
|
||||
- let windows_systemroot = g#inspect_get_windows_systemroot root in
|
||||
-
|
||||
- (* Create the temporary directory to put the Powershell file. *)
|
||||
- let tempdir = sprintf "%s/Temp" windows_systemroot in
|
||||
+ (* Place the Powershell script into firstboot_dir/Temp *)
|
||||
+ let firstboot_dir, firstboot_dir_win = Windows.create_firstboot_dir g in
|
||||
+ let tempdir = sprintf "%s/Temp" firstboot_dir in
|
||||
g#mkdir_p tempdir;
|
||||
- let ps_path = sprintf "%s/%s" tempdir name in
|
||||
+
|
||||
+ let ps_path = sprintf "%s/%s.ps1" tempdir name in
|
||||
+ let ps_path_win = sprintf "%s\\Temp\\%s.ps1" firstboot_dir_win name in
|
||||
let code = String.concat "\r\n" code ^ "\r\n" in
|
||||
g#write ps_path code;
|
||||
|
||||
- let fb = sprintf "powershell.exe -ExecutionPolicy ByPass -NoProfile -file %s"
|
||||
- ps_path in
|
||||
+ (* Create a regular firstboot bat that just invokes powershell *)
|
||||
+ let fb =
|
||||
+ sprintf "powershell.exe -ExecutionPolicy ByPass -NoProfile -file \"%s\""
|
||||
+ ps_path_win in
|
||||
add_firstboot_script g root ?prio name fb
|
||||
diff --git a/common/mlcustomize/firstboot.mli b/common/mlcustomize/firstboot.mli
|
||||
index 8231af65..34ff0690 100644
|
||||
--- a/common/mlcustomize/firstboot.mli
|
||||
+++ b/common/mlcustomize/firstboot.mli
|
||||
@@ -16,6 +16,23 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*)
|
||||
|
||||
+val firstboot_dir : Guestfs.guestfs -> string -> string * string option
|
||||
+(** [firstboot_dir g root]
|
||||
+ returns the path of the firstboot directory, creating it in
|
||||
+ the guest if necessary.
|
||||
+
|
||||
+ This returns the name of the directory as a guestfs path, and
|
||||
+ optionally the name as a Windows path (only for Windows guests).
|
||||
+
|
||||
+ For Linux this could be [/usr/lib/virt-sysprep, None]
|
||||
+
|
||||
+ For Windows this could be ["/Program Files/Guestfs/Firstboot",
|
||||
+ Some "C:\Program Files\Guestfs\Firstboot"]
|
||||
+
|
||||
+ Additional files that are used during firstboot can be placed
|
||||
+ in this directory, but be careful not to conflict with files
|
||||
+ and scripts added by the firstboot process itself. *)
|
||||
+
|
||||
val add_firstboot_script : Guestfs.guestfs -> string -> ?prio:int -> string ->
|
||||
string -> unit
|
||||
(** [add_firstboot_script g root prio name content] adds a firstboot
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml
|
||||
index eee93669..b04a3b38 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.ml
|
||||
+++ b/common/mlcustomize/inject_virtio_win.ml
|
||||
@@ -592,11 +592,11 @@ and configure_qemu_ga t files =
|
||||
add "# Run qemu-ga installers";
|
||||
List.iter (
|
||||
fun msi_path ->
|
||||
- add (sprintf "C:\\%s /norestart /qn /l+*vx C:\\%s.log"
|
||||
+ add (sprintf "Start-Process -Wait -FilePath \"C:\\%s\" -ArgumentList \"/norestart\",\"/qn\",\"/l+*vx\",\"C:\\%s.log\""
|
||||
msi_path msi_path)
|
||||
) files;
|
||||
|
||||
- Firstboot.add_firstboot_powershell t.g t.root "install-qemu-ga.ps1" !script
|
||||
+ Firstboot.add_firstboot_powershell t.g t.root "install-qemu-ga" !script
|
||||
|
||||
and configure_blnsvr t blnsvr =
|
||||
let cmd = sprintf "\
|
||||
diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml
|
||||
index 2d6e2059..52ca5bbe 100644
|
||||
--- a/convert/convert_windows.ml
|
||||
+++ b/convert/convert_windows.ml
|
||||
@@ -397,7 +397,7 @@ let convert (g : G.guestfs) _ inspect i_firmware block_driver _ static_ips =
|
||||
%systemroot%\\Sysnative\\PnPutil -i -a \
|
||||
%systemroot%\\Drivers\\Virtio\\*.inf" in
|
||||
|
||||
- (* Set priority higher than that of "v2vnetcf.ps1" firstboot script. *)
|
||||
+ (* Set priority higher than that of "network-configure" firstboot script. *)
|
||||
Firstboot.add_firstboot_script g inspect.i_root ~prio:2000
|
||||
"pnputil install drivers" fb_script;
|
||||
|
||||
@@ -674,7 +674,7 @@ let convert (g : G.guestfs) _ inspect i_firmware block_driver _ static_ips =
|
||||
* Powershell script which runs at boot.
|
||||
*)
|
||||
if static_ips <> [] then (
|
||||
- let psh_filename = "v2vnetcf.ps1" in
|
||||
+ let psh_filename = "network-configure" in
|
||||
let psh = ref [] in
|
||||
let add = List.push_back psh in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 84afa8cb6933daee1585facc00557826f1fd2273 Mon Sep 17 00:00:00 2001
|
||||
From efba6c869424b27fc5946acc230dd486906e721a 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,10 +44,10 @@ index d2a1c270..0be37f5e 100644
|
||||
=item B<-o null>
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 346be606..81a4b45a 100644
|
||||
index 5345a6c9..a1e8fb30 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -146,11 +146,6 @@ Since F<guest-domain.xml> contains the path(s) to the guest disk
|
||||
@@ -157,11 +157,6 @@ Since F<guest-domain.xml> contains the path(s) to the guest disk
|
||||
image(s) you do not need to specify the name of the disk image on the
|
||||
command line.
|
||||
|
||||
@ -59,7 +59,7 @@ index 346be606..81a4b45a 100644
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
@@ -522,9 +517,6 @@ This is similar to I<-o local>, except that a shell script is written
|
||||
@@ -533,9 +528,6 @@ This is similar to I<-o local>, except that a shell script is written
|
||||
which you can use to boot the guest in qemu. The converted disks and
|
||||
shell script are written to the directory specified by I<-os>.
|
||||
|
||||
@ -69,7 +69,7 @@ index 346be606..81a4b45a 100644
|
||||
=item B<-o> B<rhev>
|
||||
|
||||
This is the same as I<-o rhv>.
|
||||
@@ -607,11 +599,6 @@ For I<-o openstack> (L<virt-v2v-output-openstack(1)>) only, set a guest ID
|
||||
@@ -618,11 +610,6 @@ For I<-o openstack> (L<virt-v2v-output-openstack(1)>) only, set a guest ID
|
||||
which is saved on each Cinder volume in the C<virt_v2v_guest_id>
|
||||
volume property.
|
||||
|
||||
@ -81,7 +81,7 @@ index 346be606..81a4b45a 100644
|
||||
=item B<-oo verify-server-certificate>
|
||||
|
||||
=item B<-oo verify-server-certificate=>C<true|false>
|
||||
@@ -782,10 +769,6 @@ Print information about the source guest and stop. This option is
|
||||
@@ -793,10 +780,6 @@ Print information about the source guest and stop. This option is
|
||||
useful when you are setting up network and bridge maps.
|
||||
See L</Networks and bridges>.
|
||||
|
||||
@ -107,7 +107,7 @@ index 07dae8c2..b6f24565 100644
|
||||
let output_storage =
|
||||
match options.output_storage with
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 48c8cfba..fca5f6e9 100644
|
||||
index 194e6233..6baa111f 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -277,8 +277,6 @@ let rec main () =
|
||||
@ -1,116 +0,0 @@
|
||||
From 168eacf977ca49e96bc63ddc4109c27515ac0277 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 1 Aug 2024 10:36:52 +0100
|
||||
Subject: [PATCH] common: mlcustomize: Inject qemu-ga & blnsvr into
|
||||
<firstboot_dir>/Temp
|
||||
|
||||
Update common submodule to pick up this further change which should
|
||||
mean that for all Windows conversions, everything is confined to
|
||||
C:\Program Files\Guestfs\Firstboot (except the virtio drivers
|
||||
themselves).
|
||||
|
||||
Richard W.M. Jones (1):
|
||||
mlcustomize: Inject qemu-ga & blnsvr into <firstboot_dir>/Temp
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common d489469f..04116678:
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml
|
||||
index b04a3b38..2981bff5 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.ml
|
||||
+++ b/common/mlcustomize/inject_virtio_win.ml
|
||||
@@ -263,14 +263,28 @@ let rec inject_virtio_win_drivers ({ g } as t) reg =
|
||||
}
|
||||
)
|
||||
|
||||
-and inject_qemu_ga t =
|
||||
- let msi_files = copy_qemu_ga t in
|
||||
+and inject_qemu_ga ({ g; root } as t) =
|
||||
+ (* Copy the qemu-ga MSI(s) to the guest. *)
|
||||
+ let dir, dir_win = Firstboot.firstboot_dir g root in
|
||||
+ let dir_win = Option.value dir_win ~default:dir in
|
||||
+ let tempdir = sprintf "%s/Temp" dir in
|
||||
+ let tempdir_win = sprintf "%s\\Temp" dir_win in
|
||||
+ g#mkdir_p tempdir;
|
||||
+
|
||||
+ let msi_files = copy_qemu_ga t tempdir in
|
||||
if msi_files <> [] then
|
||||
- configure_qemu_ga t msi_files;
|
||||
+ configure_qemu_ga t tempdir_win msi_files;
|
||||
msi_files <> [] (* return true if we found some qemu-ga MSI files *)
|
||||
|
||||
-and inject_blnsvr t =
|
||||
- let files = copy_blnsvr t in
|
||||
+and inject_blnsvr ({ g; root } as t) =
|
||||
+ (* Copy the files to the guest. *)
|
||||
+ let dir, dir_win = Firstboot.firstboot_dir g root in
|
||||
+ let dir_win = Option.value dir_win ~default:dir in
|
||||
+ let tempdir = sprintf "%s/Temp" dir in
|
||||
+ let tempdir_win = sprintf "%s\\Temp" dir_win in
|
||||
+ g#mkdir_p tempdir;
|
||||
+
|
||||
+ let files = copy_blnsvr t tempdir in
|
||||
match files with
|
||||
| [] -> false (* Didn't find or install anything. *)
|
||||
|
||||
@@ -278,7 +292,7 @@ and inject_blnsvr t =
|
||||
* drivers/by-driver). Pick the first.
|
||||
*)
|
||||
| blnsvr :: _ ->
|
||||
- configure_blnsvr t blnsvr;
|
||||
+ configure_blnsvr t tempdir_win blnsvr;
|
||||
true
|
||||
|
||||
and add_guestor_to_registry t ((g, root) as reg) drv_name drv_pciid =
|
||||
@@ -360,13 +374,13 @@ and copy_drivers t driverdir =
|
||||
(fun () ->
|
||||
error (f_"root directory ‘/’ is missing from the virtio-win directory or ISO.\n\nThis should not happen and may indicate that virtio-win or virt-v2v is broken in some way. Please report this as a bug with a full debug log."))
|
||||
|
||||
-and copy_qemu_ga t =
|
||||
- copy_from_virtio_win t "/" "/" (virtio_iso_path_matches_qemu_ga t)
|
||||
+and copy_qemu_ga t tempdir =
|
||||
+ copy_from_virtio_win t "/" tempdir (virtio_iso_path_matches_qemu_ga t)
|
||||
(fun () ->
|
||||
error (f_"root directory ‘/’ is missing from the virtio-win directory or ISO.\n\nThis should not happen and may indicate that virtio-win or virt-v2v is broken in some way. Please report this as a bug with a full debug log."))
|
||||
|
||||
-and copy_blnsvr t =
|
||||
- copy_from_virtio_win t "/" "/" (virtio_iso_path_matches_blnsvr t)
|
||||
+and copy_blnsvr t tempdir =
|
||||
+ copy_from_virtio_win t "/" tempdir (virtio_iso_path_matches_blnsvr t)
|
||||
(fun () ->
|
||||
error (f_"root directory ‘/’ is missing from the virtio-win directory or ISO.\n\nThis should not happen and may indicate that virtio-win or virt-v2v is broken in some way. Please report this as a bug with a full debug log."))
|
||||
|
||||
@@ -578,7 +592,7 @@ and copy_from_libosinfo { g; i_osinfo; i_arch } destdir =
|
||||
(* Install qemu-ga. [files] is the non-empty list of possible qemu-ga
|
||||
* installers we detected.
|
||||
*)
|
||||
-and configure_qemu_ga t files =
|
||||
+and configure_qemu_ga t tempdir_win files =
|
||||
let script = ref [] in
|
||||
let add = List.push_back script in
|
||||
|
||||
@@ -591,16 +605,17 @@ and configure_qemu_ga t files =
|
||||
add "";
|
||||
add "# Run qemu-ga installers";
|
||||
List.iter (
|
||||
- fun msi_path ->
|
||||
- add (sprintf "Start-Process -Wait -FilePath \"C:\\%s\" -ArgumentList \"/norestart\",\"/qn\",\"/l+*vx\",\"C:\\%s.log\""
|
||||
- msi_path msi_path)
|
||||
+ fun msi ->
|
||||
+ (* [`] is an escape char for quotes *)
|
||||
+ add (sprintf "Start-Process -Wait -FilePath \"%s\\%s\" -ArgumentList \"/norestart\",\"/qn\",\"/l+*vx\",\"`\"%s\\%s.log`\"\""
|
||||
+ tempdir_win msi tempdir_win msi)
|
||||
) files;
|
||||
|
||||
Firstboot.add_firstboot_powershell t.g t.root "install-qemu-ga" !script
|
||||
|
||||
-and configure_blnsvr t blnsvr =
|
||||
+and configure_blnsvr t tempdir_win blnsvr =
|
||||
let cmd = sprintf "\
|
||||
@echo off\n\
|
||||
echo Installing %s\n\
|
||||
- c:\\%s -i\n" blnsvr blnsvr in
|
||||
- Firstboot.add_firstboot_script t.g t.root (sprintf "install-%s" blnsvr) cmd
|
||||
+ \"%s\\%s\" -i\n" blnsvr tempdir_win blnsvr in
|
||||
+ Firstboot.add_firstboot_script t.g t.root "install-blnsvr" cmd
|
||||
@ -1,4 +1,4 @@
|
||||
From abab56cf74a5005b33e962bb3d42db3d5b39e6d3 Mon Sep 17 00:00:00 2001
|
||||
From f43f6b4a5ab2387f192a871c366598194a5c1e43 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 24 Apr 2015 09:45:41 -0400
|
||||
Subject: [PATCH] RHEL: Fix list of supported sound cards to match RHEL qemu
|
||||
@ -1,45 +0,0 @@
|
||||
From c952f310c902e438a8b0b5240a4b486b698bede8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 5 Aug 2024 10:08:34 +0100
|
||||
Subject: [PATCH] docs: Add a note about removal of VMware Tools on Windows
|
||||
|
||||
We use VMware's recommended method for removal, but we know from
|
||||
experience that this rarely works. The alternate method being
|
||||
proposed involves making very invasive changes to the Registry and
|
||||
filesystem, which are inappropriate for virt-v2v to do and highly
|
||||
risky. Therefore simply document this, with notes for the virt-v2v
|
||||
user if they want to try the risky method.
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-51169
|
||||
Thanks: Yan Vugenfirer
|
||||
Reported-by: Ming Xie
|
||||
---
|
||||
docs/virt-v2v.pod | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index dfe92d77..92941026 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -1299,6 +1299,21 @@ B<N.B.> Take care not to interrupt the automatic driver installation
|
||||
process when logging in to the guest for the first time, as this may
|
||||
prevent the guest from subsequently booting correctly.
|
||||
|
||||
+=head3 Removing VMware Tools from Windows guests
|
||||
+
|
||||
+Virt-v2v attempts to remove VMware Tools. For Windows guests this is
|
||||
+supposed to happen during the first boot after conversion.
|
||||
+
|
||||
+We use VMware's recommended uninstallation method as that is the
|
||||
+safest choice. However our experience has shown that this method
|
||||
+usually fails. If so, VMware Tools must be removed by some other
|
||||
+method.
|
||||
+
|
||||
+One possible method is described here:
|
||||
+L<https://gist.github.com/broestls/f872872a00acee2fca02017160840624>
|
||||
+You should carefully check this script since it makes very invasive
|
||||
+changes to the Windows Registry and filesystem.
|
||||
+
|
||||
=head2 Free space for conversion
|
||||
|
||||
=head3 Free space in the guest
|
||||
@ -1,4 +1,4 @@
|
||||
From 2039580744223840a09b8aab7ff2fbf94a563a6c Mon Sep 17 00:00:00 2001
|
||||
From 0d6280e2be92bef1246adc70830a6ae18359f121 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.
|
||||
@ -18,10 +18,10 @@ https://bugzilla.redhat.com/show_bug.cgi?id=2187961#c1
|
||||
6 files changed, 28 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/convert/convert.ml b/convert/convert.ml
|
||||
index 344c5858..ecc48ad4 100644
|
||||
index 64b36c97..604902d1 100644
|
||||
--- a/convert/convert.ml
|
||||
+++ b/convert/convert.ml
|
||||
@@ -52,6 +52,7 @@ let rec convert dir options source =
|
||||
@@ -53,6 +53,7 @@ let rec convert dir options source =
|
||||
|
||||
message (f_"Opening the source");
|
||||
let g = open_guestfs ~identifier:"v2v" () in
|
||||
@ -30,7 +30,7 @@ index 344c5858..ecc48ad4 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/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
|
||||
index 30908a91..73cf5144 100755
|
||||
index 501c2a93..28b2744f 100755
|
||||
--- a/test-data/phony-guests/make-windows-img.sh
|
||||
+++ b/test-data/phony-guests/make-windows-img.sh
|
||||
@@ -37,6 +37,7 @@ fi
|
||||
@ -85,7 +85,7 @@ index 4373f140..2b31b0bb 100755
|
||||
|
||||
# Test the base image remained untouched
|
||||
diff --git a/tests/test-v2v-virtio-win-iso.sh b/tests/test-v2v-virtio-win-iso.sh
|
||||
index 69f6f414..b9b806fb 100755
|
||||
index 68fb879b..2e133034 100755
|
||||
--- a/tests/test-v2v-virtio-win-iso.sh
|
||||
+++ b/tests/test-v2v-virtio-win-iso.sh
|
||||
@@ -82,6 +82,12 @@ mktest ()
|
||||
@ -1,25 +0,0 @@
|
||||
From 7bc9b115baba6df2969451cd6907e2d7543ef22d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 5 Aug 2024 10:18:31 +0100
|
||||
Subject: [PATCH] Update common submodule
|
||||
|
||||
Richard W.M. Jones (1):
|
||||
mlcustomize: Write qemu-ga log file name to log.txt
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 04116678..7b84a370:
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml
|
||||
index 2981bff5..afec1e45 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.ml
|
||||
+++ b/common/mlcustomize/inject_virtio_win.ml
|
||||
@@ -606,6 +606,8 @@ and configure_qemu_ga t tempdir_win files =
|
||||
add "# Run qemu-ga installers";
|
||||
List.iter (
|
||||
fun msi ->
|
||||
+ add (sprintf "Write-Host \"Writing log to %s\\%s.log\""
|
||||
+ tempdir_win msi);
|
||||
(* [`] is an escape char for quotes *)
|
||||
add (sprintf "Start-Process -Wait -FilePath \"%s\\%s\" -ArgumentList \"/norestart\",\"/qn\",\"/l+*vx\",\"`\"%s\\%s.log`\"\""
|
||||
tempdir_win msi tempdir_win msi)
|
||||
@ -1,78 +0,0 @@
|
||||
From 50f005f8b7034916588855c15b10a0195bf54b23 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 8 Aug 2024 10:40:24 +0100
|
||||
Subject: [PATCH] Pull in a fix to make Windows firstboot more reliable.
|
||||
|
||||
Update the common submodule to get:
|
||||
|
||||
Richard W.M. Jones (2):
|
||||
mlcustomize: Add some comments to firstboot batch file
|
||||
mlcustomize: Reboot Windows between each firstboot script
|
||||
|
||||
Document that Windows may now reboot several times after conversion.
|
||||
---
|
||||
common | 2 +-
|
||||
docs/virt-v2v.pod | 9 ++++++---
|
||||
2 files changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
Submodule common 7b84a370..a7883967:
|
||||
diff --git a/common/mlcustomize/firstboot.ml b/common/mlcustomize/firstboot.ml
|
||||
index 3bbba714..52e76401 100644
|
||||
--- a/common/mlcustomize/firstboot.ml
|
||||
+++ b/common/mlcustomize/firstboot.ml
|
||||
@@ -278,6 +278,9 @@ module Windows = struct
|
||||
(* Write a firstboot.bat control script which just runs the other
|
||||
* scripts in the directory. Note we need to use CRLF line endings
|
||||
* in this script.
|
||||
+ *
|
||||
+ * XXX It would be better to use powershell here. For some ideas see
|
||||
+ * https://github.com/HCK-CI/HLK-Setup-Scripts/
|
||||
*)
|
||||
let firstboot_script = sprintf "\
|
||||
@echo off
|
||||
@@ -299,6 +302,7 @@ if not exist \"%%scripts_done%%\" (
|
||||
mkdir \"%%scripts_done%%\"
|
||||
)
|
||||
|
||||
+:: Pick the next script to run.
|
||||
for %%%%f in (\"%%scripts%%\"\\*.bat) do (
|
||||
echo running \"%%%%f\"
|
||||
move \"%%%%f\" \"%%scripts_done%%\"
|
||||
@@ -307,8 +311,17 @@ for %%%%f in (\"%%scripts%%\"\\*.bat) do (
|
||||
set elvl=!errorlevel!
|
||||
echo .... exit code !elvl!
|
||||
popd
|
||||
+
|
||||
+ :: Reboot the computer. This is necessary to free any locked
|
||||
+ :: files which may prevent later scripts from running.
|
||||
+ shutdown /r /t 0 /y
|
||||
+
|
||||
+ :: Exit the script (in case shutdown returns before rebooting).
|
||||
+ :: On next boot, the whole firstboot service will be called again.
|
||||
+ exit /b
|
||||
)
|
||||
|
||||
+:: Fallthrough here if there are no scripts.
|
||||
echo uninstalling firstboot service
|
||||
\"%%firstboot%%\\%s\" -s firstboot uninstall
|
||||
" firstboot_dir_win srvany in
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 92941026..587b4604 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -1295,9 +1295,12 @@ The guest will be bootable after the offline conversion stage, but
|
||||
will not yet have all necessary drivers installed to work correctly.
|
||||
These will be installed automatically the first time the guest boots.
|
||||
|
||||
-B<N.B.> Take care not to interrupt the automatic driver installation
|
||||
-process when logging in to the guest for the first time, as this may
|
||||
-prevent the guest from subsequently booting correctly.
|
||||
+B<N.B.> Windows may reboot 4 or more times the first time after
|
||||
+conversion. This is required to install the required drivers, guest
|
||||
+agents, remove VMware Tools, and configure the network. Take care not
|
||||
+to interrupt the automatic driver installation process when logging in
|
||||
+to the guest for the first time, as this may prevent the guest from
|
||||
+subsequently booting correctly.
|
||||
|
||||
=head3 Removing VMware Tools from Windows guests
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 13970ce5d6be475cf6e06185636a730584303a6e Mon Sep 17 00:00:00 2001
|
||||
From 421a6ec290e90add03f9ddf4ca8436fdf80f885c Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Mar 2017 14:21:37 +0100
|
||||
Subject: [PATCH] RHEL: v2v: -i disk: force VNC as display (RHBZ#1372671)
|
||||
@ -1,4 +1,4 @@
|
||||
From 98a14fe2f8a428ed4bba85aba3889467d48a5743 Mon Sep 17 00:00:00 2001
|
||||
From 8e52f84563cf8f6eaa68ed60d1f46b39c9b73b50 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 8 Mar 2017 11:03:40 +0100
|
||||
Subject: [PATCH] RHEL: v2v: do not mention SUSE Xen hosts (RHBZ#1430203)
|
||||
@ -1,30 +0,0 @@
|
||||
From e9c0d63b22bcb4c31cfaac00fc1271713c8bd3b3 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 8 Aug 2024 10:56:16 +0100
|
||||
Subject: [PATCH] docs: Restate position on removal of VMware Tools
|
||||
|
||||
With the "reboot after every step" change made in the previous commit,
|
||||
it seems removal of VMware Tools is now more reliable. Update the
|
||||
notes about this.
|
||||
|
||||
Updates: commit c952f310c902e438a8b0b5240a4b486b698bede8
|
||||
---
|
||||
docs/virt-v2v.pod | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 587b4604..346be606 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -1308,9 +1308,8 @@ Virt-v2v attempts to remove VMware Tools. For Windows guests this is
|
||||
supposed to happen during the first boot after conversion.
|
||||
|
||||
We use VMware's recommended uninstallation method as that is the
|
||||
-safest choice. However our experience has shown that this method
|
||||
-usually fails. If so, VMware Tools must be removed by some other
|
||||
-method.
|
||||
+safest choice. If this fails, VMware Tools must be manually removed
|
||||
+by some other method.
|
||||
|
||||
One possible method is described here:
|
||||
L<https://gist.github.com/broestls/f872872a00acee2fca02017160840624>
|
||||
@ -1,17 +1,17 @@
|
||||
From be45d1e5bca42148c295da10c27c485c72de28c3 Mon Sep 17 00:00:00 2001
|
||||
From dc02d123d578511f9c4dffd3df5d797af14a1f3b 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
|
||||
|
||||
---
|
||||
docs/virt-v2v-support.pod | 104 ++------------------------------------
|
||||
1 file changed, 4 insertions(+), 100 deletions(-)
|
||||
docs/virt-v2v-support.pod | 96 ++-------------------------------------
|
||||
1 file changed, 4 insertions(+), 92 deletions(-)
|
||||
|
||||
diff --git a/docs/virt-v2v-support.pod b/docs/virt-v2v-support.pod
|
||||
index 8b64a5ea..1ffc0f9d 100644
|
||||
index e6415692..1ffc0f9d 100644
|
||||
--- a/docs/virt-v2v-support.pod
|
||||
+++ b/docs/virt-v2v-support.pod
|
||||
@@ -8,106 +8,10 @@ systems and guests in virt-v2v
|
||||
@@ -8,98 +8,10 @@ systems and guests in virt-v2v
|
||||
This page documents which foreign hypervisors, virtualization
|
||||
management systems and guest types that L<virt-v2v(1)> can support.
|
||||
|
||||
@ -84,9 +84,9 @@ index 8b64a5ea..1ffc0f9d 100644
|
||||
-
|
||||
-=over 4
|
||||
-
|
||||
-=item Red Hat Enterprise Linux 4, 5, 6, 7
|
||||
-=item Red Hat Enterprise Linux 4, 5, 6, 7, 8, 9, 10
|
||||
-
|
||||
-=item CentOS 4, 5, 6, 7
|
||||
-=item CentOS 4, 5, 6, 7, 8, 9, 10
|
||||
-
|
||||
-=item Scientific Linux 4, 5, 6, 7
|
||||
-
|
||||
@ -104,15 +104,7 @@ index 8b64a5ea..1ffc0f9d 100644
|
||||
-
|
||||
-=item Ubuntu 10.04, 12.04, 14.04, 16.04, and up
|
||||
-
|
||||
-=item Windows XP to Windows 10 / Windows Server 2016
|
||||
-
|
||||
-We use Windows internal version numbers, see
|
||||
-L<https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions>
|
||||
-
|
||||
-Currently NT 5.2 to NT 6.3 are supported.
|
||||
-
|
||||
-See L</WINDOWS> below for additional notes on converting Windows
|
||||
-guests.
|
||||
-=item Windows XP to Windows 11 / Windows Server 2025
|
||||
-
|
||||
-=back
|
||||
+For more information on supported hypervisors, and guest types in
|
||||
@ -1,4 +1,4 @@
|
||||
From b0386851d539e414302cb646567836717fd027d9 Mon Sep 17 00:00:00 2001
|
||||
From 6593a1970703eee10c3ef9f41279d80a133a611d 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
|
||||
@ -98,10 +98,10 @@ index cd4862b1..54cd276e 100644
|
||||
=head1 AUTHOR
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 81a4b45a..7c7069df 100644
|
||||
index a1e8fb30..b89a08a3 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -435,14 +435,6 @@ See L</Networks and bridges> below.
|
||||
@@ -446,14 +446,6 @@ See L</Networks and bridges> below.
|
||||
|
||||
This is the same as I<-o local>.
|
||||
|
||||
@ -116,7 +116,7 @@ index 81a4b45a..7c7069df 100644
|
||||
=item B<-o> B<kubevirt>
|
||||
|
||||
Set the output method to I<kubevirt>. B<Note the way this mode works
|
||||
@@ -1191,11 +1183,6 @@ and output methods may use disk space, as outlined in the table below.
|
||||
@@ -1206,11 +1198,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>).
|
||||
|
||||
@ -128,7 +128,7 @@ index 81a4b45a..7c7069df 100644
|
||||
=item I<-o local>
|
||||
|
||||
=item I<-o qemu>
|
||||
@@ -1398,13 +1385,6 @@ See also L</Starting the libvirt system instance>.
|
||||
@@ -1413,13 +1400,6 @@ See also L</Starting the libvirt system 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.
|
||||
|
||||
@ -167,7 +167,7 @@ index c0db9115..074b5e16 100755
|
||||
set -e
|
||||
set -x
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index fca5f6e9..4148fa50 100644
|
||||
index 6baa111f..427d35d4 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -197,7 +197,6 @@ let rec main () =
|
||||
@ -187,7 +187,7 @@ index fca5f6e9..4148fa50 100644
|
||||
s_"Set output mode (default: libvirt)";
|
||||
[ M"oa" ], Getopt.String ("sparse|preallocated", set_output_alloc),
|
||||
s_"Set output allocation mode";
|
||||
@@ -325,8 +324,6 @@ virt-v2v -i libvirtxml guest-domain.xml -o local -os /var/tmp
|
||||
@@ -333,8 +332,6 @@ virt-v2v -i libvirtxml guest-domain.xml -o local -os /var/tmp
|
||||
|
||||
virt-v2v -i disk disk.img -o local -os /var/tmp
|
||||
|
||||
@ -196,7 +196,7 @@ index fca5f6e9..4148fa50 100644
|
||||
There is a companion front-end called \"virt-p2v\" which comes as an
|
||||
ISO or CD image that can be booted on physical machines.
|
||||
|
||||
@@ -401,7 +398,6 @@ read the man page virt-v2v(1).
|
||||
@@ -412,7 +409,6 @@ read the man page virt-v2v(1).
|
||||
pr "input:libvirtxml\n";
|
||||
pr "input:ova\n";
|
||||
pr "input:vmx\n";
|
||||
@ -204,7 +204,7 @@ index fca5f6e9..4148fa50 100644
|
||||
pr "output:kubevirt\n";
|
||||
pr "output:libvirt\n";
|
||||
pr "output:local\n";
|
||||
@@ -498,7 +494,6 @@ read the man page virt-v2v(1).
|
||||
@@ -509,7 +505,6 @@ read the man page virt-v2v(1).
|
||||
| `Disk -> (module Output_disk.Disk)
|
||||
| `Null -> (module Output_null.Null)
|
||||
| `QEmu -> (module Output_qemu.QEMU)
|
||||
@ -1,4 +1,4 @@
|
||||
From 7cbdcc0d3acf0bc50e331ad994987c26c5917b63 Mon Sep 17 00:00:00 2001
|
||||
From efc69fffda1c881099a30077e70335cf381765eb 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
|
||||
@ -12,10 +12,10 @@ wish to support in RHEL.
|
||||
3 files changed, 17 deletions(-)
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 7c7069df..9da6c851 100644
|
||||
index b89a08a3..8f096d0c 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -24,9 +24,6 @@ virtualize those machines (physical to virtual, or p2v).
|
||||
@@ -25,9 +25,6 @@ virtualize those machines (physical to virtual, or p2v).
|
||||
To estimate the disk space needed before conversion, see
|
||||
L<virt-v2v-inspector(1)>.
|
||||
|
||||
@ -25,7 +25,7 @@ index 7c7069df..9da6c851 100644
|
||||
=head2 Input and Output
|
||||
|
||||
You normally run virt-v2v with several I<-i*> options controlling the
|
||||
@@ -39,10 +36,6 @@ The input and output sides of virt-v2v are separate and unrelated.
|
||||
@@ -40,10 +37,6 @@ The input and output sides of virt-v2v are separate and unrelated.
|
||||
Virt-v2v can read from any input and write to any output. Therefore
|
||||
these sides of virt-v2v are documented separately in this manual.
|
||||
|
||||
@ -33,10 +33,10 @@ index 7c7069df..9da6c851 100644
|
||||
-mode". In this case the source guest is always left unchanged.
|
||||
-In-place conversions may be done using L<virt-v2v-in-place(1)>.
|
||||
-
|
||||
=head2 Other virt-v2v topics
|
||||
=head2 Customization
|
||||
|
||||
L<virt-v2v-support(1)> — Supported hypervisors, virtualization
|
||||
@@ -1666,7 +1659,6 @@ L<https://rwmj.wordpress.com/2015/09/18/importing-kvm-guests-to-ovirt-or-rhev/#c
|
||||
Virt-v2v can also customize the guest during conversion, using the
|
||||
@@ -1681,7 +1674,6 @@ L<https://rwmj.wordpress.com/2015/09/18/importing-kvm-guests-to-ovirt-or-rhev/#c
|
||||
|
||||
L<virt-p2v(1)>,
|
||||
L<virt-v2v-inspector(1)>,
|
||||
@ -45,7 +45,7 @@ index 7c7069df..9da6c851 100644
|
||||
L<virt-df(1)>,
|
||||
L<virt-filesystems(1)>,
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 723a6506..4bfa1c7a 100644
|
||||
index 1c3d6064..cee516c4 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -77,7 +77,6 @@ TESTS = \
|
||||
@ -57,7 +57,7 @@ index 723a6506..4bfa1c7a 100644
|
||||
test-v2v-inspector.sh \
|
||||
test-v2v-mac.sh \
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 4148fa50..834f023d 100644
|
||||
index 427d35d4..3604e396 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -219,12 +219,6 @@ let rec main () =
|
||||
@ -1,4 +1,4 @@
|
||||
From f98822497a4a60a56cb4da2d5609d30150bdd718 Mon Sep 17 00:00:00 2001
|
||||
From 077fa5f47c842f7ac1613e061c0893745febd0f7 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Jul 2022 11:56:54 +0100
|
||||
Subject: [PATCH] RHEL 9: -oo compressed: Remove nbdcopy version check and test
|
||||
@ -34,7 +34,7 @@ index 53d4bb1b..14288bdc 100644
|
||||
|
||||
let g = open_guestfs () in
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 4bfa1c7a..f38342f0 100644
|
||||
index cee516c4..e4c5cdb9 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -86,7 +86,6 @@ TESTS = \
|
||||
@ -1,4 +1,4 @@
|
||||
From 28311593d57777fd4d19a9ce93b4b06502a154be Mon Sep 17 00:00:00 2001
|
||||
From a10fdcb822886c5fac37bd21dc7b214d93b95670 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Jul 2022 11:58:09 +0100
|
||||
Subject: [PATCH] RHEL 9: tests: Remove btrfs test
|
||||
@ -9,7 +9,7 @@ RHEL does not have btrfs so this test always fails.
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index f38342f0..810b5b50 100644
|
||||
index e4c5cdb9..fc846ee7 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -100,7 +100,6 @@ TESTS = \
|
||||
@ -1,4 +1,4 @@
|
||||
From 9b289e8d0f03c9d98d2b950feb889cad883779ea Mon Sep 17 00:00:00 2001
|
||||
From 8b57ac179cdcdb221a537fd51750e94fdc96ef97 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 28 Apr 2023 12:28:19 +0100
|
||||
Subject: [PATCH] RHEL 9: Remove --block-driver option
|
||||
@ -16,10 +16,10 @@ Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2190387
|
||||
5 files changed, 2 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/docs/virt-v2v-in-place.pod b/docs/virt-v2v-in-place.pod
|
||||
index ce57e229..6e1c5363 100644
|
||||
index 4304c0d6..b7384210 100644
|
||||
--- a/docs/virt-v2v-in-place.pod
|
||||
+++ b/docs/virt-v2v-in-place.pod
|
||||
@@ -47,16 +47,6 @@ Display help.
|
||||
@@ -51,16 +51,6 @@ Display help.
|
||||
|
||||
See I<--network> below.
|
||||
|
||||
@ -37,10 +37,10 @@ index ce57e229..6e1c5363 100644
|
||||
|
||||
=item B<--colours>
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 9da6c851..d3406be0 100644
|
||||
index 8f096d0c..74581463 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -197,16 +197,6 @@ The options are silently ignored for other input methods.
|
||||
@@ -208,16 +208,6 @@ The options are silently ignored for other input methods.
|
||||
|
||||
See I<--network> below.
|
||||
|
||||
@ -58,7 +58,7 @@ index 9da6c851..d3406be0 100644
|
||||
|
||||
=item B<--colours>
|
||||
diff --git a/in-place/in_place.ml b/in-place/in_place.ml
|
||||
index 1fbd29d3..1c690a54 100644
|
||||
index 8286dbc5..2dc406e2 100644
|
||||
--- a/in-place/in_place.ml
|
||||
+++ b/in-place/in_place.ml
|
||||
@@ -43,7 +43,6 @@ let rec main () =
|
||||
@ -78,7 +78,7 @@ index 1fbd29d3..1c690a54 100644
|
||||
[ S 'i' ], Getopt.String ("disk|libvirt|libvirtxml|ova|vmx", set_input_mode),
|
||||
s_"Set input mode (default: libvirt)";
|
||||
[ M"ic" ], Getopt.String ("uri", set_string_option_once "-ic" input_conn),
|
||||
@@ -216,12 +213,6 @@ read the man page virt-v2v-in-place(1).
|
||||
@@ -225,12 +222,6 @@ read the man page virt-v2v-in-place(1).
|
||||
|
||||
(* Dereference the arguments. *)
|
||||
let args = List.rev !args in
|
||||
@ -88,10 +88,10 @@ index 1fbd29d3..1c690a54 100644
|
||||
- | Some "virtio-scsi" -> Virtio_SCSI
|
||||
- | Some driver ->
|
||||
- error (f_"unknown block driver ‘--block-driver %s’") driver in
|
||||
let customize_ops = get_customize_ops () in
|
||||
let input_conn = !input_conn in
|
||||
let input_mode = !input_mode in
|
||||
let print_source = !print_source in
|
||||
@@ -305,7 +296,7 @@ read the man page virt-v2v-in-place(1).
|
||||
@@ -316,7 +307,7 @@ read the man page virt-v2v-in-place(1).
|
||||
|
||||
(* Get the conversion options. *)
|
||||
let conv_options = {
|
||||
@ -101,7 +101,7 @@ index 1fbd29d3..1c690a54 100644
|
||||
ks = opthandle.ks;
|
||||
network_map;
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 810b5b50..03c71882 100644
|
||||
index fc846ee7..8a710b99 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -77,7 +77,6 @@ TESTS = \
|
||||
@ -113,7 +113,7 @@ index 810b5b50..03c71882 100644
|
||||
test-v2v-mac.sh \
|
||||
test-v2v-machine-readable.sh \
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 834f023d..be5a66e2 100644
|
||||
index 3604e396..2fdaf40b 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -48,7 +48,6 @@ let rec main () =
|
||||
@ -133,7 +133,7 @@ index 834f023d..be5a66e2 100644
|
||||
[ L"compressed" ], Getopt.Unit (fun () -> set_output_option_compat "compressed" ""),
|
||||
s_"Compress output file (-of qcow2 only)";
|
||||
[ S 'i' ], Getopt.String ("disk|libvirt|libvirtxml|ova|vmx", set_input_mode),
|
||||
@@ -343,12 +340,6 @@ read the man page virt-v2v(1).
|
||||
@@ -352,12 +349,6 @@ read the man page virt-v2v(1).
|
||||
|
||||
(* Dereference the arguments. *)
|
||||
let args = List.rev !args in
|
||||
@ -143,10 +143,10 @@ index 834f023d..be5a66e2 100644
|
||||
- | Some "virtio-scsi" -> Virtio_SCSI
|
||||
- | Some driver ->
|
||||
- error (f_"unknown block driver ‘--block-driver %s’") driver in
|
||||
let customize_ops = get_customize_ops () in
|
||||
let input_conn = !input_conn in
|
||||
let input_mode = !input_mode in
|
||||
let input_transport =
|
||||
@@ -520,7 +511,7 @@ read the man page virt-v2v(1).
|
||||
@@ -531,7 +522,7 @@ read the man page virt-v2v(1).
|
||||
|
||||
(* Get the conversion options. *)
|
||||
let conv_options = {
|
||||
@ -1,4 +1,4 @@
|
||||
From 1dec94e52974e45fd3962dcbd51882fde7e9c306 Mon Sep 17 00:00:00 2001
|
||||
From 308738b0d2a41427c1aac6a912c92a2f711f7d1a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 9 Jul 2024 11:30:09 +0100
|
||||
Subject: [PATCH] RHEL: Add warning about virt-v2v-in-place not being supported
|
||||
@ -9,10 +9,10 @@ Fixes: https://issues.redhat.com/browse/RHEL-40903
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/in-place/in_place.ml b/in-place/in_place.ml
|
||||
index 1c690a54..a70e812b 100644
|
||||
index 2dc406e2..9d24de78 100644
|
||||
--- a/in-place/in_place.ml
|
||||
+++ b/in-place/in_place.ml
|
||||
@@ -197,6 +197,9 @@ read the man page virt-v2v-in-place(1).
|
||||
@@ -206,6 +206,9 @@ read the man page virt-v2v-in-place(1).
|
||||
let opthandle = create_standard_options argspec ~anon_fun ~key_opts:true ~machine_readable:true usage_msg in
|
||||
Getopt.parse opthandle.getopt;
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From a794e7936064812540f0bb8b37827fa562a6fba4 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 30 Oct 2024 15:39:31 +0000
|
||||
Subject: [PATCH] in-place: Add a warning about checking the exit code
|
||||
|
||||
(cherry picked from commit 8b768fd9b17412ee8893447dc0f1e75bc612df58)
|
||||
---
|
||||
docs/virt-v2v-in-place.pod | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/docs/virt-v2v-in-place.pod b/docs/virt-v2v-in-place.pod
|
||||
index b7384210..4057dae5 100644
|
||||
--- a/docs/virt-v2v-in-place.pod
|
||||
+++ b/docs/virt-v2v-in-place.pod
|
||||
@@ -35,6 +35,17 @@ If the guest has been copied to local libvirt then:
|
||||
|
||||
virt-v2v-in-place -i libvirt guest
|
||||
|
||||
+=head2 Exit code
|
||||
+
|
||||
+If virt-v2v-in-place fails it will return a non-zero (error) exit
|
||||
+code. In this case, the disk image will be in an B<unknown, possibly
|
||||
+corrupted state>.
|
||||
+
|
||||
+If the image contains important information you should ensure you have
|
||||
+a backup before trying a virt-v2v-in-place conversion. And you should
|
||||
+check the exit code is zero before using the disk image after a
|
||||
+conversion.
|
||||
+
|
||||
=head1 EXAMPLES
|
||||
|
||||
=head1 OPTIONS
|
||||
30
SOURCES/0016-i-libvirt-Trim-whitespace-around-name.patch
Normal file
30
SOURCES/0016-i-libvirt-Trim-whitespace-around-name.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 669acaf0f56ffdb85a1d72fb37ff2958600003cc Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 15 Nov 2024 14:00:07 +0000
|
||||
Subject: [PATCH] -i libvirt: Trim whitespace around name
|
||||
|
||||
In -i libvirt / -i libvirtxml we didn't trim whitespace
|
||||
around the name, so:
|
||||
|
||||
<name> foo </name>
|
||||
|
||||
would set the input name to the literal string " foo ".
|
||||
|
||||
(cherry picked from commit 9cb76069040543ce25003ac8c620aff3724964fc)
|
||||
---
|
||||
input/parse_libvirt_xml.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/input/parse_libvirt_xml.ml b/input/parse_libvirt_xml.ml
|
||||
index 4d0fcdf3..8009a05a 100644
|
||||
--- a/input/parse_libvirt_xml.ml
|
||||
+++ b/input/parse_libvirt_xml.ml
|
||||
@@ -78,7 +78,7 @@ let parse_libvirt_xml ?conn xml =
|
||||
match xpath_string "/domain/name/text()" with
|
||||
| None | Some "" ->
|
||||
error (f_"in the libvirt XML metadata, <name> is missing or empty")
|
||||
- | Some s -> s in
|
||||
+ | Some s -> String.trim s in
|
||||
let genid =
|
||||
match xpath_string "/domain/genid/text()" with
|
||||
| None | Some "" -> None
|
||||
962
SOURCES/0017-o-qemu-Replace-hard-coded-UEFI-paths.patch
Normal file
962
SOURCES/0017-o-qemu-Replace-hard-coded-UEFI-paths.patch
Normal file
@ -0,0 +1,962 @@
|
||||
From faf29e12e7928345ca0178923f468fee34d067e8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 15 Nov 2024 11:49:26 +0000
|
||||
Subject: [PATCH] -o qemu: Replace hard-coded UEFI paths
|
||||
|
||||
Update the qemu shell script to simply find the UEFI paths as
|
||||
required.
|
||||
|
||||
Remove lib/uefi.ml:find_uefi_firmware as this function is no longer
|
||||
needed.
|
||||
|
||||
Remove common/mlv2v/ everywhere. This contained a list of UEFI code
|
||||
and NVRAM files which is no longer used.
|
||||
|
||||
Update common submodule. This pulls in:
|
||||
|
||||
Richard W.M. Jones (5):
|
||||
mlcustomize/customize_run.ml: Move 'in' to new line
|
||||
mlstdutils/guestfs_config: Define host_os
|
||||
mlcustomize, mltools: Check guest OS is compatible before allowing --run
|
||||
Remove mlv2v/ subdirectory
|
||||
qemuopts: Add ability to add raw, unquoted output to qemu scripts
|
||||
qemuopts: Fix missing break statement
|
||||
|
||||
(cherry picked from commit 69b4e83935b03e10c5da9b93f987eb8ddd2cde31)
|
||||
---
|
||||
Makefile.am | 1 -
|
||||
common | 2 +-
|
||||
configure.ac | 1 -
|
||||
convert/Makefile.am | 2 -
|
||||
in-place/Makefile.am | 4 +-
|
||||
input/Makefile.am | 2 -
|
||||
inspector/Makefile.am | 4 +-
|
||||
lib/Makefile.am | 1 -
|
||||
lib/utils.ml | 20 -------
|
||||
lib/utils.mli | 4 --
|
||||
ocaml-dep.sh.in | 1 -
|
||||
output/Makefile.am | 2 -
|
||||
output/output_qemu.ml | 121 +++++++++++++++++++++++-------------------
|
||||
output/qemuopts-c.c | 12 +++++
|
||||
output/qemuopts.ml | 1 +
|
||||
output/qemuopts.mli | 4 ++
|
||||
po/POTFILES-ml | 1 -
|
||||
v2v/Makefile.am | 5 +-
|
||||
18 files changed, 87 insertions(+), 101 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 51370188..4cc87324 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -37,7 +37,6 @@ SUBDIRS += common/mlxml
|
||||
SUBDIRS += common/mltools
|
||||
SUBDIRS += common/mlcustomize
|
||||
SUBDIRS += common/mldrivers
|
||||
-SUBDIRS += common/mlv2v
|
||||
SUBDIRS += lib
|
||||
SUBDIRS += input
|
||||
SUBDIRS += output
|
||||
Submodule common 2d42128e..faee2645:
|
||||
diff --git a/common/.gitignore b/common/.gitignore
|
||||
index 49915e31..44f49eb6 100644
|
||||
--- a/common/.gitignore
|
||||
+++ b/common/.gitignore
|
||||
@@ -58,7 +58,6 @@ Makefile.in
|
||||
/mlutils/.depend
|
||||
/mlutils/c_utils_unit_tests
|
||||
/mlutils/oUnit-*
|
||||
-/mlv2v/.depend
|
||||
/mlvisit/.depend
|
||||
/mlvisit/visit_tests
|
||||
/mlxml/.depend
|
||||
diff --git a/common/mlcustomize/customize_run.ml b/common/mlcustomize/customize_run.ml
|
||||
index 1d7c13ea..5ec5ed11 100644
|
||||
--- a/common/mlcustomize/customize_run.ml
|
||||
+++ b/common/mlcustomize/customize_run.ml
|
||||
@@ -44,21 +44,13 @@ let run (g : G.guestfs) root (ops : ops) =
|
||||
let debug_logfile () =
|
||||
try g#download logfile "/dev/stderr"
|
||||
with exn ->
|
||||
- warning (f_"log file %s: %s (ignored)") logfile (Printexc.to_string exn) in
|
||||
+ warning (f_"log file %s: %s (ignored)") logfile (Printexc.to_string exn)
|
||||
+ in
|
||||
|
||||
(* Useful wrapper for scripts. *)
|
||||
let do_run ~display ?(warn_failed_no_network = false) cmd =
|
||||
- let incompatible_fn () =
|
||||
- let guest_arch = g#inspect_get_arch root in
|
||||
- error (f_"host cpu (%s) and guest arch (%s) are not compatible, \
|
||||
- so you cannot use command line options that involve \
|
||||
- running commands in the guest. Use --firstboot scripts \
|
||||
- instead.")
|
||||
- Guestfs_config.host_cpu guest_arch
|
||||
- in
|
||||
-
|
||||
try
|
||||
- run_in_guest_command g root ~logfile ~incompatible_fn cmd
|
||||
+ run_in_guest_command g root ~logfile cmd
|
||||
with
|
||||
G.Error msg ->
|
||||
debug_logfile ();
|
||||
diff --git a/common/mlstdutils/guestfs_config.ml.in b/common/mlstdutils/guestfs_config.ml.in
|
||||
index 0ab95bd9..84929581 100644
|
||||
--- a/common/mlstdutils/guestfs_config.ml.in
|
||||
+++ b/common/mlstdutils/guestfs_config.ml.in
|
||||
@@ -22,4 +22,5 @@ let package_version = "@PACKAGE_VERSION@"
|
||||
let package_version_full = "@PACKAGE_VERSION_FULL@"
|
||||
let prefix = "@prefix@"
|
||||
let datadir = prefix ^ "/share"
|
||||
+let host_os = "@host_os@"
|
||||
let host_cpu = "@host_cpu@"
|
||||
diff --git a/common/mlstdutils/guestfs_config.mli b/common/mlstdutils/guestfs_config.mli
|
||||
index 78df3040..70161c01 100644
|
||||
--- a/common/mlstdutils/guestfs_config.mli
|
||||
+++ b/common/mlstdutils/guestfs_config.mli
|
||||
@@ -31,5 +31,8 @@ val prefix : string
|
||||
val datadir : string
|
||||
(** The configure value [@datadir@] *)
|
||||
|
||||
+val host_os : string
|
||||
+(** The configure value [@host_os@] *)
|
||||
+
|
||||
val host_cpu : string
|
||||
(** The configure value [@host_cpu@] *)
|
||||
diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
|
||||
index 23f16c51..1ff72ff3 100644
|
||||
--- a/common/mltools/tools_utils.ml
|
||||
+++ b/common/mltools/tools_utils.ml
|
||||
@@ -737,11 +737,21 @@ let run_in_guest_command g root ?logfile ?incompatible_fn cmd =
|
||||
(* Is the host_cpu compatible with the guest arch? ie. Can we
|
||||
* run commands in this guest?
|
||||
*)
|
||||
+ let guest_os = g#inspect_get_type root in
|
||||
+ let guest_os_compatible =
|
||||
+ String.is_prefix Guestfs_config.host_os "linux" &&
|
||||
+ guest_os = "linux" in
|
||||
let guest_arch = g#inspect_get_arch root in
|
||||
let guest_arch_compatible = guest_arch_compatible guest_arch in
|
||||
- if not guest_arch_compatible then (
|
||||
+ if not guest_os_compatible || not guest_arch_compatible then (
|
||||
match incompatible_fn with
|
||||
- | None -> ()
|
||||
+ | None ->
|
||||
+ error (f_"host (%s/%s) and guest (%s/%s) are not compatible, \
|
||||
+ so you cannot use command line options that involve \
|
||||
+ running commands in the guest. Use --firstboot scripts \
|
||||
+ instead.")
|
||||
+ Guestfs_config.host_os Guestfs_config.host_cpu
|
||||
+ guest_os guest_arch
|
||||
| Some fn -> fn ()
|
||||
)
|
||||
else (
|
||||
diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli
|
||||
index 193ba7b6..4d627676 100644
|
||||
--- a/common/mltools/tools_utils.mli
|
||||
+++ b/common/mltools/tools_utils.mli
|
||||
@@ -233,9 +233,15 @@ val with_timeout : string -> int -> ?sleep:int -> (unit -> 'a option) -> 'a
|
||||
val run_in_guest_command : Guestfs.guestfs -> string -> ?logfile:string -> ?incompatible_fn:(unit -> unit) -> string -> unit
|
||||
(** [run_in_guest_command g root ?incompatible_archs_fn cmd]
|
||||
runs a command in the guest, which is already mounted for the
|
||||
- specified [root]. The command is run directly in case the
|
||||
- architecture of the host and the guest are compatible, optionally
|
||||
- calling [?incompatible_fn] in case they are not.
|
||||
+ specified [root].
|
||||
+
|
||||
+ The command is run directly in the case that the host and guest
|
||||
+ are compatible.
|
||||
+
|
||||
+ If they are not compatible, the command is not run and an error
|
||||
+ is printed. However you can override the error by setting
|
||||
+ [?incompatible_fn], which is called so you can do something else
|
||||
+ (like install a firstboot script).
|
||||
|
||||
[?logfile] is an optional file in the guest to where redirect
|
||||
stdout and stderr of the command. *)
|
||||
diff --git a/common/mlv2v/Makefile.am b/common/mlv2v/Makefile.am
|
||||
deleted file mode 100644
|
||||
index 945f9813..00000000
|
||||
--- a/common/mlv2v/Makefile.am
|
||||
+++ /dev/null
|
||||
@@ -1,91 +0,0 @@
|
||||
-# libguestfs OCaml virt-v2v generated code
|
||||
-# Copyright (C) 2011-2019 Red Hat Inc.
|
||||
-#
|
||||
-# This program is free software; you can redistribute it and/or modify
|
||||
-# it under the terms of the GNU General Public License as published by
|
||||
-# the Free Software Foundation; either version 2 of the License, or
|
||||
-# (at your option) any later version.
|
||||
-#
|
||||
-# This program is distributed in the hope that it will be useful,
|
||||
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-# GNU General Public License for more details.
|
||||
-#
|
||||
-# You should have received a copy of the GNU General Public License
|
||||
-# along with this program; if not, write to the Free Software
|
||||
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
-
|
||||
-include $(top_srcdir)/subdir-rules.mk
|
||||
-
|
||||
-EXTRA_DIST = \
|
||||
- $(generator_built) \
|
||||
- $(SOURCES_MLI) \
|
||||
- $(SOURCES_ML) \
|
||||
- $(SOURCES_C)
|
||||
-
|
||||
-generator_built = \
|
||||
- uefi.mli \
|
||||
- uefi.ml
|
||||
-
|
||||
-SOURCES_MLI = \
|
||||
- uefi.mli
|
||||
-
|
||||
-SOURCES_ML = \
|
||||
- uefi.ml
|
||||
-
|
||||
-SOURCES_C = \
|
||||
- dummy.c
|
||||
-
|
||||
-# We pretend that we're building a C library. automake handles the
|
||||
-# compilation of the C sources for us. At the end we take the C
|
||||
-# objects and OCaml objects and link them into the OCaml library.
|
||||
-# This C library is never used.
|
||||
-
|
||||
-noinst_LIBRARIES = libmlv2v.a
|
||||
-
|
||||
-if !HAVE_OCAMLOPT
|
||||
-MLV2V_CMA = mlv2v.cma
|
||||
-else
|
||||
-MLV2V_CMA = mlv2v.cmxa
|
||||
-endif
|
||||
-
|
||||
-noinst_DATA = $(MLV2V_CMA)
|
||||
-
|
||||
-libmlv2v_a_SOURCES = $(SOURCES_C)
|
||||
-libmlv2v_a_CPPFLAGS = \
|
||||
- -DCAML_NAME_SPACE \
|
||||
- -I. \
|
||||
- -I$(top_builddir) \
|
||||
- -I$(shell $(OCAMLC) -where)
|
||||
-libmlv2v_a_CFLAGS = \
|
||||
- $(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
- -fPIC
|
||||
-
|
||||
-BOBJECTS = $(SOURCES_ML:.ml=.cmo)
|
||||
-XOBJECTS = $(BOBJECTS:.cmo=.cmx)
|
||||
-
|
||||
-OCAMLPACKAGES = \
|
||||
- -package str,unix \
|
||||
- -I $(builddir)
|
||||
-OCAMLPACKAGES_TESTS = $(MLV2V_CMA)
|
||||
-
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
-
|
||||
-if !HAVE_OCAMLOPT
|
||||
-OBJECTS = $(BOBJECTS)
|
||||
-else
|
||||
-OBJECTS = $(XOBJECTS)
|
||||
-endif
|
||||
-
|
||||
-libmlv2v_a_DEPENDENCIES = $(OBJECTS)
|
||||
-
|
||||
-$(MLV2V_CMA): $(OBJECTS) libmlv2v.a
|
||||
- $(OCAMLFIND) mklib $(OCAMLPACKAGES) \
|
||||
- $(OBJECTS) $(libmlv2v_a_OBJECTS) -o mlv2v
|
||||
-
|
||||
-# OCaml dependencies.
|
||||
-.depend: $(srcdir)/*.mli $(srcdir)/*.ml
|
||||
- $(top_builddir)/ocaml-dep.sh $^
|
||||
--include .depend
|
||||
-
|
||||
-.PHONY: docs
|
||||
diff --git a/common/mlv2v/dummy.c b/common/mlv2v/dummy.c
|
||||
deleted file mode 100644
|
||||
index ebab6198..00000000
|
||||
--- a/common/mlv2v/dummy.c
|
||||
+++ /dev/null
|
||||
@@ -1,2 +0,0 @@
|
||||
-/* Dummy source, to be used for OCaml-based tools with no C sources. */
|
||||
-enum { foo = 1 };
|
||||
diff --git a/common/mlv2v/uefi.ml b/common/mlv2v/uefi.ml
|
||||
deleted file mode 100644
|
||||
index 7a2610f2..00000000
|
||||
--- a/common/mlv2v/uefi.ml
|
||||
+++ /dev/null
|
||||
@@ -1,71 +0,0 @@
|
||||
-(* libguestfs generated file
|
||||
- * WARNING: THIS FILE IS GENERATED
|
||||
- * from the code in the generator/ subdirectory.
|
||||
- * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
|
||||
- *
|
||||
- * Copyright (C) 2009-2023 Red Hat Inc.
|
||||
- *
|
||||
- * This program is free software; you can redistribute it and/or modify
|
||||
- * it under the terms of the GNU General Public License as published by
|
||||
- * the Free Software Foundation; either version 2 of the License, or
|
||||
- * (at your option) any later version.
|
||||
- *
|
||||
- * This program is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU General Public License along
|
||||
- * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
- *)
|
||||
-
|
||||
-type uefi_firmware = {
|
||||
- code : string;
|
||||
- code_debug : string option;
|
||||
- vars : string;
|
||||
- flags : uefi_flags;
|
||||
-}
|
||||
-and uefi_flags = uefi_flag list
|
||||
-and uefi_flag = UEFI_FLAG_SECURE_BOOT_REQUIRED
|
||||
-
|
||||
-let uefi_aarch64_firmware = [
|
||||
- { code = "/usr/share/AAVMF/AAVMF_CODE.fd";
|
||||
- code_debug = Some "/usr/share/AAVMF/AAVMF_CODE.verbose.fd";
|
||||
- vars = "/usr/share/AAVMF/AAVMF_VARS.fd";
|
||||
- flags = [];
|
||||
- };
|
||||
- { code = "/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw";
|
||||
- code_debug = None;
|
||||
- vars = "/usr/share/edk2/aarch64/vars-template-pflash.raw";
|
||||
- flags = [];
|
||||
- };
|
||||
-]
|
||||
-
|
||||
-let uefi_x86_64_firmware = [
|
||||
- { code = "/usr/share/OVMF/OVMF_CODE.fd";
|
||||
- code_debug = None;
|
||||
- vars = "/usr/share/OVMF/OVMF_VARS.fd";
|
||||
- flags = [];
|
||||
- };
|
||||
- { code = "/usr/share/OVMF/OVMF_CODE.secboot.fd";
|
||||
- code_debug = None;
|
||||
- vars = "/usr/share/OVMF/OVMF_VARS.fd";
|
||||
- flags = [UEFI_FLAG_SECURE_BOOT_REQUIRED];
|
||||
- };
|
||||
- { code = "/usr/share/edk2/ovmf/OVMF_CODE.fd";
|
||||
- code_debug = None;
|
||||
- vars = "/usr/share/edk2/ovmf/OVMF_VARS.fd";
|
||||
- flags = [];
|
||||
- };
|
||||
- { code = "/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd";
|
||||
- code_debug = None;
|
||||
- vars = "/usr/share/edk2/ovmf/OVMF_VARS.fd";
|
||||
- flags = [UEFI_FLAG_SECURE_BOOT_REQUIRED];
|
||||
- };
|
||||
- { code = "/usr/share/qemu/ovmf-x86_64-code.bin";
|
||||
- code_debug = None;
|
||||
- vars = "/usr/share/qemu/ovmf-x86_64-vars.bin";
|
||||
- flags = [];
|
||||
- };
|
||||
-]
|
||||
diff --git a/common/mlv2v/uefi.mli b/common/mlv2v/uefi.mli
|
||||
deleted file mode 100644
|
||||
index 33789979..00000000
|
||||
--- a/common/mlv2v/uefi.mli
|
||||
+++ /dev/null
|
||||
@@ -1,35 +0,0 @@
|
||||
-(* libguestfs generated file
|
||||
- * WARNING: THIS FILE IS GENERATED
|
||||
- * from the code in the generator/ subdirectory.
|
||||
- * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
|
||||
- *
|
||||
- * Copyright (C) 2009-2023 Red Hat Inc.
|
||||
- *
|
||||
- * This program is free software; you can redistribute it and/or modify
|
||||
- * it under the terms of the GNU General Public License as published by
|
||||
- * the Free Software Foundation; either version 2 of the License, or
|
||||
- * (at your option) any later version.
|
||||
- *
|
||||
- * This program is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU General Public License along
|
||||
- * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
- *)
|
||||
-
|
||||
-(** UEFI paths. *)
|
||||
-
|
||||
-type uefi_firmware = {
|
||||
- code : string; (** code file *)
|
||||
- code_debug : string option; (** code debug file *)
|
||||
- vars : string; (** vars template file *)
|
||||
- flags : uefi_flags; (** flags *)
|
||||
-}
|
||||
-and uefi_flags = uefi_flag list
|
||||
-and uefi_flag = UEFI_FLAG_SECURE_BOOT_REQUIRED
|
||||
-
|
||||
-val uefi_aarch64_firmware : uefi_firmware list
|
||||
-val uefi_x86_64_firmware : uefi_firmware list
|
||||
diff --git a/common/qemuopts/qemuopts.c b/common/qemuopts/qemuopts.c
|
||||
index b12fe38f..7dd9136d 100644
|
||||
--- a/common/qemuopts/qemuopts.c
|
||||
+++ b/common/qemuopts/qemuopts.c
|
||||
@@ -76,13 +76,14 @@ enum qopt_type {
|
||||
QOPT_FLAG,
|
||||
QOPT_ARG,
|
||||
QOPT_ARG_NOQUOTE,
|
||||
+ QOPT_RAW,
|
||||
QOPT_ARG_LIST,
|
||||
};
|
||||
|
||||
struct qopt {
|
||||
enum qopt_type type;
|
||||
char *flag; /* eg. "-m" */
|
||||
- char *value; /* Value, for QOPT_ARG, QOPT_ARG_NOQUOTE. */
|
||||
+ char *value; /* Value, for QOPT_ARG, QOPT_ARG_NOQUOTE, QOPT_RAW */
|
||||
char **values; /* List of values, for QOPT_ARG_LIST. */
|
||||
};
|
||||
|
||||
@@ -353,6 +354,27 @@ qemuopts_add_arg_noquote (struct qemuopts *qopts, const char *flag,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int
|
||||
+qemuopts_add_raw (struct qemuopts *qopts, const char *str)
|
||||
+{
|
||||
+ struct qopt *qopt;
|
||||
+ char *value_copy;
|
||||
+
|
||||
+ value_copy = strdup (str);
|
||||
+ if (value_copy == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
+ if ((qopt = extend_options (qopts)) == NULL) {
|
||||
+ free (value_copy);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ qopt->type = QOPT_RAW;
|
||||
+ qopt->value = value_copy;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Start an argument that takes a comma-separated list of fields.
|
||||
*
|
||||
@@ -724,6 +746,12 @@ qemuopts_to_channel (struct qemuopts *qopts, FILE *fp)
|
||||
shell_and_comma_quote (qopts->options[i].values[j], fp);
|
||||
}
|
||||
break;
|
||||
+
|
||||
+ case QOPT_RAW:
|
||||
+ fprintf (fp, "%s%s",
|
||||
+ nl, qopts->options[i].value);
|
||||
+ break;
|
||||
+
|
||||
}
|
||||
}
|
||||
fputc ('\n', fp);
|
||||
@@ -769,6 +797,12 @@ qemuopts_to_argv (struct qemuopts *qopts)
|
||||
case QOPT_ARG:
|
||||
case QOPT_ARG_LIST:
|
||||
n += 2;
|
||||
+ break;
|
||||
+
|
||||
+ /* Raw is incompatible with using argv. */
|
||||
+ case QOPT_RAW:
|
||||
+ errno = EINVAL;
|
||||
+ return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -845,6 +879,10 @@ qemuopts_to_argv (struct qemuopts *qopts)
|
||||
}
|
||||
ret[n][len] = '\0';
|
||||
n++;
|
||||
+ break;
|
||||
+
|
||||
+ case QOPT_RAW:
|
||||
+ abort ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -924,7 +962,8 @@ qemuopts_to_config_channel (struct qemuopts *qopts, FILE *fp)
|
||||
return -1;
|
||||
|
||||
case QOPT_ARG_NOQUOTE:
|
||||
- /* arg_noquote is incompatible with this function. */
|
||||
+ case QOPT_RAW:
|
||||
+ /* arg_noquote and raw are incompatible with this function. */
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
||||
@@ -960,6 +999,7 @@ qemuopts_to_config_channel (struct qemuopts *qopts, FILE *fp)
|
||||
case QOPT_FLAG:
|
||||
case QOPT_ARG_NOQUOTE:
|
||||
case QOPT_ARG:
|
||||
+ case QOPT_RAW:
|
||||
abort ();
|
||||
|
||||
case QOPT_ARG_LIST:
|
||||
diff --git a/common/qemuopts/qemuopts.h b/common/qemuopts/qemuopts.h
|
||||
index 08efcd9a..29f81475 100644
|
||||
--- a/common/qemuopts/qemuopts.h
|
||||
+++ b/common/qemuopts/qemuopts.h
|
||||
@@ -31,6 +31,7 @@ extern int qemuopts_add_flag (struct qemuopts *qopts, const char *flag);
|
||||
extern int qemuopts_add_arg (struct qemuopts *qopts, const char *flag, const char *value);
|
||||
extern int qemuopts_add_arg_format (struct qemuopts *qopts, const char *flag, const char *fs, ...) __attribute__((format (printf,3,4)));
|
||||
extern int qemuopts_add_arg_noquote (struct qemuopts *qopts, const char *flag, const char *value);
|
||||
+extern int qemuopts_add_raw (struct qemuopts *qopts, const char *str);
|
||||
extern int qemuopts_start_arg_list (struct qemuopts *qopts, const char *flag);
|
||||
extern int qemuopts_append_arg_list (struct qemuopts *qopts, const char *value);
|
||||
extern int qemuopts_append_arg_list_format (struct qemuopts *qopts, const char *fs, ...) __attribute__((format (printf,2,3)));
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 0c8473bd..8d6a506b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -137,7 +137,6 @@ AC_CONFIG_FILES([Makefile
|
||||
common/mlstdutils/guestfs_config.ml
|
||||
common/mltools/Makefile
|
||||
common/mlutils/Makefile
|
||||
- common/mlv2v/Makefile
|
||||
common/mlxml/Makefile
|
||||
common/qemuopts/Makefile
|
||||
common/utils/Makefile
|
||||
diff --git a/convert/Makefile.am b/convert/Makefile.am
|
||||
index 2d34fe7c..2809c555 100644
|
||||
--- a/convert/Makefile.am
|
||||
+++ b/convert/Makefile.am
|
||||
@@ -83,7 +83,6 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlpcre \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
-I $(top_builddir)/common/mldrivers \
|
||||
- -I $(top_builddir)/common/mlv2v \
|
||||
-I $(top_builddir)/common/mlxml
|
||||
if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
@@ -113,7 +112,6 @@ OCAMLLINKFLAGS = \
|
||||
mltools.$(MLARCHIVE) \
|
||||
mlcustomize.$(MLARCHIVE) \
|
||||
mldrivers.$(MLARCHIVE) \
|
||||
- mlv2v.$(MLARCHIVE) \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
$(LINK_CUSTOM_OCAMLC_ONLY)
|
||||
|
||||
diff --git a/in-place/Makefile.am b/in-place/Makefile.am
|
||||
index 2217ff40..2fecb3a7 100644
|
||||
--- a/in-place/Makefile.am
|
||||
+++ b/in-place/Makefile.am
|
||||
@@ -64,8 +64,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlxml \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
-I $(top_builddir)/common/mlcustomize \
|
||||
- -I $(top_builddir)/common/mldrivers \
|
||||
- -I $(top_builddir)/common/mlv2v
|
||||
+ -I $(top_builddir)/common/mldrivers
|
||||
if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
endif
|
||||
@@ -101,7 +100,6 @@ OCAMLLINKFLAGS = \
|
||||
mllibvirt.$(MLARCHIVE) \
|
||||
mlcustomize.$(MLARCHIVE) \
|
||||
mldrivers.$(MLARCHIVE) \
|
||||
- mlv2v.$(MLARCHIVE) \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
mlconvert.$(MLARCHIVE) \
|
||||
mlinput.$(MLARCHIVE) \
|
||||
diff --git a/input/Makefile.am b/input/Makefile.am
|
||||
index 4153f878..75bee624 100644
|
||||
--- a/input/Makefile.am
|
||||
+++ b/input/Makefile.am
|
||||
@@ -104,7 +104,6 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlgettext \
|
||||
-I $(top_builddir)/common/mlpcre \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
- -I $(top_builddir)/common/mlv2v \
|
||||
-I $(top_builddir)/common/mlxml
|
||||
if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
@@ -132,7 +131,6 @@ OCAMLLINKFLAGS = \
|
||||
mlxml.$(MLARCHIVE) \
|
||||
mltools.$(MLARCHIVE) \
|
||||
mllibvirt.$(MLARCHIVE) \
|
||||
- mlv2v.$(MLARCHIVE) \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
$(LINK_CUSTOM_OCAMLC_ONLY)
|
||||
|
||||
diff --git a/inspector/Makefile.am b/inspector/Makefile.am
|
||||
index 51ac71f9..172b2dc0 100644
|
||||
--- a/inspector/Makefile.am
|
||||
+++ b/inspector/Makefile.am
|
||||
@@ -64,8 +64,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlxml \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
-I $(top_builddir)/common/mlcustomize \
|
||||
- -I $(top_builddir)/common/mldrivers \
|
||||
- -I $(top_builddir)/common/mlv2v
|
||||
+ -I $(top_builddir)/common/mldrivers
|
||||
if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
endif
|
||||
@@ -101,7 +100,6 @@ OCAMLLINKFLAGS = \
|
||||
mllibvirt.$(MLARCHIVE) \
|
||||
mlcustomize.$(MLARCHIVE) \
|
||||
mldrivers.$(MLARCHIVE) \
|
||||
- mlv2v.$(MLARCHIVE) \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
mlconvert.$(MLARCHIVE) \
|
||||
mlinput.$(MLARCHIVE) \
|
||||
diff --git a/lib/Makefile.am b/lib/Makefile.am
|
||||
index a8776019..5cec771c 100644
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -87,7 +87,6 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlstdutils \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
-I $(top_builddir)/common/mlutils \
|
||||
- -I $(top_builddir)/common/mlv2v \
|
||||
-I $(top_builddir)/common/mlxml
|
||||
OCAMLPACKAGES_TESTS = $(MLV2VLIB_CMA)
|
||||
|
||||
diff --git a/lib/utils.ml b/lib/utils.ml
|
||||
index 4c9b7415..c4cfd89b 100644
|
||||
--- a/lib/utils.ml
|
||||
+++ b/lib/utils.ml
|
||||
@@ -69,26 +69,6 @@ let qemu_supports_sound_card = function
|
||||
| Types.USBAudio
|
||||
-> false
|
||||
|
||||
-(* Find the UEFI firmware. *)
|
||||
-let find_uefi_firmware guest_arch =
|
||||
- let files =
|
||||
- (* The lists of firmware are actually defined in common/utils/uefi.c. *)
|
||||
- match guest_arch with
|
||||
- | "x86_64" -> Uefi.uefi_x86_64_firmware
|
||||
- | "aarch64" -> Uefi.uefi_aarch64_firmware
|
||||
- | arch ->
|
||||
- error (f_"don’t know how to convert UEFI guests for architecture %s")
|
||||
- guest_arch in
|
||||
- let rec loop = function
|
||||
- | [] ->
|
||||
- error (f_"cannot find firmware for UEFI guests.\n\nYou probably \
|
||||
- need to install OVMF (x86-64), or AAVMF (aarch64)")
|
||||
- | ({ Uefi.code; vars = vars_template } as ret) :: rest ->
|
||||
- if Sys.file_exists code && Sys.file_exists vars_template then ret
|
||||
- else loop rest
|
||||
- in
|
||||
- loop files
|
||||
-
|
||||
let compare_app2_versions app1 app2 =
|
||||
let i = compare app1.Guestfs.app2_epoch app2.Guestfs.app2_epoch in
|
||||
if i <> 0 then i
|
||||
diff --git a/lib/utils.mli b/lib/utils.mli
|
||||
index 46d05306..afe61a4e 100644
|
||||
--- a/lib/utils.mli
|
||||
+++ b/lib/utils.mli
|
||||
@@ -36,10 +36,6 @@ val kvm_arch : string -> string
|
||||
val qemu_supports_sound_card : Types.source_sound_model -> bool
|
||||
(** Does qemu support the given sound card? *)
|
||||
|
||||
-val find_uefi_firmware : string -> Uefi.uefi_firmware
|
||||
-(** Find the UEFI firmware for the guest architecture.
|
||||
- This cannot return an error, it calls [error] and fails instead. *)
|
||||
-
|
||||
val compare_app2_versions : Guestfs.application2 -> Guestfs.application2 -> int
|
||||
(** Compare two app versions. *)
|
||||
|
||||
diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in
|
||||
index 7f3130e5..565f880f 100755
|
||||
--- a/ocaml-dep.sh.in
|
||||
+++ b/ocaml-dep.sh.in
|
||||
@@ -41,7 +41,6 @@ common/mlprogress
|
||||
common/mlstdutils
|
||||
common/mltools
|
||||
common/mlutils
|
||||
-common/mlv2v
|
||||
common/mlvisit
|
||||
common/mlxml
|
||||
lib
|
||||
diff --git a/output/Makefile.am b/output/Makefile.am
|
||||
index 1e6799c3..f736d52d 100644
|
||||
--- a/output/Makefile.am
|
||||
+++ b/output/Makefile.am
|
||||
@@ -157,7 +157,6 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlgettext \
|
||||
-I $(top_builddir)/common/mlpcre \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
- -I $(top_builddir)/common/mlv2v \
|
||||
-I $(top_builddir)/common/mlxml
|
||||
if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
@@ -188,7 +187,6 @@ OCAMLLINKFLAGS = \
|
||||
mlxml.$(MLARCHIVE) \
|
||||
mltools.$(MLARCHIVE) \
|
||||
mllibvirt.$(MLARCHIVE) \
|
||||
- mlv2v.$(MLARCHIVE) \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
$(LINK_CUSTOM_OCAMLC_ONLY)
|
||||
|
||||
diff --git a/output/output_qemu.ml b/output/output_qemu.ml
|
||||
index b6f24565..fd0182d6 100644
|
||||
--- a/output/output_qemu.ml
|
||||
+++ b/output/output_qemu.ml
|
||||
@@ -105,30 +105,56 @@ module QEMU = struct
|
||||
|
||||
let { guestcaps; target_buses; target_firmware } = target_meta in
|
||||
|
||||
+ (* Start the shell script. Write it to a temporary file
|
||||
+ * which we rename at the end.
|
||||
+ *)
|
||||
let file = output_storage // output_name ^ ".sh" in
|
||||
+ let tmpfile = file ^ ".tmp" in
|
||||
+ On_exit.unlink tmpfile;
|
||||
|
||||
- let uefi_firmware =
|
||||
- match target_firmware with
|
||||
- | TargetBIOS -> None
|
||||
- | TargetUEFI -> Some (find_uefi_firmware guestcaps.gcaps_arch) in
|
||||
- let machine, secure_boot_required =
|
||||
- match guestcaps.gcaps_machine, uefi_firmware with
|
||||
- | _, Some { Uefi.flags }
|
||||
- when List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED flags ->
|
||||
- (* Force machine type to Q35 because PC does not support
|
||||
- * secure boot. We must remove this when we get the
|
||||
- * correct machine type from libosinfo in future. XXX
|
||||
- *)
|
||||
- Q35, true
|
||||
- | machine, _ ->
|
||||
- machine, false in
|
||||
- let smm = secure_boot_required in
|
||||
+ let chan = open_out tmpfile in
|
||||
+ let fpf fs = fprintf chan fs in
|
||||
+ fpf "#!/bin/sh -\n";
|
||||
+ fpf "\n";
|
||||
|
||||
- let machine_str =
|
||||
- match machine with
|
||||
- | I440FX -> "pc"
|
||||
- | Q35 -> "q35"
|
||||
- | Virt -> "virt" in
|
||||
+ (* Allow the user to override our choice of machine type. *)
|
||||
+ let () =
|
||||
+ let machine_str =
|
||||
+ match guestcaps.gcaps_machine with
|
||||
+ | I440FX -> "pc"
|
||||
+ | Q35 -> "q35"
|
||||
+ | Virt -> "virt" in
|
||||
+ fpf "machine=%s\n" machine_str;
|
||||
+ fpf "\n" in
|
||||
+
|
||||
+ (* If the firmware is UEFI, locate the OVMF files. *)
|
||||
+ (match target_firmware with
|
||||
+ | TargetBIOS -> ()
|
||||
+ | TargetUEFI ->
|
||||
+ let prefix =
|
||||
+ match guestcaps.gcaps_arch with
|
||||
+ | "x86_64" ->
|
||||
+ fpf "uefi_dir=/usr/share/OVMF\n"; "OVMF"
|
||||
+ | "aarch64" ->
|
||||
+ fpf "uefi_dir=/usr/share/AAVMF\n"; "AAVMF"
|
||||
+ | arch ->
|
||||
+ error (f_"don’t know how to convert UEFI guests \
|
||||
+ for architecture %s")
|
||||
+ arch in
|
||||
+ fpf "uefi_code=\"$( \
|
||||
+ find $uefi_dir -name '%s_CODE*.fd' -print -quit )\"\n"
|
||||
+ prefix;
|
||||
+ fpf "uefi_vars_template=\"$( \
|
||||
+ find $uefi_dir -name '%s_VARS.fd' -print -quit )\"\n"
|
||||
+ prefix;
|
||||
+ fpf "\n";
|
||||
+ fpf "# Make a copy of the UEFI variables template\n";
|
||||
+ fpf "uefi_vars=\"$(mktemp)\"\n";
|
||||
+ fpf "cp \"$uefi_vars_template\" \"$uefi_vars\"\n";
|
||||
+ fpf "\n";
|
||||
+ fpf "# You may need to set this 'on' to use secure boot\n";
|
||||
+ fpf "smm=off\n";
|
||||
+ );
|
||||
|
||||
(* Construct the command line. Note that the [Qemuopts]
|
||||
* module deals with shell and qemu comma quoting.
|
||||
@@ -152,20 +178,17 @@ module QEMU = struct
|
||||
|
||||
if not guestcaps.gcaps_rtc_utc then arg "-rtc" "base=localtime";
|
||||
|
||||
- arg_list "-machine" (machine_str ::
|
||||
- (if smm then ["smm=on"] else []) @
|
||||
- ["accel=kvm:tcg"]);
|
||||
+ arg_noquote "-machine" "$machine${smm:+,smm=$smm},accel=kvm:tcg";
|
||||
|
||||
- (match uefi_firmware with
|
||||
- | None -> ()
|
||||
- | Some { Uefi.code } ->
|
||||
- if secure_boot_required then
|
||||
- arg_list "-global"
|
||||
- ["driver=cfi.pflash01"; "property=secure"; "value=on"];
|
||||
- arg_list "-drive"
|
||||
- ["if=pflash"; "format=raw"; "file=" ^ code; "readonly=on"];
|
||||
- arg_noquote "-drive" "if=pflash,format=raw,file=\"$uefi_vars\"";
|
||||
- );
|
||||
+ fpf "if [ \"$uefi_code\" != \"\" ]; then\n";
|
||||
+ fpf " uefi_args=\"\\\n";
|
||||
+ fpf " -global driver=cfi.pflash01,property=secure,value=$smm \\\n";
|
||||
+ fpf " -drive if=pflash,format=raw,file=$uefi_code,readonly=on \\\n";
|
||||
+ fpf " -drive if=pflash,format=raw,file=$uefi_vars \\\n";
|
||||
+ fpf " \"\n";
|
||||
+ fpf "fi\n";
|
||||
+ fpf "\n";
|
||||
+ Qemuopts.raw cmd "$uefi_args";
|
||||
|
||||
arg "-m" (Int64.to_string (source.s_memory /^ 1024L /^ 1024L));
|
||||
|
||||
@@ -209,7 +232,7 @@ module QEMU = struct
|
||||
Array.exists floppy_filter target_buses.target_floppy_bus in
|
||||
|
||||
if ide_ctrl_needed then (
|
||||
- match machine with
|
||||
+ match guestcaps.gcaps_machine with
|
||||
| I440FX -> ()
|
||||
(* The PC machine has a built-in controller of type "piix3-ide"
|
||||
* providing buses "ide.0" and "ide.1", with each bus fitting two
|
||||
@@ -232,7 +255,7 @@ module QEMU = struct
|
||||
arg_list "-device" [ "virtio-scsi-pci"; "id=scsi0" ];
|
||||
|
||||
if floppy_ctrl_needed then (
|
||||
- match machine with
|
||||
+ match guestcaps.gcaps_machine with
|
||||
| I440FX -> ()
|
||||
(* The PC machine has a built-in controller of type "isa-fdc"
|
||||
* providing bus "floppy-bus.0", fitting two devices.
|
||||
@@ -283,7 +306,7 @@ module QEMU = struct
|
||||
*)
|
||||
let backend_name = sprintf "drive-ide-%d" frontend_ctr
|
||||
and ide_bus, ide_unit =
|
||||
- match machine with
|
||||
+ match guestcaps.gcaps_machine with
|
||||
| I440FX -> frontend_ctr / 2, frontend_ctr mod 2
|
||||
| Q35 -> frontend_ctr, 0
|
||||
| Virt -> 0, 0 (* should never happen, see warning above *) in
|
||||
@@ -450,25 +473,13 @@ module QEMU = struct
|
||||
if inspect.i_type = "linux" then
|
||||
arg "-serial" "stdio";
|
||||
|
||||
- (* Write the qemu script. *)
|
||||
- with_open_out file (
|
||||
- fun chan ->
|
||||
- let fpf fs = fprintf chan fs in
|
||||
- fpf "#!/bin/sh -\n";
|
||||
- fpf "\n";
|
||||
-
|
||||
- (match uefi_firmware with
|
||||
- | None -> ()
|
||||
- | Some { Uefi.vars = vars_template } ->
|
||||
- fpf "# Make a copy of the UEFI variables template\n";
|
||||
- fpf "uefi_vars=\"$(mktemp)\"\n";
|
||||
- fpf "cp %s \"$uefi_vars\"\n" (quote vars_template);
|
||||
- fpf "\n"
|
||||
- );
|
||||
-
|
||||
- Qemuopts.to_chan cmd chan
|
||||
- );
|
||||
+ (* Write the qemu command. *)
|
||||
+ Qemuopts.to_chan cmd chan;
|
||||
|
||||
+ (* Finish off by renaming the temporary file to the final file
|
||||
+ * and making it executable.
|
||||
+ *)
|
||||
+ Unix.rename tmpfile file;
|
||||
Unix.chmod file 0o755;
|
||||
|
||||
(* If -oo qemu-boot option was specified then we should boot the guest. *)
|
||||
diff --git a/output/qemuopts-c.c b/output/qemuopts-c.c
|
||||
index 03c40206..1d080737 100644
|
||||
--- a/output/qemuopts-c.c
|
||||
+++ b/output/qemuopts-c.c
|
||||
@@ -176,6 +176,18 @@ guestfs_int_qemuopts_arg_list (value qoptsv, value flagv, value valuesv)
|
||||
CAMLreturn (Val_unit);
|
||||
}
|
||||
|
||||
+value
|
||||
+guestfs_int_qemuopts_raw (value qoptsv, value strv)
|
||||
+{
|
||||
+ CAMLparam2 (qoptsv, strv);
|
||||
+ struct qemuopts *qopts = Qopts_val (qoptsv);
|
||||
+
|
||||
+ if (qemuopts_add_raw (qopts, String_val (strv)) == -1)
|
||||
+ unix_error (errno, (char *) "qemuopts_add_raw", strv);
|
||||
+
|
||||
+ CAMLreturn (Val_unit);
|
||||
+}
|
||||
+
|
||||
value
|
||||
guestfs_int_qemuopts_to_script (value qoptsv, value strv)
|
||||
{
|
||||
diff --git a/output/qemuopts.ml b/output/qemuopts.ml
|
||||
index 1ba57dba..bc4e33d7 100644
|
||||
--- a/output/qemuopts.ml
|
||||
+++ b/output/qemuopts.ml
|
||||
@@ -25,6 +25,7 @@ external flag : t -> string -> unit = "guestfs_int_qemuopts_flag"
|
||||
external arg : t -> string -> string -> unit = "guestfs_int_qemuopts_arg"
|
||||
external arg_noquote : t -> string -> string -> unit = "guestfs_int_qemuopts_arg_noquote"
|
||||
external arg_list : t -> string -> string list -> unit = "guestfs_int_qemuopts_arg_list"
|
||||
+external raw : t -> string -> unit = "guestfs_int_qemuopts_raw"
|
||||
external to_script : t -> string -> unit = "guestfs_int_qemuopts_to_script"
|
||||
|
||||
external _to_chan : t -> Unix.file_descr -> unit = "guestfs_int_qemuopts_to_chan"
|
||||
diff --git a/output/qemuopts.mli b/output/qemuopts.mli
|
||||
index 5c39a32f..bd65405f 100644
|
||||
--- a/output/qemuopts.mli
|
||||
+++ b/output/qemuopts.mli
|
||||
@@ -53,6 +53,10 @@ val arg_list : t -> string -> string list -> unit
|
||||
|
||||
This does both qemu comma-quoting and shell-quoting as required. *)
|
||||
|
||||
+val raw : t -> string -> unit
|
||||
+(** [raw "stuff"] adds [stuff] to the command line completely
|
||||
+ unquoted. Use with care. *)
|
||||
+
|
||||
val to_script : t -> string -> unit
|
||||
(** [to_script t "./file.sh"] writes the resulting command line to
|
||||
a file. The file begins with [#!/bin/sh] and is chmod 0755. *)
|
||||
diff --git a/po/POTFILES-ml b/po/POTFILES-ml
|
||||
index e88a18b0..7f1d1cdb 100644
|
||||
--- a/po/POTFILES-ml
|
||||
+++ b/po/POTFILES-ml
|
||||
@@ -42,7 +42,6 @@ common/mltools/urandom.ml
|
||||
common/mltools/xpath_helpers.ml
|
||||
common/mlutils/c_utils.ml
|
||||
common/mlutils/unix_utils.ml
|
||||
-common/mlv2v/uefi.ml
|
||||
common/mlxml/xml.ml
|
||||
in-place/in_place.ml
|
||||
input/OVA.ml
|
||||
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
|
||||
index d609ab02..9378eb89 100644
|
||||
--- a/v2v/Makefile.am
|
||||
+++ b/v2v/Makefile.am
|
||||
@@ -67,8 +67,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlxml \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
-I $(top_builddir)/common/mlcustomize \
|
||||
- -I $(top_builddir)/common/mldrivers \
|
||||
- -I $(top_builddir)/common/mlv2v
|
||||
+ -I $(top_builddir)/common/mldrivers
|
||||
if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
endif
|
||||
@@ -104,7 +103,6 @@ OCAMLLINKFLAGS = \
|
||||
mllibvirt.$(MLARCHIVE) \
|
||||
mlcustomize.$(MLARCHIVE) \
|
||||
mldrivers.$(MLARCHIVE) \
|
||||
- mlv2v.$(MLARCHIVE) \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
mlconvert.$(MLARCHIVE) \
|
||||
mlinput.$(MLARCHIVE) \
|
||||
@@ -164,7 +162,6 @@ v2v_unit_tests_DEPENDENCIES = \
|
||||
../common/mltools/mltools.$(MLARCHIVE) \
|
||||
../common/mlcustomize/mlcustomize.$(MLARCHIVE) \
|
||||
../common/mldrivers/mldrivers.$(MLARCHIVE) \
|
||||
- ../common/mlv2v/mlv2v.$(MLARCHIVE) \
|
||||
$(top_srcdir)/ocaml-link.sh
|
||||
v2v_unit_tests_LINK = \
|
||||
$(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
|
||||
@ -0,0 +1,32 @@
|
||||
From f43d92473d3da0a5f6a2da6e44ca8416ad824d8f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 15 Nov 2024 14:04:48 +0000
|
||||
Subject: [PATCH] -o qemu: Add set -e, -x at the top of the output script
|
||||
|
||||
This adds:
|
||||
|
||||
set -e
|
||||
#set -x
|
||||
|
||||
The second command is commented so that users can enable it if they
|
||||
want to see the output.
|
||||
|
||||
(cherry picked from commit e09aaad7e787803ff5e383fa6b5276c888b42ef5)
|
||||
---
|
||||
output/output_qemu.ml | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/output/output_qemu.ml b/output/output_qemu.ml
|
||||
index fd0182d6..b0c2ff01 100644
|
||||
--- a/output/output_qemu.ml
|
||||
+++ b/output/output_qemu.ml
|
||||
@@ -116,6 +116,9 @@ module QEMU = struct
|
||||
let fpf fs = fprintf chan fs in
|
||||
fpf "#!/bin/sh -\n";
|
||||
fpf "\n";
|
||||
+ fpf "set -e\n";
|
||||
+ fpf "#set -x\n";
|
||||
+ fpf "\n";
|
||||
|
||||
(* Allow the user to override our choice of machine type. *)
|
||||
let () =
|
||||
@ -0,0 +1,276 @@
|
||||
From 037a603c2d5cf9d2d5f8157116dbf14945277dc2 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 2 Dec 2024 15:22:43 +0000
|
||||
Subject: [PATCH] v2v: Implement --parallel=N for parallel disk copies
|
||||
|
||||
When set, run up to N copies of nbdcopy in parallel. This only
|
||||
applies for guests with multiple disks.
|
||||
|
||||
The default, as for all older versions of virt-v2v, is to copy disks
|
||||
one at a time.
|
||||
|
||||
(cherry picked from commit fd1148f79581b148525eb12154aef7603ccf0baa)
|
||||
---
|
||||
docs/virt-v2v.pod | 13 +++++++
|
||||
lib/utils.ml | 6 ++++
|
||||
lib/utils.mli | 4 +++
|
||||
tests/Makefile.am | 2 ++
|
||||
tests/test-v2v-i-disk-parallel.sh | 54 +++++++++++++++++++++++++++++
|
||||
v2v/v2v.ml | 56 +++++++++++++++++++++++++------
|
||||
6 files changed, 125 insertions(+), 10 deletions(-)
|
||||
create mode 100755 tests/test-v2v-i-disk-parallel.sh
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 74581463..216e617d 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -749,6 +749,19 @@ C<root>.
|
||||
You will get an error if virt-v2v is unable to mount/write to the
|
||||
Export Storage Domain.
|
||||
|
||||
+=item B<--parallel> N
|
||||
+
|
||||
+Enable parallel copying if the guest has multiple disks. I<N> is the
|
||||
+maximum number of parallel L<nbdcopy(1)> instances to run.
|
||||
+
|
||||
+The default is to run at most one instance of nbdcopy
|
||||
+(ie. I<--parallel=1>). All versions of virt-v2v E<le> 2.7.2 also did
|
||||
+disk copies one at a time.
|
||||
+
|
||||
+Within each guest disk, nbdcopy tries to copy in parallel if the
|
||||
+underlying endpoints support that. This is not affected by this
|
||||
+command line option. See the L<nbdcopy(1)> manual page for details.
|
||||
+
|
||||
=item B<--print-source>
|
||||
|
||||
Print information about the source guest and stop. This option is
|
||||
diff --git a/lib/utils.ml b/lib/utils.ml
|
||||
index c4cfd89b..f2da9e80 100644
|
||||
--- a/lib/utils.ml
|
||||
+++ b/lib/utils.ml
|
||||
@@ -29,6 +29,12 @@ let large_tmpdir =
|
||||
try Sys.getenv "VIRT_V2V_TMPDIR"
|
||||
with Not_found -> (open_guestfs ())#get_cachedir ()
|
||||
|
||||
+let string_of_process_status = function
|
||||
+ | Unix.WEXITED 0 -> s_"success"
|
||||
+ | WEXITED i -> sprintf (f_"exited with non-zero error code %d") i
|
||||
+ | WSIGNALED i -> sprintf (f_"signalled by signal %d") i
|
||||
+ | WSTOPPED i -> sprintf (f_"stopped by signal %d") i
|
||||
+
|
||||
(* Is SELinux enabled and enforcing on the host? *)
|
||||
let have_selinux =
|
||||
0 = Sys.command "getenforce 2>/dev/null | grep -isq Enforcing"
|
||||
diff --git a/lib/utils.mli b/lib/utils.mli
|
||||
index afe61a4e..e7ee13d1 100644
|
||||
--- a/lib/utils.mli
|
||||
+++ b/lib/utils.mli
|
||||
@@ -23,6 +23,10 @@ val large_tmpdir : string
|
||||
such as overlays in this directory. Small temporary files can
|
||||
use the default behaviour eg. of {!Filename.temp_file} *)
|
||||
|
||||
+val string_of_process_status : Unix.process_status -> string
|
||||
+(** Convert a process status (such as returned by {!Unix.wait}) into
|
||||
+ a printable string. *)
|
||||
+
|
||||
val have_selinux : bool
|
||||
(** True if SELinux is enabled and enforcing on the host. *)
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 8a710b99..fa5bb4f1 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -76,6 +76,7 @@ TESTS = \
|
||||
test-v2v-cdrom.sh \
|
||||
test-v2v-floppy.sh \
|
||||
test-v2v-i-disk.sh \
|
||||
+ test-v2v-i-disk-parallel.sh \
|
||||
test-v2v-i-ova.sh \
|
||||
test-v2v-inspector.sh \
|
||||
test-v2v-mac.sh \
|
||||
@@ -189,6 +190,7 @@ EXTRA_DIST += \
|
||||
test-v2v-floppy.expected \
|
||||
test-v2v-floppy.sh \
|
||||
test-v2v-i-disk.sh \
|
||||
+ test-v2v-i-disk-parallel.sh \
|
||||
test-v2v-i-ova-as-root.ovf \
|
||||
test-v2v-i-ova-as-root.sh \
|
||||
test-v2v-i-ova-bad-sha1.sh \
|
||||
diff --git a/tests/test-v2v-i-disk-parallel.sh b/tests/test-v2v-i-disk-parallel.sh
|
||||
new file mode 100755
|
||||
index 00000000..a6470fdd
|
||||
--- /dev/null
|
||||
+++ b/tests/test-v2v-i-disk-parallel.sh
|
||||
@@ -0,0 +1,54 @@
|
||||
+#!/bin/bash -
|
||||
+# libguestfs virt-v2v test script
|
||||
+# Copyright (C) 2014-2024 Red Hat Inc.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+
|
||||
+# Test --parallel option.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+source ./functions.sh
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+skip_if_skipped
|
||||
+windows=../test-data/phony-guests/windows.img
|
||||
+requires test -f $windows
|
||||
+
|
||||
+export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
|
||||
+
|
||||
+d=test-v2v-i-disk-parallel.d
|
||||
+rm -rf $d
|
||||
+cleanup_fn rm -rf $d
|
||||
+mkdir $d
|
||||
+
|
||||
+truncate -s $((100*1024*1024)) $d/disk-2.img $d/disk-3.img $d/disk-4.img
|
||||
+
|
||||
+$VG virt-v2v --debug-gc \
|
||||
+ --parallel=2 \
|
||||
+ -i disk \
|
||||
+ $windows \
|
||||
+ $d/disk-2.img \
|
||||
+ $d/disk-3.img \
|
||||
+ $d/disk-4.img \
|
||||
+ -o local -os $d
|
||||
+
|
||||
+# Test the libvirt XML metadata and output disks were created.
|
||||
+test -f $d/windows.xml
|
||||
+test -f $d/windows-sda
|
||||
+test -f $d/windows-sdb
|
||||
+test -f $d/windows-sdc
|
||||
+test -f $d/windows-sdd
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 2fdaf40b..68502884 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -79,6 +79,7 @@ let rec main () =
|
||||
)
|
||||
in
|
||||
|
||||
+ let parallel = ref 1 in
|
||||
let network_map = Networks.create () in
|
||||
let static_ips = ref [] in
|
||||
let rec add_network str =
|
||||
@@ -263,6 +264,8 @@ let rec main () =
|
||||
s_"Set output storage location";
|
||||
[ L"password-file" ], Getopt.String ("filename", set_string_option_once "-ip" input_password),
|
||||
s_"Same as ‘-ip filename’";
|
||||
+ [ L"parallel" ], Getopt.Set_int ("N", parallel),
|
||||
+ s_"Run up to N instances of nbdcopy in parallel";
|
||||
[ L"print-source" ], Getopt.Set print_source,
|
||||
s_"Print source and stop";
|
||||
[ L"root" ], Getopt.String ("ask|... ", set_root_choice),
|
||||
@@ -365,6 +368,7 @@ read the man page virt-v2v(1).
|
||||
| `Preallocated -> Types.Preallocated in
|
||||
let output_mode = !output_mode in
|
||||
let output_name = !output_name in
|
||||
+ let parallel = !parallel in
|
||||
let print_source = !print_source in
|
||||
let root_choice = !root_choice in
|
||||
let static_ips = !static_ips in
|
||||
@@ -386,6 +390,7 @@ read the man page virt-v2v(1).
|
||||
pr "mac-option\n";
|
||||
pr "bandwidth-option\n";
|
||||
pr "mac-ip-option\n";
|
||||
+ pr "parallel-option\n";
|
||||
pr "customize-ops\n";
|
||||
pr "input:disk\n";
|
||||
pr "input:libvirt\n";
|
||||
@@ -583,12 +588,15 @@ read the man page virt-v2v(1).
|
||||
else
|
||||
List.rev acc
|
||||
in
|
||||
- let disks = loop [] 0 in
|
||||
- let nr_disks = List.length disks in
|
||||
+ let disks = ref (loop [] 0) in
|
||||
+ let nr_disks = List.length !disks in
|
||||
|
||||
(* Copy the disks. *)
|
||||
- List.iter (
|
||||
- fun (i, input_socket, output_socket) ->
|
||||
+ let nbdcopy_pids = ref [] in
|
||||
+ let rec copy_loop () =
|
||||
+ if List.length !nbdcopy_pids < parallel && !disks <> [] then (
|
||||
+ (* Schedule another nbdcopy process. *)
|
||||
+ let i, input_socket, output_socket = List.pop_front disks in
|
||||
message (f_"Copying disk %d/%d") (i+1) nr_disks;
|
||||
|
||||
let request_size = Output_module.request_size
|
||||
@@ -608,8 +616,33 @@ read the man page virt-v2v(1).
|
||||
flush Stdlib.stderr
|
||||
);
|
||||
|
||||
- nbdcopy ?request_size output_alloc input_uri output_uri
|
||||
- ) disks;
|
||||
+ let pid = nbdcopy ?request_size output_alloc input_uri output_uri in
|
||||
+ List.push_front pid nbdcopy_pids;
|
||||
+
|
||||
+ copy_loop ();
|
||||
+ )
|
||||
+ else if !nbdcopy_pids <> [] then (
|
||||
+ (* Wait for one nbdcopy instance to exit. *)
|
||||
+ let pid, status = wait () in
|
||||
+ (* If this internal error turns up in real world scenarios then
|
||||
+ * we may need to change the [wait] above so it only waits on
|
||||
+ * the nbdcopy PIDs.
|
||||
+ *)
|
||||
+ if not (List.mem pid !nbdcopy_pids) then
|
||||
+ error (f_"internal error: wait returned unexpected \
|
||||
+ process ID %d status \"%s\"")
|
||||
+ pid (string_of_process_status status);
|
||||
+ nbdcopy_pids := List.filter ((<>) pid) !nbdcopy_pids;
|
||||
+ (match status with
|
||||
+ | WEXITED 0 -> copy_loop ()
|
||||
+ | WEXITED _ | WSIGNALED _ | WSTOPPED _ ->
|
||||
+ error "nbdcopy %s" (string_of_process_status status)
|
||||
+ );
|
||||
+ )
|
||||
+ in
|
||||
+ copy_loop ();
|
||||
+ assert (!disks == []);
|
||||
+ assert (!nbdcopy_pids == []);
|
||||
|
||||
(* End of copying phase. *)
|
||||
unlink (v2vdir // "copy");
|
||||
@@ -647,6 +680,7 @@ and check_host_free_space () =
|
||||
\"Minimum free space check in the host\".")
|
||||
large_tmpdir (human_size free_space)
|
||||
|
||||
+(* Start nbdcopy as a background process, returning the PID. *)
|
||||
and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
(* XXX It's possible that some output modes know whether
|
||||
* --target-is-zero which would be a useful optimization.
|
||||
@@ -674,10 +708,12 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
if not (quiet ()) then List.push_back cmd "--progress";
|
||||
if output_alloc = Types.Preallocated then List.push_back cmd "--allocated";
|
||||
|
||||
- let cmd = !cmd in
|
||||
-
|
||||
- if run_command cmd <> 0 then
|
||||
- error (f_"nbdcopy command failed, see earlier error messages")
|
||||
+ let args = Array.of_list !cmd in
|
||||
+ match fork () with
|
||||
+ | 0 ->
|
||||
+ (* Child process (nbdcopy). *)
|
||||
+ execvp "nbdcopy" args
|
||||
+ | pid -> pid
|
||||
|
||||
(* Run nbdinfo on a URI and collect the information. However don't
|
||||
* fail if nbdinfo is not installed since this is just used for debugging.
|
||||
2145
SOURCES/0020-tests-Rename-all-test-v2v-to-test.patch
Normal file
2145
SOURCES/0020-tests-Rename-all-test-v2v-to-test.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,93 +0,0 @@
|
||||
From d26ed76801f9d3ce5d3863ca09dfa653b4bcd1b2 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 27 Aug 2024 12:36:41 +0100
|
||||
Subject: [PATCH] convert: windows: Online all virtio disks at first boot
|
||||
|
||||
Windows 2022 (and possibly earlier versions back to around 2019) will
|
||||
force offline any non-boot disks which change bus, apparently as a
|
||||
security mitigation. The effect of this is that although the system
|
||||
drive (C:) is present after conversion, other drives may seem to
|
||||
disappear.
|
||||
|
||||
Running a Powershell script to bring all disks online seems risky.
|
||||
The compromise is to bring online only virtio disks at first boot.
|
||||
|
||||
To further reduce risk, we only do this if there are non-system disks
|
||||
(ie. > 1 disks in total), and only if we installed virtio drivers.
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-55763
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-55837
|
||||
Related: https://issues.redhat.com/browse/MTV-1299
|
||||
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1662286
|
||||
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Thanks: Martin Necas
|
||||
Acked-by: Martin Necas
|
||||
(cherry picked from commit cb56f6f94dc153051515fc7aa0d9ca646f5e2340)
|
||||
---
|
||||
convert/convert_windows.ml | 39 +++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 38 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml
|
||||
index 52ca5bbe..352e1218 100644
|
||||
--- a/convert/convert_windows.ml
|
||||
+++ b/convert/convert_windows.ml
|
||||
@@ -38,7 +38,8 @@ module G = Guestfs
|
||||
* time the Windows VM is booted on KVM.
|
||||
*)
|
||||
|
||||
-let convert (g : G.guestfs) _ inspect i_firmware block_driver _ static_ips =
|
||||
+let convert (g : G.guestfs) source inspect i_firmware
|
||||
+ block_driver _ static_ips =
|
||||
(*----------------------------------------------------------------------*)
|
||||
(* Inspect the Windows guest. *)
|
||||
|
||||
@@ -272,6 +273,8 @@ let convert (g : G.guestfs) _ inspect i_firmware block_driver _ static_ips =
|
||||
Registry.with_hive_write g inspect.i_windows_software_hive
|
||||
update_software_hive;
|
||||
|
||||
+ configure_online_disks block_driver;
|
||||
+
|
||||
configure_network_interfaces net_driver;
|
||||
|
||||
fix_ntfs_heads ();
|
||||
@@ -668,6 +671,40 @@ let convert (g : G.guestfs) _ inspect i_firmware block_driver _ static_ips =
|
||||
warning (f_"could not find registry key \
|
||||
HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion")
|
||||
|
||||
+ and configure_online_disks block_driver =
|
||||
+ (* If there are > 1 disks, run a script which will force Windows
|
||||
+ * to bring them all online. Windows 2022 will offline non-boot disks
|
||||
+ * where the bus changes as some sort of "security" mitigation.
|
||||
+ * https://issues.redhat.com/browse/RHEL-55837
|
||||
+ * https://issues.redhat.com/browse/MTV-1299
|
||||
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1662286
|
||||
+ *)
|
||||
+ let virtio_installed =
|
||||
+ match block_driver with
|
||||
+ | Inject_virtio_win.Virtio_blk | Virtio_SCSI -> true
|
||||
+ | IDE -> false in
|
||||
+ let more_than_one_disk = List.length source.s_disks > 1 in
|
||||
+
|
||||
+ if virtio_installed && more_than_one_disk then (
|
||||
+ let psh_filename = "online-disks" in
|
||||
+ let psh = ref [] in
|
||||
+ let add = List.push_back psh in
|
||||
+
|
||||
+ add "# Uncomment this line for lots of debug output.";
|
||||
+ add "# Set-PSDebug -Trace 1";
|
||||
+ add "";
|
||||
+ add "Write-Host \"Online all virtio disks\"";
|
||||
+ add "";
|
||||
+ add "Get-Disk | Where { $_.FriendlyName -like '*VirtIO*' } | % {";
|
||||
+ add " Write-Host (' - ' + $_.Number + ': ' + $_.FriendlyName + '(' + [math]::Round($_.Size/1GB,2) + 'GB)')";
|
||||
+ add " $_ | Set-Disk -IsOffline $false";
|
||||
+ add " $_ | Set-Disk -IsReadOnly $false";
|
||||
+ add "}";
|
||||
+
|
||||
+ (* Install the Powershell script to run late at firstboot. *)
|
||||
+ Firstboot.add_firstboot_powershell g inspect.i_root psh_filename !psh
|
||||
+ )
|
||||
+
|
||||
and configure_network_interfaces net_driver =
|
||||
(* If we were asked to force network interfaces to have particular
|
||||
* static IP addresses then it is done here by installing a
|
||||
272
SOURCES/0021-tests-Sort-the-tests-into-alphabetical-order.patch
Normal file
272
SOURCES/0021-tests-Sort-the-tests-into-alphabetical-order.patch
Normal file
@ -0,0 +1,272 @@
|
||||
From a9d2eb43fdd5f1d115cc5b048a4b252a533d72cd Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 15:19:15 +0000
|
||||
Subject: [PATCH] tests: Sort the tests into alphabetical order
|
||||
|
||||
The list of tests had grown organically over a very long time.
|
||||
|
||||
Also rename the "odd one out" rhbz* to test-rhbz*.
|
||||
|
||||
(cherry picked from commit d80c05a27098c6affaca4363372cae2354d9bc4f)
|
||||
---
|
||||
.gitignore | 2 +-
|
||||
configure.ac | 2 +-
|
||||
tests/Makefile.am | 70 +++++++++----------
|
||||
tests/rhbz1232192.xml | 26 +++++++
|
||||
tests/{rhbz1232192.sh => test-rhbz1232192.sh} | 2 +-
|
||||
...1232192.xml.in => test-rhbz1232192.xml.in} | 0
|
||||
6 files changed, 64 insertions(+), 38 deletions(-)
|
||||
create mode 100644 tests/rhbz1232192.xml
|
||||
rename tests/{rhbz1232192.sh => test-rhbz1232192.sh} (95%)
|
||||
rename tests/{rhbz1232192.xml.in => test-rhbz1232192.xml.in} (100%)
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index b8abc3f8..9dcd4611 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -121,13 +121,13 @@ Makefile.in
|
||||
/test-data/phony-guests/windows-system
|
||||
/tests/functions.sh
|
||||
/tests/libvirt-is-version
|
||||
-/tests/rhbz1232192.xml
|
||||
/tests/test-cdrom.xml
|
||||
/tests/test-conversion-of-*.sh
|
||||
/tests/test-floppy.xml
|
||||
/tests/test-mac.xml
|
||||
/tests/test-networks-and-bridges.xml
|
||||
/tests/test-print-source.xml
|
||||
+/tests/test-rhbz1232192.xml
|
||||
/tests/test-sound.xml
|
||||
/tests/windows.vmdk
|
||||
/v2v/.depend
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 300b421e..623c634d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -163,12 +163,12 @@ AC_CONFIG_FILES([Makefile
|
||||
test-data/phony-guests/guests.xml
|
||||
tests/functions.sh
|
||||
tests/Makefile
|
||||
- tests/rhbz1232192.xml
|
||||
tests/test-cdrom.xml
|
||||
tests/test-floppy.xml
|
||||
tests/test-mac.xml
|
||||
tests/test-networks-and-bridges.xml
|
||||
tests/test-print-source.xml
|
||||
+ tests/test-rhbz1232192.xml
|
||||
tests/test-sound.xml
|
||||
v2v/Makefile])
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 4c4a8e55..0dd5927b 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -56,6 +56,17 @@ libvirt_is_version_CFLAGS = \
|
||||
TESTS_ENVIRONMENT = $(top_builddir)/run --test
|
||||
|
||||
TESTS = \
|
||||
+ test-bad-networks-and-bridges.sh \
|
||||
+ test-cdrom.sh \
|
||||
+ test-customize.sh \
|
||||
+ test-fedora-btrfs-conversion.sh \
|
||||
+ test-fedora-conversion.sh \
|
||||
+ test-fedora-luks-on-lvm-conversion.sh \
|
||||
+ test-fedora-lvm-on-luks-conversion.sh \
|
||||
+ test-fedora-md-conversion.sh \
|
||||
+ test-floppy.sh \
|
||||
+ test-i-disk-parallel.sh \
|
||||
+ test-i-disk.sh \
|
||||
test-i-ova-bad-sha1.sh \
|
||||
test-i-ova-bad-sha256.sh \
|
||||
test-i-ova-directory.sh \
|
||||
@@ -68,18 +79,11 @@ TESTS = \
|
||||
test-i-ova-subfolders.sh \
|
||||
test-i-ova-tar.sh \
|
||||
test-i-ova-two-disks.sh \
|
||||
- test-i-vmx.sh \
|
||||
- test-it-vddk-io-query.sh \
|
||||
- test-o-rhv-upload-oo-query.sh \
|
||||
- test-o-vdsm-oo-query.sh \
|
||||
- test-bad-networks-and-bridges.sh \
|
||||
- test-cdrom.sh \
|
||||
- test-floppy.sh \
|
||||
- test-i-disk.sh \
|
||||
- test-i-disk-parallel.sh \
|
||||
test-i-ova.sh \
|
||||
+ test-i-vmx.sh \
|
||||
test-in-place.sh \
|
||||
test-inspector.sh \
|
||||
+ test-it-vddk-io-query.sh \
|
||||
test-mac.sh \
|
||||
test-machine-readable.sh \
|
||||
test-networks-and-bridges.sh \
|
||||
@@ -91,24 +95,20 @@ TESTS = \
|
||||
test-o-null.sh \
|
||||
test-o-openstack.sh \
|
||||
test-o-qemu.sh \
|
||||
- test-o-rhv.sh \
|
||||
+ test-o-rhv-upload-oo-query.sh \
|
||||
test-o-rhv-upload.sh \
|
||||
+ test-o-rhv.sh \
|
||||
+ test-o-vdsm-oo-query.sh \
|
||||
test-o-vdsm-options.sh \
|
||||
test-oa-option-qcow2.sh \
|
||||
test-oa-option-raw.sh \
|
||||
test-of-option.sh \
|
||||
test-on-option.sh \
|
||||
test-print-source.sh \
|
||||
+ test-rhbz1232192.sh \
|
||||
test-sound.sh \
|
||||
test-virtio-win-iso.sh \
|
||||
- test-fedora-conversion.sh \
|
||||
- test-fedora-btrfs-conversion.sh \
|
||||
- test-fedora-luks-on-lvm-conversion.sh \
|
||||
- test-fedora-lvm-on-luks-conversion.sh \
|
||||
- test-fedora-md-conversion.sh \
|
||||
test-windows-conversion.sh \
|
||||
- test-customize.sh \
|
||||
- rhbz1232192.sh \
|
||||
$(SLOW_TESTS) \
|
||||
$(ROOT_TESTS)
|
||||
|
||||
@@ -184,16 +184,17 @@ EXTRA_DIST += \
|
||||
test-bad-networks-and-bridges.sh \
|
||||
test-cdrom.expected \
|
||||
test-cdrom.sh \
|
||||
+ test-conversion-of.sh \
|
||||
test-customize.sh \
|
||||
- test-fedora-conversion.sh \
|
||||
test-fedora-btrfs-conversion.sh \
|
||||
+ test-fedora-conversion.sh \
|
||||
test-fedora-luks-on-lvm-conversion.sh \
|
||||
test-fedora-lvm-on-luks-conversion.sh \
|
||||
test-fedora-md-conversion.sh \
|
||||
test-floppy.expected \
|
||||
test-floppy.sh \
|
||||
- test-i-disk.sh \
|
||||
test-i-disk-parallel.sh \
|
||||
+ test-i-disk.sh \
|
||||
test-i-ova-as-root.ovf \
|
||||
test-i-ova-as-root.sh \
|
||||
test-i-ova-bad-sha1.sh \
|
||||
@@ -228,46 +229,46 @@ EXTRA_DIST += \
|
||||
test-i-ova.ovf \
|
||||
test-i-ova.sh \
|
||||
test-i-ova.xml \
|
||||
- test-i-vmx.sh \
|
||||
test-i-vmx-1.expected \
|
||||
- test-i-vmx-2.expected \
|
||||
- test-i-vmx-3.expected \
|
||||
- test-i-vmx-4.expected \
|
||||
- test-i-vmx-5.expected \
|
||||
- test-i-vmx-6.expected \
|
||||
- test-i-vmx-7.expected \
|
||||
test-i-vmx-1.vmx \
|
||||
+ test-i-vmx-2.expected \
|
||||
test-i-vmx-2.vmx \
|
||||
+ test-i-vmx-3.expected \
|
||||
test-i-vmx-3.vmx \
|
||||
+ test-i-vmx-4.expected \
|
||||
test-i-vmx-4.vmx \
|
||||
+ test-i-vmx-5.expected \
|
||||
test-i-vmx-5.vmx \
|
||||
+ test-i-vmx-6.expected \
|
||||
test-i-vmx-6.vmx \
|
||||
+ test-i-vmx-7.expected \
|
||||
test-i-vmx-7.vmx \
|
||||
+ test-i-vmx.sh \
|
||||
test-in-place.sh \
|
||||
test-inspector.sh \
|
||||
test-it-vddk-io-query.sh \
|
||||
- test-machine-readable.sh \
|
||||
test-mac-expected.xml \
|
||||
test-mac.sh \
|
||||
- test-networks-and-bridges.sh \
|
||||
+ test-machine-readable.sh \
|
||||
test-networks-and-bridges-expected.xml \
|
||||
+ test-networks-and-bridges.sh \
|
||||
test-o-glance.sh \
|
||||
test-o-kubevirt-fedora.sh \
|
||||
- test-o-kubevirt-windows.sh \
|
||||
test-o-kubevirt-fedora.yaml.expected \
|
||||
+ test-o-kubevirt-windows.sh \
|
||||
test-o-kubevirt-windows.yaml.expected \
|
||||
test-o-libvirt.sh \
|
||||
test-o-local-qcow2-compressed.sh \
|
||||
test-o-null.sh \
|
||||
test-o-openstack.sh \
|
||||
test-o-qemu.sh \
|
||||
- test-o-rhv.ovf.expected \
|
||||
- test-o-rhv.sh \
|
||||
- test-o-rhv-upload.sh \
|
||||
test-o-rhv-upload-module/imageio.py \
|
||||
test-o-rhv-upload-module/ovirtsdk4/__init__.py \
|
||||
test-o-rhv-upload-module/ovirtsdk4/types.py \
|
||||
test-o-rhv-upload-oo-query.sh \
|
||||
+ test-o-rhv-upload.sh \
|
||||
+ test-o-rhv.ovf.expected \
|
||||
+ test-o-rhv.sh \
|
||||
test-o-vdsm-oo-query.sh \
|
||||
test-o-vdsm-options.ovf.expected \
|
||||
test-o-vdsm-options.sh \
|
||||
@@ -277,9 +278,8 @@ EXTRA_DIST += \
|
||||
test-on-option.sh \
|
||||
test-print-source.expected \
|
||||
test-print-source.sh \
|
||||
- test-conversion-of.sh \
|
||||
+ test-rhbz1232192.sh \
|
||||
test-sound.sh \
|
||||
test-trim.sh \
|
||||
test-virtio-win-iso.sh \
|
||||
- test-windows-conversion.sh \
|
||||
- rhbz1232192.sh
|
||||
+ test-windows-conversion.sh
|
||||
diff --git a/tests/rhbz1232192.xml b/tests/rhbz1232192.xml
|
||||
new file mode 100644
|
||||
index 00000000..cf0d7a45
|
||||
--- /dev/null
|
||||
+++ b/tests/rhbz1232192.xml
|
||||
@@ -0,0 +1,26 @@
|
||||
+<domain type='kvm'>
|
||||
+ <name>rhbz1232192</name>
|
||||
+ <memory>1048576</memory>
|
||||
+ <vcpu>2</vcpu>
|
||||
+ <os>
|
||||
+ <type>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <features>
|
||||
+ <acpi/>
|
||||
+ <apic/>
|
||||
+ <pae/>
|
||||
+ </features>
|
||||
+ <devices>
|
||||
+ <disk type='file' device='disk'>
|
||||
+ <driver name='qemu' type='raw'/>
|
||||
+ <source file='/home/rjones/d/virt-v2v-rhel-9.6/test-data/phony-guests/windows.img'/>
|
||||
+ <target dev='hda' bus='ide'/>
|
||||
+ </disk>
|
||||
+ <disk type='file' device='disk'>
|
||||
+ <driver name='qemu' type='raw'/>
|
||||
+ <source file='/home/rjones/d/virt-v2v-rhel-9.6/test-data/phony-guests/blank-disk.img'/>
|
||||
+ <target dev='hdb' bus='ide'/>
|
||||
+ </disk>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/rhbz1232192.sh b/tests/test-rhbz1232192.sh
|
||||
similarity index 95%
|
||||
rename from tests/rhbz1232192.sh
|
||||
rename to tests/test-rhbz1232192.sh
|
||||
index d2180439..21eb2dbd 100755
|
||||
--- a/tests/rhbz1232192.sh
|
||||
+++ b/tests/test-rhbz1232192.sh
|
||||
@@ -32,4 +32,4 @@ requires test -f ../test-data/phony-guests/blank-disk.img
|
||||
|
||||
export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
|
||||
|
||||
-virt-v2v -i libvirtxml rhbz1232192.xml -o null
|
||||
+virt-v2v -i libvirtxml test-rhbz1232192.xml -o null
|
||||
diff --git a/tests/rhbz1232192.xml.in b/tests/test-rhbz1232192.xml.in
|
||||
similarity index 100%
|
||||
rename from tests/rhbz1232192.xml.in
|
||||
rename to tests/test-rhbz1232192.xml.in
|
||||
@ -1,43 +0,0 @@
|
||||
From 94619ded353081255409eb3ffae51061adcbf9a4 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 29 Aug 2024 13:17:13 +0100
|
||||
Subject: [PATCH] mlcustomize: Ignore sriov drivers on virtio-win disk
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-56383
|
||||
Thanks: Vadim Rozenfeld
|
||||
---
|
||||
common/mlcustomize/inject_virtio_win.ml | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/common/mlcustomize/inject_virtio_win.ml b/common/mlcustomize/inject_virtio_win.ml
|
||||
index afec1e4..88c1c8c 100644
|
||||
--- a/common/mlcustomize/inject_virtio_win.ml
|
||||
+++ b/common/mlcustomize/inject_virtio_win.ml
|
||||
@@ -478,7 +478,10 @@ and virtio_iso_path_matches_guest_os t path =
|
||||
* "./drivers/amd64/Win2012R2/netkvm.sys".
|
||||
* Note we check lowercase paths.
|
||||
*)
|
||||
- let pathelem elem = String.find lc_path ("/" ^ elem ^ "/") >= 0 in
|
||||
+ let pathelem elem =
|
||||
+ String.find lc_path ("/" ^ elem ^ "/") >= 0 ||
|
||||
+ String.is_prefix lc_path (elem ^ "/")
|
||||
+ in
|
||||
let p_arch =
|
||||
if pathelem "x86" || pathelem "i386" then "i386"
|
||||
else if pathelem "amd64" then "x86_64"
|
||||
@@ -522,7 +525,11 @@ and virtio_iso_path_matches_guest_os t path =
|
||||
else
|
||||
raise Not_found in
|
||||
|
||||
- arch = p_arch && os_major = p_os_major && os_minor = p_os_minor &&
|
||||
+ let p_sriov = pathelem "sriov" in
|
||||
+
|
||||
+ arch = p_arch &&
|
||||
+ not p_sriov && (* always ignored, see RHEL-56383 *)
|
||||
+ os_major = p_os_major && os_minor = p_os_minor &&
|
||||
match_os_variant os_variant &&
|
||||
match_osinfo osinfo
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
26
SOURCES/0022-docs-Embolden-whole-O.patch
Normal file
26
SOURCES/0022-docs-Embolden-whole-O.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 66a6afb741d32f998633b121c2fb9813e5195820 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 13:35:24 +0000
|
||||
Subject: [PATCH] docs: Embolden whole "-O -"
|
||||
|
||||
Since this is typed literally make sure the whole string is
|
||||
emboldened, according to our usual style.
|
||||
|
||||
(cherry picked from commit 3b81441fdb9e43eae3619c247e0d945d143fc92f)
|
||||
---
|
||||
docs/virt-v2v-inspector.pod | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/docs/virt-v2v-inspector.pod b/docs/virt-v2v-inspector.pod
|
||||
index 6b2ba2a9..8201fcf9 100644
|
||||
--- a/docs/virt-v2v-inspector.pod
|
||||
+++ b/docs/virt-v2v-inspector.pod
|
||||
@@ -138,7 +138,7 @@ Display help.
|
||||
|
||||
Write the output to a file called F<output.xml>.
|
||||
|
||||
-=item B<-O> -
|
||||
+=item B<-O ->
|
||||
|
||||
Write the output to stdout. This is also the default if the I<-O>
|
||||
option is omitted.
|
||||
@ -1,80 +0,0 @@
|
||||
From 55abb960d633c6d9f959eef5b766daa4402bb314 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 9 Feb 2025 17:35:14 +0000
|
||||
Subject: [PATCH] Update common submodule
|
||||
|
||||
Pulls in the following fix:
|
||||
|
||||
commit 38315604596ac747e44e38db79496610efee49f8
|
||||
Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
Date: Thu Feb 6 08:04:38 2025 +0000
|
||||
|
||||
mldrivers/linux_bootloaders.ml: Don't overwrite EFI grub2 wrapper
|
||||
|
||||
Fedora 34+ and RHEL 9.0+ unified BIOS and UEFI grub configuration into
|
||||
a single file. This leaves /boot/efi/EFI/<OS>/grub.cfg as a so-called
|
||||
"wrapper" which just loads the real grub2 configuration at
|
||||
/boot/grub2/grub.cfg.
|
||||
|
||||
Running '/sbin/grub2-mkconfig -o /boot/efi/EFI/<OS>/grub.cfg'
|
||||
overwrites the wrapper instead of the real configuration file.
|
||||
|
||||
RHEL 9.5 added a hard error if you try to do this, which broke
|
||||
virt-v2v. The error message was:
|
||||
|
||||
commandrvf: /sbin/grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
|
||||
Running `grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg' will
|
||||
overwrite the GRUB wrapper. Please run `grub2-mkconfig -o
|
||||
/boot/grub2/grub.cfg' instead to update grub.cfg.
|
||||
|
||||
Try to detect this situation and substitute the real grub
|
||||
configuration file instead.
|
||||
|
||||
Reported-by: Robert Knipp, Fabian Deutsch
|
||||
Thanks: Nijin Ashok, Marta Lewandowska
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-77989
|
||||
Related: https://issues.redhat.com/browse/RHEL-32099
|
||||
Related: https://fedoraproject.org/wiki/Changes/UnifyGrubConfig
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-77989
|
||||
Related: https://issues.redhat.com/browse/RHEL-32099
|
||||
(cherry picked from commit 17610d1c9b37424fec55c39fbf83c971a843f45f)
|
||||
(cherry picked from commit 60785259a8bea65663da270b25ea6f46be42aa0f)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 94619ded..084ea740:
|
||||
diff --git a/common/mldrivers/linux_bootloaders.ml b/common/mldrivers/linux_bootloaders.ml
|
||||
index 91c5ab9e..25afcc59 100644
|
||||
--- a/common/mldrivers/linux_bootloaders.ml
|
||||
+++ b/common/mldrivers/linux_bootloaders.ml
|
||||
@@ -410,6 +410,28 @@ let detect_bootloader (g : G.guestfs) root i_firmware =
|
||||
in
|
||||
loop paths in
|
||||
|
||||
+ (* If we found a grub2 boot config called /boot/efi/EFI/<OS>/grub.cfg
|
||||
+ * check if it's a "wrapper" that redirects to /boot/grub2/grub.cfg.
|
||||
+ * This is needed for Fedora 34+ and RHEL 9.0+. See:
|
||||
+ * https://issues.redhat.com/browse/RHEL-32099
|
||||
+ * https://issues.redhat.com/browse/RHEL-77989
|
||||
+ * https://github.com/libguestfs/libguestfs-common/pull/6
|
||||
+ *)
|
||||
+ let grub_config =
|
||||
+ match typ with
|
||||
+ | Grub1 -> grub_config
|
||||
+ | Grub2 ->
|
||||
+ let grub2_efi_rex = PCRE.compile "^/boot/efi/EFI/.*/grub.cfg$" in
|
||||
+ let grub2_real = "/boot/grub2/grub.cfg" in
|
||||
+
|
||||
+ if PCRE.matches grub2_efi_rex grub_config &&
|
||||
+ (* does it look like the "wrapper"? *)
|
||||
+ g#grep "configfile \\$prefix/grub\\.cfg" grub_config <> [||] &&
|
||||
+ g#exists grub2_real then
|
||||
+ grub2_real
|
||||
+ else
|
||||
+ grub_config in
|
||||
+
|
||||
let bl =
|
||||
match typ with
|
||||
| Grub1 -> new bootloader_grub1 g root grub_config
|
||||
@ -0,0 +1,26 @@
|
||||
From 900641084045a53f9c59e099e7d49dbb43bda3eb Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 17:17:25 +0000
|
||||
Subject: [PATCH] in-place: Fix name of program in the --help output
|
||||
|
||||
(cherry picked from commit 00bd17ceb1ce0ff1f837b7621596d3b1e16ccc65)
|
||||
---
|
||||
in-place/in_place.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/in-place/in_place.ml b/in-place/in_place.ml
|
||||
index 9d24de78..42075139 100644
|
||||
--- a/in-place/in_place.ml
|
||||
+++ b/in-place/in_place.ml
|
||||
@@ -194,9 +194,9 @@ let rec main () =
|
||||
Note this program modifies the guest in-place with no backup.
|
||||
Normally you should use virt-v2v.
|
||||
|
||||
-virt-v2v -i libvirtxml guest-domain.xml
|
||||
+virt-v2v-in-place -i libvirtxml guest-domain.xml
|
||||
|
||||
-virt-v2v -i disk disk.img
|
||||
+virt-v2v-in-place -i disk disk.img
|
||||
|
||||
A short summary of the options is given below. For detailed help please
|
||||
read the man page virt-v2v-in-place(1).
|
||||
@ -0,0 +1,28 @@
|
||||
From 908f4148d8479c0f5e74ec21471adc57696eed55 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 17:27:38 +0000
|
||||
Subject: [PATCH] inspector: Reorder -O option in alphabetical order
|
||||
|
||||
Updates: commit 0805ea93796b8b57e7c9f0bc04f83ea76a9820a5
|
||||
(cherry picked from commit 8efb3ac06467f32901fa0447176311ff71aa53f9)
|
||||
---
|
||||
inspector/inspector.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/inspector/inspector.ml b/inspector/inspector.ml
|
||||
index 1ad67bbc..aeddbec6 100644
|
||||
--- a/inspector/inspector.ml
|
||||
+++ b/inspector/inspector.ml
|
||||
@@ -178,10 +178,10 @@ let rec main () =
|
||||
s_"Map NIC to network or bridge or assign static IP";
|
||||
[ S 'n'; L"network" ], Getopt.String ("in:out", add_network),
|
||||
s_"Map network ‘in’ to ‘out’";
|
||||
- [ L"root" ], Getopt.String ("ask|... ", set_root_choice),
|
||||
- s_"How to choose root filesystem";
|
||||
[ S 'O' ], Getopt.String ("output.xml", set_output_file_option),
|
||||
s_"Set the output filename";
|
||||
+ [ L"root" ], Getopt.String ("ask|... ", set_root_choice),
|
||||
+ s_"How to choose root filesystem";
|
||||
] in
|
||||
|
||||
(* Append virt-customize options. *)
|
||||
24
SOURCES/0025-v2v-Ensure-parallel-1.patch
Normal file
24
SOURCES/0025-v2v-Ensure-parallel-1.patch
Normal file
@ -0,0 +1,24 @@
|
||||
From b242c331e0e3a3d04369aaefe7e910c978491368 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sat, 7 Dec 2024 11:13:09 +0000
|
||||
Subject: [PATCH] v2v: Ensure --parallel >= 1
|
||||
|
||||
Fixes: commit fd1148f79581b148525eb12154aef7603ccf0baa
|
||||
(cherry picked from commit 755ce5dc08929ef4ef9dc0b0290d380574cb1235)
|
||||
---
|
||||
v2v/v2v.ml | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 68502884..e56462a5 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -369,6 +369,8 @@ read the man page virt-v2v(1).
|
||||
let output_mode = !output_mode in
|
||||
let output_name = !output_name in
|
||||
let parallel = !parallel in
|
||||
+ if parallel < 1 then
|
||||
+ error (f_"--parallel parameter must be >= 1");
|
||||
let print_source = !print_source in
|
||||
let root_choice = !root_choice in
|
||||
let static_ips = !static_ips in
|
||||
@ -0,0 +1,403 @@
|
||||
From 479f2cc10e74304e2d6202ad13dd99bdc9a6923d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 13:26:43 +0000
|
||||
Subject: [PATCH] inspector: Move the code that creates XML output to a
|
||||
separate file
|
||||
|
||||
Simple code motion, so that we can reuse this code in
|
||||
virt-v2v-in-place.
|
||||
|
||||
(cherry picked from commit 3d2d65a04ae75716c084063b572ff916fa83fd1b)
|
||||
---
|
||||
inspector/Makefile.am | 2 +
|
||||
inspector/create_inspector_xml.ml | 167 +++++++++++++++++++++++++++++
|
||||
inspector/create_inspector_xml.mli | 22 ++++
|
||||
inspector/inspector.ml | 144 +------------------------
|
||||
4 files changed, 193 insertions(+), 142 deletions(-)
|
||||
create mode 100644 inspector/create_inspector_xml.ml
|
||||
create mode 100644 inspector/create_inspector_xml.mli
|
||||
|
||||
diff --git a/inspector/Makefile.am b/inspector/Makefile.am
|
||||
index 172b2dc0..15f8cc34 100644
|
||||
--- a/inspector/Makefile.am
|
||||
+++ b/inspector/Makefile.am
|
||||
@@ -23,9 +23,11 @@ EXTRA_DIST = \
|
||||
$(SOURCES_C)
|
||||
|
||||
SOURCES_MLI = \
|
||||
+ create_inspector_xml.mli \
|
||||
inspector.mli
|
||||
|
||||
SOURCES_ML = \
|
||||
+ create_inspector_xml.ml \
|
||||
inspector.ml
|
||||
|
||||
SOURCES_C = \
|
||||
diff --git a/inspector/create_inspector_xml.ml b/inspector/create_inspector_xml.ml
|
||||
new file mode 100644
|
||||
index 00000000..a3281d46
|
||||
--- /dev/null
|
||||
+++ b/inspector/create_inspector_xml.ml
|
||||
@@ -0,0 +1,167 @@
|
||||
+(* virt-v2v-inspector
|
||||
+ * Copyright (C) 2009-2022 Red Hat Inc.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along
|
||||
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+ *)
|
||||
+
|
||||
+open Printf
|
||||
+
|
||||
+open Std_utils
|
||||
+open Tools_utils
|
||||
+
|
||||
+open Types
|
||||
+open Utils
|
||||
+open DOM
|
||||
+
|
||||
+(* This is where we construct the final XML document based on
|
||||
+ * these inputs:
|
||||
+ * - Global configuration like the version of v2v etc.
|
||||
+ * - The NBD input sockets: v2vdir // "in0", "in1", etc
|
||||
+ * - The inspection data (Types.inspect)
|
||||
+ *)
|
||||
+let rec create_inspector_xml v2vdir inspect target_meta =
|
||||
+ let body = ref [] in
|
||||
+
|
||||
+ (* Record the version of virt-v2v etc, mainly for debugging. *)
|
||||
+ List.push_back_list body [
|
||||
+ Comment generated_by;
|
||||
+ e "program" [] [PCData "virt-v2v-inspector"];
|
||||
+ e "package" [] [PCData Config.package_name];
|
||||
+ e "version" [] [PCData Config.package_version];
|
||||
+ ];
|
||||
+
|
||||
+ (* The disks. *)
|
||||
+ let disks = ref [] in
|
||||
+
|
||||
+ List.iter (
|
||||
+ fun (i, virtual_size) ->
|
||||
+ let elems = ref [] in
|
||||
+ List.push_back elems (e "virtual-size" []
|
||||
+ [PCData (Int64.to_string virtual_size)]);
|
||||
+ (match get_input_disk_allocated v2vdir i with
|
||||
+ | None -> ()
|
||||
+ | Some real_size ->
|
||||
+ List.push_back elems (e "allocated" [ "estimated", "true" ]
|
||||
+ [PCData (Int64.to_string real_size)])
|
||||
+ );
|
||||
+
|
||||
+ List.push_back disks (e "disk" [ "index", string_of_int i ] !elems)
|
||||
+ ) (get_disks v2vdir);
|
||||
+ List.push_back body (e "disks" [] !disks);
|
||||
+
|
||||
+ (* The <firmware> field is outside the <operatingsystem> element,
|
||||
+ * since firmware is not part of the OS, and also because this is
|
||||
+ * consistent with virt-drivers output.
|
||||
+ *)
|
||||
+ List.push_back body
|
||||
+ (e "firmware"
|
||||
+ ["type",
|
||||
+ string_of_target_firmware target_meta.target_firmware]
|
||||
+ []);
|
||||
+
|
||||
+ (* The inspection data. *)
|
||||
+ (* NB: Keep these field names compatible with virt-inspector! *)
|
||||
+ let os = ref [] in
|
||||
+ List.push_back os (e "name" [] [PCData inspect.i_type]);
|
||||
+ List.push_back os (e "distro" [] [PCData inspect.i_distro]);
|
||||
+ List.push_back os (e "osinfo" [] [PCData inspect.i_osinfo]);
|
||||
+ List.push_back os (e "arch" [] [PCData inspect.i_arch]);
|
||||
+ List.push_back os (e "major_version" []
|
||||
+ [PCData (string_of_int inspect.i_major_version)]);
|
||||
+ List.push_back os (e "minor_version" []
|
||||
+ [PCData (string_of_int inspect.i_minor_version)]);
|
||||
+ if inspect.i_package_format <> "" then
|
||||
+ List.push_back os (e "package_format" []
|
||||
+ [PCData inspect.i_package_format]);
|
||||
+ if inspect.i_package_management <> "" then
|
||||
+ List.push_back os (e "package_management" []
|
||||
+ [PCData inspect.i_package_management]);
|
||||
+ if inspect.i_product_name <> "" then
|
||||
+ List.push_back os (e "product_name" [] [PCData inspect.i_product_name]);
|
||||
+ if inspect.i_product_variant <> "" then
|
||||
+ List.push_back os (e "product_variant" []
|
||||
+ [PCData inspect.i_product_variant]);
|
||||
+
|
||||
+ if inspect.i_windows_systemroot <> "" then
|
||||
+ List.push_back os (e "windows_systemroot" []
|
||||
+ [PCData inspect.i_windows_systemroot]);
|
||||
+ if inspect.i_windows_software_hive <> "" then
|
||||
+ List.push_back os (e "windows_software_hive" []
|
||||
+ [PCData inspect.i_windows_software_hive]);
|
||||
+ if inspect.i_windows_systemroot <> "" then
|
||||
+ List.push_back os (e "windows_system_hive" []
|
||||
+ [PCData inspect.i_windows_system_hive]);
|
||||
+ if inspect.i_windows_current_control_set <> "" then
|
||||
+ List.push_back os (e "windows_current_control_set" []
|
||||
+ [PCData inspect.i_windows_current_control_set]);
|
||||
+
|
||||
+ List.push_back os (e "root" [] [PCData inspect.i_root]);
|
||||
+ let mps = ref [] in
|
||||
+ List.iter (
|
||||
+ fun (fs, dev) ->
|
||||
+ List.push_back mps (e "mountpoint" [ "dev", dev ] [PCData fs])
|
||||
+ ) inspect.i_mountpoints;
|
||||
+ List.push_back os (e "mountpoints" [] !mps);
|
||||
+
|
||||
+ List.push_back body (e "operatingsystem" [] !os);
|
||||
+
|
||||
+ (* Construct the final document. *)
|
||||
+ (doc "v2v-inspection" [] !body : DOM.doc)
|
||||
+
|
||||
+
|
||||
+(* This is a copy of {!Output.get_disks}. *)
|
||||
+and get_disks dir =
|
||||
+ let rec loop acc i =
|
||||
+ let socket = sprintf "%s/in%d" dir i in
|
||||
+ if Sys.file_exists socket then (
|
||||
+ let size = Utils.with_nbd_connect_unix ~socket NBD.get_size in
|
||||
+ loop ((i, size) :: acc) (i+1)
|
||||
+ )
|
||||
+ else
|
||||
+ List.rev acc
|
||||
+ in
|
||||
+ loop [] 0
|
||||
+
|
||||
+(* This is like {!Utils.get_disk_allocated} but works on the input disks. *)
|
||||
+and get_input_disk_allocated dir i =
|
||||
+ let socket = sprintf "%s/in%d" dir i
|
||||
+ and alloc_ctx = "base:allocation" in
|
||||
+ with_nbd_connect_unix ~socket ~meta_contexts:[alloc_ctx]
|
||||
+ (fun nbd ->
|
||||
+ if NBD.can_meta_context nbd alloc_ctx then (
|
||||
+ (* Get the list of extents, using a 2GiB chunk size as hint. *)
|
||||
+ let size = NBD.get_size nbd
|
||||
+ and allocated = ref 0_L
|
||||
+ and fetch_offset = ref 0_L in
|
||||
+ while !fetch_offset < size do
|
||||
+ let remaining = size -^ !fetch_offset in
|
||||
+ let fetch_size = min 0x8000_0000_L remaining in
|
||||
+ NBD.block_status nbd fetch_size !fetch_offset
|
||||
+ (fun ctx offset entries err ->
|
||||
+ assert (ctx = alloc_ctx);
|
||||
+ for i = 0 to Array.length entries / 2 - 1 do
|
||||
+ let len = entries.(i * 2)
|
||||
+ and typ = entries.(i * 2 + 1) in
|
||||
+ assert (len > 0_L);
|
||||
+ if typ &^ 1_L = 0_L then
|
||||
+ allocated := !allocated +^ len;
|
||||
+ fetch_offset := !fetch_offset +^ len
|
||||
+ done;
|
||||
+ 0
|
||||
+ )
|
||||
+ done;
|
||||
+ Some !allocated
|
||||
+ ) else None
|
||||
+ )
|
||||
diff --git a/inspector/create_inspector_xml.mli b/inspector/create_inspector_xml.mli
|
||||
new file mode 100644
|
||||
index 00000000..4f09269c
|
||||
--- /dev/null
|
||||
+++ b/inspector/create_inspector_xml.mli
|
||||
@@ -0,0 +1,22 @@
|
||||
+(* virt-v2v-in-place
|
||||
+ * Copyright (C) 2009-2024 Red Hat Inc.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along
|
||||
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+ *)
|
||||
+
|
||||
+val create_inspector_xml : string -> Types.inspect -> Types.target_meta ->
|
||||
+ DOM.doc
|
||||
+(** Create the XML output of virt-v2v-inspector which contains the
|
||||
+ post-conversion metadata. *)
|
||||
diff --git a/inspector/inspector.ml b/inspector/inspector.ml
|
||||
index aeddbec6..ac26146f 100644
|
||||
--- a/inspector/inspector.ml
|
||||
+++ b/inspector/inspector.ml
|
||||
@@ -27,7 +27,7 @@ open Getopt.OptionName
|
||||
|
||||
open Types
|
||||
open Utils
|
||||
-open DOM
|
||||
+open Create_inspector_xml
|
||||
|
||||
(* Matches --mac command line parameters. *)
|
||||
let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$"
|
||||
@@ -368,7 +368,7 @@ read the man page virt-v2v-inspector(1).
|
||||
);
|
||||
|
||||
(* Dump out the information. *)
|
||||
- let doc = inspector_xml v2vdir inspect target_meta in
|
||||
+ let doc = create_inspector_xml v2vdir inspect target_meta in
|
||||
let chan =
|
||||
match output_file with
|
||||
| None -> Stdlib.stdout
|
||||
@@ -404,144 +404,4 @@ and check_host_free_space () =
|
||||
\"Minimum free space check in the host\".")
|
||||
large_tmpdir (human_size free_space)
|
||||
|
||||
-(* This is a copy of {!Output.get_disks}. *)
|
||||
-and get_disks dir =
|
||||
- let rec loop acc i =
|
||||
- let socket = sprintf "%s/in%d" dir i in
|
||||
- if Sys.file_exists socket then (
|
||||
- let size = Utils.with_nbd_connect_unix ~socket NBD.get_size in
|
||||
- loop ((i, size) :: acc) (i+1)
|
||||
- )
|
||||
- else
|
||||
- List.rev acc
|
||||
- in
|
||||
- loop [] 0
|
||||
-
|
||||
-(* This is like {!Utils.get_disk_allocated} but works on the input disks. *)
|
||||
-and get_input_disk_allocated dir i =
|
||||
- let socket = sprintf "%s/in%d" dir i
|
||||
- and alloc_ctx = "base:allocation" in
|
||||
- with_nbd_connect_unix ~socket ~meta_contexts:[alloc_ctx]
|
||||
- (fun nbd ->
|
||||
- if NBD.can_meta_context nbd alloc_ctx then (
|
||||
- (* Get the list of extents, using a 2GiB chunk size as hint. *)
|
||||
- let size = NBD.get_size nbd
|
||||
- and allocated = ref 0_L
|
||||
- and fetch_offset = ref 0_L in
|
||||
- while !fetch_offset < size do
|
||||
- let remaining = size -^ !fetch_offset in
|
||||
- let fetch_size = min 0x8000_0000_L remaining in
|
||||
- NBD.block_status nbd fetch_size !fetch_offset
|
||||
- (fun ctx offset entries err ->
|
||||
- assert (ctx = alloc_ctx);
|
||||
- for i = 0 to Array.length entries / 2 - 1 do
|
||||
- let len = entries.(i * 2)
|
||||
- and typ = entries.(i * 2 + 1) in
|
||||
- assert (len > 0_L);
|
||||
- if typ &^ 1_L = 0_L then
|
||||
- allocated := !allocated +^ len;
|
||||
- fetch_offset := !fetch_offset +^ len
|
||||
- done;
|
||||
- 0
|
||||
- )
|
||||
- done;
|
||||
- Some !allocated
|
||||
- ) else None
|
||||
- )
|
||||
-
|
||||
-(* This is where we construct the final XML document based on
|
||||
- * these inputs:
|
||||
- * - Global configuration like the version of v2v etc.
|
||||
- * - The NBD input sockets: v2vdir // "in0", "in1", etc
|
||||
- * - The inspection data (Types.inspect)
|
||||
- *)
|
||||
-and inspector_xml v2vdir inspect target_meta =
|
||||
- let body = ref [] in
|
||||
-
|
||||
- (* Record the version of virt-v2v etc, mainly for debugging. *)
|
||||
- List.push_back_list body [
|
||||
- Comment generated_by;
|
||||
- e "program" [] [PCData "virt-v2v-inspector"];
|
||||
- e "package" [] [PCData Config.package_name];
|
||||
- e "version" [] [PCData Config.package_version];
|
||||
- ];
|
||||
-
|
||||
- (* The disks. *)
|
||||
- let disks = ref [] in
|
||||
-
|
||||
- List.iter (
|
||||
- fun (i, virtual_size) ->
|
||||
- let elems = ref [] in
|
||||
- List.push_back elems (e "virtual-size" []
|
||||
- [PCData (Int64.to_string virtual_size)]);
|
||||
- (match get_input_disk_allocated v2vdir i with
|
||||
- | None -> ()
|
||||
- | Some real_size ->
|
||||
- List.push_back elems (e "allocated" [ "estimated", "true" ]
|
||||
- [PCData (Int64.to_string real_size)])
|
||||
- );
|
||||
-
|
||||
- List.push_back disks (e "disk" [ "index", string_of_int i ] !elems)
|
||||
- ) (get_disks v2vdir);
|
||||
- List.push_back body (e "disks" [] !disks);
|
||||
-
|
||||
- (* The <firmware> field is outside the <operatingsystem> element,
|
||||
- * since firmware is not part of the OS, and also because this is
|
||||
- * consistent with virt-drivers output.
|
||||
- *)
|
||||
- List.push_back body
|
||||
- (e "firmware"
|
||||
- ["type",
|
||||
- string_of_target_firmware target_meta.target_firmware]
|
||||
- []);
|
||||
-
|
||||
- (* The inspection data. *)
|
||||
- (* NB: Keep these field names compatible with virt-inspector! *)
|
||||
- let os = ref [] in
|
||||
- List.push_back os (e "name" [] [PCData inspect.i_type]);
|
||||
- List.push_back os (e "distro" [] [PCData inspect.i_distro]);
|
||||
- List.push_back os (e "osinfo" [] [PCData inspect.i_osinfo]);
|
||||
- List.push_back os (e "arch" [] [PCData inspect.i_arch]);
|
||||
- List.push_back os (e "major_version" []
|
||||
- [PCData (string_of_int inspect.i_major_version)]);
|
||||
- List.push_back os (e "minor_version" []
|
||||
- [PCData (string_of_int inspect.i_minor_version)]);
|
||||
- if inspect.i_package_format <> "" then
|
||||
- List.push_back os (e "package_format" []
|
||||
- [PCData inspect.i_package_format]);
|
||||
- if inspect.i_package_management <> "" then
|
||||
- List.push_back os (e "package_management" []
|
||||
- [PCData inspect.i_package_management]);
|
||||
- if inspect.i_product_name <> "" then
|
||||
- List.push_back os (e "product_name" [] [PCData inspect.i_product_name]);
|
||||
- if inspect.i_product_variant <> "" then
|
||||
- List.push_back os (e "product_variant" []
|
||||
- [PCData inspect.i_product_variant]);
|
||||
-
|
||||
- if inspect.i_windows_systemroot <> "" then
|
||||
- List.push_back os (e "windows_systemroot" []
|
||||
- [PCData inspect.i_windows_systemroot]);
|
||||
- if inspect.i_windows_software_hive <> "" then
|
||||
- List.push_back os (e "windows_software_hive" []
|
||||
- [PCData inspect.i_windows_software_hive]);
|
||||
- if inspect.i_windows_systemroot <> "" then
|
||||
- List.push_back os (e "windows_system_hive" []
|
||||
- [PCData inspect.i_windows_system_hive]);
|
||||
- if inspect.i_windows_current_control_set <> "" then
|
||||
- List.push_back os (e "windows_current_control_set" []
|
||||
- [PCData inspect.i_windows_current_control_set]);
|
||||
-
|
||||
- List.push_back os (e "root" [] [PCData inspect.i_root]);
|
||||
- let mps = ref [] in
|
||||
- List.iter (
|
||||
- fun (fs, dev) ->
|
||||
- List.push_back mps (e "mountpoint" [ "dev", dev ] [PCData fs])
|
||||
- ) inspect.i_mountpoints;
|
||||
- List.push_back os (e "mountpoints" [] !mps);
|
||||
-
|
||||
- List.push_back body (e "operatingsystem" [] !os);
|
||||
-
|
||||
- (* Construct the final document. *)
|
||||
- (doc "v2v-inspection" [] !body : DOM.doc)
|
||||
-
|
||||
let () = run_main_and_handle_errors main
|
||||
@ -0,0 +1,33 @@
|
||||
From e6f1a170002bff5db70aa8a8b6987ef1122d61e1 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 15:28:38 +0000
|
||||
Subject: [PATCH] build: Define MLOBJECT (OCaml object file) as either cmo or
|
||||
cmx
|
||||
|
||||
This macro expands to either cmo or cmx depending on whether we are
|
||||
compiling for bytecode or native code.
|
||||
|
||||
This is a natural extension of the existing MLARCHIVE macro.
|
||||
|
||||
(cherry picked from commit 7b43b226eb3af18a5bd58b2664fb064832404a47)
|
||||
---
|
||||
subdir-rules.mk | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/subdir-rules.mk b/subdir-rules.mk
|
||||
index e969f357..05221b95 100644
|
||||
--- a/subdir-rules.mk
|
||||
+++ b/subdir-rules.mk
|
||||
@@ -47,10 +47,12 @@ $(top_builddir)/generator/generator:
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
MLARCHIVE = cma
|
||||
+MLOBJECT = cmo
|
||||
LINK_CUSTOM_OCAMLC_ONLY = -output-complete-exe
|
||||
BEST = c
|
||||
else
|
||||
MLARCHIVE = cmxa
|
||||
+MLOBJECT = cmx
|
||||
BEST = opt
|
||||
endif
|
||||
|
||||
@ -0,0 +1,284 @@
|
||||
From 3dc5eb5c76fd6be2108c5b3907d9d31bbacd00a5 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 5 Dec 2024 13:36:29 +0000
|
||||
Subject: [PATCH] in-place: Add new -O option to write inspector XML
|
||||
|
||||
When using virt-v2v-in-place there is no easy way to get the
|
||||
post-conversion metadata, such as the operating system and firmware
|
||||
that virt-v2v detected inside the guest.
|
||||
|
||||
This commit adds new, optional '-O output.xml' to write this
|
||||
information out to a file. The format is identical to
|
||||
virt-v2v-inspector (and roughly a superset of virt-inspector).
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-58032
|
||||
Thanks: Martin Necas
|
||||
(cherry picked from commit 2f0958e5ac5c3442c2771518c5b73d6ebcd5bd4a)
|
||||
---
|
||||
docs/virt-v2v-in-place.pod | 18 +++++++++
|
||||
in-place/Makefile.am | 2 +
|
||||
in-place/in_place.ml | 39 +++++++++++++-----
|
||||
tests/Makefile.am | 2 +
|
||||
tests/test-in-place-xml.sh | 81 ++++++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 132 insertions(+), 10 deletions(-)
|
||||
create mode 100755 tests/test-in-place-xml.sh
|
||||
|
||||
diff --git a/docs/virt-v2v-in-place.pod b/docs/virt-v2v-in-place.pod
|
||||
index 4057dae5..34e99cf0 100644
|
||||
--- a/docs/virt-v2v-in-place.pod
|
||||
+++ b/docs/virt-v2v-in-place.pod
|
||||
@@ -7,10 +7,12 @@ virt-v2v-in-place - Convert a guest to use KVM in-place
|
||||
virt-v2v-in-place -i disk [other -i* options]
|
||||
[virt-customize options]
|
||||
filename
|
||||
+ [-O output.xml]
|
||||
|
||||
virt-v2v-in-place -i libvirt|libvirtxml [other -i* options]
|
||||
[virt-customize options]
|
||||
guest
|
||||
+ [-O output.xml]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -35,6 +37,14 @@ If the guest has been copied to local libvirt then:
|
||||
|
||||
virt-v2v-in-place -i libvirt guest
|
||||
|
||||
+=head2 Output XML
|
||||
+
|
||||
+Optionally use the I<-O> option to write post-conversion metadata
|
||||
+about the guest to an XML file. This is in the same format as
|
||||
+L<virt-v2v-inspector(1)>. This can be used, for example, to find out
|
||||
+what operating system and firmware was found inside the guest during
|
||||
+conversion.
|
||||
+
|
||||
=head2 Exit code
|
||||
|
||||
If virt-v2v-in-place fails it will return a non-zero (error) exit
|
||||
@@ -205,6 +215,14 @@ are mapped to C<out>.
|
||||
|
||||
See L<virt-v2v(1)/Networks and bridges>.
|
||||
|
||||
+=item B<-O> output.xml
|
||||
+
|
||||
+=item B<-O ->
|
||||
+
|
||||
+If this option is present, write post-conversion metadata about the
|
||||
+guest to the named XML file, or to stdout if I<-O -> is used. This is
|
||||
+in the same format as L<virt-v2v-inspector(1)>.
|
||||
+
|
||||
=item B<--print-source>
|
||||
|
||||
Print information about the source guest and stop. This option is
|
||||
diff --git a/in-place/Makefile.am b/in-place/Makefile.am
|
||||
index 2fecb3a7..89e3f5f3 100644
|
||||
--- a/in-place/Makefile.am
|
||||
+++ b/in-place/Makefile.am
|
||||
@@ -57,6 +57,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/lib \
|
||||
-I $(top_builddir)/input \
|
||||
-I $(top_builddir)/convert \
|
||||
+ -I $(top_builddir)/inspector \
|
||||
-I $(top_builddir)/common/mlstdutils \
|
||||
-I $(top_builddir)/common/mlutils \
|
||||
-I $(top_builddir)/common/mlgettext \
|
||||
@@ -103,6 +104,7 @@ OCAMLLINKFLAGS = \
|
||||
mlv2vlib.$(MLARCHIVE) \
|
||||
mlconvert.$(MLARCHIVE) \
|
||||
mlinput.$(MLARCHIVE) \
|
||||
+ create_inspector_xml.$(MLOBJECT) \
|
||||
$(LINK_CUSTOM_OCAMLC_ONLY)
|
||||
|
||||
virt_v2v_in_place_DEPENDENCIES = \
|
||||
diff --git a/in-place/in_place.ml b/in-place/in_place.ml
|
||||
index 42075139..c77533e7 100644
|
||||
--- a/in-place/in_place.ml
|
||||
+++ b/in-place/in_place.ml
|
||||
@@ -28,6 +28,12 @@ open Getopt.OptionName
|
||||
open Types
|
||||
open Utils
|
||||
|
||||
+open Create_inspector_xml
|
||||
+
|
||||
+type output_xml_option =
|
||||
+ | No_output_xml | Output_xml_to_stdout
|
||||
+ | Output_xml_to_file of string
|
||||
+
|
||||
(* Matches --mac command line parameters. *)
|
||||
let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$"
|
||||
let mac_ip_re = PCRE.compile "^([[:xdigit:]]|:|\\.)+$"
|
||||
@@ -61,6 +67,13 @@ let rec main () =
|
||||
in
|
||||
|
||||
let network_map = Networks.create () in
|
||||
+
|
||||
+ let output_xml = ref No_output_xml in
|
||||
+ let set_output_xml_option filename =
|
||||
+ if filename = "-" then output_xml := Output_xml_to_stdout
|
||||
+ else output_xml := Output_xml_to_file filename
|
||||
+ in
|
||||
+
|
||||
let static_ips = ref [] in
|
||||
let rec add_network str =
|
||||
match String.split ":" str with
|
||||
@@ -172,6 +185,8 @@ let rec main () =
|
||||
s_"Map NIC to network or bridge or assign static IP";
|
||||
[ S 'n'; L"network" ], Getopt.String ("in:out", add_network),
|
||||
s_"Map network ‘in’ to ‘out’";
|
||||
+ [ S 'O' ], Getopt.String ("output.xml", set_output_xml_option),
|
||||
+ s_"Set the output filename";
|
||||
[ L"print-source" ], Getopt.Set print_source,
|
||||
s_"Print source and stop";
|
||||
[ L"root" ], Getopt.String ("ask|... ", set_root_choice),
|
||||
@@ -228,6 +243,7 @@ read the man page virt-v2v-in-place(1).
|
||||
let customize_ops = get_customize_ops () in
|
||||
let input_conn = !input_conn in
|
||||
let input_mode = !input_mode in
|
||||
+ let output_xml = !output_xml in
|
||||
let print_source = !print_source in
|
||||
let root_choice = !root_choice in
|
||||
let static_ips = !static_ips in
|
||||
@@ -246,6 +262,7 @@ read the man page virt-v2v-in-place(1).
|
||||
pr "mac-option\n";
|
||||
pr "mac-ip-option\n";
|
||||
pr "customize-ops\n";
|
||||
+ pr "output-xml-option\n";
|
||||
pr "input:disk\n";
|
||||
pr "input:libvirt\n";
|
||||
pr "input:libvirtxml\n";
|
||||
@@ -348,16 +365,18 @@ read the man page virt-v2v-in-place(1).
|
||||
ignore (Sys.command cmd)
|
||||
);
|
||||
|
||||
- (* XXX Should we create target metadata and if so where?
|
||||
- *
|
||||
- * If the input mode is libvirt, there is an argument for
|
||||
- * updating the libvirt XML of the guest. If the input
|
||||
- * mode is disk, maybe we should write <guestname>.xml.
|
||||
- *
|
||||
- * For the moment we just ignore the output from the
|
||||
- * conversion step.
|
||||
- *)
|
||||
- ignore (inspect, target_meta);
|
||||
+ (* Write the post-conversion metadata, if asked. *)
|
||||
+ let chan =
|
||||
+ match output_xml with
|
||||
+ | No_output_xml -> None
|
||||
+ | Output_xml_to_stdout -> Some Stdlib.stdout
|
||||
+ | Output_xml_to_file filename -> Some (open_out filename) in
|
||||
+ Option.iter (
|
||||
+ fun chan ->
|
||||
+ let doc = create_inspector_xml v2vdir inspect target_meta in
|
||||
+ DOM.doc_to_chan chan doc;
|
||||
+ Stdlib.flush chan
|
||||
+ ) chan;
|
||||
|
||||
message (f_"Finishing off");
|
||||
(* As the last thing, write a file indicating success before
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 0dd5927b..4d46daf9 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -82,6 +82,7 @@ TESTS = \
|
||||
test-i-ova.sh \
|
||||
test-i-vmx.sh \
|
||||
test-in-place.sh \
|
||||
+ test-in-place-xml.sh \
|
||||
test-inspector.sh \
|
||||
test-it-vddk-io-query.sh \
|
||||
test-mac.sh \
|
||||
@@ -245,6 +246,7 @@ EXTRA_DIST += \
|
||||
test-i-vmx-7.vmx \
|
||||
test-i-vmx.sh \
|
||||
test-in-place.sh \
|
||||
+ test-in-place-xml.sh \
|
||||
test-inspector.sh \
|
||||
test-it-vddk-io-query.sh \
|
||||
test-mac-expected.xml \
|
||||
diff --git a/tests/test-in-place-xml.sh b/tests/test-in-place-xml.sh
|
||||
new file mode 100755
|
||||
index 00000000..e9580006
|
||||
--- /dev/null
|
||||
+++ b/tests/test-in-place-xml.sh
|
||||
@@ -0,0 +1,81 @@
|
||||
+#!/bin/bash -
|
||||
+# libguestfs virt-v2v test script
|
||||
+# Copyright (C) 2014-2024 Red Hat Inc.
|
||||
+# Copyright (C) 2015 Parallels IP Holdings GmbH.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+
|
||||
+# Test virt-v2v-in-place -O option.
|
||||
+
|
||||
+unset CDPATH
|
||||
+export LANG=C
|
||||
+set -e
|
||||
+
|
||||
+source ./functions.sh
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+skip_if_skipped
|
||||
+requires test -f ../test-data/phony-guests/windows.img
|
||||
+
|
||||
+img_base="$abs_top_builddir/test-data/phony-guests/windows.img"
|
||||
+
|
||||
+export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
|
||||
+export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
|
||||
+
|
||||
+d=$PWD/test-v2v-in-place-xml.d
|
||||
+rm -rf $d
|
||||
+cleanup_fn rm -r $d
|
||||
+mkdir $d
|
||||
+
|
||||
+img="$d/test.qcow2"
|
||||
+qemu-img convert -f raw $img_base -O qcow2 $img
|
||||
+
|
||||
+out="$d/out.xml"
|
||||
+
|
||||
+libvirt_xml="$d/test.xml"
|
||||
+rm -f $libvirt_xml
|
||||
+n=windows
|
||||
+cat > $libvirt_xml <<EOF
|
||||
+<node>
|
||||
+ <domain type='test'>
|
||||
+ <name>$n</name>
|
||||
+ <memory>1048576</memory>
|
||||
+ <os>
|
||||
+ <type>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <devices>
|
||||
+ <disk type='file' device='disk'>
|
||||
+ <driver name='qemu' type='qcow2'/>
|
||||
+ <source file='$img'/>
|
||||
+ <target dev='vda' bus='virtio'/>
|
||||
+ </disk>
|
||||
+ </devices>
|
||||
+ </domain>
|
||||
+</node>
|
||||
+EOF
|
||||
+
|
||||
+$VG virt-v2v-in-place --debug-gc -i libvirt -ic "test://$libvirt_xml" \
|
||||
+ $n -O $out
|
||||
+cat $out
|
||||
+
|
||||
+# Expect certain elements to be present.
|
||||
+grep '^<v2v-inspection' $out
|
||||
+grep '<program>virt-v2v-inspector</program>' $out
|
||||
+grep '<disks>' $out
|
||||
+grep "<disk index='0'>" $out
|
||||
+grep '<distro>windows</distro>' $out
|
||||
+grep '<osinfo>win2k22</osinfo>' $out
|
||||
@ -0,0 +1,49 @@
|
||||
From 2c1aee0f2a33ae9a7653dcd6e827038976d4121f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Jan 2025 11:11:46 +0000
|
||||
Subject: [PATCH] convert: Mention "operating system" in error message
|
||||
|
||||
A member of Red Hat's support team mentioned that the error "source
|
||||
guest" is confusing. Since this refers to the operating system inside
|
||||
the source guest, say that.
|
||||
|
||||
(cherry picked from commit f58b02a64f4238d7e2ddec45082a6f9b2c98a0c8)
|
||||
---
|
||||
convert/inspect_source.ml | 19 ++++++++++---------
|
||||
1 file changed, 10 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/convert/inspect_source.ml b/convert/inspect_source.ml
|
||||
index 78447193..218e517a 100644
|
||||
--- a/convert/inspect_source.ml
|
||||
+++ b/convert/inspect_source.ml
|
||||
@@ -141,11 +141,11 @@ let rec inspect_source root_choice g =
|
||||
and choose_root root_choice g = function
|
||||
| [] ->
|
||||
error (f_"inspection could not detect the source guest \
|
||||
- (or physical machine).\n\nAssuming 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.\n\nNo root device \
|
||||
- found in this operating system image.");
|
||||
+ (or physical machine) operating system.\n\n\
|
||||
+ 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.\n\n\
|
||||
+ No root device found in this operating system image.");
|
||||
| [root] -> root (* only one root, so return it *)
|
||||
| roots ->
|
||||
(* If there are multiple roots, use the [--root] option supplied
|
||||
@@ -254,8 +254,9 @@ and sanity_check_inspection inspect =
|
||||
and error_if_unknown fieldname value =
|
||||
if value = "unknown" then
|
||||
error (f_"inspection could not detect the source guest (or \
|
||||
- physical machine).\n\nAssuming 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.\n\nInspection field ‘%s’ was ‘unknown’.")
|
||||
+ physical machine) operating system.\n\n\
|
||||
+ 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.\n\n\
|
||||
+ Inspection field ‘%s’ was ‘unknown’.")
|
||||
fieldname
|
||||
189
SOURCES/0030-Update-common-submodule.patch
Normal file
189
SOURCES/0030-Update-common-submodule.patch
Normal file
@ -0,0 +1,189 @@
|
||||
From 60785259a8bea65663da270b25ea6f46be42aa0f Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 9 Feb 2025 17:35:14 +0000
|
||||
Subject: [PATCH] Update common submodule
|
||||
|
||||
Pulls in the following fix:
|
||||
|
||||
commit 38315604596ac747e44e38db79496610efee49f8
|
||||
Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
Date: Thu Feb 6 08:04:38 2025 +0000
|
||||
|
||||
mldrivers/linux_bootloaders.ml: Don't overwrite EFI grub2 wrapper
|
||||
|
||||
Fedora 34+ and RHEL 9.0+ unified BIOS and UEFI grub configuration into
|
||||
a single file. This leaves /boot/efi/EFI/<OS>/grub.cfg as a so-called
|
||||
"wrapper" which just loads the real grub2 configuration at
|
||||
/boot/grub2/grub.cfg.
|
||||
|
||||
Running '/sbin/grub2-mkconfig -o /boot/efi/EFI/<OS>/grub.cfg'
|
||||
overwrites the wrapper instead of the real configuration file.
|
||||
|
||||
RHEL 9.5 added a hard error if you try to do this, which broke
|
||||
virt-v2v. The error message was:
|
||||
|
||||
commandrvf: /sbin/grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
|
||||
Running `grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg' will
|
||||
overwrite the GRUB wrapper. Please run `grub2-mkconfig -o
|
||||
/boot/grub2/grub.cfg' instead to update grub.cfg.
|
||||
|
||||
Try to detect this situation and substitute the real grub
|
||||
configuration file instead.
|
||||
|
||||
Reported-by: Robert Knipp, Fabian Deutsch
|
||||
Thanks: Nijin Ashok, Marta Lewandowska
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-77989
|
||||
Related: https://issues.redhat.com/browse/RHEL-32099
|
||||
Related: https://fedoraproject.org/wiki/Changes/UnifyGrubConfig
|
||||
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-77989
|
||||
Related: https://issues.redhat.com/browse/RHEL-32099
|
||||
(cherry picked from commit 17610d1c9b37424fec55c39fbf83c971a843f45f)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common faee2645..2bb8c83c:
|
||||
diff --git a/common/mldrivers/linux_bootloaders.ml b/common/mldrivers/linux_bootloaders.ml
|
||||
index 91c5ab9e..a821a3f3 100644
|
||||
--- a/common/mldrivers/linux_bootloaders.ml
|
||||
+++ b/common/mldrivers/linux_bootloaders.ml
|
||||
@@ -375,8 +375,7 @@ let detect_bootloader (g : G.guestfs) root i_firmware =
|
||||
with G.Error msg ->
|
||||
error (f_"could not find bootloader mount point (%s): %s") mp msg in
|
||||
|
||||
- (*
|
||||
- * Workaround for older UEFI-based Debian which may not have
|
||||
+ (* Workaround for older UEFI-based Debian which may not have
|
||||
* /boot/efi/EFI/debian/grub.cfg.
|
||||
*)
|
||||
let paths =
|
||||
@@ -410,6 +409,28 @@ let detect_bootloader (g : G.guestfs) root i_firmware =
|
||||
in
|
||||
loop paths in
|
||||
|
||||
+ (* If we found a grub2 boot config called /boot/efi/EFI/<OS>/grub.cfg
|
||||
+ * check if it's a "wrapper" that redirects to /boot/grub2/grub.cfg.
|
||||
+ * This is needed for Fedora 34+ and RHEL 9.0+. See:
|
||||
+ * https://issues.redhat.com/browse/RHEL-32099
|
||||
+ * https://issues.redhat.com/browse/RHEL-77989
|
||||
+ * https://github.com/libguestfs/libguestfs-common/pull/6
|
||||
+ *)
|
||||
+ let grub_config =
|
||||
+ match typ with
|
||||
+ | Grub1 -> grub_config
|
||||
+ | Grub2 ->
|
||||
+ let grub2_efi_rex = PCRE.compile "^/boot/efi/EFI/.*/grub.cfg$" in
|
||||
+ let grub2_real = "/boot/grub2/grub.cfg" in
|
||||
+
|
||||
+ if PCRE.matches grub2_efi_rex grub_config &&
|
||||
+ (* does it look like the "wrapper"? *)
|
||||
+ g#grep "configfile \\$prefix/grub\\.cfg" grub_config <> [||] &&
|
||||
+ g#exists grub2_real then
|
||||
+ grub2_real
|
||||
+ else
|
||||
+ grub_config in
|
||||
+
|
||||
let bl =
|
||||
match typ with
|
||||
| Grub1 -> new bootloader_grub1 g root grub_config
|
||||
diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c
|
||||
index ad9c6d11..3959fd56 100644
|
||||
--- a/common/mlpcre/pcre-c.c
|
||||
+++ b/common/mlpcre/pcre-c.c
|
||||
@@ -39,19 +39,6 @@
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
|
||||
-/* Replacement if caml_alloc_initialized_string is missing, added
|
||||
- * to OCaml runtime in 2017.
|
||||
- */
|
||||
-#ifndef HAVE_CAML_ALLOC_INITIALIZED_STRING
|
||||
-static inline value
|
||||
-caml_alloc_initialized_string (mlsize_t len, const char *p)
|
||||
-{
|
||||
- value sv = caml_alloc_string (len);
|
||||
- memcpy ((char *) String_val (sv), p, len);
|
||||
- return sv;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
/* Data on the most recent match is stored in this thread-local
|
||||
* variable. It is freed either by the next call to PCRE.matches or
|
||||
* by (clean) thread exit.
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index 86b21a7c..5be358de 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -392,21 +392,6 @@ module List = struct
|
||||
let push_front_list xs xsp = xsp := xs @ !xsp
|
||||
end
|
||||
|
||||
-module Option = struct
|
||||
- let iter f = function
|
||||
- | None -> ()
|
||||
- | Some x -> f x
|
||||
-
|
||||
- let map f = function
|
||||
- | None -> None
|
||||
- | Some x -> Some (f x)
|
||||
-
|
||||
- let value x ~default =
|
||||
- match x with
|
||||
- | None -> default
|
||||
- | Some x -> x
|
||||
-end
|
||||
-
|
||||
let (//) = Filename.concat
|
||||
let quote = Filename.quote
|
||||
|
||||
diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli
|
||||
index a39ac5f3..c320b877 100644
|
||||
--- a/common/mlstdutils/std_utils.mli
|
||||
+++ b/common/mlstdutils/std_utils.mli
|
||||
@@ -290,21 +290,6 @@ module List : sig
|
||||
end
|
||||
(** Override the List module from stdlib. *)
|
||||
|
||||
-module Option : sig
|
||||
- val iter : ('a -> unit) -> 'a option -> unit
|
||||
- (** [iter f o] is [f v] if [o] is [Some v] and [()] otherwise *)
|
||||
-
|
||||
- val map : ('a -> 'b) -> 'a option -> 'b option
|
||||
- (** [map f (Some x)] returns [Some (f x)]. [map f None] returns [None]. *)
|
||||
-
|
||||
- val value : 'a option -> default:'a -> 'a
|
||||
- (** [value o ~default] is [v] if [o] is [Some v] and [default] otherwise. *)
|
||||
-end
|
||||
-(** Functions for dealing with option types.
|
||||
-
|
||||
- This module will be removed when we can use baseline OCaml 4.08
|
||||
- since that version introduces a compatible [Option] module. *)
|
||||
-
|
||||
val ( // ) : string -> string -> string
|
||||
(** Concatenate directory and filename. *)
|
||||
|
||||
diff --git a/common/mlxml/xml-c.c b/common/mlxml/xml-c.c
|
||||
index e024bd8a..9259314f 100644
|
||||
--- a/common/mlxml/xml-c.c
|
||||
+++ b/common/mlxml/xml-c.c
|
||||
@@ -41,19 +41,6 @@
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
|
||||
-/* Replacement if caml_alloc_initialized_string is missing, added
|
||||
- * to OCaml runtime in 2017.
|
||||
- */
|
||||
-#ifndef HAVE_CAML_ALLOC_INITIALIZED_STRING
|
||||
-static inline value
|
||||
-caml_alloc_initialized_string (mlsize_t len, const char *p)
|
||||
-{
|
||||
- value sv = caml_alloc_string (len);
|
||||
- memcpy ((char *) String_val (sv), p, len);
|
||||
- return sv;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
/* xmlDocPtr type */
|
||||
#define docptr_val(v) (*((xmlDocPtr *)Data_custom_val(v)))
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From c7d1809f4b57cb3161800d6fa1499029176f4fd1 Mon Sep 17 00:00:00 2001
|
||||
From 1d3017a30a2f831ee1461c1828c63c9a196805dd Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Mon, 10 Feb 2025 10:53:00 -0500
|
||||
Subject: [PATCH] convert: Use yum/apt/... for package removals, not rpm/dpkg
|
||||
@ -15,13 +15,12 @@ Just print a warning when package removal goes sideways.
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-71522
|
||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
||||
(cherry picked from commit b3268a13beca4da218e7ffe4648a18420296103a)
|
||||
(cherry picked from commit 1d3017a30a2f831ee1461c1828c63c9a196805dd)
|
||||
---
|
||||
convert/convert_linux.ml | 26 +++++++++++++++++++++-----
|
||||
1 file changed, 21 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||||
index 94dd7428..e4042d1f 100644
|
||||
index 3d0e2b88..cbae5e3d 100644
|
||||
--- a/convert/convert_linux.ml
|
||||
+++ b/convert/convert_linux.ml
|
||||
@@ -131,6 +131,23 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
@ -48,7 +47,7 @@ index 94dd7428..e4042d1f 100644
|
||||
let rec do_convert () =
|
||||
augeas_grub_configuration ();
|
||||
|
||||
@@ -239,7 +256,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
@@ -237,7 +254,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
else
|
||||
None
|
||||
) inspect.i_apps in
|
||||
@ -57,7 +56,7 @@ index 94dd7428..e4042d1f 100644
|
||||
|
||||
(* Undo related nastiness if kmod-xenpv was installed. *)
|
||||
if xenmods <> [] then (
|
||||
@@ -312,7 +329,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
@@ -310,7 +327,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
fun { G.app2_name = name } -> name = package_name
|
||||
) inspect.i_apps in
|
||||
if has_guest_additions then
|
||||
@ -66,7 +65,7 @@ index 94dd7428..e4042d1f 100644
|
||||
|
||||
(* Guest Additions might have been installed from a tarball. The
|
||||
* above code won't detect this case. Look for the uninstall tool
|
||||
@@ -457,8 +474,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
@@ -455,8 +472,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
)
|
||||
);
|
||||
|
||||
@ -76,7 +75,7 @@ index 94dd7428..e4042d1f 100644
|
||||
|
||||
(* VMware Tools may have been installed from a tarball, so the
|
||||
* above code won't remove it. Look for the uninstall tool and run
|
||||
@@ -505,7 +521,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
@@ -503,7 +519,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
|
||||
let pkgs = List.map (fun { G.app2_name = name } -> name) pkgs in
|
||||
|
||||
if pkgs <> [] then (
|
||||
@ -1,4 +1,4 @@
|
||||
From 00550a9ff230ab28d7306d881f923778cccf9e90 Mon Sep 17 00:00:00 2001
|
||||
From 453e38ce02118fc81fe9ec9ca8f81ae341c93fe7 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 19 Feb 2025 15:15:30 +0000
|
||||
Subject: [PATCH] test-data: phony fedora: Add simple static /bin/sh
|
||||
@ -10,7 +10,6 @@ inside the phony Fedora image.
|
||||
guestfs-tools commit 4c5854f54e1da0d96807acb1b047bbf34694a0bb)
|
||||
|
||||
(cherry picked from commit de073524ec9fbfa179f2721c36013b2bb312e73f)
|
||||
(cherry picked from commit 453e38ce02118fc81fe9ec9ca8f81ae341c93fe7)
|
||||
---
|
||||
test-data/phony-guests/fedora.c | 76 +++++++++++++++++++++--
|
||||
test-data/phony-guests/make-fedora-img.pl | 6 +-
|
||||
@ -1,4 +1,4 @@
|
||||
From b75bde1767c3ec64e44992742a837b26dffe3566 Mon Sep 17 00:00:00 2001
|
||||
From 0a5fb62a2816d16cbdd7452c8bd95a8fcd2d4a02 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 19 Feb 2025 14:16:13 +0000
|
||||
Subject: [PATCH] convert: Handle large output from 'rpm -ql' command
|
||||
@ -15,13 +15,12 @@ Update common submodule to include:
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-80080
|
||||
Reported-by: Nijin Ashok
|
||||
(cherry picked from commit 5dfe62885bc7d81c7d3c9260ba6def5cb477b5fd)
|
||||
(cherry picked from commit 0a5fb62a2816d16cbdd7452c8bd95a8fcd2d4a02)
|
||||
---
|
||||
common | 2 +-
|
||||
m4/guestfs-libraries.m4 | 4 +++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
Submodule common 084ea740..521f27c9:
|
||||
Submodule common 2bb8c83c..18310179:
|
||||
diff --git a/common/mldrivers/linux.ml b/common/mldrivers/linux.ml
|
||||
index 4e30a8e1..0dec1549 100644
|
||||
--- a/common/mldrivers/linux.ml
|
||||
@ -181,7 +180,7 @@ index 4e30a8e1..0dec1549 100644
|
||||
let is_file_owned (g : G.guestfs) root path =
|
||||
let package_format = g#inspect_get_package_format root in
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index 86b21a7c..1a36ab77 100644
|
||||
index 5be358de..212a1513 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -98,24 +98,27 @@ module String = struct
|
||||
@ -287,7 +286,7 @@ index 86b21a7c..1a36ab77 100644
|
||||
let rec lines_split str =
|
||||
let buf = Buffer.create 16 in
|
||||
diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli
|
||||
index a39ac5f3..7bd55fba 100644
|
||||
index c320b877..72a2d44c 100644
|
||||
--- a/common/mlstdutils/std_utils.mli
|
||||
+++ b/common/mlstdutils/std_utils.mli
|
||||
@@ -82,6 +82,10 @@ module String : sig
|
||||
@ -327,7 +326,7 @@ index 3f5bb1a8..4e368152 100644
|
||||
(* Test Std_utils.String.lines_split. *)
|
||||
let test_string_lines_split ctx =
|
||||
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
|
||||
index 6789a2cb..1cc10d5b 100644
|
||||
index f0cad0f5..3cb3cabd 100644
|
||||
--- a/m4/guestfs-libraries.m4
|
||||
+++ b/m4/guestfs-libraries.m4
|
||||
@@ -18,7 +18,9 @@
|
||||
@ -336,8 +335,8 @@ index 6789a2cb..1cc10d5b 100644
|
||||
dnl Of course we need libguestfs.
|
||||
-PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.44])
|
||||
+dnl
|
||||
+dnl We need libguestfs >= 1:1.50.2-1.el9_5 for guestfs_sh_out.
|
||||
+PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.50.2])
|
||||
+dnl We need libguestfs >= 1:1.54.0-4.el9_6 for guestfs_sh_out.
|
||||
+PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs >= 1.54.0])
|
||||
|
||||
dnl And libnbd.
|
||||
PKG_CHECK_MODULES([LIBNBD], [libnbd >= 1.10])
|
||||
@ -1,4 +1,4 @@
|
||||
From 6e2a9bd1a9362ae84a2e9d8d56bd2f5e5eb1acef Mon Sep 17 00:00:00 2001
|
||||
From f3fc9875d1c9449a74ad8444703bd65f79d47d5d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 2 Dec 2024 13:25:49 +0000
|
||||
Subject: [PATCH] build: Remove --with-virt-v2v-nbdkit-python-plugin=...
|
||||
@ -20,12 +20,12 @@ allowed you to override the default nbdkit-python-plugin name (usually
|
||||
(cherry picked from commit 9e25b211a48804b27228e17d8e123b5f1d44df8b)
|
||||
(cherry picked from commit d42726148753250e741b030a1aff09310fb9938a)
|
||||
---
|
||||
config.sh.in | 1 -
|
||||
configure.ac | 4 ----
|
||||
lib/config.ml.in | 1 -
|
||||
lib/config.mli | 9 ---------
|
||||
m4/guestfs-v2v.m4 | 28 ----------------------------
|
||||
tests/test-v2v-o-rhv-upload.sh | 2 +-
|
||||
config.sh.in | 1 -
|
||||
configure.ac | 4 ----
|
||||
lib/config.ml.in | 1 -
|
||||
lib/config.mli | 9 ---------
|
||||
m4/guestfs-v2v.m4 | 28 ----------------------------
|
||||
tests/test-o-rhv-upload.sh | 2 +-
|
||||
6 files changed, 1 insertion(+), 44 deletions(-)
|
||||
delete mode 100644 m4/guestfs-v2v.m4
|
||||
|
||||
@ -40,7 +40,7 @@ index be304b39..8f590853 100644
|
||||
-export VIRT_V2V_NBDKIT_PYTHON_PLUGIN="@VIRT_V2V_NBDKIT_PYTHON_PLUGIN@"
|
||||
export PYCODESTYLE="@PYCODESTYLE@"
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e04a2f3a..36ee7d27 100644
|
||||
index 623c634d..a99bcb75 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -97,10 +97,6 @@ dnl Perl, used for running mllibvirt generator, and man pages.
|
||||
@ -114,10 +114,10 @@ index 787864d3..00000000
|
||||
- [VIRT_V2V_NBDKIT_PYTHON_PLUGIN=python])
|
||||
-AC_MSG_RESULT([$VIRT_V2V_NBDKIT_PYTHON_PLUGIN])
|
||||
-AC_SUBST([VIRT_V2V_NBDKIT_PYTHON_PLUGIN])
|
||||
diff --git a/tests/test-v2v-o-rhv-upload.sh b/tests/test-v2v-o-rhv-upload.sh
|
||||
index 15d5d028..9ce9c3e3 100755
|
||||
--- a/tests/test-v2v-o-rhv-upload.sh
|
||||
+++ b/tests/test-v2v-o-rhv-upload.sh
|
||||
diff --git a/tests/test-o-rhv-upload.sh b/tests/test-o-rhv-upload.sh
|
||||
index 51307f80..c65fff67 100755
|
||||
--- a/tests/test-o-rhv-upload.sh
|
||||
+++ b/tests/test-o-rhv-upload.sh
|
||||
@@ -31,7 +31,7 @@ set -x
|
||||
|
||||
skip_if_skipped
|
||||
@ -1,4 +1,4 @@
|
||||
From 061627c4f0ac72ad0b617be910b9dd75b4135e91 Mon Sep 17 00:00:00 2001
|
||||
From 134b7aa79cb617c5db5794904254cfb495a1635e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 2 Dec 2024 13:43:39 +0000
|
||||
Subject: [PATCH] build: Use nbdcopy and nbdinfo from ./configure
|
||||
@ -60,10 +60,10 @@ index a02864fa..9cd249f1 100644
|
||||
+val nbdinfo : string
|
||||
+(** The location of the nbdinfo program, from configure value [@NBDINFO@] *)
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index be5a66e2..1385cd98 100644
|
||||
index e56462a5..60425768 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -640,7 +640,7 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
@@ -688,7 +688,7 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
* --target-is-zero which would be a useful optimization.
|
||||
*)
|
||||
let cmd = ref [] in
|
||||
@ -72,7 +72,7 @@ index be5a66e2..1385cd98 100644
|
||||
|
||||
(match request_size with
|
||||
| None -> ()
|
||||
@@ -672,8 +672,10 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
@@ -722,8 +722,10 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
*)
|
||||
and nbdinfo ?(content = false) uri =
|
||||
let cmd =
|
||||
@ -1,4 +1,4 @@
|
||||
From fad160cff8ef886a793cba854739688b11750467 Mon Sep 17 00:00:00 2001
|
||||
From 9197091bf47218ab2ce3ef31c2d83286bb3ca96b Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 31 Mar 2025 11:06:09 +0100
|
||||
Subject: [PATCH] v2v: Use nbdcopy --blkhash in verbose mode
|
||||
@ -31,10 +31,10 @@ Fixes: https://issues.redhat.com/browse/RHEL-85514
|
||||
3 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/lib/utils.ml b/lib/utils.ml
|
||||
index 4c9b7415..3b287a29 100644
|
||||
index f2da9e80..ecdaeb80 100644
|
||||
--- a/lib/utils.ml
|
||||
+++ b/lib/utils.ml
|
||||
@@ -195,6 +195,14 @@ let error_if_no_ssh_agent () =
|
||||
@@ -181,6 +181,14 @@ let error_if_no_ssh_agent () =
|
||||
is not set). This is required by qemu to do passwordless \
|
||||
ssh access. See the virt-v2v(1) man page for more information.")
|
||||
|
||||
@ -50,7 +50,7 @@ index 4c9b7415..3b287a29 100644
|
||||
let create_v2v_directory () =
|
||||
let d = Mkdtemp.temp_dir "v2v." in
|
||||
diff --git a/lib/utils.mli b/lib/utils.mli
|
||||
index 46d05306..68e83e37 100644
|
||||
index e7ee13d1..6b405353 100644
|
||||
--- a/lib/utils.mli
|
||||
+++ b/lib/utils.mli
|
||||
@@ -68,6 +68,9 @@ val chown_for_libvirt_rhbz_1045069 : string -> unit
|
||||
@ -64,10 +64,10 @@ index 46d05306..68e83e37 100644
|
||||
(** Create the directory containing inX and outX sockets. *)
|
||||
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 1385cd98..6ecc8ab3 100644
|
||||
index 60425768..3436ce14 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -656,6 +656,9 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
@@ -704,6 +704,9 @@ and nbdcopy ?request_size output_alloc input_uri output_uri =
|
||||
min 64 (target_buffer_size / request_size) in
|
||||
List.push_back cmd (sprintf "--requests=%d" requests);
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
From 314476e7aaf9c0d8e9a55239f6d4ea58a9d2ac27 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 25 Apr 2025 11:44:15 +0100
|
||||
Subject: [PATCH] lib/libvirt_utils.ml: Turn live domain error into a warning
|
||||
|
||||
As explained in the comment, we cannot easily tell if conversion is
|
||||
being attempted from a snapshot (which is safe, even if the domain is
|
||||
running). Therefore turn the error into a strong warning.
|
||||
|
||||
Reported-by: Martin Necas
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-88543
|
||||
(cherry picked from commit 8c27cb1e525b5e1d380ab27a141de6f026f4b2db)
|
||||
---
|
||||
lib/libvirt_utils.ml | 25 ++++++++++++++++---------
|
||||
1 file changed, 16 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/lib/libvirt_utils.ml b/lib/libvirt_utils.ml
|
||||
index 4200c7c8..41ee38d2 100644
|
||||
--- a/lib/libvirt_utils.ml
|
||||
+++ b/lib/libvirt_utils.ml
|
||||
@@ -59,20 +59,27 @@ let get_domain conn name =
|
||||
error (f_"cannot find libvirt domain ‘%s’: %s")
|
||||
name (Option.value ~default:"" message)
|
||||
) in
|
||||
- let uri = Libvirt.Connect.get_uri conn in
|
||||
- (* As a side-effect we check that the domain is shut down. Of course
|
||||
- * this is only appropriate for virt-v2v. (RHBZ#1138586)
|
||||
+
|
||||
+ (* As a side-effect we check that the domain is shut down (RHBZ#1138586).
|
||||
+ * In earlier versions of virt-v2v this was a hard error. Now it's
|
||||
+ * a warning, since we can't easily tell if the user is converting
|
||||
+ * from a snapshot - which is safe (RHEL-88543).
|
||||
*)
|
||||
+ let uri = Libvirt.Connect.get_uri conn in
|
||||
if not (String.is_prefix uri "test:") then (
|
||||
(match (Libvirt.Domain.get_info dom).Libvirt.Domain.state with
|
||||
- | InfoRunning | InfoBlocked | InfoPaused ->
|
||||
- error (f_"libvirt domain ‘%s’ is running or paused. It must be \
|
||||
- shut down in order to perform virt-v2v conversion")
|
||||
- (Libvirt.Domain.get_name dom)
|
||||
- | InfoNoState | InfoShutdown | InfoShutoff | InfoCrashed | InfoPMSuspended ->
|
||||
- ()
|
||||
+ | InfoRunning | InfoBlocked | InfoPaused ->
|
||||
+ warning (f_"libvirt domain ‘%s’ is running or paused. Converting \
|
||||
+ a live guest will result in corrupted output. \
|
||||
+ However this is safe if you're converting from a \
|
||||
+ snapshot")
|
||||
+ (Libvirt.Domain.get_name dom)
|
||||
+ | InfoNoState | InfoShutdown | InfoShutoff | InfoCrashed
|
||||
+ | InfoPMSuspended ->
|
||||
+ ()
|
||||
)
|
||||
);
|
||||
+
|
||||
dom
|
||||
|
||||
let get_pool conn name =
|
||||
@ -0,0 +1,57 @@
|
||||
From 7b2641bd22350802261b657df5e3d0de92784521 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 29 Apr 2025 13:16:41 +0100
|
||||
Subject: [PATCH] input/nbdkit_vddk.ml: Rename 'path' parameter to 'file'
|
||||
|
||||
The nbdkit parameter is called 'file'. There is no actual change here.
|
||||
|
||||
(cherry picked from commit 5acc67d454add0b75f6671c06979a0cc90562f7e)
|
||||
---
|
||||
input/input_vddk.ml | 4 ++--
|
||||
input/nbdkit_vddk.ml | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/input/input_vddk.ml b/input/input_vddk.ml
|
||||
index 6444ce18..982dff17 100644
|
||||
--- a/input/input_vddk.ml
|
||||
+++ b/input/input_vddk.ml
|
||||
@@ -193,7 +193,7 @@ information on these settings.
|
||||
| BlockDev _ | NBD _ | HTTP _ -> (* These should never happen? *)
|
||||
assert false
|
||||
|
||||
- | LocalFile path ->
|
||||
+ | LocalFile file ->
|
||||
(* The <source file=...> attribute returned by the libvirt
|
||||
* VMX driver looks like "[datastore] path". We can use it
|
||||
* directly as the nbdkit file= parameter, and it is passed
|
||||
@@ -206,7 +206,7 @@ information on these settings.
|
||||
?libdir ~moref
|
||||
?nfchostport ?password_file:options.input_password ?port
|
||||
~server ?snapshot ~thumbprint ?transports ?user
|
||||
- path in
|
||||
+ file in
|
||||
let _, pid = Nbdkit.run_unix socket nbdkit in
|
||||
On_exit.kill pid
|
||||
) disks;
|
||||
diff --git a/input/nbdkit_vddk.ml b/input/nbdkit_vddk.ml
|
||||
index 0cb45e89..597ae88f 100644
|
||||
--- a/input/nbdkit_vddk.ml
|
||||
+++ b/input/nbdkit_vddk.ml
|
||||
@@ -52,7 +52,7 @@ let libNN = sprintf "lib%d" Sys.word_size
|
||||
(* Create an nbdkit module specialized for reading from VDDK sources. *)
|
||||
let create_vddk ?bandwidth ?config ?cookie ?cor ?libdir ~moref
|
||||
?nfchostport ?password_file ?port
|
||||
- ~server ?snapshot ~thumbprint ?transports ?user path =
|
||||
+ ~server ?snapshot ~thumbprint ?transports ?user file =
|
||||
if not (Nbdkit.is_installed ()) then
|
||||
error (f_"nbdkit is not installed or not working");
|
||||
|
||||
@@ -114,7 +114,7 @@ See also the virt-v2v-input-vmware(1) manual.") libNN
|
||||
|
||||
Nbdkit.add_arg cmd "server" server;
|
||||
Nbdkit.add_arg cmd "vm" (sprintf "moref=%s" moref);
|
||||
- Nbdkit.add_arg cmd "file" path;
|
||||
+ Nbdkit.add_arg cmd "file" file;
|
||||
|
||||
(* For VDDK we require some user. If it's not supplied, assume root. *)
|
||||
let user = Option.value ~default:"root" user in
|
||||
168
SOURCES/0039-input-Add-io-vddk-file-.-option.patch
Normal file
168
SOURCES/0039-input-Add-io-vddk-file-.-option.patch
Normal file
@ -0,0 +1,168 @@
|
||||
From 96e4e9a036cfbf069b6383916687c3dac804f55a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 29 Apr 2025 13:44:07 +0100
|
||||
Subject: [PATCH] input: Add -io vddk-file=... option
|
||||
|
||||
This option allows the file parameter of nbdkit-vddk-plugin to be
|
||||
overridden. Useful for performing conversions of snapshots, since the
|
||||
filename returned by libvirt may not be the correct snapshot filename.
|
||||
|
||||
This also updates the common submodule, pulling in:
|
||||
|
||||
Richard W.M. Jones (2):
|
||||
mlstdutils: Implement String.implode
|
||||
mlstdutils: Add List.make function
|
||||
|
||||
Suggested-by: Martin Necas
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-88543
|
||||
(cherry picked from commit 5328142e6a9faae1db99c646991d27badc6efe91)
|
||||
---
|
||||
common | 2 +-
|
||||
docs/virt-v2v-input-vmware.pod | 9 +++++----
|
||||
input/input_vddk.ml | 35 ++++++++++++++++++++++++++--------
|
||||
3 files changed, 33 insertions(+), 13 deletions(-)
|
||||
|
||||
Submodule common 18310179..3da17d53:
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index 212a1513..6880fce5 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -409,6 +409,14 @@ module List = struct
|
||||
|
||||
let push_back_list xsp xs = xsp := !xsp @ xs
|
||||
let push_front_list xs xsp = xsp := xs @ !xsp
|
||||
+
|
||||
+ let make n x =
|
||||
+ let rec loop acc = function
|
||||
+ | 0 -> acc
|
||||
+ | i when i > 0 -> loop (x :: acc) (i-1)
|
||||
+ | _ -> invalid_arg "make"
|
||||
+ in
|
||||
+ loop [] n
|
||||
end
|
||||
|
||||
let (//) = Filename.concat
|
||||
diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli
|
||||
index 72a2d44c..ae6004b2 100644
|
||||
--- a/common/mlstdutils/std_utils.mli
|
||||
+++ b/common/mlstdutils/std_utils.mli
|
||||
@@ -291,6 +291,9 @@ module List : sig
|
||||
|
||||
[push_front_list] is like {!push_front} above, except it prepends
|
||||
a list to the list reference. *)
|
||||
+
|
||||
+ val make : int -> 'a -> 'a list
|
||||
+ (** [make n x] returns a list with [x] repeated [n] times. *)
|
||||
end
|
||||
(** Override the List module from stdlib. *)
|
||||
|
||||
diff --git a/docs/virt-v2v-input-vmware.pod b/docs/virt-v2v-input-vmware.pod
|
||||
index b28268c2..80ca560a 100644
|
||||
--- a/docs/virt-v2v-input-vmware.pod
|
||||
+++ b/docs/virt-v2v-input-vmware.pod
|
||||
@@ -342,10 +342,11 @@ SSL thumbprint:
|
||||
-o local -os /var/tmp
|
||||
|
||||
Other options that you might need to add in rare circumstances include
|
||||
-I<-io vddk-config>, I<-io vddk-cookie>, I<-io vddk-nfchostport>,
|
||||
-I<-io vddk-port>, I<-io vddk-snapshot>, and I<-io vddk-transports>,
|
||||
-which are all explained in the L<nbdkit-vddk-plugin(1)> documentation.
|
||||
-Do not use these options unless you know what you are doing.
|
||||
+I<-io vddk-config>, I<-io vddk-cookie>, I<-io vddk-file>,
|
||||
+I<-io vddk-nfchostport>, I<-io vddk-port>, I<-io vddk-snapshot>, and
|
||||
+I<-io vddk-transports>, which are all explained in the
|
||||
+L<nbdkit-vddk-plugin(1)> documentation. Do not use these options
|
||||
+unless you know what you are doing.
|
||||
|
||||
=head2 VDDK: Debugging VDDK failures
|
||||
|
||||
diff --git a/input/input_vddk.ml b/input/input_vddk.ml
|
||||
index 982dff17..36d5d624 100644
|
||||
--- a/input/input_vddk.ml
|
||||
+++ b/input/input_vddk.ml
|
||||
@@ -50,6 +50,7 @@ All other settings are optional:
|
||||
|
||||
-io vddk-config=FILE VDDK configuration file
|
||||
-io vddk-cookie=COOKIE VDDK cookie
|
||||
+ -io vddk-file=FILE Override nbdkit-vddk-plugin file= parameter
|
||||
-io vddk-libdir=LIBDIR VDDK library parent directory
|
||||
-io vddk-nfchostport=PORT VDDK nfchostport
|
||||
-io vddk-port=PORT VDDK port
|
||||
@@ -69,6 +70,7 @@ information on these settings.
|
||||
let vddk_option_keys =
|
||||
[ "config";
|
||||
"cookie";
|
||||
+ "file";
|
||||
"libdir";
|
||||
"nfchostport";
|
||||
"port";
|
||||
@@ -88,11 +90,6 @@ information on these settings.
|
||||
(key, value)
|
||||
) options.input_options in
|
||||
|
||||
- (* Check no option appears more than once. *)
|
||||
- let keys = List.map fst io_options in
|
||||
- if List.length keys <> List.length (List.sort_uniq compare keys) then
|
||||
- error (f_"-it vddk: duplicate -io options on the command line");
|
||||
-
|
||||
(* thumbprint is mandatory. *)
|
||||
if not (List.mem_assoc "thumbprint" io_options) then
|
||||
error (f_"You must pass the ‘-io vddk-thumbprint’ option with the \
|
||||
@@ -135,6 +132,7 @@ information on these settings.
|
||||
|
||||
(* Parse the libvirt XML. *)
|
||||
let source, disks, xml = parse_libvirt_domain conn guest in
|
||||
+ let nr_disks = List.length disks in
|
||||
|
||||
(* Find the <vmware:moref> element from the XML. This was added
|
||||
* in libvirt >= 3.7 and is required.
|
||||
@@ -183,9 +181,27 @@ information on these settings.
|
||||
let transports =
|
||||
try Some (List.assoc "transports" io_options) with Not_found -> None in
|
||||
|
||||
+ (* If -io vddk-file was given, there must be exactly one per guest
|
||||
+ * disk. Get the list of file overrides.
|
||||
+ *)
|
||||
+ let file_overrides =
|
||||
+ if List.mem_assoc "file" io_options then (
|
||||
+ let fos =
|
||||
+ List.filter_map (function ("file",b) -> Some (Some b) | _ -> None)
|
||||
+ io_options in
|
||||
+ if List.length fos <> nr_disks then
|
||||
+ error (f_"‘-io vddk-file=’ must be used exactly %d times") nr_disks;
|
||||
+ fos
|
||||
+ )
|
||||
+ else (
|
||||
+ (* List of no overrides. *)
|
||||
+ List.make nr_disks None
|
||||
+ ) in
|
||||
+
|
||||
(* Create an nbdkit instance for each disk. *)
|
||||
+ List.combine disks file_overrides |>
|
||||
List.iteri (
|
||||
- fun i { d_format = format; d_type } ->
|
||||
+ fun i ({ d_format = format; d_type }, file_override) ->
|
||||
let socket = sprintf "%s/in%d" dir i in
|
||||
On_exit.unlink socket;
|
||||
|
||||
@@ -193,7 +209,10 @@ information on these settings.
|
||||
| BlockDev _ | NBD _ | HTTP _ -> (* These should never happen? *)
|
||||
assert false
|
||||
|
||||
- | LocalFile file ->
|
||||
+ | LocalFile orig_file ->
|
||||
+ (* If -io vddk-file, override it here. *)
|
||||
+ let file = Option.value file_override ~default:orig_file in
|
||||
+
|
||||
(* The <source file=...> attribute returned by the libvirt
|
||||
* VMX driver looks like "[datastore] path". We can use it
|
||||
* directly as the nbdkit file= parameter, and it is passed
|
||||
@@ -209,7 +228,7 @@ information on these settings.
|
||||
file in
|
||||
let _, pid = Nbdkit.run_unix socket nbdkit in
|
||||
On_exit.kill pid
|
||||
- ) disks;
|
||||
+ );
|
||||
|
||||
source
|
||||
end
|
||||
@ -0,0 +1,25 @@
|
||||
From c941463a3b555dcd24b1b56abf1916ea273de982 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 15 May 2025 16:41:30 +0100
|
||||
Subject: [PATCH] docs: Document -io vddk-file in the main options listing
|
||||
|
||||
Reported-by: Ming Xie
|
||||
Fixes: commit 5328142e6a9faae1db99c646991d27badc6efe91
|
||||
(cherry picked from commit 3a54eabde33fe753ebd864785de8a2fe54c2e1a2)
|
||||
---
|
||||
docs/virt-v2v.pod | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 216e617d..886ae421 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -328,6 +328,8 @@ See L<virt-v2v-input-vmware(1)> for details.
|
||||
|
||||
=item B<-io vddk-cookie=>COOKIE
|
||||
|
||||
+=item B<-io vddk-file=>FILE
|
||||
+
|
||||
=item B<-io vddk-nfchostport=>PORT
|
||||
|
||||
=item B<-io vddk-port=>PORT
|
||||
350
SOURCES/1001-replaced-upstream-references.patch
Normal file
350
SOURCES/1001-replaced-upstream-references.patch
Normal file
@ -0,0 +1,350 @@
|
||||
From 0fbfa66f95181c6e3b784c8ea86e6a9faa3f4ea1 Mon Sep 17 00:00:00 2001
|
||||
From: Darren Archibald <darren.archibald@oracle.com>
|
||||
Date: Wed, 19 Feb 2025 01:33:28 -0800
|
||||
Subject: [PATCH] replaced upstream references
|
||||
|
||||
Signed-off-by: Darren Archibald <darren.archibald@oracle.com>
|
||||
---
|
||||
po/Makefile.am | 2 +-
|
||||
po/cs.po | 3 +--
|
||||
po/de.po | 3 +--
|
||||
po/es.po | 3 +--
|
||||
po/fi.po | 3 +--
|
||||
po/fr.po | 3 +--
|
||||
po/gu.po | 3 +--
|
||||
po/hi.po | 3 +--
|
||||
po/ja.po | 3 +--
|
||||
po/ka.po | 3 +--
|
||||
po/kn.po | 3 +--
|
||||
po/ml.po | 3 +--
|
||||
po/mr.po | 3 +--
|
||||
po/nl.po | 3 +--
|
||||
po/or.po | 3 +--
|
||||
po/pa.po | 3 +--
|
||||
po/pl.po | 3 +--
|
||||
po/si.po | 3 +--
|
||||
po/uk.po | 3 +--
|
||||
po/virt-v2v.pot | 3 +--
|
||||
podwrapper.pl.in | 4 ++--
|
||||
website/index.html.in | 6 +++---
|
||||
22 files changed, 25 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/po/Makefile.am b/po/Makefile.am
|
||||
index f1509d6..db4a502 100644
|
||||
--- a/po/Makefile.am
|
||||
+++ b/po/Makefile.am
|
||||
@@ -19,7 +19,7 @@ include $(top_srcdir)/subdir-rules.mk
|
||||
|
||||
DOMAIN = $(PACKAGE_NAME)
|
||||
COPYRIGHT_HOLDER = Red Hat Inc.
|
||||
-MSGID_BUGS_ADDRESS = https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
|
||||
+MSGID_BUGS_ADDRESS = https://github.com/oracle/oracle-linux
|
||||
|
||||
# Languages.
|
||||
# Don't use LINGUAS (uppercase) as Gentoo defines it (RHBZ#804464).
|
||||
diff --git a/po/cs.po b/po/cs.po
|
||||
index 95b1124..8bbc891 100644
|
||||
--- a/po/cs.po
|
||||
+++ b/po/cs.po
|
||||
@@ -2,8 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2023-04-08 18:20+0000\n"
|
||||
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
|
||||
diff --git a/po/de.po b/po/de.po
|
||||
index e5adfcf..e4cf209 100644
|
||||
--- a/po/de.po
|
||||
+++ b/po/de.po
|
||||
@@ -9,8 +9,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:48+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/es.po b/po/es.po
|
||||
index 97fa9cf..1a41da6 100644
|
||||
--- a/po/es.po
|
||||
+++ b/po/es.po
|
||||
@@ -10,8 +10,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-03-16 07:04+0000\n"
|
||||
"Last-Translator: Alex Puchades <alex94puchades@gmail.com>\n"
|
||||
diff --git a/po/fi.po b/po/fi.po
|
||||
index 04d6e7d..a7f6b9d 100644
|
||||
--- a/po/fi.po
|
||||
+++ b/po/fi.po
|
||||
@@ -6,8 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: virt-v2v 1.43.4\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2022-12-23 18:20+0000\n"
|
||||
"Last-Translator: Jan Kuparinen <copper_fin@hotmail.com>\n"
|
||||
diff --git a/po/fr.po b/po/fr.po
|
||||
index b6571f3..c145c11 100644
|
||||
--- a/po/fr.po
|
||||
+++ b/po/fr.po
|
||||
@@ -10,8 +10,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2023-03-21 09:20+0000\n"
|
||||
"Last-Translator: grimst <grimaitres@gmail.com>\n"
|
||||
diff --git a/po/gu.po b/po/gu.po
|
||||
index 9d34a97..e3eecfe 100644
|
||||
--- a/po/gu.po
|
||||
+++ b/po/gu.po
|
||||
@@ -8,8 +8,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:49+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/hi.po b/po/hi.po
|
||||
index 279dd88..f07556d 100644
|
||||
--- a/po/hi.po
|
||||
+++ b/po/hi.po
|
||||
@@ -8,8 +8,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:49+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/ja.po b/po/ja.po
|
||||
index 6a02097..6274047 100644
|
||||
--- a/po/ja.po
|
||||
+++ b/po/ja.po
|
||||
@@ -9,8 +9,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2017-02-24 07:33+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/ka.po b/po/ka.po
|
||||
index bae787b..4d189c4 100644
|
||||
--- a/po/ka.po
|
||||
+++ b/po/ka.po
|
||||
@@ -6,8 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: virt-v2v 2.1.1\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2023-11-26 21:01+0000\n"
|
||||
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
|
||||
diff --git a/po/kn.po b/po/kn.po
|
||||
index bc830a0..43eab6a 100644
|
||||
--- a/po/kn.po
|
||||
+++ b/po/kn.po
|
||||
@@ -7,8 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:50+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/ml.po b/po/ml.po
|
||||
index e0e3d49..4073d4b 100644
|
||||
--- a/po/ml.po
|
||||
+++ b/po/ml.po
|
||||
@@ -7,8 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:50+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/mr.po b/po/mr.po
|
||||
index 931374e..a729ba2 100644
|
||||
--- a/po/mr.po
|
||||
+++ b/po/mr.po
|
||||
@@ -8,8 +8,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:51+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/nl.po b/po/nl.po
|
||||
index f94cd75..bc85acd 100644
|
||||
--- a/po/nl.po
|
||||
+++ b/po/nl.po
|
||||
@@ -9,8 +9,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:51+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/or.po b/po/or.po
|
||||
index 2fe0840..38c1720 100644
|
||||
--- a/po/or.po
|
||||
+++ b/po/or.po
|
||||
@@ -7,8 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:51+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/pa.po b/po/pa.po
|
||||
index f3237c9..c7082cb 100644
|
||||
--- a/po/pa.po
|
||||
+++ b/po/pa.po
|
||||
@@ -8,8 +8,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2015-02-21 10:52+0000\n"
|
||||
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
|
||||
diff --git a/po/pl.po b/po/pl.po
|
||||
index 4b6f1b8..c90994b 100644
|
||||
--- a/po/pl.po
|
||||
+++ b/po/pl.po
|
||||
@@ -11,8 +11,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2024-01-15 13:36+0000\n"
|
||||
"Last-Translator: Weblate Translation Memory <noreply-mt-weblate-translation-"
|
||||
diff --git a/po/si.po b/po/si.po
|
||||
index b8dceb2..b407c7d 100644
|
||||
--- a/po/si.po
|
||||
+++ b/po/si.po
|
||||
@@ -6,8 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: virt-v2v 1.43.3\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
diff --git a/po/uk.po b/po/uk.po
|
||||
index 1166c04..625adb0 100644
|
||||
--- a/po/uk.po
|
||||
+++ b/po/uk.po
|
||||
@@ -12,8 +12,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libguestfs 1.39.12\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug."
|
||||
-"cgi?component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-08-29 15:25+0100\n"
|
||||
"PO-Revision-Date: 2024-09-04 15:38+0000\n"
|
||||
"Last-Translator: Weblate Translation Memory <noreply-mt-weblate-translation-"
|
||||
diff --git a/po/virt-v2v.pot b/po/virt-v2v.pot
|
||||
index a2f5362..1bf18b6 100644
|
||||
--- a/po/virt-v2v.pot
|
||||
+++ b/po/virt-v2v.pot
|
||||
@@ -7,8 +7,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: virt-v2v 2.7.1\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://github.com/oracle/oracle-linux\n"
|
||||
"POT-Creation-Date: 2024-10-22 17:33+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
diff --git a/podwrapper.pl.in b/podwrapper.pl.in
|
||||
index c99563c..14198cf 100755
|
||||
--- a/podwrapper.pl.in
|
||||
+++ b/podwrapper.pl.in
|
||||
@@ -432,10 +432,10 @@ my $reporting_bugs =
|
||||
"=head1 BUGS
|
||||
|
||||
To get a list of bugs against libguestfs, use this link:
|
||||
-L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>
|
||||
+L<https://github.com/oracle/oracle-linux>
|
||||
|
||||
To report a new bug against libguestfs, use this link:
|
||||
-L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>
|
||||
+L<https://github.com/oracle/oracle-linux>
|
||||
|
||||
When reporting a bug, please supply:
|
||||
|
||||
diff --git a/website/index.html.in b/website/index.html.in
|
||||
index f578523..e1e1592 100644
|
||||
--- a/website/index.html.in
|
||||
+++ b/website/index.html.in
|
||||
@@ -160,12 +160,12 @@ For testers:
|
||||
<h2>Bug reports</h2>
|
||||
|
||||
<p>
|
||||
-<a href="https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools">List of bugs in libguestfs</a> and
|
||||
-<a href="https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Fedora">in Fedora packaging of libguestfs</a>
|
||||
+<a href="https://github.com/oracle/oracle-linux">List of bugs in libguestfs</a> and
|
||||
+<a href="https://github.com/oracle/oracle-linux">in Community packaging of libguestfs</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
-<a href="https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools">Enter a new bug report</a>
|
||||
+<a href="https://github.com/oracle/oracle-linux">Enter a new bug report</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
||||
2
SOURCES/copy-patches.sh
Executable file → Normal file
2
SOURCES/copy-patches.sh
Executable file → Normal file
@ -7,7 +7,7 @@ set -e
|
||||
# ./copy-patches.sh
|
||||
|
||||
project=virt-v2v
|
||||
rhel_version=9.5
|
||||
rhel_version=9.6
|
||||
|
||||
# Check we're in the right directory.
|
||||
if [ ! -f $project.spec ]; then
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmapDYsRHHJpY2hAYW5u
|
||||
ZXhpYS5vcmcACgkQkXOPc+G3aKATow//dAt+/eD4WANTgt82gOK5VLuhlp/il6/L
|
||||
IsErVntOsmAlr1Ukag6lAFmrQrxDHbRo1g9w+P3dabEbedqeAy0vlyE7feifbzfn
|
||||
8dAGAYJBPqyhG5w5Y1YKU/ZfJF5OjxuD9kjn5YTBNmNNva2wqrb4vQqLfmfhpMlx
|
||||
hf3xMlqJ3plXvaqPFk69BzSgA1hKP9Z/f522RQs9lRq+aSP00zatLX9DK5oXynas
|
||||
6DbInkrfUjbMaENoYcuUzC1w45DUcTcq6Or36+h86G78yIkQpfwlS82G0/f4wVnv
|
||||
QlD5pC6dCmowuCrr5/xMoYt5ah7L+qcEUIRJ4uB0xQgQtQV32eLIFjpcHsN973ot
|
||||
ji2ievMtoM5Ncu2Hq1R02Hvx5PUvVZamEpEWf+HzqJl2VATw2F63CMALLjxR6mw4
|
||||
WORi90ZLQWtbt7lJgZEI29WOabuBWGG/cn+01gWLh8swqQpAgkGsbJhCxNXLiUfy
|
||||
0PE7K+zoWVZzSiuOVeIh1Gn2p75gSTRQXfY+l+IfPPfOUBOuNN+w1J5HRUaT7ZAk
|
||||
zBbPGFA2Y6x2zR9TD5n87QftXF6LPhf715qh5URI4Wl0pE+C9gxhQk+nf1aMKJ5J
|
||||
/fOAtU8N+PtZPUm95NTaQxpkraspwHmhLRygWzA7wUGANmVUiX0fE3qgxW9NE2bI
|
||||
paYjGigt040=
|
||||
=FGlR
|
||||
-----END PGP SIGNATURE-----
|
||||
17
SOURCES/virt-v2v-2.7.1.tar.gz.sig
Normal file
17
SOURCES/virt-v2v-2.7.1.tar.gz.sig
Normal file
@ -0,0 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmcX1vARHHJpY2hAYW5u
|
||||
ZXhpYS5vcmcACgkQkXOPc+G3aKAx9xAAgHsZ9z7uoEC70+xxZIS3UVVzfSb/4Vik
|
||||
lMgZr1+lTsFRT7cFwog+7xl/KCAfxSpNyBCfmLH3IKSSiKzVJjw4CwfbIDmRsc+5
|
||||
dJeaFJaOFeaANhqxStYWwXwG9WdmPGghM3tLJZhoeYBieZ80ei2wZrh3H+cK3/hl
|
||||
0mzFonLLmKFAR0AhuiLDmITGRg/SCSEZuopLLvL9n8LKQ+v8LCf0pKjZjinD4IGY
|
||||
J0sSbHF9e4hwaHKpOqerEnMZgkKaKG6JtKf9cj5uTdANIT3e5xfCkYjsPIDzhOpg
|
||||
7irOa2zpQJoVzqiYavSdxKdp/Uvw6+Zkb54rjwAxZSlPTSWHMFQfRSs1aY8o+mkQ
|
||||
YkEo2jiDDzB9PdrJre062kiA/J+aSvHwy5AivJxX/N7pMoida5H9ERfV4h79NHgA
|
||||
Vy/jQ237lO0DE/Fn4O1mchxWKozbFuwajo7a+/XocskrJNpOgBhukl8fQiNfqFHp
|
||||
LP1KshvRlXljw2f0yuTm2gb2NNN2axu+1QzBp37V5MmA4WEbJwuMRILn8ntK0979
|
||||
pQjtVGkYdA1aBOAX1ZJaaz6xEjwk2h9eNlY4Uu+eIUdIVgtUk7pfatOMApETmbUf
|
||||
ilLiPhWZrFCqLNHAe9uG+wEbYcf7Glx1jP5wpHXR7DSVl2ZLydNpFC/YHttIXoF5
|
||||
sJbNDeHwEVU=
|
||||
=FH7a
|
||||
-----END PGP SIGNATURE-----
|
||||
@ -3,12 +3,12 @@
|
||||
%global verify_tarball_signature 1
|
||||
|
||||
# The source directory.
|
||||
%global source_directory 2.5-development
|
||||
%global source_directory 2.7-development
|
||||
|
||||
Name: virt-v2v
|
||||
Epoch: 1
|
||||
Version: 2.5.6
|
||||
Release: 10%{?dist}
|
||||
Version: 2.7.1
|
||||
Release: 8.0.1%{?dist}
|
||||
Summary: Convert a virtual machine to run on KVM
|
||||
|
||||
License: GPL-2.0-or-later AND LGPL-2.0-or-later
|
||||
@ -25,38 +25,52 @@ Source2: libguestfs.keyring
|
||||
Source3: copy-patches.sh
|
||||
|
||||
# Patches are maintained in the following repository:
|
||||
# https://github.com/libguestfs/virt-v2v/commits/rhel-9.5
|
||||
# https://github.com/libguestfs/virt-v2v/commits/rhel-9.6
|
||||
|
||||
# Patches.
|
||||
Patch0001: 0001-docs-Note-that-mac-len-field-is-now-optional.patch
|
||||
Patch0002: 0002-convert-More-robust-qemu-ga-installation-change-path.patch
|
||||
Patch0003: 0003-common-mlcustomize-Inject-qemu-ga-blnsvr-into-firstb.patch
|
||||
Patch0004: 0004-docs-Add-a-note-about-removal-of-VMware-Tools-on-Win.patch
|
||||
Patch0005: 0005-Update-common-submodule.patch
|
||||
Patch0006: 0006-Pull-in-a-fix-to-make-Windows-firstboot-more-reliabl.patch
|
||||
Patch0007: 0007-docs-Restate-position-on-removal-of-VMware-Tools.patch
|
||||
Patch0008: 0008-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch
|
||||
Patch0009: 0009-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch
|
||||
Patch0010: 0010-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch
|
||||
Patch0011: 0011-RHEL-Fixes-for-libguestfs-winsupport.patch
|
||||
Patch0012: 0012-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
|
||||
Patch0013: 0013-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch
|
||||
Patch0014: 0014-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
|
||||
Patch0015: 0015-RHEL-Disable-o-glance.patch
|
||||
Patch0016: 0016-RHEL-Remove-the-in-place-option.patch
|
||||
Patch0017: 0017-RHEL-9-oo-compressed-Remove-nbdcopy-version-check-an.patch
|
||||
Patch0018: 0018-RHEL-9-tests-Remove-btrfs-test.patch
|
||||
Patch0019: 0019-RHEL-9-Remove-block-driver-option.patch
|
||||
Patch0020: 0020-RHEL-Add-warning-about-virt-v2v-in-place-not-being-s.patch
|
||||
Patch0021: 0021-convert-windows-Online-all-virtio-disks-at-first-boo.patch
|
||||
Patch0022: 0022-convert-windows-Ignore-sriov-drivers-on-virtio-win-d.patch
|
||||
Patch0023: 0023-Update-common-submodule.patch
|
||||
Patch0024: 0024-convert-Use-yum-apt-.-for-package-removals-not-rpm-d.patch
|
||||
Patch0025: 0025-test-data-phony-fedora-Add-simple-static-bin-sh.patch
|
||||
Patch0026: 0026-convert-Handle-large-output-from-rpm-ql-command.patch
|
||||
Patch0027: 0027-build-Remove-with-virt-v2v-nbdkit-python-plugin.patch
|
||||
Patch0028: 0028-build-Use-nbdcopy-and-nbdinfo-from-.-configure.patch
|
||||
Patch0029: 0029-v2v-Use-nbdcopy-blkhash-in-verbose-mode.patch
|
||||
Patch0001: 0001-lib-OVF-Add-preliminary-support-for-Windows-Server-2.patch
|
||||
Patch0002: 0002-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch
|
||||
Patch0003: 0003-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch
|
||||
Patch0004: 0004-RHEL-Fix-list-of-supported-sound-cards-to-match-RHEL.patch
|
||||
Patch0005: 0005-RHEL-Fixes-for-libguestfs-winsupport.patch
|
||||
Patch0006: 0006-RHEL-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch
|
||||
Patch0007: 0007-RHEL-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-1430203.patch
|
||||
Patch0008: 0008-RHEL-point-to-KB-for-supported-v2v-hypervisors-guest.patch
|
||||
Patch0009: 0009-RHEL-Disable-o-glance.patch
|
||||
Patch0010: 0010-RHEL-Remove-the-in-place-option.patch
|
||||
Patch0011: 0011-RHEL-9-oo-compressed-Remove-nbdcopy-version-check-an.patch
|
||||
Patch0012: 0012-RHEL-9-tests-Remove-btrfs-test.patch
|
||||
Patch0013: 0013-RHEL-9-Remove-block-driver-option.patch
|
||||
Patch0014: 0014-RHEL-Add-warning-about-virt-v2v-in-place-not-being-s.patch
|
||||
Patch0015: 0015-in-place-Add-a-warning-about-checking-the-exit-code.patch
|
||||
Patch0016: 0016-i-libvirt-Trim-whitespace-around-name.patch
|
||||
Patch0017: 0017-o-qemu-Replace-hard-coded-UEFI-paths.patch
|
||||
Patch0018: 0018-o-qemu-Add-set-e-x-at-the-top-of-the-output-script.patch
|
||||
Patch0019: 0019-v2v-Implement-parallel-N-for-parallel-disk-copies.patch
|
||||
Patch0020: 0020-tests-Rename-all-test-v2v-to-test.patch
|
||||
Patch0021: 0021-tests-Sort-the-tests-into-alphabetical-order.patch
|
||||
Patch0022: 0022-docs-Embolden-whole-O.patch
|
||||
Patch0023: 0023-in-place-Fix-name-of-program-in-the-help-output.patch
|
||||
Patch0024: 0024-inspector-Reorder-O-option-in-alphabetical-order.patch
|
||||
Patch0025: 0025-v2v-Ensure-parallel-1.patch
|
||||
Patch0026: 0026-inspector-Move-the-code-that-creates-XML-output-to-a.patch
|
||||
Patch0027: 0027-build-Define-MLOBJECT-OCaml-object-file-as-either-cm.patch
|
||||
Patch0028: 0028-in-place-Add-new-O-option-to-write-inspector-XML.patch
|
||||
Patch0029: 0029-convert-Mention-operating-system-in-error-message.patch
|
||||
Patch0030: 0030-Update-common-submodule.patch
|
||||
Patch0031: 0031-convert-Use-yum-apt-.-for-package-removals-not-rpm-d.patch
|
||||
Patch0032: 0032-test-data-phony-fedora-Add-simple-static-bin-sh.patch
|
||||
Patch0033: 0033-convert-Handle-large-output-from-rpm-ql-command.patch
|
||||
Patch0034: 0034-build-Remove-with-virt-v2v-nbdkit-python-plugin.patch
|
||||
Patch0035: 0035-build-Use-nbdcopy-and-nbdinfo-from-.-configure.patch
|
||||
Patch0036: 0036-v2v-Use-nbdcopy-blkhash-in-verbose-mode.patch
|
||||
Patch0037: 0037-lib-libvirt_utils.ml-Turn-live-domain-error-into-a-w.patch
|
||||
Patch0038: 0038-input-nbdkit_vddk.ml-Rename-path-parameter-to-file.patch
|
||||
Patch0039: 0039-input-Add-io-vddk-file-.-option.patch
|
||||
Patch0040: 0040-docs-Document-io-vddk-file-in-the-main-options-listi.patch
|
||||
|
||||
# Oracle patch
|
||||
Patch1001: 1001-replaced-upstream-references.patch
|
||||
|
||||
%if !0%{?rhel}
|
||||
# libguestfs hasn't been built on i686 for a while since there is no
|
||||
@ -81,12 +95,12 @@ BuildRequires: /usr/bin/pod2man
|
||||
BuildRequires: gcc
|
||||
BuildRequires: ocaml >= 4.04
|
||||
|
||||
BuildRequires: libguestfs-devel >= 1:1.50.2-2.el9_5
|
||||
BuildRequires: libguestfs-devel >= 1:1.54.0-4.el9
|
||||
BuildRequires: augeas-devel
|
||||
BuildRequires: bash-completion
|
||||
BuildRequires: file-devel
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: jansson-devel
|
||||
BuildRequires: json-c-devel
|
||||
BuildRequires: libnbd-devel
|
||||
BuildRequires: libosinfo-devel
|
||||
BuildRequires: libvirt-daemon-kvm
|
||||
@ -125,7 +139,7 @@ BuildRequires: sqlite
|
||||
BuildRequires: gnupg2
|
||||
%endif
|
||||
|
||||
Requires: libguestfs%{?_isa} >= 1:1.50.2-2.el9_5
|
||||
Requires: libguestfs%{?_isa} >= 1:1.54.0-4.el9
|
||||
Requires: guestfs-tools >= 1.49.7-1
|
||||
|
||||
# XFS is the default filesystem in Fedora and RHEL.
|
||||
@ -311,7 +325,7 @@ done
|
||||
# "windows.vmdk", regardless of the TESTS we want to run. The real
|
||||
# target we need to make here is "fedora-luks-on-lvm.img".
|
||||
make -C test-data/phony-guests windows.img fedora-luks-on-lvm.img
|
||||
make -C tests TESTS=test-v2v-fedora-luks-on-lvm-conversion.sh check
|
||||
make -C tests TESTS=test-fedora-luks-on-lvm-conversion.sh check
|
||||
%endif
|
||||
|
||||
|
||||
@ -337,9 +351,7 @@ make -C tests TESTS=test-v2v-fedora-luks-on-lvm-conversion.sh check
|
||||
%{_mandir}/man1/virt-v2v-output-openstack.1*
|
||||
%{_mandir}/man1/virt-v2v-output-rhv.1*
|
||||
%{_mandir}/man1/virt-v2v-release-notes-1.42.1*
|
||||
%{_mandir}/man1/virt-v2v-release-notes-2.0.1*
|
||||
%{_mandir}/man1/virt-v2v-release-notes-2.2.1*
|
||||
%{_mandir}/man1/virt-v2v-release-notes-2.4.1*
|
||||
%{_mandir}/man1/virt-v2v-release-notes-2.*.1*
|
||||
%{_mandir}/man1/virt-v2v-support.1*
|
||||
%{_datadir}/virt-tools
|
||||
|
||||
@ -360,25 +372,40 @@ make -C tests TESTS=test-v2v-fedora-luks-on-lvm-conversion.sh check
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Apr 02 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.5.6-10
|
||||
* Tue May 27 2025 EL Errata <el-errata_ww@oracle.com> - 2.7.1-8.0.1
|
||||
- Replaced bugzilla.oracle.com references [Orabug: 34202300]
|
||||
- replaced upstream references [Orabug:34089586]
|
||||
|
||||
* Fri May 16 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.1-8
|
||||
- Add -io vddk-file option
|
||||
resolves: RHEL-91098
|
||||
|
||||
* Wed Apr 02 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.1-6
|
||||
- Print blkhash of converted image in virt-v2v debugging output
|
||||
resolves: RHEL-85832
|
||||
resolves: RHEL-85833
|
||||
|
||||
* Thu Feb 27 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.5.6-9
|
||||
- Fix failure if the kernel-source package is installed in the source VM
|
||||
resolves: RHEL-81083
|
||||
|
||||
* Tue Feb 11 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.5.6-8
|
||||
* Tue Feb 25 2025 Richard W.M. Jones <rjones@redhat.com> - 1:2.7.1-5
|
||||
- Rebase to upstream development version 2.7.1
|
||||
resolves: RHEL-56813
|
||||
- Replace Jansson with json-c
|
||||
resolves: RHEL-65296
|
||||
- Find drivers for win2025 guests
|
||||
resolves: RHEL-65010
|
||||
- in-place: Add new -O option to write inspector XML
|
||||
resolves: RHEL-58032
|
||||
- mldrivers/linux_bootloaders.ml: Don't overwrite EFI grub2 wrapper
|
||||
resolves: RHEL-78844
|
||||
resolves: RHEL-77989
|
||||
- convert: Use yum/apt/... for package removals
|
||||
resolves: RHEL-78842
|
||||
resolves: RHEL-71522
|
||||
- Fix failure if the kernel-source package is installed in the source VM
|
||||
resolves: RHEL-80080
|
||||
|
||||
* Thu Sep 12 2024 Richard W.M. Jones <rjones@redhat.com> - 1:2.5.6-7
|
||||
- Bump and rebuild to resolve rhel-9.5.0 branch issue
|
||||
related: RHEL-56383
|
||||
|
||||
* Fri Sep 06 2024 Richard W.M. Jones <rjones@redhat.com> - 1:2.5.6-6
|
||||
* Thu Sep 05 2024 Richard W.M. Jones <rjones@redhat.com> - 1:2.5.9-1
|
||||
- Rebase to upstream development version 2.5.9
|
||||
- Fix display of incorrect Windows 11 version
|
||||
resolves: RHEL-56784
|
||||
- Add customization options for post-conversion modification
|
||||
resolves: RHEL-55761
|
||||
- convert: windows: Ignore sriov drivers on virtio-win disk
|
||||
resolves: RHEL-56383
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user