|
|
a1c947 |
From b3d2dae261768c00b5d92203351ff6dd7cde468e Mon Sep 17 00:00:00 2001
|
|
|
a1c947 |
Message-Id: <b3d2dae261768c00b5d92203351ff6dd7cde468e@dist-git>
|
|
|
a1c947 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
a1c947 |
Date: Tue, 12 Jul 2022 15:58:17 +0200
|
|
|
a1c947 |
Subject: [PATCH] qemu: Report supported TPM version in domcaps
|
|
|
a1c947 |
|
|
|
a1c947 |
Now that we have everything prepared, we can start detecting
|
|
|
a1c947 |
supported TPM versions and setting corresponding values in
|
|
|
a1c947 |
backendModel struct.
|
|
|
a1c947 |
|
|
|
a1c947 |
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/340
|
|
|
a1c947 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103119
|
|
|
a1c947 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
a1c947 |
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
a1c947 |
(cherry picked from commit 430ab88ab17727ac9774ee5b47f09f69c57add73)
|
|
|
a1c947 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
a1c947 |
---
|
|
|
a1c947 |
src/qemu/qemu_capabilities.c | 15 ++++++++++++---
|
|
|
a1c947 |
1 file changed, 12 insertions(+), 3 deletions(-)
|
|
|
a1c947 |
|
|
|
a1c947 |
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
|
|
a1c947 |
index 2c3be3ecec..8586930266 100644
|
|
|
a1c947 |
--- a/src/qemu/qemu_capabilities.c
|
|
|
a1c947 |
+++ b/src/qemu/qemu_capabilities.c
|
|
|
a1c947 |
@@ -6368,9 +6368,18 @@ virQEMUCapsFillDomainDeviceTPMCaps(virQEMUCaps *qemuCaps,
|
|
|
a1c947 |
|
|
|
a1c947 |
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_PASSTHROUGH))
|
|
|
a1c947 |
VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_PASSTHROUGH);
|
|
|
a1c947 |
- if (virTPMHasSwtpm() &&
|
|
|
a1c947 |
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_EMULATOR))
|
|
|
a1c947 |
- VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_EMULATOR);
|
|
|
a1c947 |
+ if (virTPMHasSwtpm()) {
|
|
|
a1c947 |
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_EMULATOR))
|
|
|
a1c947 |
+ VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_EMULATOR);
|
|
|
a1c947 |
+ if (virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2)) {
|
|
|
a1c947 |
+ VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendVersion, VIR_DOMAIN_TPM_VERSION_1_2);
|
|
|
a1c947 |
+ tpm->backendVersion.report = true;
|
|
|
a1c947 |
+ }
|
|
|
a1c947 |
+ if (virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0)) {
|
|
|
a1c947 |
+ VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendVersion, VIR_DOMAIN_TPM_VERSION_2_0);
|
|
|
a1c947 |
+ tpm->backendVersion.report = true;
|
|
|
a1c947 |
+ }
|
|
|
a1c947 |
+ }
|
|
|
a1c947 |
|
|
|
a1c947 |
/*
|
|
|
a1c947 |
* Need at least one frontend if it is to be usable by applications
|
|
|
a1c947 |
--
|
|
|
a1c947 |
2.35.1
|
|
|
a1c947 |
|