mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
community/libvirt to 5.10.0-2
This commit is contained in:
parent
2ff9163bd4
commit
57f601e0e2
5 changed files with 496 additions and 3 deletions
|
@ -0,0 +1,104 @@
|
|||
From 08fca7705b22c438e40f0202c5307ef2bae5b0f4 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Fri, 13 Dec 2019 15:41:16 +0100
|
||||
Subject: [PATCH 1/4] qemu_firmware: Pass virDomainDef into
|
||||
qemuFirmwareFillDomain()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This function needs domain definition really, we don't need to
|
||||
pass the whole domain object. This saves couple of dereferences
|
||||
and characters esp. in more checks to come.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Cole Robinson <crobinso@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_firmware.c | 12 ++++++------
|
||||
src/qemu/qemu_firmware.h | 2 +-
|
||||
src/qemu/qemu_process.c | 2 +-
|
||||
3 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
|
||||
index f62ce90ac9..96058c9b45 100644
|
||||
--- a/src/qemu/qemu_firmware.c
|
||||
+++ b/src/qemu/qemu_firmware.c
|
||||
@@ -1204,7 +1204,7 @@ qemuFirmwareFetchParsedConfigs(bool privileged,
|
||||
|
||||
int
|
||||
qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
- virDomainObjPtr vm,
|
||||
+ virDomainDefPtr def,
|
||||
unsigned int flags)
|
||||
{
|
||||
VIR_AUTOSTRINGLIST paths = NULL;
|
||||
@@ -1217,7 +1217,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
if (!(flags & VIR_QEMU_PROCESS_START_NEW))
|
||||
return 0;
|
||||
|
||||
- if (vm->def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE)
|
||||
+ if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE)
|
||||
return 0;
|
||||
|
||||
if ((nfirmwares = qemuFirmwareFetchParsedConfigs(driver->privileged,
|
||||
@@ -1225,7 +1225,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < nfirmwares; i++) {
|
||||
- if (qemuFirmwareMatchDomain(vm->def, firmwares[i], paths[i])) {
|
||||
+ if (qemuFirmwareMatchDomain(def, firmwares[i], paths[i])) {
|
||||
theone = firmwares[i];
|
||||
VIR_DEBUG("Found matching firmware (description path '%s')",
|
||||
paths[i]);
|
||||
@@ -1236,7 +1236,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
if (!theone) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
_("Unable to find any firmware to satisfy '%s'"),
|
||||
- virDomainOsDefFirmwareTypeToString(vm->def->os.firmware));
|
||||
+ virDomainOsDefFirmwareTypeToString(def->os.firmware));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -1245,10 +1245,10 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
* likely that admin/FW manufacturer messed up. */
|
||||
qemuFirmwareSanityCheck(theone, paths[i]);
|
||||
|
||||
- if (qemuFirmwareEnableFeatures(driver, vm->def, theone) < 0)
|
||||
+ if (qemuFirmwareEnableFeatures(driver, def, theone) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- vm->def->os.firmware = VIR_DOMAIN_OS_DEF_FIRMWARE_NONE;
|
||||
+ def->os.firmware = VIR_DOMAIN_OS_DEF_FIRMWARE_NONE;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h
|
||||
index 4be65bc664..37cbfae39d 100644
|
||||
--- a/src/qemu/qemu_firmware.h
|
||||
+++ b/src/qemu/qemu_firmware.h
|
||||
@@ -45,7 +45,7 @@ qemuFirmwareFetchConfigs(char ***firmwares,
|
||||
|
||||
int
|
||||
qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
- virDomainObjPtr vm,
|
||||
+ virDomainDefPtr def,
|
||||
unsigned int flags);
|
||||
|
||||
int
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index a588ee25f8..ac0c052fc0 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -6289,7 +6289,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
|
||||
VIR_DEBUG("Prepare bios/uefi paths");
|
||||
- if (qemuFirmwareFillDomain(driver, vm, flags) < 0)
|
||||
+ if (qemuFirmwareFillDomain(driver, vm->def, flags) < 0)
|
||||
goto cleanup;
|
||||
if (qemuDomainInitializePflashStorageSource(vm) < 0)
|
||||
goto cleanup;
|
||||
--
|
||||
2.24.1
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
From 9f67ec3b70a5c304c6baf6488a8070e4a9ece837 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Tue, 7 Jan 2020 10:10:02 +0100
|
||||
Subject: [PATCH 2/4] qemu_firmware: Introduce @want variable to
|
||||
qemuFirmwareMatchDomain()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This simplifies condition when matching FW interface by having a
|
||||
single line condition instead of multiline one. Also, it prepares
|
||||
the code for future expansion.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_firmware.c | 25 +++++++++++++++++++++----
|
||||
1 file changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
|
||||
index 96058c9b45..41e05e570b 100644
|
||||
--- a/src/qemu/qemu_firmware.c
|
||||
+++ b/src/qemu/qemu_firmware.c
|
||||
@@ -930,22 +930,39 @@ qemuFirmwareMatchesMachineArch(const qemuFirmware *fw,
|
||||
}
|
||||
|
||||
|
||||
+static qemuFirmwareOSInterface
|
||||
+qemuFirmwareOSInterfaceTypeFromOsDefFirmware(virDomainOsDefFirmware fw)
|
||||
+{
|
||||
+ switch (fw) {
|
||||
+ case VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS:
|
||||
+ return QEMU_FIRMWARE_OS_INTERFACE_BIOS;
|
||||
+ case VIR_DOMAIN_OS_DEF_FIRMWARE_EFI:
|
||||
+ return QEMU_FIRMWARE_OS_INTERFACE_UEFI;
|
||||
+ case VIR_DOMAIN_OS_DEF_FIRMWARE_NONE:
|
||||
+ case VIR_DOMAIN_OS_DEF_FIRMWARE_LAST:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return QEMU_FIRMWARE_OS_INTERFACE_NONE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static bool
|
||||
qemuFirmwareMatchDomain(const virDomainDef *def,
|
||||
const qemuFirmware *fw,
|
||||
const char *path)
|
||||
{
|
||||
size_t i;
|
||||
+ qemuFirmwareOSInterface want;
|
||||
bool supportsS3 = false;
|
||||
bool supportsS4 = false;
|
||||
bool requiresSMM = false;
|
||||
bool supportsSEV = false;
|
||||
|
||||
+ want = qemuFirmwareOSInterfaceTypeFromOsDefFirmware(def->os.firmware);
|
||||
+
|
||||
for (i = 0; i < fw->ninterfaces; i++) {
|
||||
- if ((def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS &&
|
||||
- fw->interfaces[i] == QEMU_FIRMWARE_OS_INTERFACE_BIOS) ||
|
||||
- (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI &&
|
||||
- fw->interfaces[i] == QEMU_FIRMWARE_OS_INTERFACE_UEFI))
|
||||
+ if (fw->interfaces[i] == want)
|
||||
break;
|
||||
}
|
||||
|
||||
--
|
||||
2.24.1
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
From 482e078b654c63590a09958b63b221fa80efcc6e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Tue, 7 Jan 2020 10:34:03 +0100
|
||||
Subject: [PATCH 3/4] src: Introduce and use virDomainDefHasOldStyleUEFI() and
|
||||
virDomainDefHasOldStyleROUEFI()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
These functions are meant to replace verbose check for the old
|
||||
style of specifying UEFI with a simple function call.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
---
|
||||
src/bhyve/bhyve_driver.c | 3 +--
|
||||
src/conf/domain_conf.c | 16 ++++++++++++++++
|
||||
src/conf/domain_conf.h | 6 ++++++
|
||||
src/libvirt_private.syms | 2 ++
|
||||
src/libxl/libxl_conf.c | 3 +--
|
||||
src/libxl/xen_xl.c | 8 +++-----
|
||||
src/qemu/qemu_domain.c | 14 ++++----------
|
||||
src/qemu/qemu_driver.c | 3 +--
|
||||
8 files changed, 34 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
|
||||
index d40ae1cd23..6edcc37326 100644
|
||||
--- a/src/bhyve/bhyve_driver.c
|
||||
+++ b/src/bhyve/bhyve_driver.c
|
||||
@@ -714,8 +714,7 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
|
||||
if (def->os.bootloader == NULL &&
|
||||
def->os.loader) {
|
||||
|
||||
- if ((def->os.loader->readonly != VIR_TRISTATE_BOOL_YES) ||
|
||||
- (def->os.loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH)) {
|
||||
+ if (!virDomainDefHasOldStyleROUEFI(def)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Only read-only pflash is supported."));
|
||||
goto cleanup;
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index 9580884747..54234049f7 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -31400,6 +31400,22 @@ virDomainDefHasMdevHostdev(const virDomainDef *def)
|
||||
}
|
||||
|
||||
|
||||
+bool
|
||||
+virDomainDefHasOldStyleUEFI(const virDomainDef *def)
|
||||
+{
|
||||
+ return def->os.loader &&
|
||||
+ def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool
|
||||
+virDomainDefHasOldStyleROUEFI(const virDomainDef *def)
|
||||
+{
|
||||
+ return virDomainDefHasOldStyleUEFI(def) &&
|
||||
+ def->os.loader->readonly == VIR_TRISTATE_BOOL_YES;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/**
|
||||
* virDomainGraphicsDefHasOpenGL:
|
||||
* @def: domain definition
|
||||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
||||
index 49cb6970e6..1332bdecc2 100644
|
||||
--- a/src/conf/domain_conf.h
|
||||
+++ b/src/conf/domain_conf.h
|
||||
@@ -3680,6 +3680,12 @@ virDomainDefHasVFIOHostdev(const virDomainDef *def);
|
||||
bool
|
||||
virDomainDefHasMdevHostdev(const virDomainDef *def);
|
||||
|
||||
+bool
|
||||
+virDomainDefHasOldStyleUEFI(const virDomainDef *def);
|
||||
+
|
||||
+bool
|
||||
+virDomainDefHasOldStyleROUEFI(const virDomainDef *def);
|
||||
+
|
||||
bool
|
||||
virDomainGraphicsDefHasOpenGL(const virDomainDef *def);
|
||||
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
||||
index 8fe0bf9365..5cfc8af46d 100644
|
||||
--- a/src/libvirt_private.syms
|
||||
+++ b/src/libvirt_private.syms
|
||||
@@ -297,6 +297,8 @@ virDomainDefHasManagedPR;
|
||||
virDomainDefHasMdevHostdev;
|
||||
virDomainDefHasMemballoon;
|
||||
virDomainDefHasMemoryHotplug;
|
||||
+virDomainDefHasOldStyleROUEFI;
|
||||
+virDomainDefHasOldStyleUEFI;
|
||||
virDomainDefHasUSB;
|
||||
virDomainDefHasVcpusOffline;
|
||||
virDomainDefHasVFIOHostdev;
|
||||
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
|
||||
index 37fe360067..d712515b05 100644
|
||||
--- a/src/libxl/libxl_conf.c
|
||||
+++ b/src/libxl/libxl_conf.c
|
||||
@@ -546,8 +546,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
|
||||
* future, Xen will support a user-specified firmware path. See
|
||||
* http://lists.xenproject.org/archives/html/xen-devel/2016-03/msg01628.html
|
||||
*/
|
||||
- if (def->os.loader &&
|
||||
- def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH)
|
||||
+ if (virDomainDefHasOldStyleUEFI(def))
|
||||
b_info->u.hvm.bios = LIBXL_BIOS_TYPE_OVMF;
|
||||
|
||||
if (def->emulator) {
|
||||
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
|
||||
index 396adf6dac..f0269b01ff 100644
|
||||
--- a/src/libxl/xen_xl.c
|
||||
+++ b/src/libxl/xen_xl.c
|
||||
@@ -1235,11 +1235,9 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def)
|
||||
if (xenConfigSetString(conf, "builder", "hvm") < 0)
|
||||
return -1;
|
||||
|
||||
- if (def->os.loader &&
|
||||
- def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH) {
|
||||
- if (xenConfigSetString(conf, "bios", "ovmf") < 0)
|
||||
- return -1;
|
||||
- }
|
||||
+ if (virDomainDefHasOldStyleUEFI(def) &&
|
||||
+ xenConfigSetString(conf, "bios", "ovmf") < 0)
|
||||
+ return -1;
|
||||
|
||||
if (def->os.slic_table &&
|
||||
xenConfigSetString(conf, "acpi_firmware", def->os.slic_table) < 0)
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index d1596a28ca..626ed5f326 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -4968,8 +4968,7 @@ qemuDomainDefValidate(const virDomainDef *def,
|
||||
|
||||
/* On x86, UEFI requires ACPI */
|
||||
if ((def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI ||
|
||||
- (def->os.loader &&
|
||||
- def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH)) &&
|
||||
+ virDomainDefHasOldStyleUEFI(def)) &&
|
||||
ARCH_IS_X86(def->os.arch) &&
|
||||
def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
@@ -4981,8 +4980,7 @@ qemuDomainDefValidate(const virDomainDef *def,
|
||||
if (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON &&
|
||||
def->os.arch == VIR_ARCH_AARCH64 &&
|
||||
(def->os.firmware != VIR_DOMAIN_OS_DEF_FIRMWARE_EFI &&
|
||||
- (!def->os.loader ||
|
||||
- def->os.loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH))) {
|
||||
+ !virDomainDefHasOldStyleUEFI(def))) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("ACPI requires UEFI on this architecture"));
|
||||
goto cleanup;
|
||||
@@ -15545,12 +15543,9 @@ void
|
||||
qemuDomainNVRAMPathGenerate(virQEMUDriverConfigPtr cfg,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
- if (def->os.loader &&
|
||||
- def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
|
||||
- def->os.loader->readonly == VIR_TRISTATE_BOOL_YES &&
|
||||
+ if (virDomainDefHasOldStyleROUEFI(def) &&
|
||||
!def->os.loader->nvram)
|
||||
qemuDomainNVRAMPathFormat(cfg, def, &def->os.loader->nvram);
|
||||
-
|
||||
}
|
||||
|
||||
|
||||
@@ -15677,8 +15672,7 @@ qemuDomainInitializePflashStorageSource(virDomainObjPtr vm)
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
|
||||
return 0;
|
||||
|
||||
- if (!def->os.loader ||
|
||||
- def->os.loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH)
|
||||
+ if (!virDomainDefHasOldStyleUEFI(def))
|
||||
return 0;
|
||||
|
||||
if (!(pflash0 = virStorageSourceNew()))
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index 06d16ee8e6..becb83f32b 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -15129,8 +15129,7 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm,
|
||||
* Avoid the issues by forbidding internal snapshot with pflash completely.
|
||||
*/
|
||||
if (found_internal &&
|
||||
- vm->def->os.loader &&
|
||||
- vm->def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH) {
|
||||
+ virDomainDefHasOldStyleUEFI(vm->def)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("internal snapshots of a VM with pflash based "
|
||||
"firmware are not supported"));
|
||||
--
|
||||
2.24.1
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
From 2547834c188536817662809880fa889c789e9e0e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Tue, 17 Dec 2019 17:45:50 +0100
|
||||
Subject: [PATCH 4/4] qemu_firmware: Try to autofill for old style UEFI
|
||||
specification
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
While we discourage people to use the old style of specifying
|
||||
UEFI for their domains (the old style is putting path to the FW
|
||||
image under /domain/os/loader/ whilst the new one is using
|
||||
/domain/os/@firmware), some applications might have not adapted
|
||||
yet. They still rely on libvirt autofilling NVRAM path and
|
||||
figuring out NVRAM template when using the old way (notably
|
||||
virt-install does this). We must preserve backcompat for this
|
||||
previously supported config approach. However, since we really
|
||||
want distro maintainers to leave --with-loader-nvram configure
|
||||
option and rely on JSON descriptors, we need to implement
|
||||
autofilling of NVRAM template for the old way too.
|
||||
|
||||
Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1782778
|
||||
RHEL: https://bugzilla.redhat.com/show_bug.cgi?id=1776949
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_firmware.c | 47 +++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 42 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
|
||||
index 41e05e570b..f045e7d69c 100644
|
||||
--- a/src/qemu/qemu_firmware.c
|
||||
+++ b/src/qemu/qemu_firmware.c
|
||||
@@ -961,6 +961,21 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
|
||||
|
||||
want = qemuFirmwareOSInterfaceTypeFromOsDefFirmware(def->os.firmware);
|
||||
|
||||
+ if (want == QEMU_FIRMWARE_OS_INTERFACE_NONE &&
|
||||
+ def->os.loader) {
|
||||
+ want = qemuFirmwareOSInterfaceTypeFromOsDefFirmware(def->os.loader->type);
|
||||
+
|
||||
+ if (fw->mapping.device != QEMU_FIRMWARE_DEVICE_FLASH ||
|
||||
+ STRNEQ(def->os.loader->path, fw->mapping.data.flash.executable.filename)) {
|
||||
+ VIR_DEBUG("Not matching FW interface %s or loader "
|
||||
+ "path '%s' for user provided path '%s'",
|
||||
+ qemuFirmwareDeviceTypeToString(fw->mapping.device),
|
||||
+ fw->mapping.data.flash.executable.filename,
|
||||
+ def->os.loader->path);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < fw->ninterfaces; i++) {
|
||||
if (fw->interfaces[i] == want)
|
||||
break;
|
||||
@@ -1228,14 +1243,29 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
qemuFirmwarePtr *firmwares = NULL;
|
||||
ssize_t nfirmwares = 0;
|
||||
const qemuFirmware *theone = NULL;
|
||||
+ bool needResult = true;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
|
||||
if (!(flags & VIR_QEMU_PROCESS_START_NEW))
|
||||
return 0;
|
||||
|
||||
- if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE)
|
||||
- return 0;
|
||||
+ /* Fill in FW paths if either os.firmware is enabled, or
|
||||
+ * loader path was provided with no nvram varstore. */
|
||||
+ if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE) {
|
||||
+ /* This is horrific check, but loosely said, if UEFI
|
||||
+ * image was provided by the old method (by specifying
|
||||
+ * its path in domain XML) but no template for NVRAM was
|
||||
+ * specified and the varstore doesn't exist ... */
|
||||
+ if (!virDomainDefHasOldStyleROUEFI(def) ||
|
||||
+ def->os.loader->templt ||
|
||||
+ virFileExists(def->os.loader->nvram))
|
||||
+ return 0;
|
||||
+
|
||||
+ /* ... then we want to consult JSON FW descriptors first,
|
||||
+ * but we don't want to fail if we haven't found a match. */
|
||||
+ needResult = false;
|
||||
+ }
|
||||
|
||||
if ((nfirmwares = qemuFirmwareFetchParsedConfigs(driver->privileged,
|
||||
&firmwares, &paths)) < 0)
|
||||
@@ -1251,9 +1281,16 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (!theone) {
|
||||
- virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
- _("Unable to find any firmware to satisfy '%s'"),
|
||||
- virDomainOsDefFirmwareTypeToString(def->os.firmware));
|
||||
+ if (needResult) {
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
+ _("Unable to find any firmware to satisfy '%s'"),
|
||||
+ virDomainOsDefFirmwareTypeToString(def->os.firmware));
|
||||
+ } else {
|
||||
+ VIR_DEBUG("Unable to find NVRAM template for '%s', "
|
||||
+ "falling back to old style",
|
||||
+ NULLSTR(def->os.loader ? def->os.loader->path : NULL));
|
||||
+ ret = 0;
|
||||
+ }
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
--
|
||||
2.24.1
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
pkgname=libvirt
|
||||
pkgver=5.10.0
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
|
||||
arch=('x86_64')
|
||||
url="https://libvirt.org/"
|
||||
|
@ -66,12 +66,20 @@ validpgpkeys=('C74415BA7C9C7F78F02E1DC34606B8A5DE95BC1F')
|
|||
source=("https://libvirt.org/sources/${pkgname}-${pkgver}.tar.xz"{,.asc}
|
||||
'libvirtd.conf.d'
|
||||
'libvirtd-guests.conf.d'
|
||||
'libvirt.sysusers.d')
|
||||
'libvirt.sysusers.d'
|
||||
'0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch'
|
||||
'0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch'
|
||||
'0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch'
|
||||
'0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch')
|
||||
sha512sums=('bb518a6aa6731a7de4b24fc7b8ffdcd2cdd84dfe49047374e0f02265c274eb06dbe1732c9cc4954412853d36d9dd5c1124fb8a5e37f4c01654d85013773ffa23'
|
||||
'SKIP'
|
||||
'fc0e16e045a2c84d168d42c97d9e14ca32ba0d86025135967f4367cf3fa663882eefb6923ebf04676ae763f4f459e5156d7221b36b47c835f9e531c6b6e0cd9d'
|
||||
'ef221bae994ad0a15ab5186b7469132896156d82bfdc3ef3456447d5cf1af347401ef33e8665d5b2f76451f5457aee7ea01064d7b9223d6691c90c4456763258'
|
||||
'7d1d535aaf739a6753f6819c49272c8d9b5f488e0a8553797499334a76b8631474e222b6048f2125b858e5ecc21e602face45dd02121f833d605b9ae58322982')
|
||||
'7d1d535aaf739a6753f6819c49272c8d9b5f488e0a8553797499334a76b8631474e222b6048f2125b858e5ecc21e602face45dd02121f833d605b9ae58322982'
|
||||
'58569ece7fd6ce69c4261523a985778f29e33e78c814ffb8ed674f34a32dc92aaaeb6d785ab507015f15a7480434bcfbf93b728b51539831d5fa8b4915f45a11'
|
||||
'4162a7a38d94cb98a2c9a318fb7d7b9b8dc37a07762e8f6c8e2962c9961230f901fe354c80ea83dfe6d0d8cdda5f706a7cf20fcbcaf916f854755ea9a00e435b'
|
||||
'64334505c906a256852d7d56715ce259e2881e147b290ca321d73043dd683d594b291245de36f97259b87c247852858e04e89315f929234236bb8abc39c284f2'
|
||||
'8908557893efe6f53d15907be059a410f99e4f6ffd5211979978f30ab21faaeabaf80ff98e45eef2802540dd688c862b3bea22555b968651368c629c53da39fa')
|
||||
changelog=Changelog
|
||||
|
||||
prepare() {
|
||||
|
@ -86,6 +94,12 @@ prepare() {
|
|||
# patch -Np1 < "../$src"
|
||||
#done
|
||||
|
||||
# FS#64175
|
||||
patch -p1 < ../0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch
|
||||
patch -p1 < ../0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch
|
||||
patch -p1 < ../0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch
|
||||
patch -p1 < ../0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch
|
||||
|
||||
autoreconf -vi
|
||||
|
||||
sed -i 's|/sysconfig/|/conf.d/|g' \
|
||||
|
|
Loading…
Reference in a new issue