qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	QEMU <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH] tpm: Return QMP error when TPM is disabled in build
Date: Wed, 9 Jun 2021 19:34:32 +0200	[thread overview]
Message-ID: <d73d226b-557e-d619-10ba-e547fc51ad9d@redhat.com> (raw)
In-Reply-To: <2ebcd286-cc73-e8da-53ef-2424419822ff@redhat.com>

On 6/9/21 7:27 PM, Philippe Mathieu-Daudé wrote:
> On 6/9/21 6:01 PM, Marc-André Lureau wrote:
>> Hi
>>
>> On Wed, Jun 9, 2021 at 7:33 PM Philippe Mathieu-Daudé <philmd@redhat.com
>> <mailto:philmd@redhat.com>> 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": [
>>           ]
>>       }
>>
>>     Make it clearer by returning an error, mentioning the feature is
>>     disabled:
>>
>>       { "execute": "query-tpm" }
>>       {
>>           "error": {
>>               "class": "GenericError",
>>               "desc": "this feature or command is not currently supported"
>>           }
>>       }
>>
>>     Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com
>>     <mailto:philmd@redhat.com>>
>>
>>
>> Why not make the qapi schema conditional?

Using your suggestion (and ignoring QAPI marshaling error) I'm getting:

{ "execute": "query-tpm" }
{
    "error": {
        "class": "CommandNotFound",
        "desc": "The command query-tpm has not been found"
    }
}

Is that OK from a management perspective?



  reply	other threads:[~2021-06-09 17:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 15:25 [PATCH] tpm: Return QMP error when TPM is disabled in build Philippe Mathieu-Daudé
2021-06-09 16:01 ` Marc-André Lureau
2021-06-09 17:27   ` Philippe Mathieu-Daudé
2021-06-09 17:34     ` Philippe Mathieu-Daudé [this message]
2021-06-09 17:36       ` Daniel P. Berrangé
2021-06-09 17:46         ` Philippe Mathieu-Daudé
2021-06-10  9:15         ` 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=d73d226b-557e-d619-10ba-e547fc51ad9d@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.vnet.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).