qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 01/10] block/qapi: Introduce BlockdevCreateO


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 01/10] block/qapi: Introduce BlockdevCreateOptions
Date: Tue, 16 Jan 2018 12:54:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 01/11/2018 01:52 PM, Kevin Wolf wrote:
> This creates a BlockdevCreateOptions union type that will contain all of
> the options for image creation. We'll start out with an empty struct
> type BlockdevCreateDummy for all drivers.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  qapi/block-core.json | 64 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 64 insertions(+)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index e94a6881b2..1749376c61 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -3320,6 +3320,70 @@
>  { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
>  
>  ##
> +# @BlockdevCreateDummy:
> +#
> +# FIXME To be removed. Only there to make the QAPI generator happy while 
> we're
> +# adding driver by driver. Leaving out union branches is not allowed.
> +#
> +# Since: 2.12
> +##
> +{ 'struct': 'BlockdevCreateDummy', 'data': {}}

At one point, I had a patch that let you do:

'data': { 'branch': {},
          ... }

for the branches that didn't need to add any additional types to the
flat union.  Hmm, looks like it is still sitting in my tree, unapplied;
would it help if I revived that one?

> +
> +##
> +# @BlockdevCreateOptions:
> +#
> +# Options for creating an image format on a given node.
> +#
> +# @driver           block driver to create the image format
> +# @node             node to create the image format on

Any restrictions we want to document about the node (for example, it
must not be in use by any backend device at the moment, particularly
since creation may change the node's format)?

> +#
> +# Since: 2.12
> +##
> +{ 'union': 'BlockdevCreateOptions',
> +  'base': {
> +      'driver':         'BlockdevDriver',
> +      'node':           'BlockdevRef' },
> +  'discriminator': 'driver',
> +  'data': {
> +      'blkdebug':       'BlockdevCreateDummy',

The QAPI itself looks sane for the future patches.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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