qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qmp: Include 'abstract' field on 'qom-list-types' output
Date: Fri, 26 May 2017 15:51:53 -0500	[thread overview]
Message-ID: <1bf0456a-f9d1-1e9a-dcd4-ca9b3569b567@redhat.com> (raw)
In-Reply-To: <20170526202316.22736-3-ehabkost@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]

On 05/26/2017 03:23 PM, Eduardo Habkost wrote:
> A client may be interested in getting the list of both abstract and
> non-abstract types.  Instead of requiring them to make multiple queries
> with different filter arguments, just return an 'abstract' field in
> 'qom-list-types'.
> 
> In addition to the new test code for validating this field, update the
> abstract-interfaces test case to query for all 'interface' subtypes
> (including abstract ones), and to look at the 'abstract' field directly.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---

> +++ b/qapi-schema.json
> @@ -3056,12 +3056,15 @@
>  #
>  # @name: the type name found in the search
>  #
> +# @abstract: the type is abstract and can't be directly instantiated.
> +#            Omitted if false. (since 2.10)
> +#

A little bit awkward in that libvirt will have to see if ANY entry in
the large returned result has "abstract":true before it can assume
"abstract":false on the remaining entries (that is, older qemu don't
output abstract ever, but still mentions abstract types, so blindly
writing code to assume absence of "abstract" means false breaks on those
older versions).  Or a query of introspection to see if the field name
is even supported would do.  Not insurmountable, though.

>  # Since: 1.1
>  #
>  # Notes: This command is experimental and may change syntax in future releases.

Is this note still helpful, or should we delete it now?

>  ##
>  { 'struct': 'ObjectTypeInfo',
> -  'data': { 'name': 'str' } }
> +  'data': { 'name': 'str', '*abstract': 'bool' } }

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2017-05-26 20:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 20:23 [Qemu-devel] [PATCH v2 0/3] qmp: Return extra information on qom-list-types Eduardo Habkost
2017-05-26 20:23 ` [Qemu-devel] [PATCH v2 1/3] tests: Simplify abstract-interfaces check with a helper Eduardo Habkost
2017-05-26 20:35   ` Eric Blake
2017-05-26 20:23 ` [Qemu-devel] [PATCH v2 2/3] qmp: Include 'abstract' field on 'qom-list-types' output Eduardo Habkost
2017-05-26 20:51   ` Eric Blake [this message]
2017-05-26 21:09     ` Eduardo Habkost
2017-05-26 20:23 ` [Qemu-devel] [PATCH v2 3/3] qmp: Include parent type " Eduardo Habkost
2017-05-26 20:53   ` Eric Blake

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=1bf0456a-f9d1-1e9a-dcd4-ca9b3569b567@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).