From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/8] qapi: Add default-variant for flat unions
Date: Thu, 7 Feb 2019 08:46:25 -0600 [thread overview]
Message-ID: <4ccd4724-af9c-ccf1-3598-399bd3e4483b@redhat.com> (raw)
In-Reply-To: <041a22c8-ae8d-2a25-736d-2ef4e3dc2f8b@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
On 2/7/19 8:01 AM, Eric Blake wrote:
>> I think there is: we could provide for an *optional* default value. If
>> the schema specifies it, that's what 'absent' means. If it doesn't, all
>> bets are off, just like they are now.
>
> And we already have the planned syntax, thanks to our recent work on
> adding conditionals - where we now have:
>
> { '*field': 'mytype' }
>
> we can also do long-hand:
>
> { { 'name': '*field', 'type': 'mytype' } }
I'd better use the actual syntax, instead of inventing non-JSON off the
top of my head:
{ '*field': { 'type': 'mytype' } }
>
> which also lends itself well to declaring a default:
>
> { { 'name': '*field', 'type': 'mytype', 'default': 'xyz' } }
{ '*field': { 'type': 'mytype', 'default': 'xyz' } }
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-07 14:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-06 19:55 [Qemu-devel] [PATCH v3 0/8] block: Try to create well-typed json:{} filenames Max Reitz
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 1/8] qapi: Add default-variant for flat unions Max Reitz
2019-02-06 20:13 ` Eric Blake
2019-02-07 6:56 ` Markus Armbruster
2019-02-07 14:01 ` Eric Blake
2019-02-07 14:46 ` Eric Blake [this message]
2019-02-08 18:21 ` Max Reitz
2019-06-05 19:00 ` Eric Blake
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 2/8] docs/qapi: Document optional discriminators Max Reitz
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 3/8] tests: Add QAPI optional discriminator tests Max Reitz
2019-02-06 20:20 ` Eric Blake
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 4/8] qapi: Formalize qcow2 encryption probing Max Reitz
2019-02-06 20:23 ` Eric Blake
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 5/8] qapi: Formalize qcow " Max Reitz
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 6/8] block: Try to create well typed json:{} filenames Max Reitz
2019-02-06 20:43 ` Eric Blake
2019-02-06 21:06 ` Eric Blake
2019-02-08 18:11 ` Max Reitz
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 7/8] iotests: Test internal option typing Max Reitz
2019-02-06 21:28 ` Eric Blake
2019-02-06 19:55 ` [Qemu-devel] [PATCH v3 8/8] iotests: qcow2's encrypt.format is now optional Max Reitz
2019-02-06 21:31 ` 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=4ccd4724-af9c-ccf1-3598-399bd3e4483b@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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).