]> git.proxmox.com Git - mirror_qemu.git/blob - qapi/migration.json
b8ca60ac43fd3013d07df7b96dbf3751d4e1105d
[mirror_qemu.git] / qapi / migration.json
1 # -*- Mode: Python -*-
2 #
3
4 ##
5 # = Migration
6 ##
7
8 { 'include': 'common.json' }
9
10 ##
11 # @MigrationStats:
12 #
13 # Detailed migration status.
14 #
15 # @transferred: amount of bytes already transferred to the target VM
16 #
17 # @remaining: amount of bytes remaining to be transferred to the target VM
18 #
19 # @total: total amount of bytes involved in the migration process
20 #
21 # @duplicate: number of duplicate (zero) pages (since 1.2)
22 #
23 # @skipped: number of skipped zero pages (since 1.5)
24 #
25 # @normal: number of normal pages (since 1.2)
26 #
27 # @normal-bytes: number of normal bytes sent (since 1.2)
28 #
29 # @dirty-pages-rate: number of pages dirtied by second by the
30 # guest (since 1.3)
31 #
32 # @mbps: throughput in megabits/sec. (since 1.6)
33 #
34 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
35 #
36 # @postcopy-requests: The number of page requests received from the destination
37 # (since 2.7)
38 #
39 # @page-size: The number of bytes per page for the various page-based
40 # statistics (since 2.10)
41 #
42 # Since: 0.14.0
43 ##
44 { 'struct': 'MigrationStats',
45 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
46 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
47 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
48 'mbps' : 'number', 'dirty-sync-count' : 'int',
49 'postcopy-requests' : 'int', 'page-size' : 'int' } }
50
51 ##
52 # @XBZRLECacheStats:
53 #
54 # Detailed XBZRLE migration cache statistics
55 #
56 # @cache-size: XBZRLE cache size
57 #
58 # @bytes: amount of bytes already transferred to the target VM
59 #
60 # @pages: amount of pages transferred to the target VM
61 #
62 # @cache-miss: number of cache miss
63 #
64 # @cache-miss-rate: rate of cache miss (since 2.1)
65 #
66 # @overflow: number of overflows
67 #
68 # Since: 1.2
69 ##
70 { 'struct': 'XBZRLECacheStats',
71 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
72 'cache-miss': 'int', 'cache-miss-rate': 'number',
73 'overflow': 'int' } }
74
75 ##
76 # @MigrationStatus:
77 #
78 # An enumeration of migration status.
79 #
80 # @none: no migration has ever happened.
81 #
82 # @setup: migration process has been initiated.
83 #
84 # @cancelling: in the process of cancelling migration.
85 #
86 # @cancelled: cancelling migration is finished.
87 #
88 # @active: in the process of doing migration.
89 #
90 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
91 #
92 # @postcopy-paused: during postcopy but paused. (since 2.13)
93 #
94 # @completed: migration is finished.
95 #
96 # @failed: some error occurred during migration process.
97 #
98 # @colo: VM is in the process of fault tolerance, VM can not get into this
99 # state unless colo capability is enabled for migration. (since 2.8)
100 #
101 # @pre-switchover: Paused before device serialisation. (since 2.11)
102 #
103 # @device: During device serialisation when pause-before-switchover is enabled
104 # (since 2.11)
105 #
106 # Since: 2.3
107 #
108 ##
109 { 'enum': 'MigrationStatus',
110 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
111 'active', 'postcopy-active', 'postcopy-paused',
112 'completed', 'failed', 'colo',
113 'pre-switchover', 'device' ] }
114
115 ##
116 # @MigrationInfo:
117 #
118 # Information about current migration process.
119 #
120 # @status: @MigrationStatus describing the current migration status.
121 # If this field is not returned, no migration process
122 # has been initiated
123 #
124 # @ram: @MigrationStats containing detailed migration
125 # status, only returned if status is 'active' or
126 # 'completed'(since 1.2)
127 #
128 # @disk: @MigrationStats containing detailed disk migration
129 # status, only returned if status is 'active' and it is a block
130 # migration
131 #
132 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
133 # migration statistics, only returned if XBZRLE feature is on and
134 # status is 'active' or 'completed' (since 1.2)
135 #
136 # @total-time: total amount of milliseconds since migration started.
137 # If migration has ended, it returns the total migration
138 # time. (since 1.2)
139 #
140 # @downtime: only present when migration finishes correctly
141 # total downtime in milliseconds for the guest.
142 # (since 1.3)
143 #
144 # @expected-downtime: only present while migration is active
145 # expected downtime in milliseconds for the guest in last walk
146 # of the dirty bitmap. (since 1.3)
147 #
148 # @setup-time: amount of setup time in milliseconds _before_ the
149 # iterations begin but _after_ the QMP command is issued. This is designed
150 # to provide an accounting of any activities (such as RDMA pinning) which
151 # may be expensive, but do not actually occur during the iterative
152 # migration rounds themselves. (since 1.6)
153 #
154 # @cpu-throttle-percentage: percentage of time guest cpus are being
155 # throttled during auto-converge. This is only present when auto-converge
156 # has started throttling guest cpus. (Since 2.7)
157 #
158 # @error-desc: the human readable error description string, when
159 # @status is 'failed'. Clients should not attempt to parse the
160 # error strings. (Since 2.7)
161 #
162 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
163 # live migration (Since 2.13)
164 #
165 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU (Since 2.13)
166 #
167
168 #
169 # Since: 0.14.0
170 ##
171 { 'struct': 'MigrationInfo',
172 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
173 '*disk': 'MigrationStats',
174 '*xbzrle-cache': 'XBZRLECacheStats',
175 '*total-time': 'int',
176 '*expected-downtime': 'int',
177 '*downtime': 'int',
178 '*setup-time': 'int',
179 '*cpu-throttle-percentage': 'int',
180 '*error-desc': 'str',
181 '*postcopy-blocktime' : 'uint32',
182 '*postcopy-vcpu-blocktime': ['uint32']} }
183
184 ##
185 # @query-migrate:
186 #
187 # Returns information about current migration process. If migration
188 # is active there will be another json-object with RAM migration
189 # status and if block migration is active another one with block
190 # migration status.
191 #
192 # Returns: @MigrationInfo
193 #
194 # Since: 0.14.0
195 #
196 # Example:
197 #
198 # 1. Before the first migration
199 #
200 # -> { "execute": "query-migrate" }
201 # <- { "return": {} }
202 #
203 # 2. Migration is done and has succeeded
204 #
205 # -> { "execute": "query-migrate" }
206 # <- { "return": {
207 # "status": "completed",
208 # "ram":{
209 # "transferred":123,
210 # "remaining":123,
211 # "total":246,
212 # "total-time":12345,
213 # "setup-time":12345,
214 # "downtime":12345,
215 # "duplicate":123,
216 # "normal":123,
217 # "normal-bytes":123456,
218 # "dirty-sync-count":15
219 # }
220 # }
221 # }
222 #
223 # 3. Migration is done and has failed
224 #
225 # -> { "execute": "query-migrate" }
226 # <- { "return": { "status": "failed" } }
227 #
228 # 4. Migration is being performed and is not a block migration:
229 #
230 # -> { "execute": "query-migrate" }
231 # <- {
232 # "return":{
233 # "status":"active",
234 # "ram":{
235 # "transferred":123,
236 # "remaining":123,
237 # "total":246,
238 # "total-time":12345,
239 # "setup-time":12345,
240 # "expected-downtime":12345,
241 # "duplicate":123,
242 # "normal":123,
243 # "normal-bytes":123456,
244 # "dirty-sync-count":15
245 # }
246 # }
247 # }
248 #
249 # 5. Migration is being performed and is a block migration:
250 #
251 # -> { "execute": "query-migrate" }
252 # <- {
253 # "return":{
254 # "status":"active",
255 # "ram":{
256 # "total":1057024,
257 # "remaining":1053304,
258 # "transferred":3720,
259 # "total-time":12345,
260 # "setup-time":12345,
261 # "expected-downtime":12345,
262 # "duplicate":123,
263 # "normal":123,
264 # "normal-bytes":123456,
265 # "dirty-sync-count":15
266 # },
267 # "disk":{
268 # "total":20971520,
269 # "remaining":20880384,
270 # "transferred":91136
271 # }
272 # }
273 # }
274 #
275 # 6. Migration is being performed and XBZRLE is active:
276 #
277 # -> { "execute": "query-migrate" }
278 # <- {
279 # "return":{
280 # "status":"active",
281 # "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
282 # "ram":{
283 # "total":1057024,
284 # "remaining":1053304,
285 # "transferred":3720,
286 # "total-time":12345,
287 # "setup-time":12345,
288 # "expected-downtime":12345,
289 # "duplicate":10,
290 # "normal":3333,
291 # "normal-bytes":3412992,
292 # "dirty-sync-count":15
293 # },
294 # "xbzrle-cache":{
295 # "cache-size":67108864,
296 # "bytes":20971520,
297 # "pages":2444343,
298 # "cache-miss":2244,
299 # "cache-miss-rate":0.123,
300 # "overflow":34434
301 # }
302 # }
303 # }
304 #
305 ##
306 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
307
308 ##
309 # @MigrationCapability:
310 #
311 # Migration capabilities enumeration
312 #
313 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
314 # This feature allows us to minimize migration traffic for certain work
315 # loads, by sending compressed difference of the pages
316 #
317 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
318 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
319 # Disabled by default. (since 2.0)
320 #
321 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
322 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
323 # source and target VM to support this feature. To enable it is sufficient
324 # to enable the capability on the source VM. The feature is disabled by
325 # default. (since 1.6)
326 #
327 # @compress: Use multiple compression threads to accelerate live migration.
328 # This feature can help to reduce the migration traffic, by sending
329 # compressed pages. Please note that if compress and xbzrle are both
330 # on, compress only takes effect in the ram bulk stage, after that,
331 # it will be disabled and only xbzrle takes effect, this can help to
332 # minimize migration traffic. The feature is disabled by default.
333 # (since 2.4 )
334 #
335 # @events: generate events for each migration state change
336 # (since 2.4 )
337 #
338 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
339 # to speed up convergence of RAM migration. (since 1.6)
340 #
341 # @postcopy-ram: Start executing on the migration target before all of RAM has
342 # been migrated, pulling the remaining pages along as needed. The
343 # capacity must have the same setting on both source and target
344 # or migration will not even start. NOTE: If the migration fails during
345 # postcopy the VM will fail. (since 2.6)
346 #
347 # @x-colo: If enabled, migration will never end, and the state of the VM on the
348 # primary side will be migrated continuously to the VM on secondary
349 # side, this process is called COarse-Grain LOck Stepping (COLO) for
350 # Non-stop Service. (since 2.8)
351 #
352 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
353 # during postcopy-ram migration. (since 2.9)
354 #
355 # @block: If enabled, QEMU will also migrate the contents of all block
356 # devices. Default is disabled. A possible alternative uses
357 # mirror jobs to a builtin NBD server on the destination, which
358 # offers more flexibility.
359 # (Since 2.10)
360 #
361 # @return-path: If enabled, migration will use the return path even
362 # for precopy. (since 2.10)
363 #
364 # @pause-before-switchover: Pause outgoing migration before serialising device
365 # state and before disabling block IO (since 2.11)
366 #
367 # @x-multifd: Use more than one fd for migration (since 2.11)
368 #
369 #
370 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
371 # (since 2.12)
372 #
373 # @postcopy-blocktime: Calculate downtime for postcopy live migration
374 # (since 2.13)
375 #
376 # Since: 1.2
377 ##
378 { 'enum': 'MigrationCapability',
379 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
380 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
381 'block', 'return-path', 'pause-before-switchover', 'x-multifd',
382 'dirty-bitmaps', 'postcopy-blocktime' ] }
383
384 ##
385 # @MigrationCapabilityStatus:
386 #
387 # Migration capability information
388 #
389 # @capability: capability enum
390 #
391 # @state: capability state bool
392 #
393 # Since: 1.2
394 ##
395 { 'struct': 'MigrationCapabilityStatus',
396 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
397
398 ##
399 # @migrate-set-capabilities:
400 #
401 # Enable/Disable the following migration capabilities (like xbzrle)
402 #
403 # @capabilities: json array of capability modifications to make
404 #
405 # Since: 1.2
406 #
407 # Example:
408 #
409 # -> { "execute": "migrate-set-capabilities" , "arguments":
410 # { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
411 #
412 ##
413 { 'command': 'migrate-set-capabilities',
414 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
415
416 ##
417 # @query-migrate-capabilities:
418 #
419 # Returns information about the current migration capabilities status
420 #
421 # Returns: @MigrationCapabilitiesStatus
422 #
423 # Since: 1.2
424 #
425 # Example:
426 #
427 # -> { "execute": "query-migrate-capabilities" }
428 # <- { "return": [
429 # {"state": false, "capability": "xbzrle"},
430 # {"state": false, "capability": "rdma-pin-all"},
431 # {"state": false, "capability": "auto-converge"},
432 # {"state": false, "capability": "zero-blocks"},
433 # {"state": false, "capability": "compress"},
434 # {"state": true, "capability": "events"},
435 # {"state": false, "capability": "postcopy-ram"},
436 # {"state": false, "capability": "x-colo"}
437 # ]}
438 #
439 ##
440 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
441
442 ##
443 # @MigrationParameter:
444 #
445 # Migration parameters enumeration
446 #
447 # @compress-level: Set the compression level to be used in live migration,
448 # the compression level is an integer between 0 and 9, where 0 means
449 # no compression, 1 means the best compression speed, and 9 means best
450 # compression ratio which will consume more CPU.
451 #
452 # @compress-threads: Set compression thread count to be used in live migration,
453 # the compression thread count is an integer between 1 and 255.
454 #
455 # @decompress-threads: Set decompression thread count to be used in live
456 # migration, the decompression thread count is an integer between 1
457 # and 255. Usually, decompression is at least 4 times as fast as
458 # compression, so set the decompress-threads to the number about 1/4
459 # of compress-threads is adequate.
460 #
461 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
462 # when migration auto-converge is activated. The
463 # default value is 20. (Since 2.7)
464 #
465 # @cpu-throttle-increment: throttle percentage increase each time
466 # auto-converge detects that migration is not making
467 # progress. The default value is 10. (Since 2.7)
468 #
469 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
470 # establishing a TLS connection over the migration data channel.
471 # On the outgoing side of the migration, the credentials must
472 # be for a 'client' endpoint, while for the incoming side the
473 # credentials must be for a 'server' endpoint. Setting this
474 # will enable TLS for all migrations. The default is unset,
475 # resulting in unsecured migration at the QEMU level. (Since 2.7)
476 #
477 # @tls-hostname: hostname of the target host for the migration. This is
478 # required when using x509 based TLS credentials and the
479 # migration URI does not already include a hostname. For
480 # example if using fd: or exec: based migration, the
481 # hostname must be provided so that the server's x509
482 # certificate identity can be validated. (Since 2.7)
483 #
484 # @max-bandwidth: to set maximum speed for migration. maximum speed in
485 # bytes per second. (Since 2.8)
486 #
487 # @downtime-limit: set maximum tolerated downtime for migration. maximum
488 # downtime in milliseconds (Since 2.8)
489 #
490 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
491 # periodic mode. (Since 2.8)
492 #
493 # @block-incremental: Affects how much storage is migrated when the
494 # block migration capability is enabled. When false, the entire
495 # storage backing chain is migrated into a flattened image at
496 # the destination; when true, only the active qcow2 layer is
497 # migrated and the destination must already have access to the
498 # same backing chain as was used on the source. (since 2.10)
499 #
500 # @x-multifd-channels: Number of channels used to migrate data in
501 # parallel. This is the same number that the
502 # number of sockets used for migration. The
503 # default value is 2 (since 2.11)
504 #
505 # @x-multifd-page-count: Number of pages sent together to a thread.
506 # The default value is 16 (since 2.11)
507 #
508 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
509 # needs to be a multiple of the target page size
510 # and a power of 2
511 # (Since 2.11)
512 #
513 # Since: 2.4
514 ##
515 { 'enum': 'MigrationParameter',
516 'data': ['compress-level', 'compress-threads', 'decompress-threads',
517 'cpu-throttle-initial', 'cpu-throttle-increment',
518 'tls-creds', 'tls-hostname', 'max-bandwidth',
519 'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
520 'x-multifd-channels', 'x-multifd-page-count',
521 'xbzrle-cache-size' ] }
522
523 ##
524 # @MigrateSetParameters:
525 #
526 # @compress-level: compression level
527 #
528 # @compress-threads: compression thread count
529 #
530 # @decompress-threads: decompression thread count
531 #
532 # @cpu-throttle-initial: Initial percentage of time guest cpus are
533 # throttled when migration auto-converge is activated.
534 # The default value is 20. (Since 2.7)
535 #
536 # @cpu-throttle-increment: throttle percentage increase each time
537 # auto-converge detects that migration is not making
538 # progress. The default value is 10. (Since 2.7)
539 #
540 # @tls-creds: ID of the 'tls-creds' object that provides credentials
541 # for establishing a TLS connection over the migration data
542 # channel. On the outgoing side of the migration, the credentials
543 # must be for a 'client' endpoint, while for the incoming side the
544 # credentials must be for a 'server' endpoint. Setting this
545 # to a non-empty string enables TLS for all migrations.
546 # An empty string means that QEMU will use plain text mode for
547 # migration, rather than TLS (Since 2.9)
548 # Previously (since 2.7), this was reported by omitting
549 # tls-creds instead.
550 #
551 # @tls-hostname: hostname of the target host for the migration. This
552 # is required when using x509 based TLS credentials and the
553 # migration URI does not already include a hostname. For
554 # example if using fd: or exec: based migration, the
555 # hostname must be provided so that the server's x509
556 # certificate identity can be validated. (Since 2.7)
557 # An empty string means that QEMU will use the hostname
558 # associated with the migration URI, if any. (Since 2.9)
559 # Previously (since 2.7), this was reported by omitting
560 # tls-hostname instead.
561 #
562 # @max-bandwidth: to set maximum speed for migration. maximum speed in
563 # bytes per second. (Since 2.8)
564 #
565 # @downtime-limit: set maximum tolerated downtime for migration. maximum
566 # downtime in milliseconds (Since 2.8)
567 #
568 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
569 #
570 # @block-incremental: Affects how much storage is migrated when the
571 # block migration capability is enabled. When false, the entire
572 # storage backing chain is migrated into a flattened image at
573 # the destination; when true, only the active qcow2 layer is
574 # migrated and the destination must already have access to the
575 # same backing chain as was used on the source. (since 2.10)
576 #
577 # @x-multifd-channels: Number of channels used to migrate data in
578 # parallel. This is the same number that the
579 # number of sockets used for migration. The
580 # default value is 2 (since 2.11)
581 #
582 # @x-multifd-page-count: Number of pages sent together to a thread.
583 # The default value is 16 (since 2.11)
584 #
585 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
586 # needs to be a multiple of the target page size
587 # and a power of 2
588 # (Since 2.11)
589 # Since: 2.4
590 ##
591 # TODO either fuse back into MigrationParameters, or make
592 # MigrationParameters members mandatory
593 { 'struct': 'MigrateSetParameters',
594 'data': { '*compress-level': 'int',
595 '*compress-threads': 'int',
596 '*decompress-threads': 'int',
597 '*cpu-throttle-initial': 'int',
598 '*cpu-throttle-increment': 'int',
599 '*tls-creds': 'StrOrNull',
600 '*tls-hostname': 'StrOrNull',
601 '*max-bandwidth': 'int',
602 '*downtime-limit': 'int',
603 '*x-checkpoint-delay': 'int',
604 '*block-incremental': 'bool',
605 '*x-multifd-channels': 'int',
606 '*x-multifd-page-count': 'int',
607 '*xbzrle-cache-size': 'size' } }
608
609 ##
610 # @migrate-set-parameters:
611 #
612 # Set various migration parameters.
613 #
614 # Since: 2.4
615 #
616 # Example:
617 #
618 # -> { "execute": "migrate-set-parameters" ,
619 # "arguments": { "compress-level": 1 } }
620 #
621 ##
622 { 'command': 'migrate-set-parameters', 'boxed': true,
623 'data': 'MigrateSetParameters' }
624
625 ##
626 # @MigrationParameters:
627 #
628 # The optional members aren't actually optional.
629 #
630 # @compress-level: compression level
631 #
632 # @compress-threads: compression thread count
633 #
634 # @decompress-threads: decompression thread count
635 #
636 # @cpu-throttle-initial: Initial percentage of time guest cpus are
637 # throttled when migration auto-converge is activated.
638 # (Since 2.7)
639 #
640 # @cpu-throttle-increment: throttle percentage increase each time
641 # auto-converge detects that migration is not making
642 # progress. (Since 2.7)
643 #
644 # @tls-creds: ID of the 'tls-creds' object that provides credentials
645 # for establishing a TLS connection over the migration data
646 # channel. On the outgoing side of the migration, the credentials
647 # must be for a 'client' endpoint, while for the incoming side the
648 # credentials must be for a 'server' endpoint.
649 # An empty string means that QEMU will use plain text mode for
650 # migration, rather than TLS (Since 2.7)
651 # Note: 2.8 reports this by omitting tls-creds instead.
652 #
653 # @tls-hostname: hostname of the target host for the migration. This
654 # is required when using x509 based TLS credentials and the
655 # migration URI does not already include a hostname. For
656 # example if using fd: or exec: based migration, the
657 # hostname must be provided so that the server's x509
658 # certificate identity can be validated. (Since 2.7)
659 # An empty string means that QEMU will use the hostname
660 # associated with the migration URI, if any. (Since 2.9)
661 # Note: 2.8 reports this by omitting tls-hostname instead.
662 #
663 # @max-bandwidth: to set maximum speed for migration. maximum speed in
664 # bytes per second. (Since 2.8)
665 #
666 # @downtime-limit: set maximum tolerated downtime for migration. maximum
667 # downtime in milliseconds (Since 2.8)
668 #
669 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
670 #
671 # @block-incremental: Affects how much storage is migrated when the
672 # block migration capability is enabled. When false, the entire
673 # storage backing chain is migrated into a flattened image at
674 # the destination; when true, only the active qcow2 layer is
675 # migrated and the destination must already have access to the
676 # same backing chain as was used on the source. (since 2.10)
677 #
678 # @x-multifd-channels: Number of channels used to migrate data in
679 # parallel. This is the same number that the
680 # number of sockets used for migration.
681 # The default value is 2 (since 2.11)
682 #
683 # @x-multifd-page-count: Number of pages sent together to a thread.
684 # The default value is 16 (since 2.11)
685 #
686 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
687 # needs to be a multiple of the target page size
688 # and a power of 2
689 # (Since 2.11)
690 # Since: 2.4
691 ##
692 { 'struct': 'MigrationParameters',
693 'data': { '*compress-level': 'uint8',
694 '*compress-threads': 'uint8',
695 '*decompress-threads': 'uint8',
696 '*cpu-throttle-initial': 'uint8',
697 '*cpu-throttle-increment': 'uint8',
698 '*tls-creds': 'str',
699 '*tls-hostname': 'str',
700 '*max-bandwidth': 'size',
701 '*downtime-limit': 'uint64',
702 '*x-checkpoint-delay': 'uint32',
703 '*block-incremental': 'bool' ,
704 '*x-multifd-channels': 'uint8',
705 '*x-multifd-page-count': 'uint32',
706 '*xbzrle-cache-size': 'size' } }
707
708 ##
709 # @query-migrate-parameters:
710 #
711 # Returns information about the current migration parameters
712 #
713 # Returns: @MigrationParameters
714 #
715 # Since: 2.4
716 #
717 # Example:
718 #
719 # -> { "execute": "query-migrate-parameters" }
720 # <- { "return": {
721 # "decompress-threads": 2,
722 # "cpu-throttle-increment": 10,
723 # "compress-threads": 8,
724 # "compress-level": 1,
725 # "cpu-throttle-initial": 20,
726 # "max-bandwidth": 33554432,
727 # "downtime-limit": 300
728 # }
729 # }
730 #
731 ##
732 { 'command': 'query-migrate-parameters',
733 'returns': 'MigrationParameters' }
734
735 ##
736 # @client_migrate_info:
737 #
738 # Set migration information for remote display. This makes the server
739 # ask the client to automatically reconnect using the new parameters
740 # once migration finished successfully. Only implemented for SPICE.
741 #
742 # @protocol: must be "spice"
743 # @hostname: migration target hostname
744 # @port: spice tcp port for plaintext channels
745 # @tls-port: spice tcp port for tls-secured channels
746 # @cert-subject: server certificate subject
747 #
748 # Since: 0.14.0
749 #
750 # Example:
751 #
752 # -> { "execute": "client_migrate_info",
753 # "arguments": { "protocol": "spice",
754 # "hostname": "virt42.lab.kraxel.org",
755 # "port": 1234 } }
756 # <- { "return": {} }
757 #
758 ##
759 { 'command': 'client_migrate_info',
760 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
761 '*tls-port': 'int', '*cert-subject': 'str' } }
762
763 ##
764 # @migrate-start-postcopy:
765 #
766 # Followup to a migration command to switch the migration to postcopy mode.
767 # The postcopy-ram capability must be set on both source and destination
768 # before the original migration command.
769 #
770 # Since: 2.5
771 #
772 # Example:
773 #
774 # -> { "execute": "migrate-start-postcopy" }
775 # <- { "return": {} }
776 #
777 ##
778 { 'command': 'migrate-start-postcopy' }
779
780 ##
781 # @MIGRATION:
782 #
783 # Emitted when a migration event happens
784 #
785 # @status: @MigrationStatus describing the current migration status.
786 #
787 # Since: 2.4
788 #
789 # Example:
790 #
791 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
792 # "event": "MIGRATION",
793 # "data": {"status": "completed"} }
794 #
795 ##
796 { 'event': 'MIGRATION',
797 'data': {'status': 'MigrationStatus'}}
798
799 ##
800 # @MIGRATION_PASS:
801 #
802 # Emitted from the source side of a migration at the start of each pass
803 # (when it syncs the dirty bitmap)
804 #
805 # @pass: An incrementing count (starting at 1 on the first pass)
806 #
807 # Since: 2.6
808 #
809 # Example:
810 #
811 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
812 # "event": "MIGRATION_PASS", "data": {"pass": 2} }
813 #
814 ##
815 { 'event': 'MIGRATION_PASS',
816 'data': { 'pass': 'int' } }
817
818 ##
819 # @COLOMessage:
820 #
821 # The message transmission between Primary side and Secondary side.
822 #
823 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
824 #
825 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
826 #
827 # @checkpoint-reply: SVM gets PVM's checkpoint request
828 #
829 # @vmstate-send: VM's state will be sent by PVM.
830 #
831 # @vmstate-size: The total size of VMstate.
832 #
833 # @vmstate-received: VM's state has been received by SVM.
834 #
835 # @vmstate-loaded: VM's state has been loaded by SVM.
836 #
837 # Since: 2.8
838 ##
839 { 'enum': 'COLOMessage',
840 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
841 'vmstate-send', 'vmstate-size', 'vmstate-received',
842 'vmstate-loaded' ] }
843
844 ##
845 # @COLOMode:
846 #
847 # The colo mode
848 #
849 # @unknown: unknown mode
850 #
851 # @primary: master side
852 #
853 # @secondary: slave side
854 #
855 # Since: 2.8
856 ##
857 { 'enum': 'COLOMode',
858 'data': [ 'unknown', 'primary', 'secondary'] }
859
860 ##
861 # @FailoverStatus:
862 #
863 # An enumeration of COLO failover status
864 #
865 # @none: no failover has ever happened
866 #
867 # @require: got failover requirement but not handled
868 #
869 # @active: in the process of doing failover
870 #
871 # @completed: finish the process of failover
872 #
873 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
874 #
875 # Since: 2.8
876 ##
877 { 'enum': 'FailoverStatus',
878 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
879
880 ##
881 # @x-colo-lost-heartbeat:
882 #
883 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
884 # If this command is sent to the PVM, the Primary side will exit COLO mode.
885 # If sent to the Secondary, the Secondary side will run failover work,
886 # then takes over server operation to become the service VM.
887 #
888 # Since: 2.8
889 #
890 # Example:
891 #
892 # -> { "execute": "x-colo-lost-heartbeat" }
893 # <- { "return": {} }
894 #
895 ##
896 { 'command': 'x-colo-lost-heartbeat' }
897
898 ##
899 # @migrate_cancel:
900 #
901 # Cancel the current executing migration process.
902 #
903 # Returns: nothing on success
904 #
905 # Notes: This command succeeds even if there is no migration process running.
906 #
907 # Since: 0.14.0
908 #
909 # Example:
910 #
911 # -> { "execute": "migrate_cancel" }
912 # <- { "return": {} }
913 #
914 ##
915 { 'command': 'migrate_cancel' }
916
917 ##
918 # @migrate-continue:
919 #
920 # Continue migration when it's in a paused state.
921 #
922 # @state: The state the migration is currently expected to be in
923 #
924 # Returns: nothing on success
925 # Since: 2.11
926 # Example:
927 #
928 # -> { "execute": "migrate-continue" , "arguments":
929 # { "state": "pre-switchover" } }
930 # <- { "return": {} }
931 ##
932 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
933
934 ##
935 # @migrate_set_downtime:
936 #
937 # Set maximum tolerated downtime for migration.
938 #
939 # @value: maximum downtime in seconds
940 #
941 # Returns: nothing on success
942 #
943 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
944 #
945 # Since: 0.14.0
946 #
947 # Example:
948 #
949 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
950 # <- { "return": {} }
951 #
952 ##
953 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
954
955 ##
956 # @migrate_set_speed:
957 #
958 # Set maximum speed for migration.
959 #
960 # @value: maximum speed in bytes per second.
961 #
962 # Returns: nothing on success
963 #
964 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
965 #
966 # Since: 0.14.0
967 #
968 # Example:
969 #
970 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
971 # <- { "return": {} }
972 #
973 ##
974 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
975
976 ##
977 # @migrate-set-cache-size:
978 #
979 # Set cache size to be used by XBZRLE migration
980 #
981 # @value: cache size in bytes
982 #
983 # The size will be rounded down to the nearest power of 2.
984 # The cache size can be modified before and during ongoing migration
985 #
986 # Returns: nothing on success
987 #
988 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
989 #
990 # Since: 1.2
991 #
992 # Example:
993 #
994 # -> { "execute": "migrate-set-cache-size",
995 # "arguments": { "value": 536870912 } }
996 # <- { "return": {} }
997 #
998 ##
999 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1000
1001 ##
1002 # @query-migrate-cache-size:
1003 #
1004 # Query migration XBZRLE cache size
1005 #
1006 # Returns: XBZRLE cache size in bytes
1007 #
1008 # Notes: This command is deprecated in favor of 'query-migrate-parameters'
1009 #
1010 # Since: 1.2
1011 #
1012 # Example:
1013 #
1014 # -> { "execute": "query-migrate-cache-size" }
1015 # <- { "return": 67108864 }
1016 #
1017 ##
1018 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1019
1020 ##
1021 # @migrate:
1022 #
1023 # Migrates the current running guest to another Virtual Machine.
1024 #
1025 # @uri: the Uniform Resource Identifier of the destination VM
1026 #
1027 # @blk: do block migration (full disk copy)
1028 #
1029 # @inc: incremental disk copy migration
1030 #
1031 # @detach: this argument exists only for compatibility reasons and
1032 # is ignored by QEMU
1033 #
1034 # @resume: resume one paused migration, default "off". (since 2.13)
1035 #
1036 # Returns: nothing on success
1037 #
1038 # Since: 0.14.0
1039 #
1040 # Notes:
1041 #
1042 # 1. The 'query-migrate' command should be used to check migration's progress
1043 # and final result (this information is provided by the 'status' member)
1044 #
1045 # 2. All boolean arguments default to false
1046 #
1047 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1048 # be used
1049 #
1050 # Example:
1051 #
1052 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1053 # <- { "return": {} }
1054 #
1055 ##
1056 { 'command': 'migrate',
1057 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1058 '*detach': 'bool', '*resume': 'bool' } }
1059
1060 ##
1061 # @migrate-incoming:
1062 #
1063 # Start an incoming migration, the qemu must have been started
1064 # with -incoming defer
1065 #
1066 # @uri: The Uniform Resource Identifier identifying the source or
1067 # address to listen on
1068 #
1069 # Returns: nothing on success
1070 #
1071 # Since: 2.3
1072 #
1073 # Notes:
1074 #
1075 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1076 # compatible with -incoming and the format of the uri is already exposed
1077 # above libvirt.
1078 #
1079 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1080 # be used.
1081 #
1082 # 3. The uri format is the same as for -incoming
1083 #
1084 # Example:
1085 #
1086 # -> { "execute": "migrate-incoming",
1087 # "arguments": { "uri": "tcp::4446" } }
1088 # <- { "return": {} }
1089 #
1090 ##
1091 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1092
1093 ##
1094 # @xen-save-devices-state:
1095 #
1096 # Save the state of all devices to file. The RAM and the block devices
1097 # of the VM are not saved by this command.
1098 #
1099 # @filename: the file to save the state of the devices to as binary
1100 # data. See xen-save-devices-state.txt for a description of the binary
1101 # format.
1102 #
1103 # @live: Optional argument to ask QEMU to treat this command as part of a live
1104 # migration. Default to true. (since 2.11)
1105 #
1106 # Returns: Nothing on success
1107 #
1108 # Since: 1.1
1109 #
1110 # Example:
1111 #
1112 # -> { "execute": "xen-save-devices-state",
1113 # "arguments": { "filename": "/tmp/save" } }
1114 # <- { "return": {} }
1115 #
1116 ##
1117 { 'command': 'xen-save-devices-state',
1118 'data': {'filename': 'str', '*live':'bool' } }
1119
1120 ##
1121 # @xen-set-replication:
1122 #
1123 # Enable or disable replication.
1124 #
1125 # @enable: true to enable, false to disable.
1126 #
1127 # @primary: true for primary or false for secondary.
1128 #
1129 # @failover: true to do failover, false to stop. but cannot be
1130 # specified if 'enable' is true. default value is false.
1131 #
1132 # Returns: nothing.
1133 #
1134 # Example:
1135 #
1136 # -> { "execute": "xen-set-replication",
1137 # "arguments": {"enable": true, "primary": false} }
1138 # <- { "return": {} }
1139 #
1140 # Since: 2.9
1141 ##
1142 { 'command': 'xen-set-replication',
1143 'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
1144
1145 ##
1146 # @ReplicationStatus:
1147 #
1148 # The result format for 'query-xen-replication-status'.
1149 #
1150 # @error: true if an error happened, false if replication is normal.
1151 #
1152 # @desc: the human readable error description string, when
1153 # @error is 'true'.
1154 #
1155 # Since: 2.9
1156 ##
1157 { 'struct': 'ReplicationStatus',
1158 'data': { 'error': 'bool', '*desc': 'str' } }
1159
1160 ##
1161 # @query-xen-replication-status:
1162 #
1163 # Query replication status while the vm is running.
1164 #
1165 # Returns: A @ReplicationResult object showing the status.
1166 #
1167 # Example:
1168 #
1169 # -> { "execute": "query-xen-replication-status" }
1170 # <- { "return": { "error": false } }
1171 #
1172 # Since: 2.9
1173 ##
1174 { 'command': 'query-xen-replication-status',
1175 'returns': 'ReplicationStatus' }
1176
1177 ##
1178 # @xen-colo-do-checkpoint:
1179 #
1180 # Xen uses this command to notify replication to trigger a checkpoint.
1181 #
1182 # Returns: nothing.
1183 #
1184 # Example:
1185 #
1186 # -> { "execute": "xen-colo-do-checkpoint" }
1187 # <- { "return": {} }
1188 #
1189 # Since: 2.9
1190 ##
1191 { 'command': 'xen-colo-do-checkpoint' }