[Libguestfs] [PATCH] v2v: ovf: add firmware and machine type element

Richard W.M. Jones rjones at redhat.com
Thu Jul 19 14:53:45 UTC 2018


On Thu, Jul 19, 2018 at 03:51:04PM +0200, Tomáš Golembiovský wrote:
> +let get_ovirt_biostype guestcaps target_firmware  =
> +  let uefi_firmware =
> +    match target_firmware with
> +    | TargetBIOS -> None
> +    | TargetUEFI -> Some (find_uefi_firmware guestcaps.gcaps_arch) in
> +  let secure_boot_required =
> +    match uefi_firmware with
> +    | Some { Uefi.flags = flags }
> +         when List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED flags -> true
> +    | _ -> false in
> +  match target_firmware, secure_boot_required with
> +  | TargetUEFI, true -> 3 (* q35 + UEFI + secure boot *)
> +  | TargetUEFI, _ -> 2 (* q35 + UEFI *)
> +  (* 1 is q35 + SeaBIOS *)
> +  | _, _ -> 0 (* i440fx + SeaBIOS *)

I think it would be better as well as simpler if this change depended
on this (not upstream) patch:

  https://www.redhat.com/archives/libguestfs/2018-June/thread.html#00085

Unfortunately that patch can't go upstream yet for a couple of reasons:

(1) It breaks a test.

(2) We've decided to get the data from osinfo instead of pivoting on a
particular year, so the patch needs to be reworked for that.

Maybe we can split that patch into the Types module change and the
other stuff.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the Libguestfs mailing list