qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/8] qapi: Add default-variant f


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/8] qapi: Add default-variant for flat unions
Date: Thu, 7 Feb 2019 08:46:25 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]