From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org
Cc: kwolf@redhat.com, berto@igalia.com
Subject: Re: [Qemu-devel] [PATCH RFC v3 30/32] qapi: New QMP command query-schema for QMP schema introspection
Date: Tue, 01 Sep 2015 15:23:48 -0500 [thread overview]
Message-ID: <20150901202348.18566.60300@loki> (raw)
In-Reply-To: <55E5F898.6040304@redhat.com>
Quoting Eric Blake (2015-09-01 14:12:24)
> On 09/01/2015 12:40 PM, Michael Roth wrote:
> > Quoting Markus Armbruster (2015-08-04 10:58:14)
> >> Caution, rough edges.
> >>
> >> qapi/introspect.json defines the introspection schema. It should do
> >> for uses other than QMP.
> >> FIXME it's almost entirely devoid of comments.
> >>
> >> The introspection schema does not reflect all the rules and
> >> restrictions that apply to QAPI schemata. A valid QAPI schema has an
> >> introspection value conforming to the introspection schema, but the
> >> converse is not true.
> >>
> >> Introspection lowers away a number of schema details:
> >>
> >> * The built-in types are declared with their JSON type.
> >>
> >> TODO Should we map all the integer types to just int?
> >
> > I don't think we should. If management chooses to handle them in this
> > generic fashion that's their perogative/problem, but treating all ints
> > as a single generic type can lead to unexpected results when those values
> > get passed on to functions expecting, for instance, uint8_t. So QEMU
> > should do its part to convey this information somehow.
>
> The argument here is that it is always more conservative to start with
> less information, where we can later add more information (whether in
> the form of type constraints such as uint8_t, or in a different form
> such as min/max values) if they prove useful. And QMP already
> guarantees that it gives sane error messages for parameters that are out
> of range, so the worst behavior a client might see is that a parameter
> claiming to be 'int' in the introspection gracefully rejects an attempt
> to use '256' as a value because the underlying type was uint8_t.
That's true for many cases, but a 255 uint8_t value being passed in as
a int8_t could still cause unexpected results, for instance.
>
> If we advertise full types now, then the choice of integer type becomes
> ABI (switching from 'int8_t' to 'uint8_t' has observable impact in the
> introspection) that we are stuck exposing in introspection forever. And
> in the past, we have successfully retyped a command with no change to
> the wire API (see commit 5fba6c0).
Some changes can be deemed 'compatible' on a case-by-case, such as with
the above, but those changes are were still documented/published through
the schema.
Why should an introspection interface not convey the same specificity of
information as our schema? It seems inconsistent.
If we do things this way it almost seems like we'd need a disclaimer of
the form "please reference QAPI schema for details on acceptable
integer ranges" in the introspection interface documentation. Which
honestly doesn't seem like that bad an approach if we're up front
about it and unsure how
Though, if it happens too often, I could see that being a pain for
management, but the changes are there and in effect as far as QEMU is
concerned, regardless of whether or not the wire protocol is more
generic with how it represents types. We should document QAPI: JSON
RPC is just a transport that could theoretically get swapped
out for different wire protocol if some need arose in the future.
>
> At any rate, patch 31/32 in this series gives stronger arguments for
> merging the types for at least the initial implementation; we can always
> change our minds later and undo the merging, even if it is after 2.5
> when we change our minds.
31/32 makes a good point about fixed-width types not being all that
appropriate for introspection. I suppose you could consider them a QAPI
shorthand for max/min ranges, but I still think that information should
be conveyed at least in that basic form.
If we have some concern that this would end up being a mistake in the
future, we could possibly introduce it as an optional hint for integer
types. Unfortunately, either way that would complicate the format
somewhat...
>
> But the mere fact that you are questioning the idea means that patch 30
> and 31 should not be merged (previously, I had argued that separating
> the patches didn't make sense; I don't know if Markus was planning to
> merge the two based on my recommendation), if only so that reverting the
> type merging becomes an easier task if we decide down the road that we
> don't need the merged types.
I guess another alternative would be to proceed as things are and just
be clear about the lack of some bits of detail like valid integer
ranges. Would still make introspection useful for discovering the
presence and general types of fields, with the schema serving as
the primary reference for how clients should be implemented.
Not sure if that sort of separation of scope was the initial plan or
not.
>
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
next prev parent reply other threads:[~2015-09-01 20:24 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 15:57 [Qemu-devel] [PATCH RFC v3 00/32] qapi: QMP introspection Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 01/32] qapi: Rename class QAPISchema to QAPISchemaParser Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 02/32] qapi: New QAPISchema intermediate reperesentation Markus Armbruster
2015-08-04 21:53 ` Eric Blake
2015-08-05 6:23 ` Markus Armbruster
2015-08-05 14:27 ` Eric Blake
2015-08-06 5:46 ` Markus Armbruster
2015-08-31 18:09 ` Markus Armbruster
2015-09-03 14:52 ` Eric Blake
2015-09-03 16:13 ` Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 03/32] qapi: QAPISchema code generation helper methods Markus Armbruster
2015-08-04 22:18 ` Eric Blake
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor Markus Armbruster
2015-08-04 22:26 ` Eric Blake
2015-08-05 6:24 ` Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 05/32] tests/qapi-schema: Convert test harness to QAPISchemaVisitor Markus Armbruster
2015-08-04 22:35 ` Eric Blake
2015-08-05 6:26 ` Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 06/32] qapi: Split up some typedefs to ease review Markus Armbruster
2015-08-04 22:37 ` Eric Blake
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 07/32] qapi: Generate comments to simplify splitting for review Markus Armbruster
2015-08-04 22:54 ` Eric Blake
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 08/32] Revert "qapi: Generate comments to simplify splitting for review" Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 09/32] Revert "qapi: Split up some typedefs to ease review" Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 10/32] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions Markus Armbruster
2015-08-05 15:15 ` Eric Blake
2015-08-06 5:50 ` Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 11/32] qapi-visit: Convert to QAPISchemaVisitor, fixing bugs Markus Armbruster
2015-08-05 16:03 ` Eric Blake
2015-08-06 22:53 ` Eric Blake
2015-08-08 6:07 ` Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 12/32] qapi-commands: Convert to QAPISchemaVisitor Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 13/32] qapi: De-duplicate enum code generation Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 14/32] qapi-event: Eliminate global variable event_enum_value Markus Armbruster
2015-08-04 15:57 ` [Qemu-devel] [PATCH RFC v3 15/32] qapi-event: Convert to QAPISchemaVisitor, fixing data with base Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 16/32] qapi: Generate comments to simplify splitting for review Markus Armbruster
2015-08-04 23:02 ` Eric Blake
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 17/32] Revert "qapi: Generate comments to simplify splitting for review" Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 18/32] qapi: Replace dirty is_c_ptr() by method c_null() Markus Armbruster
2015-08-05 16:13 ` Eric Blake
2015-08-06 5:52 ` Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 19/32] qapi: Clean up after recent conversions to QAPISchemaVisitor Markus Armbruster
2015-08-05 16:29 ` Eric Blake
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 20/32] qapi-visit: Rearrange code a bit Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 21/32] qapi-commands: Rearrange code Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 22/32] qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO() Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 23/32] qapi: De-duplicate parameter list generation Markus Armbruster
2015-08-05 17:00 ` Eric Blake
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 24/32] qapi-commands: De-duplicate output marshaling functions Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 25/32] qapi: Improve built-in type documentation Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 26/32] qapi: Introduce a first class 'any' type Markus Armbruster
2015-08-07 19:30 ` Eric Blake
2015-08-08 6:24 ` Markus Armbruster
2015-08-31 9:07 ` Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 27/32] qom: Don't use 'gen': false for qom-get, qom-set, object-add Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 28/32] qapi-schema: Fix up misleading specification of netdev_add Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 29/32] qapi: Pseudo-type '**' is now unused, drop it Markus Armbruster
2015-08-05 17:13 ` Eric Blake
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 30/32] qapi: New QMP command query-schema for QMP schema introspection Markus Armbruster
2015-08-05 20:20 ` Eric Blake
2015-08-06 6:23 ` Markus Armbruster
2015-09-01 13:09 ` Markus Armbruster
2015-09-01 15:48 ` Eric Blake
2015-08-05 20:54 ` Eric Blake
2015-08-06 6:47 ` Markus Armbruster
2015-08-23 4:17 ` Eric Blake
2015-08-24 11:30 ` Markus Armbruster
2015-08-24 13:07 ` Eric Blake
2015-08-24 16:51 ` Eric Blake
2015-08-24 16:55 ` Markus Armbruster
2015-08-24 17:14 ` Eric Blake
2015-08-25 8:33 ` Markus Armbruster
2015-09-01 18:40 ` Michael Roth
2015-09-01 19:12 ` Eric Blake
2015-09-01 20:23 ` Michael Roth [this message]
2015-09-02 8:56 ` Markus Armbruster
2015-09-02 16:21 ` Michael Roth
2015-09-03 9:26 ` Markus Armbruster
2015-09-03 14:31 ` Eric Blake
2015-09-03 15:59 ` Michael Roth
2015-09-03 17:01 ` Markus Armbruster
2015-09-03 19:59 ` Michael Roth
2015-09-04 6:39 ` Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 31/32] qapi-introspect: Map all integer types to 'int' Markus Armbruster
2015-08-04 15:58 ` [Qemu-devel] [PATCH RFC v3 32/32] qapi-introspect: Hide type names Markus Armbruster
2015-08-05 21:06 ` Eric Blake
2015-08-05 21:50 ` Eric Blake
2015-08-06 6:49 ` 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=20150901202348.18566.60300@loki \
--to=mdroth@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=kwolf@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).