xref: /qemu/qapi/yank.json (revision ceb7a680)
150186051SLukas Straub# -*- Mode: Python -*-
250186051SLukas Straub# vim: filetype=python
350186051SLukas Straub#
450186051SLukas Straub
550186051SLukas Straub##
650186051SLukas Straub# = Yank feature
750186051SLukas Straub##
850186051SLukas Straub
950186051SLukas Straub##
1050186051SLukas Straub# @YankInstanceType:
1150186051SLukas Straub#
1250186051SLukas Straub# An enumeration of yank instance types.  See @YankInstance for more
1350186051SLukas Straub# information.
1450186051SLukas Straub#
1550186051SLukas Straub# Since: 6.0
1650186051SLukas Straub##
1750186051SLukas Straub{ 'enum': 'YankInstanceType',
1850186051SLukas Straub  'data': [ 'block-node', 'chardev', 'migration' ] }
1950186051SLukas Straub
2050186051SLukas Straub##
2150186051SLukas Straub# @YankInstanceBlockNode:
2250186051SLukas Straub#
23a937b6aaSMarkus Armbruster# Specifies which block graph node to yank.  See @YankInstance for
24a937b6aaSMarkus Armbruster# more information.
2550186051SLukas Straub#
2650186051SLukas Straub# @node-name: the name of the block graph node
2750186051SLukas Straub#
2850186051SLukas Straub# Since: 6.0
2950186051SLukas Straub##
3050186051SLukas Straub{ 'struct': 'YankInstanceBlockNode',
3150186051SLukas Straub  'data': { 'node-name': 'str' } }
3250186051SLukas Straub
3350186051SLukas Straub##
3450186051SLukas Straub# @YankInstanceChardev:
3550186051SLukas Straub#
36a937b6aaSMarkus Armbruster# Specifies which character device to yank.  See @YankInstance for
37a937b6aaSMarkus Armbruster# more information.
3850186051SLukas Straub#
3950186051SLukas Straub# @id: the chardev's ID
4050186051SLukas Straub#
4150186051SLukas Straub# Since: 6.0
4250186051SLukas Straub##
4350186051SLukas Straub{ 'struct': 'YankInstanceChardev',
4450186051SLukas Straub  'data': { 'id': 'str' } }
4550186051SLukas Straub
4650186051SLukas Straub##
4750186051SLukas Straub# @YankInstance:
4850186051SLukas Straub#
49a937b6aaSMarkus Armbruster# A yank instance can be yanked with the @yank qmp command to recover
50a937b6aaSMarkus Armbruster# from a hanging QEMU.
5150186051SLukas Straub#
5289a2273bSMarkus Armbruster# @type: yank instance type
5389a2273bSMarkus Armbruster#
5450186051SLukas Straub# Currently implemented yank instances:
55c1101028SMarkus Armbruster#
56a937b6aaSMarkus Armbruster# - nbd block device: Yanking it will shut down the connection to the
57a937b6aaSMarkus Armbruster#   nbd server without attempting to reconnect.
58a937b6aaSMarkus Armbruster# - socket chardev: Yanking it will shut down the connected socket.
59a937b6aaSMarkus Armbruster# - migration: Yanking it will shut down all migration connections.
60a937b6aaSMarkus Armbruster#   Unlike @migrate_cancel, it will not notify the migration process,
61a937b6aaSMarkus Armbruster#   so migration will go into @failed state, instead of @cancelled
62a937b6aaSMarkus Armbruster#   state.  @yank should be used to recover from hangs.
6350186051SLukas Straub#
6450186051SLukas Straub# Since: 6.0
6550186051SLukas Straub##
6650186051SLukas Straub{ 'union': 'YankInstance',
6750186051SLukas Straub  'base': { 'type': 'YankInstanceType' },
6850186051SLukas Straub  'discriminator': 'type',
6950186051SLukas Straub  'data': {
7050186051SLukas Straub      'block-node': 'YankInstanceBlockNode',
7150186051SLukas Straub      'chardev': 'YankInstanceChardev' } }
7250186051SLukas Straub
7350186051SLukas Straub##
7450186051SLukas Straub# @yank:
7550186051SLukas Straub#
76a937b6aaSMarkus Armbruster# Try to recover from hanging QEMU by yanking the specified instances.
77a937b6aaSMarkus Armbruster# See @YankInstance for more information.
7850186051SLukas Straub#
79e701cd77SMarkus Armbruster# @instances: the instances to be yanked
8050186051SLukas Straub#
812746f060SMarkus Armbruster# Errors:
82ceb7a680SMarkus Armbruster#     - If any of the YankInstances doesn't exist, DeviceNotFound
8350186051SLukas Straub#
8450186051SLukas Straub# Example:
8550186051SLukas Straub#
8650186051SLukas Straub#     -> { "execute": "yank",
8750186051SLukas Straub#          "arguments": {
8850186051SLukas Straub#              "instances": [
8950186051SLukas Straub#                   { "type": "block-node",
9050186051SLukas Straub#                     "node-name": "nbd0" }
9150186051SLukas Straub#              ] } }
9250186051SLukas Straub#     <- { "return": {} }
9350186051SLukas Straub#
9450186051SLukas Straub# Since: 6.0
9550186051SLukas Straub##
9650186051SLukas Straub{ 'command': 'yank',
9750186051SLukas Straub  'data': { 'instances': ['YankInstance'] },
9850186051SLukas Straub  'allow-oob': true }
9950186051SLukas Straub
10050186051SLukas Straub##
10150186051SLukas Straub# @query-yank:
10250186051SLukas Straub#
10350186051SLukas Straub# Query yank instances.  See @YankInstance for more information.
10450186051SLukas Straub#
10550186051SLukas Straub# Returns: list of @YankInstance
10650186051SLukas Straub#
10750186051SLukas Straub# Example:
10850186051SLukas Straub#
10950186051SLukas Straub#     -> { "execute": "query-yank" }
11050186051SLukas Straub#     <- { "return": [
11150186051SLukas Straub#              { "type": "block-node",
11250186051SLukas Straub#                "node-name": "nbd0" }
11350186051SLukas Straub#          ] }
11450186051SLukas Straub#
11550186051SLukas Straub# Since: 6.0
11650186051SLukas Straub##
11750186051SLukas Straub{ 'command': 'query-yank',
11850186051SLukas Straub  'returns': ['YankInstance'],
11950186051SLukas Straub  'allow-oob': true }
120