community/libvirt to 6.4.0-1

This commit is contained in:
Kevin Mihelich 2020-06-02 13:53:24 +00:00
parent 72f3a84260
commit 33a4f0bf32
9 changed files with 121 additions and 600 deletions

View file

@ -1,104 +0,0 @@
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

View file

@ -1,70 +0,0 @@
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

View file

@ -1,194 +0,0 @@
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

View file

@ -1,111 +0,0 @@
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

View file

@ -1,37 +1,51 @@
# Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
# Maintainer: Robin Broda <robin@broda.me>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jonathan Wiersma <archaur at jonw dot org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove numactl from depends, doesn't build on ARM
# - drop ceph depend until it builds
# - removed ceph makedepend, libvirt-storage-rbd package
# - removed qemu makedepend
pkgname=libvirt
pkgver=5.10.0
pkgrel=3
pkgname=(libvirt libvirt-storage-gluster libvirt-storage-iscsi-direct)
pkgver=6.4.0
pkgrel=1
pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
arch=('x86_64')
url="https://libvirt.org/"
license=('LGPL')
makedepends=('lvm2' 'linux-api-headers' 'dnsmasq' 'lxc' 'libiscsi' 'open-iscsi'
'perl-xml-xpath' 'libxslt' 'parted' 'python' 'rpcsvc-proto')
depends=('e2fsprogs' 'gnutls' 'iptables' 'libxml2' 'parted' 'polkit'
'yajl' 'libpciaccess' 'udev' 'dbus' 'libxau' 'libxdmcp' 'libpcap'
'libcap-ng' 'curl' 'libsasl' 'libgcrypt' 'libgpg-error' 'openssl'
'libxcb' 'gcc-libs' 'iproute2' 'libnl' 'libx11' 'gettext'
'libssh2' 'netcf' 'fuse2' 'glusterfs' 'libiscsi')
optdepends=('ebtables: required for default NAT networking'
license=('LGPL' 'GPL3') #libvirt_parthelper links to libparted which is GPL3 only
install=libvirt.install
depends=('libpciaccess' 'yajl' 'fuse2' 'gnutls' 'parted' 'libssh' 'libxml2' 'numactl' 'polkit')
makedepends=('libxslt' 'python-docutils' 'lvm2' 'open-iscsi' 'libiscsi' 'glusterfs'
'bash-completion' 'rpcsvc-proto' 'dnsmasq' 'iproute2')
checkdepends=('ebtables')
optdepends=('libvirt-storage-gluster: Gluster storage backend'
'libvirt-storage-iscsi-direct: iSCSI-direct 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'
'bridge-utils: for bridged networking'
'netcat: for remote management over ssh'
'radvd'
'dmidecode'
'parted')
backup=('etc/conf.d/libvirt-guests'
'radvd: IPv6 RAD support'
'ebtables: required for default NAT networking'
'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/virtlogd.conf'
'etc/libvirt/libvirtd.conf'
'etc/libvirt/lxc.conf'
'etc/libvirt/nwfilter/allow-arp.xml'
@ -39,6 +53,7 @@ backup=('etc/conf.d/libvirt-guests'
'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'
@ -51,123 +66,112 @@ backup=('etc/conf.d/libvirt-guests'
'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/nwfilter/clean-traffic-gateway.xml'
'etc/libvirt/qemu-lockd.conf'
'etc/libvirt/qemu.conf'
'etc/libvirt/qemu-lockd.conf'
'etc/libvirt/qemu/networks/default.xml'
'etc/libvirt/virt-login-shell.conf'
'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')
options=('emptydirs')
validpgpkeys=('C74415BA7C9C7F78F02E1DC34606B8A5DE95BC1F')
source=("https://libvirt.org/sources/${pkgname}-${pkgver}.tar.xz"{,.asc}
'libvirtd.conf.d'
'libvirtd-guests.conf.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'
'58569ece7fd6ce69c4261523a985778f29e33e78c814ffb8ed674f34a32dc92aaaeb6d785ab507015f15a7480434bcfbf93b728b51539831d5fa8b4915f45a11'
'4162a7a38d94cb98a2c9a318fb7d7b9b8dc37a07762e8f6c8e2962c9961230f901fe354c80ea83dfe6d0d8cdda5f706a7cf20fcbcaf916f854755ea9a00e435b'
'64334505c906a256852d7d56715ce259e2881e147b290ca321d73043dd683d594b291245de36f97259b87c247852858e04e89315f929234236bb8abc39c284f2'
'8908557893efe6f53d15907be059a410f99e4f6ffd5211979978f30ab21faaeabaf80ff98e45eef2802540dd688c862b3bea22555b968651368c629c53da39fa')
changelog=Changelog
'etc/sasl2/libvirt.conf'
)
source=("https://libvirt.org/sources/$pkgname-$pkgver.tar.xz"{,.asc})
sha256sums=('586ebcf220369d08a07c6cc17035e8a91bb3741e4300199459904e9e02478be7'
'SKIP')
validpgpkeys=('C74415BA7C9C7F78F02E1DC34606B8A5DE95BC1F') # Daniel Veillard <veillard@redhat.com>
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
#local src
#for src in "${source[@]}"; do
# src="${src%%::*}"
# src="${src##*/}"
# [[ $src = *.patch ]] || continue
# msg2 "Applying patch $src..."
# 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
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
sed -i 's|@sbindir@|/usr/bin|g' src/locking/virtlockd.service.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,_conf.c} \
src/qemu/qemu.conf \
src/qemu/test_libvirtd_qemu.aug.in
sed -i 's|libsystemd-daemon|libsystemd|g' configure
sed -i 's/notify/simple/' src/remote/libvirtd.service.in
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export PYTHON=$(command -v python)
export LDFLAGS=-lX11
export RADVD=/usr/bin/radvd
mkdir build && cd build
ZFS=/usr/bin/zfs ZPOOL=/usr/bin/zpool ../configure \
cd build
ZFS=/usr/bin/zfs ZPOOL=/usr/bin/zpool \
"../$pkgname-$pkgver/configure" \
--prefix=/usr \
--libexec=/usr/lib/"${pkgname}" \
"--libexec=/usr/lib/$pkgname" \
--sbindir=/usr/bin \
--disable-static \
--with-init-script=systemd \
--with-qemu-user=nobody \
--with-qemu-group=kvm \
--without-hal \
--with-interface \
--with-lxc \
--with-netcf \
--with-udev \
--with-storage-disk \
--with-storage-gluster \
--with-storage-iscsi \
--with-storage-lvm \
--with-storage-zfs \
--with-runstatedir=/run
# --with-audit
--with-runstatedir=/run \
--with-qemu-group=kvm
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}/build"
check() {
cd build
make check
}
make DESTDIR="${pkgdir}" install
package_libvirt() {
provides=('libvirt.so' 'libvirt-admin.so' 'libvirt-lxc.so' 'libvirt-qemu.so')
cd build
make DESTDIR="$pkgdir" install
install -D -m644 "${srcdir}"/libvirtd.conf.d "${pkgdir}"/etc/conf.d/libvirtd
install -D -m644 "${srcdir}"/libvirtd-guests.conf.d "${pkgdir}"/etc/conf.d/libvirt-guests
install -D -m644 "${srcdir}"/libvirt.sysusers.d "${pkgdir}"/usr/lib/sysusers.d/libvirt.conf
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
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"
# Strip auto-generated UUID, so it will be generated per-install. (reproducible builds)
sed -i 's|<uuid>.*</uuid>|<uuid></uuid>|' "$pkgdir"/etc/libvirt/qemu/networks/default.xml
rm -rf \
"${pkgdir}"/var/run \
"${pkgdir}"/var/lib/libvirt/qemu \
"${pkgdir}"/var/cache/libvirt/qemu \
"${pkgdir}"/etc/sysconfig
"$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
rm -f "$pkgdir/etc/libvirt/qemu/networks/autostart/default.xml"
# Fix permission Fix #61977
chmod 600 "${pkgdir}"/etc/libvirt/nwfilter/*.xml "${pkgdir}/etc/libvirt/qemu/networks/default.xml"
# Fix firewalld rules Fix #62219
sed -i "s|<rule priority='32767'><reject/></rule>|#<rule priority='32767'><reject/></rule>|" "${pkgdir}/usr/lib/firewalld/zones/libvirt.xml"
# move split modules
mv "$pkgdir"/usr/lib/libvirt/storage-backend/libvirt_storage_backend_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"
}

View file

@ -0,0 +1,7 @@
post_install() {
if [[ -f /etc/libvirt/qemu/networks/default.xml ]]
then
UUID=$(/usr/bin/uuidgen)
sed -i "s|<uuid></uuid>|<uuid>$UUID</uuid>|" /etc/libvirt/qemu/networks/default.xml
fi
}

View file

@ -1 +0,0 @@
g libvirt - -

View file

@ -1,9 +0,0 @@
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

View file

@ -1 +0,0 @@
LIBVIRTD_ARGS=""