From d2a35bd3378ea0ab40b34b212583906140875449 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Fri, 2 Jun 2023 14:24:34 +0200 Subject: [PATCH] libvirt-9.4.0-1.el9 - Rebased to libvirt-9.4.0 (rhbz#2175785) - The rebase also fixes the following bugs: rhbz#2119007, rhbz#2193315, rhbz#2209658, rhbz#2143158, rhbz#2208946 rhbz#2138150, rhbz#2203657, rhbz#2180679, rhbz#2203709 Resolves: rhbz#2119007, rhbz#2138150, rhbz#2143158, rhbz#2175785, rhbz#2180679 Resolves: rhbz#2193315, rhbz#2203657, rhbz#2203709, rhbz#2208946, rhbz#2209658 --- ...calculating-memlock-limit-on-hotplug.patch | 134 ------------------ libvirt.spec | 15 +- sources | 2 +- symlinks | 26 ---- 4 files changed, 11 insertions(+), 166 deletions(-) delete mode 100644 libvirt-qemu_domin-Account-for-NVMe-disks-when-calculating-memlock-limit-on-hotplug.patch diff --git a/libvirt-qemu_domin-Account-for-NVMe-disks-when-calculating-memlock-limit-on-hotplug.patch b/libvirt-qemu_domin-Account-for-NVMe-disks-when-calculating-memlock-limit-on-hotplug.patch deleted file mode 100644 index ce3fd32..0000000 --- a/libvirt-qemu_domin-Account-for-NVMe-disks-when-calculating-memlock-limit-on-hotplug.patch +++ /dev/null @@ -1,134 +0,0 @@ -From d6fb700653000794c898517db6953b90b580af09 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Tue, 9 May 2023 13:19:12 +0300 -Subject: [PATCH] qemu_domin: Account for NVMe disks when calculating memlock - limit on hotplug - -During hotplug of a NVMe disk we need to adjust the memlock -limit. The computation of the limit is handled by -qemuDomainGetMemLockLimitBytes() which looks at given domain -definition and accounts for various device types (as different -types require different amounts). But during disk hotplug the -disk is not added to domain definition until the very last -moment. Therefore, qemuDomainGetMemLockLimitBytes() has this -@forceVFIO argument which tells it to assume VFIO even if there -are no signs of VFIO in domain definition. And this kind of -works, until the amount needed for NVMe disks changed (in -v9.3.0-rc1~52). What's missing in the commit is making @forceVFIO -behave the same as if there was an NVMe disk present in the -domain definition. - -But, we can do even better - just mimic whatever we're doing for -hostdevs. IOW - introduce qemuDomainAdjustMaxMemLockNVMe() that -behaves the same as qemuDomainAdjustMaxMemLockHostdev(). - -There are subtle differences though: - -1) qemuDomainAdjustMaxMemLockHostdev() can afford placing hostdev - right at the end of vm->def->hostdevs, because the array was - already reallocated (at the beginning of - qemuDomainAttachHostPCIDevice()). But - qemuDomainAdjustMaxMemLockNVMe() doesn't have that luxury. - -2) qemuDomainAdjustMaxMemLockHostdev() places a - virDomainHostdevDef pointer into domain definition, while - qemuDomainStorageSourceAccessModifyNVMe() (which calls - qemuDomainAdjustMaxMemLock()) sees a virStorageSource pointer - but domain definition contains virDomainDiskDef. But that's - okay, we can create a dummy disk definition and append it into - the domain definition. - -After this, qemuDomainAdjustMaxMemLock() can be called with -@forceVFIO = false, as the disk is now part of domain definition -(when computing the new limit). - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2014030#c28 -Signed-off-by: Michal Privoznik -Reviewed-by: Martin Kletzander -(cherry picked from commit c925bb927327c6f23864348286d931a25fbd13a3) - -https://bugzilla.redhat.com/show_bug.cgi?id=2014030 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 35 ++++++++++++++++++++++++++++++++++- - src/qemu/qemu_domain.h | 3 +++ - 2 files changed, 37 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index d556e2186c..b5b4184782 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -8026,7 +8026,7 @@ qemuDomainStorageSourceAccessModifyNVMe(virQEMUDriver *driver, - goto revoke; - } - -- if (qemuDomainAdjustMaxMemLock(vm, true) < 0) -+ if (qemuDomainAdjustMaxMemLockNVMe(vm, src) < 0) - goto revoke; - - revoke_maxmemlock = true; -@@ -9779,6 +9779,39 @@ qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm, - } - - -+/** -+ * qemuDomainAdjustMaxMemLockNVMe: -+ * @vm: domain object -+ * @src: disk source -+ * -+ * Temporarily add the disk source to the domain definition, -+ * adjust the max memlock based in this new definition and -+ * restore the original definition. -+ * -+ * Returns: 0 on success, -+ * -1 on failure. -+ */ -+int -+qemuDomainAdjustMaxMemLockNVMe(virDomainObj *vm, -+ virStorageSource *src) -+{ -+ g_autofree virDomainDiskDef *disk = NULL; -+ int ret = 0; -+ -+ disk = g_new0(virDomainDiskDef, 1); -+ disk->src = src; -+ -+ VIR_APPEND_ELEMENT_COPY(vm->def->disks, vm->def->ndisks, disk); -+ -+ if (qemuDomainAdjustMaxMemLock(vm, false) < 0) -+ ret = -1; -+ -+ VIR_DELETE_ELEMENT_INPLACE(vm->def->disks, vm->def->ndisks - 1, vm->def->ndisks); -+ -+ return ret; -+} -+ -+ - /** - * qemuDomainHasVcpuPids: - * @vm: Domain object -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index eaa75de3e5..ee2ddda079 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -41,6 +41,7 @@ - #include "virdomainmomentobjlist.h" - #include "virenum.h" - #include "vireventthread.h" -+#include "storage_source_conf.h" - - #define QEMU_DOMAIN_FORMAT_LIVE_FLAGS \ - (VIR_DOMAIN_XML_SECURE) -@@ -859,6 +860,8 @@ int qemuDomainAdjustMaxMemLock(virDomainObj *vm, - bool forceVFIO); - int qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm, - virDomainHostdevDef *hostdev); -+int qemuDomainAdjustMaxMemLockNVMe(virDomainObj *vm, -+ virStorageSource *src); - int qemuDomainSetMaxMemLock(virDomainObj *vm, - unsigned long long limit, - unsigned long long *origPtr); --- -2.40.1 diff --git a/libvirt.spec b/libvirt.spec index 83e14aa..eb4682c 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -228,8 +228,8 @@ Summary: Library providing a simple virtualization API Name: libvirt -Version: 9.3.0 -Release: 2%{?dist}%{?extra_release} +Version: 9.4.0 +Release: 1%{?dist}%{?extra_release} License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1 URL: https://libvirt.org/ @@ -238,8 +238,6 @@ URL: https://libvirt.org/ %endif Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz Source1: symlinks -Patch1: libvirt-qemu_domin-Account-for-NVMe-disks-when-calculating-memlock-limit-on-hotplug.patch - Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -313,7 +311,7 @@ BuildRequires: util-linux %if %{with_qemu} # For managing ACLs BuildRequires: libacl-devel -# From QEMU RPMs +# From QEMU RPMs, used by virstoragetest BuildRequires: /usr/bin/qemu-img %endif # For LVM drivers @@ -1233,6 +1231,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) %meson \ -Drunstatedir=%{_rundir} \ + -Dinitconfdir=%{_sysconfdir}/sysconfig \ %{?arg_qemu} \ %{?arg_openvz} \ %{?arg_lxc} \ @@ -2474,6 +2473,12 @@ exit 0 %endif %changelog +* Fri Jun 2 2023 Jiri Denemark - 9.4.0-1 +- Rebased to libvirt-9.4.0 (rhbz#2175785) +- The rebase also fixes the following bugs: + rhbz#2119007, rhbz#2193315, rhbz#2209658, rhbz#2143158, rhbz#2208946 + rhbz#2138150, rhbz#2203657, rhbz#2180679, rhbz#2203709 + * Tue May 16 2023 Jiri Denemark - 9.3.0-2 - qemu_domin: Account for NVMe disks when calculating memlock limit on hotplug (rhbz#2014030) diff --git a/sources b/sources index e76c4ab..0f74d78 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libvirt-9.3.0.tar.xz) = b9349dcd7798c76d75bb20afad67d6e676758cb201acaf7aed5109f0e91422b2bcca964a2f19aa8dc4fd0eca2923902474e16e3839bf8b15aca827028e88ddb7 +SHA512 (libvirt-9.4.0.tar.xz) = 8a8e3983c47c5ed5f4b50d90cb04e435717afddd27e16112ceeddda458d45c693daf65575f5d50274cfffcd1c83cbdd290819d8ece63f3bf9441b6bdaa309852 diff --git a/symlinks b/symlinks index 0a28f1c..5d69955 100644 --- a/symlinks +++ b/symlinks @@ -98,32 +98,6 @@ tests/qemuxml2argvdata/pseries-serial-compat.ppc64-latest.args pseries-serial-na tests/qemuxml2argvdata/usb-controller-default-unavailable-q35.xml usb-controller-default-q35.xml tests/qemuxml2argvdata/usb-controller-explicit-unavailable-q35.xml usb-controller-explicit-q35.xml tests/qemuxml2argvdata/usb-controller-qemu-xhci-unavailable.xml usb-controller-qemu-xhci.xml -tests/qemuxml2xmloutdata/audio-alsa-best.xml ../qemuxml2argvdata/audio-alsa-best.xml -tests/qemuxml2xmloutdata/audio-alsa-full.xml ../qemuxml2argvdata/audio-alsa-full.xml -tests/qemuxml2xmloutdata/audio-alsa-minimal.xml ../qemuxml2argvdata/audio-alsa-minimal.xml -tests/qemuxml2xmloutdata/audio-coreaudio-best.xml ../qemuxml2argvdata/audio-coreaudio-best.xml -tests/qemuxml2xmloutdata/audio-coreaudio-full.xml ../qemuxml2argvdata/audio-coreaudio-full.xml -tests/qemuxml2xmloutdata/audio-coreaudio-minimal.xml ../qemuxml2argvdata/audio-coreaudio-minimal.xml -tests/qemuxml2xmloutdata/audio-file-best.xml ../qemuxml2argvdata/audio-file-best.xml -tests/qemuxml2xmloutdata/audio-file-full.xml ../qemuxml2argvdata/audio-file-full.xml -tests/qemuxml2xmloutdata/audio-file-minimal.xml ../qemuxml2argvdata/audio-file-minimal.xml -tests/qemuxml2xmloutdata/audio-jack-full.xml ../qemuxml2argvdata/audio-jack-full.xml -tests/qemuxml2xmloutdata/audio-many-backends.x86_64-latest.xml ../qemuxml2argvdata/audio-many-backends.xml -tests/qemuxml2xmloutdata/audio-none-best.xml ../qemuxml2argvdata/audio-none-best.xml -tests/qemuxml2xmloutdata/audio-none-full.xml ../qemuxml2argvdata/audio-none-full.xml -tests/qemuxml2xmloutdata/audio-none-minimal.xml ../qemuxml2argvdata/audio-none-minimal.xml -tests/qemuxml2xmloutdata/audio-oss-best.xml ../qemuxml2argvdata/audio-oss-best.xml -tests/qemuxml2xmloutdata/audio-oss-full.xml ../qemuxml2argvdata/audio-oss-full.xml -tests/qemuxml2xmloutdata/audio-oss-minimal.xml ../qemuxml2argvdata/audio-oss-minimal.xml -tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml ../qemuxml2argvdata/audio-pulseaudio-best.xml -tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml ../qemuxml2argvdata/audio-pulseaudio-full.xml -tests/qemuxml2xmloutdata/audio-pulseaudio-minimal.xml ../qemuxml2argvdata/audio-pulseaudio-minimal.xml -tests/qemuxml2xmloutdata/audio-sdl-best.xml ../qemuxml2argvdata/audio-sdl-best.xml -tests/qemuxml2xmloutdata/audio-sdl-full.xml ../qemuxml2argvdata/audio-sdl-full.xml -tests/qemuxml2xmloutdata/audio-sdl-minimal.xml ../qemuxml2argvdata/audio-sdl-minimal.xml -tests/qemuxml2xmloutdata/audio-spice-best.xml ../qemuxml2argvdata/audio-spice-best.xml -tests/qemuxml2xmloutdata/audio-spice-full.xml ../qemuxml2argvdata/audio-spice-full.xml -tests/qemuxml2xmloutdata/audio-spice-minimal.xml ../qemuxml2argvdata/audio-spice-minimal.xml tests/qemuxml2xmloutdata/blkdeviotune-group-num.x86_64-latest.xml ../qemuxml2argvdata/blkdeviotune-group-num.xml tests/qemuxml2xmloutdata/blkdeviotune-max-length.x86_64-latest.xml ../qemuxml2argvdata/blkdeviotune-max-length.xml tests/qemuxml2xmloutdata/blkdeviotune-max.x86_64-latest.xml ../qemuxml2argvdata/blkdeviotune-max.xml