[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/5] tpm: Return QMP error when TPM is disabled in build
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v3 5/5] tpm: Return QMP error when TPM is disabled in build |
Date: |
Mon, 14 Jun 2021 22:12:08 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 6/14/21 10:09 PM, Philippe Mathieu-Daudé wrote:
> When the management layer queries a binary built using --disable-tpm
> for TPM devices, it gets confused by getting empty responses:
>
> { "execute": "query-tpm" }
> {
> "return": [
> ]
> }
> { "execute": "query-tpm-types" }
> {
> "return": [
> ]
> }
> { "execute": "query-tpm-models" }
> {
> "return": [
> ]
> }
>
> To make it clearer by returning an error:
> - Make the TPM QAPI schema conditional
> - Adapt the HMP command
> - Remove stubs which became unnecessary
>
> The management layer now gets a 'CommandNotFound' error:
>
> { "execute": "query-tpm" }
> {
> "error": {
> "class": "CommandNotFound",
> "desc": "The command query-tpm has not been found"
> }
> }
>
> Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> qapi/tpm.json | 28 +++++++++++++++++++---------
> monitor/hmp-cmds.c | 4 ++++
> stubs/tpm.c | 25 -------------------------
> stubs/meson.build | 1 -
> 4 files changed, 23 insertions(+), 35 deletions(-)
> delete mode 100644 stubs/tpm.c
Grrrr I forgot to commit:
-- >8 --
diff --git a/MAINTAINERS b/MAINTAINERS
index 7d9cd290426..636bf2f5365 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2707,7 +2707,6 @@ TPM
M: Stefan Berger <stefanb@linux.ibm.com>
S: Maintained
F: tpm.c
-F: stubs/tpm.c
F: hw/tpm/*
F: include/hw/acpi/tpm.h
F: include/sysemu/tpm*
---
- [PATCH v3 0/5] tpm: Eliminate TPM related code if CONFIG_TPM is not set, Philippe Mathieu-Daudé, 2021/06/14
- [PATCH v3 1/5] i386: Eliminate all TPM related code if CONFIG_TPM is not set, Philippe Mathieu-Daudé, 2021/06/14
- [PATCH v3 2/5] arm: Eliminate all TPM related code if CONFIG_TPM is not set, Philippe Mathieu-Daudé, 2021/06/14
- [PATCH v3 3/5] acpi: Eliminate all TPM related code if CONFIG_TPM is not set, Philippe Mathieu-Daudé, 2021/06/14
- [PATCH v3 4/5] sysemu: Make TPM structures inaccessible if CONFIG_TPM is not defined, Philippe Mathieu-Daudé, 2021/06/14
- [PATCH v3 5/5] tpm: Return QMP error when TPM is disabled in build, Philippe Mathieu-Daudé, 2021/06/14
- Re: [PATCH v3 5/5] tpm: Return QMP error when TPM is disabled in build,
Philippe Mathieu-Daudé <=
- Re: [PATCH v3 5/5] tpm: Return QMP error when TPM is disabled in build, Markus Armbruster, 2021/06/15