Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
[qemu/ar7.git] / qapi / migration.json
blob1fd7bbea9b05c4fd3de431993b551d31390cfb9f
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 # @pages-per-second: the number of memory pages transferred per second
45 #        (Since 4.0)
47 # Since: 0.14.0
49 { 'struct': 'MigrationStats',
50   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
51            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
52            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
53            'mbps' : 'number', 'dirty-sync-count' : 'int',
54            'postcopy-requests' : 'int', 'page-size' : 'int',
55            'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64' } }
58 # @XBZRLECacheStats:
60 # Detailed XBZRLE migration cache statistics
62 # @cache-size: XBZRLE cache size
64 # @bytes: amount of bytes already transferred to the target VM
66 # @pages: amount of pages transferred to the target VM
68 # @cache-miss: number of cache miss
70 # @cache-miss-rate: rate of cache miss (since 2.1)
72 # @overflow: number of overflows
74 # Since: 1.2
76 { 'struct': 'XBZRLECacheStats',
77   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
78            'cache-miss': 'int', 'cache-miss-rate': 'number',
79            'overflow': 'int' } }
82 # @CompressionStats:
84 # Detailed migration compression statistics
86 # @pages: amount of pages compressed and transferred to the target VM
88 # @busy: count of times that no free thread was available to compress data
90 # @busy-rate: rate of thread busy
92 # @compressed-size: amount of bytes after compression
94 # @compression-rate: rate of compressed size
96 # Since: 3.1
98 { 'struct': 'CompressionStats',
99   'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
100            'compressed-size': 'int', 'compression-rate': 'number' } }
103 # @MigrationStatus:
105 # An enumeration of migration status.
107 # @none: no migration has ever happened.
109 # @setup: migration process has been initiated.
111 # @cancelling: in the process of cancelling migration.
113 # @cancelled: cancelling migration is finished.
115 # @active: in the process of doing migration.
117 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
119 # @postcopy-paused: during postcopy but paused. (since 3.0)
121 # @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
123 # @completed: migration is finished.
125 # @failed: some error occurred during migration process.
127 # @colo: VM is in the process of fault tolerance, VM can not get into this
128 #        state unless colo capability is enabled for migration. (since 2.8)
130 # @pre-switchover: Paused before device serialisation. (since 2.11)
132 # @device: During device serialisation when pause-before-switchover is enabled
133 #        (since 2.11)
135 # Since: 2.3
138 { 'enum': 'MigrationStatus',
139   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
140             'active', 'postcopy-active', 'postcopy-paused',
141             'postcopy-recover', 'completed', 'failed', 'colo',
142             'pre-switchover', 'device' ] }
145 # @MigrationInfo:
147 # Information about current migration process.
149 # @status: @MigrationStatus describing the current migration status.
150 #          If this field is not returned, no migration process
151 #          has been initiated
153 # @ram: @MigrationStats containing detailed migration
154 #       status, only returned if status is 'active' or
155 #       'completed'(since 1.2)
157 # @disk: @MigrationStats containing detailed disk migration
158 #        status, only returned if status is 'active' and it is a block
159 #        migration
161 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
162 #                migration statistics, only returned if XBZRLE feature is on and
163 #                status is 'active' or 'completed' (since 1.2)
165 # @total-time: total amount of milliseconds since migration started.
166 #        If migration has ended, it returns the total migration
167 #        time. (since 1.2)
169 # @downtime: only present when migration finishes correctly
170 #        total downtime in milliseconds for the guest.
171 #        (since 1.3)
173 # @expected-downtime: only present while migration is active
174 #        expected downtime in milliseconds for the guest in last walk
175 #        of the dirty bitmap. (since 1.3)
177 # @setup-time: amount of setup time in milliseconds _before_ the
178 #        iterations begin but _after_ the QMP command is issued. This is designed
179 #        to provide an accounting of any activities (such as RDMA pinning) which
180 #        may be expensive, but do not actually occur during the iterative
181 #        migration rounds themselves. (since 1.6)
183 # @cpu-throttle-percentage: percentage of time guest cpus are being
184 #        throttled during auto-converge. This is only present when auto-converge
185 #        has started throttling guest cpus. (Since 2.7)
187 # @error-desc: the human readable error description string, when
188 #              @status is 'failed'. Clients should not attempt to parse the
189 #              error strings. (Since 2.7)
191 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
192 #           live migration. This is only present when the postcopy-blocktime
193 #           migration capability is enabled. (Since 3.0)
195 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.  This is
196 #           only present when the postcopy-blocktime migration capability
197 #           is enabled. (Since 3.0)
199 # @compression: migration compression statistics, only returned if compression
200 #           feature is on and status is 'active' or 'completed' (Since 3.1)
202 # Since: 0.14.0
204 { 'struct': 'MigrationInfo',
205   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
206            '*disk': 'MigrationStats',
207            '*xbzrle-cache': 'XBZRLECacheStats',
208            '*total-time': 'int',
209            '*expected-downtime': 'int',
210            '*downtime': 'int',
211            '*setup-time': 'int',
212            '*cpu-throttle-percentage': 'int',
213            '*error-desc': 'str',
214            '*postcopy-blocktime' : 'uint32',
215            '*postcopy-vcpu-blocktime': ['uint32'],
216            '*compression': 'CompressionStats'} }
219 # @query-migrate:
221 # Returns information about current migration process. If migration
222 # is active there will be another json-object with RAM migration
223 # status and if block migration is active another one with block
224 # migration status.
226 # Returns: @MigrationInfo
228 # Since: 0.14.0
230 # Example:
232 # 1. Before the first migration
234 # -> { "execute": "query-migrate" }
235 # <- { "return": {} }
237 # 2. Migration is done and has succeeded
239 # -> { "execute": "query-migrate" }
240 # <- { "return": {
241 #         "status": "completed",
242 #         "total-time":12345,
243 #         "setup-time":12345,
244 #         "downtime":12345,
245 #         "ram":{
246 #           "transferred":123,
247 #           "remaining":123,
248 #           "total":246,
249 #           "duplicate":123,
250 #           "normal":123,
251 #           "normal-bytes":123456,
252 #           "dirty-sync-count":15
253 #         }
254 #      }
255 #    }
257 # 3. Migration is done and has failed
259 # -> { "execute": "query-migrate" }
260 # <- { "return": { "status": "failed" } }
262 # 4. Migration is being performed and is not a block migration:
264 # -> { "execute": "query-migrate" }
265 # <- {
266 #       "return":{
267 #          "status":"active",
268 #          "total-time":12345,
269 #          "setup-time":12345,
270 #          "expected-downtime":12345,
271 #          "ram":{
272 #             "transferred":123,
273 #             "remaining":123,
274 #             "total":246,
275 #             "duplicate":123,
276 #             "normal":123,
277 #             "normal-bytes":123456,
278 #             "dirty-sync-count":15
279 #          }
280 #       }
281 #    }
283 # 5. Migration is being performed and is a block migration:
285 # -> { "execute": "query-migrate" }
286 # <- {
287 #       "return":{
288 #          "status":"active",
289 #          "total-time":12345,
290 #          "setup-time":12345,
291 #          "expected-downtime":12345,
292 #          "ram":{
293 #             "total":1057024,
294 #             "remaining":1053304,
295 #             "transferred":3720,
296 #             "duplicate":123,
297 #             "normal":123,
298 #             "normal-bytes":123456,
299 #             "dirty-sync-count":15
300 #          },
301 #          "disk":{
302 #             "total":20971520,
303 #             "remaining":20880384,
304 #             "transferred":91136
305 #          }
306 #       }
307 #    }
309 # 6. Migration is being performed and XBZRLE is active:
311 # -> { "execute": "query-migrate" }
312 # <- {
313 #       "return":{
314 #          "status":"active",
315 #          "total-time":12345,
316 #          "setup-time":12345,
317 #          "expected-downtime":12345,
318 #          "ram":{
319 #             "total":1057024,
320 #             "remaining":1053304,
321 #             "transferred":3720,
322 #             "duplicate":10,
323 #             "normal":3333,
324 #             "normal-bytes":3412992,
325 #             "dirty-sync-count":15
326 #          },
327 #          "xbzrle-cache":{
328 #             "cache-size":67108864,
329 #             "bytes":20971520,
330 #             "pages":2444343,
331 #             "cache-miss":2244,
332 #             "cache-miss-rate":0.123,
333 #             "overflow":34434
334 #          }
335 #       }
336 #    }
339 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
342 # @MigrationCapability:
344 # Migration capabilities enumeration
346 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
347 #          This feature allows us to minimize migration traffic for certain work
348 #          loads, by sending compressed difference of the pages
350 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
351 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
352 #          Disabled by default. (since 2.0)
354 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
355 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
356 #          source and target VM to support this feature. To enable it is sufficient
357 #          to enable the capability on the source VM. The feature is disabled by
358 #          default. (since 1.6)
360 # @compress: Use multiple compression threads to accelerate live migration.
361 #          This feature can help to reduce the migration traffic, by sending
362 #          compressed pages. Please note that if compress and xbzrle are both
363 #          on, compress only takes effect in the ram bulk stage, after that,
364 #          it will be disabled and only xbzrle takes effect, this can help to
365 #          minimize migration traffic. The feature is disabled by default.
366 #          (since 2.4 )
368 # @events: generate events for each migration state change
369 #          (since 2.4 )
371 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
372 #          to speed up convergence of RAM migration. (since 1.6)
374 # @postcopy-ram: Start executing on the migration target before all of RAM has
375 #          been migrated, pulling the remaining pages along as needed. The
376 #          capacity must have the same setting on both source and target
377 #          or migration will not even start. NOTE: If the migration fails during
378 #          postcopy the VM will fail.  (since 2.6)
380 # @x-colo: If enabled, migration will never end, and the state of the VM on the
381 #        primary side will be migrated continuously to the VM on secondary
382 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
383 #        Non-stop Service. (since 2.8)
385 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
386 #        during postcopy-ram migration. (since 2.9)
388 # @block: If enabled, QEMU will also migrate the contents of all block
389 #          devices.  Default is disabled.  A possible alternative uses
390 #          mirror jobs to a builtin NBD server on the destination, which
391 #          offers more flexibility.
392 #          (Since 2.10)
394 # @return-path: If enabled, migration will use the return path even
395 #               for precopy. (since 2.10)
397 # @pause-before-switchover: Pause outgoing migration before serialising device
398 #          state and before disabling block IO (since 2.11)
400 # @x-multifd: Use more than one fd for migration (since 2.11)
402 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
403 #                 (since 2.12)
405 # @postcopy-blocktime: Calculate downtime for postcopy live migration
406 #                     (since 3.0)
408 # @late-block-activate: If enabled, the destination will not activate block
409 #           devices (and thus take locks) immediately at the end of migration.
410 #           (since 3.0)
412 # Since: 1.2
414 { 'enum': 'MigrationCapability',
415   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
416            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
417            'block', 'return-path', 'pause-before-switchover', 'x-multifd',
418            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate' ] }
421 # @MigrationCapabilityStatus:
423 # Migration capability information
425 # @capability: capability enum
427 # @state: capability state bool
429 # Since: 1.2
431 { 'struct': 'MigrationCapabilityStatus',
432   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
435 # @migrate-set-capabilities:
437 # Enable/Disable the following migration capabilities (like xbzrle)
439 # @capabilities: json array of capability modifications to make
441 # Since: 1.2
443 # Example:
445 # -> { "execute": "migrate-set-capabilities" , "arguments":
446 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
449 { 'command': 'migrate-set-capabilities',
450   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
453 # @query-migrate-capabilities:
455 # Returns information about the current migration capabilities status
457 # Returns: @MigrationCapabilitiesStatus
459 # Since: 1.2
461 # Example:
463 # -> { "execute": "query-migrate-capabilities" }
464 # <- { "return": [
465 #       {"state": false, "capability": "xbzrle"},
466 #       {"state": false, "capability": "rdma-pin-all"},
467 #       {"state": false, "capability": "auto-converge"},
468 #       {"state": false, "capability": "zero-blocks"},
469 #       {"state": false, "capability": "compress"},
470 #       {"state": true, "capability": "events"},
471 #       {"state": false, "capability": "postcopy-ram"},
472 #       {"state": false, "capability": "x-colo"}
473 #    ]}
476 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
479 # @MigrationParameter:
481 # Migration parameters enumeration
483 # @announce-initial: Initial delay (in milliseconds) before sending the first
484 #          announce (Since 4.0)
486 # @announce-max: Maximum delay (in milliseconds) between packets in the
487 #          announcement (Since 4.0)
489 # @announce-rounds: Number of self-announce packets sent after migration
490 #          (Since 4.0)
492 # @announce-step: Increase in delay (in milliseconds) between subsequent
493 #          packets in the announcement (Since 4.0)
495 # @compress-level: Set the compression level to be used in live migration,
496 #          the compression level is an integer between 0 and 9, where 0 means
497 #          no compression, 1 means the best compression speed, and 9 means best
498 #          compression ratio which will consume more CPU.
500 # @compress-threads: Set compression thread count to be used in live migration,
501 #          the compression thread count is an integer between 1 and 255.
503 # @compress-wait-thread: Controls behavior when all compression threads are
504 #                        currently busy. If true (default), wait for a free
505 #                        compression thread to become available; otherwise,
506 #                        send the page uncompressed. (Since 3.1)
508 # @decompress-threads: Set decompression thread count to be used in live
509 #          migration, the decompression thread count is an integer between 1
510 #          and 255. Usually, decompression is at least 4 times as fast as
511 #          compression, so set the decompress-threads to the number about 1/4
512 #          of compress-threads is adequate.
514 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
515 #                        when migration auto-converge is activated. The
516 #                        default value is 20. (Since 2.7)
518 # @cpu-throttle-increment: throttle percentage increase each time
519 #                          auto-converge detects that migration is not making
520 #                          progress. The default value is 10. (Since 2.7)
522 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
523 #             establishing a TLS connection over the migration data channel.
524 #             On the outgoing side of the migration, the credentials must
525 #             be for a 'client' endpoint, while for the incoming side the
526 #             credentials must be for a 'server' endpoint. Setting this
527 #             will enable TLS for all migrations. The default is unset,
528 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
530 # @tls-hostname: hostname of the target host for the migration. This is
531 #                required when using x509 based TLS credentials and the
532 #                migration URI does not already include a hostname. For
533 #                example if using fd: or exec: based migration, the
534 #                hostname must be provided so that the server's x509
535 #                certificate identity can be validated. (Since 2.7)
537 # @max-bandwidth: to set maximum speed for migration. maximum speed in
538 #                 bytes per second. (Since 2.8)
540 # @downtime-limit: set maximum tolerated downtime for migration. maximum
541 #                  downtime in milliseconds (Since 2.8)
543 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
544 #          periodic mode. (Since 2.8)
546 # @block-incremental: Affects how much storage is migrated when the
547 #       block migration capability is enabled.  When false, the entire
548 #       storage backing chain is migrated into a flattened image at
549 #       the destination; when true, only the active qcow2 layer is
550 #       migrated and the destination must already have access to the
551 #       same backing chain as was used on the source.  (since 2.10)
553 # @x-multifd-channels: Number of channels used to migrate data in
554 #                     parallel. This is the same number that the
555 #                     number of sockets used for migration.  The
556 #                     default value is 2 (since 2.11)
558 # @x-multifd-page-count: Number of pages sent together to a thread.
559 #                        The default value is 16 (since 2.11)
561 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
562 #                     needs to be a multiple of the target page size
563 #                     and a power of 2
564 #                     (Since 2.11)
566 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
567 #                     Defaults to 0 (unlimited).  In bytes per second.
568 #                     (Since 3.0)
570 # @max-cpu-throttle: maximum cpu throttle percentage.
571 #                    Defaults to 99. (Since 3.1)
573 # Since: 2.4
575 { 'enum': 'MigrationParameter',
576   'data': ['announce-initial', 'announce-max',
577            'announce-rounds', 'announce-step',
578            'compress-level', 'compress-threads', 'decompress-threads',
579            'compress-wait-thread',
580            'cpu-throttle-initial', 'cpu-throttle-increment',
581            'tls-creds', 'tls-hostname', 'max-bandwidth',
582            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
583            'x-multifd-channels', 'x-multifd-page-count',
584            'xbzrle-cache-size', 'max-postcopy-bandwidth',
585            'max-cpu-throttle' ] }
588 # @MigrateSetParameters:
590 # @announce-initial: Initial delay (in milliseconds) before sending the first
591 #          announce (Since 4.0)
593 # @announce-max: Maximum delay (in milliseconds) between packets in the
594 #          announcement (Since 4.0)
596 # @announce-rounds: Number of self-announce packets sent after migration
597 #          (Since 4.0)
599 # @announce-step: Increase in delay (in milliseconds) between subsequent
600 #          packets in the announcement (Since 4.0)
602 # @compress-level: compression level
604 # @compress-threads: compression thread count
606 # @compress-wait-thread: Controls behavior when all compression threads are
607 #                        currently busy. If true (default), wait for a free
608 #                        compression thread to become available; otherwise,
609 #                        send the page uncompressed. (Since 3.1)
611 # @decompress-threads: decompression thread count
613 # @cpu-throttle-initial: Initial percentage of time guest cpus are
614 #                        throttled when migration auto-converge is activated.
615 #                        The default value is 20. (Since 2.7)
617 # @cpu-throttle-increment: throttle percentage increase each time
618 #                          auto-converge detects that migration is not making
619 #                          progress. The default value is 10. (Since 2.7)
621 # @tls-creds: ID of the 'tls-creds' object that provides credentials
622 #             for establishing a TLS connection over the migration data
623 #             channel. On the outgoing side of the migration, the credentials
624 #             must be for a 'client' endpoint, while for the incoming side the
625 #             credentials must be for a 'server' endpoint. Setting this
626 #             to a non-empty string enables TLS for all migrations.
627 #             An empty string means that QEMU will use plain text mode for
628 #             migration, rather than TLS (Since 2.9)
629 #             Previously (since 2.7), this was reported by omitting
630 #             tls-creds instead.
632 # @tls-hostname: hostname of the target host for the migration. This
633 #                is required when using x509 based TLS credentials and the
634 #                migration URI does not already include a hostname. For
635 #                example if using fd: or exec: based migration, the
636 #                hostname must be provided so that the server's x509
637 #                certificate identity can be validated. (Since 2.7)
638 #                An empty string means that QEMU will use the hostname
639 #                associated with the migration URI, if any. (Since 2.9)
640 #                Previously (since 2.7), this was reported by omitting
641 #                tls-hostname instead.
643 # @max-bandwidth: to set maximum speed for migration. maximum speed in
644 #                 bytes per second. (Since 2.8)
646 # @downtime-limit: set maximum tolerated downtime for migration. maximum
647 #                  downtime in milliseconds (Since 2.8)
649 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
651 # @block-incremental: Affects how much storage is migrated when the
652 #       block migration capability is enabled.  When false, the entire
653 #       storage backing chain is migrated into a flattened image at
654 #       the destination; when true, only the active qcow2 layer is
655 #       migrated and the destination must already have access to the
656 #       same backing chain as was used on the source.  (since 2.10)
658 # @x-multifd-channels: Number of channels used to migrate data in
659 #                     parallel. This is the same number that the
660 #                     number of sockets used for migration.  The
661 #                     default value is 2 (since 2.11)
663 # @x-multifd-page-count: Number of pages sent together to a thread.
664 #                        The default value is 16 (since 2.11)
666 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
667 #                     needs to be a multiple of the target page size
668 #                     and a power of 2
669 #                     (Since 2.11)
671 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
672 #                     Defaults to 0 (unlimited).  In bytes per second.
673 #                     (Since 3.0)
675 # @max-cpu-throttle: maximum cpu throttle percentage.
676 #                    The default value is 99. (Since 3.1)
678 # Since: 2.4
680 # TODO either fuse back into MigrationParameters, or make
681 # MigrationParameters members mandatory
682 { 'struct': 'MigrateSetParameters',
683   'data': { '*announce-initial': 'size',
684             '*announce-max': 'size',
685             '*announce-rounds': 'size',
686             '*announce-step': 'size',
687             '*compress-level': 'int',
688             '*compress-threads': 'int',
689             '*compress-wait-thread': 'bool',
690             '*decompress-threads': 'int',
691             '*cpu-throttle-initial': 'int',
692             '*cpu-throttle-increment': 'int',
693             '*tls-creds': 'StrOrNull',
694             '*tls-hostname': 'StrOrNull',
695             '*max-bandwidth': 'int',
696             '*downtime-limit': 'int',
697             '*x-checkpoint-delay': 'int',
698             '*block-incremental': 'bool',
699             '*x-multifd-channels': 'int',
700             '*x-multifd-page-count': 'int',
701             '*xbzrle-cache-size': 'size',
702             '*max-postcopy-bandwidth': 'size',
703             '*max-cpu-throttle': 'int' } }
706 # @migrate-set-parameters:
708 # Set various migration parameters.
710 # Since: 2.4
712 # Example:
714 # -> { "execute": "migrate-set-parameters" ,
715 #      "arguments": { "compress-level": 1 } }
718 { 'command': 'migrate-set-parameters', 'boxed': true,
719   'data': 'MigrateSetParameters' }
722 # @MigrationParameters:
724 # The optional members aren't actually optional.
726 # @announce-initial: Initial delay (in milliseconds) before sending the
727 #          first announce (Since 4.0)
729 # @announce-max: Maximum delay (in milliseconds) between packets in the
730 #          announcement (Since 4.0)
732 # @announce-rounds: Number of self-announce packets sent after migration
733 #          (Since 4.0)
735 # @announce-step: Increase in delay (in milliseconds) between subsequent
736 #          packets in the announcement (Since 4.0)
738 # @compress-level: compression level
740 # @compress-threads: compression thread count
742 # @compress-wait-thread: Controls behavior when all compression threads are
743 #                        currently busy. If true (default), wait for a free
744 #                        compression thread to become available; otherwise,
745 #                        send the page uncompressed. (Since 3.1)
747 # @decompress-threads: decompression thread count
749 # @cpu-throttle-initial: Initial percentage of time guest cpus are
750 #                        throttled when migration auto-converge is activated.
751 #                        (Since 2.7)
753 # @cpu-throttle-increment: throttle percentage increase each time
754 #                          auto-converge detects that migration is not making
755 #                          progress. (Since 2.7)
757 # @tls-creds: ID of the 'tls-creds' object that provides credentials
758 #             for establishing a TLS connection over the migration data
759 #             channel. On the outgoing side of the migration, the credentials
760 #             must be for a 'client' endpoint, while for the incoming side the
761 #             credentials must be for a 'server' endpoint.
762 #             An empty string means that QEMU will use plain text mode for
763 #             migration, rather than TLS (Since 2.7)
764 #             Note: 2.8 reports this by omitting tls-creds instead.
766 # @tls-hostname: hostname of the target host for the migration. This
767 #                is required when using x509 based TLS credentials and the
768 #                migration URI does not already include a hostname. For
769 #                example if using fd: or exec: based migration, the
770 #                hostname must be provided so that the server's x509
771 #                certificate identity can be validated. (Since 2.7)
772 #                An empty string means that QEMU will use the hostname
773 #                associated with the migration URI, if any. (Since 2.9)
774 #                Note: 2.8 reports this by omitting tls-hostname instead.
776 # @max-bandwidth: to set maximum speed for migration. maximum speed in
777 #                 bytes per second. (Since 2.8)
779 # @downtime-limit: set maximum tolerated downtime for migration. maximum
780 #                  downtime in milliseconds (Since 2.8)
782 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
784 # @block-incremental: Affects how much storage is migrated when the
785 #       block migration capability is enabled.  When false, the entire
786 #       storage backing chain is migrated into a flattened image at
787 #       the destination; when true, only the active qcow2 layer is
788 #       migrated and the destination must already have access to the
789 #       same backing chain as was used on the source.  (since 2.10)
791 # @x-multifd-channels: Number of channels used to migrate data in
792 #                     parallel. This is the same number that the
793 #                     number of sockets used for migration.
794 #                     The default value is 2 (since 2.11)
796 # @x-multifd-page-count: Number of pages sent together to a thread.
797 #                        The default value is 16 (since 2.11)
799 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
800 #                     needs to be a multiple of the target page size
801 #                     and a power of 2
802 #                     (Since 2.11)
804 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
805 #                     Defaults to 0 (unlimited).  In bytes per second.
806 #                     (Since 3.0)
808 # @max-cpu-throttle: maximum cpu throttle percentage.
809 #                    Defaults to 99.
810 #                     (Since 3.1)
812 # Since: 2.4
814 { 'struct': 'MigrationParameters',
815   'data': { '*announce-initial': 'size',
816             '*announce-max': 'size',
817             '*announce-rounds': 'size',
818             '*announce-step': 'size',
819             '*compress-level': 'uint8',
820             '*compress-threads': 'uint8',
821             '*compress-wait-thread': 'bool',
822             '*decompress-threads': 'uint8',
823             '*cpu-throttle-initial': 'uint8',
824             '*cpu-throttle-increment': 'uint8',
825             '*tls-creds': 'str',
826             '*tls-hostname': 'str',
827             '*max-bandwidth': 'size',
828             '*downtime-limit': 'uint64',
829             '*x-checkpoint-delay': 'uint32',
830             '*block-incremental': 'bool' ,
831             '*x-multifd-channels': 'uint8',
832             '*x-multifd-page-count': 'uint32',
833             '*xbzrle-cache-size': 'size',
834             '*max-postcopy-bandwidth': 'size',
835             '*max-cpu-throttle':'uint8'} }
838 # @query-migrate-parameters:
840 # Returns information about the current migration parameters
842 # Returns: @MigrationParameters
844 # Since: 2.4
846 # Example:
848 # -> { "execute": "query-migrate-parameters" }
849 # <- { "return": {
850 #          "decompress-threads": 2,
851 #          "cpu-throttle-increment": 10,
852 #          "compress-threads": 8,
853 #          "compress-level": 1,
854 #          "cpu-throttle-initial": 20,
855 #          "max-bandwidth": 33554432,
856 #          "downtime-limit": 300
857 #       }
858 #    }
861 { 'command': 'query-migrate-parameters',
862   'returns': 'MigrationParameters' }
865 # @client_migrate_info:
867 # Set migration information for remote display.  This makes the server
868 # ask the client to automatically reconnect using the new parameters
869 # once migration finished successfully.  Only implemented for SPICE.
871 # @protocol:     must be "spice"
872 # @hostname:     migration target hostname
873 # @port:         spice tcp port for plaintext channels
874 # @tls-port:     spice tcp port for tls-secured channels
875 # @cert-subject: server certificate subject
877 # Since: 0.14.0
879 # Example:
881 # -> { "execute": "client_migrate_info",
882 #      "arguments": { "protocol": "spice",
883 #                     "hostname": "virt42.lab.kraxel.org",
884 #                     "port": 1234 } }
885 # <- { "return": {} }
888 { 'command': 'client_migrate_info',
889   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
890             '*tls-port': 'int', '*cert-subject': 'str' } }
893 # @migrate-start-postcopy:
895 # Followup to a migration command to switch the migration to postcopy mode.
896 # The postcopy-ram capability must be set on both source and destination
897 # before the original migration command.
899 # Since: 2.5
901 # Example:
903 # -> { "execute": "migrate-start-postcopy" }
904 # <- { "return": {} }
907 { 'command': 'migrate-start-postcopy' }
910 # @MIGRATION:
912 # Emitted when a migration event happens
914 # @status: @MigrationStatus describing the current migration status.
916 # Since: 2.4
918 # Example:
920 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
921 #     "event": "MIGRATION",
922 #     "data": {"status": "completed"} }
925 { 'event': 'MIGRATION',
926   'data': {'status': 'MigrationStatus'}}
929 # @MIGRATION_PASS:
931 # Emitted from the source side of a migration at the start of each pass
932 # (when it syncs the dirty bitmap)
934 # @pass: An incrementing count (starting at 1 on the first pass)
936 # Since: 2.6
938 # Example:
940 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
941 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
944 { 'event': 'MIGRATION_PASS',
945   'data': { 'pass': 'int' } }
948 # @COLOMessage:
950 # The message transmission between Primary side and Secondary side.
952 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
954 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
956 # @checkpoint-reply: SVM gets PVM's checkpoint request
958 # @vmstate-send: VM's state will be sent by PVM.
960 # @vmstate-size: The total size of VMstate.
962 # @vmstate-received: VM's state has been received by SVM.
964 # @vmstate-loaded: VM's state has been loaded by SVM.
966 # Since: 2.8
968 { 'enum': 'COLOMessage',
969   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
970             'vmstate-send', 'vmstate-size', 'vmstate-received',
971             'vmstate-loaded' ] }
974 # @COLOMode:
976 # The COLO current mode.
978 # @none: COLO is disabled.
980 # @primary: COLO node in primary side.
982 # @secondary: COLO node in slave side.
984 # Since: 2.8
986 { 'enum': 'COLOMode',
987   'data': [ 'none', 'primary', 'secondary'] }
990 # @FailoverStatus:
992 # An enumeration of COLO failover status
994 # @none: no failover has ever happened
996 # @require: got failover requirement but not handled
998 # @active: in the process of doing failover
1000 # @completed: finish the process of failover
1002 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1004 # Since: 2.8
1006 { 'enum': 'FailoverStatus',
1007   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1010 # @COLO_EXIT:
1012 # Emitted when VM finishes COLO mode due to some errors happening or
1013 # at the request of users.
1015 # @mode: report COLO mode when COLO exited.
1017 # @reason: describes the reason for the COLO exit.
1019 # Since: 3.1
1021 # Example:
1023 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1024 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1027 { 'event': 'COLO_EXIT',
1028   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1031 # @COLOExitReason:
1033 # The reason for a COLO exit
1035 # @none: no failover has ever happened. This can't occur in the
1036 # COLO_EXIT event, only in the result of query-colo-status.
1038 # @request: COLO exit is due to an external request
1040 # @error: COLO exit is due to an internal error
1042 # Since: 3.1
1044 { 'enum': 'COLOExitReason',
1045   'data': [ 'none', 'request', 'error' ] }
1048 # @x-colo-lost-heartbeat:
1050 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1051 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1052 # If sent to the Secondary, the Secondary side will run failover work,
1053 # then takes over server operation to become the service VM.
1055 # Since: 2.8
1057 # Example:
1059 # -> { "execute": "x-colo-lost-heartbeat" }
1060 # <- { "return": {} }
1063 { 'command': 'x-colo-lost-heartbeat' }
1066 # @migrate_cancel:
1068 # Cancel the current executing migration process.
1070 # Returns: nothing on success
1072 # Notes: This command succeeds even if there is no migration process running.
1074 # Since: 0.14.0
1076 # Example:
1078 # -> { "execute": "migrate_cancel" }
1079 # <- { "return": {} }
1082 { 'command': 'migrate_cancel' }
1085 # @migrate-continue:
1087 # Continue migration when it's in a paused state.
1089 # @state: The state the migration is currently expected to be in
1091 # Returns: nothing on success
1092 # Since: 2.11
1093 # Example:
1095 # -> { "execute": "migrate-continue" , "arguments":
1096 #      { "state": "pre-switchover" } }
1097 # <- { "return": {} }
1099 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1102 # @migrate_set_downtime:
1104 # Set maximum tolerated downtime for migration.
1106 # @value: maximum downtime in seconds
1108 # Returns: nothing on success
1110 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1112 # Since: 0.14.0
1114 # Example:
1116 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1117 # <- { "return": {} }
1120 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1123 # @migrate_set_speed:
1125 # Set maximum speed for migration.
1127 # @value: maximum speed in bytes per second.
1129 # Returns: nothing on success
1131 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1133 # Since: 0.14.0
1135 # Example:
1137 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1138 # <- { "return": {} }
1141 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1144 # @migrate-set-cache-size:
1146 # Set cache size to be used by XBZRLE migration
1148 # @value: cache size in bytes
1150 # The size will be rounded down to the nearest power of 2.
1151 # The cache size can be modified before and during ongoing migration
1153 # Returns: nothing on success
1155 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1157 # Since: 1.2
1159 # Example:
1161 # -> { "execute": "migrate-set-cache-size",
1162 #      "arguments": { "value": 536870912 } }
1163 # <- { "return": {} }
1166 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1169 # @query-migrate-cache-size:
1171 # Query migration XBZRLE cache size
1173 # Returns: XBZRLE cache size in bytes
1175 # Notes: This command is deprecated in favor of 'query-migrate-parameters'
1177 # Since: 1.2
1179 # Example:
1181 # -> { "execute": "query-migrate-cache-size" }
1182 # <- { "return": 67108864 }
1185 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1188 # @migrate:
1190 # Migrates the current running guest to another Virtual Machine.
1192 # @uri: the Uniform Resource Identifier of the destination VM
1194 # @blk: do block migration (full disk copy)
1196 # @inc: incremental disk copy migration
1198 # @detach: this argument exists only for compatibility reasons and
1199 #          is ignored by QEMU
1201 # @resume: resume one paused migration, default "off". (since 3.0)
1203 # Returns: nothing on success
1205 # Since: 0.14.0
1207 # Notes:
1209 # 1. The 'query-migrate' command should be used to check migration's progress
1210 #    and final result (this information is provided by the 'status' member)
1212 # 2. All boolean arguments default to false
1214 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1215 #    be used
1217 # Example:
1219 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1220 # <- { "return": {} }
1223 { 'command': 'migrate',
1224   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1225            '*detach': 'bool', '*resume': 'bool' } }
1228 # @migrate-incoming:
1230 # Start an incoming migration, the qemu must have been started
1231 # with -incoming defer
1233 # @uri: The Uniform Resource Identifier identifying the source or
1234 #       address to listen on
1236 # Returns: nothing on success
1238 # Since: 2.3
1240 # Notes:
1242 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1243 #    compatible with -incoming and the format of the uri is already exposed
1244 #    above libvirt.
1246 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1247 #    be used.
1249 # 3. The uri format is the same as for -incoming
1251 # Example:
1253 # -> { "execute": "migrate-incoming",
1254 #      "arguments": { "uri": "tcp::4446" } }
1255 # <- { "return": {} }
1258 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1261 # @xen-save-devices-state:
1263 # Save the state of all devices to file. The RAM and the block devices
1264 # of the VM are not saved by this command.
1266 # @filename: the file to save the state of the devices to as binary
1267 # data. See xen-save-devices-state.txt for a description of the binary
1268 # format.
1270 # @live: Optional argument to ask QEMU to treat this command as part of a live
1271 # migration. Default to true. (since 2.11)
1273 # Returns: Nothing on success
1275 # Since: 1.1
1277 # Example:
1279 # -> { "execute": "xen-save-devices-state",
1280 #      "arguments": { "filename": "/tmp/save" } }
1281 # <- { "return": {} }
1284 { 'command': 'xen-save-devices-state',
1285   'data': {'filename': 'str', '*live':'bool' } }
1288 # @xen-set-replication:
1290 # Enable or disable replication.
1292 # @enable: true to enable, false to disable.
1294 # @primary: true for primary or false for secondary.
1296 # @failover: true to do failover, false to stop. but cannot be
1297 #            specified if 'enable' is true. default value is false.
1299 # Returns: nothing.
1301 # Example:
1303 # -> { "execute": "xen-set-replication",
1304 #      "arguments": {"enable": true, "primary": false} }
1305 # <- { "return": {} }
1307 # Since: 2.9
1309 { 'command': 'xen-set-replication',
1310   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1311   'if': 'defined(CONFIG_REPLICATION)' }
1314 # @ReplicationStatus:
1316 # The result format for 'query-xen-replication-status'.
1318 # @error: true if an error happened, false if replication is normal.
1320 # @desc: the human readable error description string, when
1321 #        @error is 'true'.
1323 # Since: 2.9
1325 { 'struct': 'ReplicationStatus',
1326   'data': { 'error': 'bool', '*desc': 'str' },
1327   'if': 'defined(CONFIG_REPLICATION)' }
1330 # @query-xen-replication-status:
1332 # Query replication status while the vm is running.
1334 # Returns: A @ReplicationResult object showing the status.
1336 # Example:
1338 # -> { "execute": "query-xen-replication-status" }
1339 # <- { "return": { "error": false } }
1341 # Since: 2.9
1343 { 'command': 'query-xen-replication-status',
1344   'returns': 'ReplicationStatus',
1345   'if': 'defined(CONFIG_REPLICATION)' }
1348 # @xen-colo-do-checkpoint:
1350 # Xen uses this command to notify replication to trigger a checkpoint.
1352 # Returns: nothing.
1354 # Example:
1356 # -> { "execute": "xen-colo-do-checkpoint" }
1357 # <- { "return": {} }
1359 # Since: 2.9
1361 { 'command': 'xen-colo-do-checkpoint',
1362   'if': 'defined(CONFIG_REPLICATION)' }
1365 # @COLOStatus:
1367 # The result format for 'query-colo-status'.
1369 # @mode: COLO running mode. If COLO is running, this field will return
1370 #        'primary' or 'secondary'.
1372 # @reason: describes the reason for the COLO exit.
1374 # Since: 3.1
1376 { 'struct': 'COLOStatus',
1377   'data': { 'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1380 # @query-colo-status:
1382 # Query COLO status while the vm is running.
1384 # Returns: A @COLOStatus object showing the status.
1386 # Example:
1388 # -> { "execute": "query-colo-status" }
1389 # <- { "return": { "mode": "primary", "active": true, "reason": "request" } }
1391 # Since: 3.1
1393 { 'command': 'query-colo-status',
1394   'returns': 'COLOStatus' }
1397 # @migrate-recover:
1399 # Provide a recovery migration stream URI.
1401 # @uri: the URI to be used for the recovery of migration stream.
1403 # Returns: nothing.
1405 # Example:
1407 # -> { "execute": "migrate-recover",
1408 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1409 # <- { "return": {} }
1411 # Since: 3.0
1413 { 'command': 'migrate-recover',
1414   'data': { 'uri': 'str' },
1415   'allow-oob': true }
1418 # @migrate-pause:
1420 # Pause a migration.  Currently it only supports postcopy.
1422 # Returns: nothing.
1424 # Example:
1426 # -> { "execute": "migrate-pause" }
1427 # <- { "return": {} }
1429 # Since: 3.0
1431 { 'command': 'migrate-pause', 'allow-oob': true }