migration: introduce lock for to_dst_file
[qemu/ar7.git] / qapi / migration.json
blobda351d74217f7076ce22994b65a00d63864a8281
1 # -*- Mode: Python -*-
4 ##
5 # = Migration
6 ##
8 { 'include': 'common.json' }
11 # @MigrationStats:
13 # Detailed migration status.
15 # @transferred: amount of bytes already transferred to the target VM
17 # @remaining: amount of bytes remaining to be transferred to the target VM
19 # @total: total amount of bytes involved in the migration process
21 # @duplicate: number of duplicate (zero) pages (since 1.2)
23 # @skipped: number of skipped zero pages (since 1.5)
25 # @normal: number of normal pages (since 1.2)
27 # @normal-bytes: number of normal bytes sent (since 1.2)
29 # @dirty-pages-rate: number of pages dirtied by second by the
30 #        guest (since 1.3)
32 # @mbps: throughput in megabits/sec. (since 1.6)
34 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
36 # @postcopy-requests: The number of page requests received from the destination
37 #        (since 2.7)
39 # @page-size: The number of bytes per page for the various page-based
40 #        statistics (since 2.10)
42 # Since: 0.14.0
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' } }
52 # @XBZRLECacheStats:
54 # Detailed XBZRLE migration cache statistics
56 # @cache-size: XBZRLE cache size
58 # @bytes: amount of bytes already transferred to the target VM
60 # @pages: amount of pages transferred to the target VM
62 # @cache-miss: number of cache miss
64 # @cache-miss-rate: rate of cache miss (since 2.1)
66 # @overflow: number of overflows
68 # Since: 1.2
70 { 'struct': 'XBZRLECacheStats',
71   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
72            'cache-miss': 'int', 'cache-miss-rate': 'number',
73            'overflow': 'int' } }
76 # @MigrationStatus:
78 # An enumeration of migration status.
80 # @none: no migration has ever happened.
82 # @setup: migration process has been initiated.
84 # @cancelling: in the process of cancelling migration.
86 # @cancelled: cancelling migration is finished.
88 # @active: in the process of doing migration.
90 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
92 # @postcopy-paused: during postcopy but paused. (since 2.13)
94 # @postcopy-recover: trying to recover from a paused postcopy. (since 2.13)
96 # @completed: migration is finished.
98 # @failed: some error occurred during migration process.
100 # @colo: VM is in the process of fault tolerance, VM can not get into this
101 #        state unless colo capability is enabled for migration. (since 2.8)
103 # @pre-switchover: Paused before device serialisation. (since 2.11)
105 # @device: During device serialisation when pause-before-switchover is enabled
106 #        (since 2.11)
108 # Since: 2.3
111 { 'enum': 'MigrationStatus',
112   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
113             'active', 'postcopy-active', 'postcopy-paused',
114             'postcopy-recover', 'completed', 'failed', 'colo',
115             'pre-switchover', 'device' ] }
118 # @MigrationInfo:
120 # Information about current migration process.
122 # @status: @MigrationStatus describing the current migration status.
123 #          If this field is not returned, no migration process
124 #          has been initiated
126 # @ram: @MigrationStats containing detailed migration
127 #       status, only returned if status is 'active' or
128 #       'completed'(since 1.2)
130 # @disk: @MigrationStats containing detailed disk migration
131 #        status, only returned if status is 'active' and it is a block
132 #        migration
134 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
135 #                migration statistics, only returned if XBZRLE feature is on and
136 #                status is 'active' or 'completed' (since 1.2)
138 # @total-time: total amount of milliseconds since migration started.
139 #        If migration has ended, it returns the total migration
140 #        time. (since 1.2)
142 # @downtime: only present when migration finishes correctly
143 #        total downtime in milliseconds for the guest.
144 #        (since 1.3)
146 # @expected-downtime: only present while migration is active
147 #        expected downtime in milliseconds for the guest in last walk
148 #        of the dirty bitmap. (since 1.3)
150 # @setup-time: amount of setup time in milliseconds _before_ the
151 #        iterations begin but _after_ the QMP command is issued. This is designed
152 #        to provide an accounting of any activities (such as RDMA pinning) which
153 #        may be expensive, but do not actually occur during the iterative
154 #        migration rounds themselves. (since 1.6)
156 # @cpu-throttle-percentage: percentage of time guest cpus are being
157 #        throttled during auto-converge. This is only present when auto-converge
158 #        has started throttling guest cpus. (Since 2.7)
160 # @error-desc: the human readable error description string, when
161 #              @status is 'failed'. Clients should not attempt to parse the
162 #              error strings. (Since 2.7)
164 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
165 #           live migration (Since 2.13)
167 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU (Since 2.13)
171 # Since: 0.14.0
173 { 'struct': 'MigrationInfo',
174   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
175            '*disk': 'MigrationStats',
176            '*xbzrle-cache': 'XBZRLECacheStats',
177            '*total-time': 'int',
178            '*expected-downtime': 'int',
179            '*downtime': 'int',
180            '*setup-time': 'int',
181            '*cpu-throttle-percentage': 'int',
182            '*error-desc': 'str',
183            '*postcopy-blocktime' : 'uint32',
184            '*postcopy-vcpu-blocktime': ['uint32']} }
187 # @query-migrate:
189 # Returns information about current migration process. If migration
190 # is active there will be another json-object with RAM migration
191 # status and if block migration is active another one with block
192 # migration status.
194 # Returns: @MigrationInfo
196 # Since: 0.14.0
198 # Example:
200 # 1. Before the first migration
202 # -> { "execute": "query-migrate" }
203 # <- { "return": {} }
205 # 2. Migration is done and has succeeded
207 # -> { "execute": "query-migrate" }
208 # <- { "return": {
209 #         "status": "completed",
210 #         "ram":{
211 #           "transferred":123,
212 #           "remaining":123,
213 #           "total":246,
214 #           "total-time":12345,
215 #           "setup-time":12345,
216 #           "downtime":12345,
217 #           "duplicate":123,
218 #           "normal":123,
219 #           "normal-bytes":123456,
220 #           "dirty-sync-count":15
221 #         }
222 #      }
223 #    }
225 # 3. Migration is done and has failed
227 # -> { "execute": "query-migrate" }
228 # <- { "return": { "status": "failed" } }
230 # 4. Migration is being performed and is not a block migration:
232 # -> { "execute": "query-migrate" }
233 # <- {
234 #       "return":{
235 #          "status":"active",
236 #          "ram":{
237 #             "transferred":123,
238 #             "remaining":123,
239 #             "total":246,
240 #             "total-time":12345,
241 #             "setup-time":12345,
242 #             "expected-downtime":12345,
243 #             "duplicate":123,
244 #             "normal":123,
245 #             "normal-bytes":123456,
246 #             "dirty-sync-count":15
247 #          }
248 #       }
249 #    }
251 # 5. Migration is being performed and is a block migration:
253 # -> { "execute": "query-migrate" }
254 # <- {
255 #       "return":{
256 #          "status":"active",
257 #          "ram":{
258 #             "total":1057024,
259 #             "remaining":1053304,
260 #             "transferred":3720,
261 #             "total-time":12345,
262 #             "setup-time":12345,
263 #             "expected-downtime":12345,
264 #             "duplicate":123,
265 #             "normal":123,
266 #             "normal-bytes":123456,
267 #             "dirty-sync-count":15
268 #          },
269 #          "disk":{
270 #             "total":20971520,
271 #             "remaining":20880384,
272 #             "transferred":91136
273 #          }
274 #       }
275 #    }
277 # 6. Migration is being performed and XBZRLE is active:
279 # -> { "execute": "query-migrate" }
280 # <- {
281 #       "return":{
282 #          "status":"active",
283 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
284 #          "ram":{
285 #             "total":1057024,
286 #             "remaining":1053304,
287 #             "transferred":3720,
288 #             "total-time":12345,
289 #             "setup-time":12345,
290 #             "expected-downtime":12345,
291 #             "duplicate":10,
292 #             "normal":3333,
293 #             "normal-bytes":3412992,
294 #             "dirty-sync-count":15
295 #          },
296 #          "xbzrle-cache":{
297 #             "cache-size":67108864,
298 #             "bytes":20971520,
299 #             "pages":2444343,
300 #             "cache-miss":2244,
301 #             "cache-miss-rate":0.123,
302 #             "overflow":34434
303 #          }
304 #       }
305 #    }
308 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
311 # @MigrationCapability:
313 # Migration capabilities enumeration
315 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
316 #          This feature allows us to minimize migration traffic for certain work
317 #          loads, by sending compressed difference of the pages
319 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
320 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
321 #          Disabled by default. (since 2.0)
323 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
324 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
325 #          source and target VM to support this feature. To enable it is sufficient
326 #          to enable the capability on the source VM. The feature is disabled by
327 #          default. (since 1.6)
329 # @compress: Use multiple compression threads to accelerate live migration.
330 #          This feature can help to reduce the migration traffic, by sending
331 #          compressed pages. Please note that if compress and xbzrle are both
332 #          on, compress only takes effect in the ram bulk stage, after that,
333 #          it will be disabled and only xbzrle takes effect, this can help to
334 #          minimize migration traffic. The feature is disabled by default.
335 #          (since 2.4 )
337 # @events: generate events for each migration state change
338 #          (since 2.4 )
340 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
341 #          to speed up convergence of RAM migration. (since 1.6)
343 # @postcopy-ram: Start executing on the migration target before all of RAM has
344 #          been migrated, pulling the remaining pages along as needed. The
345 #          capacity must have the same setting on both source and target
346 #          or migration will not even start. NOTE: If the migration fails during
347 #          postcopy the VM will fail.  (since 2.6)
349 # @x-colo: If enabled, migration will never end, and the state of the VM on the
350 #        primary side will be migrated continuously to the VM on secondary
351 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
352 #        Non-stop Service. (since 2.8)
354 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
355 #        during postcopy-ram migration. (since 2.9)
357 # @block: If enabled, QEMU will also migrate the contents of all block
358 #          devices.  Default is disabled.  A possible alternative uses
359 #          mirror jobs to a builtin NBD server on the destination, which
360 #          offers more flexibility.
361 #          (Since 2.10)
363 # @return-path: If enabled, migration will use the return path even
364 #               for precopy. (since 2.10)
366 # @pause-before-switchover: Pause outgoing migration before serialising device
367 #          state and before disabling block IO (since 2.11)
369 # @x-multifd: Use more than one fd for migration (since 2.11)
372 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
373 #                 (since 2.12)
375 # @postcopy-blocktime: Calculate downtime for postcopy live migration
376 #                     (since 2.13)
378 # Since: 1.2
380 { 'enum': 'MigrationCapability',
381   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
382            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
383            'block', 'return-path', 'pause-before-switchover', 'x-multifd',
384            'dirty-bitmaps', 'postcopy-blocktime' ] }
387 # @MigrationCapabilityStatus:
389 # Migration capability information
391 # @capability: capability enum
393 # @state: capability state bool
395 # Since: 1.2
397 { 'struct': 'MigrationCapabilityStatus',
398   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
401 # @migrate-set-capabilities:
403 # Enable/Disable the following migration capabilities (like xbzrle)
405 # @capabilities: json array of capability modifications to make
407 # Since: 1.2
409 # Example:
411 # -> { "execute": "migrate-set-capabilities" , "arguments":
412 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
415 { 'command': 'migrate-set-capabilities',
416   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
419 # @query-migrate-capabilities:
421 # Returns information about the current migration capabilities status
423 # Returns: @MigrationCapabilitiesStatus
425 # Since: 1.2
427 # Example:
429 # -> { "execute": "query-migrate-capabilities" }
430 # <- { "return": [
431 #       {"state": false, "capability": "xbzrle"},
432 #       {"state": false, "capability": "rdma-pin-all"},
433 #       {"state": false, "capability": "auto-converge"},
434 #       {"state": false, "capability": "zero-blocks"},
435 #       {"state": false, "capability": "compress"},
436 #       {"state": true, "capability": "events"},
437 #       {"state": false, "capability": "postcopy-ram"},
438 #       {"state": false, "capability": "x-colo"}
439 #    ]}
442 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
445 # @MigrationParameter:
447 # Migration parameters enumeration
449 # @compress-level: Set the compression level to be used in live migration,
450 #          the compression level is an integer between 0 and 9, where 0 means
451 #          no compression, 1 means the best compression speed, and 9 means best
452 #          compression ratio which will consume more CPU.
454 # @compress-threads: Set compression thread count to be used in live migration,
455 #          the compression thread count is an integer between 1 and 255.
457 # @decompress-threads: Set decompression thread count to be used in live
458 #          migration, the decompression thread count is an integer between 1
459 #          and 255. Usually, decompression is at least 4 times as fast as
460 #          compression, so set the decompress-threads to the number about 1/4
461 #          of compress-threads is adequate.
463 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
464 #                        when migration auto-converge is activated. The
465 #                        default value is 20. (Since 2.7)
467 # @cpu-throttle-increment: throttle percentage increase each time
468 #                          auto-converge detects that migration is not making
469 #                          progress. The default value is 10. (Since 2.7)
471 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
472 #             establishing a TLS connection over the migration data channel.
473 #             On the outgoing side of the migration, the credentials must
474 #             be for a 'client' endpoint, while for the incoming side the
475 #             credentials must be for a 'server' endpoint. Setting this
476 #             will enable TLS for all migrations. The default is unset,
477 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
479 # @tls-hostname: hostname of the target host for the migration. This is
480 #                required when using x509 based TLS credentials and the
481 #                migration URI does not already include a hostname. For
482 #                example if using fd: or exec: based migration, the
483 #                hostname must be provided so that the server's x509
484 #                certificate identity can be validated. (Since 2.7)
486 # @max-bandwidth: to set maximum speed for migration. maximum speed in
487 #                 bytes per second. (Since 2.8)
489 # @downtime-limit: set maximum tolerated downtime for migration. maximum
490 #                  downtime in milliseconds (Since 2.8)
492 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
493 #          periodic mode. (Since 2.8)
495 # @block-incremental: Affects how much storage is migrated when the
496 #       block migration capability is enabled.  When false, the entire
497 #       storage backing chain is migrated into a flattened image at
498 #       the destination; when true, only the active qcow2 layer is
499 #       migrated and the destination must already have access to the
500 #       same backing chain as was used on the source.  (since 2.10)
502 # @x-multifd-channels: Number of channels used to migrate data in
503 #                     parallel. This is the same number that the
504 #                     number of sockets used for migration.  The
505 #                     default value is 2 (since 2.11)
507 # @x-multifd-page-count: Number of pages sent together to a thread.
508 #                        The default value is 16 (since 2.11)
510 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
511 #                     needs to be a multiple of the target page size
512 #                     and a power of 2
513 #                     (Since 2.11)
515 # Since: 2.4
517 { 'enum': 'MigrationParameter',
518   'data': ['compress-level', 'compress-threads', 'decompress-threads',
519            'cpu-throttle-initial', 'cpu-throttle-increment',
520            'tls-creds', 'tls-hostname', 'max-bandwidth',
521            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
522            'x-multifd-channels', 'x-multifd-page-count',
523            'xbzrle-cache-size' ] }
526 # @MigrateSetParameters:
528 # @compress-level: compression level
530 # @compress-threads: compression thread count
532 # @decompress-threads: decompression thread count
534 # @cpu-throttle-initial: Initial percentage of time guest cpus are
535 #                        throttled when migration auto-converge is activated.
536 #                        The default value is 20. (Since 2.7)
538 # @cpu-throttle-increment: throttle percentage increase each time
539 #                          auto-converge detects that migration is not making
540 #                          progress. The default value is 10. (Since 2.7)
542 # @tls-creds: ID of the 'tls-creds' object that provides credentials
543 #             for establishing a TLS connection over the migration data
544 #             channel. On the outgoing side of the migration, the credentials
545 #             must be for a 'client' endpoint, while for the incoming side the
546 #             credentials must be for a 'server' endpoint. Setting this
547 #             to a non-empty string enables TLS for all migrations.
548 #             An empty string means that QEMU will use plain text mode for
549 #             migration, rather than TLS (Since 2.9)
550 #             Previously (since 2.7), this was reported by omitting
551 #             tls-creds instead.
553 # @tls-hostname: hostname of the target host for the migration. This
554 #                is required when using x509 based TLS credentials and the
555 #                migration URI does not already include a hostname. For
556 #                example if using fd: or exec: based migration, the
557 #                hostname must be provided so that the server's x509
558 #                certificate identity can be validated. (Since 2.7)
559 #                An empty string means that QEMU will use the hostname
560 #                associated with the migration URI, if any. (Since 2.9)
561 #                Previously (since 2.7), this was reported by omitting
562 #                tls-hostname instead.
564 # @max-bandwidth: to set maximum speed for migration. maximum speed in
565 #                 bytes per second. (Since 2.8)
567 # @downtime-limit: set maximum tolerated downtime for migration. maximum
568 #                  downtime in milliseconds (Since 2.8)
570 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
572 # @block-incremental: Affects how much storage is migrated when the
573 #       block migration capability is enabled.  When false, the entire
574 #       storage backing chain is migrated into a flattened image at
575 #       the destination; when true, only the active qcow2 layer is
576 #       migrated and the destination must already have access to the
577 #       same backing chain as was used on the source.  (since 2.10)
579 # @x-multifd-channels: Number of channels used to migrate data in
580 #                     parallel. This is the same number that the
581 #                     number of sockets used for migration.  The
582 #                     default value is 2 (since 2.11)
584 # @x-multifd-page-count: Number of pages sent together to a thread.
585 #                        The default value is 16 (since 2.11)
587 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
588 #                     needs to be a multiple of the target page size
589 #                     and a power of 2
590 #                     (Since 2.11)
591 # Since: 2.4
593 # TODO either fuse back into MigrationParameters, or make
594 # MigrationParameters members mandatory
595 { 'struct': 'MigrateSetParameters',
596   'data': { '*compress-level': 'int',
597             '*compress-threads': 'int',
598             '*decompress-threads': 'int',
599             '*cpu-throttle-initial': 'int',
600             '*cpu-throttle-increment': 'int',
601             '*tls-creds': 'StrOrNull',
602             '*tls-hostname': 'StrOrNull',
603             '*max-bandwidth': 'int',
604             '*downtime-limit': 'int',
605             '*x-checkpoint-delay': 'int',
606             '*block-incremental': 'bool',
607             '*x-multifd-channels': 'int',
608             '*x-multifd-page-count': 'int',
609             '*xbzrle-cache-size': 'size' } }
612 # @migrate-set-parameters:
614 # Set various migration parameters.
616 # Since: 2.4
618 # Example:
620 # -> { "execute": "migrate-set-parameters" ,
621 #      "arguments": { "compress-level": 1 } }
624 { 'command': 'migrate-set-parameters', 'boxed': true,
625   'data': 'MigrateSetParameters' }
628 # @MigrationParameters:
630 # The optional members aren't actually optional.
632 # @compress-level: compression level
634 # @compress-threads: compression thread count
636 # @decompress-threads: decompression thread count
638 # @cpu-throttle-initial: Initial percentage of time guest cpus are
639 #                        throttled when migration auto-converge is activated.
640 #                        (Since 2.7)
642 # @cpu-throttle-increment: throttle percentage increase each time
643 #                          auto-converge detects that migration is not making
644 #                          progress. (Since 2.7)
646 # @tls-creds: ID of the 'tls-creds' object that provides credentials
647 #             for establishing a TLS connection over the migration data
648 #             channel. On the outgoing side of the migration, the credentials
649 #             must be for a 'client' endpoint, while for the incoming side the
650 #             credentials must be for a 'server' endpoint.
651 #             An empty string means that QEMU will use plain text mode for
652 #             migration, rather than TLS (Since 2.7)
653 #             Note: 2.8 reports this by omitting tls-creds instead.
655 # @tls-hostname: hostname of the target host for the migration. This
656 #                is required when using x509 based TLS credentials and the
657 #                migration URI does not already include a hostname. For
658 #                example if using fd: or exec: based migration, the
659 #                hostname must be provided so that the server's x509
660 #                certificate identity can be validated. (Since 2.7)
661 #                An empty string means that QEMU will use the hostname
662 #                associated with the migration URI, if any. (Since 2.9)
663 #                Note: 2.8 reports this by omitting tls-hostname instead.
665 # @max-bandwidth: to set maximum speed for migration. maximum speed in
666 #                 bytes per second. (Since 2.8)
668 # @downtime-limit: set maximum tolerated downtime for migration. maximum
669 #                  downtime in milliseconds (Since 2.8)
671 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
673 # @block-incremental: Affects how much storage is migrated when the
674 #       block migration capability is enabled.  When false, the entire
675 #       storage backing chain is migrated into a flattened image at
676 #       the destination; when true, only the active qcow2 layer is
677 #       migrated and the destination must already have access to the
678 #       same backing chain as was used on the source.  (since 2.10)
680 # @x-multifd-channels: Number of channels used to migrate data in
681 #                     parallel. This is the same number that the
682 #                     number of sockets used for migration.
683 #                     The default value is 2 (since 2.11)
685 # @x-multifd-page-count: Number of pages sent together to a thread.
686 #                        The default value is 16 (since 2.11)
688 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
689 #                     needs to be a multiple of the target page size
690 #                     and a power of 2
691 #                     (Since 2.11)
692 # Since: 2.4
694 { 'struct': 'MigrationParameters',
695   'data': { '*compress-level': 'uint8',
696             '*compress-threads': 'uint8',
697             '*decompress-threads': 'uint8',
698             '*cpu-throttle-initial': 'uint8',
699             '*cpu-throttle-increment': 'uint8',
700             '*tls-creds': 'str',
701             '*tls-hostname': 'str',
702             '*max-bandwidth': 'size',
703             '*downtime-limit': 'uint64',
704             '*x-checkpoint-delay': 'uint32',
705             '*block-incremental': 'bool' ,
706             '*x-multifd-channels': 'uint8',
707             '*x-multifd-page-count': 'uint32',
708             '*xbzrle-cache-size': 'size' } }
711 # @query-migrate-parameters:
713 # Returns information about the current migration parameters
715 # Returns: @MigrationParameters
717 # Since: 2.4
719 # Example:
721 # -> { "execute": "query-migrate-parameters" }
722 # <- { "return": {
723 #          "decompress-threads": 2,
724 #          "cpu-throttle-increment": 10,
725 #          "compress-threads": 8,
726 #          "compress-level": 1,
727 #          "cpu-throttle-initial": 20,
728 #          "max-bandwidth": 33554432,
729 #          "downtime-limit": 300
730 #       }
731 #    }
734 { 'command': 'query-migrate-parameters',
735   'returns': 'MigrationParameters' }
738 # @client_migrate_info:
740 # Set migration information for remote display.  This makes the server
741 # ask the client to automatically reconnect using the new parameters
742 # once migration finished successfully.  Only implemented for SPICE.
744 # @protocol:     must be "spice"
745 # @hostname:     migration target hostname
746 # @port:         spice tcp port for plaintext channels
747 # @tls-port:     spice tcp port for tls-secured channels
748 # @cert-subject: server certificate subject
750 # Since: 0.14.0
752 # Example:
754 # -> { "execute": "client_migrate_info",
755 #      "arguments": { "protocol": "spice",
756 #                     "hostname": "virt42.lab.kraxel.org",
757 #                     "port": 1234 } }
758 # <- { "return": {} }
761 { 'command': 'client_migrate_info',
762   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
763             '*tls-port': 'int', '*cert-subject': 'str' } }
766 # @migrate-start-postcopy:
768 # Followup to a migration command to switch the migration to postcopy mode.
769 # The postcopy-ram capability must be set on both source and destination
770 # before the original migration command.
772 # Since: 2.5
774 # Example:
776 # -> { "execute": "migrate-start-postcopy" }
777 # <- { "return": {} }
780 { 'command': 'migrate-start-postcopy' }
783 # @MIGRATION:
785 # Emitted when a migration event happens
787 # @status: @MigrationStatus describing the current migration status.
789 # Since: 2.4
791 # Example:
793 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
794 #     "event": "MIGRATION",
795 #     "data": {"status": "completed"} }
798 { 'event': 'MIGRATION',
799   'data': {'status': 'MigrationStatus'}}
802 # @MIGRATION_PASS:
804 # Emitted from the source side of a migration at the start of each pass
805 # (when it syncs the dirty bitmap)
807 # @pass: An incrementing count (starting at 1 on the first pass)
809 # Since: 2.6
811 # Example:
813 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
814 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
817 { 'event': 'MIGRATION_PASS',
818   'data': { 'pass': 'int' } }
821 # @COLOMessage:
823 # The message transmission between Primary side and Secondary side.
825 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
827 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
829 # @checkpoint-reply: SVM gets PVM's checkpoint request
831 # @vmstate-send: VM's state will be sent by PVM.
833 # @vmstate-size: The total size of VMstate.
835 # @vmstate-received: VM's state has been received by SVM.
837 # @vmstate-loaded: VM's state has been loaded by SVM.
839 # Since: 2.8
841 { 'enum': 'COLOMessage',
842   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
843             'vmstate-send', 'vmstate-size', 'vmstate-received',
844             'vmstate-loaded' ] }
847 # @COLOMode:
849 # The colo mode
851 # @unknown: unknown mode
853 # @primary: master side
855 # @secondary: slave side
857 # Since: 2.8
859 { 'enum': 'COLOMode',
860   'data': [ 'unknown', 'primary', 'secondary'] }
863 # @FailoverStatus:
865 # An enumeration of COLO failover status
867 # @none: no failover has ever happened
869 # @require: got failover requirement but not handled
871 # @active: in the process of doing failover
873 # @completed: finish the process of failover
875 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
877 # Since: 2.8
879 { 'enum': 'FailoverStatus',
880   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
883 # @x-colo-lost-heartbeat:
885 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
886 # If this command is sent to the PVM, the Primary side will exit COLO mode.
887 # If sent to the Secondary, the Secondary side will run failover work,
888 # then takes over server operation to become the service VM.
890 # Since: 2.8
892 # Example:
894 # -> { "execute": "x-colo-lost-heartbeat" }
895 # <- { "return": {} }
898 { 'command': 'x-colo-lost-heartbeat' }
901 # @migrate_cancel:
903 # Cancel the current executing migration process.
905 # Returns: nothing on success
907 # Notes: This command succeeds even if there is no migration process running.
909 # Since: 0.14.0
911 # Example:
913 # -> { "execute": "migrate_cancel" }
914 # <- { "return": {} }
917 { 'command': 'migrate_cancel' }
920 # @migrate-continue:
922 # Continue migration when it's in a paused state.
924 # @state: The state the migration is currently expected to be in
926 # Returns: nothing on success
927 # Since: 2.11
928 # Example:
930 # -> { "execute": "migrate-continue" , "arguments":
931 #      { "state": "pre-switchover" } }
932 # <- { "return": {} }
934 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
937 # @migrate_set_downtime:
939 # Set maximum tolerated downtime for migration.
941 # @value: maximum downtime in seconds
943 # Returns: nothing on success
945 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
947 # Since: 0.14.0
949 # Example:
951 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
952 # <- { "return": {} }
955 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
958 # @migrate_set_speed:
960 # Set maximum speed for migration.
962 # @value: maximum speed in bytes per second.
964 # Returns: nothing on success
966 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
968 # Since: 0.14.0
970 # Example:
972 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
973 # <- { "return": {} }
976 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
979 # @migrate-set-cache-size:
981 # Set cache size to be used by XBZRLE migration
983 # @value: cache size in bytes
985 # The size will be rounded down to the nearest power of 2.
986 # The cache size can be modified before and during ongoing migration
988 # Returns: nothing on success
990 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
992 # Since: 1.2
994 # Example:
996 # -> { "execute": "migrate-set-cache-size",
997 #      "arguments": { "value": 536870912 } }
998 # <- { "return": {} }
1001 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1004 # @query-migrate-cache-size:
1006 # Query migration XBZRLE cache size
1008 # Returns: XBZRLE cache size in bytes
1010 # Notes: This command is deprecated in favor of 'query-migrate-parameters'
1012 # Since: 1.2
1014 # Example:
1016 # -> { "execute": "query-migrate-cache-size" }
1017 # <- { "return": 67108864 }
1020 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1023 # @migrate:
1025 # Migrates the current running guest to another Virtual Machine.
1027 # @uri: the Uniform Resource Identifier of the destination VM
1029 # @blk: do block migration (full disk copy)
1031 # @inc: incremental disk copy migration
1033 # @detach: this argument exists only for compatibility reasons and
1034 #          is ignored by QEMU
1036 # @resume: resume one paused migration, default "off". (since 2.13)
1038 # Returns: nothing on success
1040 # Since: 0.14.0
1042 # Notes:
1044 # 1. The 'query-migrate' command should be used to check migration's progress
1045 #    and final result (this information is provided by the 'status' member)
1047 # 2. All boolean arguments default to false
1049 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1050 #    be used
1052 # Example:
1054 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1055 # <- { "return": {} }
1058 { 'command': 'migrate',
1059   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1060            '*detach': 'bool', '*resume': 'bool' } }
1063 # @migrate-incoming:
1065 # Start an incoming migration, the qemu must have been started
1066 # with -incoming defer
1068 # @uri: The Uniform Resource Identifier identifying the source or
1069 #       address to listen on
1071 # Returns: nothing on success
1073 # Since: 2.3
1075 # Notes:
1077 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1078 #    compatible with -incoming and the format of the uri is already exposed
1079 #    above libvirt.
1081 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1082 #    be used.
1084 # 3. The uri format is the same as for -incoming
1086 # Example:
1088 # -> { "execute": "migrate-incoming",
1089 #      "arguments": { "uri": "tcp::4446" } }
1090 # <- { "return": {} }
1093 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1096 # @xen-save-devices-state:
1098 # Save the state of all devices to file. The RAM and the block devices
1099 # of the VM are not saved by this command.
1101 # @filename: the file to save the state of the devices to as binary
1102 # data. See xen-save-devices-state.txt for a description of the binary
1103 # format.
1105 # @live: Optional argument to ask QEMU to treat this command as part of a live
1106 # migration. Default to true. (since 2.11)
1108 # Returns: Nothing on success
1110 # Since: 1.1
1112 # Example:
1114 # -> { "execute": "xen-save-devices-state",
1115 #      "arguments": { "filename": "/tmp/save" } }
1116 # <- { "return": {} }
1119 { 'command': 'xen-save-devices-state',
1120   'data': {'filename': 'str', '*live':'bool' } }
1123 # @xen-set-replication:
1125 # Enable or disable replication.
1127 # @enable: true to enable, false to disable.
1129 # @primary: true for primary or false for secondary.
1131 # @failover: true to do failover, false to stop. but cannot be
1132 #            specified if 'enable' is true. default value is false.
1134 # Returns: nothing.
1136 # Example:
1138 # -> { "execute": "xen-set-replication",
1139 #      "arguments": {"enable": true, "primary": false} }
1140 # <- { "return": {} }
1142 # Since: 2.9
1144 { 'command': 'xen-set-replication',
1145   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
1148 # @ReplicationStatus:
1150 # The result format for 'query-xen-replication-status'.
1152 # @error: true if an error happened, false if replication is normal.
1154 # @desc: the human readable error description string, when
1155 #        @error is 'true'.
1157 # Since: 2.9
1159 { 'struct': 'ReplicationStatus',
1160   'data': { 'error': 'bool', '*desc': 'str' } }
1163 # @query-xen-replication-status:
1165 # Query replication status while the vm is running.
1167 # Returns: A @ReplicationResult object showing the status.
1169 # Example:
1171 # -> { "execute": "query-xen-replication-status" }
1172 # <- { "return": { "error": false } }
1174 # Since: 2.9
1176 { 'command': 'query-xen-replication-status',
1177   'returns': 'ReplicationStatus' }
1180 # @xen-colo-do-checkpoint:
1182 # Xen uses this command to notify replication to trigger a checkpoint.
1184 # Returns: nothing.
1186 # Example:
1188 # -> { "execute": "xen-colo-do-checkpoint" }
1189 # <- { "return": {} }
1191 # Since: 2.9
1193 { 'command': 'xen-colo-do-checkpoint' }
1196 # @migrate-recover:
1198 # Provide a recovery migration stream URI.
1200 # @uri: the URI to be used for the recovery of migration stream.
1202 # Returns: nothing.
1204 # Example:
1206 # -> { "execute": "migrate-recover",
1207 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1208 # <- { "return": {} }
1210 # Since: 2.13
1212 { 'command': 'migrate-recover', 'data': { 'uri': 'str' },
1213   'allow-oob': true }