SHA256
1
0
forked from pool/libvirt
libvirt/8fcee478-qemu-firmware5.patch
James Fehlig 94f306e5d5 Accepting request 762258 from home:jfehlig:branches:Virtualization
- qemu: Fix firmware auto detection
  50d7465f-qemu-firmware1.patc, 57f9067c-qemu-firmware2.patch,
  7c5264d2-qemu-firmware3.patch, 8e1804f9-qemu-firmware4.patch,
  8fcee478-qemu-firmware5.patch
  boo#1157378, bsc#1159796

OBS-URL: https://build.opensuse.org/request/show/762258
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=793
2020-01-09 15:42:24 +00:00

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: