diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml index 072b94f43..33f69dcfa 100644 --- a/v2v/output_libvirt.ml +++ b/v2v/output_libvirt.ml @@ -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 -> () diff --git a/v2v/output_local.ml b/v2v/output_local.ml index 9ba1d6f63..9c105ef8d 100644 --- a/v2v/output_local.ml +++ b/v2v/output_local.ml @@ -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. diff --git a/v2v/output_qemu.ml b/v2v/output_qemu.ml index 3e28ad0dc..84efd4529 100644 --- a/v2v/output_qemu.ml +++ b/v2v/output_qemu.ml @@ -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 -> ()