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

Tomáš Golembiovský tgolembi at redhat.com
Wed Oct 10 17:30:10 UTC 2018


On Thu, 19 Jul 2018 16:24:57 +0200
Pino Toscano <ptoscano at redhat.com> wrote:

> On Thursday, 19 July 2018 15:51:04 CEST Tomáš Golembiovský wrote:
> > Add oVirt specific elemnt to OVF. It represents the combination of
> > machine type (i440fx/q35) and firmware (BIOS/UEFI).  
> 
> Other than adding a new element in the OVF, this also enables the
> conversion of UEFI guests to oVirt.

> It is tested?

At the time of writing I didn't test it as I was not sure how to create
q35 machine in VMware. I can give it another try one of these days.

> Does it require other changes?

AFAIK no

    Tomas

> 
> I'd split the addition of <BiosType> to the OVF in an own patch, and
> the enablement of UEFI for oVirt in a different one.
> 
> > +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 *)  
> 
> This function seems a bit to convoluted -- what about something like
> (untested):
> 
> let get_ovirt_biostype guestcaps = function
>   | TargetBIOS -> 0  (* i440fx + SeaBIOS *)
>   | TargetUEFI ->
>     let caps = find_uefi_firmware guestcaps.gcaps_arch in
>     if List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED caps.flags
>     then 3  (* q35 + UEFI + secure boot *)
>     else 2  (* q35 + UEFI *)
> 
> Thanks,
> -- 
> Pino Toscano


-- 
Tomáš Golembiovský <tgolembi at redhat.com>




More information about the Libguestfs mailing list