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