[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema |
Date: |
Tue, 16 Jan 2018 12:59:24 -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:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qapi/block-core.json | 33 ++++++++++++++++++++++++++++++++-
> 1 file changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 1749376c61..9341f6708d 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -3320,6 +3320,37 @@
> { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
>
> ##
> +# @BlockdevQcow2CompatLevel:
> +# @0_10: The original QCOW2 format as introduced in qemu 0.10 (version 2)
> +# @1_1: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
> +#
> +# Since: 2.10
> +##
> +{ 'enum': 'BlockdevQcow2CompatLevel',
> + 'data': [ '0_10', '1_1' ] }
Enums are allowed to start with digits while struct members are not; so
you can get away with this naming. Do we really want the names 0_10 and
1_1, or are there better names we could come up with (it already
undergoes translation such that qemu-img reports 0.10 rather than 0_10).
> +
> +
> +##
> +# @BlockdevCreateOptionsQcow2:
> +#
> +# Driver specific image creation options for qcow2.
> +#
> +# TODO Describe fields
Hence this being RFC :)
> +#
> +# Since: 2.12
> +##
> +{ 'struct': 'BlockdevCreateOptionsQcow2',
> + 'data': { 'size': 'size',
Is size mandatory even when we have a backing file specification? It is
not mandatory for qemu-img create; but on the other hand, I think I can
live with requiring the QMP caller to supply a size.
> + '*compat': 'BlockdevQcow2CompatLevel',
> + '*backing-file': 'str',
Given Dan's comments, perhaps name this one 'backing-str' to make it
obvious that it is the string written into the qcow2 header, rather than
the node we open as backing? Or, maybe we support an optional
'*backing-node' that can be used for allowing a default size and backing
string if not explicitly overridden?
> + '*backing-fmt': 'BlockdevDriver',
> + '*encrypt': 'QCryptoBlockCreateOptions',
> + '*cluster-size': 'size',
> + '*preallocation': 'PreallocMode',
> + '*lazy-refcounts': 'bool',
> + '*refcount-bits': 'int' } }
> +
> +##
> # @BlockdevCreateDummy:
> #
> # FIXME To be removed. Only there to make the QAPI generator happy while
> we're
> @@ -3365,7 +3396,7 @@
> 'null-aio': 'BlockdevCreateDummy',
> 'null-co': 'BlockdevCreateDummy',
> 'parallels': 'BlockdevCreateDummy',
> - 'qcow2': 'BlockdevCreateDummy',
> + 'qcow2': 'BlockdevCreateOptionsQcow2',
> 'qcow': 'BlockdevCreateDummy',
> 'qed': 'BlockdevCreateDummy',
> 'quorum': 'BlockdevCreateDummy',
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema,
Eric Blake <=
Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema, Max Reitz, 2018/01/29
[Qemu-block] [RFC PATCH 03/10] qcow2: Let qcow2_create() handle protocol layer, Kevin Wolf, 2018/01/11
[Qemu-block] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2(), Kevin Wolf, 2018/01/11