Merge remote-tracking branch 'remotes/kraxel/tags/seabios-1.12-20181120-pull-request...
[qemu/ar7.git] / qapi / migration.json
blob38d4c41d88c82e08c7509ceee14e5ebb94046b7e
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 # @multifd-bytes: The number of bytes sent through multifd (since 3.0)
44 # Since: 0.14.0
46 { 'struct': 'MigrationStats',
47   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
48            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
49            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
50            'mbps' : 'number', 'dirty-sync-count' : 'int',
51            'postcopy-requests' : 'int', 'page-size' : 'int',
52            'multifd-bytes' : 'uint64' } }
55 # @XBZRLECacheStats:
57 # Detailed XBZRLE migration cache statistics
59 # @cache-size: XBZRLE cache size
61 # @bytes: amount of bytes already transferred to the target VM
63 # @pages: amount of pages transferred to the target VM
65 # @cache-miss: number of cache miss
67 # @cache-miss-rate: rate of cache miss (since 2.1)
69 # @overflow: number of overflows
71 # Since: 1.2
73 { 'struct': 'XBZRLECacheStats',
74   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
75            'cache-miss': 'int', 'cache-miss-rate': 'number',
76            'overflow': 'int' } }
79 # @CompressionStats:
81 # Detailed migration compression statistics
83 # @pages: amount of pages compressed and transferred to the target VM
85 # @busy: count of times that no free thread was available to compress data
87 # @busy-rate: rate of thread busy
89 # @compressed-size: amount of bytes after compression
91 # @compression-rate: rate of compressed size
93 # Since: 3.1
95 { 'struct': 'CompressionStats',
96   'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
97            'compressed-size': 'int', 'compression-rate': 'number' } }
100 # @MigrationStatus:
102 # An enumeration of migration status.
104 # @none: no migration has ever happened.
106 # @setup: migration process has been initiated.
108 # @cancelling: in the process of cancelling migration.
110 # @cancelled: cancelling migration is finished.
112 # @active: in the process of doing migration.
114 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
116 # @postcopy-paused: during postcopy but paused. (since 3.0)
118 # @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
120 # @completed: migration is finished.
122 # @failed: some error occurred during migration process.
124 # @colo: VM is in the process of fault tolerance, VM can not get into this
125 #        state unless colo capability is enabled for migration. (since 2.8)
127 # @pre-switchover: Paused before device serialisation. (since 2.11)
129 # @device: During device serialisation when pause-before-switchover is enabled
130 #        (since 2.11)
132 # Since: 2.3
135 { 'enum': 'MigrationStatus',
136   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
137             'active', 'postcopy-active', 'postcopy-paused',
138             'postcopy-recover', 'completed', 'failed', 'colo',
139             'pre-switchover', 'device' ] }
142 # @MigrationInfo:
144 # Information about current migration process.
146 # @status: @MigrationStatus describing the current migration status.
147 #          If this field is not returned, no migration process
148 #          has been initiated
150 # @ram: @MigrationStats containing detailed migration
151 #       status, only returned if status is 'active' or
152 #       'completed'(since 1.2)
154 # @disk: @MigrationStats containing detailed disk migration
155 #        status, only returned if status is 'active' and it is a block
156 #        migration
158 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
159 #                migration statistics, only returned if XBZRLE feature is on and
160 #                status is 'active' or 'completed' (since 1.2)
162 # @total-time: total amount of milliseconds since migration started.
163 #        If migration has ended, it returns the total migration
164 #        time. (since 1.2)
166 # @downtime: only present when migration finishes correctly
167 #        total downtime in milliseconds for the guest.
168 #        (since 1.3)
170 # @expected-downtime: only present while migration is active
171 #        expected downtime in milliseconds for the guest in last walk
172 #        of the dirty bitmap. (since 1.3)
174 # @setup-time: amount of setup time in milliseconds _before_ the
175 #        iterations begin but _after_ the QMP command is issued. This is designed
176 #        to provide an accounting of any activities (such as RDMA pinning) which
177 #        may be expensive, but do not actually occur during the iterative
178 #        migration rounds themselves. (since 1.6)
180 # @cpu-throttle-percentage: percentage of time guest cpus are being
181 #        throttled during auto-converge. This is only present when auto-converge
182 #        has started throttling guest cpus. (Since 2.7)
184 # @error-desc: the human readable error description string, when
185 #              @status is 'failed'. Clients should not attempt to parse the
186 #              error strings. (Since 2.7)
188 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
189 #           live migration. This is only present when the postcopy-blocktime
190 #           migration capability is enabled. (Since 3.0)
192 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.  This is
193 #           only present when the postcopy-blocktime migration capability
194 #           is enabled. (Since 3.0)
196 # @compression: migration compression statistics, only returned if compression
197 #           feature is on and status is 'active' or 'completed' (Since 3.1)
199 # Since: 0.14.0
201 { 'struct': 'MigrationInfo',
202   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
203            '*disk': 'MigrationStats',
204            '*xbzrle-cache': 'XBZRLECacheStats',
205            '*total-time': 'int',
206            '*expected-downtime': 'int',
207            '*downtime': 'int',
208            '*setup-time': 'int',
209            '*cpu-throttle-percentage': 'int',
210            '*error-desc': 'str',
211            '*postcopy-blocktime' : 'uint32',
212            '*postcopy-vcpu-blocktime': ['uint32'],
213            '*compression': 'CompressionStats'} }
216 # @query-migrate:
218 # Returns information about current migration process. If migration
219 # is active there will be another json-object with RAM migration
220 # status and if block migration is active another one with block
221 # migration status.
223 # Returns: @MigrationInfo
225 # Since: 0.14.0
227 # Example:
229 # 1. Before the first migration
231 # -> { "execute": "query-migrate" }
232 # <- { "return": {} }
234 # 2. Migration is done and has succeeded
236 # -> { "execute": "query-migrate" }
237 # <- { "return": {
238 #         "status": "completed",
239 #         "total-time":12345,
240 #         "setup-time":12345,
241 #         "downtime":12345,
242 #         "ram":{
243 #           "transferred":123,
244 #           "remaining":123,
245 #           "total":246,
246 #           "duplicate":123,
247 #           "normal":123,
248 #           "normal-bytes":123456,
249 #           "dirty-sync-count":15
250 #         }
251 #      }
252 #    }
254 # 3. Migration is done and has failed
256 # -> { "execute": "query-migrate" }
257 # <- { "return": { "status": "failed" } }
259 # 4. Migration is being performed and is not a block migration:
261 # -> { "execute": "query-migrate" }
262 # <- {
263 #       "return":{
264 #          "status":"active",
265 #          "total-time":12345,
266 #          "setup-time":12345,
267 #          "expected-downtime":12345,
268 #          "ram":{
269 #             "transferred":123,
270 #             "remaining":123,
271 #             "total":246,
272 #             "duplicate":123,
273 #             "normal":123,
274 #             "normal-bytes":123456,
275 #             "dirty-sync-count":15
276 #          }
277 #       }
278 #    }
280 # 5. Migration is being performed and is a block migration:
282 # -> { "execute": "query-migrate" }
283 # <- {
284 #       "return":{
285 #          "status":"active",
286 #          "total-time":12345,
287 #          "setup-time":12345,
288 #          "expected-downtime":12345,
289 #          "ram":{
290 #             "total":1057024,
291 #             "remaining":1053304,
292 #             "transferred":3720,
293 #             "duplicate":123,
294 #             "normal":123,
295 #             "normal-bytes":123456,
296 #             "dirty-sync-count":15
297 #          },
298 #          "disk":{
299 #             "total":20971520,
300 #             "remaining":20880384,
301 #             "transferred":91136
302 #          }
303 #       }
304 #    }
306 # 6. Migration is being performed and XBZRLE is active:
308 # -> { "execute": "query-migrate" }
309 # <- {
310 #       "return":{
311 #          "status":"active",
312 #          "total-time":12345,
313 #          "setup-time":12345,
314 #          "expected-downtime":12345,
315 #          "ram":{
316 #             "total":1057024,
317 #             "remaining":1053304,
318 #             "transferred":3720,
319 #             "duplicate":10,
320 #             "normal":3333,
321 #             "normal-bytes":3412992,
322 #             "dirty-sync-count":15
323 #          },
324 #          "xbzrle-cache":{
325 #             "cache-size":67108864,
326 #             "bytes":20971520,
327 #             "pages":2444343,
328 #             "cache-miss":2244,
329 #             "cache-miss-rate":0.123,
330 #             "overflow":34434
331 #          }
332 #       }
333 #    }
336 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
339 # @MigrationCapability:
341 # Migration capabilities enumeration
343 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
344 #          This feature allows us to minimize migration traffic for certain work
345 #          loads, by sending compressed difference of the pages
347 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
348 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
349 #          Disabled by default. (since 2.0)
351 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
352 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
353 #          source and target VM to support this feature. To enable it is sufficient
354 #          to enable the capability on the source VM. The feature is disabled by
355 #          default. (since 1.6)
357 # @compress: Use multiple compression threads to accelerate live migration.
358 #          This feature can help to reduce the migration traffic, by sending
359 #          compressed pages. Please note that if compress and xbzrle are both
360 #          on, compress only takes effect in the ram bulk stage, after that,
361 #          it will be disabled and only xbzrle takes effect, this can help to
362 #          minimize migration traffic. The feature is disabled by default.
363 #          (since 2.4 )
365 # @events: generate events for each migration state change
366 #          (since 2.4 )
368 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
369 #          to speed up convergence of RAM migration. (since 1.6)
371 # @postcopy-ram: Start executing on the migration target before all of RAM has
372 #          been migrated, pulling the remaining pages along as needed. The
373 #          capacity must have the same setting on both source and target
374 #          or migration will not even start. NOTE: If the migration fails during
375 #          postcopy the VM will fail.  (since 2.6)
377 # @x-colo: If enabled, migration will never end, and the state of the VM on the
378 #        primary side will be migrated continuously to the VM on secondary
379 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
380 #        Non-stop Service. (since 2.8)
382 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
383 #        during postcopy-ram migration. (since 2.9)
385 # @block: If enabled, QEMU will also migrate the contents of all block
386 #          devices.  Default is disabled.  A possible alternative uses
387 #          mirror jobs to a builtin NBD server on the destination, which
388 #          offers more flexibility.
389 #          (Since 2.10)
391 # @return-path: If enabled, migration will use the return path even
392 #               for precopy. (since 2.10)
394 # @pause-before-switchover: Pause outgoing migration before serialising device
395 #          state and before disabling block IO (since 2.11)
397 # @x-multifd: Use more than one fd for migration (since 2.11)
399 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
400 #                 (since 2.12)
402 # @postcopy-blocktime: Calculate downtime for postcopy live migration
403 #                     (since 3.0)
405 # @late-block-activate: If enabled, the destination will not activate block
406 #           devices (and thus take locks) immediately at the end of migration.
407 #           (since 3.0)
409 # Since: 1.2
411 { 'enum': 'MigrationCapability',
412   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
413            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
414            'block', 'return-path', 'pause-before-switchover', 'x-multifd',
415            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate' ] }
418 # @MigrationCapabilityStatus:
420 # Migration capability information
422 # @capability: capability enum
424 # @state: capability state bool
426 # Since: 1.2
428 { 'struct': 'MigrationCapabilityStatus',
429   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
432 # @migrate-set-capabilities:
434 # Enable/Disable the following migration capabilities (like xbzrle)
436 # @capabilities: json array of capability modifications to make
438 # Since: 1.2
440 # Example:
442 # -> { "execute": "migrate-set-capabilities" , "arguments":
443 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
446 { 'command': 'migrate-set-capabilities',
447   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
450 # @query-migrate-capabilities:
452 # Returns information about the current migration capabilities status
454 # Returns: @MigrationCapabilitiesStatus
456 # Since: 1.2
458 # Example:
460 # -> { "execute": "query-migrate-capabilities" }
461 # <- { "return": [
462 #       {"state": false, "capability": "xbzrle"},
463 #       {"state": false, "capability": "rdma-pin-all"},
464 #       {"state": false, "capability": "auto-converge"},
465 #       {"state": false, "capability": "zero-blocks"},
466 #       {"state": false, "capability": "compress"},
467 #       {"state": true, "capability": "events"},
468 #       {"state": false, "capability": "postcopy-ram"},
469 #       {"state": false, "capability": "x-colo"}
470 #    ]}
473 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
476 # @MigrationParameter:
478 # Migration parameters enumeration
480 # @compress-level: Set the compression level to be used in live migration,
481 #          the compression level is an integer between 0 and 9, where 0 means
482 #          no compression, 1 means the best compression speed, and 9 means best
483 #          compression ratio which will consume more CPU.
485 # @compress-threads: Set compression thread count to be used in live migration,
486 #          the compression thread count is an integer between 1 and 255.
488 # @compress-wait-thread: Controls behavior when all compression threads are
489 #                        currently busy. If true (default), wait for a free
490 #                        compression thread to become available; otherwise,
491 #                        send the page uncompressed. (Since 3.1)
493 # @decompress-threads: Set decompression thread count to be used in live
494 #          migration, the decompression thread count is an integer between 1
495 #          and 255. Usually, decompression is at least 4 times as fast as
496 #          compression, so set the decompress-threads to the number about 1/4
497 #          of compress-threads is adequate.
499 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
500 #                        when migration auto-converge is activated. The
501 #                        default value is 20. (Since 2.7)
503 # @cpu-throttle-increment: throttle percentage increase each time
504 #                          auto-converge detects that migration is not making
505 #                          progress. The default value is 10. (Since 2.7)
507 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
508 #             establishing a TLS connection over the migration data channel.
509 #             On the outgoing side of the migration, the credentials must
510 #             be for a 'client' endpoint, while for the incoming side the
511 #             credentials must be for a 'server' endpoint. Setting this
512 #             will enable TLS for all migrations. The default is unset,
513 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
515 # @tls-hostname: hostname of the target host for the migration. This is
516 #                required when using x509 based TLS credentials and the
517 #                migration URI does not already include a hostname. For
518 #                example if using fd: or exec: based migration, the
519 #                hostname must be provided so that the server's x509
520 #                certificate identity can be validated. (Since 2.7)
522 # @max-bandwidth: to set maximum speed for migration. maximum speed in
523 #                 bytes per second. (Since 2.8)
525 # @downtime-limit: set maximum tolerated downtime for migration. maximum
526 #                  downtime in milliseconds (Since 2.8)
528 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
529 #          periodic mode. (Since 2.8)
531 # @block-incremental: Affects how much storage is migrated when the
532 #       block migration capability is enabled.  When false, the entire
533 #       storage backing chain is migrated into a flattened image at
534 #       the destination; when true, only the active qcow2 layer is
535 #       migrated and the destination must already have access to the
536 #       same backing chain as was used on the source.  (since 2.10)
538 # @x-multifd-channels: Number of channels used to migrate data in
539 #                     parallel. This is the same number that the
540 #                     number of sockets used for migration.  The
541 #                     default value is 2 (since 2.11)
543 # @x-multifd-page-count: Number of pages sent together to a thread.
544 #                        The default value is 16 (since 2.11)
546 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
547 #                     needs to be a multiple of the target page size
548 #                     and a power of 2
549 #                     (Since 2.11)
551 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
552 #                     Defaults to 0 (unlimited).  In bytes per second.
553 #                     (Since 3.0)
555 # @max-cpu-throttle: maximum cpu throttle percentage.
556 #                    Defaults to 99. (Since 3.1)
557 # Since: 2.4
559 { 'enum': 'MigrationParameter',
560   'data': ['compress-level', 'compress-threads', 'decompress-threads',
561            'compress-wait-thread',
562            'cpu-throttle-initial', 'cpu-throttle-increment',
563            'tls-creds', 'tls-hostname', 'max-bandwidth',
564            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
565            'x-multifd-channels', 'x-multifd-page-count',
566            'xbzrle-cache-size', 'max-postcopy-bandwidth',
567            'max-cpu-throttle' ] }
570 # @MigrateSetParameters:
572 # @compress-level: compression level
574 # @compress-threads: compression thread count
576 # @compress-wait-thread: Controls behavior when all compression threads are
577 #                        currently busy. If true (default), wait for a free
578 #                        compression thread to become available; otherwise,
579 #                        send the page uncompressed. (Since 3.1)
581 # @decompress-threads: decompression thread count
583 # @cpu-throttle-initial: Initial percentage of time guest cpus are
584 #                        throttled when migration auto-converge is activated.
585 #                        The default value is 20. (Since 2.7)
587 # @cpu-throttle-increment: throttle percentage increase each time
588 #                          auto-converge detects that migration is not making
589 #                          progress. The default value is 10. (Since 2.7)
591 # @tls-creds: ID of the 'tls-creds' object that provides credentials
592 #             for establishing a TLS connection over the migration data
593 #             channel. On the outgoing side of the migration, the credentials
594 #             must be for a 'client' endpoint, while for the incoming side the
595 #             credentials must be for a 'server' endpoint. Setting this
596 #             to a non-empty string enables TLS for all migrations.
597 #             An empty string means that QEMU will use plain text mode for
598 #             migration, rather than TLS (Since 2.9)
599 #             Previously (since 2.7), this was reported by omitting
600 #             tls-creds instead.
602 # @tls-hostname: hostname of the target host for the migration. This
603 #                is required when using x509 based TLS credentials and the
604 #                migration URI does not already include a hostname. For
605 #                example if using fd: or exec: based migration, the
606 #                hostname must be provided so that the server's x509
607 #                certificate identity can be validated. (Since 2.7)
608 #                An empty string means that QEMU will use the hostname
609 #                associated with the migration URI, if any. (Since 2.9)
610 #                Previously (since 2.7), this was reported by omitting
611 #                tls-hostname instead.
613 # @max-bandwidth: to set maximum speed for migration. maximum speed in
614 #                 bytes per second. (Since 2.8)
616 # @downtime-limit: set maximum tolerated downtime for migration. maximum
617 #                  downtime in milliseconds (Since 2.8)
619 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
621 # @block-incremental: Affects how much storage is migrated when the
622 #       block migration capability is enabled.  When false, the entire
623 #       storage backing chain is migrated into a flattened image at
624 #       the destination; when true, only the active qcow2 layer is
625 #       migrated and the destination must already have access to the
626 #       same backing chain as was used on the source.  (since 2.10)
628 # @x-multifd-channels: Number of channels used to migrate data in
629 #                     parallel. This is the same number that the
630 #                     number of sockets used for migration.  The
631 #                     default value is 2 (since 2.11)
633 # @x-multifd-page-count: Number of pages sent together to a thread.
634 #                        The default value is 16 (since 2.11)
636 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
637 #                     needs to be a multiple of the target page size
638 #                     and a power of 2
639 #                     (Since 2.11)
641 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
642 #                     Defaults to 0 (unlimited).  In bytes per second.
643 #                     (Since 3.0)
645 # @max-cpu-throttle: maximum cpu throttle percentage.
646 #                    The default value is 99. (Since 3.1)
648 # Since: 2.4
650 # TODO either fuse back into MigrationParameters, or make
651 # MigrationParameters members mandatory
652 { 'struct': 'MigrateSetParameters',
653   'data': { '*compress-level': 'int',
654             '*compress-threads': 'int',
655             '*compress-wait-thread': 'bool',
656             '*decompress-threads': 'int',
657             '*cpu-throttle-initial': 'int',
658             '*cpu-throttle-increment': 'int',
659             '*tls-creds': 'StrOrNull',
660             '*tls-hostname': 'StrOrNull',
661             '*max-bandwidth': 'int',
662             '*downtime-limit': 'int',
663             '*x-checkpoint-delay': 'int',
664             '*block-incremental': 'bool',
665             '*x-multifd-channels': 'int',
666             '*x-multifd-page-count': 'int',
667             '*xbzrle-cache-size': 'size',
668             '*max-postcopy-bandwidth': 'size',
669             '*max-cpu-throttle': 'int' } }
672 # @migrate-set-parameters:
674 # Set various migration parameters.
676 # Since: 2.4
678 # Example:
680 # -> { "execute": "migrate-set-parameters" ,
681 #      "arguments": { "compress-level": 1 } }
684 { 'command': 'migrate-set-parameters', 'boxed': true,
685   'data': 'MigrateSetParameters' }
688 # @MigrationParameters:
690 # The optional members aren't actually optional.
692 # @compress-level: compression level
694 # @compress-threads: compression thread count
696 # @compress-wait-thread: Controls behavior when all compression threads are
697 #                        currently busy. If true (default), wait for a free
698 #                        compression thread to become available; otherwise,
699 #                        send the page uncompressed. (Since 3.1)
701 # @decompress-threads: decompression thread count
703 # @cpu-throttle-initial: Initial percentage of time guest cpus are
704 #                        throttled when migration auto-converge is activated.
705 #                        (Since 2.7)
707 # @cpu-throttle-increment: throttle percentage increase each time
708 #                          auto-converge detects that migration is not making
709 #                          progress. (Since 2.7)
711 # @tls-creds: ID of the 'tls-creds' object that provides credentials
712 #             for establishing a TLS connection over the migration data
713 #             channel. On the outgoing side of the migration, the credentials
714 #             must be for a 'client' endpoint, while for the incoming side the
715 #             credentials must be for a 'server' endpoint.
716 #             An empty string means that QEMU will use plain text mode for
717 #             migration, rather than TLS (Since 2.7)
718 #             Note: 2.8 reports this by omitting tls-creds instead.
720 # @tls-hostname: hostname of the target host for the migration. This
721 #                is required when using x509 based TLS credentials and the
722 #                migration URI does not already include a hostname. For
723 #                example if using fd: or exec: based migration, the
724 #                hostname must be provided so that the server's x509
725 #                certificate identity can be validated. (Since 2.7)
726 #                An empty string means that QEMU will use the hostname
727 #                associated with the migration URI, if any. (Since 2.9)
728 #                Note: 2.8 reports this by omitting tls-hostname instead.
730 # @max-bandwidth: to set maximum speed for migration. maximum speed in
731 #                 bytes per second. (Since 2.8)
733 # @downtime-limit: set maximum tolerated downtime for migration. maximum
734 #                  downtime in milliseconds (Since 2.8)
736 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
738 # @block-incremental: Affects how much storage is migrated when the
739 #       block migration capability is enabled.  When false, the entire
740 #       storage backing chain is migrated into a flattened image at
741 #       the destination; when true, only the active qcow2 layer is
742 #       migrated and the destination must already have access to the
743 #       same backing chain as was used on the source.  (since 2.10)
745 # @x-multifd-channels: Number of channels used to migrate data in
746 #                     parallel. This is the same number that the
747 #                     number of sockets used for migration.
748 #                     The default value is 2 (since 2.11)
750 # @x-multifd-page-count: Number of pages sent together to a thread.
751 #                        The default value is 16 (since 2.11)
753 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
754 #                     needs to be a multiple of the target page size
755 #                     and a power of 2
756 #                     (Since 2.11)
758 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
759 #                     Defaults to 0 (unlimited).  In bytes per second.
760 #                     (Since 3.0)
762 # @max-cpu-throttle: maximum cpu throttle percentage.
763 #                    Defaults to 99.
764 #                     (Since 3.1)
766 # Since: 2.4
768 { 'struct': 'MigrationParameters',
769   'data': { '*compress-level': 'uint8',
770             '*compress-threads': 'uint8',
771             '*compress-wait-thread': 'bool',
772             '*decompress-threads': 'uint8',
773             '*cpu-throttle-initial': 'uint8',
774             '*cpu-throttle-increment': 'uint8',
775             '*tls-creds': 'str',
776             '*tls-hostname': 'str',
777             '*max-bandwidth': 'size',
778             '*downtime-limit': 'uint64',
779             '*x-checkpoint-delay': 'uint32',
780             '*block-incremental': 'bool' ,
781             '*x-multifd-channels': 'uint8',
782             '*x-multifd-page-count': 'uint32',
783             '*xbzrle-cache-size': 'size',
784             '*max-postcopy-bandwidth': 'size',
785             '*max-cpu-throttle':'uint8'} }
788 # @query-migrate-parameters:
790 # Returns information about the current migration parameters
792 # Returns: @MigrationParameters
794 # Since: 2.4
796 # Example:
798 # -> { "execute": "query-migrate-parameters" }
799 # <- { "return": {
800 #          "decompress-threads": 2,
801 #          "cpu-throttle-increment": 10,
802 #          "compress-threads": 8,
803 #          "compress-level": 1,
804 #          "cpu-throttle-initial": 20,
805 #          "max-bandwidth": 33554432,
806 #          "downtime-limit": 300
807 #       }
808 #    }
811 { 'command': 'query-migrate-parameters',
812   'returns': 'MigrationParameters' }
815 # @client_migrate_info:
817 # Set migration information for remote display.  This makes the server
818 # ask the client to automatically reconnect using the new parameters
819 # once migration finished successfully.  Only implemented for SPICE.
821 # @protocol:     must be "spice"
822 # @hostname:     migration target hostname
823 # @port:         spice tcp port for plaintext channels
824 # @tls-port:     spice tcp port for tls-secured channels
825 # @cert-subject: server certificate subject
827 # Since: 0.14.0
829 # Example:
831 # -> { "execute": "client_migrate_info",
832 #      "arguments": { "protocol": "spice",
833 #                     "hostname": "virt42.lab.kraxel.org",
834 #                     "port": 1234 } }
835 # <- { "return": {} }
838 { 'command': 'client_migrate_info',
839   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
840             '*tls-port': 'int', '*cert-subject': 'str' } }
843 # @migrate-start-postcopy:
845 # Followup to a migration command to switch the migration to postcopy mode.
846 # The postcopy-ram capability must be set on both source and destination
847 # before the original migration command.
849 # Since: 2.5
851 # Example:
853 # -> { "execute": "migrate-start-postcopy" }
854 # <- { "return": {} }
857 { 'command': 'migrate-start-postcopy' }
860 # @MIGRATION:
862 # Emitted when a migration event happens
864 # @status: @MigrationStatus describing the current migration status.
866 # Since: 2.4
868 # Example:
870 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
871 #     "event": "MIGRATION",
872 #     "data": {"status": "completed"} }
875 { 'event': 'MIGRATION',
876   'data': {'status': 'MigrationStatus'}}
879 # @MIGRATION_PASS:
881 # Emitted from the source side of a migration at the start of each pass
882 # (when it syncs the dirty bitmap)
884 # @pass: An incrementing count (starting at 1 on the first pass)
886 # Since: 2.6
888 # Example:
890 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
891 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
894 { 'event': 'MIGRATION_PASS',
895   'data': { 'pass': 'int' } }
898 # @COLOMessage:
900 # The message transmission between Primary side and Secondary side.
902 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
904 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
906 # @checkpoint-reply: SVM gets PVM's checkpoint request
908 # @vmstate-send: VM's state will be sent by PVM.
910 # @vmstate-size: The total size of VMstate.
912 # @vmstate-received: VM's state has been received by SVM.
914 # @vmstate-loaded: VM's state has been loaded by SVM.
916 # Since: 2.8
918 { 'enum': 'COLOMessage',
919   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
920             'vmstate-send', 'vmstate-size', 'vmstate-received',
921             'vmstate-loaded' ] }
924 # @COLOMode:
926 # The COLO current mode.
928 # @none: COLO is disabled.
930 # @primary: COLO node in primary side.
932 # @secondary: COLO node in slave side.
934 # Since: 2.8
936 { 'enum': 'COLOMode',
937   'data': [ 'none', 'primary', 'secondary'] }
940 # @FailoverStatus:
942 # An enumeration of COLO failover status
944 # @none: no failover has ever happened
946 # @require: got failover requirement but not handled
948 # @active: in the process of doing failover
950 # @completed: finish the process of failover
952 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
954 # Since: 2.8
956 { 'enum': 'FailoverStatus',
957   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
960 # @COLO_EXIT:
962 # Emitted when VM finishes COLO mode due to some errors happening or
963 # at the request of users.
965 # @mode: report COLO mode when COLO exited.
967 # @reason: describes the reason for the COLO exit.
969 # Since: 3.1
971 # Example:
973 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
974 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
977 { 'event': 'COLO_EXIT',
978   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
981 # @COLOExitReason:
983 # The reason for a COLO exit
985 # @none: no failover has ever happened. This can't occur in the
986 # COLO_EXIT event, only in the result of query-colo-status.
988 # @request: COLO exit is due to an external request
990 # @error: COLO exit is due to an internal error
992 # Since: 3.1
994 { 'enum': 'COLOExitReason',
995   'data': [ 'none', 'request', 'error' ] }
998 # @x-colo-lost-heartbeat:
1000 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1001 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1002 # If sent to the Secondary, the Secondary side will run failover work,
1003 # then takes over server operation to become the service VM.
1005 # Since: 2.8
1007 # Example:
1009 # -> { "execute": "x-colo-lost-heartbeat" }
1010 # <- { "return": {} }
1013 { 'command': 'x-colo-lost-heartbeat' }
1016 # @migrate_cancel:
1018 # Cancel the current executing migration process.
1020 # Returns: nothing on success
1022 # Notes: This command succeeds even if there is no migration process running.
1024 # Since: 0.14.0
1026 # Example:
1028 # -> { "execute": "migrate_cancel" }
1029 # <- { "return": {} }
1032 { 'command': 'migrate_cancel' }
1035 # @migrate-continue:
1037 # Continue migration when it's in a paused state.
1039 # @state: The state the migration is currently expected to be in
1041 # Returns: nothing on success
1042 # Since: 2.11
1043 # Example:
1045 # -> { "execute": "migrate-continue" , "arguments":
1046 #      { "state": "pre-switchover" } }
1047 # <- { "return": {} }
1049 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1052 # @migrate_set_downtime:
1054 # Set maximum tolerated downtime for migration.
1056 # @value: maximum downtime in seconds
1058 # Returns: nothing on success
1060 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1062 # Since: 0.14.0
1064 # Example:
1066 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1067 # <- { "return": {} }
1070 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1073 # @migrate_set_speed:
1075 # Set maximum speed for migration.
1077 # @value: maximum speed in bytes per second.
1079 # Returns: nothing on success
1081 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1083 # Since: 0.14.0
1085 # Example:
1087 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1088 # <- { "return": {} }
1091 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1094 # @migrate-set-cache-size:
1096 # Set cache size to be used by XBZRLE migration
1098 # @value: cache size in bytes
1100 # The size will be rounded down to the nearest power of 2.
1101 # The cache size can be modified before and during ongoing migration
1103 # Returns: nothing on success
1105 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1107 # Since: 1.2
1109 # Example:
1111 # -> { "execute": "migrate-set-cache-size",
1112 #      "arguments": { "value": 536870912 } }
1113 # <- { "return": {} }
1116 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1119 # @query-migrate-cache-size:
1121 # Query migration XBZRLE cache size
1123 # Returns: XBZRLE cache size in bytes
1125 # Notes: This command is deprecated in favor of 'query-migrate-parameters'
1127 # Since: 1.2
1129 # Example:
1131 # -> { "execute": "query-migrate-cache-size" }
1132 # <- { "return": 67108864 }
1135 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1138 # @migrate:
1140 # Migrates the current running guest to another Virtual Machine.
1142 # @uri: the Uniform Resource Identifier of the destination VM
1144 # @blk: do block migration (full disk copy)
1146 # @inc: incremental disk copy migration
1148 # @detach: this argument exists only for compatibility reasons and
1149 #          is ignored by QEMU
1151 # @resume: resume one paused migration, default "off". (since 3.0)
1153 # Returns: nothing on success
1155 # Since: 0.14.0
1157 # Notes:
1159 # 1. The 'query-migrate' command should be used to check migration's progress
1160 #    and final result (this information is provided by the 'status' member)
1162 # 2. All boolean arguments default to false
1164 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1165 #    be used
1167 # Example:
1169 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1170 # <- { "return": {} }
1173 { 'command': 'migrate',
1174   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1175            '*detach': 'bool', '*resume': 'bool' } }
1178 # @migrate-incoming:
1180 # Start an incoming migration, the qemu must have been started
1181 # with -incoming defer
1183 # @uri: The Uniform Resource Identifier identifying the source or
1184 #       address to listen on
1186 # Returns: nothing on success
1188 # Since: 2.3
1190 # Notes:
1192 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1193 #    compatible with -incoming and the format of the uri is already exposed
1194 #    above libvirt.
1196 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1197 #    be used.
1199 # 3. The uri format is the same as for -incoming
1201 # Example:
1203 # -> { "execute": "migrate-incoming",
1204 #      "arguments": { "uri": "tcp::4446" } }
1205 # <- { "return": {} }
1208 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1211 # @xen-save-devices-state:
1213 # Save the state of all devices to file. The RAM and the block devices
1214 # of the VM are not saved by this command.
1216 # @filename: the file to save the state of the devices to as binary
1217 # data. See xen-save-devices-state.txt for a description of the binary
1218 # format.
1220 # @live: Optional argument to ask QEMU to treat this command as part of a live
1221 # migration. Default to true. (since 2.11)
1223 # Returns: Nothing on success
1225 # Since: 1.1
1227 # Example:
1229 # -> { "execute": "xen-save-devices-state",
1230 #      "arguments": { "filename": "/tmp/save" } }
1231 # <- { "return": {} }
1234 { 'command': 'xen-save-devices-state',
1235   'data': {'filename': 'str', '*live':'bool' } }
1238 # @xen-set-replication:
1240 # Enable or disable replication.
1242 # @enable: true to enable, false to disable.
1244 # @primary: true for primary or false for secondary.
1246 # @failover: true to do failover, false to stop. but cannot be
1247 #            specified if 'enable' is true. default value is false.
1249 # Returns: nothing.
1251 # Example:
1253 # -> { "execute": "xen-set-replication",
1254 #      "arguments": {"enable": true, "primary": false} }
1255 # <- { "return": {} }
1257 # Since: 2.9
1259 { 'command': 'xen-set-replication',
1260   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
1263 # @ReplicationStatus:
1265 # The result format for 'query-xen-replication-status'.
1267 # @error: true if an error happened, false if replication is normal.
1269 # @desc: the human readable error description string, when
1270 #        @error is 'true'.
1272 # Since: 2.9
1274 { 'struct': 'ReplicationStatus',
1275   'data': { 'error': 'bool', '*desc': 'str' } }
1278 # @query-xen-replication-status:
1280 # Query replication status while the vm is running.
1282 # Returns: A @ReplicationResult object showing the status.
1284 # Example:
1286 # -> { "execute": "query-xen-replication-status" }
1287 # <- { "return": { "error": false } }
1289 # Since: 2.9
1291 { 'command': 'query-xen-replication-status',
1292   'returns': 'ReplicationStatus' }
1295 # @xen-colo-do-checkpoint:
1297 # Xen uses this command to notify replication to trigger a checkpoint.
1299 # Returns: nothing.
1301 # Example:
1303 # -> { "execute": "xen-colo-do-checkpoint" }
1304 # <- { "return": {} }
1306 # Since: 2.9
1308 { 'command': 'xen-colo-do-checkpoint' }
1311 # @COLOStatus:
1313 # The result format for 'query-colo-status'.
1315 # @mode: COLO running mode. If COLO is running, this field will return
1316 #        'primary' or 'secondary'.
1318 # @reason: describes the reason for the COLO exit.
1320 # Since: 3.1
1322 { 'struct': 'COLOStatus',
1323   'data': { 'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1326 # @query-colo-status:
1328 # Query COLO status while the vm is running.
1330 # Returns: A @COLOStatus object showing the status.
1332 # Example:
1334 # -> { "execute": "query-colo-status" }
1335 # <- { "return": { "mode": "primary", "active": true, "reason": "request" } }
1337 # Since: 3.1
1339 { 'command': 'query-colo-status',
1340   'returns': 'COLOStatus' }
1343 # @migrate-recover:
1345 # Provide a recovery migration stream URI.
1347 # @uri: the URI to be used for the recovery of migration stream.
1349 # Returns: nothing.
1351 # Example:
1353 # -> { "execute": "migrate-recover",
1354 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1355 # <- { "return": {} }
1357 # Since: 3.0
1359 { 'command': 'migrate-recover', 'data': { 'uri': 'str' },
1360   'allow-oob': true }
1363 # @migrate-pause:
1365 # Pause a migration.  Currently it only supports postcopy.
1367 # Returns: nothing.
1369 # Example:
1371 # -> { "execute": "migrate-pause" }
1372 # <- { "return": {} }
1374 # Since: 3.0
1376 { 'command': 'migrate-pause', 'allow-oob': true }