[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH-for-5.1 2/2] tpm: List the available TPM backends
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [RFC PATCH-for-5.1 2/2] tpm: List the available TPM backends |
Date: |
Thu, 23 Jul 2020 12:34:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 7/22/20 11:44 PM, Stefan Berger wrote:
> On 7/22/20 7:23 AM, Philippe Mathieu-Daudé wrote:
>> When an incorrect backend is selected, tpm_display_backend_drivers()
>> is supposed to list the available backends. However the error is
>> directly propagated, and we never display the list. The user only
>> gets "Parameter 'type' expects a TPM backend type" error.
>>
>> Convert the fprintf(stderr,) calls to error hints propagated with
>> the error.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> RFC because this is now odd in tpm_config_parse():
>
> because it's not using the fprintf anymore ?
>
>
Because when using &error_fatal you don't return:
if (!strcmp(optarg, "help")) {
tpm_list_backend_drivers_hint(&error_fatal);
/* not reached */
return -1;
}
I should probably use that instead:
if (!strcmp(optarg, "help")) {
tpm_list_backend_drivers_hint(&error_fatal);
g_assert_not_reached();
}