mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2025-10-30 07:57:14 +08:00
tpm: Return QMP error when TPM is disabled in build
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
All of tpm.json is now 'if': 'defined(CONFIG_TPM)'.
- 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>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
committed by
Stefan Berger
parent
e542b71805
commit
caff255a54
@ -38,7 +38,6 @@ stub_ss.add(files('runstate-check.c'))
|
||||
stub_ss.add(files('sysbus.c'))
|
||||
stub_ss.add(files('target-get-monitor-def.c'))
|
||||
stub_ss.add(files('target-monitor-defs.c'))
|
||||
stub_ss.add(files('tpm.c'))
|
||||
stub_ss.add(files('trace-control.c'))
|
||||
stub_ss.add(files('uuid.c'))
|
||||
stub_ss.add(files('vmgenid.c'))
|
||||
|
||||
Reference in New Issue
Block a user