On Wed, Jan 08, 2020 at 09:52:11AM +0100, Michal Privoznik wrote:
The point of this function is to translate virDomainOsDefFirmware
enum to qemuFirmwareOSInterface enum. However, with my commit of
d/of /
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(a)redhat.com>
---
src/conf/domain_conf.h | 4 ++--
src/qemu/qemu_firmware.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e6b06a8eba..6a61c9603f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1927,8 +1927,8 @@ 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
Please also add:
G_STATIC_ASSERT(VIR_DOMAIN_OS_DEF_FIRMWARE_LAST == VIR_DOMAIN_LOADER_TYPE_LAST);
to match the verify() assertion we've done for qemuBlockjobState
} virDomainOsDefFirmware;
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index a835fe6b4a..7fb57913e8 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -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:
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano