mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
tpm: Improve help on TPM types when none are available
Help is a bit awkward when no TPM types are built into QEMU:
$ qemu-system-x86_64 -tpmdev nonexistent,id=tpm0
qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
Supported TPM types (choose only one):
Improve to
qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
No TPM backend types are available
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
d64072c0ac
commit
5a6791c3d4
1 changed files with 9 additions and 4 deletions
13
tpm.c
13
tpm.c
|
|
@ -47,18 +47,23 @@ tpm_be_find_by_type(enum TpmType type)
|
||||||
*/
|
*/
|
||||||
static void tpm_display_backend_drivers(void)
|
static void tpm_display_backend_drivers(void)
|
||||||
{
|
{
|
||||||
|
bool got_one = false;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
fprintf(stderr, "Supported TPM types (choose only one):\n");
|
|
||||||
|
|
||||||
for (i = 0; i < TPM_TYPE__MAX; i++) {
|
for (i = 0; i < TPM_TYPE__MAX; i++) {
|
||||||
const TPMBackendClass *bc = tpm_be_find_by_type(i);
|
const TPMBackendClass *bc = tpm_be_find_by_type(i);
|
||||||
if (!bc) {
|
if (!bc) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%12s %s\n", TpmType_str(i), bc->desc);
|
if (!got_one) {
|
||||||
|
error_printf("Supported TPM types (choose only one):\n");
|
||||||
|
got_one = true;
|
||||||
|
}
|
||||||
|
error_printf("%12s %s\n", TpmType_str(i), bc->desc);
|
||||||
|
}
|
||||||
|
if (!got_one) {
|
||||||
|
error_printf("No TPM backend types are available\n");
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue