diff --git a/libvirt.spec b/libvirt.spec index 8a7e31645983adb34ce63c57653eaf09d1e52587..d7f59e7296afcde1a95043c9a0c4d606e50fa7a9 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -101,7 +101,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.2.0 -Release: 55 +Release: 56 License: LGPLv2+ URL: https://libvirt.org/ @@ -478,6 +478,8 @@ Patch0365: backport-meson-drop-debug_logs-configure-argument.patch Patch0366: backport-vshCommandStringGetArg-Drop-sz.patch Patch0367: bugfix-fix-warnings-found-by-clang.patch Patch0368: Fix-potential-crash-during-driver-cleanup.patch +Patch0369: nodedev-ignore-EINVAL-from-libudev-in-udevEventHandl.patch +Patch0370: qemu-tpm-Pass-logfile-to-swtpm_setup-for-incoming-mi.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2214,6 +2216,10 @@ exit 0 %changelog +* Sun May 21 2023 XuFei - 6.2.0-56 +- nodedev: ignore EINVAL from libudev in udevEventHandleThread +- qemu: tpm: Pass --logfile to swtpm_setup for incoming migration + * Tue Apr 25 2023 tianyuan - 6.2.0-55 - bugfix: Fix potential crash during driver cleanup diff --git a/nodedev-ignore-EINVAL-from-libudev-in-udevEventHandl.patch b/nodedev-ignore-EINVAL-from-libudev-in-udevEventHandl.patch new file mode 100644 index 0000000000000000000000000000000000000000..624612a0595f0b049489465a710abaf2b15ce4d5 --- /dev/null +++ b/nodedev-ignore-EINVAL-from-libudev-in-udevEventHandl.patch @@ -0,0 +1,53 @@ +From c8f5445399e057a8974a77a882be502dba605301 Mon Sep 17 00:00:00 2001 +From: Christian Ehrhardt +Date: Thu, 10 Nov 2022 10:36:28 +0100 +Subject: [PATCH] nodedev: ignore EINVAL from libudev in udevEventHandleThread +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Certain udev entries might be of a size that makes libudev emit EINVAL +which right now leads to udevEventHandleThread exiting. Due to no more +handling events other elements of libvirt will start pushing for events +to be consumed which never happens causing a busy loop burning a cpu +without any gain. + +After evaluation of the example case discussed in in #245 and a test +run ignoring EINVAL it was considered safe to add EINVAL to the ignored +errnos to not exit udevEventHandleThread giving it more resilience. + +The root cause is in systemd and by now was discussed and fixed via +https://github.com/systemd/systemd/issues/24987, but hardening libvirt +to be able to better deal with EINVAL returned still is the right thing +to avoid the reported busy loops on systemd with older systemd versions. + +Fixes: https://gitlab.com/libvirt/libvirt/-/issues/245 + +Signed-off-by: Christian Ehrhardt +Reviewed-by: Daniel P. Berrangé +--- + src/node_device/node_device_udev.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c +index a674380f19..0d8a7db5c6 100644 +--- a/src/node_device/node_device_udev.c ++++ b/src/node_device/node_device_udev.c +@@ -1594,10 +1594,12 @@ udevEventHandleThread(void *opaque G_GNUC_UNUSED) + } + + /* POSIX allows both EAGAIN and EWOULDBLOCK to be used +- * interchangeably when the read would block or timeout was fired ++ * interchangeably when the read would block or timeout was fired. ++ * EINVAL might happen on too large udev entries, ignore those for ++ * the robustness of udevEventHandleThread. + */ + VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR +- if (errno != EAGAIN && errno != EWOULDBLOCK) { ++ if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINVAL) { + VIR_WARNINGS_RESET + virReportSystemError(errno, "%s", + _("failed to receive device from udev " +-- +2.25.1 + diff --git a/qemu-tpm-Pass-logfile-to-swtpm_setup-for-incoming-mi.patch b/qemu-tpm-Pass-logfile-to-swtpm_setup-for-incoming-mi.patch new file mode 100644 index 0000000000000000000000000000000000000000..8bd6453aec295b154ed8900eb4eac39476676ea9 --- /dev/null +++ b/qemu-tpm-Pass-logfile-to-swtpm_setup-for-incoming-mi.patch @@ -0,0 +1,33 @@ +From 92e7bc7ac09d5e62f7ff612be3f2e07beb86e67d Mon Sep 17 00:00:00 2001 +From: qihao +Date: Wed, 15 Mar 2023 10:56:44 +0800 +Subject: [PATCH] qemu: tpm: Pass --logfile to swtpm_setup for incoming + migration + +cheery-pick from cc21979fae736768db92d0c060ea732ed857327e + +Good to have for debugging in case something wrong happens during +incoming migration. + +Signed-off-by: Eiichi Tsukata +Signed-off-by: qihao_yewu +Reviewed-by: Michal Privoznik +--- + src/qemu/qemu_tpm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c +index 601d5cf4e9..5d783f2afc 100644 +--- a/src/qemu/qemu_tpm.c ++++ b/src/qemu/qemu_tpm.c +@@ -505,6 +505,7 @@ qemuTPMEmulatorRunSetup(const char *storagepath, + } else { + virCommandAddArgList(cmd, + "--tpm-state", storagepath, ++ "--logfile", logfile, + "--overwrite", + NULL); + } +-- +2.25.1 +