]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/migration.json
configure: Enable test and libs for zstd
[mirror_qemu.git] / qapi / migration.json
CommitLineData
48685a8e
MA
1# -*- Mode: Python -*-
2#
3
4##
5# = Migration
6##
7
8{ 'include': 'common.json' }
9aca82ba 9{ 'include': 'sockets.json' }
48685a8e
MA
10
11##
12# @MigrationStats:
13#
14# Detailed migration status.
15#
16# @transferred: amount of bytes already transferred to the target VM
17#
18# @remaining: amount of bytes remaining to be transferred to the target VM
19#
20# @total: total amount of bytes involved in the migration process
21#
22# @duplicate: number of duplicate (zero) pages (since 1.2)
23#
24# @skipped: number of skipped zero pages (since 1.5)
25#
26# @normal: number of normal pages (since 1.2)
27#
28# @normal-bytes: number of normal bytes sent (since 1.2)
29#
30# @dirty-pages-rate: number of pages dirtied by second by the
26ec4e53 31# guest (since 1.3)
48685a8e
MA
32#
33# @mbps: throughput in megabits/sec. (since 1.6)
34#
35# @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
36#
37# @postcopy-requests: The number of page requests received from the destination
26ec4e53 38# (since 2.7)
48685a8e
MA
39#
40# @page-size: The number of bytes per page for the various page-based
26ec4e53 41# statistics (since 2.10)
48685a8e 42#
a61c45bd
JQ
43# @multifd-bytes: The number of bytes sent through multifd (since 3.0)
44#
aecbfe9c 45# @pages-per-second: the number of memory pages transferred per second
26ec4e53 46# (Since 4.0)
aecbfe9c 47#
48685a8e
MA
48# Since: 0.14.0
49##
50{ 'struct': 'MigrationStats',
51 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
52 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
53 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
54 'mbps' : 'number', 'dirty-sync-count' : 'int',
a61c45bd 55 'postcopy-requests' : 'int', 'page-size' : 'int',
aecbfe9c 56 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64' } }
48685a8e
MA
57
58##
59# @XBZRLECacheStats:
60#
61# Detailed XBZRLE migration cache statistics
62#
63# @cache-size: XBZRLE cache size
64#
65# @bytes: amount of bytes already transferred to the target VM
66#
67# @pages: amount of pages transferred to the target VM
68#
69# @cache-miss: number of cache miss
70#
71# @cache-miss-rate: rate of cache miss (since 2.1)
72#
73# @overflow: number of overflows
74#
75# Since: 1.2
76##
77{ 'struct': 'XBZRLECacheStats',
78 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
79 'cache-miss': 'int', 'cache-miss-rate': 'number',
80 'overflow': 'int' } }
81
76e03000
XG
82##
83# @CompressionStats:
84#
85# Detailed migration compression statistics
86#
87# @pages: amount of pages compressed and transferred to the target VM
88#
89# @busy: count of times that no free thread was available to compress data
90#
91# @busy-rate: rate of thread busy
92#
93# @compressed-size: amount of bytes after compression
94#
95# @compression-rate: rate of compressed size
96#
97# Since: 3.1
98##
99{ 'struct': 'CompressionStats',
100 'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
dbb28bc8 101 'compressed-size': 'int', 'compression-rate': 'number' } }
76e03000 102
48685a8e
MA
103##
104# @MigrationStatus:
105#
106# An enumeration of migration status.
107#
108# @none: no migration has ever happened.
109#
110# @setup: migration process has been initiated.
111#
112# @cancelling: in the process of cancelling migration.
113#
114# @cancelled: cancelling migration is finished.
115#
116# @active: in the process of doing migration.
117#
118# @postcopy-active: like active, but now in postcopy mode. (since 2.5)
119#
51f63ec7 120# @postcopy-paused: during postcopy but paused. (since 3.0)
a688d2c1 121#
51f63ec7 122# @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
135b87b4 123#
48685a8e
MA
124# @completed: migration is finished.
125#
126# @failed: some error occurred during migration process.
127#
128# @colo: VM is in the process of fault tolerance, VM can not get into this
129# state unless colo capability is enabled for migration. (since 2.8)
130#
31e06077
DDAG
131# @pre-switchover: Paused before device serialisation. (since 2.11)
132#
133# @device: During device serialisation when pause-before-switchover is enabled
26ec4e53 134# (since 2.11)
31e06077 135#
c7e0acd5
JF
136# @wait-unplug: wait for device unplug request by guest OS to be completed.
137# (since 4.2)
138#
48685a8e
MA
139# Since: 2.3
140#
141##
142{ 'enum': 'MigrationStatus',
143 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
a688d2c1 144 'active', 'postcopy-active', 'postcopy-paused',
135b87b4 145 'postcopy-recover', 'completed', 'failed', 'colo',
c7e0acd5 146 'pre-switchover', 'device', 'wait-unplug' ] }
48685a8e
MA
147
148##
149# @MigrationInfo:
150#
151# Information about current migration process.
152#
153# @status: @MigrationStatus describing the current migration status.
154# If this field is not returned, no migration process
155# has been initiated
156#
157# @ram: @MigrationStats containing detailed migration
158# status, only returned if status is 'active' or
159# 'completed'(since 1.2)
160#
161# @disk: @MigrationStats containing detailed disk migration
162# status, only returned if status is 'active' and it is a block
163# migration
164#
165# @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
166# migration statistics, only returned if XBZRLE feature is on and
167# status is 'active' or 'completed' (since 1.2)
168#
169# @total-time: total amount of milliseconds since migration started.
26ec4e53
PM
170# If migration has ended, it returns the total migration
171# time. (since 1.2)
48685a8e
MA
172#
173# @downtime: only present when migration finishes correctly
26ec4e53
PM
174# total downtime in milliseconds for the guest.
175# (since 1.3)
48685a8e
MA
176#
177# @expected-downtime: only present while migration is active
26ec4e53
PM
178# expected downtime in milliseconds for the guest in last walk
179# of the dirty bitmap. (since 1.3)
48685a8e 180#
a660eed4
PM
181# @setup-time: amount of setup time in milliseconds *before* the
182# iterations begin but *after* the QMP command is issued. This is designed
26ec4e53
PM
183# to provide an accounting of any activities (such as RDMA pinning) which
184# may be expensive, but do not actually occur during the iterative
185# migration rounds themselves. (since 1.6)
48685a8e
MA
186#
187# @cpu-throttle-percentage: percentage of time guest cpus are being
26ec4e53
PM
188# throttled during auto-converge. This is only present when auto-converge
189# has started throttling guest cpus. (Since 2.7)
48685a8e
MA
190#
191# @error-desc: the human readable error description string, when
192# @status is 'failed'. Clients should not attempt to parse the
193# error strings. (Since 2.7)
65ace060
AP
194#
195# @postcopy-blocktime: total time when all vCPU were blocked during postcopy
26ec4e53
PM
196# live migration. This is only present when the postcopy-blocktime
197# migration capability is enabled. (Since 3.0)
65ace060 198#
5e50cae4 199# @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU. This is
26ec4e53
PM
200# only present when the postcopy-blocktime migration capability
201# is enabled. (Since 3.0)
65ace060 202#
76e03000 203# @compression: migration compression statistics, only returned if compression
26ec4e53 204# feature is on and status is 'active' or 'completed' (Since 3.1)
48685a8e 205#
9aca82ba
JQ
206# @socket-address: Only used for tcp, to know what the real port is (Since 4.0)
207#
48685a8e
MA
208# Since: 0.14.0
209##
210{ 'struct': 'MigrationInfo',
211 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
212 '*disk': 'MigrationStats',
213 '*xbzrle-cache': 'XBZRLECacheStats',
214 '*total-time': 'int',
215 '*expected-downtime': 'int',
216 '*downtime': 'int',
217 '*setup-time': 'int',
218 '*cpu-throttle-percentage': 'int',
65ace060
AP
219 '*error-desc': 'str',
220 '*postcopy-blocktime' : 'uint32',
76e03000 221 '*postcopy-vcpu-blocktime': ['uint32'],
9aca82ba
JQ
222 '*compression': 'CompressionStats',
223 '*socket-address': ['SocketAddress'] } }
48685a8e
MA
224
225##
226# @query-migrate:
227#
228# Returns information about current migration process. If migration
229# is active there will be another json-object with RAM migration
230# status and if block migration is active another one with block
231# migration status.
232#
233# Returns: @MigrationInfo
234#
235# Since: 0.14.0
236#
237# Example:
238#
239# 1. Before the first migration
240#
241# -> { "execute": "query-migrate" }
242# <- { "return": {} }
243#
244# 2. Migration is done and has succeeded
245#
246# -> { "execute": "query-migrate" }
247# <- { "return": {
248# "status": "completed",
be1d2c49 249# "total-time":12345,
250# "setup-time":12345,
251# "downtime":12345,
48685a8e
MA
252# "ram":{
253# "transferred":123,
254# "remaining":123,
255# "total":246,
48685a8e
MA
256# "duplicate":123,
257# "normal":123,
258# "normal-bytes":123456,
259# "dirty-sync-count":15
260# }
261# }
262# }
263#
264# 3. Migration is done and has failed
265#
266# -> { "execute": "query-migrate" }
267# <- { "return": { "status": "failed" } }
268#
269# 4. Migration is being performed and is not a block migration:
270#
271# -> { "execute": "query-migrate" }
272# <- {
273# "return":{
274# "status":"active",
be1d2c49 275# "total-time":12345,
276# "setup-time":12345,
277# "expected-downtime":12345,
48685a8e
MA
278# "ram":{
279# "transferred":123,
280# "remaining":123,
281# "total":246,
48685a8e
MA
282# "duplicate":123,
283# "normal":123,
284# "normal-bytes":123456,
285# "dirty-sync-count":15
286# }
287# }
288# }
289#
290# 5. Migration is being performed and is a block migration:
291#
292# -> { "execute": "query-migrate" }
293# <- {
294# "return":{
295# "status":"active",
be1d2c49 296# "total-time":12345,
297# "setup-time":12345,
298# "expected-downtime":12345,
48685a8e
MA
299# "ram":{
300# "total":1057024,
301# "remaining":1053304,
302# "transferred":3720,
48685a8e
MA
303# "duplicate":123,
304# "normal":123,
305# "normal-bytes":123456,
306# "dirty-sync-count":15
307# },
308# "disk":{
309# "total":20971520,
310# "remaining":20880384,
311# "transferred":91136
312# }
313# }
314# }
315#
316# 6. Migration is being performed and XBZRLE is active:
317#
318# -> { "execute": "query-migrate" }
319# <- {
320# "return":{
321# "status":"active",
be1d2c49 322# "total-time":12345,
323# "setup-time":12345,
324# "expected-downtime":12345,
48685a8e
MA
325# "ram":{
326# "total":1057024,
327# "remaining":1053304,
328# "transferred":3720,
48685a8e
MA
329# "duplicate":10,
330# "normal":3333,
331# "normal-bytes":3412992,
332# "dirty-sync-count":15
333# },
334# "xbzrle-cache":{
335# "cache-size":67108864,
336# "bytes":20971520,
337# "pages":2444343,
338# "cache-miss":2244,
339# "cache-miss-rate":0.123,
340# "overflow":34434
341# }
342# }
343# }
344#
345##
346{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
347
348##
349# @MigrationCapability:
350#
351# Migration capabilities enumeration
352#
353# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
354# This feature allows us to minimize migration traffic for certain work
355# loads, by sending compressed difference of the pages
356#
357# @rdma-pin-all: Controls whether or not the entire VM memory footprint is
26ec4e53
PM
358# mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
359# Disabled by default. (since 2.0)
48685a8e
MA
360#
361# @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
26ec4e53
PM
362# essentially saves 1MB of zeroes per block on the wire. Enabling requires
363# source and target VM to support this feature. To enable it is sufficient
364# to enable the capability on the source VM. The feature is disabled by
365# default. (since 1.6)
48685a8e
MA
366#
367# @compress: Use multiple compression threads to accelerate live migration.
26ec4e53
PM
368# This feature can help to reduce the migration traffic, by sending
369# compressed pages. Please note that if compress and xbzrle are both
370# on, compress only takes effect in the ram bulk stage, after that,
371# it will be disabled and only xbzrle takes effect, this can help to
372# minimize migration traffic. The feature is disabled by default.
373# (since 2.4 )
48685a8e
MA
374#
375# @events: generate events for each migration state change
376# (since 2.4 )
377#
378# @auto-converge: If enabled, QEMU will automatically throttle down the guest
26ec4e53 379# to speed up convergence of RAM migration. (since 1.6)
48685a8e
MA
380#
381# @postcopy-ram: Start executing on the migration target before all of RAM has
26ec4e53
PM
382# been migrated, pulling the remaining pages along as needed. The
383# capacity must have the same setting on both source and target
384# or migration will not even start. NOTE: If the migration fails during
385# postcopy the VM will fail. (since 2.6)
48685a8e
MA
386#
387# @x-colo: If enabled, migration will never end, and the state of the VM on the
26ec4e53
PM
388# primary side will be migrated continuously to the VM on secondary
389# side, this process is called COarse-Grain LOck Stepping (COLO) for
390# Non-stop Service. (since 2.8)
48685a8e
MA
391#
392# @release-ram: if enabled, qemu will free the migrated ram pages on the source
26ec4e53 393# during postcopy-ram migration. (since 2.9)
48685a8e
MA
394#
395# @block: If enabled, QEMU will also migrate the contents of all block
26ec4e53
PM
396# devices. Default is disabled. A possible alternative uses
397# mirror jobs to a builtin NBD server on the destination, which
398# offers more flexibility.
399# (Since 2.10)
48685a8e
MA
400#
401# @return-path: If enabled, migration will use the return path even
402# for precopy. (since 2.10)
403#
93fbd031 404# @pause-before-switchover: Pause outgoing migration before serialising device
26ec4e53 405# state and before disabling block IO (since 2.11)
93fbd031 406#
cbfd6c95 407# @multifd: Use more than one fd for migration (since 4.0)
30126bbf 408#
55efc8c2
VSO
409# @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
410# (since 2.12)
411#
f22f928e 412# @postcopy-blocktime: Calculate downtime for postcopy live migration
26ec4e53 413# (since 3.0)
f22f928e 414#
0f073f44 415# @late-block-activate: If enabled, the destination will not activate block
26ec4e53
PM
416# devices (and thus take locks) immediately at the end of migration.
417# (since 3.0)
0f073f44 418#
18269069
YK
419# @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
420#
b9d68df6
YK
421# @validate-uuid: Send the UUID of the source to allow the destination
422# to ensure it is the same. (since 4.2)
423#
48685a8e
MA
424# Since: 1.2
425##
426{ 'enum': 'MigrationCapability',
427 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
428 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
cbfd6c95 429 'block', 'return-path', 'pause-before-switchover', 'multifd',
18269069 430 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
b9d68df6 431 'x-ignore-shared', 'validate-uuid' ] }
48685a8e
MA
432
433##
434# @MigrationCapabilityStatus:
435#
436# Migration capability information
437#
438# @capability: capability enum
439#
440# @state: capability state bool
441#
442# Since: 1.2
443##
444{ 'struct': 'MigrationCapabilityStatus',
445 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
446
447##
448# @migrate-set-capabilities:
449#
450# Enable/Disable the following migration capabilities (like xbzrle)
451#
452# @capabilities: json array of capability modifications to make
453#
454# Since: 1.2
455#
456# Example:
457#
458# -> { "execute": "migrate-set-capabilities" , "arguments":
459# { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
460#
461##
462{ 'command': 'migrate-set-capabilities',
463 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
464
465##
466# @query-migrate-capabilities:
467#
468# Returns information about the current migration capabilities status
469#
470# Returns: @MigrationCapabilitiesStatus
471#
472# Since: 1.2
473#
474# Example:
475#
476# -> { "execute": "query-migrate-capabilities" }
477# <- { "return": [
478# {"state": false, "capability": "xbzrle"},
479# {"state": false, "capability": "rdma-pin-all"},
480# {"state": false, "capability": "auto-converge"},
481# {"state": false, "capability": "zero-blocks"},
482# {"state": false, "capability": "compress"},
483# {"state": true, "capability": "events"},
484# {"state": false, "capability": "postcopy-ram"},
485# {"state": false, "capability": "x-colo"}
486# ]}
487#
488##
489{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
490
96eef042
JQ
491##
492# @MultiFDCompression:
493#
494# An enumeration of multifd compression methods.
495#
496# @none: no compression.
7ec2c2b3 497# @zlib: use zlib compression method.
96eef042
JQ
498#
499# Since: 5.0
500#
501##
502{ 'enum': 'MultiFDCompression',
7ec2c2b3 503 'data': [ 'none', 'zlib' ] }
96eef042 504
48685a8e
MA
505##
506# @MigrationParameter:
507#
508# Migration parameters enumeration
509#
ee3d96ba 510# @announce-initial: Initial delay (in milliseconds) before sending the first
26ec4e53 511# announce (Since 4.0)
ee3d96ba
DDAG
512#
513# @announce-max: Maximum delay (in milliseconds) between packets in the
26ec4e53 514# announcement (Since 4.0)
ee3d96ba
DDAG
515#
516# @announce-rounds: Number of self-announce packets sent after migration
26ec4e53 517# (Since 4.0)
ee3d96ba
DDAG
518#
519# @announce-step: Increase in delay (in milliseconds) between subsequent
26ec4e53 520# packets in the announcement (Since 4.0)
ee3d96ba 521#
48685a8e 522# @compress-level: Set the compression level to be used in live migration,
26ec4e53
PM
523# the compression level is an integer between 0 and 9, where 0 means
524# no compression, 1 means the best compression speed, and 9 means best
525# compression ratio which will consume more CPU.
48685a8e
MA
526#
527# @compress-threads: Set compression thread count to be used in live migration,
26ec4e53 528# the compression thread count is an integer between 1 and 255.
48685a8e 529#
1d58872a
XG
530# @compress-wait-thread: Controls behavior when all compression threads are
531# currently busy. If true (default), wait for a free
532# compression thread to become available; otherwise,
533# send the page uncompressed. (Since 3.1)
534#
48685a8e 535# @decompress-threads: Set decompression thread count to be used in live
26ec4e53
PM
536# migration, the decompression thread count is an integer between 1
537# and 255. Usually, decompression is at least 4 times as fast as
538# compression, so set the decompress-threads to the number about 1/4
539# of compress-threads is adequate.
48685a8e
MA
540#
541# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
542# when migration auto-converge is activated. The
543# default value is 20. (Since 2.7)
544#
545# @cpu-throttle-increment: throttle percentage increase each time
546# auto-converge detects that migration is not making
547# progress. The default value is 10. (Since 2.7)
548#
549# @tls-creds: ID of the 'tls-creds' object that provides credentials for
550# establishing a TLS connection over the migration data channel.
551# On the outgoing side of the migration, the credentials must
552# be for a 'client' endpoint, while for the incoming side the
553# credentials must be for a 'server' endpoint. Setting this
554# will enable TLS for all migrations. The default is unset,
555# resulting in unsecured migration at the QEMU level. (Since 2.7)
556#
557# @tls-hostname: hostname of the target host for the migration. This is
558# required when using x509 based TLS credentials and the
559# migration URI does not already include a hostname. For
560# example if using fd: or exec: based migration, the
561# hostname must be provided so that the server's x509
562# certificate identity can be validated. (Since 2.7)
563#
d2f1d29b
DB
564# @tls-authz: ID of the 'authz' object subclass that provides access control
565# checking of the TLS x509 certificate distinguished name.
566# This object is only resolved at time of use, so can be deleted
567# and recreated on the fly while the migration server is active.
568# If missing, it will default to denying access (Since 4.0)
569#
48685a8e
MA
570# @max-bandwidth: to set maximum speed for migration. maximum speed in
571# bytes per second. (Since 2.8)
572#
573# @downtime-limit: set maximum tolerated downtime for migration. maximum
574# downtime in milliseconds (Since 2.8)
575#
576# @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
26ec4e53 577# periodic mode. (Since 2.8)
48685a8e
MA
578#
579# @block-incremental: Affects how much storage is migrated when the
26ec4e53
PM
580# block migration capability is enabled. When false, the entire
581# storage backing chain is migrated into a flattened image at
582# the destination; when true, only the active qcow2 layer is
583# migrated and the destination must already have access to the
584# same backing chain as was used on the source. (since 2.10)
48685a8e 585#
cbfd6c95
JQ
586# @multifd-channels: Number of channels used to migrate data in
587# parallel. This is the same number that the
588# number of sockets used for migration. The
589# default value is 2 (since 4.0)
4075fb1c 590#
73af8dd8
JQ
591# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
592# needs to be a multiple of the target page size
593# and a power of 2
594# (Since 2.11)
595#
7e555c6c 596# @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
26ec4e53
PM
597# Defaults to 0 (unlimited). In bytes per second.
598# (Since 3.0)
4cbc9c7f
LQ
599#
600# @max-cpu-throttle: maximum cpu throttle percentage.
601# Defaults to 99. (Since 3.1)
ee3d96ba 602#
96eef042
JQ
603# @multifd-compression: Which compression method to use.
604# Defaults to none. (Since 5.0)
605#
9004db48
JQ
606# @multifd-zlib-level: Set the compression level to be used in live
607# migration, the compression level is an integer between 0
608# and 9, where 0 means no compression, 1 means the best
609# compression speed, and 9 means best compression ratio which
610# will consume more CPU.
611# Defaults to 1. (Since 5.0)
612#
48685a8e
MA
613# Since: 2.4
614##
615{ 'enum': 'MigrationParameter',
ee3d96ba
DDAG
616 'data': ['announce-initial', 'announce-max',
617 'announce-rounds', 'announce-step',
618 'compress-level', 'compress-threads', 'decompress-threads',
1d58872a 619 'compress-wait-thread',
48685a8e 620 'cpu-throttle-initial', 'cpu-throttle-increment',
d2f1d29b 621 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
4075fb1c 622 'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
cbfd6c95 623 'multifd-channels',
4cbc9c7f 624 'xbzrle-cache-size', 'max-postcopy-bandwidth',
9004db48
JQ
625 'max-cpu-throttle', 'multifd-compression',
626 'multifd-zlib-level' ] }
48685a8e
MA
627
628##
629# @MigrateSetParameters:
630#
ee3d96ba 631# @announce-initial: Initial delay (in milliseconds) before sending the first
26ec4e53 632# announce (Since 4.0)
ee3d96ba
DDAG
633#
634# @announce-max: Maximum delay (in milliseconds) between packets in the
26ec4e53 635# announcement (Since 4.0)
ee3d96ba
DDAG
636#
637# @announce-rounds: Number of self-announce packets sent after migration
26ec4e53 638# (Since 4.0)
ee3d96ba
DDAG
639#
640# @announce-step: Increase in delay (in milliseconds) between subsequent
26ec4e53 641# packets in the announcement (Since 4.0)
ee3d96ba 642#
48685a8e
MA
643# @compress-level: compression level
644#
645# @compress-threads: compression thread count
646#
1d58872a
XG
647# @compress-wait-thread: Controls behavior when all compression threads are
648# currently busy. If true (default), wait for a free
649# compression thread to become available; otherwise,
650# send the page uncompressed. (Since 3.1)
651#
48685a8e
MA
652# @decompress-threads: decompression thread count
653#
654# @cpu-throttle-initial: Initial percentage of time guest cpus are
655# throttled when migration auto-converge is activated.
656# The default value is 20. (Since 2.7)
657#
658# @cpu-throttle-increment: throttle percentage increase each time
659# auto-converge detects that migration is not making
660# progress. The default value is 10. (Since 2.7)
661#
662# @tls-creds: ID of the 'tls-creds' object that provides credentials
663# for establishing a TLS connection over the migration data
664# channel. On the outgoing side of the migration, the credentials
665# must be for a 'client' endpoint, while for the incoming side the
666# credentials must be for a 'server' endpoint. Setting this
667# to a non-empty string enables TLS for all migrations.
668# An empty string means that QEMU will use plain text mode for
669# migration, rather than TLS (Since 2.9)
670# Previously (since 2.7), this was reported by omitting
671# tls-creds instead.
672#
673# @tls-hostname: hostname of the target host for the migration. This
674# is required when using x509 based TLS credentials and the
675# migration URI does not already include a hostname. For
676# example if using fd: or exec: based migration, the
677# hostname must be provided so that the server's x509
678# certificate identity can be validated. (Since 2.7)
679# An empty string means that QEMU will use the hostname
680# associated with the migration URI, if any. (Since 2.9)
681# Previously (since 2.7), this was reported by omitting
682# tls-hostname instead.
683#
684# @max-bandwidth: to set maximum speed for migration. maximum speed in
685# bytes per second. (Since 2.8)
686#
687# @downtime-limit: set maximum tolerated downtime for migration. maximum
688# downtime in milliseconds (Since 2.8)
689#
690# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
691#
692# @block-incremental: Affects how much storage is migrated when the
26ec4e53
PM
693# block migration capability is enabled. When false, the entire
694# storage backing chain is migrated into a flattened image at
695# the destination; when true, only the active qcow2 layer is
696# migrated and the destination must already have access to the
697# same backing chain as was used on the source. (since 2.10)
48685a8e 698#
cbfd6c95
JQ
699# @multifd-channels: Number of channels used to migrate data in
700# parallel. This is the same number that the
701# number of sockets used for migration. The
702# default value is 2 (since 4.0)
4075fb1c 703#
73af8dd8
JQ
704# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
705# needs to be a multiple of the target page size
706# and a power of 2
707# (Since 2.11)
7e555c6c
DDAG
708#
709# @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
26ec4e53
PM
710# Defaults to 0 (unlimited). In bytes per second.
711# (Since 3.0)
4cbc9c7f
LQ
712#
713# @max-cpu-throttle: maximum cpu throttle percentage.
714# The default value is 99. (Since 3.1)
715#
96eef042
JQ
716# @multifd-compression: Which compression method to use.
717# Defaults to none. (Since 5.0)
718#
9004db48
JQ
719# @multifd-zlib-level: Set the compression level to be used in live
720# migration, the compression level is an integer between 0
721# and 9, where 0 means no compression, 1 means the best
722# compression speed, and 9 means best compression ratio which
723# will consume more CPU.
724# Defaults to 1. (Since 5.0)
725#
48685a8e
MA
726# Since: 2.4
727##
728# TODO either fuse back into MigrationParameters, or make
729# MigrationParameters members mandatory
730{ 'struct': 'MigrateSetParameters',
ee3d96ba
DDAG
731 'data': { '*announce-initial': 'size',
732 '*announce-max': 'size',
733 '*announce-rounds': 'size',
734 '*announce-step': 'size',
735 '*compress-level': 'int',
48685a8e 736 '*compress-threads': 'int',
1d58872a 737 '*compress-wait-thread': 'bool',
48685a8e
MA
738 '*decompress-threads': 'int',
739 '*cpu-throttle-initial': 'int',
740 '*cpu-throttle-increment': 'int',
741 '*tls-creds': 'StrOrNull',
742 '*tls-hostname': 'StrOrNull',
d2f1d29b 743 '*tls-authz': 'StrOrNull',
48685a8e
MA
744 '*max-bandwidth': 'int',
745 '*downtime-limit': 'int',
746 '*x-checkpoint-delay': 'int',
4075fb1c 747 '*block-incremental': 'bool',
cbfd6c95 748 '*multifd-channels': 'int',
7e555c6c 749 '*xbzrle-cache-size': 'size',
4cbc9c7f 750 '*max-postcopy-bandwidth': 'size',
96eef042 751 '*max-cpu-throttle': 'int',
9004db48
JQ
752 '*multifd-compression': 'MultiFDCompression',
753 '*multifd-zlib-level': 'int' } }
48685a8e
MA
754
755##
756# @migrate-set-parameters:
757#
758# Set various migration parameters.
759#
760# Since: 2.4
761#
762# Example:
763#
764# -> { "execute": "migrate-set-parameters" ,
765# "arguments": { "compress-level": 1 } }
766#
767##
768{ 'command': 'migrate-set-parameters', 'boxed': true,
769 'data': 'MigrateSetParameters' }
770
771##
772# @MigrationParameters:
773#
774# The optional members aren't actually optional.
775#
ee3d96ba 776# @announce-initial: Initial delay (in milliseconds) before sending the
26ec4e53 777# first announce (Since 4.0)
ee3d96ba
DDAG
778#
779# @announce-max: Maximum delay (in milliseconds) between packets in the
26ec4e53 780# announcement (Since 4.0)
ee3d96ba
DDAG
781#
782# @announce-rounds: Number of self-announce packets sent after migration
26ec4e53 783# (Since 4.0)
ee3d96ba
DDAG
784#
785# @announce-step: Increase in delay (in milliseconds) between subsequent
26ec4e53 786# packets in the announcement (Since 4.0)
ee3d96ba 787#
48685a8e
MA
788# @compress-level: compression level
789#
790# @compress-threads: compression thread count
791#
1d58872a
XG
792# @compress-wait-thread: Controls behavior when all compression threads are
793# currently busy. If true (default), wait for a free
794# compression thread to become available; otherwise,
795# send the page uncompressed. (Since 3.1)
796#
48685a8e
MA
797# @decompress-threads: decompression thread count
798#
799# @cpu-throttle-initial: Initial percentage of time guest cpus are
800# throttled when migration auto-converge is activated.
801# (Since 2.7)
802#
803# @cpu-throttle-increment: throttle percentage increase each time
804# auto-converge detects that migration is not making
805# progress. (Since 2.7)
806#
807# @tls-creds: ID of the 'tls-creds' object that provides credentials
808# for establishing a TLS connection over the migration data
809# channel. On the outgoing side of the migration, the credentials
810# must be for a 'client' endpoint, while for the incoming side the
811# credentials must be for a 'server' endpoint.
812# An empty string means that QEMU will use plain text mode for
813# migration, rather than TLS (Since 2.7)
814# Note: 2.8 reports this by omitting tls-creds instead.
815#
816# @tls-hostname: hostname of the target host for the migration. This
817# is required when using x509 based TLS credentials and the
818# migration URI does not already include a hostname. For
819# example if using fd: or exec: based migration, the
820# hostname must be provided so that the server's x509
821# certificate identity can be validated. (Since 2.7)
822# An empty string means that QEMU will use the hostname
823# associated with the migration URI, if any. (Since 2.9)
824# Note: 2.8 reports this by omitting tls-hostname instead.
825#
d2f1d29b
DB
826# @tls-authz: ID of the 'authz' object subclass that provides access control
827# checking of the TLS x509 certificate distinguished name. (Since
828# 4.0)
829#
48685a8e
MA
830# @max-bandwidth: to set maximum speed for migration. maximum speed in
831# bytes per second. (Since 2.8)
832#
833# @downtime-limit: set maximum tolerated downtime for migration. maximum
834# downtime in milliseconds (Since 2.8)
835#
836# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
837#
838# @block-incremental: Affects how much storage is migrated when the
26ec4e53
PM
839# block migration capability is enabled. When false, the entire
840# storage backing chain is migrated into a flattened image at
841# the destination; when true, only the active qcow2 layer is
842# migrated and the destination must already have access to the
843# same backing chain as was used on the source. (since 2.10)
48685a8e 844#
cbfd6c95
JQ
845# @multifd-channels: Number of channels used to migrate data in
846# parallel. This is the same number that the
847# number of sockets used for migration.
848# The default value is 2 (since 4.0)
4075fb1c 849#
73af8dd8
JQ
850# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
851# needs to be a multiple of the target page size
852# and a power of 2
853# (Since 2.11)
7e555c6c
DDAG
854#
855# @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
26ec4e53
PM
856# Defaults to 0 (unlimited). In bytes per second.
857# (Since 3.0)
4cbc9c7f
LQ
858#
859# @max-cpu-throttle: maximum cpu throttle percentage.
860# Defaults to 99.
26ec4e53 861# (Since 3.1)
4cbc9c7f 862#
96eef042
JQ
863# @multifd-compression: Which compression method to use.
864# Defaults to none. (Since 5.0)
865#
9004db48
JQ
866# @multifd-zlib-level: Set the compression level to be used in live
867# migration, the compression level is an integer between 0
868# and 9, where 0 means no compression, 1 means the best
869# compression speed, and 9 means best compression ratio which
870# will consume more CPU.
871# Defaults to 1. (Since 5.0)
872#
48685a8e
MA
873# Since: 2.4
874##
875{ 'struct': 'MigrationParameters',
ee3d96ba
DDAG
876 'data': { '*announce-initial': 'size',
877 '*announce-max': 'size',
878 '*announce-rounds': 'size',
879 '*announce-step': 'size',
880 '*compress-level': 'uint8',
741d4086 881 '*compress-threads': 'uint8',
1d58872a 882 '*compress-wait-thread': 'bool',
741d4086
JQ
883 '*decompress-threads': 'uint8',
884 '*cpu-throttle-initial': 'uint8',
885 '*cpu-throttle-increment': 'uint8',
48685a8e
MA
886 '*tls-creds': 'str',
887 '*tls-hostname': 'str',
d2f1d29b 888 '*tls-authz': 'str',
741d4086
JQ
889 '*max-bandwidth': 'size',
890 '*downtime-limit': 'uint64',
891 '*x-checkpoint-delay': 'uint32',
4075fb1c 892 '*block-incremental': 'bool' ,
cbfd6c95 893 '*multifd-channels': 'uint8',
7e555c6c 894 '*xbzrle-cache-size': 'size',
dbb28bc8 895 '*max-postcopy-bandwidth': 'size',
96eef042 896 '*max-cpu-throttle': 'uint8',
9004db48
JQ
897 '*multifd-compression': 'MultiFDCompression',
898 '*multifd-zlib-level': 'uint8' } }
48685a8e
MA
899
900##
901# @query-migrate-parameters:
902#
903# Returns information about the current migration parameters
904#
905# Returns: @MigrationParameters
906#
907# Since: 2.4
908#
909# Example:
910#
911# -> { "execute": "query-migrate-parameters" }
912# <- { "return": {
913# "decompress-threads": 2,
914# "cpu-throttle-increment": 10,
915# "compress-threads": 8,
916# "compress-level": 1,
917# "cpu-throttle-initial": 20,
918# "max-bandwidth": 33554432,
919# "downtime-limit": 300
920# }
921# }
922#
923##
924{ 'command': 'query-migrate-parameters',
925 'returns': 'MigrationParameters' }
926
927##
928# @client_migrate_info:
929#
930# Set migration information for remote display. This makes the server
931# ask the client to automatically reconnect using the new parameters
932# once migration finished successfully. Only implemented for SPICE.
933#
934# @protocol: must be "spice"
935# @hostname: migration target hostname
936# @port: spice tcp port for plaintext channels
937# @tls-port: spice tcp port for tls-secured channels
938# @cert-subject: server certificate subject
939#
940# Since: 0.14.0
941#
942# Example:
943#
944# -> { "execute": "client_migrate_info",
945# "arguments": { "protocol": "spice",
946# "hostname": "virt42.lab.kraxel.org",
947# "port": 1234 } }
948# <- { "return": {} }
949#
950##
951{ 'command': 'client_migrate_info',
952 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
953 '*tls-port': 'int', '*cert-subject': 'str' } }
954
955##
956# @migrate-start-postcopy:
957#
958# Followup to a migration command to switch the migration to postcopy mode.
c2eb7f21
GK
959# The postcopy-ram capability must be set on both source and destination
960# before the original migration command.
48685a8e
MA
961#
962# Since: 2.5
963#
964# Example:
965#
966# -> { "execute": "migrate-start-postcopy" }
967# <- { "return": {} }
968#
969##
970{ 'command': 'migrate-start-postcopy' }
971
972##
973# @MIGRATION:
974#
975# Emitted when a migration event happens
976#
977# @status: @MigrationStatus describing the current migration status.
978#
979# Since: 2.4
980#
981# Example:
982#
983# <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
984# "event": "MIGRATION",
985# "data": {"status": "completed"} }
986#
987##
988{ 'event': 'MIGRATION',
989 'data': {'status': 'MigrationStatus'}}
990
991##
992# @MIGRATION_PASS:
993#
994# Emitted from the source side of a migration at the start of each pass
995# (when it syncs the dirty bitmap)
996#
997# @pass: An incrementing count (starting at 1 on the first pass)
998#
999# Since: 2.6
1000#
1001# Example:
1002#
1003# { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1004# "event": "MIGRATION_PASS", "data": {"pass": 2} }
1005#
1006##
1007{ 'event': 'MIGRATION_PASS',
1008 'data': { 'pass': 'int' } }
1009
1010##
1011# @COLOMessage:
1012#
1013# The message transmission between Primary side and Secondary side.
1014#
1015# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1016#
1017# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1018#
1019# @checkpoint-reply: SVM gets PVM's checkpoint request
1020#
1021# @vmstate-send: VM's state will be sent by PVM.
1022#
1023# @vmstate-size: The total size of VMstate.
1024#
1025# @vmstate-received: VM's state has been received by SVM.
1026#
1027# @vmstate-loaded: VM's state has been loaded by SVM.
1028#
1029# Since: 2.8
1030##
1031{ 'enum': 'COLOMessage',
1032 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1033 'vmstate-send', 'vmstate-size', 'vmstate-received',
1034 'vmstate-loaded' ] }
1035
1036##
1037# @COLOMode:
1038#
41b6b779 1039# The COLO current mode.
48685a8e 1040#
41b6b779 1041# @none: COLO is disabled.
48685a8e 1042#
41b6b779 1043# @primary: COLO node in primary side.
48685a8e 1044#
41b6b779 1045# @secondary: COLO node in slave side.
48685a8e
MA
1046#
1047# Since: 2.8
1048##
1049{ 'enum': 'COLOMode',
41b6b779 1050 'data': [ 'none', 'primary', 'secondary'] }
48685a8e
MA
1051
1052##
1053# @FailoverStatus:
1054#
1055# An enumeration of COLO failover status
1056#
1057# @none: no failover has ever happened
1058#
1059# @require: got failover requirement but not handled
1060#
1061# @active: in the process of doing failover
1062#
1063# @completed: finish the process of failover
1064#
1065# @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1066#
1067# Since: 2.8
1068##
1069{ 'enum': 'FailoverStatus',
1070 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1071
9ecff6d6
HZ
1072##
1073# @COLO_EXIT:
1074#
1075# Emitted when VM finishes COLO mode due to some errors happening or
1076# at the request of users.
1077#
1078# @mode: report COLO mode when COLO exited.
1079#
1080# @reason: describes the reason for the COLO exit.
1081#
1082# Since: 3.1
1083#
1084# Example:
1085#
1086# <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1087# "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1088#
1089##
1090{ 'event': 'COLO_EXIT',
1091 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1092
1093##
1094# @COLOExitReason:
1095#
3a43ac47 1096# The reason for a COLO exit.
9ecff6d6 1097#
3a43ac47 1098# @none: failover has never happened. This state does not occur
26ec4e53
PM
1099# in the COLO_EXIT event, and is only visible in the result of
1100# query-colo-status.
9ecff6d6 1101#
3a43ac47 1102# @request: COLO exit is due to an external request.
9ecff6d6 1103#
3a43ac47
ZC
1104# @error: COLO exit is due to an internal error.
1105#
1106# @processing: COLO is currently handling a failover (since 4.0).
9ecff6d6
HZ
1107#
1108# Since: 3.1
1109##
1110{ 'enum': 'COLOExitReason',
3a43ac47 1111 'data': [ 'none', 'request', 'error' , 'processing' ] }
9ecff6d6 1112
48685a8e
MA
1113##
1114# @x-colo-lost-heartbeat:
1115#
1116# Tell qemu that heartbeat is lost, request it to do takeover procedures.
1117# If this command is sent to the PVM, the Primary side will exit COLO mode.
1118# If sent to the Secondary, the Secondary side will run failover work,
1119# then takes over server operation to become the service VM.
1120#
1121# Since: 2.8
1122#
1123# Example:
1124#
1125# -> { "execute": "x-colo-lost-heartbeat" }
1126# <- { "return": {} }
1127#
1128##
1129{ 'command': 'x-colo-lost-heartbeat' }
1130
1131##
1132# @migrate_cancel:
1133#
1134# Cancel the current executing migration process.
1135#
1136# Returns: nothing on success
1137#
1138# Notes: This command succeeds even if there is no migration process running.
1139#
1140# Since: 0.14.0
1141#
1142# Example:
1143#
1144# -> { "execute": "migrate_cancel" }
1145# <- { "return": {} }
1146#
1147##
1148{ 'command': 'migrate_cancel' }
1149
89cfc02c
DDAG
1150##
1151# @migrate-continue:
1152#
1153# Continue migration when it's in a paused state.
1154#
1155# @state: The state the migration is currently expected to be in
1156#
1157# Returns: nothing on success
1158# Since: 2.11
1159# Example:
1160#
1161# -> { "execute": "migrate-continue" , "arguments":
1162# { "state": "pre-switchover" } }
1163# <- { "return": {} }
1164##
1165{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1166
48685a8e
MA
1167##
1168# @migrate_set_downtime:
1169#
1170# Set maximum tolerated downtime for migration.
1171#
1172# @value: maximum downtime in seconds
1173#
1174# Returns: nothing on success
1175#
1176# Notes: This command is deprecated in favor of 'migrate-set-parameters'
1177#
1178# Since: 0.14.0
1179#
1180# Example:
1181#
1182# -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1183# <- { "return": {} }
1184#
1185##
1186{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1187
1188##
1189# @migrate_set_speed:
1190#
1191# Set maximum speed for migration.
1192#
1193# @value: maximum speed in bytes per second.
1194#
1195# Returns: nothing on success
1196#
1197# Notes: This command is deprecated in favor of 'migrate-set-parameters'
1198#
1199# Since: 0.14.0
1200#
1201# Example:
1202#
1203# -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1204# <- { "return": {} }
1205#
1206##
1207{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1208
1209##
1210# @migrate-set-cache-size:
1211#
1212# Set cache size to be used by XBZRLE migration
1213#
1214# @value: cache size in bytes
1215#
1216# The size will be rounded down to the nearest power of 2.
1217# The cache size can be modified before and during ongoing migration
1218#
1219# Returns: nothing on success
1220#
73af8dd8
JQ
1221# Notes: This command is deprecated in favor of 'migrate-set-parameters'
1222#
48685a8e
MA
1223# Since: 1.2
1224#
1225# Example:
1226#
1227# -> { "execute": "migrate-set-cache-size",
1228# "arguments": { "value": 536870912 } }
1229# <- { "return": {} }
1230#
1231##
1232{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1233
1234##
1235# @query-migrate-cache-size:
1236#
1237# Query migration XBZRLE cache size
1238#
1239# Returns: XBZRLE cache size in bytes
1240#
73af8dd8
JQ
1241# Notes: This command is deprecated in favor of 'query-migrate-parameters'
1242#
48685a8e
MA
1243# Since: 1.2
1244#
1245# Example:
1246#
1247# -> { "execute": "query-migrate-cache-size" }
1248# <- { "return": 67108864 }
1249#
1250##
1251{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
1252
1253##
1254# @migrate:
1255#
1256# Migrates the current running guest to another Virtual Machine.
1257#
1258# @uri: the Uniform Resource Identifier of the destination VM
1259#
1260# @blk: do block migration (full disk copy)
1261#
1262# @inc: incremental disk copy migration
1263#
1264# @detach: this argument exists only for compatibility reasons and
1265# is ignored by QEMU
1266#
51f63ec7 1267# @resume: resume one paused migration, default "off". (since 3.0)
7a4da28b 1268#
48685a8e
MA
1269# Returns: nothing on success
1270#
1271# Since: 0.14.0
1272#
1273# Notes:
1274#
1275# 1. The 'query-migrate' command should be used to check migration's progress
1276# and final result (this information is provided by the 'status' member)
1277#
1278# 2. All boolean arguments default to false
1279#
1280# 3. The user Monitor's "detach" argument is invalid in QMP and should not
1281# be used
1282#
1283# Example:
1284#
1285# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1286# <- { "return": {} }
1287#
1288##
1289{ 'command': 'migrate',
7a4da28b
PX
1290 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1291 '*detach': 'bool', '*resume': 'bool' } }
48685a8e
MA
1292
1293##
1294# @migrate-incoming:
1295#
1296# Start an incoming migration, the qemu must have been started
1297# with -incoming defer
1298#
1299# @uri: The Uniform Resource Identifier identifying the source or
1300# address to listen on
1301#
1302# Returns: nothing on success
1303#
1304# Since: 2.3
1305#
1306# Notes:
1307#
1308# 1. It's a bad idea to use a string for the uri, but it needs to stay
1309# compatible with -incoming and the format of the uri is already exposed
1310# above libvirt.
1311#
1312# 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1313# be used.
1314#
1315# 3. The uri format is the same as for -incoming
1316#
1317# Example:
1318#
1319# -> { "execute": "migrate-incoming",
1320# "arguments": { "uri": "tcp::4446" } }
1321# <- { "return": {} }
1322#
1323##
1324{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1325
1326##
1327# @xen-save-devices-state:
1328#
1329# Save the state of all devices to file. The RAM and the block devices
1330# of the VM are not saved by this command.
1331#
1332# @filename: the file to save the state of the devices to as binary
26ec4e53
PM
1333# data. See xen-save-devices-state.txt for a description of the binary
1334# format.
48685a8e 1335#
5d6c599f 1336# @live: Optional argument to ask QEMU to treat this command as part of a live
26ec4e53 1337# migration. Default to true. (since 2.11)
5d6c599f 1338#
48685a8e
MA
1339# Returns: Nothing on success
1340#
1341# Since: 1.1
1342#
1343# Example:
1344#
1345# -> { "execute": "xen-save-devices-state",
1346# "arguments": { "filename": "/tmp/save" } }
1347# <- { "return": {} }
1348#
1349##
5d6c599f
AP
1350{ 'command': 'xen-save-devices-state',
1351 'data': {'filename': 'str', '*live':'bool' } }
48685a8e
MA
1352
1353##
1354# @xen-set-replication:
1355#
1356# Enable or disable replication.
1357#
1358# @enable: true to enable, false to disable.
1359#
1360# @primary: true for primary or false for secondary.
1361#
1362# @failover: true to do failover, false to stop. but cannot be
1363# specified if 'enable' is true. default value is false.
1364#
1365# Returns: nothing.
1366#
1367# Example:
1368#
1369# -> { "execute": "xen-set-replication",
1370# "arguments": {"enable": true, "primary": false} }
1371# <- { "return": {} }
1372#
1373# Since: 2.9
1374##
1375{ 'command': 'xen-set-replication',
335d10cd
MAL
1376 'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1377 'if': 'defined(CONFIG_REPLICATION)' }
48685a8e
MA
1378
1379##
1380# @ReplicationStatus:
1381#
1382# The result format for 'query-xen-replication-status'.
1383#
1384# @error: true if an error happened, false if replication is normal.
1385#
1386# @desc: the human readable error description string, when
1387# @error is 'true'.
1388#
1389# Since: 2.9
1390##
1391{ 'struct': 'ReplicationStatus',
335d10cd
MAL
1392 'data': { 'error': 'bool', '*desc': 'str' },
1393 'if': 'defined(CONFIG_REPLICATION)' }
48685a8e
MA
1394
1395##
1396# @query-xen-replication-status:
1397#
1398# Query replication status while the vm is running.
1399#
1400# Returns: A @ReplicationResult object showing the status.
1401#
1402# Example:
1403#
1404# -> { "execute": "query-xen-replication-status" }
1405# <- { "return": { "error": false } }
1406#
1407# Since: 2.9
1408##
1409{ 'command': 'query-xen-replication-status',
335d10cd
MAL
1410 'returns': 'ReplicationStatus',
1411 'if': 'defined(CONFIG_REPLICATION)' }
48685a8e
MA
1412
1413##
1414# @xen-colo-do-checkpoint:
1415#
1416# Xen uses this command to notify replication to trigger a checkpoint.
1417#
1418# Returns: nothing.
1419#
1420# Example:
1421#
1422# -> { "execute": "xen-colo-do-checkpoint" }
1423# <- { "return": {} }
1424#
1425# Since: 2.9
1426##
335d10cd
MAL
1427{ 'command': 'xen-colo-do-checkpoint',
1428 'if': 'defined(CONFIG_REPLICATION)' }
02affd41 1429
f56c0065
ZC
1430##
1431# @COLOStatus:
1432#
1433# The result format for 'query-colo-status'.
1434#
1435# @mode: COLO running mode. If COLO is running, this field will return
1436# 'primary' or 'secondary'.
1437#
5cc8f9eb 1438# @last-mode: COLO last running mode. If COLO is running, this field
5ed0deca 1439# will return same like mode field, after failover we can
966c0d49 1440# use this field to get last colo mode. (since 4.0)
5ed0deca 1441#
f56c0065
ZC
1442# @reason: describes the reason for the COLO exit.
1443#
ea3b23e5 1444# Since: 3.1
f56c0065
ZC
1445##
1446{ 'struct': 'COLOStatus',
5cc8f9eb 1447 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
5ed0deca 1448 'reason': 'COLOExitReason' } }
f56c0065
ZC
1449
1450##
1451# @query-colo-status:
1452#
1453# Query COLO status while the vm is running.
1454#
1455# Returns: A @COLOStatus object showing the status.
1456#
1457# Example:
1458#
1459# -> { "execute": "query-colo-status" }
b5922fc5 1460# <- { "return": { "mode": "primary", "reason": "request" } }
f56c0065 1461#
ea3b23e5 1462# Since: 3.1
f56c0065
ZC
1463##
1464{ 'command': 'query-colo-status',
1465 'returns': 'COLOStatus' }
1466
02affd41
PX
1467##
1468# @migrate-recover:
1469#
1470# Provide a recovery migration stream URI.
1471#
1472# @uri: the URI to be used for the recovery of migration stream.
1473#
1474# Returns: nothing.
1475#
1476# Example:
1477#
1478# -> { "execute": "migrate-recover",
1479# "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1480# <- { "return": {} }
1481#
51f63ec7 1482# Since: 3.0
02affd41 1483##
b0ddeba2
MAL
1484{ 'command': 'migrate-recover',
1485 'data': { 'uri': 'str' },
02affd41 1486 'allow-oob': true }
bfbf89c2
PX
1487
1488##
1489# @migrate-pause:
1490#
1491# Pause a migration. Currently it only supports postcopy.
1492#
1493# Returns: nothing.
1494#
1495# Example:
1496#
1497# -> { "execute": "migrate-pause" }
1498# <- { "return": {} }
1499#
51f63ec7 1500# Since: 3.0
bfbf89c2
PX
1501##
1502{ 'command': 'migrate-pause', 'allow-oob': true }
d328e6f3
JF
1503
1504##
1505# @UNPLUG_PRIMARY:
1506#
1507# Emitted from source side of a migration when migration state is
1508# WAIT_UNPLUG. Device was unplugged by guest operating system.
1509# Device resources in QEMU are kept on standby to be able to re-plug it in case
1510# of migration failure.
1511#
1512# @device-id: QEMU device id of the unplugged device
1513#
1514# Since: 4.2
1515#
1516# Example:
1517# {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1518#
1519##
1520{ 'event': 'UNPLUG_PRIMARY',
1521 'data': { 'device-id': 'str' } }