]> xenbits.xensource.com Git - libvirt.git/commit
qemu: split handling of distinct firmware enum conversions
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 10 Jan 2022 18:03:42 +0000 (13:03 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 14 Jan 2022 18:56:39 +0000 (18:56 +0000)
commitc723a98618f6fbe689c154f5378957081a5282d3
treed68d6f11f2bc3220a52b96bd63a01d90e65b895a
parent4bb150ed3a0814cb6f9ce3388658dfa893245eb4
qemu: split handling of distinct firmware enum conversions

The qemuFirmwareOSInterfaceTypeFromOsDefFirmware method
was added to convert from virDomainOsDefFirmware to the
qemuFirmwareOSInterface enum.

It was later also used to convert from virDomainLoader
to qemuFirmwareOSInterface in:

  commit 8e1804f9f66f13ca1412d22bf1a957b6d55a2365
  Author: Michal Prívozník <mprivozn@redhat.com>
  Date:   Tue Dec 17 17:45:50 2019 +0100

    qemu_firmware: Try to autofill for old style UEFI specification

This caused compile errors with clang due to passing a
mis-matched enum type. These were later silenced by
stripping the enum types:

  commit 8fcee47807d29008632a7ad918cbe93ac0a20597
  Author: Michal Prívozník <mprivozn@redhat.com>
  Date:   Wed Jan 8 09:42:47 2020 +0100

    qemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()

This is still rather confusing to humans reading the
code. It is clearer to just define a separate helper
method for the virDomainLoader type conversion.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.h
src/qemu/qemu_firmware.c