net/slirp: Convert atoi to qemu_strtoi to allow error checking
[qemu/ar7.git] / qapi / migration.json
blobdc9cc85545103fe2cd31799deffcc67f20e7fb3f
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 3.0)
94 # @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
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. This is only present when the postcopy-blocktime
166 #           migration capability is enabled. (Since 3.0)
168 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.  This is
169 #           only present when the postcopy-blocktime migration capability
170 #           is enabled. (Since 3.0)
173 # Since: 0.14.0
175 { 'struct': 'MigrationInfo',
176   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
177            '*disk': 'MigrationStats',
178            '*xbzrle-cache': 'XBZRLECacheStats',
179            '*total-time': 'int',
180            '*expected-downtime': 'int',
181            '*downtime': 'int',
182            '*setup-time': 'int',
183            '*cpu-throttle-percentage': 'int',
184            '*error-desc': 'str',
185            '*postcopy-blocktime' : 'uint32',
186            '*postcopy-vcpu-blocktime': ['uint32']} }
189 # @query-migrate:
191 # Returns information about current migration process. If migration
192 # is active there will be another json-object with RAM migration
193 # status and if block migration is active another one with block
194 # migration status.
196 # Returns: @MigrationInfo
198 # Since: 0.14.0
200 # Example:
202 # 1. Before the first migration
204 # -> { "execute": "query-migrate" }
205 # <- { "return": {} }
207 # 2. Migration is done and has succeeded
209 # -> { "execute": "query-migrate" }
210 # <- { "return": {
211 #         "status": "completed",
212 #         "ram":{
213 #           "transferred":123,
214 #           "remaining":123,
215 #           "total":246,
216 #           "total-time":12345,
217 #           "setup-time":12345,
218 #           "downtime":12345,
219 #           "duplicate":123,
220 #           "normal":123,
221 #           "normal-bytes":123456,
222 #           "dirty-sync-count":15
223 #         }
224 #      }
225 #    }
227 # 3. Migration is done and has failed
229 # -> { "execute": "query-migrate" }
230 # <- { "return": { "status": "failed" } }
232 # 4. Migration is being performed and is not a block migration:
234 # -> { "execute": "query-migrate" }
235 # <- {
236 #       "return":{
237 #          "status":"active",
238 #          "ram":{
239 #             "transferred":123,
240 #             "remaining":123,
241 #             "total":246,
242 #             "total-time":12345,
243 #             "setup-time":12345,
244 #             "expected-downtime":12345,
245 #             "duplicate":123,
246 #             "normal":123,
247 #             "normal-bytes":123456,
248 #             "dirty-sync-count":15
249 #          }
250 #       }
251 #    }
253 # 5. Migration is being performed and is a block migration:
255 # -> { "execute": "query-migrate" }
256 # <- {
257 #       "return":{
258 #          "status":"active",
259 #          "ram":{
260 #             "total":1057024,
261 #             "remaining":1053304,
262 #             "transferred":3720,
263 #             "total-time":12345,
264 #             "setup-time":12345,
265 #             "expected-downtime":12345,
266 #             "duplicate":123,
267 #             "normal":123,
268 #             "normal-bytes":123456,
269 #             "dirty-sync-count":15
270 #          },
271 #          "disk":{
272 #             "total":20971520,
273 #             "remaining":20880384,
274 #             "transferred":91136
275 #          }
276 #       }
277 #    }
279 # 6. Migration is being performed and XBZRLE is active:
281 # -> { "execute": "query-migrate" }
282 # <- {
283 #       "return":{
284 #          "status":"active",
285 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
286 #          "ram":{
287 #             "total":1057024,
288 #             "remaining":1053304,
289 #             "transferred":3720,
290 #             "total-time":12345,
291 #             "setup-time":12345,
292 #             "expected-downtime":12345,
293 #             "duplicate":10,
294 #             "normal":3333,
295 #             "normal-bytes":3412992,
296 #             "dirty-sync-count":15
297 #          },
298 #          "xbzrle-cache":{
299 #             "cache-size":67108864,
300 #             "bytes":20971520,
301 #             "pages":2444343,
302 #             "cache-miss":2244,
303 #             "cache-miss-rate":0.123,
304 #             "overflow":34434
305 #          }
306 #       }
307 #    }
310 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
313 # @MigrationCapability:
315 # Migration capabilities enumeration
317 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
318 #          This feature allows us to minimize migration traffic for certain work
319 #          loads, by sending compressed difference of the pages
321 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
322 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
323 #          Disabled by default. (since 2.0)
325 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
326 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
327 #          source and target VM to support this feature. To enable it is sufficient
328 #          to enable the capability on the source VM. The feature is disabled by
329 #          default. (since 1.6)
331 # @compress: Use multiple compression threads to accelerate live migration.
332 #          This feature can help to reduce the migration traffic, by sending
333 #          compressed pages. Please note that if compress and xbzrle are both
334 #          on, compress only takes effect in the ram bulk stage, after that,
335 #          it will be disabled and only xbzrle takes effect, this can help to
336 #          minimize migration traffic. The feature is disabled by default.
337 #          (since 2.4 )
339 # @events: generate events for each migration state change
340 #          (since 2.4 )
342 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
343 #          to speed up convergence of RAM migration. (since 1.6)
345 # @postcopy-ram: Start executing on the migration target before all of RAM has
346 #          been migrated, pulling the remaining pages along as needed. The
347 #          capacity must have the same setting on both source and target
348 #          or migration will not even start. NOTE: If the migration fails during
349 #          postcopy the VM will fail.  (since 2.6)
351 # @x-colo: If enabled, migration will never end, and the state of the VM on the
352 #        primary side will be migrated continuously to the VM on secondary
353 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
354 #        Non-stop Service. (since 2.8)
356 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
357 #        during postcopy-ram migration. (since 2.9)
359 # @block: If enabled, QEMU will also migrate the contents of all block
360 #          devices.  Default is disabled.  A possible alternative uses
361 #          mirror jobs to a builtin NBD server on the destination, which
362 #          offers more flexibility.
363 #          (Since 2.10)
365 # @return-path: If enabled, migration will use the return path even
366 #               for precopy. (since 2.10)
368 # @pause-before-switchover: Pause outgoing migration before serialising device
369 #          state and before disabling block IO (since 2.11)
371 # @x-multifd: Use more than one fd for migration (since 2.11)
373 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
374 #                 (since 2.12)
376 # @postcopy-blocktime: Calculate downtime for postcopy live migration
377 #                     (since 3.0)
379 # Since: 1.2
381 { 'enum': 'MigrationCapability',
382   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
383            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
384            'block', 'return-path', 'pause-before-switchover', 'x-multifd',
385            'dirty-bitmaps', 'postcopy-blocktime' ] }
388 # @MigrationCapabilityStatus:
390 # Migration capability information
392 # @capability: capability enum
394 # @state: capability state bool
396 # Since: 1.2
398 { 'struct': 'MigrationCapabilityStatus',
399   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
402 # @migrate-set-capabilities:
404 # Enable/Disable the following migration capabilities (like xbzrle)
406 # @capabilities: json array of capability modifications to make
408 # Since: 1.2
410 # Example:
412 # -> { "execute": "migrate-set-capabilities" , "arguments":
413 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
416 { 'command': 'migrate-set-capabilities',
417   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
420 # @query-migrate-capabilities:
422 # Returns information about the current migration capabilities status
424 # Returns: @MigrationCapabilitiesStatus
426 # Since: 1.2
428 # Example:
430 # -> { "execute": "query-migrate-capabilities" }
431 # <- { "return": [
432 #       {"state": false, "capability": "xbzrle"},
433 #       {"state": false, "capability": "rdma-pin-all"},
434 #       {"state": false, "capability": "auto-converge"},
435 #       {"state": false, "capability": "zero-blocks"},
436 #       {"state": false, "capability": "compress"},
437 #       {"state": true, "capability": "events"},
438 #       {"state": false, "capability": "postcopy-ram"},
439 #       {"state": false, "capability": "x-colo"}
440 #    ]}
443 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
446 # @MigrationParameter:
448 # Migration parameters enumeration
450 # @compress-level: Set the compression level to be used in live migration,
451 #          the compression level is an integer between 0 and 9, where 0 means
452 #          no compression, 1 means the best compression speed, and 9 means best
453 #          compression ratio which will consume more CPU.
455 # @compress-threads: Set compression thread count to be used in live migration,
456 #          the compression thread count is an integer between 1 and 255.
458 # @decompress-threads: Set decompression thread count to be used in live
459 #          migration, the decompression thread count is an integer between 1
460 #          and 255. Usually, decompression is at least 4 times as fast as
461 #          compression, so set the decompress-threads to the number about 1/4
462 #          of compress-threads is adequate.
464 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
465 #                        when migration auto-converge is activated. The
466 #                        default value is 20. (Since 2.7)
468 # @cpu-throttle-increment: throttle percentage increase each time
469 #                          auto-converge detects that migration is not making
470 #                          progress. The default value is 10. (Since 2.7)
472 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
473 #             establishing a TLS connection over the migration data channel.
474 #             On the outgoing side of the migration, the credentials must
475 #             be for a 'client' endpoint, while for the incoming side the
476 #             credentials must be for a 'server' endpoint. Setting this
477 #             will enable TLS for all migrations. The default is unset,
478 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
480 # @tls-hostname: hostname of the target host for the migration. This is
481 #                required when using x509 based TLS credentials and the
482 #                migration URI does not already include a hostname. For
483 #                example if using fd: or exec: based migration, the
484 #                hostname must be provided so that the server's x509
485 #                certificate identity can be validated. (Since 2.7)
487 # @max-bandwidth: to set maximum speed for migration. maximum speed in
488 #                 bytes per second. (Since 2.8)
490 # @downtime-limit: set maximum tolerated downtime for migration. maximum
491 #                  downtime in milliseconds (Since 2.8)
493 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
494 #          periodic mode. (Since 2.8)
496 # @block-incremental: Affects how much storage is migrated when the
497 #       block migration capability is enabled.  When false, the entire
498 #       storage backing chain is migrated into a flattened image at
499 #       the destination; when true, only the active qcow2 layer is
500 #       migrated and the destination must already have access to the
501 #       same backing chain as was used on the source.  (since 2.10)
503 # @x-multifd-channels: Number of channels used to migrate data in
504 #                     parallel. This is the same number that the
505 #                     number of sockets used for migration.  The
506 #                     default value is 2 (since 2.11)
508 # @x-multifd-page-count: Number of pages sent together to a thread.
509 #                        The default value is 16 (since 2.11)
511 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
512 #                     needs to be a multiple of the target page size
513 #                     and a power of 2
514 #                     (Since 2.11)
516 # Since: 2.4
518 { 'enum': 'MigrationParameter',
519   'data': ['compress-level', 'compress-threads', 'decompress-threads',
520            'cpu-throttle-initial', 'cpu-throttle-increment',
521            'tls-creds', 'tls-hostname', 'max-bandwidth',
522            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
523            'x-multifd-channels', 'x-multifd-page-count',
524            'xbzrle-cache-size' ] }
527 # @MigrateSetParameters:
529 # @compress-level: compression level
531 # @compress-threads: compression thread count
533 # @decompress-threads: decompression thread count
535 # @cpu-throttle-initial: Initial percentage of time guest cpus are
536 #                        throttled when migration auto-converge is activated.
537 #                        The default value is 20. (Since 2.7)
539 # @cpu-throttle-increment: throttle percentage increase each time
540 #                          auto-converge detects that migration is not making
541 #                          progress. The default value is 10. (Since 2.7)
543 # @tls-creds: ID of the 'tls-creds' object that provides credentials
544 #             for establishing a TLS connection over the migration data
545 #             channel. On the outgoing side of the migration, the credentials
546 #             must be for a 'client' endpoint, while for the incoming side the
547 #             credentials must be for a 'server' endpoint. Setting this
548 #             to a non-empty string enables TLS for all migrations.
549 #             An empty string means that QEMU will use plain text mode for
550 #             migration, rather than TLS (Since 2.9)
551 #             Previously (since 2.7), this was reported by omitting
552 #             tls-creds instead.
554 # @tls-hostname: hostname of the target host for the migration. This
555 #                is required when using x509 based TLS credentials and the
556 #                migration URI does not already include a hostname. For
557 #                example if using fd: or exec: based migration, the
558 #                hostname must be provided so that the server's x509
559 #                certificate identity can be validated. (Since 2.7)
560 #                An empty string means that QEMU will use the hostname
561 #                associated with the migration URI, if any. (Since 2.9)
562 #                Previously (since 2.7), this was reported by omitting
563 #                tls-hostname instead.
565 # @max-bandwidth: to set maximum speed for migration. maximum speed in
566 #                 bytes per second. (Since 2.8)
568 # @downtime-limit: set maximum tolerated downtime for migration. maximum
569 #                  downtime in milliseconds (Since 2.8)
571 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
573 # @block-incremental: Affects how much storage is migrated when the
574 #       block migration capability is enabled.  When false, the entire
575 #       storage backing chain is migrated into a flattened image at
576 #       the destination; when true, only the active qcow2 layer is
577 #       migrated and the destination must already have access to the
578 #       same backing chain as was used on the source.  (since 2.10)
580 # @x-multifd-channels: Number of channels used to migrate data in
581 #                     parallel. This is the same number that the
582 #                     number of sockets used for migration.  The
583 #                     default value is 2 (since 2.11)
585 # @x-multifd-page-count: Number of pages sent together to a thread.
586 #                        The default value is 16 (since 2.11)
588 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
589 #                     needs to be a multiple of the target page size
590 #                     and a power of 2
591 #                     (Since 2.11)
592 # Since: 2.4
594 # TODO either fuse back into MigrationParameters, or make
595 # MigrationParameters members mandatory
596 { 'struct': 'MigrateSetParameters',
597   'data': { '*compress-level': 'int',
598             '*compress-threads': 'int',
599             '*decompress-threads': 'int',
600             '*cpu-throttle-initial': 'int',
601             '*cpu-throttle-increment': 'int',
602             '*tls-creds': 'StrOrNull',
603             '*tls-hostname': 'StrOrNull',
604             '*max-bandwidth': 'int',
605             '*downtime-limit': 'int',
606             '*x-checkpoint-delay': 'int',
607             '*block-incremental': 'bool',
608             '*x-multifd-channels': 'int',
609             '*x-multifd-page-count': 'int',
610             '*xbzrle-cache-size': 'size' } }
613 # @migrate-set-parameters:
615 # Set various migration parameters.
617 # Since: 2.4
619 # Example:
621 # -> { "execute": "migrate-set-parameters" ,
622 #      "arguments": { "compress-level": 1 } }
625 { 'command': 'migrate-set-parameters', 'boxed': true,
626   'data': 'MigrateSetParameters' }
629 # @MigrationParameters:
631 # The optional members aren't actually optional.
633 # @compress-level: compression level
635 # @compress-threads: compression thread count
637 # @decompress-threads: decompression thread count
639 # @cpu-throttle-initial: Initial percentage of time guest cpus are
640 #                        throttled when migration auto-converge is activated.
641 #                        (Since 2.7)
643 # @cpu-throttle-increment: throttle percentage increase each time
644 #                          auto-converge detects that migration is not making
645 #                          progress. (Since 2.7)
647 # @tls-creds: ID of the 'tls-creds' object that provides credentials
648 #             for establishing a TLS connection over the migration data
649 #             channel. On the outgoing side of the migration, the credentials
650 #             must be for a 'client' endpoint, while for the incoming side the
651 #             credentials must be for a 'server' endpoint.
652 #             An empty string means that QEMU will use plain text mode for
653 #             migration, rather than TLS (Since 2.7)
654 #             Note: 2.8 reports this by omitting tls-creds instead.
656 # @tls-hostname: hostname of the target host for the migration. This
657 #                is required when using x509 based TLS credentials and the
658 #                migration URI does not already include a hostname. For
659 #                example if using fd: or exec: based migration, the
660 #                hostname must be provided so that the server's x509
661 #                certificate identity can be validated. (Since 2.7)
662 #                An empty string means that QEMU will use the hostname
663 #                associated with the migration URI, if any. (Since 2.9)
664 #                Note: 2.8 reports this by omitting tls-hostname instead.
666 # @max-bandwidth: to set maximum speed for migration. maximum speed in
667 #                 bytes per second. (Since 2.8)
669 # @downtime-limit: set maximum tolerated downtime for migration. maximum
670 #                  downtime in milliseconds (Since 2.8)
672 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
674 # @block-incremental: Affects how much storage is migrated when the
675 #       block migration capability is enabled.  When false, the entire
676 #       storage backing chain is migrated into a flattened image at
677 #       the destination; when true, only the active qcow2 layer is
678 #       migrated and the destination must already have access to the
679 #       same backing chain as was used on the source.  (since 2.10)
681 # @x-multifd-channels: Number of channels used to migrate data in
682 #                     parallel. This is the same number that the
683 #                     number of sockets used for migration.
684 #                     The default value is 2 (since 2.11)
686 # @x-multifd-page-count: Number of pages sent together to a thread.
687 #                        The default value is 16 (since 2.11)
689 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
690 #                     needs to be a multiple of the target page size
691 #                     and a power of 2
692 #                     (Since 2.11)
693 # Since: 2.4
695 { 'struct': 'MigrationParameters',
696   'data': { '*compress-level': 'uint8',
697             '*compress-threads': 'uint8',
698             '*decompress-threads': 'uint8',
699             '*cpu-throttle-initial': 'uint8',
700             '*cpu-throttle-increment': 'uint8',
701             '*tls-creds': 'str',
702             '*tls-hostname': 'str',
703             '*max-bandwidth': 'size',
704             '*downtime-limit': 'uint64',
705             '*x-checkpoint-delay': 'uint32',
706             '*block-incremental': 'bool' ,
707             '*x-multifd-channels': 'uint8',
708             '*x-multifd-page-count': 'uint32',
709             '*xbzrle-cache-size': 'size' } }
712 # @query-migrate-parameters:
714 # Returns information about the current migration parameters
716 # Returns: @MigrationParameters
718 # Since: 2.4
720 # Example:
722 # -> { "execute": "query-migrate-parameters" }
723 # <- { "return": {
724 #          "decompress-threads": 2,
725 #          "cpu-throttle-increment": 10,
726 #          "compress-threads": 8,
727 #          "compress-level": 1,
728 #          "cpu-throttle-initial": 20,
729 #          "max-bandwidth": 33554432,
730 #          "downtime-limit": 300
731 #       }
732 #    }
735 { 'command': 'query-migrate-parameters',
736   'returns': 'MigrationParameters' }
739 # @client_migrate_info:
741 # Set migration information for remote display.  This makes the server
742 # ask the client to automatically reconnect using the new parameters
743 # once migration finished successfully.  Only implemented for SPICE.
745 # @protocol:     must be "spice"
746 # @hostname:     migration target hostname
747 # @port:         spice tcp port for plaintext channels
748 # @tls-port:     spice tcp port for tls-secured channels
749 # @cert-subject: server certificate subject
751 # Since: 0.14.0
753 # Example:
755 # -> { "execute": "client_migrate_info",
756 #      "arguments": { "protocol": "spice",
757 #                     "hostname": "virt42.lab.kraxel.org",
758 #                     "port": 1234 } }
759 # <- { "return": {} }
762 { 'command': 'client_migrate_info',
763   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
764             '*tls-port': 'int', '*cert-subject': 'str' } }
767 # @migrate-start-postcopy:
769 # Followup to a migration command to switch the migration to postcopy mode.
770 # The postcopy-ram capability must be set on both source and destination
771 # before the original migration command.
773 # Since: 2.5
775 # Example:
777 # -> { "execute": "migrate-start-postcopy" }
778 # <- { "return": {} }
781 { 'command': 'migrate-start-postcopy' }
784 # @MIGRATION:
786 # Emitted when a migration event happens
788 # @status: @MigrationStatus describing the current migration status.
790 # Since: 2.4
792 # Example:
794 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
795 #     "event": "MIGRATION",
796 #     "data": {"status": "completed"} }
799 { 'event': 'MIGRATION',
800   'data': {'status': 'MigrationStatus'}}
803 # @MIGRATION_PASS:
805 # Emitted from the source side of a migration at the start of each pass
806 # (when it syncs the dirty bitmap)
808 # @pass: An incrementing count (starting at 1 on the first pass)
810 # Since: 2.6
812 # Example:
814 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
815 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
818 { 'event': 'MIGRATION_PASS',
819   'data': { 'pass': 'int' } }
822 # @COLOMessage:
824 # The message transmission between Primary side and Secondary side.
826 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
828 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
830 # @checkpoint-reply: SVM gets PVM's checkpoint request
832 # @vmstate-send: VM's state will be sent by PVM.
834 # @vmstate-size: The total size of VMstate.
836 # @vmstate-received: VM's state has been received by SVM.
838 # @vmstate-loaded: VM's state has been loaded by SVM.
840 # Since: 2.8
842 { 'enum': 'COLOMessage',
843   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
844             'vmstate-send', 'vmstate-size', 'vmstate-received',
845             'vmstate-loaded' ] }
848 # @COLOMode:
850 # The colo mode
852 # @unknown: unknown mode
854 # @primary: master side
856 # @secondary: slave side
858 # Since: 2.8
860 { 'enum': 'COLOMode',
861   'data': [ 'unknown', 'primary', 'secondary'] }
864 # @FailoverStatus:
866 # An enumeration of COLO failover status
868 # @none: no failover has ever happened
870 # @require: got failover requirement but not handled
872 # @active: in the process of doing failover
874 # @completed: finish the process of failover
876 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
878 # Since: 2.8
880 { 'enum': 'FailoverStatus',
881   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
884 # @x-colo-lost-heartbeat:
886 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
887 # If this command is sent to the PVM, the Primary side will exit COLO mode.
888 # If sent to the Secondary, the Secondary side will run failover work,
889 # then takes over server operation to become the service VM.
891 # Since: 2.8
893 # Example:
895 # -> { "execute": "x-colo-lost-heartbeat" }
896 # <- { "return": {} }
899 { 'command': 'x-colo-lost-heartbeat' }
902 # @migrate_cancel:
904 # Cancel the current executing migration process.
906 # Returns: nothing on success
908 # Notes: This command succeeds even if there is no migration process running.
910 # Since: 0.14.0
912 # Example:
914 # -> { "execute": "migrate_cancel" }
915 # <- { "return": {} }
918 { 'command': 'migrate_cancel' }
921 # @migrate-continue:
923 # Continue migration when it's in a paused state.
925 # @state: The state the migration is currently expected to be in
927 # Returns: nothing on success
928 # Since: 2.11
929 # Example:
931 # -> { "execute": "migrate-continue" , "arguments":
932 #      { "state": "pre-switchover" } }
933 # <- { "return": {} }
935 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
938 # @migrate_set_downtime:
940 # Set maximum tolerated downtime for migration.
942 # @value: maximum downtime in seconds
944 # Returns: nothing on success
946 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
948 # Since: 0.14.0
950 # Example:
952 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
953 # <- { "return": {} }
956 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
959 # @migrate_set_speed:
961 # Set maximum speed for migration.
963 # @value: maximum speed in bytes per second.
965 # Returns: nothing on success
967 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
969 # Since: 0.14.0
971 # Example:
973 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
974 # <- { "return": {} }
977 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
980 # @migrate-set-cache-size:
982 # Set cache size to be used by XBZRLE migration
984 # @value: cache size in bytes
986 # The size will be rounded down to the nearest power of 2.
987 # The cache size can be modified before and during ongoing migration
989 # Returns: nothing on success
991 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
993 # Since: 1.2
995 # Example:
997 # -> { "execute": "migrate-set-cache-size",
998 #      "arguments": { "value": 536870912 } }
999 # <- { "return": {} }
1002 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1005 # @query-migrate-cache-size:
1007 # Query migration XBZRLE cache size
1009 # Returns: XBZRLE cache size in bytes
1011 # Notes: This command is deprecated in favor of 'query-migrate-parameters'
1013 # Since: 1.2
1015 # Example:
1017 # -> { "execute": "query-migrate-cache-size" }
1018 # <- { "return": 67108864 }
1021 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1024 # @migrate:
1026 # Migrates the current running guest to another Virtual Machine.
1028 # @uri: the Uniform Resource Identifier of the destination VM
1030 # @blk: do block migration (full disk copy)
1032 # @inc: incremental disk copy migration
1034 # @detach: this argument exists only for compatibility reasons and
1035 #          is ignored by QEMU
1037 # @resume: resume one paused migration, default "off". (since 3.0)
1039 # Returns: nothing on success
1041 # Since: 0.14.0
1043 # Notes:
1045 # 1. The 'query-migrate' command should be used to check migration's progress
1046 #    and final result (this information is provided by the 'status' member)
1048 # 2. All boolean arguments default to false
1050 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1051 #    be used
1053 # Example:
1055 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1056 # <- { "return": {} }
1059 { 'command': 'migrate',
1060   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1061            '*detach': 'bool', '*resume': 'bool' } }
1064 # @migrate-incoming:
1066 # Start an incoming migration, the qemu must have been started
1067 # with -incoming defer
1069 # @uri: The Uniform Resource Identifier identifying the source or
1070 #       address to listen on
1072 # Returns: nothing on success
1074 # Since: 2.3
1076 # Notes:
1078 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1079 #    compatible with -incoming and the format of the uri is already exposed
1080 #    above libvirt.
1082 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1083 #    be used.
1085 # 3. The uri format is the same as for -incoming
1087 # Example:
1089 # -> { "execute": "migrate-incoming",
1090 #      "arguments": { "uri": "tcp::4446" } }
1091 # <- { "return": {} }
1094 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1097 # @xen-save-devices-state:
1099 # Save the state of all devices to file. The RAM and the block devices
1100 # of the VM are not saved by this command.
1102 # @filename: the file to save the state of the devices to as binary
1103 # data. See xen-save-devices-state.txt for a description of the binary
1104 # format.
1106 # @live: Optional argument to ask QEMU to treat this command as part of a live
1107 # migration. Default to true. (since 2.11)
1109 # Returns: Nothing on success
1111 # Since: 1.1
1113 # Example:
1115 # -> { "execute": "xen-save-devices-state",
1116 #      "arguments": { "filename": "/tmp/save" } }
1117 # <- { "return": {} }
1120 { 'command': 'xen-save-devices-state',
1121   'data': {'filename': 'str', '*live':'bool' } }
1124 # @xen-set-replication:
1126 # Enable or disable replication.
1128 # @enable: true to enable, false to disable.
1130 # @primary: true for primary or false for secondary.
1132 # @failover: true to do failover, false to stop. but cannot be
1133 #            specified if 'enable' is true. default value is false.
1135 # Returns: nothing.
1137 # Example:
1139 # -> { "execute": "xen-set-replication",
1140 #      "arguments": {"enable": true, "primary": false} }
1141 # <- { "return": {} }
1143 # Since: 2.9
1145 { 'command': 'xen-set-replication',
1146   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
1149 # @ReplicationStatus:
1151 # The result format for 'query-xen-replication-status'.
1153 # @error: true if an error happened, false if replication is normal.
1155 # @desc: the human readable error description string, when
1156 #        @error is 'true'.
1158 # Since: 2.9
1160 { 'struct': 'ReplicationStatus',
1161   'data': { 'error': 'bool', '*desc': 'str' } }
1164 # @query-xen-replication-status:
1166 # Query replication status while the vm is running.
1168 # Returns: A @ReplicationResult object showing the status.
1170 # Example:
1172 # -> { "execute": "query-xen-replication-status" }
1173 # <- { "return": { "error": false } }
1175 # Since: 2.9
1177 { 'command': 'query-xen-replication-status',
1178   'returns': 'ReplicationStatus' }
1181 # @xen-colo-do-checkpoint:
1183 # Xen uses this command to notify replication to trigger a checkpoint.
1185 # Returns: nothing.
1187 # Example:
1189 # -> { "execute": "xen-colo-do-checkpoint" }
1190 # <- { "return": {} }
1192 # Since: 2.9
1194 { 'command': 'xen-colo-do-checkpoint' }
1197 # @migrate-recover:
1199 # Provide a recovery migration stream URI.
1201 # @uri: the URI to be used for the recovery of migration stream.
1203 # Returns: nothing.
1205 # Example:
1207 # -> { "execute": "migrate-recover",
1208 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1209 # <- { "return": {} }
1211 # Since: 3.0
1213 { 'command': 'migrate-recover', 'data': { 'uri': 'str' },
1214   'allow-oob': true }
1217 # @migrate-pause:
1219 # Pause a migration.  Currently it only supports postcopy.
1221 # Returns: nothing.
1223 # Example:
1225 # -> { "execute": "migrate-pause" }
1226 # <- { "return": {} }
1228 # Since: 3.0
1230 { 'command': 'migrate-pause', 'allow-oob': true }