From 6623b47de68aac637e3f0d576106e0c82ec6fd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Sun, 12 Jul 2026 03:12:49 +0000 Subject: [PATCH] Backport packages from upstream --- centos-10/SOURCES/libvirt-12.4.0.tar.xz | 3 - centos-10/SOURCES/libvirt-12.5.0.tar.xz | 3 + centos-10/SPECS/libvirt.spec | 8 +- ...dering-of-virtlockd-virtlogd-daemons.patch | 119 ++++++++++++++++++ centos-9/SPECS/libvirt.spec | 7 +- 5 files changed, 134 insertions(+), 6 deletions(-) delete mode 100644 centos-10/SOURCES/libvirt-12.4.0.tar.xz create mode 100644 centos-10/SOURCES/libvirt-12.5.0.tar.xz create mode 100644 centos-9/SOURCES/libvirt-qemu-Ensure-proper-shutdown-ordering-of-virtlockd-virtlogd-daemons.patch diff --git a/centos-10/SOURCES/libvirt-12.4.0.tar.xz b/centos-10/SOURCES/libvirt-12.4.0.tar.xz deleted file mode 100644 index c90a0e8..0000000 --- a/centos-10/SOURCES/libvirt-12.4.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c86c7f758391b895ec90f76f965a56266167028978ac6dce824fea4d6a036b6d -size 10461608 diff --git a/centos-10/SOURCES/libvirt-12.5.0.tar.xz b/centos-10/SOURCES/libvirt-12.5.0.tar.xz new file mode 100644 index 0000000..c0f4c2e --- /dev/null +++ b/centos-10/SOURCES/libvirt-12.5.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fff62f08fdf938fe7fd21e260a908a44193cc6d34c42d3b1afdcadd34120357 +size 10659480 diff --git a/centos-10/SPECS/libvirt.spec b/centos-10/SPECS/libvirt.spec index 20adad4..2c003ed 100644 --- a/centos-10/SPECS/libvirt.spec +++ b/centos-10/SPECS/libvirt.spec @@ -138,7 +138,6 @@ %define with_vbox 0 %define with_vmware 0 %define with_libxl 0 - %define with_hyperv 0 %define with_lxc 0 %define with_ch 0 %endif @@ -287,7 +286,7 @@ Summary: Library providing a simple virtualization API Name: libvirt -Version: 12.4.0 +Version: 12.5.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/ @@ -2694,6 +2693,11 @@ exit 0 %endif %changelog +* Wed Jul 1 2026 Jiri Denemark - 12.5.0-1 +- Rebased to libvirt-12.5.0 (RHEL-156861) +- The rebase also fixes the following bugs: + RHEL-180448, RHEL-181350, RHEL-185108, RHEL-186015, RHEL-187057 + * Mon Jun 15 2026 Jiri Denemark - 12.4.0-1 - Rebased to libvirt-12.4.0 (RHEL-156861) - The rebase also fixes the following bugs: diff --git a/centos-9/SOURCES/libvirt-qemu-Ensure-proper-shutdown-ordering-of-virtlockd-virtlogd-daemons.patch b/centos-9/SOURCES/libvirt-qemu-Ensure-proper-shutdown-ordering-of-virtlockd-virtlogd-daemons.patch new file mode 100644 index 0000000..41c5859 --- /dev/null +++ b/centos-9/SOURCES/libvirt-qemu-Ensure-proper-shutdown-ordering-of-virtlockd-virtlogd-daemons.patch @@ -0,0 +1,119 @@ +From 36c833cacb0d001ab43ba9662fe432922491c3b5 Mon Sep 17 00:00:00 2001 +Message-ID: <36c833cacb0d001ab43ba9662fe432922491c3b5.1782911963.git.jdenemar@redhat.com> +From: Peter Krempa +Date: Mon, 15 Jun 2026 13:01:01 +0200 +Subject: [PATCH] qemu: Ensure proper shutdown ordering of virtlockd/virtlogd + daemons + +For socket activation to work our systemd unit files use the following +pattern: + + [virtlogd.socket] <----(After)--- [virtlogd.service] + [virtqemud.socket] <----(After)--- [virtqemud.service] + +Now the qemu daemon also wants to use the services provided by those +daemons so we have dependency between the two too: + + [virtlogd.socket] <----(After)--- [virtlogd.service] + ^ + +-------------(After+Requires)-------+ + | + [virtqemud.socket] <----(After)--- [virtqemud.service] + +Now on startup everything is fine, because with socket activation, when +'virtqemud.service' wants to use 'virtlogd' services the socket is +already up due to the dependency+ordering and opening a connection will +cause 'virtlogd.service' to be socket-activated. + +On shutdown though there's no transitive 'After' ordering between +'virtqemud.service' and 'virtlogd.service' and thus nothing explicitly +telling systemd that if virtlogd was started. In fact systemd is free to +translate it that 'virtlogd' and 'virtqemud' need to be stopped before +stopping 'virtlogd.socket'. + +To illustrate what happens consider the following scenario: + +A host is running a VM under virtqemud. 'virtqemud' is configured to +attempt shutdown on the VMs before killing them (daemon-based guest +shutdown, but the same reproduces also with libvirt-guests). The host +is being rebooted. + + (virtqemud attempts to shut down guests, but guest takes more than the + configured shutdown inhibition timeout, journald output follows): + + 06:44:02 fedora systemd-logind[664]: Delay lock is active (UID 0/root, PID 991/virtqemud) but inhibitor timeout is reached. + 06:44:02 fedora systemd-logind[664]: System is rebooting. + [...] + 06:44:02 fedora virtlogd[802]: 802: debug : virSystemdNotify:667 : Notify 'STOPPING=1' + 06:44:02 fedora systemd[1]: Stopping virtlogd.service - libvirt logging daemon... + 06:44:02 fedora systemd[1]: Stopping virtqemud.service - libvirt QEMU daemon... + 06:44:02 fedora virtqemud[991]: 991: debug : virSystemdNotify:667 : Notify 'STOPPING=1' + 06:44:02 fedora systemd[1]: virtlogd.service: Deactivated successfully. + 06:44:02 fedora systemd[1]: Stopped virtlogd.service - libvirt logging daemon. + + (the shutdown times out, virtqemud kills the unresponsive vm) + + 06:44:27 fedora virtqemud[991]: 1053: debug : qemuProcessStop:8916 : Shutting down vm=0x7f71ac032670 name=virt-vm1 id=1 pid=805, reason=destroyed, asyncJob=none, flags=0x0 + 06:44:27 fedora virtqemud[991]: 1053: debug : qemuDomainLogAppendMessage:5757 : Append log message (vm='virt-vm1' message='2026-06-15 10:44:27.427+0000: shutting down, reason=destroyed + ) stdioLogD=1 + 06:44:27 fedora virtqemud[991]: 1053: error : virNetSocketReadWire:1767 : Cannot recv data: Connection reset by peer + 06:44:27 fedora virtqemud[991]: 1053: debug : qemuProcessKill:8811 : vm=0x7f71ac032670 name=virt-vm1 pid=805 flags=0x5 + +Now the log shows that we want to add VM log file message in +'qemuDomainLogAppendMessage' but it fails because virtlogd is dead +already. + +Now the same happens also with 'virtlockd' but with much worse outcome, +especially if the configured action is to save the VMs because shutdown +of 'virtlockd' when locks are held ends up 'fencing' the VMs by killing +them. + +The same also happens when libvirt-guests is used to shutdown the guests +instead. + +This patch adds an explicit 'After=virtlo[ck|g]d.service' to the daemons +containing the qemu driver to ensure that the shutdown ordering makes +sense. This doesn't break socket activation (e.g. the log/lock daemons +are not started unless first invoked). + +Signed-off-by: Peter Krempa +Reviewed-by: Jiri Denemark +(cherry picked from commit aa1bf13b9caa4ef893cd4fdbaa111d5da73aa120) +https://redhat.atlassian.net/browse/RHEL-180876 +--- + src/qemu/virtqemud.service.extra.in | 4 ++++ + src/remote/libvirtd.service.in | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/src/qemu/virtqemud.service.extra.in b/src/qemu/virtqemud.service.extra.in +index cc16b6a9bb..3cc2edcfd0 100644 +--- a/src/qemu/virtqemud.service.extra.in ++++ b/src/qemu/virtqemud.service.extra.in +@@ -6,6 +6,10 @@ Requires=virtlogd.socket + Wants=virtlockd.socket + After=virtlogd.socket + After=virtlockd.socket ++# To ensure that our helper daemons are not shut down before the main daemon ++# shuts down we need also explicit ordering with the .service unit ++After=virtlogd.service ++After=virtlock.service + Wants=systemd-machined.service + After=systemd-machined.service + After=remote-fs.target +diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in +index b0a062e885..f26494d646 100644 +--- a/src/remote/libvirtd.service.in ++++ b/src/remote/libvirtd.service.in +@@ -15,6 +15,10 @@ Requires=virtlogd.socket + Wants=virtlockd.socket + After=virtlogd.socket + After=virtlockd.socket ++# To ensure that our helper daemons are not shut down before the main daemon ++# shuts down we need also explicit ordering with the .service unit ++After=virtlogd.service ++After=virtlock.service + Wants=systemd-machined.service + After=network.target + After=dbus.service +-- +2.54.0 diff --git a/centos-9/SPECS/libvirt.spec b/centos-9/SPECS/libvirt.spec index 1150815..f0d7855 100644 --- a/centos-9/SPECS/libvirt.spec +++ b/centos-9/SPECS/libvirt.spec @@ -287,7 +287,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 11.10.0 -Release: 13%{?dist}%{?extra_release} +Release: 14%{?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/ @@ -414,6 +414,7 @@ Patch116: libvirt-Introduce-VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FE Patch117: libvirt-virsh-Add-supported-cpu-features-option-for-domcapabilities.patch Patch118: libvirt-domaincapstest-Test-SUPPORTED_CPU_FEATURES-flag.patch Patch119: libvirt-qemu_capabilities-Fix-domain-capabilities-on-AMD-CPUs.patch +Patch120: libvirt-qemu-Ensure-proper-shutdown-ordering-of-virtlockd-virtlogd-daemons.patch Requires: libvirt-daemon = %{version}-%{release} @@ -2805,6 +2806,10 @@ exit 0 %endif %changelog +* Wed Jul 1 2026 Jiri Denemark - 11.10.0-14 +- distro: Update URL in plans.fmf +- qemu: Ensure proper shutdown ordering of virtlockd/virtlogd daemons (RHEL-180876) + * Thu Jun 4 2026 Jiri Denemark - 11.10.0-13 - conf: Parse hyperv features even for host-model (RHEL-151688) - qemu: Wire up new hyperv host-model mode behavior (RHEL-151688)