qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qapi-schema: Collect transaction stuff in qapi/transaction.json

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503602048-12268-11-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

+161 -150
+1
MAINTAINERS
··· 1231 1231 F: blockdev.c 1232 1232 F: block/qapi.c 1233 1233 F: qapi/block*.json 1234 + F: qapi/transaction.json 1234 1235 T: git git://repo.or.cz/qemu/armbru.git block-next 1235 1236 1236 1237 Dirty Bitmaps
+1
Makefile
··· 419 419 $(SRC_PATH)/qapi/run-state.json \ 420 420 $(SRC_PATH)/qapi/sockets.json \ 421 421 $(SRC_PATH)/qapi/trace.json \ 422 + $(SRC_PATH)/qapi/transaction.json \ 422 423 $(SRC_PATH)/qapi/ui.json 423 424 424 425 qapi-types.c qapi-types.h :\
+1 -150
qapi-schema.json
··· 88 88 { 'include': 'qapi/rocker.json' } 89 89 { 'include': 'qapi/ui.json' } 90 90 { 'include': 'qapi/migration.json' } 91 + { 'include': 'qapi/transaction.json' } 91 92 { 'include': 'qapi/event.json' } 92 93 { 'include': 'qapi/trace.json' } 93 94 { 'include': 'qapi/introspect.json' } ··· 1095 1096 # 1096 1097 ## 1097 1098 { 'command': 'balloon', 'data': {'value': 'int'} } 1098 - 1099 - ## 1100 - # @Abort: 1101 - # 1102 - # This action can be used to test transaction failure. 1103 - # 1104 - # Since: 1.6 1105 - ## 1106 - { 'struct': 'Abort', 1107 - 'data': { } } 1108 - 1109 - ## 1110 - # @ActionCompletionMode: 1111 - # 1112 - # An enumeration of Transactional completion modes. 1113 - # 1114 - # @individual: Do not attempt to cancel any other Actions if any Actions fail 1115 - # after the Transaction request succeeds. All Actions that 1116 - # can complete successfully will do so without waiting on others. 1117 - # This is the default. 1118 - # 1119 - # @grouped: If any Action fails after the Transaction succeeds, cancel all 1120 - # Actions. Actions do not complete until all Actions are ready to 1121 - # complete. May be rejected by Actions that do not support this 1122 - # completion mode. 1123 - # 1124 - # Since: 2.5 1125 - ## 1126 - { 'enum': 'ActionCompletionMode', 1127 - 'data': [ 'individual', 'grouped' ] } 1128 - 1129 - ## 1130 - # @TransactionAction: 1131 - # 1132 - # A discriminated record of operations that can be performed with 1133 - # @transaction. Action @type can be: 1134 - # 1135 - # - @abort: since 1.6 1136 - # - @block-dirty-bitmap-add: since 2.5 1137 - # - @block-dirty-bitmap-clear: since 2.5 1138 - # - @blockdev-backup: since 2.3 1139 - # - @blockdev-snapshot: since 2.5 1140 - # - @blockdev-snapshot-internal-sync: since 1.7 1141 - # - @blockdev-snapshot-sync: since 1.1 1142 - # - @drive-backup: since 1.6 1143 - # 1144 - # Since: 1.1 1145 - ## 1146 - { 'union': 'TransactionAction', 1147 - 'data': { 1148 - 'abort': 'Abort', 1149 - 'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd', 1150 - 'block-dirty-bitmap-clear': 'BlockDirtyBitmap', 1151 - 'blockdev-backup': 'BlockdevBackup', 1152 - 'blockdev-snapshot': 'BlockdevSnapshot', 1153 - 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal', 1154 - 'blockdev-snapshot-sync': 'BlockdevSnapshotSync', 1155 - 'drive-backup': 'DriveBackup' 1156 - } } 1157 - 1158 - ## 1159 - # @TransactionProperties: 1160 - # 1161 - # Optional arguments to modify the behavior of a Transaction. 1162 - # 1163 - # @completion-mode: Controls how jobs launched asynchronously by 1164 - # Actions will complete or fail as a group. 1165 - # See @ActionCompletionMode for details. 1166 - # 1167 - # Since: 2.5 1168 - ## 1169 - { 'struct': 'TransactionProperties', 1170 - 'data': { 1171 - '*completion-mode': 'ActionCompletionMode' 1172 - } 1173 - } 1174 - 1175 - ## 1176 - # @transaction: 1177 - # 1178 - # Executes a number of transactionable QMP commands atomically. If any 1179 - # operation fails, then the entire set of actions will be abandoned and the 1180 - # appropriate error returned. 1181 - # 1182 - # For external snapshots, the dictionary contains the device, the file to use for 1183 - # the new snapshot, and the format. The default format, if not specified, is 1184 - # qcow2. 1185 - # 1186 - # Each new snapshot defaults to being created by QEMU (wiping any 1187 - # contents if the file already exists), but it is also possible to reuse 1188 - # an externally-created file. In the latter case, you should ensure that 1189 - # the new image file has the same contents as the current one; QEMU cannot 1190 - # perform any meaningful check. Typically this is achieved by using the 1191 - # current image file as the backing file for the new image. 1192 - # 1193 - # On failure, the original disks pre-snapshot attempt will be used. 1194 - # 1195 - # For internal snapshots, the dictionary contains the device and the snapshot's 1196 - # name. If an internal snapshot matching name already exists, the request will 1197 - # be rejected. Only some image formats support it, for example, qcow2, rbd, 1198 - # and sheepdog. 1199 - # 1200 - # On failure, qemu will try delete the newly created internal snapshot in the 1201 - # transaction. When an I/O error occurs during deletion, the user needs to fix 1202 - # it later with qemu-img or other command. 1203 - # 1204 - # @actions: List of @TransactionAction; 1205 - # information needed for the respective operations. 1206 - # 1207 - # @properties: structure of additional options to control the 1208 - # execution of the transaction. See @TransactionProperties 1209 - # for additional detail. 1210 - # 1211 - # Returns: nothing on success 1212 - # 1213 - # Errors depend on the operations of the transaction 1214 - # 1215 - # Note: The transaction aborts on the first failure. Therefore, there will be 1216 - # information on only one failed operation returned in an error condition, and 1217 - # subsequent actions will not have been attempted. 1218 - # 1219 - # Since: 1.1 1220 - # 1221 - # Example: 1222 - # 1223 - # -> { "execute": "transaction", 1224 - # "arguments": { "actions": [ 1225 - # { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0", 1226 - # "snapshot-file": "/some/place/my-image", 1227 - # "format": "qcow2" } }, 1228 - # { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile", 1229 - # "snapshot-file": "/some/place/my-image2", 1230 - # "snapshot-node-name": "node3432", 1231 - # "mode": "existing", 1232 - # "format": "qcow2" } }, 1233 - # { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1", 1234 - # "snapshot-file": "/some/place/my-image2", 1235 - # "mode": "existing", 1236 - # "format": "qcow2" } }, 1237 - # { "type": "blockdev-snapshot-internal-sync", "data" : { 1238 - # "device": "ide-hd2", 1239 - # "name": "snapshot0" } } ] } } 1240 - # <- { "return": {} } 1241 - # 1242 - ## 1243 - { 'command': 'transaction', 1244 - 'data': { 'actions': [ 'TransactionAction' ], 1245 - '*properties': 'TransactionProperties' 1246 - } 1247 - } 1248 1099 1249 1100 ## 1250 1101 # @human-monitor-command:
+158
qapi/transaction.json
··· 1 + # -*- Mode: Python -*- 2 + # 3 + 4 + ## 5 + # = Transactions 6 + ## 7 + 8 + { 'include': 'block.json' } 9 + 10 + ## 11 + # @Abort: 12 + # 13 + # This action can be used to test transaction failure. 14 + # 15 + # Since: 1.6 16 + ## 17 + { 'struct': 'Abort', 18 + 'data': { } } 19 + 20 + ## 21 + # @ActionCompletionMode: 22 + # 23 + # An enumeration of Transactional completion modes. 24 + # 25 + # @individual: Do not attempt to cancel any other Actions if any Actions fail 26 + # after the Transaction request succeeds. All Actions that 27 + # can complete successfully will do so without waiting on others. 28 + # This is the default. 29 + # 30 + # @grouped: If any Action fails after the Transaction succeeds, cancel all 31 + # Actions. Actions do not complete until all Actions are ready to 32 + # complete. May be rejected by Actions that do not support this 33 + # completion mode. 34 + # 35 + # Since: 2.5 36 + ## 37 + { 'enum': 'ActionCompletionMode', 38 + 'data': [ 'individual', 'grouped' ] } 39 + 40 + ## 41 + # @TransactionAction: 42 + # 43 + # A discriminated record of operations that can be performed with 44 + # @transaction. Action @type can be: 45 + # 46 + # - @abort: since 1.6 47 + # - @block-dirty-bitmap-add: since 2.5 48 + # - @block-dirty-bitmap-clear: since 2.5 49 + # - @blockdev-backup: since 2.3 50 + # - @blockdev-snapshot: since 2.5 51 + # - @blockdev-snapshot-internal-sync: since 1.7 52 + # - @blockdev-snapshot-sync: since 1.1 53 + # - @drive-backup: since 1.6 54 + # 55 + # Since: 1.1 56 + ## 57 + { 'union': 'TransactionAction', 58 + 'data': { 59 + 'abort': 'Abort', 60 + 'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd', 61 + 'block-dirty-bitmap-clear': 'BlockDirtyBitmap', 62 + 'blockdev-backup': 'BlockdevBackup', 63 + 'blockdev-snapshot': 'BlockdevSnapshot', 64 + 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal', 65 + 'blockdev-snapshot-sync': 'BlockdevSnapshotSync', 66 + 'drive-backup': 'DriveBackup' 67 + } } 68 + 69 + ## 70 + # @TransactionProperties: 71 + # 72 + # Optional arguments to modify the behavior of a Transaction. 73 + # 74 + # @completion-mode: Controls how jobs launched asynchronously by 75 + # Actions will complete or fail as a group. 76 + # See @ActionCompletionMode for details. 77 + # 78 + # Since: 2.5 79 + ## 80 + { 'struct': 'TransactionProperties', 81 + 'data': { 82 + '*completion-mode': 'ActionCompletionMode' 83 + } 84 + } 85 + 86 + ## 87 + # @transaction: 88 + # 89 + # Executes a number of transactionable QMP commands atomically. If any 90 + # operation fails, then the entire set of actions will be abandoned and the 91 + # appropriate error returned. 92 + # 93 + # For external snapshots, the dictionary contains the device, the file to use for 94 + # the new snapshot, and the format. The default format, if not specified, is 95 + # qcow2. 96 + # 97 + # Each new snapshot defaults to being created by QEMU (wiping any 98 + # contents if the file already exists), but it is also possible to reuse 99 + # an externally-created file. In the latter case, you should ensure that 100 + # the new image file has the same contents as the current one; QEMU cannot 101 + # perform any meaningful check. Typically this is achieved by using the 102 + # current image file as the backing file for the new image. 103 + # 104 + # On failure, the original disks pre-snapshot attempt will be used. 105 + # 106 + # For internal snapshots, the dictionary contains the device and the snapshot's 107 + # name. If an internal snapshot matching name already exists, the request will 108 + # be rejected. Only some image formats support it, for example, qcow2, rbd, 109 + # and sheepdog. 110 + # 111 + # On failure, qemu will try delete the newly created internal snapshot in the 112 + # transaction. When an I/O error occurs during deletion, the user needs to fix 113 + # it later with qemu-img or other command. 114 + # 115 + # @actions: List of @TransactionAction; 116 + # information needed for the respective operations. 117 + # 118 + # @properties: structure of additional options to control the 119 + # execution of the transaction. See @TransactionProperties 120 + # for additional detail. 121 + # 122 + # Returns: nothing on success 123 + # 124 + # Errors depend on the operations of the transaction 125 + # 126 + # Note: The transaction aborts on the first failure. Therefore, there will be 127 + # information on only one failed operation returned in an error condition, and 128 + # subsequent actions will not have been attempted. 129 + # 130 + # Since: 1.1 131 + # 132 + # Example: 133 + # 134 + # -> { "execute": "transaction", 135 + # "arguments": { "actions": [ 136 + # { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0", 137 + # "snapshot-file": "/some/place/my-image", 138 + # "format": "qcow2" } }, 139 + # { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile", 140 + # "snapshot-file": "/some/place/my-image2", 141 + # "snapshot-node-name": "node3432", 142 + # "mode": "existing", 143 + # "format": "qcow2" } }, 144 + # { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1", 145 + # "snapshot-file": "/some/place/my-image2", 146 + # "mode": "existing", 147 + # "format": "qcow2" } }, 148 + # { "type": "blockdev-snapshot-internal-sync", "data" : { 149 + # "device": "ide-hd2", 150 + # "name": "snapshot0" } } ] } } 151 + # <- { "return": {} } 152 + # 153 + ## 154 + { 'command': 'transaction', 155 + 'data': { 'actions': [ 'TransactionAction' ], 156 + '*properties': 'TransactionProperties' 157 + } 158 + }