From nobody Sun Dec 22 01:52:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733224032015354.662326565282; Tue, 3 Dec 2024 03:07:12 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 8DAE116D9; Tue, 3 Dec 2024 06:07:10 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4CED3163F; Tue, 3 Dec 2024 06:06:51 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2F3C01614; Tue, 3 Dec 2024 06:06:48 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 99578161F for ; Tue, 3 Dec 2024 06:06:46 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-470-N7S47k_4P16_1YjZzsgm8w-1; Tue, 03 Dec 2024 06:06:44 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E6B8F195608B for ; Tue, 3 Dec 2024 11:06:43 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.53]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0823730000DF for ; Tue, 3 Dec 2024 11:06:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733224006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Co0mSjDdnLTOQwH5j/tqo6CtasNdn5+JtOIBzQnvkKI=; b=QZgEWZHSuaJ9CIpGhsCHYZWRrOdeHag6ISH8wN5m+rLd9aDch345QsQvm2cc09XRtUgyuG uCAD8RRMeLQia/lK0RDzf+2XgW5Rr3Z+cNo0c8Jvukpe64AmtxkZKMZqbWJcoaCxUw6PMk l6izBcfTze/Mb2nC8NandMQhmaFM6Lo= X-MC-Unique: N7S47k_4P16_1YjZzsgm8w-1 X-Mimecast-MFC-AGG-ID: N7S47k_4P16_1YjZzsgm8w From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: devel@lists.libvirt.org Subject: [libvirt PATCH] qemu: tpm: do not update profile name for transient domains Date: Tue, 3 Dec 2024 12:06:37 +0100 Message-ID: <013326497bc29235ee43fe7619c2d6a6e9a89841.1733223997.git.jtomko@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fA-CKJ6bZWDH0vx6Q9MEcPJaO5LNY2mLILRJ2OnL7u8_1733224004 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DJTK2USYNVU5OI5M5W6EKSLHDQPV4BIZ X-Message-ID-Hash: DJTK2USYNVU5OI5M5W6EKSLHDQPV4BIZ X-MailFrom: jtomko@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1733224033602116600 Content-Type: text/plain; charset="utf-8" If we do not have a persistent definition, there's no point in looking for it since we cannot store it. This fixes the crash when starting a transient domain. https://issues.redhat.com/browse/RHEL-69774 Fixes: d79542eec669eb9c449bb8228179e7a87e768017 Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_extdevice.c | 5 ++++- src/qemu/qemu_tpm.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index a6f31f9773..d4b6e11e0b 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -190,7 +190,10 @@ qemuExtDevicesStart(virQEMUDriver *driver, =20 for (i =3D 0; i < def->ntpms; i++) { virDomainTPMDef *tpm =3D def->tpms[i]; - virDomainTPMDef *persistentTPMDef =3D persistentDef->tpms[i]; + virDomainTPMDef *persistentTPMDef =3D NULL; + + if (persistentDef) + persistentTPMDef =3D persistentDef->tpms[i]; =20 if (tpm->type =3D=3D 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; =20 - if (run_setup && !incomingMigration && + if (run_setup && !incomingMigration && persistentTPMDef && qemuTPMEmulatorUpdateProfileName(&tpm->data.emulator, persistentTP= MDef, cfg, saveDef) < 0) goto error; --=20 2.47.0