qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Stefan Berger <stefanb@linux.ibm.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: [RFC PATCH-for-5.1 2/2] tpm: List the available TPM backends
Date: Thu, 23 Jul 2020 12:34:55 +0200	[thread overview]
Message-ID: <d64b2965-310d-cf81-ce76-103c117d65b7@redhat.com> (raw)
In-Reply-To: <25d572a7-d899-fb61-f39e-547e36c8f920@linux.ibm.com>

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();
    }



  reply	other threads:[~2020-07-23 10:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 11:23 [PATCH-for-5.1 0/2] tpm: Improve error reporting Philippe Mathieu-Daudé
2020-07-22 11:23 ` [PATCH-for-5.1 1/2] tpm: Display when no backend is available Philippe Mathieu-Daudé
2020-07-22 14:57   ` Stefan Berger
2020-07-23 10:40   ` Markus Armbruster
2020-07-22 11:23 ` [RFC PATCH-for-5.1 2/2] tpm: List the available TPM backends Philippe Mathieu-Daudé
2020-07-22 21:44   ` Stefan Berger
2020-07-23 10:34     ` Philippe Mathieu-Daudé [this message]
2020-07-23 10:59   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d64b2965-310d-cf81-ce76-103c117d65b7@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).