From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@gmail.com>,
QEMU <qemu-devel@nongnu.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>
Subject: Re: [PATCH] tpm: Return QMP error when TPM is disabled in build
Date: Wed, 9 Jun 2021 19:46:28 +0200 [thread overview]
Message-ID: <1a6d1dd1-b7d4-cde4-3141-ad9c202d6c0e@redhat.com> (raw)
In-Reply-To: <YMD8IaJKTHJwp+io@redhat.com>
On 6/9/21 7:36 PM, Daniel P. Berrangé wrote:
> On Wed, Jun 09, 2021 at 07:34:32PM +0200, Philippe Mathieu-Daudé wrote:
>> 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?
>
> That's fairly typical of what we'd expect to see from a feature
> which is either removed at compile time, or never existed in the first
> place. mgmt apps don't really need to distinguish those two scenarios,
> so this is fine.
Thank you!
next prev parent reply other threads:[~2021-06-09 17:47 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é
2021-06-09 17:36 ` Daniel P. Berrangé
2021-06-09 17:46 ` Philippe Mathieu-Daudé [this message]
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=1a6d1dd1-b7d4-cde4-3141-ad9c202d6c0e@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@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).