1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

qemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()

The point of this function is to translate virDomainOsDefFirmware
enum to qemuFirmwareOSInterface enum. However, with my commit
v5.10.0-507-g8e1804f9f6 we are passing a variable type of
virDomainLoader enum. Make the function accept both enums and
make the enum members correspond to each other.

This fixes clang build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2020-01-08 09:42:47 +01:00
parent 54ba7da585
commit 8fcee47807
2 changed files with 5 additions and 3 deletions

View File

@ -1928,12 +1928,14 @@ struct _virDomainOSEnv {
typedef enum {
VIR_DOMAIN_OS_DEF_FIRMWARE_NONE = 0,
VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS,
VIR_DOMAIN_OS_DEF_FIRMWARE_EFI,
VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS = VIR_DOMAIN_LOADER_TYPE_ROM,
VIR_DOMAIN_OS_DEF_FIRMWARE_EFI = VIR_DOMAIN_LOADER_TYPE_PFLASH,
VIR_DOMAIN_OS_DEF_FIRMWARE_LAST
} virDomainOsDefFirmware;
G_STATIC_ASSERT((int)VIR_DOMAIN_OS_DEF_FIRMWARE_LAST == (int)VIR_DOMAIN_LOADER_TYPE_LAST);
VIR_ENUM_DECL(virDomainOsDefFirmware);
struct _virDomainOSDef {

View File

@ -929,7 +929,7 @@ qemuFirmwareMatchesMachineArch(const qemuFirmware *fw,
static qemuFirmwareOSInterface
qemuFirmwareOSInterfaceTypeFromOsDefFirmware(virDomainOsDefFirmware fw)
qemuFirmwareOSInterfaceTypeFromOsDefFirmware(int fw)
{
switch (fw) {
case VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS: