diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml index 61e1efddb..b5df8245f 100644 --- a/v2v/output_libvirt.ml +++ b/v2v/output_libvirt.ml @@ -145,13 +145,11 @@ class output_libvirt oc output_pool = object match target_firmware with | TargetBIOS -> () | TargetUEFI -> - (* This will fail with an error if the target firmware is - * not installed on the host. - * XXX Can remove this method when libvirt supports + (* XXX Can remove this method when libvirt supports * since then it will be up to * libvirt to check this. *) - ignore (find_uefi_firmware guestcaps.gcaps_arch) + error_unless_uefi_firmware guestcaps.gcaps_arch method create_metadata source _ target_buses guestcaps _ target_firmware = (* We copied directly into the final pool directory. However we diff --git a/v2v/output_local.ml b/v2v/output_local.ml index 3553150ff..de432fb88 100644 --- a/v2v/output_local.ml +++ b/v2v/output_local.ml @@ -44,10 +44,11 @@ class output_local dir = object match target_firmware with | TargetBIOS -> () | TargetUEFI -> - (* This will fail with an error if the target firmware is - * not installed on the host. + (* XXX Can remove this method when libvirt supports + * since then it will be up to + * libvirt to check this. *) - ignore (find_uefi_firmware guestcaps.gcaps_arch) + error_unless_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 diff --git a/v2v/output_qemu.ml b/v2v/output_qemu.ml index 00814e8f0..9e0c67a0b 100644 --- a/v2v/output_qemu.ml +++ b/v2v/output_qemu.ml @@ -44,11 +44,7 @@ object 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) + | TargetUEFI -> error_unless_uefi_firmware guestcaps.gcaps_arch method create_metadata source _ target_buses guestcaps inspect target_firmware = diff --git a/v2v/utils.ml b/v2v/utils.ml index d060cd7ed..008452d69 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -79,6 +79,9 @@ let find_uefi_firmware guest_arch = in loop files +let error_unless_uefi_firmware guest_arch = + ignore (find_uefi_firmware guest_arch) + 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/v2v/utils.mli b/v2v/utils.mli index eb69c9ef1..8d902a53a 100644 --- a/v2v/utils.mli +++ b/v2v/utils.mli @@ -32,6 +32,9 @@ 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 error_unless_uefi_firmware : string -> unit +(** Check UEFI firmware is installed on the local host and error out if not. *) + val compare_app2_versions : Guestfs.application2 -> Guestfs.application2 -> int (** Compare two app versions. *)