From 94d16a640a1058653327392e08c6d39eeba1e499 Mon Sep 17 00:00:00 2001 From: John Snow Date: Thu, 5 Nov 2015 18:13:18 -0500 Subject: block: add transactional properties Add both transactional properties to the QMP transactional interface, and add the BlockJobTxn that we create as a result of the err-cancel property to the BlkActionState structure. [split up from a patch originally by Stefan and Fam. --js] Signed-off-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Signed-off-by: John Snow Signed-off-by: John Snow Message-id: 1446765200-3054-13-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qapi-schema.json | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) (limited to 'qapi-schema.json') diff --git a/qapi-schema.json b/qapi-schema.json index b60c3729a7..36e59b8932 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1533,6 +1533,26 @@ { 'struct': 'Abort', 'data': { } } +## +# @ActionCompletionMode +# +# An enumeration of Transactional completion modes. +# +# @individual: Do not attempt to cancel any other Actions if any Actions fail +# after the Transaction request succeeds. All Actions that +# can complete successfully will do so without waiting on others. +# This is the default. +# +# @grouped: If any Action fails after the Transaction succeeds, cancel all +# Actions. Actions do not complete until all Actions are ready to +# complete. May be rejected by Actions that do not support this +# completion mode. +# +# Since: 2.5 +## +{ 'enum': 'ActionCompletionMode', + 'data': [ 'individual', 'grouped' ] } + ## # @TransactionAction # @@ -1561,6 +1581,23 @@ 'block-dirty-bitmap-clear': 'BlockDirtyBitmap' } } +## +# @TransactionProperties +# +# Optional arguments to modify the behavior of a Transaction. +# +# @completion-mode: #optional Controls how jobs launched asynchronously by +# Actions will complete or fail as a group. +# See @ActionCompletionMode for details. +# +# Since: 2.5 +## +{ 'struct': 'TransactionProperties', + 'data': { + '*completion-mode': 'ActionCompletionMode' + } +} + ## # @transaction # @@ -1568,8 +1605,12 @@ # operation fails, then the entire set of actions will be abandoned and the # appropriate error returned. # -# List of: -# @TransactionAction: information needed for the respective operation +# @actions: List of @TransactionAction; +# information needed for the respective operations. +# +# @properties: #optional structure of additional options to control the +# execution of the transaction. See @TransactionProperties +# for additional detail. # # Returns: nothing on success # Errors depend on the operations of the transaction @@ -1581,7 +1622,10 @@ # Since 1.1 ## { 'command': 'transaction', - 'data': { 'actions': [ 'TransactionAction' ] } } + 'data': { 'actions': [ 'TransactionAction' ], + '*properties': 'TransactionProperties' + } +} ## # @human-monitor-command: -- cgit v1.2.3