···8888{ 'include': 'qapi/rocker.json' }
8989{ 'include': 'qapi/ui.json' }
9090{ 'include': 'qapi/migration.json' }
9191+{ 'include': 'qapi/transaction.json' }
9192{ 'include': 'qapi/event.json' }
9293{ 'include': 'qapi/trace.json' }
9394{ 'include': 'qapi/introspect.json' }
···10951096#
10961097##
10971098{ 'command': 'balloon', 'data': {'value': 'int'} }
10981098-10991099-##
11001100-# @Abort:
11011101-#
11021102-# This action can be used to test transaction failure.
11031103-#
11041104-# Since: 1.6
11051105-##
11061106-{ 'struct': 'Abort',
11071107- 'data': { } }
11081108-11091109-##
11101110-# @ActionCompletionMode:
11111111-#
11121112-# An enumeration of Transactional completion modes.
11131113-#
11141114-# @individual: Do not attempt to cancel any other Actions if any Actions fail
11151115-# after the Transaction request succeeds. All Actions that
11161116-# can complete successfully will do so without waiting on others.
11171117-# This is the default.
11181118-#
11191119-# @grouped: If any Action fails after the Transaction succeeds, cancel all
11201120-# Actions. Actions do not complete until all Actions are ready to
11211121-# complete. May be rejected by Actions that do not support this
11221122-# completion mode.
11231123-#
11241124-# Since: 2.5
11251125-##
11261126-{ 'enum': 'ActionCompletionMode',
11271127- 'data': [ 'individual', 'grouped' ] }
11281128-11291129-##
11301130-# @TransactionAction:
11311131-#
11321132-# A discriminated record of operations that can be performed with
11331133-# @transaction. Action @type can be:
11341134-#
11351135-# - @abort: since 1.6
11361136-# - @block-dirty-bitmap-add: since 2.5
11371137-# - @block-dirty-bitmap-clear: since 2.5
11381138-# - @blockdev-backup: since 2.3
11391139-# - @blockdev-snapshot: since 2.5
11401140-# - @blockdev-snapshot-internal-sync: since 1.7
11411141-# - @blockdev-snapshot-sync: since 1.1
11421142-# - @drive-backup: since 1.6
11431143-#
11441144-# Since: 1.1
11451145-##
11461146-{ 'union': 'TransactionAction',
11471147- 'data': {
11481148- 'abort': 'Abort',
11491149- 'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
11501150- 'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
11511151- 'blockdev-backup': 'BlockdevBackup',
11521152- 'blockdev-snapshot': 'BlockdevSnapshot',
11531153- 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
11541154- 'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
11551155- 'drive-backup': 'DriveBackup'
11561156- } }
11571157-11581158-##
11591159-# @TransactionProperties:
11601160-#
11611161-# Optional arguments to modify the behavior of a Transaction.
11621162-#
11631163-# @completion-mode: Controls how jobs launched asynchronously by
11641164-# Actions will complete or fail as a group.
11651165-# See @ActionCompletionMode for details.
11661166-#
11671167-# Since: 2.5
11681168-##
11691169-{ 'struct': 'TransactionProperties',
11701170- 'data': {
11711171- '*completion-mode': 'ActionCompletionMode'
11721172- }
11731173-}
11741174-11751175-##
11761176-# @transaction:
11771177-#
11781178-# Executes a number of transactionable QMP commands atomically. If any
11791179-# operation fails, then the entire set of actions will be abandoned and the
11801180-# appropriate error returned.
11811181-#
11821182-# For external snapshots, the dictionary contains the device, the file to use for
11831183-# the new snapshot, and the format. The default format, if not specified, is
11841184-# qcow2.
11851185-#
11861186-# Each new snapshot defaults to being created by QEMU (wiping any
11871187-# contents if the file already exists), but it is also possible to reuse
11881188-# an externally-created file. In the latter case, you should ensure that
11891189-# the new image file has the same contents as the current one; QEMU cannot
11901190-# perform any meaningful check. Typically this is achieved by using the
11911191-# current image file as the backing file for the new image.
11921192-#
11931193-# On failure, the original disks pre-snapshot attempt will be used.
11941194-#
11951195-# For internal snapshots, the dictionary contains the device and the snapshot's
11961196-# name. If an internal snapshot matching name already exists, the request will
11971197-# be rejected. Only some image formats support it, for example, qcow2, rbd,
11981198-# and sheepdog.
11991199-#
12001200-# On failure, qemu will try delete the newly created internal snapshot in the
12011201-# transaction. When an I/O error occurs during deletion, the user needs to fix
12021202-# it later with qemu-img or other command.
12031203-#
12041204-# @actions: List of @TransactionAction;
12051205-# information needed for the respective operations.
12061206-#
12071207-# @properties: structure of additional options to control the
12081208-# execution of the transaction. See @TransactionProperties
12091209-# for additional detail.
12101210-#
12111211-# Returns: nothing on success
12121212-#
12131213-# Errors depend on the operations of the transaction
12141214-#
12151215-# Note: The transaction aborts on the first failure. Therefore, there will be
12161216-# information on only one failed operation returned in an error condition, and
12171217-# subsequent actions will not have been attempted.
12181218-#
12191219-# Since: 1.1
12201220-#
12211221-# Example:
12221222-#
12231223-# -> { "execute": "transaction",
12241224-# "arguments": { "actions": [
12251225-# { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
12261226-# "snapshot-file": "/some/place/my-image",
12271227-# "format": "qcow2" } },
12281228-# { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
12291229-# "snapshot-file": "/some/place/my-image2",
12301230-# "snapshot-node-name": "node3432",
12311231-# "mode": "existing",
12321232-# "format": "qcow2" } },
12331233-# { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
12341234-# "snapshot-file": "/some/place/my-image2",
12351235-# "mode": "existing",
12361236-# "format": "qcow2" } },
12371237-# { "type": "blockdev-snapshot-internal-sync", "data" : {
12381238-# "device": "ide-hd2",
12391239-# "name": "snapshot0" } } ] } }
12401240-# <- { "return": {} }
12411241-#
12421242-##
12431243-{ 'command': 'transaction',
12441244- 'data': { 'actions': [ 'TransactionAction' ],
12451245- '*properties': 'TransactionProperties'
12461246- }
12471247-}
1248109912491100##
12501101# @human-monitor-command:
+158
qapi/transaction.json
···11+# -*- Mode: Python -*-
22+#
33+44+##
55+# = Transactions
66+##
77+88+{ 'include': 'block.json' }
99+1010+##
1111+# @Abort:
1212+#
1313+# This action can be used to test transaction failure.
1414+#
1515+# Since: 1.6
1616+##
1717+{ 'struct': 'Abort',
1818+ 'data': { } }
1919+2020+##
2121+# @ActionCompletionMode:
2222+#
2323+# An enumeration of Transactional completion modes.
2424+#
2525+# @individual: Do not attempt to cancel any other Actions if any Actions fail
2626+# after the Transaction request succeeds. All Actions that
2727+# can complete successfully will do so without waiting on others.
2828+# This is the default.
2929+#
3030+# @grouped: If any Action fails after the Transaction succeeds, cancel all
3131+# Actions. Actions do not complete until all Actions are ready to
3232+# complete. May be rejected by Actions that do not support this
3333+# completion mode.
3434+#
3535+# Since: 2.5
3636+##
3737+{ 'enum': 'ActionCompletionMode',
3838+ 'data': [ 'individual', 'grouped' ] }
3939+4040+##
4141+# @TransactionAction:
4242+#
4343+# A discriminated record of operations that can be performed with
4444+# @transaction. Action @type can be:
4545+#
4646+# - @abort: since 1.6
4747+# - @block-dirty-bitmap-add: since 2.5
4848+# - @block-dirty-bitmap-clear: since 2.5
4949+# - @blockdev-backup: since 2.3
5050+# - @blockdev-snapshot: since 2.5
5151+# - @blockdev-snapshot-internal-sync: since 1.7
5252+# - @blockdev-snapshot-sync: since 1.1
5353+# - @drive-backup: since 1.6
5454+#
5555+# Since: 1.1
5656+##
5757+{ 'union': 'TransactionAction',
5858+ 'data': {
5959+ 'abort': 'Abort',
6060+ 'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
6161+ 'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
6262+ 'blockdev-backup': 'BlockdevBackup',
6363+ 'blockdev-snapshot': 'BlockdevSnapshot',
6464+ 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
6565+ 'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
6666+ 'drive-backup': 'DriveBackup'
6767+ } }
6868+6969+##
7070+# @TransactionProperties:
7171+#
7272+# Optional arguments to modify the behavior of a Transaction.
7373+#
7474+# @completion-mode: Controls how jobs launched asynchronously by
7575+# Actions will complete or fail as a group.
7676+# See @ActionCompletionMode for details.
7777+#
7878+# Since: 2.5
7979+##
8080+{ 'struct': 'TransactionProperties',
8181+ 'data': {
8282+ '*completion-mode': 'ActionCompletionMode'
8383+ }
8484+}
8585+8686+##
8787+# @transaction:
8888+#
8989+# Executes a number of transactionable QMP commands atomically. If any
9090+# operation fails, then the entire set of actions will be abandoned and the
9191+# appropriate error returned.
9292+#
9393+# For external snapshots, the dictionary contains the device, the file to use for
9494+# the new snapshot, and the format. The default format, if not specified, is
9595+# qcow2.
9696+#
9797+# Each new snapshot defaults to being created by QEMU (wiping any
9898+# contents if the file already exists), but it is also possible to reuse
9999+# an externally-created file. In the latter case, you should ensure that
100100+# the new image file has the same contents as the current one; QEMU cannot
101101+# perform any meaningful check. Typically this is achieved by using the
102102+# current image file as the backing file for the new image.
103103+#
104104+# On failure, the original disks pre-snapshot attempt will be used.
105105+#
106106+# For internal snapshots, the dictionary contains the device and the snapshot's
107107+# name. If an internal snapshot matching name already exists, the request will
108108+# be rejected. Only some image formats support it, for example, qcow2, rbd,
109109+# and sheepdog.
110110+#
111111+# On failure, qemu will try delete the newly created internal snapshot in the
112112+# transaction. When an I/O error occurs during deletion, the user needs to fix
113113+# it later with qemu-img or other command.
114114+#
115115+# @actions: List of @TransactionAction;
116116+# information needed for the respective operations.
117117+#
118118+# @properties: structure of additional options to control the
119119+# execution of the transaction. See @TransactionProperties
120120+# for additional detail.
121121+#
122122+# Returns: nothing on success
123123+#
124124+# Errors depend on the operations of the transaction
125125+#
126126+# Note: The transaction aborts on the first failure. Therefore, there will be
127127+# information on only one failed operation returned in an error condition, and
128128+# subsequent actions will not have been attempted.
129129+#
130130+# Since: 1.1
131131+#
132132+# Example:
133133+#
134134+# -> { "execute": "transaction",
135135+# "arguments": { "actions": [
136136+# { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
137137+# "snapshot-file": "/some/place/my-image",
138138+# "format": "qcow2" } },
139139+# { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
140140+# "snapshot-file": "/some/place/my-image2",
141141+# "snapshot-node-name": "node3432",
142142+# "mode": "existing",
143143+# "format": "qcow2" } },
144144+# { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
145145+# "snapshot-file": "/some/place/my-image2",
146146+# "mode": "existing",
147147+# "format": "qcow2" } },
148148+# { "type": "blockdev-snapshot-internal-sync", "data" : {
149149+# "device": "ide-hd2",
150150+# "name": "snapshot0" } } ] } }
151151+# <- { "return": {} }
152152+#
153153+##
154154+{ 'command': 'transaction',
155155+ 'data': { 'actions': [ 'TransactionAction' ],
156156+ '*properties': 'TransactionProperties'
157157+ }
158158+}