mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
v2v: -o local: Check that UEFI firmware is installed before conversion (RHBZ#1429506).
Avoids a lengthy conversion followed by failure if we discover at the end that OVMF is not installed. This also changes the order of the methods in -o libvirt and -o qemu so that it matches the order in the class interface, and also logically makes more sense. Thanks: Christopher Brown
This commit is contained in:
@@ -76,8 +76,6 @@ class output_libvirt oc output_pool = object
|
||||
| None -> sprintf "-o libvirt -os %s" output_pool
|
||||
| Some uri -> sprintf "-o libvirt -oc %s -os %s" uri output_pool
|
||||
|
||||
method supported_firmware = [ TargetBIOS; TargetUEFI ]
|
||||
|
||||
method prepare_targets source targets =
|
||||
(* Get the capabilities from libvirt. *)
|
||||
let xml = Libvirt_utils.capabilities ?conn:oc () in
|
||||
@@ -140,6 +138,8 @@ class output_libvirt oc output_pool = object
|
||||
{ t with target_file = target_file }
|
||||
) targets
|
||||
|
||||
method supported_firmware = [ TargetBIOS; TargetUEFI ]
|
||||
|
||||
method check_target_firmware guestcaps target_firmware =
|
||||
match target_firmware with
|
||||
| TargetBIOS -> ()
|
||||
|
||||
@@ -30,8 +30,6 @@ class output_local dir = object
|
||||
|
||||
method as_options = sprintf "-o local -os %s" dir
|
||||
|
||||
method supported_firmware = [ TargetBIOS; TargetUEFI ]
|
||||
|
||||
method prepare_targets source targets =
|
||||
List.map (
|
||||
fun t ->
|
||||
@@ -39,6 +37,17 @@ class output_local dir = object
|
||||
{ t with target_file = target_file }
|
||||
) targets
|
||||
|
||||
method supported_firmware = [ TargetBIOS; TargetUEFI ]
|
||||
|
||||
method check_target_firmware guestcaps target_firmware =
|
||||
match target_firmware with
|
||||
| TargetBIOS -> ()
|
||||
| TargetUEFI ->
|
||||
(* This will fail with an error if the target firmware is
|
||||
* not installed on the host.
|
||||
*)
|
||||
ignore (find_uefi_firmware guestcaps.gcaps_arch)
|
||||
|
||||
method create_metadata source _ target_buses guestcaps _ target_firmware =
|
||||
(* We don't know what target features the hypervisor supports, but
|
||||
* assume a common set that libvirt supports.
|
||||
|
||||
@@ -31,8 +31,6 @@ object
|
||||
method as_options =
|
||||
sprintf "-o qemu -os %s%s" dir (if qemu_boot then " --qemu-boot" else "")
|
||||
|
||||
method supported_firmware = [ TargetBIOS; TargetUEFI ]
|
||||
|
||||
method prepare_targets source targets =
|
||||
List.map (
|
||||
fun t ->
|
||||
@@ -40,6 +38,8 @@ object
|
||||
{ t with target_file = target_file }
|
||||
) targets
|
||||
|
||||
method supported_firmware = [ TargetBIOS; TargetUEFI ]
|
||||
|
||||
method check_target_firmware guestcaps target_firmware =
|
||||
match target_firmware with
|
||||
| TargetBIOS -> ()
|
||||
|
||||
Reference in New Issue
Block a user