From nobody Mon Apr 29 21:36:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676019239; cv=none; d=zohomail.com; s=zohoarc; b=ch2SN9/VJaU6GiLH9nNaxoThyOA+D5s2s/CSetMyPh3MPZiHcGxuBudlGsP1pxFzqWz5WKptsJjvnpu3DngjZOpfE/8W4bOuOK5yzYh1TspgXqrjpfKiEj0R5NhkZiWys9TQ4uxp1kx4Kq0TrRqRdZ56gcwGHs6ixXxCP+xIh6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676019239; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cvwiAWpgqN1KfPOF9ef84Iu49zzL7yNkLOwdkNxs11o=; b=HSXYgtehcJTQR4yT0m/QqyRYNpXCI/MSCLHWOFoKHN2qIQabrkwf/qhFJ6UmcmocpqpGTs4MSB65p5YXfAucGM7fE2OSQ9inxUQ+r4KZkFWj+BQ8kdyQeRh/RGQ1qA023WEcSAb4xk4PxvqwDSeLD8oKvAfFSfFrRRJbqvuV4v0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1676019239028332.1793276552619; Fri, 10 Feb 2023 00:53:59 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-412-DKj6XhFOOlKxRYyxtbR9sw-1; Fri, 10 Feb 2023 03:53:54 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B988C85CBE5; Fri, 10 Feb 2023 08:53:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48D9F1121315; Fri, 10 Feb 2023 08:53:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 272DA1946594; Fri, 10 Feb 2023 08:53:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 785D4194658F for ; Fri, 10 Feb 2023 08:53:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6AD05C16023; Fri, 10 Feb 2023 08:53:51 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12B26C16022 for ; Fri, 10 Feb 2023 08:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676019237; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cvwiAWpgqN1KfPOF9ef84Iu49zzL7yNkLOwdkNxs11o=; b=EORMC6xgCg14K4sI11opZvBxXmSZe4fFbity8qEs844n0gMIUQDSj/PDE9nKVCpxy6gE35 3Y6/CDU5eUETc66LSBT4sO/UdGRjjV+hX3ECMO/q7v+zla4mU4BZIrsdTl0NCXMv0++BbU qBxV00ETBaT+L62HS7N6A0KKcjPwFYA= X-MC-Unique: DKj6XhFOOlKxRYyxtbR9sw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_extdevice: Do cleanup host only for VIR_DOMAIN_TPM_TYPE_EMULATOR Date: Fri, 10 Feb 2023 09:53:48 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676019239572100001 Content-Type: text/plain; charset="utf-8"; x-default="true" We only set up host for VIR_DOMAIN_TPM_TYPE_EMULATOR and thus similarly, we should do cleanup for the same type. This also fixes a crasher, in which qemuTPMEmulatorCleanupHost() accesses tpm->data.emulator.storagepath which is NULL for VIR_DOMAIN_TPM_TYPE_EXTERNAL. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2168762 Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_extdevice.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index f7b2e2e653..fdefe59215 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -162,7 +162,10 @@ qemuExtDevicesCleanupHost(virQEMUDriver *driver, return; =20 for (i =3D 0; i < def->ntpms; i++) { - qemuExtTPMCleanupHost(def->tpms[i], flags, outgoingMigration); + virDomainTPMDef *tpm =3D def->tpms[i]; + + if (tpm->type =3D=3D VIR_DOMAIN_TPM_TYPE_EMULATOR) + qemuExtTPMCleanupHost(tpm, flags, outgoingMigration); } } =20 --=20 2.39.1