From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 39A331580FD for ; Thu, 26 Dec 2024 11:13:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 71EBBE0821; Thu, 26 Dec 2024 11:13:34 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 54CD3E0821 for ; Thu, 26 Dec 2024 11:13:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 510A4335DC7 for ; Thu, 26 Dec 2024 11:13:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AFD4D1048 for ; Thu, 26 Dec 2024 11:13:31 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1735211587.71efa13d1596686c6417a38427a7c347c235c85f.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/files/, app-emulation/libvirt/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-emulation/libvirt/files/libvirt-10.10.0-qemu-tpm-do-not-update-profile-name-for-transient-do.patch app-emulation/libvirt/libvirt-10.10.0-r1.ebuild app-emulation/libvirt/libvirt-10.10.0.ebuild X-VCS-Directories: app-emulation/libvirt/ app-emulation/libvirt/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 71efa13d1596686c6417a38427a7c347c235c85f X-VCS-Branch: master Date: Thu, 26 Dec 2024 11:13:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7f5d35d1-a38f-4f35-9334-82acfdf07c6f X-Archives-Hash: ecf1fd5ff116282474113a257d277113 commit: 71efa13d1596686c6417a38427a7c347c235c85f Author: Michal Privoznik gmail com> AuthorDate: Thu Dec 26 11:02:04 2024 +0000 Commit: Sam James gentoo org> CommitDate: Thu Dec 26 11:13:07 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71efa13d app-emulation/libvirt: Backport a TPM related crasher When installing a VM, it may happen that layered tools like virt-install will add TPM to domain definition (some guests like Windows 11 require it). But in libvirt-10.10.0 there is a crasher and those layered tools tickle it. Backport a fix from upstream. Closes: https://bugs.gentoo.org/946930 Signed-off-by: Michal Privoznik gmail.com> Closes: https://github.com/gentoo/gentoo/pull/39845 Signed-off-by: Sam James gentoo.org> ...-not-update-profile-name-for-transient-do.patch | 70 ++++++++++++++++++++++ ...rt-10.10.0.ebuild => libvirt-10.10.0-r1.ebuild} | 1 + 2 files changed, 71 insertions(+) diff --git a/app-emulation/libvirt/files/libvirt-10.10.0-qemu-tpm-do-not-update-profile-name-for-transient-do.patch b/app-emulation/libvirt/files/libvirt-10.10.0-qemu-tpm-do-not-update-profile-name-for-transient-do.patch new file mode 100644 index 000000000000..e3289651f332 --- /dev/null +++ b/app-emulation/libvirt/files/libvirt-10.10.0-qemu-tpm-do-not-update-profile-name-for-transient-do.patch @@ -0,0 +1,70 @@ +From 81da7a2c2a2d490cddaaa77d3e3b36e210b38bd7 Mon Sep 17 00:00:00 2001 +Message-ID: <81da7a2c2a2d490cddaaa77d3e3b36e210b38bd7.1735210585.git.mprivozn@redhat.com> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Tue, 3 Dec 2024 12:00:08 +0100 +Subject: [PATCH] qemu: tpm: do not update profile name for transient domains +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If we do not have a persistent definition, there's no point in +looking for it since we cannot store it. + +Also skip the update if the tpm device(s) in the persistent +definition are different. + +This fixes the crash when starting a transient domain. + +https://issues.redhat.com/browse/RHEL-69774 +https://gitlab.com/libvirt/libvirt/-/issues/715 + +Fixes: d79542eec669eb9c449bb8228179e7a87e768017 +Signed-off-by: Ján Tomko +Reviewed-by: Jiri Denemark +Reviewed-by: Stefan Berger +Signed-off-by: Michal Privoznik +--- + src/qemu/qemu_extdevice.c | 13 ++++++++++++- + src/qemu/qemu_tpm.c | 2 +- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c +index a6f31f9773..954cb323a4 100644 +--- a/src/qemu/qemu_extdevice.c ++++ b/src/qemu/qemu_extdevice.c +@@ -190,7 +190,18 @@ qemuExtDevicesStart(virQEMUDriver *driver, + + for (i = 0; i < def->ntpms; i++) { + virDomainTPMDef *tpm = def->tpms[i]; +- virDomainTPMDef *persistentTPMDef = persistentDef->tpms[i]; ++ virDomainTPMDef *persistentTPMDef = NULL; ++ ++ if (persistentDef) { ++ /* do not try to update the profile in the persistent definition ++ * if the device does not match */ ++ if (persistentDef->ntpms == def->ntpms) ++ persistentTPMDef = persistentDef->tpms[i]; ++ if (persistentTPMDef && ++ (persistentTPMDef->type != tpm->type || ++ persistentTPMDef->model != tpm->model)) ++ persistentTPMDef = NULL; ++ } + + if (tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR && + qemuExtTPMStart(driver, vm, tpm, persistentTPMDef, +diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c +index f223dcb9ae..f5e0184e54 100644 +--- a/src/qemu/qemu_tpm.c ++++ b/src/qemu/qemu_tpm.c +@@ -773,7 +773,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm, + incomingMigration) < 0) + goto error; + +- if (run_setup && !incomingMigration && ++ if (run_setup && !incomingMigration && persistentTPMDef && + qemuTPMEmulatorUpdateProfileName(&tpm->data.emulator, persistentTPMDef, + cfg, saveDef) < 0) + goto error; +-- +2.45.2 + diff --git a/app-emulation/libvirt/libvirt-10.10.0.ebuild b/app-emulation/libvirt/libvirt-10.10.0-r1.ebuild similarity index 99% rename from app-emulation/libvirt/libvirt-10.10.0.ebuild rename to app-emulation/libvirt/libvirt-10.10.0-r1.ebuild index d87fbdaace17..39ba18558c54 100644 --- a/app-emulation/libvirt/libvirt-10.10.0.ebuild +++ b/app-emulation/libvirt/libvirt-10.10.0-r1.ebuild @@ -159,6 +159,7 @@ PATCHES=( "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch "${FILESDIR}"/${PN}-10.7.0-fix-paths-for-apparmor.patch + "${FILESDIR}"/${PN}-10.10.0-qemu-tpm-do-not-update-profile-name-for-transient-do.patch ) python_check_deps() {