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
This commit is contained in:
Jiri Denemark 2023-06-02 14:24:34 +02:00
parent 8e2d2a718e
commit d2a35bd337
4 changed files with 11 additions and 166 deletions

View File

@ -1,134 +0,0 @@
From d6fb700653000794c898517db6953b90b580af09 Mon Sep 17 00:00:00 2001
Message-Id: <d6fb700653000794c898517db6953b90b580af09@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
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 <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit c925bb927327c6f23864348286d931a25fbd13a3)
https://bugzilla.redhat.com/show_bug.cgi?id=2014030
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
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

View File

@ -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 <jdenemar@redhat.com> - 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 <jdenemar@redhat.com> - 9.3.0-2
- qemu_domin: Account for NVMe disks when calculating memlock limit on hotplug (rhbz#2014030)

View File

@ -1 +1 @@
SHA512 (libvirt-9.3.0.tar.xz) = b9349dcd7798c76d75bb20afad67d6e676758cb201acaf7aed5109f0e91422b2bcca964a2f19aa8dc4fd0eca2923902474e16e3839bf8b15aca827028e88ddb7
SHA512 (libvirt-9.4.0.tar.xz) = 8a8e3983c47c5ed5f4b50d90cb04e435717afddd27e16112ceeddda458d45c693daf65575f5d50274cfffcd1c83cbdd290819d8ece63f3bf9441b6bdaa309852

View File

@ -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