From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@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 18:36:33 +0100 [thread overview]
Message-ID: <YMD8IaJKTHJwp+io@redhat.com> (raw)
In-Reply-To: <d73d226b-557e-d619-10ba-e547fc51ad9d@redhat.com>
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.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-06-09 17:37 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é [this message]
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=YMD8IaJKTHJwp+io@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@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).