|
|
acda74 |
From d78fc22fb96e0050a419623bf27639c63624c998 Mon Sep 17 00:00:00 2001
|
|
|
acda74 |
Message-Id: <d78fc22fb96e0050a419623bf27639c63624c998@dist-git>
|
|
|
acda74 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
acda74 |
Date: Fri, 10 Feb 2023 09:47:05 +0100
|
|
|
acda74 |
Subject: [PATCH] qemu_extdevice: Do cleanup host only for
|
|
|
acda74 |
VIR_DOMAIN_TPM_TYPE_EMULATOR
|
|
|
acda74 |
MIME-Version: 1.0
|
|
|
acda74 |
Content-Type: text/plain; charset=UTF-8
|
|
|
acda74 |
Content-Transfer-Encoding: 8bit
|
|
|
acda74 |
|
|
|
acda74 |
We only set up host for VIR_DOMAIN_TPM_TYPE_EMULATOR and thus
|
|
|
acda74 |
similarly, we should do cleanup for the same type. This also
|
|
|
acda74 |
fixes a crasher, in which qemuTPMEmulatorCleanupHost() accesses
|
|
|
acda74 |
tpm->data.emulator.storagepath which is NULL for
|
|
|
acda74 |
VIR_DOMAIN_TPM_TYPE_EXTERNAL.
|
|
|
acda74 |
|
|
|
acda74 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2168762
|
|
|
acda74 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
acda74 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
acda74 |
(cherry picked from commit 03f76e577d66f8eea6aa7cc513e75026527b4cda)
|
|
|
acda74 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
acda74 |
---
|
|
|
acda74 |
src/qemu/qemu_extdevice.c | 5 ++++-
|
|
|
acda74 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
acda74 |
|
|
|
acda74 |
diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
|
|
|
acda74 |
index f7b2e2e653..fdefe59215 100644
|
|
|
acda74 |
--- a/src/qemu/qemu_extdevice.c
|
|
|
acda74 |
+++ b/src/qemu/qemu_extdevice.c
|
|
|
acda74 |
@@ -162,7 +162,10 @@ qemuExtDevicesCleanupHost(virQEMUDriver *driver,
|
|
|
acda74 |
return;
|
|
|
acda74 |
|
|
|
acda74 |
for (i = 0; i < def->ntpms; i++) {
|
|
|
acda74 |
- qemuExtTPMCleanupHost(def->tpms[i], flags, outgoingMigration);
|
|
|
acda74 |
+ virDomainTPMDef *tpm = def->tpms[i];
|
|
|
acda74 |
+
|
|
|
acda74 |
+ if (tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR)
|
|
|
acda74 |
+ qemuExtTPMCleanupHost(tpm, flags, outgoingMigration);
|
|
|
acda74 |
}
|
|
|
acda74 |
}
|
|
|
acda74 |
|
|
|
acda74 |
--
|
|
|
acda74 |
2.39.1
|
|
|
acda74 |
|