forked from pool/libvirt
52 lines
1.9 KiB
Diff
52 lines
1.9 KiB
Diff
|
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()
|
||
|
|
||
|
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>
|
||
|
|
||
|
Index: libvirt-5.10.0/src/conf/domain_conf.h
|
||
|
===================================================================
|
||
|
--- libvirt-5.10.0.orig/src/conf/domain_conf.h
|
||
|
+++ libvirt-5.10.0/src/conf/domain_conf.h
|
||
|
@@ -1927,12 +1927,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 {
|
||
|
Index: libvirt-5.10.0/src/qemu/qemu_firmware.c
|
||
|
===================================================================
|
||
|
--- libvirt-5.10.0.orig/src/qemu/qemu_firmware.c
|
||
|
+++ libvirt-5.10.0/src/qemu/qemu_firmware.c
|
||
|
@@ -931,7 +931,7 @@ qemuFirmwareMatchesMachineArch(const qem
|
||
|
|
||
|
|
||
|
static qemuFirmwareOSInterface
|
||
|
-qemuFirmwareOSInterfaceTypeFromOsDefFirmware(virDomainOsDefFirmware fw)
|
||
|
+qemuFirmwareOSInterfaceTypeFromOsDefFirmware(int fw)
|
||
|
{
|
||
|
switch (fw) {
|
||
|
case VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS:
|