mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-26 13:22:20 +00:00
qemu: Report supported TPM version in domcaps
Now that we have everything prepared, we can start detecting supported TPM versions and setting corresponding values in backendModel struct. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/340 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103119 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
1277a9c884
commit
430ab88ab1
@ -6368,9 +6368,18 @@ virQEMUCapsFillDomainDeviceTPMCaps(virQEMUCaps *qemuCaps,
|
||||
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_PASSTHROUGH))
|
||||
VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_PASSTHROUGH);
|
||||
if (virTPMHasSwtpm() &&
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_EMULATOR))
|
||||
if (virTPMHasSwtpm()) {
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_TPM_EMULATOR))
|
||||
VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendModel, VIR_DOMAIN_TPM_TYPE_EMULATOR);
|
||||
if (virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2)) {
|
||||
VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendVersion, VIR_DOMAIN_TPM_VERSION_1_2);
|
||||
tpm->backendVersion.report = true;
|
||||
}
|
||||
if (virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0)) {
|
||||
VIR_DOMAIN_CAPS_ENUM_SET(tpm->backendVersion, VIR_DOMAIN_TPM_VERSION_2_0);
|
||||
tpm->backendVersion.report = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Need at least one frontend if it is to be usable by applications
|
||||
|
Loading…
x
Reference in New Issue
Block a user