]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/migration.json
multifd: Add multifd-zlib-level parameter
[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.
497#
498# Since: 5.0
499#
500##
501{ 'enum': 'MultiFDCompression',
502 'data': [ 'none' ] }
503
48685a8e
MA
504##
505# @MigrationParameter:
506#
507# Migration parameters enumeration
508#
ee3d96ba 509# @announce-initial: Initial delay (in milliseconds) before sending the first
26ec4e53 510# announce (Since 4.0)
ee3d96ba
DDAG
511#
512# @announce-max: Maximum delay (in milliseconds) between packets in the
26ec4e53 513# announcement (Since 4.0)
ee3d96ba
DDAG
514#
515# @announce-rounds: Number of self-announce packets sent after migration
26ec4e53 516# (Since 4.0)
ee3d96ba
DDAG
517#
518# @announce-step: Increase in delay (in milliseconds) between subsequent
26ec4e53 519# packets in the announcement (Since 4.0)
ee3d96ba 520#
48685a8e 521# @compress-level: Set the compression level to be used in live migration,
26ec4e53
PM
522# the compression level is an integer between 0 and 9, where 0 means
523# no compression, 1 means the best compression speed, and 9 means best
524# compression ratio which will consume more CPU.
48685a8e
MA
525#
526# @compress-threads: Set compression thread count to be used in live migration,
26ec4e53 527# the compression thread count is an integer between 1 and 255.
48685a8e 528#
1d58872a
XG
529# @compress-wait-thread: Controls behavior when all compression threads are
530# currently busy. If true (default), wait for a free
531# compression thread to become available; otherwise,
532# send the page uncompressed. (Since 3.1)
533#
48685a8e 534# @decompress-threads: Set decompression thread count to be used in live
26ec4e53
PM
535# migration, the decompression thread count is an integer between 1
536# and 255. Usually, decompression is at least 4 times as fast as
537# compression, so set the decompress-threads to the number about 1/4
538# of compress-threads is adequate.
48685a8e
MA
539#
540# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
541# when migration auto-converge is activated. The
542# default value is 20. (Since 2.7)
543#
544# @cpu-throttle-increment: throttle percentage increase each time
545# auto-converge detects that migration is not making
546# progress. The default value is 10. (Since 2.7)
547#
548# @tls-creds: ID of the 'tls-creds' object that provides credentials for
549# establishing a TLS connection over the migration data channel.
550# On the outgoing side of the migration, the credentials must
551# be for a 'client' endpoint, while for the incoming side the
552# credentials must be for a 'server' endpoint. Setting this
553# will enable TLS for all migrations. The default is unset,
554# resulting in unsecured migration at the QEMU level. (Since 2.7)
555#
556# @tls-hostname: hostname of the target host for the migration. This is
557# required when using x509 based TLS credentials and the
558# migration URI does not already include a hostname. For
559# example if using fd: or exec: based migration, the
560# hostname must be provided so that the server's x509
561# certificate identity can be validated. (Since 2.7)
562#
d2f1d29b
DB
563# @tls-authz: ID of the 'authz' object subclass that provides access control
564# checking of the TLS x509 certificate distinguished name.
565# This object is only resolved at time of use, so can be deleted
566# and recreated on the fly while the migration server is active.
567# If missing, it will default to denying access (Since 4.0)
568#
48685a8e
MA
569# @max-bandwidth: to set maximum speed for migration. maximum speed in
570# bytes per second. (Since 2.8)
571#
572# @downtime-limit: set maximum tolerated downtime for migration. maximum
573# downtime in milliseconds (Since 2.8)
574#
575# @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
26ec4e53 576# periodic mode. (Since 2.8)
48685a8e
MA
577#
578# @block-incremental: Affects how much storage is migrated when the
26ec4e53
PM
579# block migration capability is enabled. When false, the entire
580# storage backing chain is migrated into a flattened image at
581# the destination; when true, only the active qcow2 layer is
582# migrated and the destination must already have access to the
583# same backing chain as was used on the source. (since 2.10)
48685a8e 584#
cbfd6c95
JQ
585# @multifd-channels: Number of channels used to migrate data in
586# parallel. This is the same number that the
587# number of sockets used for migration. The
588# default value is 2 (since 4.0)
4075fb1c 589#
73af8dd8
JQ
590# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
591# needs to be a multiple of the target page size
592# and a power of 2
593# (Since 2.11)
594#
7e555c6c 595# @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
26ec4e53
PM
596# Defaults to 0 (unlimited). In bytes per second.
597# (Since 3.0)
4cbc9c7f
LQ
598#
599# @max-cpu-throttle: maximum cpu throttle percentage.
600# Defaults to 99. (Since 3.1)
ee3d96ba 601#
96eef042
JQ
602# @multifd-compression: Which compression method to use.
603# Defaults to none. (Since 5.0)
604#
9004db48
JQ
605# @multifd-zlib-level: Set the compression level to be used in live
606# migration, the compression level is an integer between 0
607# and 9, where 0 means no compression, 1 means the best
608# compression speed, and 9 means best compression ratio which
609# will consume more CPU.
610# Defaults to 1. (Since 5.0)
611#
48685a8e
MA
612# Since: 2.4
613##
614{ 'enum': 'MigrationParameter',
ee3d96ba
DDAG
615 'data': ['announce-initial', 'announce-max',
616 'announce-rounds', 'announce-step',
617 'compress-level', 'compress-threads', 'decompress-threads',
1d58872a 618 'compress-wait-thread',
48685a8e 619 'cpu-throttle-initial', 'cpu-throttle-increment',
d2f1d29b 620 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
4075fb1c 621 'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
cbfd6c95 622 'multifd-channels',
4cbc9c7f 623 'xbzrle-cache-size', 'max-postcopy-bandwidth',
9004db48
JQ
624 'max-cpu-throttle', 'multifd-compression',
625 'multifd-zlib-level' ] }
48685a8e
MA
626
627##
628# @MigrateSetParameters:
629#
ee3d96ba 630# @announce-initial: Initial delay (in milliseconds) before sending the first
26ec4e53 631# announce (Since 4.0)
ee3d96ba
DDAG
632#
633# @announce-max: Maximum delay (in milliseconds) between packets in the
26ec4e53 634# announcement (Since 4.0)
ee3d96ba
DDAG
635#
636# @announce-rounds: Number of self-announce packets sent after migration
26ec4e53 637# (Since 4.0)
ee3d96ba
DDAG
638#
639# @announce-step: Increase in delay (in milliseconds) between subsequent
26ec4e53 640# packets in the announcement (Since 4.0)
ee3d96ba 641#
48685a8e
MA
642# @compress-level: compression level
643#
644# @compress-threads: compression thread count
645#
1d58872a
XG
646# @compress-wait-thread: Controls behavior when all compression threads are
647# currently busy. If true (default), wait for a free
648# compression thread to become available; otherwise,
649# send the page uncompressed. (Since 3.1)
650#
48685a8e
MA
651# @decompress-threads: decompression thread count
652#
653# @cpu-throttle-initial: Initial percentage of time guest cpus are
654# throttled when migration auto-converge is activated.
655# The default value is 20. (Since 2.7)
656#
657# @cpu-throttle-increment: throttle percentage increase each time
658# auto-converge detects that migration is not making
659# progress. The default value is 10. (Since 2.7)
660#
661# @tls-creds: ID of the 'tls-creds' object that provides credentials
662# for establishing a TLS connection over the migration data
663# channel. On the outgoing side of the migration, the credentials
664# must be for a 'client' endpoint, while for the incoming side the
665# credentials must be for a 'server' endpoint. Setting this
666# to a non-empty string enables TLS for all migrations.
667# An empty string means that QEMU will use plain text mode for
668# migration, rather than TLS (Since 2.9)
669# Previously (since 2.7), this was reported by omitting
670# tls-creds instead.
671#
672# @tls-hostname: hostname of the target host for the migration. This
673# is required when using x509 based TLS credentials and the
674# migration URI does not already include a hostname. For
675# example if using fd: or exec: based migration, the
676# hostname must be provided so that the server's x509
677# certificate identity can be validated. (Since 2.7)
678# An empty string means that QEMU will use the hostname
679# associated with the migration URI, if any. (Since 2.9)
680# Previously (since 2.7), this was reported by omitting
681# tls-hostname instead.
682#
683# @max-bandwidth: to set maximum speed for migration. maximum speed in
684# bytes per second. (Since 2.8)
685#
686# @downtime-limit: set maximum tolerated downtime for migration. maximum
687# downtime in milliseconds (Since 2.8)
688#
689# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
690#
691# @block-incremental: Affects how much storage is migrated when the
26ec4e53
PM
692# block migration capability is enabled. When false, the entire
693# storage backing chain is migrated into a flattened image at
694# the destination; when true, only the active qcow2 layer is
695# migrated and the destination must already have access to the
696# same backing chain as was used on the source. (since 2.10)
48685a8e 697#
cbfd6c95
JQ
698# @multifd-channels: Number of channels used to migrate data in
699# parallel. This is the same number that the
700# number of sockets used for migration. The
701# default value is 2 (since 4.0)
4075fb1c 702#
73af8dd8
JQ
703# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
704# needs to be a multiple of the target page size
705# and a power of 2
706# (Since 2.11)
7e555c6c
DDAG
707#
708# @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
26ec4e53
PM
709# Defaults to 0 (unlimited). In bytes per second.
710# (Since 3.0)
4cbc9c7f
LQ
711#
712# @max-cpu-throttle: maximum cpu throttle percentage.
713# The default value is 99. (Since 3.1)
714#
96eef042
JQ
715# @multifd-compression: Which compression method to use.
716# Defaults to none. (Since 5.0)
717#
9004db48
JQ
718# @multifd-zlib-level: Set the compression level to be used in live
719# migration, the compression level is an integer between 0
720# and 9, where 0 means no compression, 1 means the best
721# compression speed, and 9 means best compression ratio which
722# will consume more CPU.
723# Defaults to 1. (Since 5.0)
724#
48685a8e
MA
725# Since: 2.4
726##
727# TODO either fuse back into MigrationParameters, or make
728# MigrationParameters members mandatory
729{ 'struct': 'MigrateSetParameters',
ee3d96ba
DDAG
730 'data': { '*announce-initial': 'size',
731 '*announce-max': 'size',
732 '*announce-rounds': 'size',
733 '*announce-step': 'size',
734 '*compress-level': 'int',
48685a8e 735 '*compress-threads': 'int',
1d58872a 736 '*compress-wait-thread': 'bool',
48685a8e
MA
737 '*decompress-threads': 'int',
738 '*cpu-throttle-initial': 'int',
739 '*cpu-throttle-increment': 'int',
740 '*tls-creds': 'StrOrNull',
741 '*tls-hostname': 'StrOrNull',
d2f1d29b 742 '*tls-authz': 'StrOrNull',
48685a8e
MA
743 '*max-bandwidth': 'int',
744 '*downtime-limit': 'int',
745 '*x-checkpoint-delay': 'int',
4075fb1c 746 '*block-incremental': 'bool',
cbfd6c95 747 '*multifd-channels': 'int',
7e555c6c 748 '*xbzrle-cache-size': 'size',
4cbc9c7f 749 '*max-postcopy-bandwidth': 'size',
96eef042 750 '*max-cpu-throttle': 'int',
9004db48
JQ
751 '*multifd-compression': 'MultiFDCompression',
752 '*multifd-zlib-level': 'int' } }
48685a8e
MA
753
754##
755# @migrate-set-parameters:
756#
757# Set various migration parameters.
758#
759# Since: 2.4
760#
761# Example:
762#
763# -> { "execute": "migrate-set-parameters" ,
764# "arguments": { "compress-level": 1 } }
765#
766##
767{ 'command': 'migrate-set-parameters', 'boxed': true,
768 'data': 'MigrateSetParameters' }
769
770##
771# @MigrationParameters:
772#
773# The optional members aren't actually optional.
774#
ee3d96ba 775# @announce-initial: Initial delay (in milliseconds) before sending the
26ec4e53 776# first announce (Since 4.0)
ee3d96ba
DDAG
777#
778# @announce-max: Maximum delay (in milliseconds) between packets in the
26ec4e53 779# announcement (Since 4.0)
ee3d96ba
DDAG
780#
781# @announce-rounds: Number of self-announce packets sent after migration
26ec4e53 782# (Since 4.0)
ee3d96ba
DDAG
783#
784# @announce-step: Increase in delay (in milliseconds) between subsequent
26ec4e53 785# packets in the announcement (Since 4.0)
ee3d96ba 786#
48685a8e
MA
787# @compress-level: compression level
788#
789# @compress-threads: compression thread count
790#
1d58872a
XG
791# @compress-wait-thread: Controls behavior when all compression threads are
792# currently busy. If true (default), wait for a free
793# compression thread to become available; otherwise,
794# send the page uncompressed. (Since 3.1)
795#
48685a8e
MA
796# @decompress-threads: decompression thread count
797#
798# @cpu-throttle-initial: Initial percentage of time guest cpus are
799# throttled when migration auto-converge is activated.
800# (Since 2.7)
801#
802# @cpu-throttle-increment: throttle percentage increase each time
803# auto-converge detects that migration is not making
804# progress. (Since 2.7)
805#
806# @tls-creds: ID of the 'tls-creds' object that provides credentials
807# for establishing a TLS connection over the migration data
808# channel. On the outgoing side of the migration, the credentials
809# must be for a 'client' endpoint, while for the incoming side the
810# credentials must be for a 'server' endpoint.
811# An empty string means that QEMU will use plain text mode for
812# migration, rather than TLS (Since 2.7)
813# Note: 2.8 reports this by omitting tls-creds instead.
814#
815# @tls-hostname: hostname of the target host for the migration. This
816# is required when using x509 based TLS credentials and the
817# migration URI does not already include a hostname. For
818# example if using fd: or exec: based migration, the
819# hostname must be provided so that the server's x509
820# certificate identity can be validated. (Since 2.7)
821# An empty string means that QEMU will use the hostname
822# associated with the migration URI, if any. (Since 2.9)
823# Note: 2.8 reports this by omitting tls-hostname instead.
824#
d2f1d29b
DB
825# @tls-authz: ID of the 'authz' object subclass that provides access control
826# checking of the TLS x509 certificate distinguished name. (Since
827# 4.0)
828#
48685a8e
MA
829# @max-bandwidth: to set maximum speed for migration. maximum speed in
830# bytes per second. (Since 2.8)
831#
832# @downtime-limit: set maximum tolerated downtime for migration. maximum
833# downtime in milliseconds (Since 2.8)
834#
835# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
836#
837# @block-incremental: Affects how much storage is migrated when the
26ec4e53
PM
838# block migration capability is enabled. When false, the entire
839# storage backing chain is migrated into a flattened image at
840# the destination; when true, only the active qcow2 layer is
841# migrated and the destination must already have access to the
842# same backing chain as was used on the source. (since 2.10)
48685a8e 843#
cbfd6c95
JQ
844# @multifd-channels: Number of channels used to migrate data in
845# parallel. This is the same number that the
846# number of sockets used for migration.
847# The default value is 2 (since 4.0)
4075fb1c 848#
73af8dd8
JQ
849# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
850# needs to be a multiple of the target page size
851# and a power of 2
852# (Since 2.11)
7e555c6c
DDAG
853#
854# @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
26ec4e53
PM
855# Defaults to 0 (unlimited). In bytes per second.
856# (Since 3.0)
4cbc9c7f
LQ
857#
858# @max-cpu-throttle: maximum cpu throttle percentage.
859# Defaults to 99.
26ec4e53 860# (Since 3.1)
4cbc9c7f 861#
96eef042
JQ
862# @multifd-compression: Which compression method to use.
863# Defaults to none. (Since 5.0)
864#
9004db48
JQ
865# @multifd-zlib-level: Set the compression level to be used in live
866# migration, the compression level is an integer between 0
867# and 9, where 0 means no compression, 1 means the best
868# compression speed, and 9 means best compression ratio which
869# will consume more CPU.
870# Defaults to 1. (Since 5.0)
871#
48685a8e
MA
872# Since: 2.4
873##
874{ 'struct': 'MigrationParameters',
ee3d96ba
DDAG
875 'data': { '*announce-initial': 'size',
876 '*announce-max': 'size',
877 '*announce-rounds': 'size',
878 '*announce-step': 'size',
879 '*compress-level': 'uint8',
741d4086 880 '*compress-threads': 'uint8',
1d58872a 881 '*compress-wait-thread': 'bool',
741d4086
JQ
882 '*decompress-threads': 'uint8',
883 '*cpu-throttle-initial': 'uint8',
884 '*cpu-throttle-increment': 'uint8',
48685a8e
MA
885 '*tls-creds': 'str',
886 '*tls-hostname': 'str',
d2f1d29b 887 '*tls-authz': 'str',
741d4086
JQ
888 '*max-bandwidth': 'size',
889 '*downtime-limit': 'uint64',
890 '*x-checkpoint-delay': 'uint32',
4075fb1c 891 '*block-incremental': 'bool' ,
cbfd6c95 892 '*multifd-channels': 'uint8',
7e555c6c 893 '*xbzrle-cache-size': 'size',
dbb28bc8 894 '*max-postcopy-bandwidth': 'size',
96eef042 895 '*max-cpu-throttle': 'uint8',
9004db48
JQ
896 '*multifd-compression': 'MultiFDCompression',
897 '*multifd-zlib-level': 'uint8' } }
48685a8e
MA
898
899##
900# @query-migrate-parameters:
901#
902# Returns information about the current migration parameters
903#
904# Returns: @MigrationParameters
905#
906# Since: 2.4
907#
908# Example:
909#
910# -> { "execute": "query-migrate-parameters" }
911# <- { "return": {
912# "decompress-threads": 2,
913# "cpu-throttle-increment": 10,
914# "compress-threads": 8,
915# "compress-level": 1,
916# "cpu-throttle-initial": 20,
917# "max-bandwidth": 33554432,
918# "downtime-limit": 300
919# }
920# }
921#
922##
923{ 'command': 'query-migrate-parameters',
924 'returns': 'MigrationParameters' }
925
926##
927# @client_migrate_info:
928#
929# Set migration information for remote display. This makes the server
930# ask the client to automatically reconnect using the new parameters
931# once migration finished successfully. Only implemented for SPICE.
932#
933# @protocol: must be "spice"
934# @hostname: migration target hostname
935# @port: spice tcp port for plaintext channels
936# @tls-port: spice tcp port for tls-secured channels
937# @cert-subject: server certificate subject
938#
939# Since: 0.14.0
940#
941# Example:
942#
943# -> { "execute": "client_migrate_info",
944# "arguments": { "protocol": "spice",
945# "hostname": "virt42.lab.kraxel.org",
946# "port": 1234 } }
947# <- { "return": {} }
948#
949##
950{ 'command': 'client_migrate_info',
951 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
952 '*tls-port': 'int', '*cert-subject': 'str' } }
953
954##
955# @migrate-start-postcopy:
956#
957# Followup to a migration command to switch the migration to postcopy mode.
c2eb7f21
GK
958# The postcopy-ram capability must be set on both source and destination
959# before the original migration command.
48685a8e
MA
960#
961# Since: 2.5
962#
963# Example:
964#
965# -> { "execute": "migrate-start-postcopy" }
966# <- { "return": {} }
967#
968##
969{ 'command': 'migrate-start-postcopy' }
970
971##
972# @MIGRATION:
973#
974# Emitted when a migration event happens
975#
976# @status: @MigrationStatus describing the current migration status.
977#
978# Since: 2.4
979#
980# Example:
981#
982# <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
983# "event": "MIGRATION",
984# "data": {"status": "completed"} }
985#
986##
987{ 'event': 'MIGRATION',
988 'data': {'status': 'MigrationStatus'}}
989
990##
991# @MIGRATION_PASS:
992#
993# Emitted from the source side of a migration at the start of each pass
994# (when it syncs the dirty bitmap)
995#
996# @pass: An incrementing count (starting at 1 on the first pass)
997#
998# Since: 2.6
999#
1000# Example:
1001#
1002# { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1003# "event": "MIGRATION_PASS", "data": {"pass": 2} }
1004#
1005##
1006{ 'event': 'MIGRATION_PASS',
1007 'data': { 'pass': 'int' } }
1008
1009##
1010# @COLOMessage:
1011#
1012# The message transmission between Primary side and Secondary side.
1013#
1014# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1015#
1016# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1017#
1018# @checkpoint-reply: SVM gets PVM's checkpoint request
1019#
1020# @vmstate-send: VM's state will be sent by PVM.
1021#
1022# @vmstate-size: The total size of VMstate.
1023#
1024# @vmstate-received: VM's state has been received by SVM.
1025#
1026# @vmstate-loaded: VM's state has been loaded by SVM.
1027#
1028# Since: 2.8
1029##
1030{ 'enum': 'COLOMessage',
1031 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1032 'vmstate-send', 'vmstate-size', 'vmstate-received',
1033 'vmstate-loaded' ] }
1034
1035##
1036# @COLOMode:
1037#
41b6b779 1038# The COLO current mode.
48685a8e 1039#
41b6b779 1040# @none: COLO is disabled.
48685a8e 1041#
41b6b779 1042# @primary: COLO node in primary side.
48685a8e 1043#
41b6b779 1044# @secondary: COLO node in slave side.
48685a8e
MA
1045#
1046# Since: 2.8
1047##
1048{ 'enum': 'COLOMode',
41b6b779 1049 'data': [ 'none', 'primary', 'secondary'] }
48685a8e
MA
1050
1051##
1052# @FailoverStatus:
1053#
1054# An enumeration of COLO failover status
1055#
1056# @none: no failover has ever happened
1057#
1058# @require: got failover requirement but not handled
1059#
1060# @active: in the process of doing failover
1061#
1062# @completed: finish the process of failover
1063#
1064# @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1065#
1066# Since: 2.8
1067##
1068{ 'enum': 'FailoverStatus',
1069 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1070
9ecff6d6
HZ
1071##
1072# @COLO_EXIT:
1073#
1074# Emitted when VM finishes COLO mode due to some errors happening or
1075# at the request of users.
1076#
1077# @mode: report COLO mode when COLO exited.
1078#
1079# @reason: describes the reason for the COLO exit.
1080#
1081# Since: 3.1
1082#
1083# Example:
1084#
1085# <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1086# "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1087#
1088##
1089{ 'event': 'COLO_EXIT',
1090 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1091
1092##
1093# @COLOExitReason:
1094#
3a43ac47 1095# The reason for a COLO exit.
9ecff6d6 1096#
3a43ac47 1097# @none: failover has never happened. This state does not occur
26ec4e53
PM
1098# in the COLO_EXIT event, and is only visible in the result of
1099# query-colo-status.
9ecff6d6 1100#
3a43ac47 1101# @request: COLO exit is due to an external request.
9ecff6d6 1102#
3a43ac47
ZC
1103# @error: COLO exit is due to an internal error.
1104#
1105# @processing: COLO is currently handling a failover (since 4.0).
9ecff6d6
HZ
1106#
1107# Since: 3.1
1108##
1109{ 'enum': 'COLOExitReason',
3a43ac47 1110 'data': [ 'none', 'request', 'error' , 'processing' ] }
9ecff6d6 1111
48685a8e
MA
1112##
1113# @x-colo-lost-heartbeat:
1114#
1115# Tell qemu that heartbeat is lost, request it to do takeover procedures.
1116# If this command is sent to the PVM, the Primary side will exit COLO mode.
1117# If sent to the Secondary, the Secondary side will run failover work,
1118# then takes over server operation to become the service VM.
1119#
1120# Since: 2.8
1121#
1122# Example:
1123#
1124# -> { "execute": "x-colo-lost-heartbeat" }
1125# <- { "return": {} }
1126#
1127##
1128{ 'command': 'x-colo-lost-heartbeat' }
1129
1130##
1131# @migrate_cancel:
1132#
1133# Cancel the current executing migration process.
1134#
1135# Returns: nothing on success
1136#
1137# Notes: This command succeeds even if there is no migration process running.
1138#
1139# Since: 0.14.0
1140#
1141# Example:
1142#
1143# -> { "execute": "migrate_cancel" }
1144# <- { "return": {} }
1145#
1146##
1147{ 'command': 'migrate_cancel' }
1148
89cfc02c
DDAG
1149##
1150# @migrate-continue:
1151#
1152# Continue migration when it's in a paused state.
1153#
1154# @state: The state the migration is currently expected to be in
1155#
1156# Returns: nothing on success
1157# Since: 2.11
1158# Example:
1159#
1160# -> { "execute": "migrate-continue" , "arguments":
1161# { "state": "pre-switchover" } }
1162# <- { "return": {} }
1163##
1164{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1165
48685a8e
MA
1166##
1167# @migrate_set_downtime:
1168#
1169# Set maximum tolerated downtime for migration.
1170#
1171# @value: maximum downtime in seconds
1172#
1173# Returns: nothing on success
1174#
1175# Notes: This command is deprecated in favor of 'migrate-set-parameters'
1176#
1177# Since: 0.14.0
1178#
1179# Example:
1180#
1181# -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1182# <- { "return": {} }
1183#
1184##
1185{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1186
1187##
1188# @migrate_set_speed:
1189#
1190# Set maximum speed for migration.
1191#
1192# @value: maximum speed in bytes per second.
1193#
1194# Returns: nothing on success
1195#
1196# Notes: This command is deprecated in favor of 'migrate-set-parameters'
1197#
1198# Since: 0.14.0
1199#
1200# Example:
1201#
1202# -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1203# <- { "return": {} }
1204#
1205##
1206{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1207
1208##
1209# @migrate-set-cache-size:
1210#
1211# Set cache size to be used by XBZRLE migration
1212#
1213# @value: cache size in bytes
1214#
1215# The size will be rounded down to the nearest power of 2.
1216# The cache size can be modified before and during ongoing migration
1217#
1218# Returns: nothing on success
1219#
73af8dd8
JQ
1220# Notes: This command is deprecated in favor of 'migrate-set-parameters'
1221#
48685a8e
MA
1222# Since: 1.2
1223#
1224# Example:
1225#
1226# -> { "execute": "migrate-set-cache-size",
1227# "arguments": { "value": 536870912 } }
1228# <- { "return": {} }
1229#
1230##
1231{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1232
1233##
1234# @query-migrate-cache-size:
1235#
1236# Query migration XBZRLE cache size
1237#
1238# Returns: XBZRLE cache size in bytes
1239#
73af8dd8
JQ
1240# Notes: This command is deprecated in favor of 'query-migrate-parameters'
1241#
48685a8e
MA
1242# Since: 1.2
1243#
1244# Example:
1245#
1246# -> { "execute": "query-migrate-cache-size" }
1247# <- { "return": 67108864 }
1248#
1249##
1250{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
1251
1252##
1253# @migrate:
1254#
1255# Migrates the current running guest to another Virtual Machine.
1256#
1257# @uri: the Uniform Resource Identifier of the destination VM
1258#
1259# @blk: do block migration (full disk copy)
1260#
1261# @inc: incremental disk copy migration
1262#
1263# @detach: this argument exists only for compatibility reasons and
1264# is ignored by QEMU
1265#
51f63ec7 1266# @resume: resume one paused migration, default "off". (since 3.0)
7a4da28b 1267#
48685a8e
MA
1268# Returns: nothing on success
1269#
1270# Since: 0.14.0
1271#
1272# Notes:
1273#
1274# 1. The 'query-migrate' command should be used to check migration's progress
1275# and final result (this information is provided by the 'status' member)
1276#
1277# 2. All boolean arguments default to false
1278#
1279# 3. The user Monitor's "detach" argument is invalid in QMP and should not
1280# be used
1281#
1282# Example:
1283#
1284# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1285# <- { "return": {} }
1286#
1287##
1288{ 'command': 'migrate',
7a4da28b
PX
1289 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1290 '*detach': 'bool', '*resume': 'bool' } }
48685a8e
MA
1291
1292##
1293# @migrate-incoming:
1294#
1295# Start an incoming migration, the qemu must have been started
1296# with -incoming defer
1297#
1298# @uri: The Uniform Resource Identifier identifying the source or
1299# address to listen on
1300#
1301# Returns: nothing on success
1302#
1303# Since: 2.3
1304#
1305# Notes:
1306#
1307# 1. It's a bad idea to use a string for the uri, but it needs to stay
1308# compatible with -incoming and the format of the uri is already exposed
1309# above libvirt.
1310#
1311# 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1312# be used.
1313#
1314# 3. The uri format is the same as for -incoming
1315#
1316# Example:
1317#
1318# -> { "execute": "migrate-incoming",
1319# "arguments": { "uri": "tcp::4446" } }
1320# <- { "return": {} }
1321#
1322##
1323{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1324
1325##
1326# @xen-save-devices-state:
1327#
1328# Save the state of all devices to file. The RAM and the block devices
1329# of the VM are not saved by this command.
1330#
1331# @filename: the file to save the state of the devices to as binary
26ec4e53
PM
1332# data. See xen-save-devices-state.txt for a description of the binary
1333# format.
48685a8e 1334#
5d6c599f 1335# @live: Optional argument to ask QEMU to treat this command as part of a live
26ec4e53 1336# migration. Default to true. (since 2.11)
5d6c599f 1337#
48685a8e
MA
1338# Returns: Nothing on success
1339#
1340# Since: 1.1
1341#
1342# Example:
1343#
1344# -> { "execute": "xen-save-devices-state",
1345# "arguments": { "filename": "/tmp/save" } }
1346# <- { "return": {} }
1347#
1348##
5d6c599f
AP
1349{ 'command': 'xen-save-devices-state',
1350 'data': {'filename': 'str', '*live':'bool' } }
48685a8e
MA
1351
1352##
1353# @xen-set-replication:
1354#
1355# Enable or disable replication.
1356#
1357# @enable: true to enable, false to disable.
1358#
1359# @primary: true for primary or false for secondary.
1360#
1361# @failover: true to do failover, false to stop. but cannot be
1362# specified if 'enable' is true. default value is false.
1363#
1364# Returns: nothing.
1365#
1366# Example:
1367#
1368# -> { "execute": "xen-set-replication",
1369# "arguments": {"enable": true, "primary": false} }
1370# <- { "return": {} }
1371#
1372# Since: 2.9
1373##
1374{ 'command': 'xen-set-replication',
335d10cd
MAL
1375 'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1376 'if': 'defined(CONFIG_REPLICATION)' }
48685a8e
MA
1377
1378##
1379# @ReplicationStatus:
1380#
1381# The result format for 'query-xen-replication-status'.
1382#
1383# @error: true if an error happened, false if replication is normal.
1384#
1385# @desc: the human readable error description string, when
1386# @error is 'true'.
1387#
1388# Since: 2.9
1389##
1390{ 'struct': 'ReplicationStatus',
335d10cd
MAL
1391 'data': { 'error': 'bool', '*desc': 'str' },
1392 'if': 'defined(CONFIG_REPLICATION)' }
48685a8e
MA
1393
1394##
1395# @query-xen-replication-status:
1396#
1397# Query replication status while the vm is running.
1398#
1399# Returns: A @ReplicationResult object showing the status.
1400#
1401# Example:
1402#
1403# -> { "execute": "query-xen-replication-status" }
1404# <- { "return": { "error": false } }
1405#
1406# Since: 2.9
1407##
1408{ 'command': 'query-xen-replication-status',
335d10cd
MAL
1409 'returns': 'ReplicationStatus',
1410 'if': 'defined(CONFIG_REPLICATION)' }
48685a8e
MA
1411
1412##
1413# @xen-colo-do-checkpoint:
1414#
1415# Xen uses this command to notify replication to trigger a checkpoint.
1416#
1417# Returns: nothing.
1418#
1419# Example:
1420#
1421# -> { "execute": "xen-colo-do-checkpoint" }
1422# <- { "return": {} }
1423#
1424# Since: 2.9
1425##
335d10cd
MAL
1426{ 'command': 'xen-colo-do-checkpoint',
1427 'if': 'defined(CONFIG_REPLICATION)' }
02affd41 1428
f56c0065
ZC
1429##
1430# @COLOStatus:
1431#
1432# The result format for 'query-colo-status'.
1433#
1434# @mode: COLO running mode. If COLO is running, this field will return
1435# 'primary' or 'secondary'.
1436#
5cc8f9eb 1437# @last-mode: COLO last running mode. If COLO is running, this field
5ed0deca 1438# will return same like mode field, after failover we can
966c0d49 1439# use this field to get last colo mode. (since 4.0)
5ed0deca 1440#
f56c0065
ZC
1441# @reason: describes the reason for the COLO exit.
1442#
ea3b23e5 1443# Since: 3.1
f56c0065
ZC
1444##
1445{ 'struct': 'COLOStatus',
5cc8f9eb 1446 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
5ed0deca 1447 'reason': 'COLOExitReason' } }
f56c0065
ZC
1448
1449##
1450# @query-colo-status:
1451#
1452# Query COLO status while the vm is running.
1453#
1454# Returns: A @COLOStatus object showing the status.
1455#
1456# Example:
1457#
1458# -> { "execute": "query-colo-status" }
b5922fc5 1459# <- { "return": { "mode": "primary", "reason": "request" } }
f56c0065 1460#
ea3b23e5 1461# Since: 3.1
f56c0065
ZC
1462##
1463{ 'command': 'query-colo-status',
1464 'returns': 'COLOStatus' }
1465
02affd41
PX
1466##
1467# @migrate-recover:
1468#
1469# Provide a recovery migration stream URI.
1470#
1471# @uri: the URI to be used for the recovery of migration stream.
1472#
1473# Returns: nothing.
1474#
1475# Example:
1476#
1477# -> { "execute": "migrate-recover",
1478# "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1479# <- { "return": {} }
1480#
51f63ec7 1481# Since: 3.0
02affd41 1482##
b0ddeba2
MAL
1483{ 'command': 'migrate-recover',
1484 'data': { 'uri': 'str' },
02affd41 1485 'allow-oob': true }
bfbf89c2
PX
1486
1487##
1488# @migrate-pause:
1489#
1490# Pause a migration. Currently it only supports postcopy.
1491#
1492# Returns: nothing.
1493#
1494# Example:
1495#
1496# -> { "execute": "migrate-pause" }
1497# <- { "return": {} }
1498#
51f63ec7 1499# Since: 3.0
bfbf89c2
PX
1500##
1501{ 'command': 'migrate-pause', 'allow-oob': true }
d328e6f3
JF
1502
1503##
1504# @UNPLUG_PRIMARY:
1505#
1506# Emitted from source side of a migration when migration state is
1507# WAIT_UNPLUG. Device was unplugged by guest operating system.
1508# Device resources in QEMU are kept on standby to be able to re-plug it in case
1509# of migration failure.
1510#
1511# @device-id: QEMU device id of the unplugged device
1512#
1513# Since: 4.2
1514#
1515# Example:
1516# {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1517#
1518##
1519{ 'event': 'UNPLUG_PRIMARY',
1520 'data': { 'device-id': 'str' } }