Marc-André Lureau <[email protected]> writes:

> Integer built-in types are currently canonicalized to "int" in
> query-qmp-schema. Consequently, clients cannot distinguish types such
> as int8, uint64, and size, even though they accept different ranges.

This is by design.

Width and signedness are an implementation detail.  We can change them
freely without affecting syntactic compatibility of the wire protocol.

If we expose them, we can't anymore, and docs/devel/qapi-code-gen.rst
section "Compatibility considerations" needs an update.

Why would this be useful?  Knowing width and signedness narrows down the
possible values some, but it need not be tight.

> Preserve the individual integer types during schema analysis and add an
> optional "integer" member to SchemaInfoBuiltin. It reports whether the
> type is signed and its width in bits. This also preserves the actual
> element type for arrays of integers.
>
> Teach the introspection generator to emit integer values and update the
> documentation to describe the extended schema information.
>
> For example for introspection, for all kind of int, before:
> {"name": "int", "json-type": "int", "meta-type": "builtin"}
>
> After, there are various int types such as:
> {"name": "int64", "integer": {"bits": 64, "signed": true}, "json-type":
> "int", "meta-type": "builtin"}
>
> Signed-off-by: Marc-André Lureau <[email protected]>


Reply via email to