migration: Deprecate redundant query-migrate result @blocked
[qemu/ar7.git] / qapi / migration.json
blob0b17cce46bfc1affc29f870b342463a09a728f21
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Migration
7 ##
9 { 'include': 'common.json' }
10 { 'include': 'sockets.json' }
13 # @MigrationStats:
15 # Detailed migration status.
17 # @transferred: amount of bytes already transferred to the target VM
19 # @remaining: amount of bytes remaining to be transferred to the target VM
21 # @total: total amount of bytes involved in the migration process
23 # @duplicate: number of duplicate (zero) pages (since 1.2)
25 # @skipped: number of skipped zero pages (since 1.5)
27 # @normal: number of normal pages (since 1.2)
29 # @normal-bytes: number of normal bytes sent (since 1.2)
31 # @dirty-pages-rate: number of pages dirtied by second by the
32 #                    guest (since 1.3)
34 # @mbps: throughput in megabits/sec. (since 1.6)
36 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
38 # @postcopy-requests: The number of page requests received from the destination
39 #                     (since 2.7)
41 # @page-size: The number of bytes per page for the various page-based
42 #             statistics (since 2.10)
44 # @multifd-bytes: The number of bytes sent through multifd (since 3.0)
46 # @pages-per-second: the number of memory pages transferred per second
47 #                    (Since 4.0)
49 # Since: 0.14
51 { 'struct': 'MigrationStats',
52   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
53            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
54            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
55            'mbps' : 'number', 'dirty-sync-count' : 'int',
56            'postcopy-requests' : 'int', 'page-size' : 'int',
57            'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64' } }
60 # @XBZRLECacheStats:
62 # Detailed XBZRLE migration cache statistics
64 # @cache-size: XBZRLE cache size
66 # @bytes: amount of bytes already transferred to the target VM
68 # @pages: amount of pages transferred to the target VM
70 # @cache-miss: number of cache miss
72 # @cache-miss-rate: rate of cache miss (since 2.1)
74 # @encoding-rate: rate of encoded bytes (since 5.1)
76 # @overflow: number of overflows
78 # Since: 1.2
80 { 'struct': 'XBZRLECacheStats',
81   'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
82            'cache-miss': 'int', 'cache-miss-rate': 'number',
83            'encoding-rate': 'number', 'overflow': 'int' } }
86 # @CompressionStats:
88 # Detailed migration compression statistics
90 # @pages: amount of pages compressed and transferred to the target VM
92 # @busy: count of times that no free thread was available to compress data
94 # @busy-rate: rate of thread busy
96 # @compressed-size: amount of bytes after compression
98 # @compression-rate: rate of compressed size
100 # Since: 3.1
102 { 'struct': 'CompressionStats',
103   'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
104            'compressed-size': 'int', 'compression-rate': 'number' } }
107 # @MigrationStatus:
109 # An enumeration of migration status.
111 # @none: no migration has ever happened.
113 # @setup: migration process has been initiated.
115 # @cancelling: in the process of cancelling migration.
117 # @cancelled: cancelling migration is finished.
119 # @active: in the process of doing migration.
121 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
123 # @postcopy-paused: during postcopy but paused. (since 3.0)
125 # @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
127 # @completed: migration is finished.
129 # @failed: some error occurred during migration process.
131 # @colo: VM is in the process of fault tolerance, VM can not get into this
132 #        state unless colo capability is enabled for migration. (since 2.8)
134 # @pre-switchover: Paused before device serialisation. (since 2.11)
136 # @device: During device serialisation when pause-before-switchover is enabled
137 #          (since 2.11)
139 # @wait-unplug: wait for device unplug request by guest OS to be completed.
140 #               (since 4.2)
142 # Since: 2.3
145 { 'enum': 'MigrationStatus',
146   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
147             'active', 'postcopy-active', 'postcopy-paused',
148             'postcopy-recover', 'completed', 'failed', 'colo',
149             'pre-switchover', 'device', 'wait-unplug' ] }
151 # @VfioStats:
153 # Detailed VFIO devices migration statistics
155 # @transferred: amount of bytes transferred to the target VM by VFIO devices
157 # Since: 5.2
160 { 'struct': 'VfioStats',
161   'data': {'transferred': 'int' } }
164 # @MigrationInfo:
166 # Information about current migration process.
168 # @status: @MigrationStatus describing the current migration status.
169 #          If this field is not returned, no migration process
170 #          has been initiated
172 # @ram: @MigrationStats containing detailed migration
173 #       status, only returned if status is 'active' or
174 #       'completed'(since 1.2)
176 # @disk: @MigrationStats containing detailed disk migration
177 #        status, only returned if status is 'active' and it is a block
178 #        migration
180 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
181 #                migration statistics, only returned if XBZRLE feature is on and
182 #                status is 'active' or 'completed' (since 1.2)
184 # @total-time: total amount of milliseconds since migration started.
185 #              If migration has ended, it returns the total migration
186 #              time. (since 1.2)
188 # @downtime: only present when migration finishes correctly
189 #            total downtime in milliseconds for the guest.
190 #            (since 1.3)
192 # @expected-downtime: only present while migration is active
193 #                     expected downtime in milliseconds for the guest in last walk
194 #                     of the dirty bitmap. (since 1.3)
196 # @setup-time: amount of setup time in milliseconds *before* the
197 #              iterations begin but *after* the QMP command is issued. This is designed
198 #              to provide an accounting of any activities (such as RDMA pinning) which
199 #              may be expensive, but do not actually occur during the iterative
200 #              migration rounds themselves. (since 1.6)
202 # @cpu-throttle-percentage: percentage of time guest cpus are being
203 #                           throttled during auto-converge. This is only present when auto-converge
204 #                           has started throttling guest cpus. (Since 2.7)
206 # @error-desc: the human readable error description string, when
207 #              @status is 'failed'. Clients should not attempt to parse the
208 #              error strings. (Since 2.7)
210 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
211 #                      live migration. This is only present when the postcopy-blocktime
212 #                      migration capability is enabled. (Since 3.0)
214 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.  This is
215 #                           only present when the postcopy-blocktime migration capability
216 #                           is enabled. (Since 3.0)
218 # @compression: migration compression statistics, only returned if compression
219 #               feature is on and status is 'active' or 'completed' (Since 3.1)
221 # @socket-address: Only used for tcp, to know what the real port is (Since 4.0)
223 # @vfio: @VfioStats containing detailed VFIO devices migration statistics,
224 #        only returned if VFIO device is present, migration is supported by all
225 #        VFIO devices and status is 'active' or 'completed' (since 5.2)
227 # @blocked-reasons: A list of reasons an outgoing migration is blocked.
228 #                   Present and non-empty when migration is blocked.
229 #                   (since 6.0)
231 # @blocked: True if outgoing migration is blocked (since 6.0)
233 # Features:
234 # @deprecated: Member @blocked is deprecated.  Use @blocked-reasons instead.
236 # Since: 0.14
238 { 'struct': 'MigrationInfo',
239   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
240            '*disk': 'MigrationStats',
241            '*vfio': 'VfioStats',
242            '*xbzrle-cache': 'XBZRLECacheStats',
243            '*total-time': 'int',
244            '*expected-downtime': 'int',
245            '*downtime': 'int',
246            '*setup-time': 'int',
247            '*cpu-throttle-percentage': 'int',
248            '*error-desc': 'str',
249            'blocked': { 'type': 'bool', 'features': [ 'deprecated' ] },
250            '*blocked-reasons': ['str'],
251            '*postcopy-blocktime' : 'uint32',
252            '*postcopy-vcpu-blocktime': ['uint32'],
253            '*compression': 'CompressionStats',
254            '*socket-address': ['SocketAddress'] } }
257 # @query-migrate:
259 # Returns information about current migration process. If migration
260 # is active there will be another json-object with RAM migration
261 # status and if block migration is active another one with block
262 # migration status.
264 # Returns: @MigrationInfo
266 # Since: 0.14
268 # Example:
270 # 1. Before the first migration
272 # -> { "execute": "query-migrate" }
273 # <- { "return": {} }
275 # 2. Migration is done and has succeeded
277 # -> { "execute": "query-migrate" }
278 # <- { "return": {
279 #         "status": "completed",
280 #         "total-time":12345,
281 #         "setup-time":12345,
282 #         "downtime":12345,
283 #         "ram":{
284 #           "transferred":123,
285 #           "remaining":123,
286 #           "total":246,
287 #           "duplicate":123,
288 #           "normal":123,
289 #           "normal-bytes":123456,
290 #           "dirty-sync-count":15
291 #         }
292 #      }
293 #    }
295 # 3. Migration is done and has failed
297 # -> { "execute": "query-migrate" }
298 # <- { "return": { "status": "failed" } }
300 # 4. Migration is being performed and is not a block migration:
302 # -> { "execute": "query-migrate" }
303 # <- {
304 #       "return":{
305 #          "status":"active",
306 #          "total-time":12345,
307 #          "setup-time":12345,
308 #          "expected-downtime":12345,
309 #          "ram":{
310 #             "transferred":123,
311 #             "remaining":123,
312 #             "total":246,
313 #             "duplicate":123,
314 #             "normal":123,
315 #             "normal-bytes":123456,
316 #             "dirty-sync-count":15
317 #          }
318 #       }
319 #    }
321 # 5. Migration is being performed and is a block migration:
323 # -> { "execute": "query-migrate" }
324 # <- {
325 #       "return":{
326 #          "status":"active",
327 #          "total-time":12345,
328 #          "setup-time":12345,
329 #          "expected-downtime":12345,
330 #          "ram":{
331 #             "total":1057024,
332 #             "remaining":1053304,
333 #             "transferred":3720,
334 #             "duplicate":123,
335 #             "normal":123,
336 #             "normal-bytes":123456,
337 #             "dirty-sync-count":15
338 #          },
339 #          "disk":{
340 #             "total":20971520,
341 #             "remaining":20880384,
342 #             "transferred":91136
343 #          }
344 #       }
345 #    }
347 # 6. Migration is being performed and XBZRLE is active:
349 # -> { "execute": "query-migrate" }
350 # <- {
351 #       "return":{
352 #          "status":"active",
353 #          "total-time":12345,
354 #          "setup-time":12345,
355 #          "expected-downtime":12345,
356 #          "ram":{
357 #             "total":1057024,
358 #             "remaining":1053304,
359 #             "transferred":3720,
360 #             "duplicate":10,
361 #             "normal":3333,
362 #             "normal-bytes":3412992,
363 #             "dirty-sync-count":15
364 #          },
365 #          "xbzrle-cache":{
366 #             "cache-size":67108864,
367 #             "bytes":20971520,
368 #             "pages":2444343,
369 #             "cache-miss":2244,
370 #             "cache-miss-rate":0.123,
371 #             "encoding-rate":80.1,
372 #             "overflow":34434
373 #          }
374 #       }
375 #    }
378 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
381 # @MigrationCapability:
383 # Migration capabilities enumeration
385 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
386 #          This feature allows us to minimize migration traffic for certain work
387 #          loads, by sending compressed difference of the pages
389 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
390 #                mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
391 #                Disabled by default. (since 2.0)
393 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
394 #               essentially saves 1MB of zeroes per block on the wire. Enabling requires
395 #               source and target VM to support this feature. To enable it is sufficient
396 #               to enable the capability on the source VM. The feature is disabled by
397 #               default. (since 1.6)
399 # @compress: Use multiple compression threads to accelerate live migration.
400 #            This feature can help to reduce the migration traffic, by sending
401 #            compressed pages. Please note that if compress and xbzrle are both
402 #            on, compress only takes effect in the ram bulk stage, after that,
403 #            it will be disabled and only xbzrle takes effect, this can help to
404 #            minimize migration traffic. The feature is disabled by default.
405 #            (since 2.4 )
407 # @events: generate events for each migration state change
408 #          (since 2.4 )
410 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
411 #                 to speed up convergence of RAM migration. (since 1.6)
413 # @postcopy-ram: Start executing on the migration target before all of RAM has
414 #                been migrated, pulling the remaining pages along as needed. The
415 #                capacity must have the same setting on both source and target
416 #                or migration will not even start. NOTE: If the migration fails during
417 #                postcopy the VM will fail.  (since 2.6)
419 # @x-colo: If enabled, migration will never end, and the state of the VM on the
420 #          primary side will be migrated continuously to the VM on secondary
421 #          side, this process is called COarse-Grain LOck Stepping (COLO) for
422 #          Non-stop Service. (since 2.8)
424 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
425 #               during postcopy-ram migration. (since 2.9)
427 # @block: If enabled, QEMU will also migrate the contents of all block
428 #         devices.  Default is disabled.  A possible alternative uses
429 #         mirror jobs to a builtin NBD server on the destination, which
430 #         offers more flexibility.
431 #         (Since 2.10)
433 # @return-path: If enabled, migration will use the return path even
434 #               for precopy. (since 2.10)
436 # @pause-before-switchover: Pause outgoing migration before serialising device
437 #                           state and before disabling block IO (since 2.11)
439 # @multifd: Use more than one fd for migration (since 4.0)
441 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
442 #                 (since 2.12)
444 # @postcopy-blocktime: Calculate downtime for postcopy live migration
445 #                      (since 3.0)
447 # @late-block-activate: If enabled, the destination will not activate block
448 #                       devices (and thus take locks) immediately at the end of migration.
449 #                       (since 3.0)
451 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
453 # @validate-uuid: Send the UUID of the source to allow the destination
454 #                 to ensure it is the same. (since 4.2)
456 # @background-snapshot: If enabled, the migration stream will be a snapshot
457 #                       of the VM exactly at the point when the migration
458 #                       procedure starts. The VM RAM is saved with running VM.
459 #                       (since 6.0)
461 # Since: 1.2
463 { 'enum': 'MigrationCapability',
464   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
465            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
466            'block', 'return-path', 'pause-before-switchover', 'multifd',
467            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
468            'x-ignore-shared', 'validate-uuid', 'background-snapshot'] }
471 # @MigrationCapabilityStatus:
473 # Migration capability information
475 # @capability: capability enum
477 # @state: capability state bool
479 # Since: 1.2
481 { 'struct': 'MigrationCapabilityStatus',
482   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
485 # @migrate-set-capabilities:
487 # Enable/Disable the following migration capabilities (like xbzrle)
489 # @capabilities: json array of capability modifications to make
491 # Since: 1.2
493 # Example:
495 # -> { "execute": "migrate-set-capabilities" , "arguments":
496 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
499 { 'command': 'migrate-set-capabilities',
500   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
503 # @query-migrate-capabilities:
505 # Returns information about the current migration capabilities status
507 # Returns: @MigrationCapabilitiesStatus
509 # Since: 1.2
511 # Example:
513 # -> { "execute": "query-migrate-capabilities" }
514 # <- { "return": [
515 #       {"state": false, "capability": "xbzrle"},
516 #       {"state": false, "capability": "rdma-pin-all"},
517 #       {"state": false, "capability": "auto-converge"},
518 #       {"state": false, "capability": "zero-blocks"},
519 #       {"state": false, "capability": "compress"},
520 #       {"state": true, "capability": "events"},
521 #       {"state": false, "capability": "postcopy-ram"},
522 #       {"state": false, "capability": "x-colo"}
523 #    ]}
526 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
529 # @MultiFDCompression:
531 # An enumeration of multifd compression methods.
533 # @none: no compression.
534 # @zlib: use zlib compression method.
535 # @zstd: use zstd compression method.
537 # Since: 5.0
540 { 'enum': 'MultiFDCompression',
541   'data': [ 'none', 'zlib',
542             { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
545 # @BitmapMigrationBitmapAliasTransform:
547 # @persistent: If present, the bitmap will be made persistent
548 #              or transient depending on this parameter.
550 # Since: 6.0
552 { 'struct': 'BitmapMigrationBitmapAliasTransform',
553   'data': {
554       '*persistent': 'bool'
555   } }
558 # @BitmapMigrationBitmapAlias:
560 # @name: The name of the bitmap.
562 # @alias: An alias name for migration (for example the bitmap name on
563 #         the opposite site).
565 # @transform: Allows the modification of the migrated bitmap.
566 #             (since 6.0)
568 # Since: 5.2
570 { 'struct': 'BitmapMigrationBitmapAlias',
571   'data': {
572       'name': 'str',
573       'alias': 'str',
574       '*transform': 'BitmapMigrationBitmapAliasTransform'
575   } }
578 # @BitmapMigrationNodeAlias:
580 # Maps a block node name and the bitmaps it has to aliases for dirty
581 # bitmap migration.
583 # @node-name: A block node name.
585 # @alias: An alias block node name for migration (for example the
586 #         node name on the opposite site).
588 # @bitmaps: Mappings for the bitmaps on this node.
590 # Since: 5.2
592 { 'struct': 'BitmapMigrationNodeAlias',
593   'data': {
594       'node-name': 'str',
595       'alias': 'str',
596       'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
597   } }
600 # @MigrationParameter:
602 # Migration parameters enumeration
604 # @announce-initial: Initial delay (in milliseconds) before sending the first
605 #                    announce (Since 4.0)
607 # @announce-max: Maximum delay (in milliseconds) between packets in the
608 #                announcement (Since 4.0)
610 # @announce-rounds: Number of self-announce packets sent after migration
611 #                   (Since 4.0)
613 # @announce-step: Increase in delay (in milliseconds) between subsequent
614 #                 packets in the announcement (Since 4.0)
616 # @compress-level: Set the compression level to be used in live migration,
617 #                  the compression level is an integer between 0 and 9, where 0 means
618 #                  no compression, 1 means the best compression speed, and 9 means best
619 #                  compression ratio which will consume more CPU.
621 # @compress-threads: Set compression thread count to be used in live migration,
622 #                    the compression thread count is an integer between 1 and 255.
624 # @compress-wait-thread: Controls behavior when all compression threads are
625 #                        currently busy. If true (default), wait for a free
626 #                        compression thread to become available; otherwise,
627 #                        send the page uncompressed. (Since 3.1)
629 # @decompress-threads: Set decompression thread count to be used in live
630 #                      migration, the decompression thread count is an integer between 1
631 #                      and 255. Usually, decompression is at least 4 times as fast as
632 #                      compression, so set the decompress-threads to the number about 1/4
633 #                      of compress-threads is adequate.
635 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
636 #                              to trigger throttling. It is expressed as percentage.
637 #                              The default value is 50. (Since 5.0)
639 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
640 #                        when migration auto-converge is activated. The
641 #                        default value is 20. (Since 2.7)
643 # @cpu-throttle-increment: throttle percentage increase each time
644 #                          auto-converge detects that migration is not making
645 #                          progress. The default value is 10. (Since 2.7)
647 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
648 #                         At the tail stage of throttling, the Guest is very
649 #                         sensitive to CPU percentage while the @cpu-throttle
650 #                         -increment is excessive usually at tail stage.
651 #                         If this parameter is true, we will compute the ideal
652 #                         CPU percentage used by the Guest, which may exactly make
653 #                         the dirty rate match the dirty rate threshold. Then we
654 #                         will choose a smaller throttle increment between the
655 #                         one specified by @cpu-throttle-increment and the one
656 #                         generated by ideal CPU percentage.
657 #                         Therefore, it is compatible to traditional throttling,
658 #                         meanwhile the throttle increment won't be excessive
659 #                         at tail stage.
660 #                         The default value is false. (Since 5.1)
662 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
663 #             establishing a TLS connection over the migration data channel.
664 #             On the outgoing side of the migration, the credentials must
665 #             be for a 'client' endpoint, while for the incoming side the
666 #             credentials must be for a 'server' endpoint. Setting this
667 #             will enable TLS for all migrations. The default is unset,
668 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
670 # @tls-hostname: hostname of the target host for the migration. This is
671 #                required when using x509 based TLS credentials and the
672 #                migration URI does not already include a hostname. For
673 #                example if using fd: or exec: based migration, the
674 #                hostname must be provided so that the server's x509
675 #                certificate identity can be validated. (Since 2.7)
677 # @tls-authz: ID of the 'authz' object subclass that provides access control
678 #             checking of the TLS x509 certificate distinguished name.
679 #             This object is only resolved at time of use, so can be deleted
680 #             and recreated on the fly while the migration server is active.
681 #             If missing, it will default to denying access (Since 4.0)
683 # @max-bandwidth: to set maximum speed for migration. maximum speed in
684 #                 bytes per second. (Since 2.8)
686 # @downtime-limit: set maximum tolerated downtime for migration. maximum
687 #                  downtime in milliseconds (Since 2.8)
689 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
690 #                      periodic mode. (Since 2.8)
692 # @block-incremental: Affects how much storage is migrated when the
693 #                     block migration capability is enabled.  When false, the entire
694 #                     storage backing chain is migrated into a flattened image at
695 #                     the destination; when true, only the active qcow2 layer is
696 #                     migrated and the destination must already have access to the
697 #                     same backing chain as was used on the source.  (since 2.10)
699 # @multifd-channels: Number of channels used to migrate data in
700 #                    parallel. This is the same number that the
701 #                    number of sockets used for migration.  The
702 #                    default value is 2 (since 4.0)
704 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
705 #                     needs to be a multiple of the target page size
706 #                     and a power of 2
707 #                     (Since 2.11)
709 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
710 #                          Defaults to 0 (unlimited).  In bytes per second.
711 #                          (Since 3.0)
713 # @max-cpu-throttle: maximum cpu throttle percentage.
714 #                    Defaults to 99. (Since 3.1)
716 # @multifd-compression: Which compression method to use.
717 #                       Defaults to none. (Since 5.0)
719 # @multifd-zlib-level: Set the compression level to be used in live
720 #                      migration, the compression level is an integer between 0
721 #                      and 9, where 0 means no compression, 1 means the best
722 #                      compression speed, and 9 means best compression ratio which
723 #                      will consume more CPU.
724 #                      Defaults to 1. (Since 5.0)
726 # @multifd-zstd-level: Set the compression level to be used in live
727 #                      migration, the compression level is an integer between 0
728 #                      and 20, where 0 means no compression, 1 means the best
729 #                      compression speed, and 20 means best compression ratio which
730 #                      will consume more CPU.
731 #                      Defaults to 1. (Since 5.0)
733 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
734 #                        aliases for the purpose of dirty bitmap migration.  Such
735 #                        aliases may for example be the corresponding names on the
736 #                        opposite site.
737 #                        The mapping must be one-to-one, but not necessarily
738 #                        complete: On the source, unmapped bitmaps and all bitmaps
739 #                        on unmapped nodes will be ignored.  On the destination,
740 #                        encountering an unmapped alias in the incoming migration
741 #                        stream will result in a report, and all further bitmap
742 #                        migration data will then be discarded.
743 #                        Note that the destination does not know about bitmaps it
744 #                        does not receive, so there is no limitation or requirement
745 #                        regarding the number of bitmaps received, or how they are
746 #                        named, or on which nodes they are placed.
747 #                        By default (when this parameter has never been set), bitmap
748 #                        names are mapped to themselves.  Nodes are mapped to their
749 #                        block device name if there is one, and to their node name
750 #                        otherwise. (Since 5.2)
752 # Since: 2.4
754 { 'enum': 'MigrationParameter',
755   'data': ['announce-initial', 'announce-max',
756            'announce-rounds', 'announce-step',
757            'compress-level', 'compress-threads', 'decompress-threads',
758            'compress-wait-thread', 'throttle-trigger-threshold',
759            'cpu-throttle-initial', 'cpu-throttle-increment',
760            'cpu-throttle-tailslow',
761            'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
762            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
763            'multifd-channels',
764            'xbzrle-cache-size', 'max-postcopy-bandwidth',
765            'max-cpu-throttle', 'multifd-compression',
766            'multifd-zlib-level' ,'multifd-zstd-level',
767            'block-bitmap-mapping' ] }
770 # @MigrateSetParameters:
772 # @announce-initial: Initial delay (in milliseconds) before sending the first
773 #                    announce (Since 4.0)
775 # @announce-max: Maximum delay (in milliseconds) between packets in the
776 #                announcement (Since 4.0)
778 # @announce-rounds: Number of self-announce packets sent after migration
779 #                   (Since 4.0)
781 # @announce-step: Increase in delay (in milliseconds) between subsequent
782 #                 packets in the announcement (Since 4.0)
784 # @compress-level: compression level
786 # @compress-threads: compression thread count
788 # @compress-wait-thread: Controls behavior when all compression threads are
789 #                        currently busy. If true (default), wait for a free
790 #                        compression thread to become available; otherwise,
791 #                        send the page uncompressed. (Since 3.1)
793 # @decompress-threads: decompression thread count
795 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
796 #                              to trigger throttling. It is expressed as percentage.
797 #                              The default value is 50. (Since 5.0)
799 # @cpu-throttle-initial: Initial percentage of time guest cpus are
800 #                        throttled when migration auto-converge is activated.
801 #                        The default value is 20. (Since 2.7)
803 # @cpu-throttle-increment: throttle percentage increase each time
804 #                          auto-converge detects that migration is not making
805 #                          progress. The default value is 10. (Since 2.7)
807 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
808 #                         At the tail stage of throttling, the Guest is very
809 #                         sensitive to CPU percentage while the @cpu-throttle
810 #                         -increment is excessive usually at tail stage.
811 #                         If this parameter is true, we will compute the ideal
812 #                         CPU percentage used by the Guest, which may exactly make
813 #                         the dirty rate match the dirty rate threshold. Then we
814 #                         will choose a smaller throttle increment between the
815 #                         one specified by @cpu-throttle-increment and the one
816 #                         generated by ideal CPU percentage.
817 #                         Therefore, it is compatible to traditional throttling,
818 #                         meanwhile the throttle increment won't be excessive
819 #                         at tail stage.
820 #                         The default value is false. (Since 5.1)
822 # @tls-creds: ID of the 'tls-creds' object that provides credentials
823 #             for establishing a TLS connection over the migration data
824 #             channel. On the outgoing side of the migration, the credentials
825 #             must be for a 'client' endpoint, while for the incoming side the
826 #             credentials must be for a 'server' endpoint. Setting this
827 #             to a non-empty string enables TLS for all migrations.
828 #             An empty string means that QEMU will use plain text mode for
829 #             migration, rather than TLS (Since 2.9)
830 #             Previously (since 2.7), this was reported by omitting
831 #             tls-creds instead.
833 # @tls-hostname: hostname of the target host for the migration. This
834 #                is required when using x509 based TLS credentials and the
835 #                migration URI does not already include a hostname. For
836 #                example if using fd: or exec: based migration, the
837 #                hostname must be provided so that the server's x509
838 #                certificate identity can be validated. (Since 2.7)
839 #                An empty string means that QEMU will use the hostname
840 #                associated with the migration URI, if any. (Since 2.9)
841 #                Previously (since 2.7), this was reported by omitting
842 #                tls-hostname instead.
844 # @max-bandwidth: to set maximum speed for migration. maximum speed in
845 #                 bytes per second. (Since 2.8)
847 # @downtime-limit: set maximum tolerated downtime for migration. maximum
848 #                  downtime in milliseconds (Since 2.8)
850 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
852 # @block-incremental: Affects how much storage is migrated when the
853 #                     block migration capability is enabled.  When false, the entire
854 #                     storage backing chain is migrated into a flattened image at
855 #                     the destination; when true, only the active qcow2 layer is
856 #                     migrated and the destination must already have access to the
857 #                     same backing chain as was used on the source.  (since 2.10)
859 # @multifd-channels: Number of channels used to migrate data in
860 #                    parallel. This is the same number that the
861 #                    number of sockets used for migration.  The
862 #                    default value is 2 (since 4.0)
864 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
865 #                     needs to be a multiple of the target page size
866 #                     and a power of 2
867 #                     (Since 2.11)
869 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
870 #                          Defaults to 0 (unlimited).  In bytes per second.
871 #                          (Since 3.0)
873 # @max-cpu-throttle: maximum cpu throttle percentage.
874 #                    The default value is 99. (Since 3.1)
876 # @multifd-compression: Which compression method to use.
877 #                       Defaults to none. (Since 5.0)
879 # @multifd-zlib-level: Set the compression level to be used in live
880 #                      migration, the compression level is an integer between 0
881 #                      and 9, where 0 means no compression, 1 means the best
882 #                      compression speed, and 9 means best compression ratio which
883 #                      will consume more CPU.
884 #                      Defaults to 1. (Since 5.0)
886 # @multifd-zstd-level: Set the compression level to be used in live
887 #                      migration, the compression level is an integer between 0
888 #                      and 20, where 0 means no compression, 1 means the best
889 #                      compression speed, and 20 means best compression ratio which
890 #                      will consume more CPU.
891 #                      Defaults to 1. (Since 5.0)
893 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
894 #                        aliases for the purpose of dirty bitmap migration.  Such
895 #                        aliases may for example be the corresponding names on the
896 #                        opposite site.
897 #                        The mapping must be one-to-one, but not necessarily
898 #                        complete: On the source, unmapped bitmaps and all bitmaps
899 #                        on unmapped nodes will be ignored.  On the destination,
900 #                        encountering an unmapped alias in the incoming migration
901 #                        stream will result in a report, and all further bitmap
902 #                        migration data will then be discarded.
903 #                        Note that the destination does not know about bitmaps it
904 #                        does not receive, so there is no limitation or requirement
905 #                        regarding the number of bitmaps received, or how they are
906 #                        named, or on which nodes they are placed.
907 #                        By default (when this parameter has never been set), bitmap
908 #                        names are mapped to themselves.  Nodes are mapped to their
909 #                        block device name if there is one, and to their node name
910 #                        otherwise. (Since 5.2)
912 # Since: 2.4
914 # TODO either fuse back into MigrationParameters, or make
915 # MigrationParameters members mandatory
916 { 'struct': 'MigrateSetParameters',
917   'data': { '*announce-initial': 'size',
918             '*announce-max': 'size',
919             '*announce-rounds': 'size',
920             '*announce-step': 'size',
921             '*compress-level': 'uint8',
922             '*compress-threads': 'uint8',
923             '*compress-wait-thread': 'bool',
924             '*decompress-threads': 'uint8',
925             '*throttle-trigger-threshold': 'uint8',
926             '*cpu-throttle-initial': 'uint8',
927             '*cpu-throttle-increment': 'uint8',
928             '*cpu-throttle-tailslow': 'bool',
929             '*tls-creds': 'StrOrNull',
930             '*tls-hostname': 'StrOrNull',
931             '*tls-authz': 'StrOrNull',
932             '*max-bandwidth': 'size',
933             '*downtime-limit': 'uint64',
934             '*x-checkpoint-delay': 'uint32',
935             '*block-incremental': 'bool',
936             '*multifd-channels': 'uint8',
937             '*xbzrle-cache-size': 'size',
938             '*max-postcopy-bandwidth': 'size',
939             '*max-cpu-throttle': 'uint8',
940             '*multifd-compression': 'MultiFDCompression',
941             '*multifd-zlib-level': 'uint8',
942             '*multifd-zstd-level': 'uint8',
943             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
946 # @migrate-set-parameters:
948 # Set various migration parameters.
950 # Since: 2.4
952 # Example:
954 # -> { "execute": "migrate-set-parameters" ,
955 #      "arguments": { "compress-level": 1 } }
958 { 'command': 'migrate-set-parameters', 'boxed': true,
959   'data': 'MigrateSetParameters' }
962 # @MigrationParameters:
964 # The optional members aren't actually optional.
966 # @announce-initial: Initial delay (in milliseconds) before sending the
967 #                    first announce (Since 4.0)
969 # @announce-max: Maximum delay (in milliseconds) between packets in the
970 #                announcement (Since 4.0)
972 # @announce-rounds: Number of self-announce packets sent after migration
973 #                   (Since 4.0)
975 # @announce-step: Increase in delay (in milliseconds) between subsequent
976 #                 packets in the announcement (Since 4.0)
978 # @compress-level: compression level
980 # @compress-threads: compression thread count
982 # @compress-wait-thread: Controls behavior when all compression threads are
983 #                        currently busy. If true (default), wait for a free
984 #                        compression thread to become available; otherwise,
985 #                        send the page uncompressed. (Since 3.1)
987 # @decompress-threads: decompression thread count
989 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
990 #                              to trigger throttling. It is expressed as percentage.
991 #                              The default value is 50. (Since 5.0)
993 # @cpu-throttle-initial: Initial percentage of time guest cpus are
994 #                        throttled when migration auto-converge is activated.
995 #                        (Since 2.7)
997 # @cpu-throttle-increment: throttle percentage increase each time
998 #                          auto-converge detects that migration is not making
999 #                          progress. (Since 2.7)
1001 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
1002 #                         At the tail stage of throttling, the Guest is very
1003 #                         sensitive to CPU percentage while the @cpu-throttle
1004 #                         -increment is excessive usually at tail stage.
1005 #                         If this parameter is true, we will compute the ideal
1006 #                         CPU percentage used by the Guest, which may exactly make
1007 #                         the dirty rate match the dirty rate threshold. Then we
1008 #                         will choose a smaller throttle increment between the
1009 #                         one specified by @cpu-throttle-increment and the one
1010 #                         generated by ideal CPU percentage.
1011 #                         Therefore, it is compatible to traditional throttling,
1012 #                         meanwhile the throttle increment won't be excessive
1013 #                         at tail stage.
1014 #                         The default value is false. (Since 5.1)
1016 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1017 #             for establishing a TLS connection over the migration data
1018 #             channel. On the outgoing side of the migration, the credentials
1019 #             must be for a 'client' endpoint, while for the incoming side the
1020 #             credentials must be for a 'server' endpoint.
1021 #             An empty string means that QEMU will use plain text mode for
1022 #             migration, rather than TLS (Since 2.7)
1023 #             Note: 2.8 reports this by omitting tls-creds instead.
1025 # @tls-hostname: hostname of the target host for the migration. This
1026 #                is required when using x509 based TLS credentials and the
1027 #                migration URI does not already include a hostname. For
1028 #                example if using fd: or exec: based migration, the
1029 #                hostname must be provided so that the server's x509
1030 #                certificate identity can be validated. (Since 2.7)
1031 #                An empty string means that QEMU will use the hostname
1032 #                associated with the migration URI, if any. (Since 2.9)
1033 #                Note: 2.8 reports this by omitting tls-hostname instead.
1035 # @tls-authz: ID of the 'authz' object subclass that provides access control
1036 #             checking of the TLS x509 certificate distinguished name. (Since
1037 #             4.0)
1039 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1040 #                 bytes per second. (Since 2.8)
1042 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1043 #                  downtime in milliseconds (Since 2.8)
1045 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1047 # @block-incremental: Affects how much storage is migrated when the
1048 #                     block migration capability is enabled.  When false, the entire
1049 #                     storage backing chain is migrated into a flattened image at
1050 #                     the destination; when true, only the active qcow2 layer is
1051 #                     migrated and the destination must already have access to the
1052 #                     same backing chain as was used on the source.  (since 2.10)
1054 # @multifd-channels: Number of channels used to migrate data in
1055 #                    parallel. This is the same number that the
1056 #                    number of sockets used for migration.
1057 #                    The default value is 2 (since 4.0)
1059 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
1060 #                     needs to be a multiple of the target page size
1061 #                     and a power of 2
1062 #                     (Since 2.11)
1064 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
1065 #                          Defaults to 0 (unlimited).  In bytes per second.
1066 #                          (Since 3.0)
1068 # @max-cpu-throttle: maximum cpu throttle percentage.
1069 #                    Defaults to 99.
1070 #                    (Since 3.1)
1072 # @multifd-compression: Which compression method to use.
1073 #                       Defaults to none. (Since 5.0)
1075 # @multifd-zlib-level: Set the compression level to be used in live
1076 #                      migration, the compression level is an integer between 0
1077 #                      and 9, where 0 means no compression, 1 means the best
1078 #                      compression speed, and 9 means best compression ratio which
1079 #                      will consume more CPU.
1080 #                      Defaults to 1. (Since 5.0)
1082 # @multifd-zstd-level: Set the compression level to be used in live
1083 #                      migration, the compression level is an integer between 0
1084 #                      and 20, where 0 means no compression, 1 means the best
1085 #                      compression speed, and 20 means best compression ratio which
1086 #                      will consume more CPU.
1087 #                      Defaults to 1. (Since 5.0)
1089 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1090 #                        aliases for the purpose of dirty bitmap migration.  Such
1091 #                        aliases may for example be the corresponding names on the
1092 #                        opposite site.
1093 #                        The mapping must be one-to-one, but not necessarily
1094 #                        complete: On the source, unmapped bitmaps and all bitmaps
1095 #                        on unmapped nodes will be ignored.  On the destination,
1096 #                        encountering an unmapped alias in the incoming migration
1097 #                        stream will result in a report, and all further bitmap
1098 #                        migration data will then be discarded.
1099 #                        Note that the destination does not know about bitmaps it
1100 #                        does not receive, so there is no limitation or requirement
1101 #                        regarding the number of bitmaps received, or how they are
1102 #                        named, or on which nodes they are placed.
1103 #                        By default (when this parameter has never been set), bitmap
1104 #                        names are mapped to themselves.  Nodes are mapped to their
1105 #                        block device name if there is one, and to their node name
1106 #                        otherwise. (Since 5.2)
1108 # Since: 2.4
1110 { 'struct': 'MigrationParameters',
1111   'data': { '*announce-initial': 'size',
1112             '*announce-max': 'size',
1113             '*announce-rounds': 'size',
1114             '*announce-step': 'size',
1115             '*compress-level': 'uint8',
1116             '*compress-threads': 'uint8',
1117             '*compress-wait-thread': 'bool',
1118             '*decompress-threads': 'uint8',
1119             '*throttle-trigger-threshold': 'uint8',
1120             '*cpu-throttle-initial': 'uint8',
1121             '*cpu-throttle-increment': 'uint8',
1122             '*cpu-throttle-tailslow': 'bool',
1123             '*tls-creds': 'str',
1124             '*tls-hostname': 'str',
1125             '*tls-authz': 'str',
1126             '*max-bandwidth': 'size',
1127             '*downtime-limit': 'uint64',
1128             '*x-checkpoint-delay': 'uint32',
1129             '*block-incremental': 'bool',
1130             '*multifd-channels': 'uint8',
1131             '*xbzrle-cache-size': 'size',
1132             '*max-postcopy-bandwidth': 'size',
1133             '*max-cpu-throttle': 'uint8',
1134             '*multifd-compression': 'MultiFDCompression',
1135             '*multifd-zlib-level': 'uint8',
1136             '*multifd-zstd-level': 'uint8',
1137             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
1140 # @query-migrate-parameters:
1142 # Returns information about the current migration parameters
1144 # Returns: @MigrationParameters
1146 # Since: 2.4
1148 # Example:
1150 # -> { "execute": "query-migrate-parameters" }
1151 # <- { "return": {
1152 #          "decompress-threads": 2,
1153 #          "cpu-throttle-increment": 10,
1154 #          "compress-threads": 8,
1155 #          "compress-level": 1,
1156 #          "cpu-throttle-initial": 20,
1157 #          "max-bandwidth": 33554432,
1158 #          "downtime-limit": 300
1159 #       }
1160 #    }
1163 { 'command': 'query-migrate-parameters',
1164   'returns': 'MigrationParameters' }
1167 # @client_migrate_info:
1169 # Set migration information for remote display.  This makes the server
1170 # ask the client to automatically reconnect using the new parameters
1171 # once migration finished successfully.  Only implemented for SPICE.
1173 # @protocol:     must be "spice"
1174 # @hostname:     migration target hostname
1175 # @port:         spice tcp port for plaintext channels
1176 # @tls-port:     spice tcp port for tls-secured channels
1177 # @cert-subject: server certificate subject
1179 # Since: 0.14
1181 # Example:
1183 # -> { "execute": "client_migrate_info",
1184 #      "arguments": { "protocol": "spice",
1185 #                     "hostname": "virt42.lab.kraxel.org",
1186 #                     "port": 1234 } }
1187 # <- { "return": {} }
1190 { 'command': 'client_migrate_info',
1191   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1192             '*tls-port': 'int', '*cert-subject': 'str' } }
1195 # @migrate-start-postcopy:
1197 # Followup to a migration command to switch the migration to postcopy mode.
1198 # The postcopy-ram capability must be set on both source and destination
1199 # before the original migration command.
1201 # Since: 2.5
1203 # Example:
1205 # -> { "execute": "migrate-start-postcopy" }
1206 # <- { "return": {} }
1209 { 'command': 'migrate-start-postcopy' }
1212 # @MIGRATION:
1214 # Emitted when a migration event happens
1216 # @status: @MigrationStatus describing the current migration status.
1218 # Since: 2.4
1220 # Example:
1222 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1223 #     "event": "MIGRATION",
1224 #     "data": {"status": "completed"} }
1227 { 'event': 'MIGRATION',
1228   'data': {'status': 'MigrationStatus'}}
1231 # @MIGRATION_PASS:
1233 # Emitted from the source side of a migration at the start of each pass
1234 # (when it syncs the dirty bitmap)
1236 # @pass: An incrementing count (starting at 1 on the first pass)
1238 # Since: 2.6
1240 # Example:
1242 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1243 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
1246 { 'event': 'MIGRATION_PASS',
1247   'data': { 'pass': 'int' } }
1250 # @COLOMessage:
1252 # The message transmission between Primary side and Secondary side.
1254 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1256 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1258 # @checkpoint-reply: SVM gets PVM's checkpoint request
1260 # @vmstate-send: VM's state will be sent by PVM.
1262 # @vmstate-size: The total size of VMstate.
1264 # @vmstate-received: VM's state has been received by SVM.
1266 # @vmstate-loaded: VM's state has been loaded by SVM.
1268 # Since: 2.8
1270 { 'enum': 'COLOMessage',
1271   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1272             'vmstate-send', 'vmstate-size', 'vmstate-received',
1273             'vmstate-loaded' ] }
1276 # @COLOMode:
1278 # The COLO current mode.
1280 # @none: COLO is disabled.
1282 # @primary: COLO node in primary side.
1284 # @secondary: COLO node in slave side.
1286 # Since: 2.8
1288 { 'enum': 'COLOMode',
1289   'data': [ 'none', 'primary', 'secondary'] }
1292 # @FailoverStatus:
1294 # An enumeration of COLO failover status
1296 # @none: no failover has ever happened
1298 # @require: got failover requirement but not handled
1300 # @active: in the process of doing failover
1302 # @completed: finish the process of failover
1304 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1306 # Since: 2.8
1308 { 'enum': 'FailoverStatus',
1309   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1312 # @COLO_EXIT:
1314 # Emitted when VM finishes COLO mode due to some errors happening or
1315 # at the request of users.
1317 # @mode: report COLO mode when COLO exited.
1319 # @reason: describes the reason for the COLO exit.
1321 # Since: 3.1
1323 # Example:
1325 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1326 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1329 { 'event': 'COLO_EXIT',
1330   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1333 # @COLOExitReason:
1335 # The reason for a COLO exit.
1337 # @none: failover has never happened. This state does not occur
1338 #        in the COLO_EXIT event, and is only visible in the result of
1339 #        query-colo-status.
1341 # @request: COLO exit is due to an external request.
1343 # @error: COLO exit is due to an internal error.
1345 # @processing: COLO is currently handling a failover (since 4.0).
1347 # Since: 3.1
1349 { 'enum': 'COLOExitReason',
1350   'data': [ 'none', 'request', 'error' , 'processing' ] }
1353 # @x-colo-lost-heartbeat:
1355 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1356 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1357 # If sent to the Secondary, the Secondary side will run failover work,
1358 # then takes over server operation to become the service VM.
1360 # Since: 2.8
1362 # Example:
1364 # -> { "execute": "x-colo-lost-heartbeat" }
1365 # <- { "return": {} }
1368 { 'command': 'x-colo-lost-heartbeat' }
1371 # @migrate_cancel:
1373 # Cancel the current executing migration process.
1375 # Returns: nothing on success
1377 # Notes: This command succeeds even if there is no migration process running.
1379 # Since: 0.14
1381 # Example:
1383 # -> { "execute": "migrate_cancel" }
1384 # <- { "return": {} }
1387 { 'command': 'migrate_cancel' }
1390 # @migrate-continue:
1392 # Continue migration when it's in a paused state.
1394 # @state: The state the migration is currently expected to be in
1396 # Returns: nothing on success
1397 # Since: 2.11
1398 # Example:
1400 # -> { "execute": "migrate-continue" , "arguments":
1401 #      { "state": "pre-switchover" } }
1402 # <- { "return": {} }
1404 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1407 # @migrate:
1409 # Migrates the current running guest to another Virtual Machine.
1411 # @uri: the Uniform Resource Identifier of the destination VM
1413 # @blk: do block migration (full disk copy)
1415 # @inc: incremental disk copy migration
1417 # @detach: this argument exists only for compatibility reasons and
1418 #          is ignored by QEMU
1420 # @resume: resume one paused migration, default "off". (since 3.0)
1422 # Returns: nothing on success
1424 # Since: 0.14
1426 # Notes:
1428 # 1. The 'query-migrate' command should be used to check migration's progress
1429 #    and final result (this information is provided by the 'status' member)
1431 # 2. All boolean arguments default to false
1433 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1434 #    be used
1436 # Example:
1438 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1439 # <- { "return": {} }
1442 { 'command': 'migrate',
1443   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1444            '*detach': 'bool', '*resume': 'bool' } }
1447 # @migrate-incoming:
1449 # Start an incoming migration, the qemu must have been started
1450 # with -incoming defer
1452 # @uri: The Uniform Resource Identifier identifying the source or
1453 #       address to listen on
1455 # Returns: nothing on success
1457 # Since: 2.3
1459 # Notes:
1461 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1462 #    compatible with -incoming and the format of the uri is already exposed
1463 #    above libvirt.
1465 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1466 #    be used.
1468 # 3. The uri format is the same as for -incoming
1470 # Example:
1472 # -> { "execute": "migrate-incoming",
1473 #      "arguments": { "uri": "tcp::4446" } }
1474 # <- { "return": {} }
1477 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1480 # @xen-save-devices-state:
1482 # Save the state of all devices to file. The RAM and the block devices
1483 # of the VM are not saved by this command.
1485 # @filename: the file to save the state of the devices to as binary
1486 #            data. See xen-save-devices-state.txt for a description of the binary
1487 #            format.
1489 # @live: Optional argument to ask QEMU to treat this command as part of a live
1490 #        migration. Default to true. (since 2.11)
1492 # Returns: Nothing on success
1494 # Since: 1.1
1496 # Example:
1498 # -> { "execute": "xen-save-devices-state",
1499 #      "arguments": { "filename": "/tmp/save" } }
1500 # <- { "return": {} }
1503 { 'command': 'xen-save-devices-state',
1504   'data': {'filename': 'str', '*live':'bool' } }
1507 # @xen-set-global-dirty-log:
1509 # Enable or disable the global dirty log mode.
1511 # @enable: true to enable, false to disable.
1513 # Returns: nothing
1515 # Since: 1.3
1517 # Example:
1519 # -> { "execute": "xen-set-global-dirty-log",
1520 #      "arguments": { "enable": true } }
1521 # <- { "return": {} }
1524 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1527 # @xen-load-devices-state:
1529 # Load the state of all devices from file. The RAM and the block devices
1530 # of the VM are not loaded by this command.
1532 # @filename: the file to load the state of the devices from as binary
1533 #            data. See xen-save-devices-state.txt for a description of the binary
1534 #            format.
1536 # Since: 2.7
1538 # Example:
1540 # -> { "execute": "xen-load-devices-state",
1541 #      "arguments": { "filename": "/tmp/resume" } }
1542 # <- { "return": {} }
1545 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1548 # @xen-set-replication:
1550 # Enable or disable replication.
1552 # @enable: true to enable, false to disable.
1554 # @primary: true for primary or false for secondary.
1556 # @failover: true to do failover, false to stop. but cannot be
1557 #            specified if 'enable' is true. default value is false.
1559 # Returns: nothing.
1561 # Example:
1563 # -> { "execute": "xen-set-replication",
1564 #      "arguments": {"enable": true, "primary": false} }
1565 # <- { "return": {} }
1567 # Since: 2.9
1569 { 'command': 'xen-set-replication',
1570   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1571   'if': 'defined(CONFIG_REPLICATION)' }
1574 # @ReplicationStatus:
1576 # The result format for 'query-xen-replication-status'.
1578 # @error: true if an error happened, false if replication is normal.
1580 # @desc: the human readable error description string, when
1581 #        @error is 'true'.
1583 # Since: 2.9
1585 { 'struct': 'ReplicationStatus',
1586   'data': { 'error': 'bool', '*desc': 'str' },
1587   'if': 'defined(CONFIG_REPLICATION)' }
1590 # @query-xen-replication-status:
1592 # Query replication status while the vm is running.
1594 # Returns: A @ReplicationResult object showing the status.
1596 # Example:
1598 # -> { "execute": "query-xen-replication-status" }
1599 # <- { "return": { "error": false } }
1601 # Since: 2.9
1603 { 'command': 'query-xen-replication-status',
1604   'returns': 'ReplicationStatus',
1605   'if': 'defined(CONFIG_REPLICATION)' }
1608 # @xen-colo-do-checkpoint:
1610 # Xen uses this command to notify replication to trigger a checkpoint.
1612 # Returns: nothing.
1614 # Example:
1616 # -> { "execute": "xen-colo-do-checkpoint" }
1617 # <- { "return": {} }
1619 # Since: 2.9
1621 { 'command': 'xen-colo-do-checkpoint',
1622   'if': 'defined(CONFIG_REPLICATION)' }
1625 # @COLOStatus:
1627 # The result format for 'query-colo-status'.
1629 # @mode: COLO running mode. If COLO is running, this field will return
1630 #        'primary' or 'secondary'.
1632 # @last-mode: COLO last running mode. If COLO is running, this field
1633 #             will return same like mode field, after failover we can
1634 #             use this field to get last colo mode. (since 4.0)
1636 # @reason: describes the reason for the COLO exit.
1638 # Since: 3.1
1640 { 'struct': 'COLOStatus',
1641   'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1642             'reason': 'COLOExitReason' } }
1645 # @query-colo-status:
1647 # Query COLO status while the vm is running.
1649 # Returns: A @COLOStatus object showing the status.
1651 # Example:
1653 # -> { "execute": "query-colo-status" }
1654 # <- { "return": { "mode": "primary", "reason": "request" } }
1656 # Since: 3.1
1658 { 'command': 'query-colo-status',
1659   'returns': 'COLOStatus' }
1662 # @migrate-recover:
1664 # Provide a recovery migration stream URI.
1666 # @uri: the URI to be used for the recovery of migration stream.
1668 # Returns: nothing.
1670 # Example:
1672 # -> { "execute": "migrate-recover",
1673 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1674 # <- { "return": {} }
1676 # Since: 3.0
1678 { 'command': 'migrate-recover',
1679   'data': { 'uri': 'str' },
1680   'allow-oob': true }
1683 # @migrate-pause:
1685 # Pause a migration.  Currently it only supports postcopy.
1687 # Returns: nothing.
1689 # Example:
1691 # -> { "execute": "migrate-pause" }
1692 # <- { "return": {} }
1694 # Since: 3.0
1696 { 'command': 'migrate-pause', 'allow-oob': true }
1699 # @UNPLUG_PRIMARY:
1701 # Emitted from source side of a migration when migration state is
1702 # WAIT_UNPLUG. Device was unplugged by guest operating system.
1703 # Device resources in QEMU are kept on standby to be able to re-plug it in case
1704 # of migration failure.
1706 # @device-id: QEMU device id of the unplugged device
1708 # Since: 4.2
1710 # Example:
1711 #   {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1714 { 'event': 'UNPLUG_PRIMARY',
1715   'data': { 'device-id': 'str' } }
1718 # @DirtyRateStatus:
1720 # An enumeration of dirtyrate status.
1722 # @unstarted: the dirtyrate thread has not been started.
1724 # @measuring: the dirtyrate thread is measuring.
1726 # @measured: the dirtyrate thread has measured and results are available.
1728 # Since: 5.2
1731 { 'enum': 'DirtyRateStatus',
1732   'data': [ 'unstarted', 'measuring', 'measured'] }
1735 # @DirtyRateInfo:
1737 # Information about current dirty page rate of vm.
1739 # @dirty-rate: an estimate of the dirty page rate of the VM in units of
1740 #              MB/s, present only when estimating the rate has completed.
1742 # @status: status containing dirtyrate query status includes
1743 #          'unstarted' or 'measuring' or 'measured'
1745 # @start-time: start time in units of second for calculation
1747 # @calc-time: time in units of second for sample dirty pages
1749 # Since: 5.2
1752 { 'struct': 'DirtyRateInfo',
1753   'data': {'*dirty-rate': 'int64',
1754            'status': 'DirtyRateStatus',
1755            'start-time': 'int64',
1756            'calc-time': 'int64'} }
1759 # @calc-dirty-rate:
1761 # start calculating dirty page rate for vm
1763 # @calc-time: time in units of second for sample dirty pages
1765 # Since: 5.2
1767 # Example:
1768 #   {"command": "calc-dirty-rate", "data": {"calc-time": 1} }
1771 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64'} }
1774 # @query-dirty-rate:
1776 # query dirty page rate in units of MB/s for vm
1778 # Since: 5.2
1780 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1783 # @snapshot-save:
1785 # Save a VM snapshot
1787 # @job-id: identifier for the newly created job
1788 # @tag: name of the snapshot to create
1789 # @vmstate: block device node name to save vmstate to
1790 # @devices: list of block device node names to save a snapshot to
1792 # Applications should not assume that the snapshot save is complete
1793 # when this command returns. The job commands / events must be used
1794 # to determine completion and to fetch details of any errors that arise.
1796 # Note that execution of the guest CPUs may be stopped during the
1797 # time it takes to save the snapshot. A future version of QEMU
1798 # may ensure CPUs are executing continuously.
1800 # It is strongly recommended that @devices contain all writable
1801 # block device nodes if a consistent snapshot is required.
1803 # If @tag already exists, an error will be reported
1805 # Returns: nothing
1807 # Example:
1809 # -> { "execute": "snapshot-save",
1810 #      "data": {
1811 #         "job-id": "snapsave0",
1812 #         "tag": "my-snap",
1813 #         "vmstate": "disk0",
1814 #         "devices": ["disk0", "disk1"]
1815 #      }
1816 #    }
1817 # <- { "return": { } }
1818 # <- {"event": "JOB_STATUS_CHANGE",
1819 #     "data": {"status": "created", "id": "snapsave0"}}
1820 # <- {"event": "JOB_STATUS_CHANGE",
1821 #     "data": {"status": "running", "id": "snapsave0"}}
1822 # <- {"event": "STOP"}
1823 # <- {"event": "RESUME"}
1824 # <- {"event": "JOB_STATUS_CHANGE",
1825 #     "data": {"status": "waiting", "id": "snapsave0"}}
1826 # <- {"event": "JOB_STATUS_CHANGE",
1827 #     "data": {"status": "pending", "id": "snapsave0"}}
1828 # <- {"event": "JOB_STATUS_CHANGE",
1829 #     "data": {"status": "concluded", "id": "snapsave0"}}
1830 # -> {"execute": "query-jobs"}
1831 # <- {"return": [{"current-progress": 1,
1832 #                 "status": "concluded",
1833 #                 "total-progress": 1,
1834 #                 "type": "snapshot-save",
1835 #                 "id": "snapsave0"}]}
1837 # Since: 6.0
1839 { 'command': 'snapshot-save',
1840   'data': { 'job-id': 'str',
1841             'tag': 'str',
1842             'vmstate': 'str',
1843             'devices': ['str'] } }
1846 # @snapshot-load:
1848 # Load a VM snapshot
1850 # @job-id: identifier for the newly created job
1851 # @tag: name of the snapshot to load.
1852 # @vmstate: block device node name to load vmstate from
1853 # @devices: list of block device node names to load a snapshot from
1855 # Applications should not assume that the snapshot load is complete
1856 # when this command returns. The job commands / events must be used
1857 # to determine completion and to fetch details of any errors that arise.
1859 # Note that execution of the guest CPUs will be stopped during the
1860 # time it takes to load the snapshot.
1862 # It is strongly recommended that @devices contain all writable
1863 # block device nodes that can have changed since the original
1864 # @snapshot-save command execution.
1866 # Returns: nothing
1868 # Example:
1870 # -> { "execute": "snapshot-load",
1871 #      "data": {
1872 #         "job-id": "snapload0",
1873 #         "tag": "my-snap",
1874 #         "vmstate": "disk0",
1875 #         "devices": ["disk0", "disk1"]
1876 #      }
1877 #    }
1878 # <- { "return": { } }
1879 # <- {"event": "JOB_STATUS_CHANGE",
1880 #     "data": {"status": "created", "id": "snapload0"}}
1881 # <- {"event": "JOB_STATUS_CHANGE",
1882 #     "data": {"status": "running", "id": "snapload0"}}
1883 # <- {"event": "STOP"}
1884 # <- {"event": "RESUME"}
1885 # <- {"event": "JOB_STATUS_CHANGE",
1886 #     "data": {"status": "waiting", "id": "snapload0"}}
1887 # <- {"event": "JOB_STATUS_CHANGE",
1888 #     "data": {"status": "pending", "id": "snapload0"}}
1889 # <- {"event": "JOB_STATUS_CHANGE",
1890 #     "data": {"status": "concluded", "id": "snapload0"}}
1891 # -> {"execute": "query-jobs"}
1892 # <- {"return": [{"current-progress": 1,
1893 #                 "status": "concluded",
1894 #                 "total-progress": 1,
1895 #                 "type": "snapshot-load",
1896 #                 "id": "snapload0"}]}
1898 # Since: 6.0
1900 { 'command': 'snapshot-load',
1901   'data': { 'job-id': 'str',
1902             'tag': 'str',
1903             'vmstate': 'str',
1904             'devices': ['str'] } }
1907 # @snapshot-delete:
1909 # Delete a VM snapshot
1911 # @job-id: identifier for the newly created job
1912 # @tag: name of the snapshot to delete.
1913 # @devices: list of block device node names to delete a snapshot from
1915 # Applications should not assume that the snapshot delete is complete
1916 # when this command returns. The job commands / events must be used
1917 # to determine completion and to fetch details of any errors that arise.
1919 # Returns: nothing
1921 # Example:
1923 # -> { "execute": "snapshot-delete",
1924 #      "data": {
1925 #         "job-id": "snapdelete0",
1926 #         "tag": "my-snap",
1927 #         "devices": ["disk0", "disk1"]
1928 #      }
1929 #    }
1930 # <- { "return": { } }
1931 # <- {"event": "JOB_STATUS_CHANGE",
1932 #     "data": {"status": "created", "id": "snapdelete0"}}
1933 # <- {"event": "JOB_STATUS_CHANGE",
1934 #     "data": {"status": "running", "id": "snapdelete0"}}
1935 # <- {"event": "JOB_STATUS_CHANGE",
1936 #     "data": {"status": "waiting", "id": "snapdelete0"}}
1937 # <- {"event": "JOB_STATUS_CHANGE",
1938 #     "data": {"status": "pending", "id": "snapdelete0"}}
1939 # <- {"event": "JOB_STATUS_CHANGE",
1940 #     "data": {"status": "concluded", "id": "snapdelete0"}}
1941 # -> {"execute": "query-jobs"}
1942 # <- {"return": [{"current-progress": 1,
1943 #                 "status": "concluded",
1944 #                 "total-progress": 1,
1945 #                 "type": "snapshot-delete",
1946 #                 "id": "snapdelete0"}]}
1948 # Since: 6.0
1950 { 'command': 'snapshot-delete',
1951   'data': { 'job-id': 'str',
1952             'tag': 'str',
1953             'devices': ['str'] } }