[arch-commits] Commit in libvirt/repos (10 files)

Robin Broda coderobe at archlinux.org
Wed May 6 11:47:33 UTC 2020


    Date: Wednesday, May 6, 2020 @ 11:47:33
  Author: coderobe
Revision: 625036

archrelease: copy trunk to community-testing-x86_64

Added:
  libvirt/repos/community-testing-x86_64/
  libvirt/repos/community-testing-x86_64/0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch
    (from rev 625035, libvirt/trunk/0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch)
  libvirt/repos/community-testing-x86_64/0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch
    (from rev 625035, libvirt/trunk/0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch)
  libvirt/repos/community-testing-x86_64/0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch
    (from rev 625035, libvirt/trunk/0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch)
  libvirt/repos/community-testing-x86_64/0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch
    (from rev 625035, libvirt/trunk/0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch)
  libvirt/repos/community-testing-x86_64/Changelog
    (from rev 625035, libvirt/trunk/Changelog)
  libvirt/repos/community-testing-x86_64/PKGBUILD
    (from rev 625035, libvirt/trunk/PKGBUILD)
  libvirt/repos/community-testing-x86_64/libvirt.sysusers.d
    (from rev 625035, libvirt/trunk/libvirt.sysusers.d)
  libvirt/repos/community-testing-x86_64/libvirtd-guests.conf.d
    (from rev 625035, libvirt/trunk/libvirtd-guests.conf.d)
  libvirt/repos/community-testing-x86_64/libvirtd.conf.d
    (from rev 625035, libvirt/trunk/libvirtd.conf.d)

-----------------------------------------------------------------+
 0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch |  104 +++++
 0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch |   70 +++
 0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch |  194 ++++++++++
 0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch |  111 +++++
 Changelog                                                       |    1 
 PKGBUILD                                                        |  178 +++++++++
 libvirt.sysusers.d                                              |    1 
 libvirtd-guests.conf.d                                          |    9 
 libvirtd.conf.d                                                 |    1 
 9 files changed, 669 insertions(+)

Copied: libvirt/repos/community-testing-x86_64/0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch (from rev 625035, libvirt/trunk/0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch)
===================================================================
--- community-testing-x86_64/0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch	                        (rev 0)
+++ community-testing-x86_64/0001-qemu_firmware-Pass-virDomainDef-into-qemuFirmwareFil.patch	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1,104 @@
+From 08fca7705b22c438e40f0202c5307ef2bae5b0f4 Mon Sep 17 00:00:00 2001
+From: Michal Privoznik <mprivozn at 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 at redhat.com>
+Reviewed-by: Cole Robinson <crobinso at redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange at 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
+

Copied: libvirt/repos/community-testing-x86_64/0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch (from rev 625035, libvirt/trunk/0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch)
===================================================================
--- community-testing-x86_64/0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch	                        (rev 0)
+++ community-testing-x86_64/0002-qemu_firmware-Introduce-want-variable-to-qemuFirmwar.patch	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1,70 @@
+From 9f67ec3b70a5c304c6baf6488a8070e4a9ece837 Mon Sep 17 00:00:00 2001
+From: Michal Privoznik <mprivozn at 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 at redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange at 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
+

Copied: libvirt/repos/community-testing-x86_64/0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch (from rev 625035, libvirt/trunk/0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch)
===================================================================
--- community-testing-x86_64/0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch	                        (rev 0)
+++ community-testing-x86_64/0003-src-Introduce-and-use-virDomainDefHasOldStyleUEFI-an.patch	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1,194 @@
+From 482e078b654c63590a09958b63b221fa80efcc6e Mon Sep 17 00:00:00 2001
+From: Michal Privoznik <mprivozn at 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 at redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange at 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
+

Copied: libvirt/repos/community-testing-x86_64/0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch (from rev 625035, libvirt/trunk/0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch)
===================================================================
--- community-testing-x86_64/0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch	                        (rev 0)
+++ community-testing-x86_64/0004-qemu_firmware-Try-to-autofill-for-old-style-UEFI-spe.patch	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1,111 @@
+From 2547834c188536817662809880fa889c789e9e0e Mon Sep 17 00:00:00 2001
+From: Michal Privoznik <mprivozn at 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 at redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange at 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
+

Copied: libvirt/repos/community-testing-x86_64/Changelog (from rev 625035, libvirt/trunk/Changelog)
===================================================================
--- community-testing-x86_64/Changelog	                        (rev 0)
+++ community-testing-x86_64/Changelog	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1 @@
+https://libvirt.org/news.html

Copied: libvirt/repos/community-testing-x86_64/PKGBUILD (from rev 625035, libvirt/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1,178 @@
+# Maintainer: Christian Rebischke <chris.rebischke at archlinux.org>
+# Maintainer: Robin Broda <robin at broda.me>
+# Contributor: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Contributor: Jonathan Wiersma <archaur at jonw dot org>
+
+pkgname=(libvirt libvirt-storage-gluster libvirt-storage-iscsi-direct libvirt-storage-rbd)
+pkgver=6.3.0
+pkgrel=1
+pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
+arch=('x86_64')
+url="https://libvirt.org/"
+license=('LGPL')
+depends=('libpciaccess' 'yajl' 'fuse2' 'gnutls' 'parted' 'libssh' 'libxml2' 'numactl' 'polkit')
+makedepends=('libxslt' 'python-docutils' 'lvm2' 'open-iscsi' 'libiscsi' 'ceph-libs' 'glusterfs'
+             'bash-completion' 'rpcsvc-proto' 'dnsmasq' 'iproute2' 'qemu-headless')
+checkdepends=('ebtables')
+optdepends=('libvirt-storage-gluster: Gluster storage backend'
+            'libvirt-storage-iscsi-direct: iSCSI-direct storage backend'
+            'libvirt-storage-rbd: RBD storage backend'
+            'gettext: required for libvirt-guests.service'
+            'openbsd-netcat: for remote management over ssh'
+            'dmidecode: DMI system info support'
+            'dnsmasq: required for default NAT/DHCP for guests'
+            'radvd: IPv6 RAD support'
+            'ebtables: required for default NAT networking'
+            'qemu: QEMU/KVM support'
+            'lvm2: Logical Volume Manager support'
+            'open-iscsi: iSCSI support via iscsiadm')
+backup=(
+  'etc/conf.d/libvirtd'
+  'etc/conf.d/libvirt-guests'
+  'etc/conf.d/virtinterfaced'
+  'etc/conf.d/virtlockd'
+  'etc/conf.d/virtlogd'
+  'etc/conf.d/virtlxcd'
+  'etc/conf.d/virtnetworkd'
+  'etc/conf.d/virtnodedevd'
+  'etc/conf.d/virtnwfilterd'
+  'etc/conf.d/virtproxyd'
+  'etc/conf.d/virtqemud'
+  'etc/conf.d/virtsecretd'
+  'etc/conf.d/virtstoraged'
+  'etc/conf.d/virtvboxd'
+  'etc/libvirt/libvirt-admin.conf'
+  'etc/libvirt/libvirt.conf'
+  'etc/libvirt/libvirtd.conf'
+  'etc/libvirt/lxc.conf'
+  'etc/libvirt/nwfilter/allow-arp.xml'
+  'etc/libvirt/nwfilter/allow-dhcp-server.xml'
+  'etc/libvirt/nwfilter/allow-dhcp.xml'
+  'etc/libvirt/nwfilter/allow-incoming-ipv4.xml'
+  'etc/libvirt/nwfilter/allow-ipv4.xml'
+  'etc/libvirt/nwfilter/clean-traffic-gateway.xml'
+  'etc/libvirt/nwfilter/clean-traffic.xml'
+  'etc/libvirt/nwfilter/no-arp-ip-spoofing.xml'
+  'etc/libvirt/nwfilter/no-arp-mac-spoofing.xml'
+  'etc/libvirt/nwfilter/no-arp-spoofing.xml'
+  'etc/libvirt/nwfilter/no-ip-multicast.xml'
+  'etc/libvirt/nwfilter/no-ip-spoofing.xml'
+  'etc/libvirt/nwfilter/no-mac-broadcast.xml'
+  'etc/libvirt/nwfilter/no-mac-spoofing.xml'
+  'etc/libvirt/nwfilter/no-other-l2-traffic.xml'
+  'etc/libvirt/nwfilter/no-other-rarp-traffic.xml'
+  'etc/libvirt/nwfilter/qemu-announce-self-rarp.xml'
+  'etc/libvirt/nwfilter/qemu-announce-self.xml'
+  'etc/libvirt/qemu.conf'
+  'etc/libvirt/qemu-lockd.conf'
+  'etc/libvirt/qemu/networks/default.xml'
+  'etc/libvirt/virtinterfaced.conf'
+  'etc/libvirt/virtlockd.conf'
+  'etc/libvirt/virtlogd.conf'
+  'etc/libvirt/virt-login-shell.conf'
+  'etc/libvirt/virtlxcd.conf'
+  'etc/libvirt/virtnetworkd.conf'
+  'etc/libvirt/virtnodedevd.conf'
+  'etc/libvirt/virtnwfilterd.conf'
+  'etc/libvirt/virtproxyd.conf'
+  'etc/libvirt/virtqemud.conf'
+  'etc/libvirt/virtsecretd.conf'
+  'etc/libvirt/virtstoraged.conf'
+  'etc/libvirt/virtvboxd.conf'
+  'etc/logrotate.d/libvirtd'
+  'etc/logrotate.d/libvirtd.lxc'
+  'etc/logrotate.d/libvirtd.qemu'
+  'etc/sasl2/libvirt.conf'
+)
+source=("https://libvirt.org/sources/$pkgname-$pkgver.tar.xz"{,.asc})
+sha256sums=('74069438d34082336e99a88146349e21130552b96efc3b7c562f6878127996f5'
+            'SKIP')
+validpgpkeys=('C74415BA7C9C7F78F02E1DC34606B8A5DE95BC1F') # Daniel Veillard <veillard at redhat.com>
+
+prepare() {
+  mkdir build
+  cd "$pkgname-$pkgver"
+  sed -i 's|/sysconfig/|/conf.d/|g' \
+    src/remote/libvirtd.service.in \
+    tools/{libvirt-guests.service,libvirt-guests.sh,virt-pki-validate}.in \
+    src/locking/virtlockd.service.in \
+    src/logging/virtlogd.service.in
+  sed -i 's|/usr/libexec/qemu-bridge-helper|/usr/lib/qemu/qemu-bridge-helper|g' \
+    src/qemu/qemu.conf \
+    src/qemu/test_libvirtd_qemu.aug.in
+}
+
+build() {
+  cd build
+  ZFS=/usr/bin/zfs ZPOOL=/usr/bin/zpool \
+  "../$pkgname-$pkgver/configure" \
+    --prefix=/usr \
+    "--libexec=/usr/lib/$pkgname" \
+    --sbindir=/usr/bin \
+    --with-runstatedir=/run \
+    --with-qemu-group=kvm
+  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+  make
+}
+
+check() {
+  cd build
+  make check
+}
+
+package_libvirt() {
+  provides=('libvirt.so' 'libvirt-admin.so' 'libvirt-lxc.so' 'libvirt-qemu.so')
+  cd build
+  make DESTDIR="$pkgdir" install
+
+  mv "$pkgdir"/etc/{sysconfig,conf.d}
+  mkdir "$pkgdir"/usr/lib/{sysusers,tmpfiles}.d
+  echo "g libvirt - -" > "$pkgdir/usr/lib/sysusers.d/libvirt.conf"
+  echo "z /var/lib/libvirt/qemu 0751" > "$pkgdir/usr/lib/tmpfiles.d/libvirt.conf"
+
+  chown 0:102 "$pkgdir/usr/share/polkit-1/rules.d"
+  chmod 0750 "$pkgdir/usr/share/polkit-1/rules.d"
+  chmod 600 "$pkgdir"/etc/libvirt/nwfilter/*.xml \
+    "$pkgdir/etc/libvirt/qemu/networks/default.xml"
+
+  rm -rf \
+    "$pkgdir/run" \
+    "$pkgdir/var/lib/libvirt/qemu" \
+    "$pkgdir/var/cache/libvirt/qemu" \
+    "$pkgdir/etc/logrotate.d/libvirtd.libxl"
+
+  rm -f "$pkgdir/etc/libvirt/qemu/networks/autostart/default.xml"
+
+  # move split modules
+  mv "$pkgdir"/usr/lib/libvirt/storage-backend/libvirt_storage_backend_{rbd,gluster}.so "$pkgdir/../"
+  mv "$pkgdir/usr/lib/libvirt/storage-backend/libvirt_storage_backend_iscsi-direct.so" "$pkgdir/../"
+  mv "$pkgdir/usr/lib/libvirt/storage-file/libvirt_storage_file_gluster.so" "$pkgdir/../"
+}
+
+package_libvirt-storage-gluster() {
+  pkgdesc="Libvirt Gluster storage backend"
+  depends=("libvirt=$pkgver" 'glusterfs')
+  optdepends=()
+  backup=()
+
+  install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_gluster.so"
+  install -Dv -t "$pkgdir/usr/lib/libvirt/storage-file" "$pkgdir/../libvirt_storage_file_gluster.so"
+}
+
+package_libvirt-storage-iscsi-direct() {
+  pkgdesc="Libvirt iSCSI-direct storage backend"
+  depends=("libvirt=$pkgver" 'libiscsi')
+  optdepends=()
+  backup=()
+
+  install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_iscsi-direct.so"
+}
+
+package_libvirt-storage-rbd() {
+  pkgdesc="Libvirt RBD storage backend"
+  depends=("libvirt=$pkgver" 'ceph-libs')
+  optdepends=()
+  backup=()
+
+  install -Dv -t "$pkgdir/usr/lib/libvirt/storage-backend" "$pkgdir/../libvirt_storage_backend_rbd.so"
+}

Copied: libvirt/repos/community-testing-x86_64/libvirt.sysusers.d (from rev 625035, libvirt/trunk/libvirt.sysusers.d)
===================================================================
--- community-testing-x86_64/libvirt.sysusers.d	                        (rev 0)
+++ community-testing-x86_64/libvirt.sysusers.d	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1 @@
+g libvirt - -

Copied: libvirt/repos/community-testing-x86_64/libvirtd-guests.conf.d (from rev 625035, libvirt/trunk/libvirtd-guests.conf.d)
===================================================================
--- community-testing-x86_64/libvirtd-guests.conf.d	                        (rev 0)
+++ community-testing-x86_64/libvirtd-guests.conf.d	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1,9 @@
+BYPASS_CACHE=0
+CONNECT_RETRIES=10
+ON_BOOT=start
+ON_SHUTDOWN=suspend
+PARALLEL_SHUTDOWN=0
+RETRIES_SLEEP=1
+SHUTDOWN_TIMEOUT=300
+START_DELAY=0
+URIS=default

Copied: libvirt/repos/community-testing-x86_64/libvirtd.conf.d (from rev 625035, libvirt/trunk/libvirtd.conf.d)
===================================================================
--- community-testing-x86_64/libvirtd.conf.d	                        (rev 0)
+++ community-testing-x86_64/libvirtd.conf.d	2020-05-06 11:47:33 UTC (rev 625036)
@@ -0,0 +1 @@
+LIBVIRTD_ARGS=""


More information about the arch-commits mailing list