Skip to content

Commit

Permalink
qapi/block-core: Add "new" qcow2 options
Browse files Browse the repository at this point in the history
qcow2 supports more than four options by now, add the new options
(overlap check mode and metadata cache size)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1408557576-14574-5-git-send-email-mreitz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
XanClic authored and stefanhaRH committed Sep 22, 2014
1 parent ee42b5c commit f658581
Showing 1 changed file with 78 additions and 1 deletion.
79 changes: 78 additions & 1 deletion qapi/block-core.json
Expand Up @@ -1263,6 +1263,67 @@
'base': 'BlockdevOptionsGenericFormat',
'data': { '*backing': 'BlockdevRef' } }

##
# @Qcow2OverlapCheckMode
#
# General overlap check modes.
#
# @none: Do not perform any checks
#
# @constant: Perform only checks which can be done in constant time and
# without reading anything from disk
#
# @cached: Perform only checks which can be done without reading anything
# from disk
#
# @all: Perform all available overlap checks
#
# Since: 2.2
##
{ 'enum': 'Qcow2OverlapCheckMode',
'data': [ 'none', 'constant', 'cached', 'all' ] }

##
# @Qcow2OverlapCheckFlags
#
# Structure of flags for each metadata structure. Setting a field to 'true'
# makes qemu guard that structure against unintended overwriting. The default
# value is chosen according to the template given.
#
# @template: Specifies a template mode which can be adjusted using the other
# flags, defaults to 'cached'
#
# Since: 2.2
##
{ 'type': 'Qcow2OverlapCheckFlags',
'data': { '*template': 'Qcow2OverlapCheckMode',
'*main-header': 'bool',
'*active-l1': 'bool',
'*active-l2': 'bool',
'*refcount-table': 'bool',
'*refcount-block': 'bool',
'*snapshot-table': 'bool',
'*inactive-l1': 'bool',
'*inactive-l2': 'bool' } }

##
# @Qcow2OverlapChecks
#
# Specifies which metadata structures should be guarded against unintended
# overwriting.
#
# @flags: set of flags for separate specification of each metadata structure
# type
#
# @mode: named mode which chooses a specific set of flags
#
# Since: 2.2
##
{ 'union': 'Qcow2OverlapChecks',
'discriminator': {},
'data': { 'flags': 'Qcow2OverlapCheckFlags',
'mode': 'Qcow2OverlapCheckMode' } }

##
# @BlockdevOptionsQcow2
#
Expand All @@ -1282,14 +1343,30 @@
# should be issued on other occasions where a cluster
# gets freed
#
# @overlap-check: #optional which overlap checks to perform for writes
# to the image, defaults to 'cached' (since 2.2)
#
# @cache-size: #optional the maximum total size of the L2 table and
# refcount block caches in bytes (since 2.2)
#
# @l2-cache-size: #optional the maximum size of the L2 table cache in
# bytes (since 2.2)
#
# @refcount-cache-size: #optional the maximum size of the refcount block cache
# in bytes (since 2.2)
#
# Since: 1.7
##
{ 'type': 'BlockdevOptionsQcow2',
'base': 'BlockdevOptionsGenericCOWFormat',
'data': { '*lazy-refcounts': 'bool',
'*pass-discard-request': 'bool',
'*pass-discard-snapshot': 'bool',
'*pass-discard-other': 'bool' } }
'*pass-discard-other': 'bool',
'*overlap-check': 'Qcow2OverlapChecks',
'*cache-size': 'int',
'*l2-cache-size': 'int',
'*refcount-cache-size': 'int' } }


##
Expand Down

0 comments on commit f658581

Please sign in to comment.