From 4d2091023a3475893b6145413cfc2dfc391e6d7d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 1 Apr 2019 17:01:40 +0200 Subject: qdev: Delete unused LostTickPolicy "merge" Commit 4e4fa398db6 "qdev: Introduce lost tick policy property" (v1.1.0) created PropertyType PROP_TYPE_LOSTTICKPOLICY with values "discard", "delay", "merge", and "slew". Value "merge" has never been used. Delete it. Signed-off-by: Markus Armbruster Message-Id: <20190401150140.29151-1-armbru@redhat.com> Reviewed-by: Eric Blake --- qapi/misc.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'qapi') diff --git a/qapi/misc.json b/qapi/misc.json index 8b3ca4f..dc4cf9d 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -172,17 +172,13 @@ # @delay: continue to deliver ticks at the normal rate. Guest time will be # delayed due to the late tick # -# @merge: merge the missed tick(s) into one tick and inject. Guest time -# may be delayed, depending on how the OS reacts to the merging -# of ticks -# # @slew: deliver ticks at a higher rate to catch up with the missed tick. The # guest time should not be delayed once catchup is complete. # # Since: 2.0 ## { 'enum': 'LostTickPolicy', - 'data': ['discard', 'delay', 'merge', 'slew' ] } + 'data': ['discard', 'delay', 'slew' ] } ## # @add_client: -- cgit v1.1 From 64c7580c2e85072685cb3f97b429191db92ced2b Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Fri, 24 May 2019 09:58:46 +0200 Subject: qapi/block-core: update documentation of preallocation parameter Add default and available values in the documentation block of each block device or protocol that supports the 'preallocation' parameter during the image creation. Suggested-by: Markus Armbruster Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster Message-Id: <20190524075848.23781-2-sgarzare@redhat.com> Signed-off-by: Markus Armbruster --- qapi/block-core.json | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'qapi') diff --git a/qapi/block-core.json b/qapi/block-core.json index 1defcde..175ccfe 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -4121,7 +4121,10 @@ # # @filename Filename for the new image file # @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off) +# @preallocation Preallocation mode for the new image (default: off; +# allowed values: off, +# falloc (if defined CONFIG_POSIX_FALLOCATE), +# full (if defined CONFIG_POSIX)) # @nocow Turn off copy-on-write (valid only on btrfs; default: off) # # Since: 2.12 @@ -4139,7 +4142,10 @@ # # @location Where to store the new image file # @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off) +# @preallocation Preallocation mode for the new image (default: off; +# allowed values: off, +# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE), +# full (if defined CONFIG_GLUSTERFS_ZEROFILL)) # # Since: 2.12 ## @@ -4243,7 +4249,8 @@ # @backing-fmt Name of the block driver to use for the backing file # @encrypt Encryption options if the image should be encrypted # @cluster-size qcow2 cluster size in bytes (default: 65536) -# @preallocation Preallocation mode for the new image (default: off) +# @preallocation Preallocation mode for the new image (default: off; +# allowed values: off, falloc, full, metadata) # @lazy-refcounts True if refcounts may be updated lazily (default: off) # @refcount-bits Width of reference counts in bits (default: 16) # @@ -4426,7 +4433,8 @@ # @location Where to store the new image file # @size Size of the virtual disk in bytes # @backing-file File name of a base image -# @preallocation Preallocation mode (allowed values: off, full) +# @preallocation Preallocation mode for the new image (default: off; +# allowed values: off, full) # @redundancy Redundancy of the image # @object-size Object size of the image # @@ -4461,8 +4469,8 @@ # # @file Node to create the image format on # @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (allowed values: off, -# metadata; default: off) +# @preallocation Preallocation mode for the new image (default: off; +# allowed values: off, metadata) # # Since: 2.12 ## -- cgit v1.1 From 6a8c0b51025314cdb1a8b4be24d45e690f1217dd Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 6 Jun 2019 17:37:57 +0200 Subject: qapi: Add feature flags to struct types Sometimes, the behaviour of QEMU changes without a change in the QMP syntax (usually by allowing values or operations that previously resulted in an error). QMP clients may still need to know whether they can rely on the changed behavior. Let's add feature flags to the QAPI schema language, so that we can make such changes visible with schema introspection. An example for a schema definition using feature flags looks like this: { 'struct': 'TestType', 'data': { 'number': 'int' }, 'features': [ 'allow-negative-numbers' ] } Introspection information then looks like this: { "name": "TestType", "meta-type": "object", "members": [ { "name": "number", "type": "int" } ], "features": [ "allow-negative-numbers" ] } This patch implements feature flags only for struct types. We'll implement them more widely as needed. Signed-off-by: Kevin Wolf Message-Id: <20190606153803.5278-2-armbru@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/introspect.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qapi') diff --git a/qapi/introspect.json b/qapi/introspect.json index 3d22166..1843c1c 100644 --- a/qapi/introspect.json +++ b/qapi/introspect.json @@ -174,6 +174,9 @@ # and may even differ from the order of the values of the # enum type of the @tag. # +# @features: names of features associated with the type, in no particular +# order. (since: 4.1) +# # Values of this type are JSON object on the wire. # # Since: 2.5 @@ -181,7 +184,8 @@ { 'struct': 'SchemaInfoObject', 'data': { 'members': [ 'SchemaInfoObjectMember' ], '*tag': 'str', - '*variants': [ 'SchemaInfoObjectVariant' ] } } + '*variants': [ 'SchemaInfoObjectVariant' ], + '*features': [ 'str' ] } } ## # @SchemaInfoObjectMember: -- cgit v1.1 From c9d4070991ee504bd674c77c3790ef7028b258bd Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 6 Jun 2019 17:38:02 +0200 Subject: file-posix: Add dynamic-auto-read-only QAPI feature In commit 23dece19da4 ('file-posix: Make auto-read-only dynamic') , auto-read-only=on changed its behaviour in file-posix for the 4.0 release. This change cannot be detected through the usual mechanisms like schema introspection. Add a new feature flag to the schema to allow libvirt to detect the presence of the new behaviour. Signed-off-by: Kevin Wolf Message-Id: <20190606153803.5278-7-armbru@redhat.com> Reviewed-by: Markus Armbruster [Comment tweaked on Eric Blake's advice] Signed-off-by: Markus Armbruster --- qapi/block-core.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'qapi') diff --git a/qapi/block-core.json b/qapi/block-core.json index 175ccfe..fcd054f 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2859,6 +2859,15 @@ # file is large, do not use in production. # (default: off) (since: 3.0) # +# Features: +# @dynamic-auto-read-only: If present, enabled auto-read-only means that the +# driver will open the image read-only at first, +# dynamically reopen the image file read-write when +# the first writer is attached to the node and reopen +# read-only when the last writer is detached. This +# allows giving QEMU write permissions only on demand +# when an operation actually needs write access. +# # Since: 2.9 ## { 'struct': 'BlockdevOptionsFile', @@ -2868,7 +2877,9 @@ '*aio': 'BlockdevAioOptions', '*drop-cache': {'type': 'bool', 'if': 'defined(CONFIG_LINUX)'}, - '*x-check-cache-dropped': 'bool' } } + '*x-check-cache-dropped': 'bool' }, + 'features': [ { 'name': 'dynamic-auto-read-only', + 'if': 'defined(CONFIG_POSIX)' } ] } ## # @BlockdevOptionsNull: -- cgit v1.1