xref: /qemu/qapi/migration.json (revision 354cac28)
148685a8eSMarkus Armbruster# -*- Mode: Python -*-
2f7160f32SAndrea Bolognani# vim: filetype=python
348685a8eSMarkus Armbruster#
448685a8eSMarkus Armbruster
548685a8eSMarkus Armbruster##
648685a8eSMarkus Armbruster# = Migration
748685a8eSMarkus Armbruster##
848685a8eSMarkus Armbruster
948685a8eSMarkus Armbruster{ 'include': 'common.json' }
109aca82baSJuan Quintela{ 'include': 'sockets.json' }
1148685a8eSMarkus Armbruster
1248685a8eSMarkus Armbruster##
1348685a8eSMarkus Armbruster# @MigrationStats:
1448685a8eSMarkus Armbruster#
1548685a8eSMarkus Armbruster# Detailed migration status.
1648685a8eSMarkus Armbruster#
1748685a8eSMarkus Armbruster# @transferred: amount of bytes already transferred to the target VM
1848685a8eSMarkus Armbruster#
19a937b6aaSMarkus Armbruster# @remaining: amount of bytes remaining to be transferred to the
20a937b6aaSMarkus Armbruster#     target VM
2148685a8eSMarkus Armbruster#
2248685a8eSMarkus Armbruster# @total: total amount of bytes involved in the migration process
2348685a8eSMarkus Armbruster#
2448685a8eSMarkus Armbruster# @duplicate: number of duplicate (zero) pages (since 1.2)
2548685a8eSMarkus Armbruster#
2648685a8eSMarkus Armbruster# @normal: number of normal pages (since 1.2)
2748685a8eSMarkus Armbruster#
2848685a8eSMarkus Armbruster# @normal-bytes: number of normal bytes sent (since 1.2)
2948685a8eSMarkus Armbruster#
30a937b6aaSMarkus Armbruster# @dirty-pages-rate: number of pages dirtied by second by the guest
31a937b6aaSMarkus Armbruster#     (since 1.3)
3248685a8eSMarkus Armbruster#
3348685a8eSMarkus Armbruster# @mbps: throughput in megabits/sec.  (since 1.6)
3448685a8eSMarkus Armbruster#
35a937b6aaSMarkus Armbruster# @dirty-sync-count: number of times that dirty ram was synchronized
36a937b6aaSMarkus Armbruster#     (since 2.1)
3748685a8eSMarkus Armbruster#
38a937b6aaSMarkus Armbruster# @postcopy-requests: The number of page requests received from the
39a937b6aaSMarkus Armbruster#     destination (since 2.7)
4048685a8eSMarkus Armbruster#
4148685a8eSMarkus Armbruster# @page-size: The number of bytes per page for the various page-based
4248685a8eSMarkus Armbruster#     statistics (since 2.10)
4348685a8eSMarkus Armbruster#
44a61c45bdSJuan Quintela# @multifd-bytes: The number of bytes sent through multifd (since 3.0)
45a61c45bdSJuan Quintela#
46aecbfe9cSXiao Guangrong# @pages-per-second: the number of memory pages transferred per second
47aecbfe9cSXiao Guangrong#     (Since 4.0)
48aecbfe9cSXiao Guangrong#
49ae680668SDavid Edmondson# @precopy-bytes: The number of bytes sent in the pre-copy phase
50ae680668SDavid Edmondson#     (since 7.0).
51ae680668SDavid Edmondson#
52ae680668SDavid Edmondson# @downtime-bytes: The number of bytes sent while the guest is paused
53ae680668SDavid Edmondson#     (since 7.0).
54ae680668SDavid Edmondson#
55ae680668SDavid Edmondson# @postcopy-bytes: The number of bytes sent during the post-copy phase
56ae680668SDavid Edmondson#     (since 7.0).
57ae680668SDavid Edmondson#
58a937b6aaSMarkus Armbruster# @dirty-sync-missed-zero-copy: Number of times dirty RAM
59a937b6aaSMarkus Armbruster#     synchronization could not avoid copying dirty pages.  This is
60a937b6aaSMarkus Armbruster#     between 0 and @dirty-sync-count * @multifd-channels.  (since
61a937b6aaSMarkus Armbruster#     7.1)
62a937b6aaSMarkus Armbruster#
639bc6e893SMarkus Armbruster# Since: 0.14
6448685a8eSMarkus Armbruster##
6548685a8eSMarkus Armbruster{ 'struct': 'MigrationStats',
6648685a8eSMarkus Armbruster  'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
677b24d326SJuan Quintela           'duplicate': 'int',
687b24d326SJuan Quintela           'normal': 'int',
6948685a8eSMarkus Armbruster           'normal-bytes': 'int', 'dirty-pages-rate': 'int',
7048685a8eSMarkus Armbruster           'mbps': 'number', 'dirty-sync-count': 'int',
71a61c45bdSJuan Quintela           'postcopy-requests': 'int', 'page-size': 'int',
72ae680668SDavid Edmondson           'multifd-bytes': 'uint64', 'pages-per-second': 'uint64',
73ae680668SDavid Edmondson           'precopy-bytes': 'uint64', 'downtime-bytes': 'uint64',
74cf20c897SLeonardo Bras           'postcopy-bytes': 'uint64',
75cf20c897SLeonardo Bras           'dirty-sync-missed-zero-copy': 'uint64' } }
7648685a8eSMarkus Armbruster
7748685a8eSMarkus Armbruster##
7848685a8eSMarkus Armbruster# @XBZRLECacheStats:
7948685a8eSMarkus Armbruster#
8048685a8eSMarkus Armbruster# Detailed XBZRLE migration cache statistics
8148685a8eSMarkus Armbruster#
8248685a8eSMarkus Armbruster# @cache-size: XBZRLE cache size
8348685a8eSMarkus Armbruster#
8448685a8eSMarkus Armbruster# @bytes: amount of bytes already transferred to the target VM
8548685a8eSMarkus Armbruster#
8648685a8eSMarkus Armbruster# @pages: amount of pages transferred to the target VM
8748685a8eSMarkus Armbruster#
8848685a8eSMarkus Armbruster# @cache-miss: number of cache miss
8948685a8eSMarkus Armbruster#
9048685a8eSMarkus Armbruster# @cache-miss-rate: rate of cache miss (since 2.1)
9148685a8eSMarkus Armbruster#
92e460a4b1SWei Wang# @encoding-rate: rate of encoded bytes (since 5.1)
93e460a4b1SWei Wang#
9448685a8eSMarkus Armbruster# @overflow: number of overflows
9548685a8eSMarkus Armbruster#
9648685a8eSMarkus Armbruster# Since: 1.2
9748685a8eSMarkus Armbruster##
9848685a8eSMarkus Armbruster{ 'struct': 'XBZRLECacheStats',
998b9407a0SMarkus Armbruster  'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
10048685a8eSMarkus Armbruster           'cache-miss': 'int', 'cache-miss-rate': 'number',
101e460a4b1SWei Wang           'encoding-rate': 'number', 'overflow': 'int' } }
10248685a8eSMarkus Armbruster
10348685a8eSMarkus Armbruster##
10476e03000SXiao Guangrong# @CompressionStats:
10576e03000SXiao Guangrong#
10676e03000SXiao Guangrong# Detailed migration compression statistics
10776e03000SXiao Guangrong#
10876e03000SXiao Guangrong# @pages: amount of pages compressed and transferred to the target VM
10976e03000SXiao Guangrong#
110a937b6aaSMarkus Armbruster# @busy: count of times that no free thread was available to compress
111a937b6aaSMarkus Armbruster#     data
11276e03000SXiao Guangrong#
11376e03000SXiao Guangrong# @busy-rate: rate of thread busy
11476e03000SXiao Guangrong#
11576e03000SXiao Guangrong# @compressed-size: amount of bytes after compression
11676e03000SXiao Guangrong#
11776e03000SXiao Guangrong# @compression-rate: rate of compressed size
11876e03000SXiao Guangrong#
11976e03000SXiao Guangrong# Since: 3.1
12076e03000SXiao Guangrong##
12176e03000SXiao Guangrong{ 'struct': 'CompressionStats',
12276e03000SXiao Guangrong  'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
12376e03000SXiao Guangrong           'compressed-size': 'int', 'compression-rate': 'number' } }
12476e03000SXiao Guangrong
12576e03000SXiao Guangrong##
12648685a8eSMarkus Armbruster# @MigrationStatus:
12748685a8eSMarkus Armbruster#
12848685a8eSMarkus Armbruster# An enumeration of migration status.
12948685a8eSMarkus Armbruster#
13048685a8eSMarkus Armbruster# @none: no migration has ever happened.
13148685a8eSMarkus Armbruster#
13248685a8eSMarkus Armbruster# @setup: migration process has been initiated.
13348685a8eSMarkus Armbruster#
13448685a8eSMarkus Armbruster# @cancelling: in the process of cancelling migration.
13548685a8eSMarkus Armbruster#
13648685a8eSMarkus Armbruster# @cancelled: cancelling migration is finished.
13748685a8eSMarkus Armbruster#
13848685a8eSMarkus Armbruster# @active: in the process of doing migration.
13948685a8eSMarkus Armbruster#
140a937b6aaSMarkus Armbruster# @postcopy-active: like active, but now in postcopy mode.  (since
141a937b6aaSMarkus Armbruster#     2.5)
14248685a8eSMarkus Armbruster#
14351f63ec7SPeter Maydell# @postcopy-paused: during postcopy but paused.  (since 3.0)
144a688d2c1SPeter Xu#
145a937b6aaSMarkus Armbruster# @postcopy-recover: trying to recover from a paused postcopy.  (since
146a937b6aaSMarkus Armbruster#     3.0)
147135b87b4SPeter Xu#
14848685a8eSMarkus Armbruster# @completed: migration is finished.
14948685a8eSMarkus Armbruster#
15048685a8eSMarkus Armbruster# @failed: some error occurred during migration process.
15148685a8eSMarkus Armbruster#
152a937b6aaSMarkus Armbruster# @colo: VM is in the process of fault tolerance, VM can not get into
153a937b6aaSMarkus Armbruster#     this state unless colo capability is enabled for migration.
154a937b6aaSMarkus Armbruster#     (since 2.8)
15548685a8eSMarkus Armbruster#
15631e06077SDr. David Alan Gilbert# @pre-switchover: Paused before device serialisation.  (since 2.11)
15731e06077SDr. David Alan Gilbert#
158a937b6aaSMarkus Armbruster# @device: During device serialisation when pause-before-switchover is
159a937b6aaSMarkus Armbruster#     enabled (since 2.11)
16031e06077SDr. David Alan Gilbert#
161a937b6aaSMarkus Armbruster# @wait-unplug: wait for device unplug request by guest OS to be
162a937b6aaSMarkus Armbruster#     completed.  (since 4.2)
163c7e0acd5SJens Freimann#
16448685a8eSMarkus Armbruster# Since: 2.3
16548685a8eSMarkus Armbruster##
16648685a8eSMarkus Armbruster{ 'enum': 'MigrationStatus',
16748685a8eSMarkus Armbruster  'data': [ 'none', 'setup', 'cancelling', 'cancelled',
168a688d2c1SPeter Xu            'active', 'postcopy-active', 'postcopy-paused',
169135b87b4SPeter Xu            'postcopy-recover', 'completed', 'failed', 'colo',
170c7e0acd5SJens Freimann            'pre-switchover', 'device', 'wait-unplug' ] }
1713710586cSKirti Wankhede##
1723710586cSKirti Wankhede# @VfioStats:
1733710586cSKirti Wankhede#
1743710586cSKirti Wankhede# Detailed VFIO devices migration statistics
1753710586cSKirti Wankhede#
176a937b6aaSMarkus Armbruster# @transferred: amount of bytes transferred to the target VM by VFIO
177a937b6aaSMarkus Armbruster#     devices
1783710586cSKirti Wankhede#
1793710586cSKirti Wankhede# Since: 5.2
1803710586cSKirti Wankhede##
1813710586cSKirti Wankhede{ 'struct': 'VfioStats',
1823710586cSKirti Wankhede  'data': {'transferred': 'int' } }
18348685a8eSMarkus Armbruster
18448685a8eSMarkus Armbruster##
18548685a8eSMarkus Armbruster# @MigrationInfo:
18648685a8eSMarkus Armbruster#
18748685a8eSMarkus Armbruster# Information about current migration process.
18848685a8eSMarkus Armbruster#
18948685a8eSMarkus Armbruster# @status: @MigrationStatus describing the current migration status.
190a937b6aaSMarkus Armbruster#     If this field is not returned, no migration process has been
191a937b6aaSMarkus Armbruster#     initiated
19248685a8eSMarkus Armbruster#
193a937b6aaSMarkus Armbruster# @ram: @MigrationStats containing detailed migration status, only
194a937b6aaSMarkus Armbruster#     returned if status is 'active' or 'completed'(since 1.2)
19548685a8eSMarkus Armbruster#
19648685a8eSMarkus Armbruster# @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
19748685a8eSMarkus Armbruster#     migration statistics, only returned if XBZRLE feature is on and
19848685a8eSMarkus Armbruster#     status is 'active' or 'completed' (since 1.2)
19948685a8eSMarkus Armbruster#
20048685a8eSMarkus Armbruster# @total-time: total amount of milliseconds since migration started.
201a937b6aaSMarkus Armbruster#     If migration has ended, it returns the total migration time.
202a937b6aaSMarkus Armbruster#     (since 1.2)
20348685a8eSMarkus Armbruster#
204a937b6aaSMarkus Armbruster# @downtime: only present when migration finishes correctly total
205a937b6aaSMarkus Armbruster#     downtime in milliseconds for the guest.  (since 1.3)
20648685a8eSMarkus Armbruster#
207a937b6aaSMarkus Armbruster# @expected-downtime: only present while migration is active expected
208a937b6aaSMarkus Armbruster#     downtime in milliseconds for the guest in last walk of the dirty
209a937b6aaSMarkus Armbruster#     bitmap.  (since 1.3)
21048685a8eSMarkus Armbruster#
211a660eed4SPeter Maydell# @setup-time: amount of setup time in milliseconds *before* the
212a937b6aaSMarkus Armbruster#     iterations begin but *after* the QMP command is issued.  This is
213a937b6aaSMarkus Armbruster#     designed to provide an accounting of any activities (such as
214a937b6aaSMarkus Armbruster#     RDMA pinning) which may be expensive, but do not actually occur
215a937b6aaSMarkus Armbruster#     during the iterative migration rounds themselves.  (since 1.6)
21648685a8eSMarkus Armbruster#
21748685a8eSMarkus Armbruster# @cpu-throttle-percentage: percentage of time guest cpus are being
218a937b6aaSMarkus Armbruster#     throttled during auto-converge.  This is only present when
219a937b6aaSMarkus Armbruster#     auto-converge has started throttling guest cpus.  (Since 2.7)
22048685a8eSMarkus Armbruster#
221c94143e5SPeter Xu# @error-desc: the human readable error description string.  Clients
222c94143e5SPeter Xu#     should not attempt to parse the error strings.  (Since 2.7)
22348685a8eSMarkus Armbruster#
224a937b6aaSMarkus Armbruster# @postcopy-blocktime: total time when all vCPU were blocked during
225a937b6aaSMarkus Armbruster#     postcopy live migration.  This is only present when the
226a937b6aaSMarkus Armbruster#     postcopy-blocktime migration capability is enabled.  (Since 3.0)
22765ace060SAlexey Perevalov#
228a937b6aaSMarkus Armbruster# @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.
229a937b6aaSMarkus Armbruster#     This is only present when the postcopy-blocktime migration
230a937b6aaSMarkus Armbruster#     capability is enabled.  (Since 3.0)
23165ace060SAlexey Perevalov#
232a937b6aaSMarkus Armbruster# @socket-address: Only used for tcp, to know what the real port is
233a937b6aaSMarkus Armbruster#     (Since 4.0)
2349aca82baSJuan Quintela#
235a937b6aaSMarkus Armbruster# @vfio: @VfioStats containing detailed VFIO devices migration
236a937b6aaSMarkus Armbruster#     statistics, only returned if VFIO device is present, migration
237a937b6aaSMarkus Armbruster#     is supported by all VFIO devices and status is 'active' or
238a937b6aaSMarkus Armbruster#     'completed' (since 5.2)
2393710586cSKirti Wankhede#
240a937b6aaSMarkus Armbruster# @blocked-reasons: A list of reasons an outgoing migration is
241a937b6aaSMarkus Armbruster#     blocked.  Present and non-empty when migration is blocked.
242e11ce6c0SMarkus Armbruster#     (since 6.0)
243e11ce6c0SMarkus Armbruster#
2448abc8115SHyman Huang(黄勇)# @dirty-limit-throttle-time-per-round: Maximum throttle time
2458abc8115SHyman Huang(黄勇)#     (in microseconds) of virtual CPUs each dirty ring full round,
2468abc8115SHyman Huang(黄勇)#     which shows how MigrationCapability dirty-limit affects the
2478abc8115SHyman Huang(黄勇)#     guest during live migration.  (Since 8.1)
24815699cf5SHyman Huang(黄勇)#
2498abc8115SHyman Huang(黄勇)# @dirty-limit-ring-full-time: Estimated average dirty ring full time
2508abc8115SHyman Huang(黄勇)#     (in microseconds) for each dirty ring full round.  The value
2518abc8115SHyman Huang(黄勇)#     equals the dirty ring memory size divided by the average dirty
2528abc8115SHyman Huang(黄勇)#     page rate of the virtual CPU, which can be used to observe the
2538abc8115SHyman Huang(黄勇)#     average memory load of the virtual CPU indirectly.  Note that
2548abc8115SHyman Huang(黄勇)#     zero means guest doesn't dirty memory.  (Since 8.1)
25515699cf5SHyman Huang(黄勇)#
2569bc6e893SMarkus Armbruster# Since: 0.14
25748685a8eSMarkus Armbruster##
25848685a8eSMarkus Armbruster{ 'struct': 'MigrationInfo',
25948685a8eSMarkus Armbruster  'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
2603710586cSKirti Wankhede           '*vfio': 'VfioStats',
26148685a8eSMarkus Armbruster           '*xbzrle-cache': 'XBZRLECacheStats',
26248685a8eSMarkus Armbruster           '*total-time': 'int',
26348685a8eSMarkus Armbruster           '*expected-downtime': 'int',
26448685a8eSMarkus Armbruster           '*downtime': 'int',
26548685a8eSMarkus Armbruster           '*setup-time': 'int',
26648685a8eSMarkus Armbruster           '*cpu-throttle-percentage': 'int',
26765ace060SAlexey Perevalov           '*error-desc': 'str',
2683af8554bSDr. David Alan Gilbert           '*blocked-reasons': ['str'],
26965ace060SAlexey Perevalov           '*postcopy-blocktime': 'uint32',
27076e03000SXiao Guangrong           '*postcopy-vcpu-blocktime': ['uint32'],
27115699cf5SHyman Huang(黄勇)           '*socket-address': ['SocketAddress'],
27215699cf5SHyman Huang(黄勇)           '*dirty-limit-throttle-time-per-round': 'uint64',
27315699cf5SHyman Huang(黄勇)           '*dirty-limit-ring-full-time': 'uint64'} }
27448685a8eSMarkus Armbruster
27548685a8eSMarkus Armbruster##
27648685a8eSMarkus Armbruster# @query-migrate:
27748685a8eSMarkus Armbruster#
27848685a8eSMarkus Armbruster# Returns information about current migration process.  If migration
27948685a8eSMarkus Armbruster# is active there will be another json-object with RAM migration
280eef0bae3SFabiano Rosas# status.
28148685a8eSMarkus Armbruster#
28248685a8eSMarkus Armbruster# Returns: @MigrationInfo
28348685a8eSMarkus Armbruster#
2849bc6e893SMarkus Armbruster# Since: 0.14
28548685a8eSMarkus Armbruster#
28637fa48a4SMarkus Armbruster# Examples:
28748685a8eSMarkus Armbruster#
28848685a8eSMarkus Armbruster#     1. Before the first migration
28948685a8eSMarkus Armbruster#
29048685a8eSMarkus Armbruster#     -> { "execute": "query-migrate" }
29148685a8eSMarkus Armbruster#     <- { "return": {} }
29248685a8eSMarkus Armbruster#
29348685a8eSMarkus Armbruster#     2. Migration is done and has succeeded
29448685a8eSMarkus Armbruster#
29548685a8eSMarkus Armbruster#     -> { "execute": "query-migrate" }
29648685a8eSMarkus Armbruster#     <- { "return": {
29748685a8eSMarkus Armbruster#             "status": "completed",
298be1d2c49Sjialina01#             "total-time":12345,
299be1d2c49Sjialina01#             "setup-time":12345,
300be1d2c49Sjialina01#             "downtime":12345,
30148685a8eSMarkus Armbruster#             "ram":{
30248685a8eSMarkus Armbruster#               "transferred":123,
30348685a8eSMarkus Armbruster#               "remaining":123,
30448685a8eSMarkus Armbruster#               "total":246,
30548685a8eSMarkus Armbruster#               "duplicate":123,
30648685a8eSMarkus Armbruster#               "normal":123,
30748685a8eSMarkus Armbruster#               "normal-bytes":123456,
30848685a8eSMarkus Armbruster#               "dirty-sync-count":15
30948685a8eSMarkus Armbruster#             }
31048685a8eSMarkus Armbruster#          }
31148685a8eSMarkus Armbruster#        }
31248685a8eSMarkus Armbruster#
31348685a8eSMarkus Armbruster#     3. Migration is done and has failed
31448685a8eSMarkus Armbruster#
31548685a8eSMarkus Armbruster#     -> { "execute": "query-migrate" }
31648685a8eSMarkus Armbruster#     <- { "return": { "status": "failed" } }
31748685a8eSMarkus Armbruster#
318eef0bae3SFabiano Rosas#     4. Migration is being performed:
31948685a8eSMarkus Armbruster#
32048685a8eSMarkus Armbruster#     -> { "execute": "query-migrate" }
32148685a8eSMarkus Armbruster#     <- {
32248685a8eSMarkus Armbruster#           "return":{
32348685a8eSMarkus Armbruster#              "status":"active",
324be1d2c49Sjialina01#              "total-time":12345,
325be1d2c49Sjialina01#              "setup-time":12345,
326be1d2c49Sjialina01#              "expected-downtime":12345,
32748685a8eSMarkus Armbruster#              "ram":{
32848685a8eSMarkus Armbruster#                 "transferred":123,
32948685a8eSMarkus Armbruster#                 "remaining":123,
33048685a8eSMarkus Armbruster#                 "total":246,
33148685a8eSMarkus Armbruster#                 "duplicate":123,
33248685a8eSMarkus Armbruster#                 "normal":123,
33348685a8eSMarkus Armbruster#                 "normal-bytes":123456,
33448685a8eSMarkus Armbruster#                 "dirty-sync-count":15
33548685a8eSMarkus Armbruster#              }
33648685a8eSMarkus Armbruster#           }
33748685a8eSMarkus Armbruster#        }
33848685a8eSMarkus Armbruster#
339eef0bae3SFabiano Rosas#     5. Migration is being performed and XBZRLE is active:
34048685a8eSMarkus Armbruster#
34148685a8eSMarkus Armbruster#     -> { "execute": "query-migrate" }
34248685a8eSMarkus Armbruster#     <- {
34348685a8eSMarkus Armbruster#           "return":{
34448685a8eSMarkus Armbruster#              "status":"active",
345be1d2c49Sjialina01#              "total-time":12345,
346be1d2c49Sjialina01#              "setup-time":12345,
347be1d2c49Sjialina01#              "expected-downtime":12345,
34848685a8eSMarkus Armbruster#              "ram":{
34948685a8eSMarkus Armbruster#                 "total":1057024,
35048685a8eSMarkus Armbruster#                 "remaining":1053304,
35148685a8eSMarkus Armbruster#                 "transferred":3720,
35248685a8eSMarkus Armbruster#                 "duplicate":10,
35348685a8eSMarkus Armbruster#                 "normal":3333,
35448685a8eSMarkus Armbruster#                 "normal-bytes":3412992,
35548685a8eSMarkus Armbruster#                 "dirty-sync-count":15
35648685a8eSMarkus Armbruster#              },
35748685a8eSMarkus Armbruster#              "xbzrle-cache":{
35848685a8eSMarkus Armbruster#                 "cache-size":67108864,
35948685a8eSMarkus Armbruster#                 "bytes":20971520,
36048685a8eSMarkus Armbruster#                 "pages":2444343,
36148685a8eSMarkus Armbruster#                 "cache-miss":2244,
36248685a8eSMarkus Armbruster#                 "cache-miss-rate":0.123,
363e460a4b1SWei Wang#                 "encoding-rate":80.1,
36448685a8eSMarkus Armbruster#                 "overflow":34434
36548685a8eSMarkus Armbruster#              }
36648685a8eSMarkus Armbruster#           }
36748685a8eSMarkus Armbruster#        }
36848685a8eSMarkus Armbruster##
36948685a8eSMarkus Armbruster{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
37048685a8eSMarkus Armbruster
37148685a8eSMarkus Armbruster##
37248685a8eSMarkus Armbruster# @MigrationCapability:
37348685a8eSMarkus Armbruster#
37448685a8eSMarkus Armbruster# Migration capabilities enumeration
37548685a8eSMarkus Armbruster#
376a937b6aaSMarkus Armbruster# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length
377a937b6aaSMarkus Armbruster#     Encoding). This feature allows us to minimize migration traffic
378a937b6aaSMarkus Armbruster#     for certain work loads, by sending compressed difference of the
379a937b6aaSMarkus Armbruster#     pages
38048685a8eSMarkus Armbruster#
381a937b6aaSMarkus Armbruster# @rdma-pin-all: Controls whether or not the entire VM memory
382a937b6aaSMarkus Armbruster#     footprint is mlock()'d on demand or all at once.  Refer to
383a937b6aaSMarkus Armbruster#     docs/rdma.txt for usage.  Disabled by default.  (since 2.0)
38448685a8eSMarkus Armbruster#
385a937b6aaSMarkus Armbruster# @zero-blocks: During storage migration encode blocks of zeroes
386a937b6aaSMarkus Armbruster#     efficiently.  This essentially saves 1MB of zeroes per block on
387a937b6aaSMarkus Armbruster#     the wire.  Enabling requires source and target VM to support
388a937b6aaSMarkus Armbruster#     this feature.  To enable it is sufficient to enable the
389a937b6aaSMarkus Armbruster#     capability on the source VM. The feature is disabled by default.
390a937b6aaSMarkus Armbruster#     (since 1.6)
39148685a8eSMarkus Armbruster#
392e4ceec29SJuan Quintela# @events: generate events for each migration state change (since 2.4)
39348685a8eSMarkus Armbruster#
394a937b6aaSMarkus Armbruster# @auto-converge: If enabled, QEMU will automatically throttle down
395a937b6aaSMarkus Armbruster#     the guest to speed up convergence of RAM migration.  (since 1.6)
39648685a8eSMarkus Armbruster#
397a937b6aaSMarkus Armbruster# @postcopy-ram: Start executing on the migration target before all of
398a937b6aaSMarkus Armbruster#     RAM has been migrated, pulling the remaining pages along as
399a937b6aaSMarkus Armbruster#     needed.  The capacity must have the same setting on both source
400a937b6aaSMarkus Armbruster#     and target or migration will not even start.  NOTE: If the
401a937b6aaSMarkus Armbruster#     migration fails during postcopy the VM will fail.  (since 2.6)
40248685a8eSMarkus Armbruster#
403a937b6aaSMarkus Armbruster# @x-colo: If enabled, migration will never end, and the state of the
404a937b6aaSMarkus Armbruster#     VM on the primary side will be migrated continuously to the VM
405a937b6aaSMarkus Armbruster#     on secondary side, this process is called COarse-Grain LOck
406a937b6aaSMarkus Armbruster#     Stepping (COLO) for Non-stop Service.  (since 2.8)
40748685a8eSMarkus Armbruster#
408a937b6aaSMarkus Armbruster# @release-ram: if enabled, qemu will free the migrated ram pages on
409a937b6aaSMarkus Armbruster#     the source during postcopy-ram migration.  (since 2.9)
41048685a8eSMarkus Armbruster#
41148685a8eSMarkus Armbruster# @return-path: If enabled, migration will use the return path even
41248685a8eSMarkus Armbruster#     for precopy.  (since 2.10)
41348685a8eSMarkus Armbruster#
414a937b6aaSMarkus Armbruster# @pause-before-switchover: Pause outgoing migration before
415a937b6aaSMarkus Armbruster#     serialising device state and before disabling block IO (since
416a937b6aaSMarkus Armbruster#     2.11)
41793fbd031SDr. David Alan Gilbert#
418cbfd6c95SJuan Quintela# @multifd: Use more than one fd for migration (since 4.0)
41930126bbfSJuan Quintela#
42055efc8c2SVladimir Sementsov-Ogievskiy# @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
42155efc8c2SVladimir Sementsov-Ogievskiy#     (since 2.12)
42255efc8c2SVladimir Sementsov-Ogievskiy#
423f22f928eSAlexey Perevalov# @postcopy-blocktime: Calculate downtime for postcopy live migration
42451f63ec7SPeter Maydell#     (since 3.0)
425f22f928eSAlexey Perevalov#
426a937b6aaSMarkus Armbruster# @late-block-activate: If enabled, the destination will not activate
427a937b6aaSMarkus Armbruster#     block devices (and thus take locks) immediately at the end of
428a937b6aaSMarkus Armbruster#     migration.  (since 3.0)
4290f073f44SDr. David Alan Gilbert#
4309e272073SMarkus Armbruster# @x-ignore-shared: If enabled, QEMU will not migrate shared memory
4319e272073SMarkus Armbruster#     that is accessible on the destination machine.  (since 4.0)
43218269069SYury Kotov#
433b9d68df6SYury Kotov# @validate-uuid: Send the UUID of the source to allow the destination
434b9d68df6SYury Kotov#     to ensure it is the same.  (since 4.2)
435b9d68df6SYury Kotov#
436a937b6aaSMarkus Armbruster# @background-snapshot: If enabled, the migration stream will be a
437a937b6aaSMarkus Armbruster#     snapshot of the VM exactly at the point when the migration
438209e64d9SMarkus Armbruster#     procedure starts.  The VM RAM is saved with running VM.
439209e64d9SMarkus Armbruster#     (since 6.0)
4406e8c25b4SAndrey Gruzdev#
441a937b6aaSMarkus Armbruster# @zero-copy-send: Controls behavior on sending memory pages on
442a937b6aaSMarkus Armbruster#     migration.  When true, enables a zero-copy mechanism for sending
443a937b6aaSMarkus Armbruster#     memory pages, if host supports it.  Requires that QEMU be
444a937b6aaSMarkus Armbruster#     permitted to use locked memory for guest RAM pages.  (since 7.1)
445a937b6aaSMarkus Armbruster#
446a937b6aaSMarkus Armbruster# @postcopy-preempt: If enabled, the migration process will allow
447a937b6aaSMarkus Armbruster#     postcopy requests to preempt precopy stream, so postcopy
448a937b6aaSMarkus Armbruster#     requests will be handled faster.  This is a performance feature
449a937b6aaSMarkus Armbruster#     and should not affect the correctness of postcopy migration.
450ce5b0f4aSPeter Xu#     (since 7.1)
4511abaec9aSLeonardo Bras#
4526574232fSAvihai Horon# @switchover-ack: If enabled, migration will not stop the source VM
4536574232fSAvihai Horon#     and complete the migration until an ACK is received from the
4546574232fSAvihai Horon#     destination that it's OK to do so.  Exactly when this ACK is
4559e272073SMarkus Armbruster#     sent depends on the migrated devices that use this feature.  For
4569e272073SMarkus Armbruster#     example, a device can use it to make sure some of its data is
4579e272073SMarkus Armbruster#     sent and loaded in the destination before doing switchover.
4586574232fSAvihai Horon#     This can reduce downtime if devices that support this capability
4596574232fSAvihai Horon#     are present.  'return-path' capability must be enabled to use
4606574232fSAvihai Horon#     it.  (since 8.1)
4616574232fSAvihai Horon#
462ef965377SHyman Huang(黄勇)# @dirty-limit: If enabled, migration will throttle vCPUs as needed to
463ef965377SHyman Huang(黄勇)#     keep their dirty page rate within @vcpu-dirty-limit.  This can
464ef965377SHyman Huang(黄勇)#     improve responsiveness of large guests during live migration,
465ef965377SHyman Huang(黄勇)#     and can result in more stable read performance.  Requires KVM
466ef965377SHyman Huang(黄勇)#     with accelerator property "dirty-ring-size" set.  (Since 8.1)
467dc623955SHyman Huang(黄勇)#
4684ed49febSFabiano Rosas# @mapped-ram: Migrate using fixed offsets in the migration file for
4694ed49febSFabiano Rosas#     each RAM page.  Requires a migration URI that supports seeking,
4704ed49febSFabiano Rosas#     such as a file.  (since 9.0)
4714ed49febSFabiano Rosas#
4729fb49daaSMarkus Armbruster# Features:
473a937b6aaSMarkus Armbruster#
4749fb49daaSMarkus Armbruster# @unstable: Members @x-colo and @x-ignore-shared are experimental.
4759fb49daaSMarkus Armbruster#
47648685a8eSMarkus Armbruster# Since: 1.2
47748685a8eSMarkus Armbruster##
47848685a8eSMarkus Armbruster{ 'enum': 'MigrationCapability',
47948685a8eSMarkus Armbruster  'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
480864128dfSJuan Quintela           'events', 'postcopy-ram',
4819fb49daaSMarkus Armbruster           { 'name': 'x-colo', 'features': [ 'unstable' ] },
4829fb49daaSMarkus Armbruster           'release-ram',
48366db46caSJuan Quintela           'return-path', 'pause-before-switchover', 'multifd',
48418269069SYury Kotov           'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
4859fb49daaSMarkus Armbruster           { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
4861abaec9aSLeonardo Bras           'validate-uuid', 'background-snapshot',
487dc623955SHyman Huang(黄勇)           'zero-copy-send', 'postcopy-preempt', 'switchover-ack',
4884ed49febSFabiano Rosas           'dirty-limit', 'mapped-ram'] }
48948685a8eSMarkus Armbruster
49048685a8eSMarkus Armbruster##
49148685a8eSMarkus Armbruster# @MigrationCapabilityStatus:
49248685a8eSMarkus Armbruster#
49348685a8eSMarkus Armbruster# Migration capability information
49448685a8eSMarkus Armbruster#
49548685a8eSMarkus Armbruster# @capability: capability enum
49648685a8eSMarkus Armbruster#
49748685a8eSMarkus Armbruster# @state: capability state bool
49848685a8eSMarkus Armbruster#
49948685a8eSMarkus Armbruster# Since: 1.2
50048685a8eSMarkus Armbruster##
50148685a8eSMarkus Armbruster{ 'struct': 'MigrationCapabilityStatus',
50248685a8eSMarkus Armbruster  'data': { 'capability': 'MigrationCapability', 'state': 'bool' } }
50348685a8eSMarkus Armbruster
50448685a8eSMarkus Armbruster##
50548685a8eSMarkus Armbruster# @migrate-set-capabilities:
50648685a8eSMarkus Armbruster#
50748685a8eSMarkus Armbruster# Enable/Disable the following migration capabilities (like xbzrle)
50848685a8eSMarkus Armbruster#
50948685a8eSMarkus Armbruster# @capabilities: json array of capability modifications to make
51048685a8eSMarkus Armbruster#
51148685a8eSMarkus Armbruster# Since: 1.2
51248685a8eSMarkus Armbruster#
51348685a8eSMarkus Armbruster# Example:
51448685a8eSMarkus Armbruster#
51548685a8eSMarkus Armbruster#     -> { "execute": "migrate-set-capabilities" , "arguments":
51648685a8eSMarkus Armbruster#          { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
51737fa48a4SMarkus Armbruster#     <- { "return": {} }
51848685a8eSMarkus Armbruster##
51948685a8eSMarkus Armbruster{ 'command': 'migrate-set-capabilities',
52048685a8eSMarkus Armbruster  'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
52148685a8eSMarkus Armbruster
52248685a8eSMarkus Armbruster##
52348685a8eSMarkus Armbruster# @query-migrate-capabilities:
52448685a8eSMarkus Armbruster#
52548685a8eSMarkus Armbruster# Returns information about the current migration capabilities status
52648685a8eSMarkus Armbruster#
527d93ed1bdSMarkus Armbruster# Returns: @MigrationCapabilityStatus
52848685a8eSMarkus Armbruster#
52948685a8eSMarkus Armbruster# Since: 1.2
53048685a8eSMarkus Armbruster#
53148685a8eSMarkus Armbruster# Example:
53248685a8eSMarkus Armbruster#
53348685a8eSMarkus Armbruster#     -> { "execute": "query-migrate-capabilities" }
53448685a8eSMarkus Armbruster#     <- { "return": [
53548685a8eSMarkus Armbruster#           {"state": false, "capability": "xbzrle"},
53648685a8eSMarkus Armbruster#           {"state": false, "capability": "rdma-pin-all"},
53748685a8eSMarkus Armbruster#           {"state": false, "capability": "auto-converge"},
53848685a8eSMarkus Armbruster#           {"state": false, "capability": "zero-blocks"},
53948685a8eSMarkus Armbruster#           {"state": true, "capability": "events"},
54048685a8eSMarkus Armbruster#           {"state": false, "capability": "postcopy-ram"},
54148685a8eSMarkus Armbruster#           {"state": false, "capability": "x-colo"}
54248685a8eSMarkus Armbruster#        ]}
54348685a8eSMarkus Armbruster##
54448685a8eSMarkus Armbruster{ 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
54548685a8eSMarkus Armbruster
54648685a8eSMarkus Armbruster##
54796eef042SJuan Quintela# @MultiFDCompression:
54896eef042SJuan Quintela#
54996eef042SJuan Quintela# An enumeration of multifd compression methods.
55096eef042SJuan Quintela#
55196eef042SJuan Quintela# @none: no compression.
552a937b6aaSMarkus Armbruster#
5537ec2c2b3SJuan Quintela# @zlib: use zlib compression method.
554a937b6aaSMarkus Armbruster#
55587dc6f5fSJuan Quintela# @zstd: use zstd compression method.
55696eef042SJuan Quintela#
557*354cac28SYuan Liu# @qpl: use qpl compression method.  Query Processing Library(qpl) is
558*354cac28SYuan Liu#       based on the deflate compression algorithm and use the Intel
559*354cac28SYuan Liu#       In-Memory Analytics Accelerator(IAA) accelerated compression
560*354cac28SYuan Liu#       and decompression.  (Since 9.1)
561*354cac28SYuan Liu#
56296eef042SJuan Quintela# Since: 5.0
56396eef042SJuan Quintela##
56496eef042SJuan Quintela{ 'enum': 'MultiFDCompression',
56587dc6f5fSJuan Quintela  'data': [ 'none', 'zlib',
566*354cac28SYuan Liu            { 'name': 'zstd', 'if': 'CONFIG_ZSTD' },
567*354cac28SYuan Liu            { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] }
56896eef042SJuan Quintela
56996eef042SJuan Quintela##
570eea1e5c9SSteve Sistare# @MigMode:
571eea1e5c9SSteve Sistare#
572eea1e5c9SSteve Sistare# @normal: the original form of migration.  (since 8.2)
573eea1e5c9SSteve Sistare#
574209e64d9SMarkus Armbruster# @cpr-reboot: The migrate command stops the VM and saves state to the
575209e64d9SMarkus Armbruster#     URI.  After quitting QEMU, the user resumes by running QEMU
576209e64d9SMarkus Armbruster#     -incoming.
577ce5db1cbSSteve Sistare#
57887a28487SSteve Sistare#     This mode allows the user to quit QEMU, optionally update and
57987a28487SSteve Sistare#     reboot the OS, and restart QEMU.  If the user reboots, the URI
58087a28487SSteve Sistare#     must persist across the reboot, such as by using a file.
581ce5db1cbSSteve Sistare#
58287a28487SSteve Sistare#     Unlike normal mode, the use of certain local storage options
58387a28487SSteve Sistare#     does not block the migration, but the user must not modify the
58487a28487SSteve Sistare#     contents of guest block devices between the quit and restart.
585ce5db1cbSSteve Sistare#
586209e64d9SMarkus Armbruster#     This mode supports VFIO devices provided the user first puts the
587209e64d9SMarkus Armbruster#     guest in the suspended runstate, such as by issuing
58887a28487SSteve Sistare#     guest-suspend-ram to the QEMU guest agent.
589ce5db1cbSSteve Sistare#
59087a28487SSteve Sistare#     Best performance is achieved when the memory backend is shared
59187a28487SSteve Sistare#     and the @x-ignore-shared migration capability is set, but this
59287a28487SSteve Sistare#     is not required.  Further, if the user reboots before restarting
59387a28487SSteve Sistare#     such a configuration, the shared memory must persist across the
59487a28487SSteve Sistare#     reboot, such as by backing it with a dax device.
595ce5db1cbSSteve Sistare#
59687a28487SSteve Sistare#     @cpr-reboot may not be used with postcopy, background-snapshot,
59787a28487SSteve Sistare#     or COLO.
598cbdafc1bSSteve Sistare#
599a87e6451SSteve Sistare#     (since 8.2)
600eea1e5c9SSteve Sistare##
601eea1e5c9SSteve Sistare{ 'enum': 'MigMode',
602a87e6451SSteve Sistare  'data': [ 'normal', 'cpr-reboot' ] }
603eea1e5c9SSteve Sistare
604eea1e5c9SSteve Sistare##
6055fdbb1dfSHao Xiang# @ZeroPageDetection:
6065fdbb1dfSHao Xiang#
6075fdbb1dfSHao Xiang# @none: Do not perform zero page checking.
6085fdbb1dfSHao Xiang#
6095fdbb1dfSHao Xiang# @legacy: Perform zero page checking in main migration thread.
6105fdbb1dfSHao Xiang#
611303e6f54SHao Xiang# @multifd: Perform zero page checking in multifd sender thread if
612209e64d9SMarkus Armbruster#     multifd migration is enabled, else in the main migration thread
613209e64d9SMarkus Armbruster#     as for @legacy.
614303e6f54SHao Xiang#
6155fdbb1dfSHao Xiang# Since: 9.0
6165fdbb1dfSHao Xiang##
6175fdbb1dfSHao Xiang{ 'enum': 'ZeroPageDetection',
618303e6f54SHao Xiang  'data': [ 'none', 'legacy', 'multifd' ] }
6195fdbb1dfSHao Xiang
6205fdbb1dfSHao Xiang##
6216e9f21a2SPeter Krempa# @BitmapMigrationBitmapAliasTransform:
6226e9f21a2SPeter Krempa#
623a937b6aaSMarkus Armbruster# @persistent: If present, the bitmap will be made persistent or
624a937b6aaSMarkus Armbruster#     transient depending on this parameter.
6256e9f21a2SPeter Krempa#
6266e9f21a2SPeter Krempa# Since: 6.0
6276e9f21a2SPeter Krempa##
6286e9f21a2SPeter Krempa{ 'struct': 'BitmapMigrationBitmapAliasTransform',
6296e9f21a2SPeter Krempa  'data': {
6306e9f21a2SPeter Krempa      '*persistent': 'bool'
6316e9f21a2SPeter Krempa  } }
6326e9f21a2SPeter Krempa
6336e9f21a2SPeter Krempa##
63431e4c354SMax Reitz# @BitmapMigrationBitmapAlias:
63531e4c354SMax Reitz#
63631e4c354SMax Reitz# @name: The name of the bitmap.
63731e4c354SMax Reitz#
63831e4c354SMax Reitz# @alias: An alias name for migration (for example the bitmap name on
63931e4c354SMax Reitz#     the opposite site).
64031e4c354SMax Reitz#
641a937b6aaSMarkus Armbruster# @transform: Allows the modification of the migrated bitmap.  (since
642a937b6aaSMarkus Armbruster#     6.0)
6436e9f21a2SPeter Krempa#
64431e4c354SMax Reitz# Since: 5.2
64531e4c354SMax Reitz##
64631e4c354SMax Reitz{ 'struct': 'BitmapMigrationBitmapAlias',
64731e4c354SMax Reitz  'data': {
64831e4c354SMax Reitz      'name': 'str',
6496e9f21a2SPeter Krempa      'alias': 'str',
6506e9f21a2SPeter Krempa      '*transform': 'BitmapMigrationBitmapAliasTransform'
65131e4c354SMax Reitz  } }
65231e4c354SMax Reitz
65331e4c354SMax Reitz##
65431e4c354SMax Reitz# @BitmapMigrationNodeAlias:
65531e4c354SMax Reitz#
65631e4c354SMax Reitz# Maps a block node name and the bitmaps it has to aliases for dirty
65731e4c354SMax Reitz# bitmap migration.
65831e4c354SMax Reitz#
65931e4c354SMax Reitz# @node-name: A block node name.
66031e4c354SMax Reitz#
661a937b6aaSMarkus Armbruster# @alias: An alias block node name for migration (for example the node
662a937b6aaSMarkus Armbruster#     name on the opposite site).
66331e4c354SMax Reitz#
66431e4c354SMax Reitz# @bitmaps: Mappings for the bitmaps on this node.
66531e4c354SMax Reitz#
66631e4c354SMax Reitz# Since: 5.2
66731e4c354SMax Reitz##
66831e4c354SMax Reitz{ 'struct': 'BitmapMigrationNodeAlias',
66931e4c354SMax Reitz  'data': {
67031e4c354SMax Reitz      'node-name': 'str',
67131e4c354SMax Reitz      'alias': 'str',
67231e4c354SMax Reitz      'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
67331e4c354SMax Reitz  } }
67431e4c354SMax Reitz
67531e4c354SMax Reitz##
67648685a8eSMarkus Armbruster# @MigrationParameter:
67748685a8eSMarkus Armbruster#
67848685a8eSMarkus Armbruster# Migration parameters enumeration
67948685a8eSMarkus Armbruster#
680a937b6aaSMarkus Armbruster# @announce-initial: Initial delay (in milliseconds) before sending
681a937b6aaSMarkus Armbruster#     the first announce (Since 4.0)
682ee3d96baSDr. David Alan Gilbert#
683a937b6aaSMarkus Armbruster# @announce-max: Maximum delay (in milliseconds) between packets in
684a937b6aaSMarkus Armbruster#     the announcement (Since 4.0)
685ee3d96baSDr. David Alan Gilbert#
686a937b6aaSMarkus Armbruster# @announce-rounds: Number of self-announce packets sent after
687a937b6aaSMarkus Armbruster#     migration (Since 4.0)
688ee3d96baSDr. David Alan Gilbert#
689a937b6aaSMarkus Armbruster# @announce-step: Increase in delay (in milliseconds) between
690a937b6aaSMarkus Armbruster#     subsequent packets in the announcement (Since 4.0)
691ee3d96baSDr. David Alan Gilbert#
692a937b6aaSMarkus Armbruster# @throttle-trigger-threshold: The ratio of bytes_dirty_period and
693a937b6aaSMarkus Armbruster#     bytes_xfer_period to trigger throttling.  It is expressed as
694a937b6aaSMarkus Armbruster#     percentage.  The default value is 50.  (Since 5.0)
695dc14a470SKeqian Zhu#
696a937b6aaSMarkus Armbruster# @cpu-throttle-initial: Initial percentage of time guest cpus are
697a937b6aaSMarkus Armbruster#     throttled when migration auto-converge is activated.  The
69848685a8eSMarkus Armbruster#     default value is 20.  (Since 2.7)
69948685a8eSMarkus Armbruster#
70048685a8eSMarkus Armbruster# @cpu-throttle-increment: throttle percentage increase each time
701a937b6aaSMarkus Armbruster#     auto-converge detects that migration is not making progress.
702a937b6aaSMarkus Armbruster#     The default value is 10.  (Since 2.7)
70348685a8eSMarkus Armbruster#
704a937b6aaSMarkus Armbruster# @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
705a937b6aaSMarkus Armbruster#     the tail stage of throttling, the Guest is very sensitive to CPU
706a937b6aaSMarkus Armbruster#     percentage while the @cpu-throttle -increment is excessive
707a937b6aaSMarkus Armbruster#     usually at tail stage.  If this parameter is true, we will
708a937b6aaSMarkus Armbruster#     compute the ideal CPU percentage used by the Guest, which may
709a937b6aaSMarkus Armbruster#     exactly make the dirty rate match the dirty rate threshold.
710a937b6aaSMarkus Armbruster#     Then we will choose a smaller throttle increment between the one
711a937b6aaSMarkus Armbruster#     specified by @cpu-throttle-increment and the one generated by
712a937b6aaSMarkus Armbruster#     ideal CPU percentage.  Therefore, it is compatible to
713a937b6aaSMarkus Armbruster#     traditional throttling, meanwhile the throttle increment won't
714a937b6aaSMarkus Armbruster#     be excessive at tail stage.  The default value is false.  (Since
715a937b6aaSMarkus Armbruster#     5.1)
716cbbf8182SKeqian Zhu#
717a937b6aaSMarkus Armbruster# @tls-creds: ID of the 'tls-creds' object that provides credentials
718a937b6aaSMarkus Armbruster#     for establishing a TLS connection over the migration data
719a937b6aaSMarkus Armbruster#     channel.  On the outgoing side of the migration, the credentials
720a937b6aaSMarkus Armbruster#     must be for a 'client' endpoint, while for the incoming side the
721e8c5503aSMarkus Armbruster#     credentials must be for a 'server' endpoint.  Setting this to a
722e8c5503aSMarkus Armbruster#     non-empty string enables TLS for all migrations.  An empty
723e8c5503aSMarkus Armbruster#     string means that QEMU will use plain text mode for migration,
724e8c5503aSMarkus Armbruster#     rather than TLS.  (Since 2.7)
72548685a8eSMarkus Armbruster#
726e8c5503aSMarkus Armbruster# @tls-hostname: migration target's hostname for validating the
727e8c5503aSMarkus Armbruster#     server's x509 certificate identity.  If empty, QEMU will use the
728e8c5503aSMarkus Armbruster#     hostname from the migration URI, if any.  A non-empty value is
729e8c5503aSMarkus Armbruster#     required when using x509 based TLS credentials and the migration
730e8c5503aSMarkus Armbruster#     URI does not include a hostname, such as fd: or exec: based
731e8c5503aSMarkus Armbruster#     migration.  (Since 2.7)
732e8c5503aSMarkus Armbruster#
733e8c5503aSMarkus Armbruster#     Note: empty value works only since 2.9.
73448685a8eSMarkus Armbruster#
735a937b6aaSMarkus Armbruster# @tls-authz: ID of the 'authz' object subclass that provides access
736a937b6aaSMarkus Armbruster#     control checking of the TLS x509 certificate distinguished name.
737d2f1d29bSDaniel P. Berrange#     This object is only resolved at time of use, so can be deleted
738d2f1d29bSDaniel P. Berrange#     and recreated on the fly while the migration server is active.
739d2f1d29bSDaniel P. Berrange#     If missing, it will default to denying access (Since 4.0)
740d2f1d29bSDaniel P. Berrange#
74173c67f38SMarkus Armbruster# @max-bandwidth: maximum speed for migration, in bytes per second.
74273c67f38SMarkus Armbruster#     (Since 2.8)
74348685a8eSMarkus Armbruster#
7448b239597SPeter Xu# @avail-switchover-bandwidth: to set the available bandwidth that
7458b239597SPeter Xu#     migration can use during switchover phase.  NOTE!  This does not
746209e64d9SMarkus Armbruster#     limit the bandwidth during switchover, but only for calculations
747209e64d9SMarkus Armbruster#     when making decisions to switchover.  By default, this value is
748209e64d9SMarkus Armbruster#     zero, which means QEMU will estimate the bandwidth
749209e64d9SMarkus Armbruster#     automatically.  This can be set when the estimated value is not
750209e64d9SMarkus Armbruster#     accurate, while the user is able to guarantee such bandwidth is
751209e64d9SMarkus Armbruster#     available when switching over.  When specified correctly, this
752209e64d9SMarkus Armbruster#     can make the switchover decision much more accurate.
753209e64d9SMarkus Armbruster#     (Since 8.2)
7548b239597SPeter Xu#
755a937b6aaSMarkus Armbruster# @downtime-limit: set maximum tolerated downtime for migration.
756a937b6aaSMarkus Armbruster#     maximum downtime in milliseconds (Since 2.8)
75748685a8eSMarkus Armbruster#
758a937b6aaSMarkus Armbruster# @x-checkpoint-delay: The delay time (in ms) between two COLO
759a937b6aaSMarkus Armbruster#     checkpoints in periodic mode.  (Since 2.8)
76048685a8eSMarkus Armbruster#
761cbfd6c95SJuan Quintela# @multifd-channels: Number of channels used to migrate data in
762a937b6aaSMarkus Armbruster#     parallel.  This is the same number that the number of sockets
763a937b6aaSMarkus Armbruster#     used for migration.  The default value is 2 (since 4.0)
7644075fb1cSJuan Quintela#
76573af8dd8SJuan Quintela# @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
766a937b6aaSMarkus Armbruster#     needs to be a multiple of the target page size and a power of 2
76773af8dd8SJuan Quintela#     (Since 2.11)
76873af8dd8SJuan Quintela#
769a937b6aaSMarkus Armbruster# @max-postcopy-bandwidth: Background transfer bandwidth during
770a937b6aaSMarkus Armbruster#     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
7717e555c6cSDr. David Alan Gilbert#     (Since 3.0)
7724cbc9c7fSLi Qiang#
773a937b6aaSMarkus Armbruster# @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
774a937b6aaSMarkus Armbruster#     (Since 3.1)
775ee3d96baSDr. David Alan Gilbert#
776a937b6aaSMarkus Armbruster# @multifd-compression: Which compression method to use.  Defaults to
777a937b6aaSMarkus Armbruster#     none.  (Since 5.0)
77896eef042SJuan Quintela#
7799004db48SJuan Quintela# @multifd-zlib-level: Set the compression level to be used in live
780a937b6aaSMarkus Armbruster#     migration, the compression level is an integer between 0 and 9,
781a937b6aaSMarkus Armbruster#     where 0 means no compression, 1 means the best compression
782a937b6aaSMarkus Armbruster#     speed, and 9 means best compression ratio which will consume
783a937b6aaSMarkus Armbruster#     more CPU. Defaults to 1.  (Since 5.0)
7849004db48SJuan Quintela#
7856a9ad154SJuan Quintela# @multifd-zstd-level: Set the compression level to be used in live
786a937b6aaSMarkus Armbruster#     migration, the compression level is an integer between 0 and 20,
787a937b6aaSMarkus Armbruster#     where 0 means no compression, 1 means the best compression
788a937b6aaSMarkus Armbruster#     speed, and 20 means best compression ratio which will consume
789a937b6aaSMarkus Armbruster#     more CPU. Defaults to 1.  (Since 5.0)
790abb6295bSLeonardo Bras#
79131e4c354SMax Reitz# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
792a937b6aaSMarkus Armbruster#     aliases for the purpose of dirty bitmap migration.  Such aliases
793a937b6aaSMarkus Armbruster#     may for example be the corresponding names on the opposite site.
794a937b6aaSMarkus Armbruster#     The mapping must be one-to-one, but not necessarily complete: On
795a937b6aaSMarkus Armbruster#     the source, unmapped bitmaps and all bitmaps on unmapped nodes
796a937b6aaSMarkus Armbruster#     will be ignored.  On the destination, encountering an unmapped
797a937b6aaSMarkus Armbruster#     alias in the incoming migration stream will result in a report,
798a937b6aaSMarkus Armbruster#     and all further bitmap migration data will then be discarded.
799a937b6aaSMarkus Armbruster#     Note that the destination does not know about bitmaps it does
800a937b6aaSMarkus Armbruster#     not receive, so there is no limitation or requirement regarding
801a937b6aaSMarkus Armbruster#     the number of bitmaps received, or how they are named, or on
802a937b6aaSMarkus Armbruster#     which nodes they are placed.  By default (when this parameter
803a937b6aaSMarkus Armbruster#     has never been set), bitmap names are mapped to themselves.
804a937b6aaSMarkus Armbruster#     Nodes are mapped to their block device name if there is one, and
805a937b6aaSMarkus Armbruster#     to their node name otherwise.  (Since 5.2)
80631e4c354SMax Reitz#
8078abc8115SHyman Huang(黄勇)# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
808209e64d9SMarkus Armbruster#     limit during live migration.  Should be in the range 1 to
809209e64d9SMarkus Armbruster#     1000ms.  Defaults to 1000ms.  (Since 8.1)
8104d807857SHyman Huang(黄勇)#
81109f9ec99SHyman Huang(黄勇)# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
81209f9ec99SHyman Huang(黄勇)#     Defaults to 1.  (Since 8.1)
81309f9ec99SHyman Huang(黄勇)#
814209e64d9SMarkus Armbruster# @mode: Migration mode.  See description in @MigMode.  Default is
815209e64d9SMarkus Armbruster#     'normal'.  (Since 8.2)
816eea1e5c9SSteve Sistare#
8175fdbb1dfSHao Xiang# @zero-page-detection: Whether and how to detect zero pages.
81870c25c92SHao Xiang#     See description in @ZeroPageDetection.  Default is 'multifd'.
8195fdbb1dfSHao Xiang#     (since 9.0)
8205fdbb1dfSHao Xiang#
8219fb49daaSMarkus Armbruster# Features:
822a937b6aaSMarkus Armbruster#
823209e64d9SMarkus Armbruster# @unstable: Members @x-checkpoint-delay and
824209e64d9SMarkus Armbruster#     @x-vcpu-dirty-limit-period are experimental.
8259fb49daaSMarkus Armbruster#
82648685a8eSMarkus Armbruster# Since: 2.4
82748685a8eSMarkus Armbruster##
82848685a8eSMarkus Armbruster{ 'enum': 'MigrationParameter',
829ee3d96baSDr. David Alan Gilbert  'data': ['announce-initial', 'announce-max',
830ee3d96baSDr. David Alan Gilbert           'announce-rounds', 'announce-step',
831864128dfSJuan Quintela           'throttle-trigger-threshold',
83248685a8eSMarkus Armbruster           'cpu-throttle-initial', 'cpu-throttle-increment',
833cbbf8182SKeqian Zhu           'cpu-throttle-tailslow',
834d2f1d29bSDaniel P. Berrange           'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
8358b239597SPeter Xu           'avail-switchover-bandwidth', 'downtime-limit',
8369fb49daaSMarkus Armbruster           { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
837cbfd6c95SJuan Quintela           'multifd-channels',
8384cbc9c7fSLi Qiang           'xbzrle-cache-size', 'max-postcopy-bandwidth',
8399004db48SJuan Quintela           'max-cpu-throttle', 'multifd-compression',
84031e4c354SMax Reitz           'multifd-zlib-level', 'multifd-zstd-level',
8414d807857SHyman Huang(黄勇)           'block-bitmap-mapping',
84209f9ec99SHyman Huang(黄勇)           { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] },
843eea1e5c9SSteve Sistare           'vcpu-dirty-limit',
8445fdbb1dfSHao Xiang           'mode',
8455fdbb1dfSHao Xiang           'zero-page-detection'] }
84648685a8eSMarkus Armbruster
84748685a8eSMarkus Armbruster##
84848685a8eSMarkus Armbruster# @MigrateSetParameters:
84948685a8eSMarkus Armbruster#
850a937b6aaSMarkus Armbruster# @announce-initial: Initial delay (in milliseconds) before sending
851a937b6aaSMarkus Armbruster#     the first announce (Since 4.0)
852ee3d96baSDr. David Alan Gilbert#
853a937b6aaSMarkus Armbruster# @announce-max: Maximum delay (in milliseconds) between packets in
854a937b6aaSMarkus Armbruster#     the announcement (Since 4.0)
855ee3d96baSDr. David Alan Gilbert#
856a937b6aaSMarkus Armbruster# @announce-rounds: Number of self-announce packets sent after
857a937b6aaSMarkus Armbruster#     migration (Since 4.0)
858ee3d96baSDr. David Alan Gilbert#
859a937b6aaSMarkus Armbruster# @announce-step: Increase in delay (in milliseconds) between
860a937b6aaSMarkus Armbruster#     subsequent packets in the announcement (Since 4.0)
861ee3d96baSDr. David Alan Gilbert#
862a937b6aaSMarkus Armbruster# @throttle-trigger-threshold: The ratio of bytes_dirty_period and
863a937b6aaSMarkus Armbruster#     bytes_xfer_period to trigger throttling.  It is expressed as
864a937b6aaSMarkus Armbruster#     percentage.  The default value is 50.  (Since 5.0)
865dc14a470SKeqian Zhu#
86648685a8eSMarkus Armbruster# @cpu-throttle-initial: Initial percentage of time guest cpus are
867a937b6aaSMarkus Armbruster#     throttled when migration auto-converge is activated.  The
868a937b6aaSMarkus Armbruster#     default value is 20.  (Since 2.7)
86948685a8eSMarkus Armbruster#
87048685a8eSMarkus Armbruster# @cpu-throttle-increment: throttle percentage increase each time
871a937b6aaSMarkus Armbruster#     auto-converge detects that migration is not making progress.
872a937b6aaSMarkus Armbruster#     The default value is 10.  (Since 2.7)
87348685a8eSMarkus Armbruster#
874a937b6aaSMarkus Armbruster# @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
875a937b6aaSMarkus Armbruster#     the tail stage of throttling, the Guest is very sensitive to CPU
876a937b6aaSMarkus Armbruster#     percentage while the @cpu-throttle -increment is excessive
877a937b6aaSMarkus Armbruster#     usually at tail stage.  If this parameter is true, we will
878a937b6aaSMarkus Armbruster#     compute the ideal CPU percentage used by the Guest, which may
879a937b6aaSMarkus Armbruster#     exactly make the dirty rate match the dirty rate threshold.
880a937b6aaSMarkus Armbruster#     Then we will choose a smaller throttle increment between the one
881a937b6aaSMarkus Armbruster#     specified by @cpu-throttle-increment and the one generated by
882a937b6aaSMarkus Armbruster#     ideal CPU percentage.  Therefore, it is compatible to
883a937b6aaSMarkus Armbruster#     traditional throttling, meanwhile the throttle increment won't
884a937b6aaSMarkus Armbruster#     be excessive at tail stage.  The default value is false.  (Since
885a937b6aaSMarkus Armbruster#     5.1)
886cbbf8182SKeqian Zhu#
88748685a8eSMarkus Armbruster# @tls-creds: ID of the 'tls-creds' object that provides credentials
88848685a8eSMarkus Armbruster#     for establishing a TLS connection over the migration data
88948685a8eSMarkus Armbruster#     channel.  On the outgoing side of the migration, the credentials
89048685a8eSMarkus Armbruster#     must be for a 'client' endpoint, while for the incoming side the
891a937b6aaSMarkus Armbruster#     credentials must be for a 'server' endpoint.  Setting this to a
892a937b6aaSMarkus Armbruster#     non-empty string enables TLS for all migrations.  An empty
893a937b6aaSMarkus Armbruster#     string means that QEMU will use plain text mode for migration,
894e8c5503aSMarkus Armbruster#     rather than TLS.  This is the default.  (Since 2.7)
89548685a8eSMarkus Armbruster#
896e8c5503aSMarkus Armbruster# @tls-hostname: migration target's hostname for validating the
897e8c5503aSMarkus Armbruster#     server's x509 certificate identity.  If empty, QEMU will use the
898e8c5503aSMarkus Armbruster#     hostname from the migration URI, if any.  A non-empty value is
899e8c5503aSMarkus Armbruster#     required when using x509 based TLS credentials and the migration
900e8c5503aSMarkus Armbruster#     URI does not include a hostname, such as fd: or exec: based
901e8c5503aSMarkus Armbruster#     migration.  (Since 2.7)
902e8c5503aSMarkus Armbruster#
903e8c5503aSMarkus Armbruster#     Note: empty value works only since 2.9.
90448685a8eSMarkus Armbruster#
90566fcb9d6SPeter Xu# @tls-authz: ID of the 'authz' object subclass that provides access
90666fcb9d6SPeter Xu#     control checking of the TLS x509 certificate distinguished name.
907e8c5503aSMarkus Armbruster#     This object is only resolved at time of use, so can be deleted
908e8c5503aSMarkus Armbruster#     and recreated on the fly while the migration server is active.
909e8c5503aSMarkus Armbruster#     If missing, it will default to denying access (Since 4.0)
91066fcb9d6SPeter Xu#
91173c67f38SMarkus Armbruster# @max-bandwidth: maximum speed for migration, in bytes per second.
91273c67f38SMarkus Armbruster#     (Since 2.8)
91348685a8eSMarkus Armbruster#
9148b239597SPeter Xu# @avail-switchover-bandwidth: to set the available bandwidth that
9158b239597SPeter Xu#     migration can use during switchover phase.  NOTE!  This does not
916209e64d9SMarkus Armbruster#     limit the bandwidth during switchover, but only for calculations
917209e64d9SMarkus Armbruster#     when making decisions to switchover.  By default, this value is
918209e64d9SMarkus Armbruster#     zero, which means QEMU will estimate the bandwidth
919209e64d9SMarkus Armbruster#     automatically.  This can be set when the estimated value is not
920209e64d9SMarkus Armbruster#     accurate, while the user is able to guarantee such bandwidth is
921209e64d9SMarkus Armbruster#     available when switching over.  When specified correctly, this
922209e64d9SMarkus Armbruster#     can make the switchover decision much more accurate.
923209e64d9SMarkus Armbruster#     (Since 8.2)
9248b239597SPeter Xu#
925a937b6aaSMarkus Armbruster# @downtime-limit: set maximum tolerated downtime for migration.
926a937b6aaSMarkus Armbruster#     maximum downtime in milliseconds (Since 2.8)
92748685a8eSMarkus Armbruster#
9288eb0a257SMarkus Armbruster# @x-checkpoint-delay: The delay time (in ms) between two COLO
9298eb0a257SMarkus Armbruster#     checkpoints in periodic mode.  (Since 2.8)
93048685a8eSMarkus Armbruster#
931cbfd6c95SJuan Quintela# @multifd-channels: Number of channels used to migrate data in
932a937b6aaSMarkus Armbruster#     parallel.  This is the same number that the number of sockets
933a937b6aaSMarkus Armbruster#     used for migration.  The default value is 2 (since 4.0)
9344075fb1cSJuan Quintela#
93573af8dd8SJuan Quintela# @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
936a937b6aaSMarkus Armbruster#     needs to be a multiple of the target page size and a power of 2
93773af8dd8SJuan Quintela#     (Since 2.11)
9387e555c6cSDr. David Alan Gilbert#
939a937b6aaSMarkus Armbruster# @max-postcopy-bandwidth: Background transfer bandwidth during
940a937b6aaSMarkus Armbruster#     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
9417e555c6cSDr. David Alan Gilbert#     (Since 3.0)
9424cbc9c7fSLi Qiang#
9438eb0a257SMarkus Armbruster# @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
9448eb0a257SMarkus Armbruster#     (Since 3.1)
9454cbc9c7fSLi Qiang#
946a937b6aaSMarkus Armbruster# @multifd-compression: Which compression method to use.  Defaults to
947a937b6aaSMarkus Armbruster#     none.  (Since 5.0)
94896eef042SJuan Quintela#
9499004db48SJuan Quintela# @multifd-zlib-level: Set the compression level to be used in live
950a937b6aaSMarkus Armbruster#     migration, the compression level is an integer between 0 and 9,
951a937b6aaSMarkus Armbruster#     where 0 means no compression, 1 means the best compression
952a937b6aaSMarkus Armbruster#     speed, and 9 means best compression ratio which will consume
953a937b6aaSMarkus Armbruster#     more CPU. Defaults to 1.  (Since 5.0)
9549004db48SJuan Quintela#
9556a9ad154SJuan Quintela# @multifd-zstd-level: Set the compression level to be used in live
956a937b6aaSMarkus Armbruster#     migration, the compression level is an integer between 0 and 20,
957a937b6aaSMarkus Armbruster#     where 0 means no compression, 1 means the best compression
958a937b6aaSMarkus Armbruster#     speed, and 20 means best compression ratio which will consume
959a937b6aaSMarkus Armbruster#     more CPU. Defaults to 1.  (Since 5.0)
9606a9ad154SJuan Quintela#
96131e4c354SMax Reitz# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
962a937b6aaSMarkus Armbruster#     aliases for the purpose of dirty bitmap migration.  Such aliases
963a937b6aaSMarkus Armbruster#     may for example be the corresponding names on the opposite site.
964a937b6aaSMarkus Armbruster#     The mapping must be one-to-one, but not necessarily complete: On
965a937b6aaSMarkus Armbruster#     the source, unmapped bitmaps and all bitmaps on unmapped nodes
966a937b6aaSMarkus Armbruster#     will be ignored.  On the destination, encountering an unmapped
967a937b6aaSMarkus Armbruster#     alias in the incoming migration stream will result in a report,
968a937b6aaSMarkus Armbruster#     and all further bitmap migration data will then be discarded.
969a937b6aaSMarkus Armbruster#     Note that the destination does not know about bitmaps it does
970a937b6aaSMarkus Armbruster#     not receive, so there is no limitation or requirement regarding
971a937b6aaSMarkus Armbruster#     the number of bitmaps received, or how they are named, or on
972a937b6aaSMarkus Armbruster#     which nodes they are placed.  By default (when this parameter
973a937b6aaSMarkus Armbruster#     has never been set), bitmap names are mapped to themselves.
974a937b6aaSMarkus Armbruster#     Nodes are mapped to their block device name if there is one, and
975a937b6aaSMarkus Armbruster#     to their node name otherwise.  (Since 5.2)
97631e4c354SMax Reitz#
9778abc8115SHyman Huang(黄勇)# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
978209e64d9SMarkus Armbruster#     limit during live migration.  Should be in the range 1 to
979209e64d9SMarkus Armbruster#     1000ms.  Defaults to 1000ms.  (Since 8.1)
9804d807857SHyman Huang(黄勇)#
98109f9ec99SHyman Huang(黄勇)# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
98209f9ec99SHyman Huang(黄勇)#     Defaults to 1.  (Since 8.1)
98309f9ec99SHyman Huang(黄勇)#
984209e64d9SMarkus Armbruster# @mode: Migration mode.  See description in @MigMode.  Default is
985209e64d9SMarkus Armbruster#     'normal'.  (Since 8.2)
986eea1e5c9SSteve Sistare#
9875fdbb1dfSHao Xiang# @zero-page-detection: Whether and how to detect zero pages.
98870c25c92SHao Xiang#     See description in @ZeroPageDetection.  Default is 'multifd'.
9895fdbb1dfSHao Xiang#     (since 9.0)
9905fdbb1dfSHao Xiang#
9919fb49daaSMarkus Armbruster# Features:
992a937b6aaSMarkus Armbruster#
993209e64d9SMarkus Armbruster# @unstable: Members @x-checkpoint-delay and
994209e64d9SMarkus Armbruster#     @x-vcpu-dirty-limit-period are experimental.
9959fb49daaSMarkus Armbruster#
99656266c6dSMarkus Armbruster# TODO: either fuse back into MigrationParameters, or make
99756266c6dSMarkus Armbruster#     MigrationParameters members mandatory
99856266c6dSMarkus Armbruster#
99948685a8eSMarkus Armbruster# Since: 2.4
100048685a8eSMarkus Armbruster##
100148685a8eSMarkus Armbruster{ 'struct': 'MigrateSetParameters',
1002ee3d96baSDr. David Alan Gilbert  'data': { '*announce-initial': 'size',
1003ee3d96baSDr. David Alan Gilbert            '*announce-max': 'size',
1004ee3d96baSDr. David Alan Gilbert            '*announce-rounds': 'size',
1005ee3d96baSDr. David Alan Gilbert            '*announce-step': 'size',
1006ec17de0aSMarkus Armbruster            '*throttle-trigger-threshold': 'uint8',
1007ec17de0aSMarkus Armbruster            '*cpu-throttle-initial': 'uint8',
1008ec17de0aSMarkus Armbruster            '*cpu-throttle-increment': 'uint8',
1009cbbf8182SKeqian Zhu            '*cpu-throttle-tailslow': 'bool',
101048685a8eSMarkus Armbruster            '*tls-creds': 'StrOrNull',
101148685a8eSMarkus Armbruster            '*tls-hostname': 'StrOrNull',
1012d2f1d29bSDaniel P. Berrange            '*tls-authz': 'StrOrNull',
1013ec17de0aSMarkus Armbruster            '*max-bandwidth': 'size',
10148b239597SPeter Xu            '*avail-switchover-bandwidth': 'size',
1015ec17de0aSMarkus Armbruster            '*downtime-limit': 'uint64',
10169fb49daaSMarkus Armbruster            '*x-checkpoint-delay': { 'type': 'uint32',
10179fb49daaSMarkus Armbruster                                     'features': [ 'unstable' ] },
1018ec17de0aSMarkus Armbruster            '*multifd-channels': 'uint8',
10197e555c6cSDr. David Alan Gilbert            '*xbzrle-cache-size': 'size',
10204cbc9c7fSLi Qiang            '*max-postcopy-bandwidth': 'size',
1021ec17de0aSMarkus Armbruster            '*max-cpu-throttle': 'uint8',
10229004db48SJuan Quintela            '*multifd-compression': 'MultiFDCompression',
1023ec17de0aSMarkus Armbruster            '*multifd-zlib-level': 'uint8',
1024ec17de0aSMarkus Armbruster            '*multifd-zstd-level': 'uint8',
10254d807857SHyman Huang(黄勇)            '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
10264d807857SHyman Huang(黄勇)            '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
102709f9ec99SHyman Huang(黄勇)                                            'features': [ 'unstable' ] },
1028eea1e5c9SSteve Sistare            '*vcpu-dirty-limit': 'uint64',
10295fdbb1dfSHao Xiang            '*mode': 'MigMode',
10305fdbb1dfSHao Xiang            '*zero-page-detection': 'ZeroPageDetection'} }
103148685a8eSMarkus Armbruster
103248685a8eSMarkus Armbruster##
103348685a8eSMarkus Armbruster# @migrate-set-parameters:
103448685a8eSMarkus Armbruster#
103548685a8eSMarkus Armbruster# Set various migration parameters.
103648685a8eSMarkus Armbruster#
103748685a8eSMarkus Armbruster# Since: 2.4
103848685a8eSMarkus Armbruster#
103948685a8eSMarkus Armbruster# Example:
104048685a8eSMarkus Armbruster#
104148685a8eSMarkus Armbruster#     -> { "execute": "migrate-set-parameters" ,
1042864128dfSJuan Quintela#          "arguments": { "multifd-channels": 5 } }
104337fa48a4SMarkus Armbruster#     <- { "return": {} }
104448685a8eSMarkus Armbruster##
104548685a8eSMarkus Armbruster{ 'command': 'migrate-set-parameters', 'boxed': true,
104648685a8eSMarkus Armbruster  'data': 'MigrateSetParameters' }
104748685a8eSMarkus Armbruster
104848685a8eSMarkus Armbruster##
104948685a8eSMarkus Armbruster# @MigrationParameters:
105048685a8eSMarkus Armbruster#
105148685a8eSMarkus Armbruster# The optional members aren't actually optional.
105248685a8eSMarkus Armbruster#
1053a937b6aaSMarkus Armbruster# @announce-initial: Initial delay (in milliseconds) before sending
1054a937b6aaSMarkus Armbruster#     the first announce (Since 4.0)
1055ee3d96baSDr. David Alan Gilbert#
1056a937b6aaSMarkus Armbruster# @announce-max: Maximum delay (in milliseconds) between packets in
1057a937b6aaSMarkus Armbruster#     the announcement (Since 4.0)
1058ee3d96baSDr. David Alan Gilbert#
1059a937b6aaSMarkus Armbruster# @announce-rounds: Number of self-announce packets sent after
1060a937b6aaSMarkus Armbruster#     migration (Since 4.0)
1061ee3d96baSDr. David Alan Gilbert#
1062a937b6aaSMarkus Armbruster# @announce-step: Increase in delay (in milliseconds) between
1063a937b6aaSMarkus Armbruster#     subsequent packets in the announcement (Since 4.0)
1064ee3d96baSDr. David Alan Gilbert#
1065a937b6aaSMarkus Armbruster# @throttle-trigger-threshold: The ratio of bytes_dirty_period and
1066a937b6aaSMarkus Armbruster#     bytes_xfer_period to trigger throttling.  It is expressed as
1067a937b6aaSMarkus Armbruster#     percentage.  The default value is 50.  (Since 5.0)
1068dc14a470SKeqian Zhu#
106948685a8eSMarkus Armbruster# @cpu-throttle-initial: Initial percentage of time guest cpus are
1070a937b6aaSMarkus Armbruster#     throttled when migration auto-converge is activated.  (Since
1071a937b6aaSMarkus Armbruster#     2.7)
107248685a8eSMarkus Armbruster#
107348685a8eSMarkus Armbruster# @cpu-throttle-increment: throttle percentage increase each time
1074a937b6aaSMarkus Armbruster#     auto-converge detects that migration is not making progress.
1075a937b6aaSMarkus Armbruster#     (Since 2.7)
107648685a8eSMarkus Armbruster#
1077a937b6aaSMarkus Armbruster# @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
1078a937b6aaSMarkus Armbruster#     the tail stage of throttling, the Guest is very sensitive to CPU
1079a937b6aaSMarkus Armbruster#     percentage while the @cpu-throttle -increment is excessive
1080a937b6aaSMarkus Armbruster#     usually at tail stage.  If this parameter is true, we will
1081a937b6aaSMarkus Armbruster#     compute the ideal CPU percentage used by the Guest, which may
1082a937b6aaSMarkus Armbruster#     exactly make the dirty rate match the dirty rate threshold.
1083a937b6aaSMarkus Armbruster#     Then we will choose a smaller throttle increment between the one
1084a937b6aaSMarkus Armbruster#     specified by @cpu-throttle-increment and the one generated by
1085a937b6aaSMarkus Armbruster#     ideal CPU percentage.  Therefore, it is compatible to
1086a937b6aaSMarkus Armbruster#     traditional throttling, meanwhile the throttle increment won't
1087a937b6aaSMarkus Armbruster#     be excessive at tail stage.  The default value is false.  (Since
1088a937b6aaSMarkus Armbruster#     5.1)
1089cbbf8182SKeqian Zhu#
109048685a8eSMarkus Armbruster# @tls-creds: ID of the 'tls-creds' object that provides credentials
109148685a8eSMarkus Armbruster#     for establishing a TLS connection over the migration data
109248685a8eSMarkus Armbruster#     channel.  On the outgoing side of the migration, the credentials
109348685a8eSMarkus Armbruster#     must be for a 'client' endpoint, while for the incoming side the
1094a937b6aaSMarkus Armbruster#     credentials must be for a 'server' endpoint.  An empty string
1095a937b6aaSMarkus Armbruster#     means that QEMU will use plain text mode for migration, rather
1096e8c5503aSMarkus Armbruster#     than TLS.  (Since 2.7)
109748685a8eSMarkus Armbruster#
1098e8c5503aSMarkus Armbruster#     Note: 2.8 omits empty @tls-creds instead.
1099e8c5503aSMarkus Armbruster#
1100e8c5503aSMarkus Armbruster# @tls-hostname: migration target's hostname for validating the
1101e8c5503aSMarkus Armbruster#     server's x509 certificate identity.  If empty, QEMU will use the
1102e8c5503aSMarkus Armbruster#     hostname from the migration URI, if any.  (Since 2.7)
1103e8c5503aSMarkus Armbruster#
1104e8c5503aSMarkus Armbruster#     Note: 2.8 omits empty @tls-hostname instead.
110548685a8eSMarkus Armbruster#
1106a937b6aaSMarkus Armbruster# @tls-authz: ID of the 'authz' object subclass that provides access
1107a937b6aaSMarkus Armbruster#     control checking of the TLS x509 certificate distinguished name.
1108a937b6aaSMarkus Armbruster#     (Since 4.0)
1109d2f1d29bSDaniel P. Berrange#
111073c67f38SMarkus Armbruster# @max-bandwidth: maximum speed for migration, in bytes per second.
111173c67f38SMarkus Armbruster#     (Since 2.8)
111248685a8eSMarkus Armbruster#
11138b239597SPeter Xu# @avail-switchover-bandwidth: to set the available bandwidth that
11148b239597SPeter Xu#     migration can use during switchover phase.  NOTE!  This does not
1115209e64d9SMarkus Armbruster#     limit the bandwidth during switchover, but only for calculations
1116209e64d9SMarkus Armbruster#     when making decisions to switchover.  By default, this value is
1117209e64d9SMarkus Armbruster#     zero, which means QEMU will estimate the bandwidth
1118209e64d9SMarkus Armbruster#     automatically.  This can be set when the estimated value is not
1119209e64d9SMarkus Armbruster#     accurate, while the user is able to guarantee such bandwidth is
1120209e64d9SMarkus Armbruster#     available when switching over.  When specified correctly, this
1121209e64d9SMarkus Armbruster#     can make the switchover decision much more accurate.
1122209e64d9SMarkus Armbruster#     (Since 8.2)
11238b239597SPeter Xu#
1124a937b6aaSMarkus Armbruster# @downtime-limit: set maximum tolerated downtime for migration.
1125a937b6aaSMarkus Armbruster#     maximum downtime in milliseconds (Since 2.8)
112648685a8eSMarkus Armbruster#
1127a937b6aaSMarkus Armbruster# @x-checkpoint-delay: the delay time between two COLO checkpoints.
1128a937b6aaSMarkus Armbruster#     (Since 2.8)
112948685a8eSMarkus Armbruster#
1130cbfd6c95SJuan Quintela# @multifd-channels: Number of channels used to migrate data in
1131a937b6aaSMarkus Armbruster#     parallel.  This is the same number that the number of sockets
1132a937b6aaSMarkus Armbruster#     used for migration.  The default value is 2 (since 4.0)
11334075fb1cSJuan Quintela#
113473af8dd8SJuan Quintela# @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
1135a937b6aaSMarkus Armbruster#     needs to be a multiple of the target page size and a power of 2
113673af8dd8SJuan Quintela#     (Since 2.11)
11377e555c6cSDr. David Alan Gilbert#
1138a937b6aaSMarkus Armbruster# @max-postcopy-bandwidth: Background transfer bandwidth during
1139a937b6aaSMarkus Armbruster#     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
11407e555c6cSDr. David Alan Gilbert#     (Since 3.0)
11414cbc9c7fSLi Qiang#
1142a937b6aaSMarkus Armbruster# @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
11434cbc9c7fSLi Qiang#     (Since 3.1)
11444cbc9c7fSLi Qiang#
1145a937b6aaSMarkus Armbruster# @multifd-compression: Which compression method to use.  Defaults to
1146a937b6aaSMarkus Armbruster#     none.  (Since 5.0)
114796eef042SJuan Quintela#
11489004db48SJuan Quintela# @multifd-zlib-level: Set the compression level to be used in live
1149a937b6aaSMarkus Armbruster#     migration, the compression level is an integer between 0 and 9,
1150a937b6aaSMarkus Armbruster#     where 0 means no compression, 1 means the best compression
1151a937b6aaSMarkus Armbruster#     speed, and 9 means best compression ratio which will consume
1152a937b6aaSMarkus Armbruster#     more CPU. Defaults to 1.  (Since 5.0)
11539004db48SJuan Quintela#
11546a9ad154SJuan Quintela# @multifd-zstd-level: Set the compression level to be used in live
1155a937b6aaSMarkus Armbruster#     migration, the compression level is an integer between 0 and 20,
1156a937b6aaSMarkus Armbruster#     where 0 means no compression, 1 means the best compression
1157a937b6aaSMarkus Armbruster#     speed, and 20 means best compression ratio which will consume
1158a937b6aaSMarkus Armbruster#     more CPU. Defaults to 1.  (Since 5.0)
11596a9ad154SJuan Quintela#
116031e4c354SMax Reitz# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1161a937b6aaSMarkus Armbruster#     aliases for the purpose of dirty bitmap migration.  Such aliases
1162a937b6aaSMarkus Armbruster#     may for example be the corresponding names on the opposite site.
1163a937b6aaSMarkus Armbruster#     The mapping must be one-to-one, but not necessarily complete: On
1164a937b6aaSMarkus Armbruster#     the source, unmapped bitmaps and all bitmaps on unmapped nodes
1165a937b6aaSMarkus Armbruster#     will be ignored.  On the destination, encountering an unmapped
1166a937b6aaSMarkus Armbruster#     alias in the incoming migration stream will result in a report,
1167a937b6aaSMarkus Armbruster#     and all further bitmap migration data will then be discarded.
1168a937b6aaSMarkus Armbruster#     Note that the destination does not know about bitmaps it does
1169a937b6aaSMarkus Armbruster#     not receive, so there is no limitation or requirement regarding
1170a937b6aaSMarkus Armbruster#     the number of bitmaps received, or how they are named, or on
1171a937b6aaSMarkus Armbruster#     which nodes they are placed.  By default (when this parameter
1172a937b6aaSMarkus Armbruster#     has never been set), bitmap names are mapped to themselves.
1173a937b6aaSMarkus Armbruster#     Nodes are mapped to their block device name if there is one, and
1174a937b6aaSMarkus Armbruster#     to their node name otherwise.  (Since 5.2)
117531e4c354SMax Reitz#
11768abc8115SHyman Huang(黄勇)# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
1177209e64d9SMarkus Armbruster#     limit during live migration.  Should be in the range 1 to
1178209e64d9SMarkus Armbruster#     1000ms.  Defaults to 1000ms.  (Since 8.1)
11794d807857SHyman Huang(黄勇)#
118009f9ec99SHyman Huang(黄勇)# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
118109f9ec99SHyman Huang(黄勇)#     Defaults to 1.  (Since 8.1)
118209f9ec99SHyman Huang(黄勇)#
1183209e64d9SMarkus Armbruster# @mode: Migration mode.  See description in @MigMode.  Default is
1184209e64d9SMarkus Armbruster#        'normal'.  (Since 8.2)
1185eea1e5c9SSteve Sistare#
11865fdbb1dfSHao Xiang# @zero-page-detection: Whether and how to detect zero pages.
118770c25c92SHao Xiang#     See description in @ZeroPageDetection.  Default is 'multifd'.
11885fdbb1dfSHao Xiang#     (since 9.0)
11895fdbb1dfSHao Xiang#
11909fb49daaSMarkus Armbruster# Features:
1191a937b6aaSMarkus Armbruster#
1192209e64d9SMarkus Armbruster# @unstable: Members @x-checkpoint-delay and
1193209e64d9SMarkus Armbruster#     @x-vcpu-dirty-limit-period are experimental.
11949fb49daaSMarkus Armbruster#
119548685a8eSMarkus Armbruster# Since: 2.4
119648685a8eSMarkus Armbruster##
119748685a8eSMarkus Armbruster{ 'struct': 'MigrationParameters',
1198ee3d96baSDr. David Alan Gilbert  'data': { '*announce-initial': 'size',
1199ee3d96baSDr. David Alan Gilbert            '*announce-max': 'size',
1200ee3d96baSDr. David Alan Gilbert            '*announce-rounds': 'size',
1201ee3d96baSDr. David Alan Gilbert            '*announce-step': 'size',
1202dc14a470SKeqian Zhu            '*throttle-trigger-threshold': 'uint8',
1203741d4086SJuan Quintela            '*cpu-throttle-initial': 'uint8',
1204741d4086SJuan Quintela            '*cpu-throttle-increment': 'uint8',
1205cbbf8182SKeqian Zhu            '*cpu-throttle-tailslow': 'bool',
120648685a8eSMarkus Armbruster            '*tls-creds': 'str',
120748685a8eSMarkus Armbruster            '*tls-hostname': 'str',
1208d2f1d29bSDaniel P. Berrange            '*tls-authz': 'str',
1209741d4086SJuan Quintela            '*max-bandwidth': 'size',
12108b239597SPeter Xu            '*avail-switchover-bandwidth': 'size',
1211741d4086SJuan Quintela            '*downtime-limit': 'uint64',
12129fb49daaSMarkus Armbruster            '*x-checkpoint-delay': { 'type': 'uint32',
12139fb49daaSMarkus Armbruster                                     'features': [ 'unstable' ] },
1214cbfd6c95SJuan Quintela            '*multifd-channels': 'uint8',
12157e555c6cSDr. David Alan Gilbert            '*xbzrle-cache-size': 'size',
12164cbc9c7fSLi Qiang            '*max-postcopy-bandwidth': 'size',
121796eef042SJuan Quintela            '*max-cpu-throttle': 'uint8',
12189004db48SJuan Quintela            '*multifd-compression': 'MultiFDCompression',
12196a9ad154SJuan Quintela            '*multifd-zlib-level': 'uint8',
122031e4c354SMax Reitz            '*multifd-zstd-level': 'uint8',
12214d807857SHyman Huang(黄勇)            '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
12224d807857SHyman Huang(黄勇)            '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
122309f9ec99SHyman Huang(黄勇)                                            'features': [ 'unstable' ] },
1224eea1e5c9SSteve Sistare            '*vcpu-dirty-limit': 'uint64',
12255fdbb1dfSHao Xiang            '*mode': 'MigMode',
12265fdbb1dfSHao Xiang            '*zero-page-detection': 'ZeroPageDetection'} }
122748685a8eSMarkus Armbruster
122848685a8eSMarkus Armbruster##
122948685a8eSMarkus Armbruster# @query-migrate-parameters:
123048685a8eSMarkus Armbruster#
123148685a8eSMarkus Armbruster# Returns information about the current migration parameters
123248685a8eSMarkus Armbruster#
123348685a8eSMarkus Armbruster# Returns: @MigrationParameters
123448685a8eSMarkus Armbruster#
123548685a8eSMarkus Armbruster# Since: 2.4
123648685a8eSMarkus Armbruster#
123748685a8eSMarkus Armbruster# Example:
123848685a8eSMarkus Armbruster#
123948685a8eSMarkus Armbruster#     -> { "execute": "query-migrate-parameters" }
124048685a8eSMarkus Armbruster#     <- { "return": {
1241864128dfSJuan Quintela#              "multifd-channels": 2,
124248685a8eSMarkus Armbruster#              "cpu-throttle-increment": 10,
124348685a8eSMarkus Armbruster#              "cpu-throttle-initial": 20,
124448685a8eSMarkus Armbruster#              "max-bandwidth": 33554432,
124548685a8eSMarkus Armbruster#              "downtime-limit": 300
124648685a8eSMarkus Armbruster#           }
124748685a8eSMarkus Armbruster#        }
124848685a8eSMarkus Armbruster##
124948685a8eSMarkus Armbruster{ 'command': 'query-migrate-parameters',
125048685a8eSMarkus Armbruster  'returns': 'MigrationParameters' }
125148685a8eSMarkus Armbruster
125248685a8eSMarkus Armbruster##
125348685a8eSMarkus Armbruster# @migrate-start-postcopy:
125448685a8eSMarkus Armbruster#
1255a937b6aaSMarkus Armbruster# Followup to a migration command to switch the migration to postcopy
1256a937b6aaSMarkus Armbruster# mode.  The postcopy-ram capability must be set on both source and
1257a937b6aaSMarkus Armbruster# destination before the original migration command.
125848685a8eSMarkus Armbruster#
125948685a8eSMarkus Armbruster# Since: 2.5
126048685a8eSMarkus Armbruster#
126148685a8eSMarkus Armbruster# Example:
126248685a8eSMarkus Armbruster#
126348685a8eSMarkus Armbruster#     -> { "execute": "migrate-start-postcopy" }
126448685a8eSMarkus Armbruster#     <- { "return": {} }
126548685a8eSMarkus Armbruster##
126648685a8eSMarkus Armbruster{ 'command': 'migrate-start-postcopy' }
126748685a8eSMarkus Armbruster
126848685a8eSMarkus Armbruster##
126948685a8eSMarkus Armbruster# @MIGRATION:
127048685a8eSMarkus Armbruster#
127148685a8eSMarkus Armbruster# Emitted when a migration event happens
127248685a8eSMarkus Armbruster#
127348685a8eSMarkus Armbruster# @status: @MigrationStatus describing the current migration status.
127448685a8eSMarkus Armbruster#
127548685a8eSMarkus Armbruster# Since: 2.4
127648685a8eSMarkus Armbruster#
127748685a8eSMarkus Armbruster# Example:
127848685a8eSMarkus Armbruster#
127948685a8eSMarkus Armbruster#     <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
128048685a8eSMarkus Armbruster#         "event": "MIGRATION",
128148685a8eSMarkus Armbruster#         "data": {"status": "completed"} }
128248685a8eSMarkus Armbruster##
128348685a8eSMarkus Armbruster{ 'event': 'MIGRATION',
128448685a8eSMarkus Armbruster  'data': {'status': 'MigrationStatus'}}
128548685a8eSMarkus Armbruster
128648685a8eSMarkus Armbruster##
128748685a8eSMarkus Armbruster# @MIGRATION_PASS:
128848685a8eSMarkus Armbruster#
1289a937b6aaSMarkus Armbruster# Emitted from the source side of a migration at the start of each
1290a937b6aaSMarkus Armbruster# pass (when it syncs the dirty bitmap)
129148685a8eSMarkus Armbruster#
129248685a8eSMarkus Armbruster# @pass: An incrementing count (starting at 1 on the first pass)
129348685a8eSMarkus Armbruster#
129448685a8eSMarkus Armbruster# Since: 2.6
129548685a8eSMarkus Armbruster#
129648685a8eSMarkus Armbruster# Example:
129748685a8eSMarkus Armbruster#
129837fa48a4SMarkus Armbruster#     <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
129948685a8eSMarkus Armbruster#           "event": "MIGRATION_PASS", "data": {"pass": 2} }
130048685a8eSMarkus Armbruster##
130148685a8eSMarkus Armbruster{ 'event': 'MIGRATION_PASS',
130248685a8eSMarkus Armbruster  'data': { 'pass': 'int' } }
130348685a8eSMarkus Armbruster
130448685a8eSMarkus Armbruster##
130548685a8eSMarkus Armbruster# @COLOMessage:
130648685a8eSMarkus Armbruster#
130748685a8eSMarkus Armbruster# The message transmission between Primary side and Secondary side.
130848685a8eSMarkus Armbruster#
130948685a8eSMarkus Armbruster# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
131048685a8eSMarkus Armbruster#
1311a937b6aaSMarkus Armbruster# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for
1312a937b6aaSMarkus Armbruster#     checkpointing
131348685a8eSMarkus Armbruster#
131448685a8eSMarkus Armbruster# @checkpoint-reply: SVM gets PVM's checkpoint request
131548685a8eSMarkus Armbruster#
131648685a8eSMarkus Armbruster# @vmstate-send: VM's state will be sent by PVM.
131748685a8eSMarkus Armbruster#
131848685a8eSMarkus Armbruster# @vmstate-size: The total size of VMstate.
131948685a8eSMarkus Armbruster#
132048685a8eSMarkus Armbruster# @vmstate-received: VM's state has been received by SVM.
132148685a8eSMarkus Armbruster#
132248685a8eSMarkus Armbruster# @vmstate-loaded: VM's state has been loaded by SVM.
132348685a8eSMarkus Armbruster#
132448685a8eSMarkus Armbruster# Since: 2.8
132548685a8eSMarkus Armbruster##
132648685a8eSMarkus Armbruster{ 'enum': 'COLOMessage',
132748685a8eSMarkus Armbruster  'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
132848685a8eSMarkus Armbruster            'vmstate-send', 'vmstate-size', 'vmstate-received',
132948685a8eSMarkus Armbruster            'vmstate-loaded' ] }
133048685a8eSMarkus Armbruster
133148685a8eSMarkus Armbruster##
133248685a8eSMarkus Armbruster# @COLOMode:
133348685a8eSMarkus Armbruster#
133441b6b779SZhang Chen# The COLO current mode.
133548685a8eSMarkus Armbruster#
133641b6b779SZhang Chen# @none: COLO is disabled.
133748685a8eSMarkus Armbruster#
133841b6b779SZhang Chen# @primary: COLO node in primary side.
133948685a8eSMarkus Armbruster#
134041b6b779SZhang Chen# @secondary: COLO node in slave side.
134148685a8eSMarkus Armbruster#
134248685a8eSMarkus Armbruster# Since: 2.8
134348685a8eSMarkus Armbruster##
134448685a8eSMarkus Armbruster{ 'enum': 'COLOMode',
134541b6b779SZhang Chen  'data': [ 'none', 'primary', 'secondary'] }
134648685a8eSMarkus Armbruster
134748685a8eSMarkus Armbruster##
134848685a8eSMarkus Armbruster# @FailoverStatus:
134948685a8eSMarkus Armbruster#
135048685a8eSMarkus Armbruster# An enumeration of COLO failover status
135148685a8eSMarkus Armbruster#
135248685a8eSMarkus Armbruster# @none: no failover has ever happened
135348685a8eSMarkus Armbruster#
135448685a8eSMarkus Armbruster# @require: got failover requirement but not handled
135548685a8eSMarkus Armbruster#
135648685a8eSMarkus Armbruster# @active: in the process of doing failover
135748685a8eSMarkus Armbruster#
135848685a8eSMarkus Armbruster# @completed: finish the process of failover
135948685a8eSMarkus Armbruster#
1360a937b6aaSMarkus Armbruster# @relaunch: restart the failover process, from 'none' -> 'completed'
1361a937b6aaSMarkus Armbruster#     (Since 2.9)
136248685a8eSMarkus Armbruster#
136348685a8eSMarkus Armbruster# Since: 2.8
136448685a8eSMarkus Armbruster##
136548685a8eSMarkus Armbruster{ 'enum': 'FailoverStatus',
136648685a8eSMarkus Armbruster  'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
136748685a8eSMarkus Armbruster
136848685a8eSMarkus Armbruster##
13699ecff6d6Szhanghailiang# @COLO_EXIT:
13709ecff6d6Szhanghailiang#
13719ecff6d6Szhanghailiang# Emitted when VM finishes COLO mode due to some errors happening or
13729ecff6d6Szhanghailiang# at the request of users.
13739ecff6d6Szhanghailiang#
13749ecff6d6Szhanghailiang# @mode: report COLO mode when COLO exited.
13759ecff6d6Szhanghailiang#
13769ecff6d6Szhanghailiang# @reason: describes the reason for the COLO exit.
13779ecff6d6Szhanghailiang#
13789ecff6d6Szhanghailiang# Since: 3.1
13799ecff6d6Szhanghailiang#
13809ecff6d6Szhanghailiang# Example:
13819ecff6d6Szhanghailiang#
13829ecff6d6Szhanghailiang#     <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
13839ecff6d6Szhanghailiang#          "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
13849ecff6d6Szhanghailiang##
13859ecff6d6Szhanghailiang{ 'event': 'COLO_EXIT',
13869ecff6d6Szhanghailiang  'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
13879ecff6d6Szhanghailiang
13889ecff6d6Szhanghailiang##
13899ecff6d6Szhanghailiang# @COLOExitReason:
13909ecff6d6Szhanghailiang#
13913a43ac47SZhang Chen# The reason for a COLO exit.
13929ecff6d6Szhanghailiang#
1393a937b6aaSMarkus Armbruster# @none: failover has never happened.  This state does not occur in
1394a937b6aaSMarkus Armbruster#     the COLO_EXIT event, and is only visible in the result of
13953a43ac47SZhang Chen#     query-colo-status.
13969ecff6d6Szhanghailiang#
13973a43ac47SZhang Chen# @request: COLO exit is due to an external request.
13989ecff6d6Szhanghailiang#
13993a43ac47SZhang Chen# @error: COLO exit is due to an internal error.
14003a43ac47SZhang Chen#
14013a43ac47SZhang Chen# @processing: COLO is currently handling a failover (since 4.0).
14029ecff6d6Szhanghailiang#
14039ecff6d6Szhanghailiang# Since: 3.1
14049ecff6d6Szhanghailiang##
14059ecff6d6Szhanghailiang{ 'enum': 'COLOExitReason',
14063a43ac47SZhang Chen  'data': [ 'none', 'request', 'error' , 'processing' ] }
14079ecff6d6Szhanghailiang
14089ecff6d6Szhanghailiang##
140948685a8eSMarkus Armbruster# @x-colo-lost-heartbeat:
141048685a8eSMarkus Armbruster#
1411a937b6aaSMarkus Armbruster# Tell qemu that heartbeat is lost, request it to do takeover
1412a937b6aaSMarkus Armbruster# procedures.  If this command is sent to the PVM, the Primary side
1413a937b6aaSMarkus Armbruster# will exit COLO mode.  If sent to the Secondary, the Secondary side
1414a937b6aaSMarkus Armbruster# will run failover work, then takes over server operation to become
1415a937b6aaSMarkus Armbruster# the service VM.
141648685a8eSMarkus Armbruster#
14179fb49daaSMarkus Armbruster# Features:
1418a937b6aaSMarkus Armbruster#
14199fb49daaSMarkus Armbruster# @unstable: This command is experimental.
14209fb49daaSMarkus Armbruster#
142148685a8eSMarkus Armbruster# Since: 2.8
142248685a8eSMarkus Armbruster#
142348685a8eSMarkus Armbruster# Example:
142448685a8eSMarkus Armbruster#
142548685a8eSMarkus Armbruster#     -> { "execute": "x-colo-lost-heartbeat" }
142648685a8eSMarkus Armbruster#     <- { "return": {} }
142748685a8eSMarkus Armbruster##
14289fb49daaSMarkus Armbruster{ 'command': 'x-colo-lost-heartbeat',
142951e47cf8SVladimir Sementsov-Ogievskiy  'features': [ 'unstable' ],
143051e47cf8SVladimir Sementsov-Ogievskiy  'if': 'CONFIG_REPLICATION' }
143148685a8eSMarkus Armbruster
143248685a8eSMarkus Armbruster##
143348685a8eSMarkus Armbruster# @migrate_cancel:
143448685a8eSMarkus Armbruster#
143548685a8eSMarkus Armbruster# Cancel the current executing migration process.
143648685a8eSMarkus Armbruster#
1437a937b6aaSMarkus Armbruster# Notes: This command succeeds even if there is no migration process
1438a937b6aaSMarkus Armbruster#     running.
143948685a8eSMarkus Armbruster#
14409bc6e893SMarkus Armbruster# Since: 0.14
144148685a8eSMarkus Armbruster#
144248685a8eSMarkus Armbruster# Example:
144348685a8eSMarkus Armbruster#
144448685a8eSMarkus Armbruster#     -> { "execute": "migrate_cancel" }
144548685a8eSMarkus Armbruster#     <- { "return": {} }
144648685a8eSMarkus Armbruster##
144748685a8eSMarkus Armbruster{ 'command': 'migrate_cancel' }
144848685a8eSMarkus Armbruster
144948685a8eSMarkus Armbruster##
145089cfc02cSDr. David Alan Gilbert# @migrate-continue:
145189cfc02cSDr. David Alan Gilbert#
145289cfc02cSDr. David Alan Gilbert# Continue migration when it's in a paused state.
145389cfc02cSDr. David Alan Gilbert#
145489cfc02cSDr. David Alan Gilbert# @state: The state the migration is currently expected to be in
145589cfc02cSDr. David Alan Gilbert#
145689cfc02cSDr. David Alan Gilbert# Since: 2.11
14574ae65a52SAndrea Bolognani#
145889cfc02cSDr. David Alan Gilbert# Example:
145989cfc02cSDr. David Alan Gilbert#
146089cfc02cSDr. David Alan Gilbert#     -> { "execute": "migrate-continue" , "arguments":
146189cfc02cSDr. David Alan Gilbert#          { "state": "pre-switchover" } }
146289cfc02cSDr. David Alan Gilbert#     <- { "return": {} }
146389cfc02cSDr. David Alan Gilbert##
146489cfc02cSDr. David Alan Gilbert{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
146589cfc02cSDr. David Alan Gilbert
146689cfc02cSDr. David Alan Gilbert##
1467e034f883SHet Gala# @MigrationAddressType:
1468e034f883SHet Gala#
1469e034f883SHet Gala# The migration stream transport mechanisms.
1470e034f883SHet Gala#
1471e034f883SHet Gala# @socket: Migrate via socket.
1472e034f883SHet Gala#
1473e034f883SHet Gala# @exec: Direct the migration stream to another process.
1474e034f883SHet Gala#
1475e034f883SHet Gala# @rdma: Migrate via RDMA.
1476e034f883SHet Gala#
1477e034f883SHet Gala# @file: Direct the migration stream to a file.
1478e034f883SHet Gala#
147937507c14SMarkus Armbruster# Since: 8.2
1480e034f883SHet Gala##
1481e034f883SHet Gala{ 'enum': 'MigrationAddressType',
1482e034f883SHet Gala  'data': [ 'socket', 'exec', 'rdma', 'file' ] }
1483e034f883SHet Gala
1484e034f883SHet Gala##
1485e034f883SHet Gala# @FileMigrationArgs:
1486e034f883SHet Gala#
1487e034f883SHet Gala# @filename: The file to receive the migration stream
1488e034f883SHet Gala#
1489e034f883SHet Gala# @offset: The file offset where the migration stream will start
1490e034f883SHet Gala#
149137507c14SMarkus Armbruster# Since: 8.2
1492e034f883SHet Gala##
1493e034f883SHet Gala{ 'struct': 'FileMigrationArgs',
1494e034f883SHet Gala  'data': { 'filename': 'str',
1495e034f883SHet Gala            'offset': 'uint64' } }
1496e034f883SHet Gala
1497e034f883SHet Gala##
1498e034f883SHet Gala# @MigrationExecCommand:
1499e034f883SHet Gala#
1500e034f883SHet Gala# @args: command (list head) and arguments to execute.
1501e034f883SHet Gala#
150237507c14SMarkus Armbruster# Since: 8.2
1503e034f883SHet Gala##
1504e034f883SHet Gala{ 'struct': 'MigrationExecCommand',
1505e034f883SHet Gala  'data': {'args': [ 'str' ] } }
1506e034f883SHet Gala
1507e034f883SHet Gala##
1508e034f883SHet Gala# @MigrationAddress:
1509e034f883SHet Gala#
1510e034f883SHet Gala# Migration endpoint configuration.
1511e034f883SHet Gala#
151289a2273bSMarkus Armbruster# @transport: The migration stream transport mechanism
151389a2273bSMarkus Armbruster#
151437507c14SMarkus Armbruster# Since: 8.2
1515e034f883SHet Gala##
1516e034f883SHet Gala{ 'union': 'MigrationAddress',
1517e034f883SHet Gala  'base': { 'transport' : 'MigrationAddressType'},
1518e034f883SHet Gala  'discriminator': 'transport',
1519e034f883SHet Gala  'data': {
1520e034f883SHet Gala    'socket': 'SocketAddress',
1521e034f883SHet Gala    'exec': 'MigrationExecCommand',
1522e034f883SHet Gala    'rdma': 'InetSocketAddress',
1523e034f883SHet Gala    'file': 'FileMigrationArgs' } }
1524e034f883SHet Gala
1525e034f883SHet Gala##
1526074dbce5SHet Gala# @MigrationChannelType:
1527074dbce5SHet Gala#
1528074dbce5SHet Gala# The migration channel-type request options.
1529074dbce5SHet Gala#
1530074dbce5SHet Gala# @main: Main outbound migration channel.
1531074dbce5SHet Gala#
153237507c14SMarkus Armbruster# Since: 8.1
1533074dbce5SHet Gala##
1534074dbce5SHet Gala{ 'enum': 'MigrationChannelType',
1535074dbce5SHet Gala  'data': [ 'main' ] }
1536074dbce5SHet Gala
1537074dbce5SHet Gala##
1538074dbce5SHet Gala# @MigrationChannel:
1539074dbce5SHet Gala#
1540074dbce5SHet Gala# Migration stream channel parameters.
1541074dbce5SHet Gala#
15424061c334SMichael Tokarev# @channel-type: Channel type for transferring packet information.
1543074dbce5SHet Gala#
1544074dbce5SHet Gala# @addr: Migration endpoint configuration on destination interface.
1545074dbce5SHet Gala#
154637507c14SMarkus Armbruster# Since: 8.1
1547074dbce5SHet Gala##
1548074dbce5SHet Gala{ 'struct': 'MigrationChannel',
1549074dbce5SHet Gala  'data': {
1550074dbce5SHet Gala      'channel-type': 'MigrationChannelType',
1551074dbce5SHet Gala      'addr': 'MigrationAddress' } }
1552074dbce5SHet Gala
1553074dbce5SHet Gala##
155448685a8eSMarkus Armbruster# @migrate:
155548685a8eSMarkus Armbruster#
155648685a8eSMarkus Armbruster# Migrates the current running guest to another Virtual Machine.
155748685a8eSMarkus Armbruster#
155848685a8eSMarkus Armbruster# @uri: the Uniform Resource Identifier of the destination VM
155948685a8eSMarkus Armbruster#
1560074dbce5SHet Gala# @channels: list of migration stream channels with each stream in the
1561074dbce5SHet Gala#     list connected to a destination interface endpoint.
1562074dbce5SHet Gala#
1563a937b6aaSMarkus Armbruster# @detach: this argument exists only for compatibility reasons and is
1564a937b6aaSMarkus Armbruster#     ignored by QEMU
156548685a8eSMarkus Armbruster#
156651f63ec7SPeter Maydell# @resume: resume one paused migration, default "off".  (since 3.0)
15677a4da28bSPeter Xu#
15689bc6e893SMarkus Armbruster# Since: 0.14
156948685a8eSMarkus Armbruster#
157048685a8eSMarkus Armbruster# Notes:
157148685a8eSMarkus Armbruster#
15721ed1d4d6SMarkus Armbruster#     1. The 'query-migrate' command should be used to check
15731ed1d4d6SMarkus Armbruster#        migration's progress and final result (this information is
15741ed1d4d6SMarkus Armbruster#        provided by the 'status' member)
157548685a8eSMarkus Armbruster#
157648685a8eSMarkus Armbruster#     2. All boolean arguments default to false
157748685a8eSMarkus Armbruster#
15781ed1d4d6SMarkus Armbruster#     3. The user Monitor's "detach" argument is invalid in QMP and
15791ed1d4d6SMarkus Armbruster#        should not be used
158048685a8eSMarkus Armbruster#
15811ed1d4d6SMarkus Armbruster#     4. The uri argument should have the Uniform Resource Identifier
15821ed1d4d6SMarkus Armbruster#        of default destination VM. This connection will be bound to
15831ed1d4d6SMarkus Armbruster#        default network.
1584074dbce5SHet Gala#
15851ed1d4d6SMarkus Armbruster#     5. For now, number of migration streams is restricted to one,
15867d08424cSMarkus Armbruster#        i.e. number of items in 'channels' list is just 1.
1587074dbce5SHet Gala#
1588074dbce5SHet Gala#     6. The 'uri' and 'channels' arguments are mutually exclusive;
1589074dbce5SHet Gala#        exactly one of the two should be present.
1590074dbce5SHet Gala#
159148685a8eSMarkus Armbruster# Example:
159248685a8eSMarkus Armbruster#
159348685a8eSMarkus Armbruster#     -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
159448685a8eSMarkus Armbruster#     <- { "return": {} }
15953cee17e7SHet Gala#
1596074dbce5SHet Gala#     -> { "execute": "migrate",
1597074dbce5SHet Gala#          "arguments": {
1598074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1599074dbce5SHet Gala#                              "addr": { "transport": "socket",
1600074dbce5SHet Gala#                                        "type": "inet",
1601074dbce5SHet Gala#                                        "host": "10.12.34.9",
1602074dbce5SHet Gala#                                        "port": "1050" } } ] } }
1603074dbce5SHet Gala#     <- { "return": {} }
1604074dbce5SHet Gala#
1605074dbce5SHet Gala#     -> { "execute": "migrate",
1606074dbce5SHet Gala#          "arguments": {
1607074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1608074dbce5SHet Gala#                              "addr": { "transport": "exec",
1609074dbce5SHet Gala#                                        "args": [ "/bin/nc", "-p", "6000",
1610074dbce5SHet Gala#                                                  "/some/sock" ] } } ] } }
1611074dbce5SHet Gala#     <- { "return": {} }
1612074dbce5SHet Gala#
1613074dbce5SHet Gala#     -> { "execute": "migrate",
1614074dbce5SHet Gala#          "arguments": {
1615074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1616074dbce5SHet Gala#                              "addr": { "transport": "rdma",
1617074dbce5SHet Gala#                                        "host": "10.12.34.9",
1618074dbce5SHet Gala#                                        "port": "1050" } } ] } }
1619074dbce5SHet Gala#     <- { "return": {} }
1620074dbce5SHet Gala#
1621074dbce5SHet Gala#     -> { "execute": "migrate",
1622074dbce5SHet Gala#          "arguments": {
1623074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1624074dbce5SHet Gala#                              "addr": { "transport": "file",
1625074dbce5SHet Gala#                                        "filename": "/tmp/migfile",
1626074dbce5SHet Gala#                                        "offset": "0x1000" } } ] } }
1627074dbce5SHet Gala#     <- { "return": {} }
1628074dbce5SHet Gala#
162948685a8eSMarkus Armbruster##
163048685a8eSMarkus Armbruster{ 'command': 'migrate',
163157fd4b4eSHet Gala  'data': {'*uri': 'str',
1632074dbce5SHet Gala           '*channels': [ 'MigrationChannel' ],
16337a4da28bSPeter Xu           '*detach': 'bool', '*resume': 'bool' } }
163448685a8eSMarkus Armbruster
163548685a8eSMarkus Armbruster##
163648685a8eSMarkus Armbruster# @migrate-incoming:
163748685a8eSMarkus Armbruster#
1638a937b6aaSMarkus Armbruster# Start an incoming migration, the qemu must have been started with
1639a937b6aaSMarkus Armbruster# -incoming defer
164048685a8eSMarkus Armbruster#
164148685a8eSMarkus Armbruster# @uri: The Uniform Resource Identifier identifying the source or
164248685a8eSMarkus Armbruster#     address to listen on
164348685a8eSMarkus Armbruster#
1644074dbce5SHet Gala# @channels: list of migration stream channels with each stream in the
1645074dbce5SHet Gala#     list connected to a destination interface endpoint.
1646074dbce5SHet Gala#
1647dbea1c89SVladimir Sementsov-Ogievskiy# @exit-on-error: Exit on incoming migration failure.  Default true.
1648dbea1c89SVladimir Sementsov-Ogievskiy#     When set to false, the failure triggers a MIGRATION event, and
1649dbea1c89SVladimir Sementsov-Ogievskiy#     error details could be retrieved with query-migrate.  (since 9.1)
1650dbea1c89SVladimir Sementsov-Ogievskiy#
165148685a8eSMarkus Armbruster# Since: 2.3
165248685a8eSMarkus Armbruster#
165348685a8eSMarkus Armbruster# Notes:
165448685a8eSMarkus Armbruster#
16551ed1d4d6SMarkus Armbruster#     1. It's a bad idea to use a string for the uri, but it needs to
16561ed1d4d6SMarkus Armbruster#        stay compatible with -incoming and the format of the uri is
16571ed1d4d6SMarkus Armbruster#        already exposed above libvirt.
165848685a8eSMarkus Armbruster#
1659a937b6aaSMarkus Armbruster#     2. QEMU must be started with -incoming defer to allow
1660a937b6aaSMarkus Armbruster#        migrate-incoming to be used.
166148685a8eSMarkus Armbruster#
166248685a8eSMarkus Armbruster#     3. The uri format is the same as for -incoming
166348685a8eSMarkus Armbruster#
16643cee17e7SHet Gala#     4. For now, number of migration streams is restricted to one,
16657d08424cSMarkus Armbruster#        i.e. number of items in 'channels' list is just 1.
1666074dbce5SHet Gala#
16673cee17e7SHet Gala#     5. The 'uri' and 'channels' arguments are mutually exclusive;
1668074dbce5SHet Gala#        exactly one of the two should be present.
1669074dbce5SHet Gala#
167048685a8eSMarkus Armbruster# Example:
167148685a8eSMarkus Armbruster#
167248685a8eSMarkus Armbruster#     -> { "execute": "migrate-incoming",
16733cee17e7SHet Gala#          "arguments": { "uri": "tcp:0:4446" } }
167448685a8eSMarkus Armbruster#     <- { "return": {} }
1675074dbce5SHet Gala#
16763cee17e7SHet Gala#     -> { "execute": "migrate-incoming",
1677074dbce5SHet Gala#          "arguments": {
1678074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1679074dbce5SHet Gala#                              "addr": { "transport": "socket",
1680074dbce5SHet Gala#                                        "type": "inet",
1681074dbce5SHet Gala#                                        "host": "10.12.34.9",
1682074dbce5SHet Gala#                                        "port": "1050" } } ] } }
1683074dbce5SHet Gala#     <- { "return": {} }
1684074dbce5SHet Gala#
16853cee17e7SHet Gala#     -> { "execute": "migrate-incoming",
1686074dbce5SHet Gala#          "arguments": {
1687074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1688074dbce5SHet Gala#                              "addr": { "transport": "exec",
1689074dbce5SHet Gala#                                        "args": [ "/bin/nc", "-p", "6000",
1690074dbce5SHet Gala#                                                  "/some/sock" ] } } ] } }
1691074dbce5SHet Gala#     <- { "return": {} }
1692074dbce5SHet Gala#
16933cee17e7SHet Gala#     -> { "execute": "migrate-incoming",
1694074dbce5SHet Gala#          "arguments": {
1695074dbce5SHet Gala#              "channels": [ { "channel-type": "main",
1696074dbce5SHet Gala#                              "addr": { "transport": "rdma",
1697074dbce5SHet Gala#                                        "host": "10.12.34.9",
1698074dbce5SHet Gala#                                        "port": "1050" } } ] } }
1699074dbce5SHet Gala#     <- { "return": {} }
170048685a8eSMarkus Armbruster##
1701074dbce5SHet Gala{ 'command': 'migrate-incoming',
1702074dbce5SHet Gala             'data': {'*uri': 'str',
1703dbea1c89SVladimir Sementsov-Ogievskiy                      '*channels': [ 'MigrationChannel' ],
1704dbea1c89SVladimir Sementsov-Ogievskiy                      '*exit-on-error': 'bool' } }
170548685a8eSMarkus Armbruster
170648685a8eSMarkus Armbruster##
170748685a8eSMarkus Armbruster# @xen-save-devices-state:
170848685a8eSMarkus Armbruster#
1709a937b6aaSMarkus Armbruster# Save the state of all devices to file.  The RAM and the block
1710a937b6aaSMarkus Armbruster# devices of the VM are not saved by this command.
171148685a8eSMarkus Armbruster#
171248685a8eSMarkus Armbruster# @filename: the file to save the state of the devices to as binary
1713a937b6aaSMarkus Armbruster#     data.  See xen-save-devices-state.txt for a description of the
1714a937b6aaSMarkus Armbruster#     binary format.
171548685a8eSMarkus Armbruster#
1716a937b6aaSMarkus Armbruster# @live: Optional argument to ask QEMU to treat this command as part
1717a937b6aaSMarkus Armbruster#     of a live migration.  Default to true.  (since 2.11)
17185d6c599fSAnthony PERARD#
171948685a8eSMarkus Armbruster# Since: 1.1
172048685a8eSMarkus Armbruster#
172148685a8eSMarkus Armbruster# Example:
172248685a8eSMarkus Armbruster#
172348685a8eSMarkus Armbruster#     -> { "execute": "xen-save-devices-state",
172448685a8eSMarkus Armbruster#          "arguments": { "filename": "/tmp/save" } }
172548685a8eSMarkus Armbruster#     <- { "return": {} }
172648685a8eSMarkus Armbruster##
17275d6c599fSAnthony PERARD{ 'command': 'xen-save-devices-state',
17285d6c599fSAnthony PERARD  'data': {'filename': 'str', '*live':'bool' } }
172948685a8eSMarkus Armbruster
173048685a8eSMarkus Armbruster##
173128af9ba2SPhilippe Mathieu-Daudé# @xen-set-global-dirty-log:
173228af9ba2SPhilippe Mathieu-Daudé#
173328af9ba2SPhilippe Mathieu-Daudé# Enable or disable the global dirty log mode.
173428af9ba2SPhilippe Mathieu-Daudé#
173528af9ba2SPhilippe Mathieu-Daudé# @enable: true to enable, false to disable.
173628af9ba2SPhilippe Mathieu-Daudé#
173728af9ba2SPhilippe Mathieu-Daudé# Since: 1.3
173828af9ba2SPhilippe Mathieu-Daudé#
173928af9ba2SPhilippe Mathieu-Daudé# Example:
174028af9ba2SPhilippe Mathieu-Daudé#
174128af9ba2SPhilippe Mathieu-Daudé#     -> { "execute": "xen-set-global-dirty-log",
174228af9ba2SPhilippe Mathieu-Daudé#          "arguments": { "enable": true } }
174328af9ba2SPhilippe Mathieu-Daudé#     <- { "return": {} }
174428af9ba2SPhilippe Mathieu-Daudé##
174528af9ba2SPhilippe Mathieu-Daudé{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
174628af9ba2SPhilippe Mathieu-Daudé
174728af9ba2SPhilippe Mathieu-Daudé##
174828af9ba2SPhilippe Mathieu-Daudé# @xen-load-devices-state:
174928af9ba2SPhilippe Mathieu-Daudé#
1750a937b6aaSMarkus Armbruster# Load the state of all devices from file.  The RAM and the block
1751a937b6aaSMarkus Armbruster# devices of the VM are not loaded by this command.
175228af9ba2SPhilippe Mathieu-Daudé#
175328af9ba2SPhilippe Mathieu-Daudé# @filename: the file to load the state of the devices from as binary
1754a937b6aaSMarkus Armbruster#     data.  See xen-save-devices-state.txt for a description of the
1755a937b6aaSMarkus Armbruster#     binary format.
175628af9ba2SPhilippe Mathieu-Daudé#
175728af9ba2SPhilippe Mathieu-Daudé# Since: 2.7
175828af9ba2SPhilippe Mathieu-Daudé#
175928af9ba2SPhilippe Mathieu-Daudé# Example:
176028af9ba2SPhilippe Mathieu-Daudé#
176128af9ba2SPhilippe Mathieu-Daudé#     -> { "execute": "xen-load-devices-state",
176228af9ba2SPhilippe Mathieu-Daudé#          "arguments": { "filename": "/tmp/resume" } }
176328af9ba2SPhilippe Mathieu-Daudé#     <- { "return": {} }
176428af9ba2SPhilippe Mathieu-Daudé##
176528af9ba2SPhilippe Mathieu-Daudé{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
176628af9ba2SPhilippe Mathieu-Daudé
176728af9ba2SPhilippe Mathieu-Daudé##
176848685a8eSMarkus Armbruster# @xen-set-replication:
176948685a8eSMarkus Armbruster#
177048685a8eSMarkus Armbruster# Enable or disable replication.
177148685a8eSMarkus Armbruster#
177248685a8eSMarkus Armbruster# @enable: true to enable, false to disable.
177348685a8eSMarkus Armbruster#
177448685a8eSMarkus Armbruster# @primary: true for primary or false for secondary.
177548685a8eSMarkus Armbruster#
177673c67f38SMarkus Armbruster# @failover: true to do failover, false to stop.  Cannot be specified
177773c67f38SMarkus Armbruster#     if 'enable' is true.  Default value is false.
177848685a8eSMarkus Armbruster#
177948685a8eSMarkus Armbruster# Example:
178048685a8eSMarkus Armbruster#
178148685a8eSMarkus Armbruster#     -> { "execute": "xen-set-replication",
178248685a8eSMarkus Armbruster#          "arguments": {"enable": true, "primary": false} }
178348685a8eSMarkus Armbruster#     <- { "return": {} }
178448685a8eSMarkus Armbruster#
178548685a8eSMarkus Armbruster# Since: 2.9
178648685a8eSMarkus Armbruster##
178748685a8eSMarkus Armbruster{ 'command': 'xen-set-replication',
1788335d10cdSMarc-André Lureau  'data': { 'enable': 'bool', 'primary': 'bool', '*failover': 'bool' },
17898a9f1e1dSMarc-André Lureau  'if': 'CONFIG_REPLICATION' }
179048685a8eSMarkus Armbruster
179148685a8eSMarkus Armbruster##
179248685a8eSMarkus Armbruster# @ReplicationStatus:
179348685a8eSMarkus Armbruster#
179448685a8eSMarkus Armbruster# The result format for 'query-xen-replication-status'.
179548685a8eSMarkus Armbruster#
179648685a8eSMarkus Armbruster# @error: true if an error happened, false if replication is normal.
179748685a8eSMarkus Armbruster#
1798a937b6aaSMarkus Armbruster# @desc: the human readable error description string, when @error is
1799a937b6aaSMarkus Armbruster#     'true'.
180048685a8eSMarkus Armbruster#
180148685a8eSMarkus Armbruster# Since: 2.9
180248685a8eSMarkus Armbruster##
180348685a8eSMarkus Armbruster{ 'struct': 'ReplicationStatus',
1804335d10cdSMarc-André Lureau  'data': { 'error': 'bool', '*desc': 'str' },
18058a9f1e1dSMarc-André Lureau  'if': 'CONFIG_REPLICATION' }
180648685a8eSMarkus Armbruster
180748685a8eSMarkus Armbruster##
180848685a8eSMarkus Armbruster# @query-xen-replication-status:
180948685a8eSMarkus Armbruster#
181048685a8eSMarkus Armbruster# Query replication status while the vm is running.
181148685a8eSMarkus Armbruster#
1812f4347129SAndrea Bolognani# Returns: A @ReplicationStatus object showing the status.
181348685a8eSMarkus Armbruster#
181448685a8eSMarkus Armbruster# Example:
181548685a8eSMarkus Armbruster#
181648685a8eSMarkus Armbruster#     -> { "execute": "query-xen-replication-status" }
181748685a8eSMarkus Armbruster#     <- { "return": { "error": false } }
181848685a8eSMarkus Armbruster#
181948685a8eSMarkus Armbruster# Since: 2.9
182048685a8eSMarkus Armbruster##
182148685a8eSMarkus Armbruster{ 'command': 'query-xen-replication-status',
1822335d10cdSMarc-André Lureau  'returns': 'ReplicationStatus',
18238a9f1e1dSMarc-André Lureau  'if': 'CONFIG_REPLICATION' }
182448685a8eSMarkus Armbruster
182548685a8eSMarkus Armbruster##
182648685a8eSMarkus Armbruster# @xen-colo-do-checkpoint:
182748685a8eSMarkus Armbruster#
182848685a8eSMarkus Armbruster# Xen uses this command to notify replication to trigger a checkpoint.
182948685a8eSMarkus Armbruster#
183048685a8eSMarkus Armbruster# Example:
183148685a8eSMarkus Armbruster#
183248685a8eSMarkus Armbruster#     -> { "execute": "xen-colo-do-checkpoint" }
183348685a8eSMarkus Armbruster#     <- { "return": {} }
183448685a8eSMarkus Armbruster#
183548685a8eSMarkus Armbruster# Since: 2.9
183648685a8eSMarkus Armbruster##
1837335d10cdSMarc-André Lureau{ 'command': 'xen-colo-do-checkpoint',
18388a9f1e1dSMarc-André Lureau  'if': 'CONFIG_REPLICATION' }
183902affd41SPeter Xu
184002affd41SPeter Xu##
1841f56c0065SZhang Chen# @COLOStatus:
1842f56c0065SZhang Chen#
1843f56c0065SZhang Chen# The result format for 'query-colo-status'.
1844f56c0065SZhang Chen#
1845a937b6aaSMarkus Armbruster# @mode: COLO running mode.  If COLO is running, this field will
1846a937b6aaSMarkus Armbruster#     return 'primary' or 'secondary'.
1847f56c0065SZhang Chen#
18485cc8f9ebSZhang Chen# @last-mode: COLO last running mode.  If COLO is running, this field
1849a937b6aaSMarkus Armbruster#     will return same like mode field, after failover we can use this
1850a937b6aaSMarkus Armbruster#     field to get last colo mode.  (since 4.0)
18515ed0decaSZhang Chen#
1852f56c0065SZhang Chen# @reason: describes the reason for the COLO exit.
1853f56c0065SZhang Chen#
1854ea3b23e5SZhang Chen# Since: 3.1
1855f56c0065SZhang Chen##
1856f56c0065SZhang Chen{ 'struct': 'COLOStatus',
18575cc8f9ebSZhang Chen  'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
185851e47cf8SVladimir Sementsov-Ogievskiy            'reason': 'COLOExitReason' },
185951e47cf8SVladimir Sementsov-Ogievskiy  'if': 'CONFIG_REPLICATION' }
1860f56c0065SZhang Chen
1861f56c0065SZhang Chen##
1862f56c0065SZhang Chen# @query-colo-status:
1863f56c0065SZhang Chen#
1864f56c0065SZhang Chen# Query COLO status while the vm is running.
1865f56c0065SZhang Chen#
1866f56c0065SZhang Chen# Returns: A @COLOStatus object showing the status.
1867f56c0065SZhang Chen#
1868f56c0065SZhang Chen# Example:
1869f56c0065SZhang Chen#
1870f56c0065SZhang Chen#     -> { "execute": "query-colo-status" }
187151ec294dSVictor Toso#     <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
1872f56c0065SZhang Chen#
1873ea3b23e5SZhang Chen# Since: 3.1
1874f56c0065SZhang Chen##
1875f56c0065SZhang Chen{ 'command': 'query-colo-status',
187651e47cf8SVladimir Sementsov-Ogievskiy  'returns': 'COLOStatus',
187751e47cf8SVladimir Sementsov-Ogievskiy  'if': 'CONFIG_REPLICATION' }
1878f56c0065SZhang Chen
1879f56c0065SZhang Chen##
188002affd41SPeter Xu# @migrate-recover:
188102affd41SPeter Xu#
188202affd41SPeter Xu# Provide a recovery migration stream URI.
188302affd41SPeter Xu#
188402affd41SPeter Xu# @uri: the URI to be used for the recovery of migration stream.
188502affd41SPeter Xu#
188602affd41SPeter Xu# Example:
188702affd41SPeter Xu#
188802affd41SPeter Xu#     -> { "execute": "migrate-recover",
188902affd41SPeter Xu#          "arguments": { "uri": "tcp:192.168.1.200:12345" } }
189002affd41SPeter Xu#     <- { "return": {} }
189102affd41SPeter Xu#
189251f63ec7SPeter Maydell# Since: 3.0
189302affd41SPeter Xu##
1894b0ddeba2SMarc-André Lureau{ 'command': 'migrate-recover',
1895b0ddeba2SMarc-André Lureau  'data': { 'uri': 'str' },
189602affd41SPeter Xu  'allow-oob': true }
1897bfbf89c2SPeter Xu
1898bfbf89c2SPeter Xu##
1899bfbf89c2SPeter Xu# @migrate-pause:
1900bfbf89c2SPeter Xu#
1901bfbf89c2SPeter Xu# Pause a migration.  Currently it only supports postcopy.
1902bfbf89c2SPeter Xu#
1903bfbf89c2SPeter Xu# Example:
1904bfbf89c2SPeter Xu#
1905bfbf89c2SPeter Xu#     -> { "execute": "migrate-pause" }
1906bfbf89c2SPeter Xu#     <- { "return": {} }
1907bfbf89c2SPeter Xu#
190851f63ec7SPeter Maydell# Since: 3.0
1909bfbf89c2SPeter Xu##
1910bfbf89c2SPeter Xu{ 'command': 'migrate-pause', 'allow-oob': true }
1911d328e6f3SJens Freimann
1912d328e6f3SJens Freimann##
1913d328e6f3SJens Freimann# @UNPLUG_PRIMARY:
1914d328e6f3SJens Freimann#
1915d328e6f3SJens Freimann# Emitted from source side of a migration when migration state is
1916a937b6aaSMarkus Armbruster# WAIT_UNPLUG. Device was unplugged by guest operating system.  Device
1917a937b6aaSMarkus Armbruster# resources in QEMU are kept on standby to be able to re-plug it in
1918a937b6aaSMarkus Armbruster# case of migration failure.
1919d328e6f3SJens Freimann#
1920d328e6f3SJens Freimann# @device-id: QEMU device id of the unplugged device
1921d328e6f3SJens Freimann#
1922d328e6f3SJens Freimann# Since: 4.2
1923d328e6f3SJens Freimann#
1924d328e6f3SJens Freimann# Example:
19254ae65a52SAndrea Bolognani#
19260df5e9a3SVictor Toso#     <- { "event": "UNPLUG_PRIMARY",
19270df5e9a3SVictor Toso#          "data": { "device-id": "hostdev0" },
19280df5e9a3SVictor Toso#          "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1929d328e6f3SJens Freimann##
1930d328e6f3SJens Freimann{ 'event': 'UNPLUG_PRIMARY',
1931d328e6f3SJens Freimann  'data': { 'device-id': 'str' } }
19327df3aa30SChuan Zheng
19337df3aa30SChuan Zheng##
193471864eadSHyman Huang(黄勇)# @DirtyRateVcpu:
193571864eadSHyman Huang(黄勇)#
193671864eadSHyman Huang(黄勇)# Dirty rate of vcpu.
193771864eadSHyman Huang(黄勇)#
193871864eadSHyman Huang(黄勇)# @id: vcpu index.
193971864eadSHyman Huang(黄勇)#
194071864eadSHyman Huang(黄勇)# @dirty-rate: dirty rate.
194171864eadSHyman Huang(黄勇)#
1942f78d4ed7SHyman Huang(黄勇)# Since: 6.2
194371864eadSHyman Huang(黄勇)##
194471864eadSHyman Huang(黄勇){ 'struct': 'DirtyRateVcpu',
194571864eadSHyman Huang(黄勇)  'data': { 'id': 'int', 'dirty-rate': 'int64' } }
194671864eadSHyman Huang(黄勇)
194771864eadSHyman Huang(黄勇)##
19487df3aa30SChuan Zheng# @DirtyRateStatus:
19497df3aa30SChuan Zheng#
19505034e3d4SAndrei Gudkov# Dirty page rate measurement status.
19517df3aa30SChuan Zheng#
19525034e3d4SAndrei Gudkov# @unstarted: measuring thread has not been started yet
19537df3aa30SChuan Zheng#
19545034e3d4SAndrei Gudkov# @measuring: measuring thread is running
19557df3aa30SChuan Zheng#
19565034e3d4SAndrei Gudkov# @measured: dirty page rate is measured and the results are available
19577df3aa30SChuan Zheng#
19587df3aa30SChuan Zheng# Since: 5.2
19597df3aa30SChuan Zheng##
19607df3aa30SChuan Zheng{ 'enum': 'DirtyRateStatus',
19617df3aa30SChuan Zheng  'data': [ 'unstarted', 'measuring', 'measured'] }
19624c437254SChuan Zheng
19634c437254SChuan Zheng##
196471864eadSHyman Huang(黄勇)# @DirtyRateMeasureMode:
196571864eadSHyman Huang(黄勇)#
19665034e3d4SAndrei Gudkov# Method used to measure dirty page rate.  Differences between
19675034e3d4SAndrei Gudkov# available methods are explained in @calc-dirty-rate.
196871864eadSHyman Huang(黄勇)#
19695034e3d4SAndrei Gudkov# @page-sampling: use page sampling
197071864eadSHyman Huang(黄勇)#
19715034e3d4SAndrei Gudkov# @dirty-ring: use dirty ring
1972826b8bc8SHyman Huang(黄勇)#
19735034e3d4SAndrei Gudkov# @dirty-bitmap: use dirty bitmap
197471864eadSHyman Huang(黄勇)#
1975f78d4ed7SHyman Huang(黄勇)# Since: 6.2
197671864eadSHyman Huang(黄勇)##
197771864eadSHyman Huang(黄勇){ 'enum': 'DirtyRateMeasureMode',
1978826b8bc8SHyman Huang(黄勇)  'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
197971864eadSHyman Huang(黄勇)
198071864eadSHyman Huang(黄勇)##
198134a68001SAndrei Gudkov# @TimeUnit:
198234a68001SAndrei Gudkov#
198334a68001SAndrei Gudkov# Specifies unit in which time-related value is specified.
198434a68001SAndrei Gudkov#
198534a68001SAndrei Gudkov# @second: value is in seconds
198634a68001SAndrei Gudkov#
198734a68001SAndrei Gudkov# @millisecond: value is in milliseconds
198834a68001SAndrei Gudkov#
198937507c14SMarkus Armbruster# Since: 8.2
199034a68001SAndrei Gudkov##
199134a68001SAndrei Gudkov{ 'enum': 'TimeUnit',
199234a68001SAndrei Gudkov  'data': ['second', 'millisecond'] }
199334a68001SAndrei Gudkov
199434a68001SAndrei Gudkov##
19954c437254SChuan Zheng# @DirtyRateInfo:
19964c437254SChuan Zheng#
19975034e3d4SAndrei Gudkov# Information about measured dirty page rate.
19984c437254SChuan Zheng#
1999a937b6aaSMarkus Armbruster# @dirty-rate: an estimate of the dirty page rate of the VM in units
20005034e3d4SAndrei Gudkov#     of MiB/s.  Value is present only when @status is 'measured'.
20014c437254SChuan Zheng#
20025034e3d4SAndrei Gudkov# @status: current status of dirty page rate measurements
20034c437254SChuan Zheng#
20044c437254SChuan Zheng# @start-time: start time in units of second for calculation
20054c437254SChuan Zheng#
200634a68001SAndrei Gudkov# @calc-time: time period for which dirty page rate was measured,
200734a68001SAndrei Gudkov#     expressed and rounded down to @calc-time-unit.
200834a68001SAndrei Gudkov#
200934a68001SAndrei Gudkov# @calc-time-unit: time unit of @calc-time  (Since 8.2)
20104c437254SChuan Zheng#
20115034e3d4SAndrei Gudkov# @sample-pages: number of sampled pages per GiB of guest memory.
20125034e3d4SAndrei Gudkov#     Valid only in page-sampling mode (Since 6.1)
20137afa08cdSHyman Huang(黄勇)#
20145034e3d4SAndrei Gudkov# @mode: mode that was used to measure dirty page rate (Since 6.2)
20150e21bf24SHyman Huang(黄勇)#
20165034e3d4SAndrei Gudkov# @vcpu-dirty-rate: dirty rate for each vCPU if dirty-ring mode was
2017a937b6aaSMarkus Armbruster#     specified (Since 6.2)
20180e21bf24SHyman Huang(黄勇)#
20194c437254SChuan Zheng# Since: 5.2
20204c437254SChuan Zheng##
20214c437254SChuan Zheng{ 'struct': 'DirtyRateInfo',
2022b1a859cfSChuan Zheng  'data': {'*dirty-rate': 'int64',
20234c437254SChuan Zheng           'status': 'DirtyRateStatus',
20244c437254SChuan Zheng           'start-time': 'int64',
20257afa08cdSHyman Huang(黄勇)           'calc-time': 'int64',
202634a68001SAndrei Gudkov           'calc-time-unit': 'TimeUnit',
20270e21bf24SHyman Huang(黄勇)           'sample-pages': 'uint64',
20280e21bf24SHyman Huang(黄勇)           'mode': 'DirtyRateMeasureMode',
20290e21bf24SHyman Huang(黄勇)           '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
20304c437254SChuan Zheng
20314c437254SChuan Zheng##
20324c437254SChuan Zheng# @calc-dirty-rate:
20334c437254SChuan Zheng#
20345034e3d4SAndrei Gudkov# Start measuring dirty page rate of the VM.  Results can be retrieved
20355034e3d4SAndrei Gudkov# with @query-dirty-rate after measurements are completed.
20364c437254SChuan Zheng#
20375034e3d4SAndrei Gudkov# Dirty page rate is the number of pages changed in a given time
20385034e3d4SAndrei Gudkov# period expressed in MiB/s.  The following methods of calculation are
20395034e3d4SAndrei Gudkov# available:
20404c437254SChuan Zheng#
20415034e3d4SAndrei Gudkov# 1. In page sampling mode, a random subset of pages are selected and
20425034e3d4SAndrei Gudkov#    hashed twice: once at the beginning of measurement time period,
20435034e3d4SAndrei Gudkov#    and once again at the end.  If two hashes for some page are
20445034e3d4SAndrei Gudkov#    different, the page is counted as changed.  Since this method
20455034e3d4SAndrei Gudkov#    relies on sampling and hashing, calculated dirty page rate is
20465034e3d4SAndrei Gudkov#    only an estimate of its true value.  Increasing @sample-pages
20475034e3d4SAndrei Gudkov#    improves estimation quality at the cost of higher computational
20485034e3d4SAndrei Gudkov#    overhead.
20497afa08cdSHyman Huang(黄勇)#
20505034e3d4SAndrei Gudkov# 2. Dirty bitmap mode captures writes to memory (for example by
20515034e3d4SAndrei Gudkov#    temporarily revoking write access to all pages) and counting page
20525034e3d4SAndrei Gudkov#    faults.  Information about modified pages is collected into a
20535034e3d4SAndrei Gudkov#    bitmap, where each bit corresponds to one guest page.  This mode
20545034e3d4SAndrei Gudkov#    requires that KVM accelerator property "dirty-ring-size" is *not*
20555034e3d4SAndrei Gudkov#    set.
20565034e3d4SAndrei Gudkov#
20575034e3d4SAndrei Gudkov# 3. Dirty ring mode is similar to dirty bitmap mode, but the
20585034e3d4SAndrei Gudkov#    information about modified pages is collected into ring buffer.
20595034e3d4SAndrei Gudkov#    This mode tracks page modification per each vCPU separately.  It
20605034e3d4SAndrei Gudkov#    requires that KVM accelerator property "dirty-ring-size" is set.
20615034e3d4SAndrei Gudkov#
206234a68001SAndrei Gudkov# @calc-time: time period for which dirty page rate is calculated.
206334a68001SAndrei Gudkov#     By default it is specified in seconds, but the unit can be set
206434a68001SAndrei Gudkov#     explicitly with @calc-time-unit.  Note that larger @calc-time
206534a68001SAndrei Gudkov#     values will typically result in smaller dirty page rates because
206634a68001SAndrei Gudkov#     page dirtying is a one-time event.  Once some page is counted
206734a68001SAndrei Gudkov#     as dirty during @calc-time period, further writes to this page
206834a68001SAndrei Gudkov#     will not increase dirty page rate anymore.
206934a68001SAndrei Gudkov#
207034a68001SAndrei Gudkov# @calc-time-unit: time unit in which @calc-time is specified.
207134a68001SAndrei Gudkov#     By default it is seconds.  (Since 8.2)
20725034e3d4SAndrei Gudkov#
20735034e3d4SAndrei Gudkov# @sample-pages: number of sampled pages per each GiB of guest memory.
20745034e3d4SAndrei Gudkov#     Default value is 512.  For 4KiB guest pages this corresponds to
20755034e3d4SAndrei Gudkov#     sampling ratio of 0.2%.  This argument is used only in page
20765034e3d4SAndrei Gudkov#     sampling mode.  (Since 6.1)
20775034e3d4SAndrei Gudkov#
20785034e3d4SAndrei Gudkov# @mode: mechanism for tracking dirty pages.  Default value is
20795034e3d4SAndrei Gudkov#     'page-sampling'.  Others are 'dirty-bitmap' and 'dirty-ring'.
20805034e3d4SAndrei Gudkov#     (Since 6.1)
20810e21bf24SHyman Huang(黄勇)#
20824c437254SChuan Zheng# Since: 5.2
20834c437254SChuan Zheng#
20844c437254SChuan Zheng# Example:
20854ae65a52SAndrea Bolognani#
208637fa48a4SMarkus Armbruster#     -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
20877afa08cdSHyman Huang(黄勇)#                                                     'sample-pages': 512} }
208837fa48a4SMarkus Armbruster#     <- { "return": {} }
208934a68001SAndrei Gudkov#
209034a68001SAndrei Gudkov#     Measure dirty rate using dirty bitmap for 500 milliseconds:
209134a68001SAndrei Gudkov#
209234a68001SAndrei Gudkov#     -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 500,
209334a68001SAndrei Gudkov#         "calc-time-unit": "millisecond", "mode": "dirty-bitmap"} }
209434a68001SAndrei Gudkov#
209534a68001SAndrei Gudkov#     <- { "return": {} }
20964c437254SChuan Zheng##
20977afa08cdSHyman Huang(黄勇){ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
209834a68001SAndrei Gudkov                                         '*calc-time-unit': 'TimeUnit',
20990e21bf24SHyman Huang(黄勇)                                         '*sample-pages': 'int',
21000e21bf24SHyman Huang(黄勇)                                         '*mode': 'DirtyRateMeasureMode'} }
21014c437254SChuan Zheng
21024c437254SChuan Zheng##
21034c437254SChuan Zheng# @query-dirty-rate:
21044c437254SChuan Zheng#
21055034e3d4SAndrei Gudkov# Query results of the most recent invocation of @calc-dirty-rate.
21064c437254SChuan Zheng#
210734a68001SAndrei Gudkov# @calc-time-unit: time unit in which to report calculation time.
210834a68001SAndrei Gudkov#     By default it is reported in seconds.  (Since 8.2)
210934a68001SAndrei Gudkov#
21104c437254SChuan Zheng# Since: 5.2
21115034e3d4SAndrei Gudkov#
21125034e3d4SAndrei Gudkov# Examples:
21135034e3d4SAndrei Gudkov#
21145034e3d4SAndrei Gudkov#     1. Measurement is in progress:
21155034e3d4SAndrei Gudkov#
21165034e3d4SAndrei Gudkov#     <- {"status": "measuring", "sample-pages": 512,
2117320a6cccSAndrei Gudkov#         "mode": "page-sampling", "start-time": 1693900454, "calc-time": 10,
211834a68001SAndrei Gudkov#         "calc-time-unit": "second"}
21195034e3d4SAndrei Gudkov#
21205034e3d4SAndrei Gudkov#     2. Measurement has been completed:
21215034e3d4SAndrei Gudkov#
21225034e3d4SAndrei Gudkov#     <- {"status": "measured", "sample-pages": 512, "dirty-rate": 108,
2123320a6cccSAndrei Gudkov#         "mode": "page-sampling", "start-time": 1693900454, "calc-time": 10,
212434a68001SAndrei Gudkov#         "calc-time-unit": "second"}
21254c437254SChuan Zheng##
212634a68001SAndrei Gudkov{ 'command': 'query-dirty-rate', 'data': {'*calc-time-unit': 'TimeUnit' },
212734a68001SAndrei Gudkov                                 'returns': 'DirtyRateInfo' }
21280f0d83a4SDaniel P. Berrangé
21290f0d83a4SDaniel P. Berrangé##
2130f3b2e38cSHyman Huang(黄勇)# @DirtyLimitInfo:
2131f3b2e38cSHyman Huang(黄勇)#
2132f3b2e38cSHyman Huang(黄勇)# Dirty page rate limit information of a virtual CPU.
2133f3b2e38cSHyman Huang(黄勇)#
2134f3b2e38cSHyman Huang(黄勇)# @cpu-index: index of a virtual CPU.
2135f3b2e38cSHyman Huang(黄勇)#
2136f3b2e38cSHyman Huang(黄勇)# @limit-rate: upper limit of dirty page rate (MB/s) for a virtual
2137f3b2e38cSHyman Huang(黄勇)#     CPU, 0 means unlimited.
2138f3b2e38cSHyman Huang(黄勇)#
2139f3b2e38cSHyman Huang(黄勇)# @current-rate: current dirty page rate (MB/s) for a virtual CPU.
2140f3b2e38cSHyman Huang(黄勇)#
2141f3b2e38cSHyman Huang(黄勇)# Since: 7.1
2142f3b2e38cSHyman Huang(黄勇)##
2143f3b2e38cSHyman Huang(黄勇){ 'struct': 'DirtyLimitInfo',
2144f3b2e38cSHyman Huang(黄勇)  'data': { 'cpu-index': 'int',
2145f3b2e38cSHyman Huang(黄勇)            'limit-rate': 'uint64',
2146f3b2e38cSHyman Huang(黄勇)            'current-rate': 'uint64' } }
2147f3b2e38cSHyman Huang(黄勇)
2148f3b2e38cSHyman Huang(黄勇)##
2149f3b2e38cSHyman Huang(黄勇)# @set-vcpu-dirty-limit:
2150f3b2e38cSHyman Huang(黄勇)#
2151f3b2e38cSHyman Huang(黄勇)# Set the upper limit of dirty page rate for virtual CPUs.
2152f3b2e38cSHyman Huang(黄勇)#
2153a937b6aaSMarkus Armbruster# Requires KVM with accelerator property "dirty-ring-size" set.  A
2154a937b6aaSMarkus Armbruster# virtual CPU's dirty page rate is a measure of its memory load.  To
2155a937b6aaSMarkus Armbruster# observe dirty page rates, use @calc-dirty-rate.
2156f3b2e38cSHyman Huang(黄勇)#
2157f3b2e38cSHyman Huang(黄勇)# @cpu-index: index of a virtual CPU, default is all.
2158f3b2e38cSHyman Huang(黄勇)#
2159f3b2e38cSHyman Huang(黄勇)# @dirty-rate: upper limit of dirty page rate (MB/s) for virtual CPUs.
2160f3b2e38cSHyman Huang(黄勇)#
2161f3b2e38cSHyman Huang(黄勇)# Since: 7.1
2162f3b2e38cSHyman Huang(黄勇)#
2163f3b2e38cSHyman Huang(黄勇)# Example:
216437fa48a4SMarkus Armbruster#
216537fa48a4SMarkus Armbruster#     -> {"execute": "set-vcpu-dirty-limit"}
2166f3b2e38cSHyman Huang(黄勇)#         "arguments": { "dirty-rate": 200,
2167f3b2e38cSHyman Huang(黄勇)#                        "cpu-index": 1 } }
216837fa48a4SMarkus Armbruster#     <- { "return": {} }
2169f3b2e38cSHyman Huang(黄勇)##
2170f3b2e38cSHyman Huang(黄勇){ 'command': 'set-vcpu-dirty-limit',
2171f3b2e38cSHyman Huang(黄勇)  'data': { '*cpu-index': 'int',
2172f3b2e38cSHyman Huang(黄勇)            'dirty-rate': 'uint64' } }
2173f3b2e38cSHyman Huang(黄勇)
2174f3b2e38cSHyman Huang(黄勇)##
2175f3b2e38cSHyman Huang(黄勇)# @cancel-vcpu-dirty-limit:
2176f3b2e38cSHyman Huang(黄勇)#
2177f3b2e38cSHyman Huang(黄勇)# Cancel the upper limit of dirty page rate for virtual CPUs.
2178f3b2e38cSHyman Huang(黄勇)#
2179f3b2e38cSHyman Huang(黄勇)# Cancel the dirty page limit for the vCPU which has been set with
2180f3b2e38cSHyman Huang(黄勇)# set-vcpu-dirty-limit command.  Note that this command requires
2181f3b2e38cSHyman Huang(黄勇)# support from dirty ring, same as the "set-vcpu-dirty-limit".
2182f3b2e38cSHyman Huang(黄勇)#
2183f3b2e38cSHyman Huang(黄勇)# @cpu-index: index of a virtual CPU, default is all.
2184f3b2e38cSHyman Huang(黄勇)#
2185f3b2e38cSHyman Huang(黄勇)# Since: 7.1
2186f3b2e38cSHyman Huang(黄勇)#
2187f3b2e38cSHyman Huang(黄勇)# Example:
218837fa48a4SMarkus Armbruster#
218937fa48a4SMarkus Armbruster#     -> {"execute": "cancel-vcpu-dirty-limit"},
2190f3b2e38cSHyman Huang(黄勇)#         "arguments": { "cpu-index": 1 } }
219137fa48a4SMarkus Armbruster#     <- { "return": {} }
2192f3b2e38cSHyman Huang(黄勇)##
2193f3b2e38cSHyman Huang(黄勇){ 'command': 'cancel-vcpu-dirty-limit',
2194f3b2e38cSHyman Huang(黄勇)  'data': { '*cpu-index': 'int'} }
2195f3b2e38cSHyman Huang(黄勇)
2196f3b2e38cSHyman Huang(黄勇)##
2197f3b2e38cSHyman Huang(黄勇)# @query-vcpu-dirty-limit:
2198f3b2e38cSHyman Huang(黄勇)#
2199a937b6aaSMarkus Armbruster# Returns information about virtual CPU dirty page rate limits, if
2200a937b6aaSMarkus Armbruster# any.
2201f3b2e38cSHyman Huang(黄勇)#
2202f3b2e38cSHyman Huang(黄勇)# Since: 7.1
2203f3b2e38cSHyman Huang(黄勇)#
2204f3b2e38cSHyman Huang(黄勇)# Example:
220537fa48a4SMarkus Armbruster#
220637fa48a4SMarkus Armbruster#     -> {"execute": "query-vcpu-dirty-limit"}
220737fa48a4SMarkus Armbruster#     <- {"return": [
220837fa48a4SMarkus Armbruster#            { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
220937fa48a4SMarkus Armbruster#            { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
2210f3b2e38cSHyman Huang(黄勇)##
2211f3b2e38cSHyman Huang(黄勇){ 'command': 'query-vcpu-dirty-limit',
2212f3b2e38cSHyman Huang(黄勇)  'returns': [ 'DirtyLimitInfo' ] }
2213f3b2e38cSHyman Huang(黄勇)
2214f3b2e38cSHyman Huang(黄勇)##
221567132620SJiang Jiacheng# @MigrationThreadInfo:
221667132620SJiang Jiacheng#
221767132620SJiang Jiacheng# Information about migrationthreads
221867132620SJiang Jiacheng#
221967132620SJiang Jiacheng# @name: the name of migration thread
222067132620SJiang Jiacheng#
222167132620SJiang Jiacheng# @thread-id: ID of the underlying host thread
222267132620SJiang Jiacheng#
222367132620SJiang Jiacheng# Since: 7.2
222467132620SJiang Jiacheng##
222567132620SJiang Jiacheng{ 'struct': 'MigrationThreadInfo',
222667132620SJiang Jiacheng  'data': {'name': 'str',
222767132620SJiang Jiacheng           'thread-id': 'int'} }
222867132620SJiang Jiacheng
222967132620SJiang Jiacheng##
223067132620SJiang Jiacheng# @query-migrationthreads:
223167132620SJiang Jiacheng#
223267132620SJiang Jiacheng# Returns information of migration threads
223367132620SJiang Jiacheng#
2234e6c60bf0SMarkus Armbruster# Returns: @MigrationThreadInfo
223567132620SJiang Jiacheng#
223667132620SJiang Jiacheng# Since: 7.2
223767132620SJiang Jiacheng##
223867132620SJiang Jiacheng{ 'command': 'query-migrationthreads',
223967132620SJiang Jiacheng  'returns': ['MigrationThreadInfo'] }
224067132620SJiang Jiacheng
224167132620SJiang Jiacheng##
22420f0d83a4SDaniel P. Berrangé# @snapshot-save:
22430f0d83a4SDaniel P. Berrangé#
22440f0d83a4SDaniel P. Berrangé# Save a VM snapshot
22450f0d83a4SDaniel P. Berrangé#
22460f0d83a4SDaniel P. Berrangé# @job-id: identifier for the newly created job
2247a937b6aaSMarkus Armbruster#
22480f0d83a4SDaniel P. Berrangé# @tag: name of the snapshot to create
2249a937b6aaSMarkus Armbruster#
22500f0d83a4SDaniel P. Berrangé# @vmstate: block device node name to save vmstate to
2251a937b6aaSMarkus Armbruster#
22520f0d83a4SDaniel P. Berrangé# @devices: list of block device node names to save a snapshot to
22530f0d83a4SDaniel P. Berrangé#
22540f0d83a4SDaniel P. Berrangé# Applications should not assume that the snapshot save is complete
22550f0d83a4SDaniel P. Berrangé# when this command returns.  The job commands / events must be used
2256a937b6aaSMarkus Armbruster# to determine completion and to fetch details of any errors that
2257a937b6aaSMarkus Armbruster# arise.
22580f0d83a4SDaniel P. Berrangé#
2259a937b6aaSMarkus Armbruster# Note that execution of the guest CPUs may be stopped during the time
2260a937b6aaSMarkus Armbruster# it takes to save the snapshot.  A future version of QEMU may ensure
2261a937b6aaSMarkus Armbruster# CPUs are executing continuously.
22620f0d83a4SDaniel P. Berrangé#
2263a937b6aaSMarkus Armbruster# It is strongly recommended that @devices contain all writable block
2264a937b6aaSMarkus Armbruster# device nodes if a consistent snapshot is required.
22650f0d83a4SDaniel P. Berrangé#
22660f0d83a4SDaniel P. Berrangé# If @tag already exists, an error will be reported
22670f0d83a4SDaniel P. Berrangé#
22680f0d83a4SDaniel P. Berrangé# Example:
22690f0d83a4SDaniel P. Berrangé#
22700f0d83a4SDaniel P. Berrangé#     -> { "execute": "snapshot-save",
2271b1ca5322SFabian Holler#          "arguments": {
22720f0d83a4SDaniel P. Berrangé#             "job-id": "snapsave0",
22730f0d83a4SDaniel P. Berrangé#             "tag": "my-snap",
22740f0d83a4SDaniel P. Berrangé#             "vmstate": "disk0",
22750f0d83a4SDaniel P. Berrangé#             "devices": ["disk0", "disk1"]
22760f0d83a4SDaniel P. Berrangé#          }
22770f0d83a4SDaniel P. Berrangé#        }
22780f0d83a4SDaniel P. Berrangé#     <- { "return": { } }
22790f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
22806e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432121972, "microseconds": 744001},
22810f0d83a4SDaniel P. Berrangé#         "data": {"status": "created", "id": "snapsave0"}}
22820f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
22836e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432122172, "microseconds": 744001},
22840f0d83a4SDaniel P. Berrangé#         "data": {"status": "running", "id": "snapsave0"}}
22856e7a37ffSVictor Toso#     <- {"event": "STOP",
22866e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432122372, "microseconds": 744001} }
22876e7a37ffSVictor Toso#     <- {"event": "RESUME",
22886e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432122572, "microseconds": 744001} }
22890f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
22906e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432122772, "microseconds": 744001},
22910f0d83a4SDaniel P. Berrangé#         "data": {"status": "waiting", "id": "snapsave0"}}
22920f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
22936e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432122972, "microseconds": 744001},
22940f0d83a4SDaniel P. Berrangé#         "data": {"status": "pending", "id": "snapsave0"}}
22950f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
22966e7a37ffSVictor Toso#         "timestamp": {"seconds": 1432123172, "microseconds": 744001},
22970f0d83a4SDaniel P. Berrangé#         "data": {"status": "concluded", "id": "snapsave0"}}
22980f0d83a4SDaniel P. Berrangé#     -> {"execute": "query-jobs"}
22990f0d83a4SDaniel P. Berrangé#     <- {"return": [{"current-progress": 1,
23000f0d83a4SDaniel P. Berrangé#                     "status": "concluded",
23010f0d83a4SDaniel P. Berrangé#                     "total-progress": 1,
23020f0d83a4SDaniel P. Berrangé#                     "type": "snapshot-save",
23030f0d83a4SDaniel P. Berrangé#                     "id": "snapsave0"}]}
23040f0d83a4SDaniel P. Berrangé#
23050f0d83a4SDaniel P. Berrangé# Since: 6.0
23060f0d83a4SDaniel P. Berrangé##
23070f0d83a4SDaniel P. Berrangé{ 'command': 'snapshot-save',
23080f0d83a4SDaniel P. Berrangé  'data': { 'job-id': 'str',
23090f0d83a4SDaniel P. Berrangé            'tag': 'str',
23100f0d83a4SDaniel P. Berrangé            'vmstate': 'str',
23110f0d83a4SDaniel P. Berrangé            'devices': ['str'] } }
23120f0d83a4SDaniel P. Berrangé
23130f0d83a4SDaniel P. Berrangé##
23140f0d83a4SDaniel P. Berrangé# @snapshot-load:
23150f0d83a4SDaniel P. Berrangé#
23160f0d83a4SDaniel P. Berrangé# Load a VM snapshot
23170f0d83a4SDaniel P. Berrangé#
23180f0d83a4SDaniel P. Berrangé# @job-id: identifier for the newly created job
2319a937b6aaSMarkus Armbruster#
23200f0d83a4SDaniel P. Berrangé# @tag: name of the snapshot to load.
2321a937b6aaSMarkus Armbruster#
23220f0d83a4SDaniel P. Berrangé# @vmstate: block device node name to load vmstate from
2323a937b6aaSMarkus Armbruster#
23240f0d83a4SDaniel P. Berrangé# @devices: list of block device node names to load a snapshot from
23250f0d83a4SDaniel P. Berrangé#
23260f0d83a4SDaniel P. Berrangé# Applications should not assume that the snapshot load is complete
23270f0d83a4SDaniel P. Berrangé# when this command returns.  The job commands / events must be used
2328a937b6aaSMarkus Armbruster# to determine completion and to fetch details of any errors that
2329a937b6aaSMarkus Armbruster# arise.
23300f0d83a4SDaniel P. Berrangé#
23310f0d83a4SDaniel P. Berrangé# Note that execution of the guest CPUs will be stopped during the
23320f0d83a4SDaniel P. Berrangé# time it takes to load the snapshot.
23330f0d83a4SDaniel P. Berrangé#
2334a937b6aaSMarkus Armbruster# It is strongly recommended that @devices contain all writable block
2335a937b6aaSMarkus Armbruster# device nodes that can have changed since the original @snapshot-save
2336a937b6aaSMarkus Armbruster# command execution.
23370f0d83a4SDaniel P. Berrangé#
23380f0d83a4SDaniel P. Berrangé# Example:
23390f0d83a4SDaniel P. Berrangé#
23400f0d83a4SDaniel P. Berrangé#     -> { "execute": "snapshot-load",
2341b1ca5322SFabian Holler#          "arguments": {
23420f0d83a4SDaniel P. Berrangé#             "job-id": "snapload0",
23430f0d83a4SDaniel P. Berrangé#             "tag": "my-snap",
23440f0d83a4SDaniel P. Berrangé#             "vmstate": "disk0",
23450f0d83a4SDaniel P. Berrangé#             "devices": ["disk0", "disk1"]
23460f0d83a4SDaniel P. Berrangé#          }
23470f0d83a4SDaniel P. Berrangé#        }
23480f0d83a4SDaniel P. Berrangé#     <- { "return": { } }
23490f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
23506e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472124172, "microseconds": 744001},
23510f0d83a4SDaniel P. Berrangé#         "data": {"status": "created", "id": "snapload0"}}
23520f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
23536e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472125172, "microseconds": 744001},
23540f0d83a4SDaniel P. Berrangé#         "data": {"status": "running", "id": "snapload0"}}
23556e7a37ffSVictor Toso#     <- {"event": "STOP",
23566e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472125472, "microseconds": 744001} }
23576e7a37ffSVictor Toso#     <- {"event": "RESUME",
23586e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472125872, "microseconds": 744001} }
23590f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
23606e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472126172, "microseconds": 744001},
23610f0d83a4SDaniel P. Berrangé#         "data": {"status": "waiting", "id": "snapload0"}}
23620f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
23636e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472127172, "microseconds": 744001},
23640f0d83a4SDaniel P. Berrangé#         "data": {"status": "pending", "id": "snapload0"}}
23650f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
23666e7a37ffSVictor Toso#         "timestamp": {"seconds": 1472128172, "microseconds": 744001},
23670f0d83a4SDaniel P. Berrangé#         "data": {"status": "concluded", "id": "snapload0"}}
23680f0d83a4SDaniel P. Berrangé#     -> {"execute": "query-jobs"}
23690f0d83a4SDaniel P. Berrangé#     <- {"return": [{"current-progress": 1,
23700f0d83a4SDaniel P. Berrangé#                     "status": "concluded",
23710f0d83a4SDaniel P. Berrangé#                     "total-progress": 1,
23720f0d83a4SDaniel P. Berrangé#                     "type": "snapshot-load",
23730f0d83a4SDaniel P. Berrangé#                     "id": "snapload0"}]}
23740f0d83a4SDaniel P. Berrangé#
23750f0d83a4SDaniel P. Berrangé# Since: 6.0
23760f0d83a4SDaniel P. Berrangé##
23770f0d83a4SDaniel P. Berrangé{ 'command': 'snapshot-load',
23780f0d83a4SDaniel P. Berrangé  'data': { 'job-id': 'str',
23790f0d83a4SDaniel P. Berrangé            'tag': 'str',
23800f0d83a4SDaniel P. Berrangé            'vmstate': 'str',
23810f0d83a4SDaniel P. Berrangé            'devices': ['str'] } }
23820f0d83a4SDaniel P. Berrangé
23830f0d83a4SDaniel P. Berrangé##
23840f0d83a4SDaniel P. Berrangé# @snapshot-delete:
23850f0d83a4SDaniel P. Berrangé#
23860f0d83a4SDaniel P. Berrangé# Delete a VM snapshot
23870f0d83a4SDaniel P. Berrangé#
23880f0d83a4SDaniel P. Berrangé# @job-id: identifier for the newly created job
2389a937b6aaSMarkus Armbruster#
23900f0d83a4SDaniel P. Berrangé# @tag: name of the snapshot to delete.
2391a937b6aaSMarkus Armbruster#
23920f0d83a4SDaniel P. Berrangé# @devices: list of block device node names to delete a snapshot from
23930f0d83a4SDaniel P. Berrangé#
23940f0d83a4SDaniel P. Berrangé# Applications should not assume that the snapshot delete is complete
23950f0d83a4SDaniel P. Berrangé# when this command returns.  The job commands / events must be used
2396a937b6aaSMarkus Armbruster# to determine completion and to fetch details of any errors that
2397a937b6aaSMarkus Armbruster# arise.
23980f0d83a4SDaniel P. Berrangé#
23990f0d83a4SDaniel P. Berrangé# Example:
24000f0d83a4SDaniel P. Berrangé#
24010f0d83a4SDaniel P. Berrangé#     -> { "execute": "snapshot-delete",
2402b1ca5322SFabian Holler#          "arguments": {
24030f0d83a4SDaniel P. Berrangé#             "job-id": "snapdelete0",
24040f0d83a4SDaniel P. Berrangé#             "tag": "my-snap",
24050f0d83a4SDaniel P. Berrangé#             "devices": ["disk0", "disk1"]
24060f0d83a4SDaniel P. Berrangé#          }
24070f0d83a4SDaniel P. Berrangé#        }
24080f0d83a4SDaniel P. Berrangé#     <- { "return": { } }
24090f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
24106e7a37ffSVictor Toso#         "timestamp": {"seconds": 1442124172, "microseconds": 744001},
24110f0d83a4SDaniel P. Berrangé#         "data": {"status": "created", "id": "snapdelete0"}}
24120f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
24136e7a37ffSVictor Toso#         "timestamp": {"seconds": 1442125172, "microseconds": 744001},
24140f0d83a4SDaniel P. Berrangé#         "data": {"status": "running", "id": "snapdelete0"}}
24150f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
24166e7a37ffSVictor Toso#         "timestamp": {"seconds": 1442126172, "microseconds": 744001},
24170f0d83a4SDaniel P. Berrangé#         "data": {"status": "waiting", "id": "snapdelete0"}}
24180f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
24196e7a37ffSVictor Toso#         "timestamp": {"seconds": 1442127172, "microseconds": 744001},
24200f0d83a4SDaniel P. Berrangé#         "data": {"status": "pending", "id": "snapdelete0"}}
24210f0d83a4SDaniel P. Berrangé#     <- {"event": "JOB_STATUS_CHANGE",
24226e7a37ffSVictor Toso#         "timestamp": {"seconds": 1442128172, "microseconds": 744001},
24230f0d83a4SDaniel P. Berrangé#         "data": {"status": "concluded", "id": "snapdelete0"}}
24240f0d83a4SDaniel P. Berrangé#     -> {"execute": "query-jobs"}
24250f0d83a4SDaniel P. Berrangé#     <- {"return": [{"current-progress": 1,
24260f0d83a4SDaniel P. Berrangé#                     "status": "concluded",
24270f0d83a4SDaniel P. Berrangé#                     "total-progress": 1,
24280f0d83a4SDaniel P. Berrangé#                     "type": "snapshot-delete",
24290f0d83a4SDaniel P. Berrangé#                     "id": "snapdelete0"}]}
24300f0d83a4SDaniel P. Berrangé#
24310f0d83a4SDaniel P. Berrangé# Since: 6.0
24320f0d83a4SDaniel P. Berrangé##
24330f0d83a4SDaniel P. Berrangé{ 'command': 'snapshot-delete',
24340f0d83a4SDaniel P. Berrangé  'data': { 'job-id': 'str',
24350f0d83a4SDaniel P. Berrangé            'tag': 'str',
24360f0d83a4SDaniel P. Berrangé            'devices': ['str'] } }
2437