target/arm: Implement SVE2 saturating extract narrow
[qemu/ar7.git] / qapi / migration.json
blob7a5bdf9a0dad333059c097f9158ae805d9158075
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 # Since: 0.14
233 { 'struct': 'MigrationInfo',
234   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
235            '*disk': 'MigrationStats',
236            '*vfio': 'VfioStats',
237            '*xbzrle-cache': 'XBZRLECacheStats',
238            '*total-time': 'int',
239            '*expected-downtime': 'int',
240            '*downtime': 'int',
241            '*setup-time': 'int',
242            '*cpu-throttle-percentage': 'int',
243            '*error-desc': 'str',
244            '*blocked-reasons': ['str'],
245            '*postcopy-blocktime' : 'uint32',
246            '*postcopy-vcpu-blocktime': ['uint32'],
247            '*compression': 'CompressionStats',
248            '*socket-address': ['SocketAddress'] } }
251 # @query-migrate:
253 # Returns information about current migration process. If migration
254 # is active there will be another json-object with RAM migration
255 # status and if block migration is active another one with block
256 # migration status.
258 # Returns: @MigrationInfo
260 # Since: 0.14
262 # Example:
264 # 1. Before the first migration
266 # -> { "execute": "query-migrate" }
267 # <- { "return": {} }
269 # 2. Migration is done and has succeeded
271 # -> { "execute": "query-migrate" }
272 # <- { "return": {
273 #         "status": "completed",
274 #         "total-time":12345,
275 #         "setup-time":12345,
276 #         "downtime":12345,
277 #         "ram":{
278 #           "transferred":123,
279 #           "remaining":123,
280 #           "total":246,
281 #           "duplicate":123,
282 #           "normal":123,
283 #           "normal-bytes":123456,
284 #           "dirty-sync-count":15
285 #         }
286 #      }
287 #    }
289 # 3. Migration is done and has failed
291 # -> { "execute": "query-migrate" }
292 # <- { "return": { "status": "failed" } }
294 # 4. Migration is being performed and is not a block migration:
296 # -> { "execute": "query-migrate" }
297 # <- {
298 #       "return":{
299 #          "status":"active",
300 #          "total-time":12345,
301 #          "setup-time":12345,
302 #          "expected-downtime":12345,
303 #          "ram":{
304 #             "transferred":123,
305 #             "remaining":123,
306 #             "total":246,
307 #             "duplicate":123,
308 #             "normal":123,
309 #             "normal-bytes":123456,
310 #             "dirty-sync-count":15
311 #          }
312 #       }
313 #    }
315 # 5. Migration is being performed and is a block migration:
317 # -> { "execute": "query-migrate" }
318 # <- {
319 #       "return":{
320 #          "status":"active",
321 #          "total-time":12345,
322 #          "setup-time":12345,
323 #          "expected-downtime":12345,
324 #          "ram":{
325 #             "total":1057024,
326 #             "remaining":1053304,
327 #             "transferred":3720,
328 #             "duplicate":123,
329 #             "normal":123,
330 #             "normal-bytes":123456,
331 #             "dirty-sync-count":15
332 #          },
333 #          "disk":{
334 #             "total":20971520,
335 #             "remaining":20880384,
336 #             "transferred":91136
337 #          }
338 #       }
339 #    }
341 # 6. Migration is being performed and XBZRLE is active:
343 # -> { "execute": "query-migrate" }
344 # <- {
345 #       "return":{
346 #          "status":"active",
347 #          "total-time":12345,
348 #          "setup-time":12345,
349 #          "expected-downtime":12345,
350 #          "ram":{
351 #             "total":1057024,
352 #             "remaining":1053304,
353 #             "transferred":3720,
354 #             "duplicate":10,
355 #             "normal":3333,
356 #             "normal-bytes":3412992,
357 #             "dirty-sync-count":15
358 #          },
359 #          "xbzrle-cache":{
360 #             "cache-size":67108864,
361 #             "bytes":20971520,
362 #             "pages":2444343,
363 #             "cache-miss":2244,
364 #             "cache-miss-rate":0.123,
365 #             "encoding-rate":80.1,
366 #             "overflow":34434
367 #          }
368 #       }
369 #    }
372 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
375 # @MigrationCapability:
377 # Migration capabilities enumeration
379 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
380 #          This feature allows us to minimize migration traffic for certain work
381 #          loads, by sending compressed difference of the pages
383 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
384 #                mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
385 #                Disabled by default. (since 2.0)
387 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
388 #               essentially saves 1MB of zeroes per block on the wire. Enabling requires
389 #               source and target VM to support this feature. To enable it is sufficient
390 #               to enable the capability on the source VM. The feature is disabled by
391 #               default. (since 1.6)
393 # @compress: Use multiple compression threads to accelerate live migration.
394 #            This feature can help to reduce the migration traffic, by sending
395 #            compressed pages. Please note that if compress and xbzrle are both
396 #            on, compress only takes effect in the ram bulk stage, after that,
397 #            it will be disabled and only xbzrle takes effect, this can help to
398 #            minimize migration traffic. The feature is disabled by default.
399 #            (since 2.4 )
401 # @events: generate events for each migration state change
402 #          (since 2.4 )
404 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
405 #                 to speed up convergence of RAM migration. (since 1.6)
407 # @postcopy-ram: Start executing on the migration target before all of RAM has
408 #                been migrated, pulling the remaining pages along as needed. The
409 #                capacity must have the same setting on both source and target
410 #                or migration will not even start. NOTE: If the migration fails during
411 #                postcopy the VM will fail.  (since 2.6)
413 # @x-colo: If enabled, migration will never end, and the state of the VM on the
414 #          primary side will be migrated continuously to the VM on secondary
415 #          side, this process is called COarse-Grain LOck Stepping (COLO) for
416 #          Non-stop Service. (since 2.8)
418 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
419 #               during postcopy-ram migration. (since 2.9)
421 # @block: If enabled, QEMU will also migrate the contents of all block
422 #         devices.  Default is disabled.  A possible alternative uses
423 #         mirror jobs to a builtin NBD server on the destination, which
424 #         offers more flexibility.
425 #         (Since 2.10)
427 # @return-path: If enabled, migration will use the return path even
428 #               for precopy. (since 2.10)
430 # @pause-before-switchover: Pause outgoing migration before serialising device
431 #                           state and before disabling block IO (since 2.11)
433 # @multifd: Use more than one fd for migration (since 4.0)
435 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
436 #                 (since 2.12)
438 # @postcopy-blocktime: Calculate downtime for postcopy live migration
439 #                      (since 3.0)
441 # @late-block-activate: If enabled, the destination will not activate block
442 #                       devices (and thus take locks) immediately at the end of migration.
443 #                       (since 3.0)
445 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
447 # @validate-uuid: Send the UUID of the source to allow the destination
448 #                 to ensure it is the same. (since 4.2)
450 # @background-snapshot: If enabled, the migration stream will be a snapshot
451 #                       of the VM exactly at the point when the migration
452 #                       procedure starts. The VM RAM is saved with running VM.
453 #                       (since 6.0)
455 # Since: 1.2
457 { 'enum': 'MigrationCapability',
458   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
459            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
460            'block', 'return-path', 'pause-before-switchover', 'multifd',
461            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
462            'x-ignore-shared', 'validate-uuid', 'background-snapshot'] }
465 # @MigrationCapabilityStatus:
467 # Migration capability information
469 # @capability: capability enum
471 # @state: capability state bool
473 # Since: 1.2
475 { 'struct': 'MigrationCapabilityStatus',
476   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
479 # @migrate-set-capabilities:
481 # Enable/Disable the following migration capabilities (like xbzrle)
483 # @capabilities: json array of capability modifications to make
485 # Since: 1.2
487 # Example:
489 # -> { "execute": "migrate-set-capabilities" , "arguments":
490 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
493 { 'command': 'migrate-set-capabilities',
494   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
497 # @query-migrate-capabilities:
499 # Returns information about the current migration capabilities status
501 # Returns: @MigrationCapabilitiesStatus
503 # Since: 1.2
505 # Example:
507 # -> { "execute": "query-migrate-capabilities" }
508 # <- { "return": [
509 #       {"state": false, "capability": "xbzrle"},
510 #       {"state": false, "capability": "rdma-pin-all"},
511 #       {"state": false, "capability": "auto-converge"},
512 #       {"state": false, "capability": "zero-blocks"},
513 #       {"state": false, "capability": "compress"},
514 #       {"state": true, "capability": "events"},
515 #       {"state": false, "capability": "postcopy-ram"},
516 #       {"state": false, "capability": "x-colo"}
517 #    ]}
520 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
523 # @MultiFDCompression:
525 # An enumeration of multifd compression methods.
527 # @none: no compression.
528 # @zlib: use zlib compression method.
529 # @zstd: use zstd compression method.
531 # Since: 5.0
534 { 'enum': 'MultiFDCompression',
535   'data': [ 'none', 'zlib',
536             { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
539 # @BitmapMigrationBitmapAliasTransform:
541 # @persistent: If present, the bitmap will be made persistent
542 #              or transient depending on this parameter.
544 # Since: 6.0
546 { 'struct': 'BitmapMigrationBitmapAliasTransform',
547   'data': {
548       '*persistent': 'bool'
549   } }
552 # @BitmapMigrationBitmapAlias:
554 # @name: The name of the bitmap.
556 # @alias: An alias name for migration (for example the bitmap name on
557 #         the opposite site).
559 # @transform: Allows the modification of the migrated bitmap.
560 #             (since 6.0)
562 # Since: 5.2
564 { 'struct': 'BitmapMigrationBitmapAlias',
565   'data': {
566       'name': 'str',
567       'alias': 'str',
568       '*transform': 'BitmapMigrationBitmapAliasTransform'
569   } }
572 # @BitmapMigrationNodeAlias:
574 # Maps a block node name and the bitmaps it has to aliases for dirty
575 # bitmap migration.
577 # @node-name: A block node name.
579 # @alias: An alias block node name for migration (for example the
580 #         node name on the opposite site).
582 # @bitmaps: Mappings for the bitmaps on this node.
584 # Since: 5.2
586 { 'struct': 'BitmapMigrationNodeAlias',
587   'data': {
588       'node-name': 'str',
589       'alias': 'str',
590       'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
591   } }
594 # @MigrationParameter:
596 # Migration parameters enumeration
598 # @announce-initial: Initial delay (in milliseconds) before sending the first
599 #                    announce (Since 4.0)
601 # @announce-max: Maximum delay (in milliseconds) between packets in the
602 #                announcement (Since 4.0)
604 # @announce-rounds: Number of self-announce packets sent after migration
605 #                   (Since 4.0)
607 # @announce-step: Increase in delay (in milliseconds) between subsequent
608 #                 packets in the announcement (Since 4.0)
610 # @compress-level: Set the compression level to be used in live migration,
611 #                  the compression level is an integer between 0 and 9, where 0 means
612 #                  no compression, 1 means the best compression speed, and 9 means best
613 #                  compression ratio which will consume more CPU.
615 # @compress-threads: Set compression thread count to be used in live migration,
616 #                    the compression thread count is an integer between 1 and 255.
618 # @compress-wait-thread: Controls behavior when all compression threads are
619 #                        currently busy. If true (default), wait for a free
620 #                        compression thread to become available; otherwise,
621 #                        send the page uncompressed. (Since 3.1)
623 # @decompress-threads: Set decompression thread count to be used in live
624 #                      migration, the decompression thread count is an integer between 1
625 #                      and 255. Usually, decompression is at least 4 times as fast as
626 #                      compression, so set the decompress-threads to the number about 1/4
627 #                      of compress-threads is adequate.
629 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
630 #                              to trigger throttling. It is expressed as percentage.
631 #                              The default value is 50. (Since 5.0)
633 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
634 #                        when migration auto-converge is activated. The
635 #                        default value is 20. (Since 2.7)
637 # @cpu-throttle-increment: throttle percentage increase each time
638 #                          auto-converge detects that migration is not making
639 #                          progress. The default value is 10. (Since 2.7)
641 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
642 #                         At the tail stage of throttling, the Guest is very
643 #                         sensitive to CPU percentage while the @cpu-throttle
644 #                         -increment is excessive usually at tail stage.
645 #                         If this parameter is true, we will compute the ideal
646 #                         CPU percentage used by the Guest, which may exactly make
647 #                         the dirty rate match the dirty rate threshold. Then we
648 #                         will choose a smaller throttle increment between the
649 #                         one specified by @cpu-throttle-increment and the one
650 #                         generated by ideal CPU percentage.
651 #                         Therefore, it is compatible to traditional throttling,
652 #                         meanwhile the throttle increment won't be excessive
653 #                         at tail stage.
654 #                         The default value is false. (Since 5.1)
656 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
657 #             establishing a TLS connection over the migration data channel.
658 #             On the outgoing side of the migration, the credentials must
659 #             be for a 'client' endpoint, while for the incoming side the
660 #             credentials must be for a 'server' endpoint. Setting this
661 #             will enable TLS for all migrations. The default is unset,
662 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
664 # @tls-hostname: hostname of the target host for the migration. This is
665 #                required when using x509 based TLS credentials and the
666 #                migration URI does not already include a hostname. For
667 #                example if using fd: or exec: based migration, the
668 #                hostname must be provided so that the server's x509
669 #                certificate identity can be validated. (Since 2.7)
671 # @tls-authz: ID of the 'authz' object subclass that provides access control
672 #             checking of the TLS x509 certificate distinguished name.
673 #             This object is only resolved at time of use, so can be deleted
674 #             and recreated on the fly while the migration server is active.
675 #             If missing, it will default to denying access (Since 4.0)
677 # @max-bandwidth: to set maximum speed for migration. maximum speed in
678 #                 bytes per second. (Since 2.8)
680 # @downtime-limit: set maximum tolerated downtime for migration. maximum
681 #                  downtime in milliseconds (Since 2.8)
683 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
684 #                      periodic mode. (Since 2.8)
686 # @block-incremental: Affects how much storage is migrated when the
687 #                     block migration capability is enabled.  When false, the entire
688 #                     storage backing chain is migrated into a flattened image at
689 #                     the destination; when true, only the active qcow2 layer is
690 #                     migrated and the destination must already have access to the
691 #                     same backing chain as was used on the source.  (since 2.10)
693 # @multifd-channels: Number of channels used to migrate data in
694 #                    parallel. This is the same number that the
695 #                    number of sockets used for migration.  The
696 #                    default value is 2 (since 4.0)
698 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
699 #                     needs to be a multiple of the target page size
700 #                     and a power of 2
701 #                     (Since 2.11)
703 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
704 #                          Defaults to 0 (unlimited).  In bytes per second.
705 #                          (Since 3.0)
707 # @max-cpu-throttle: maximum cpu throttle percentage.
708 #                    Defaults to 99. (Since 3.1)
710 # @multifd-compression: Which compression method to use.
711 #                       Defaults to none. (Since 5.0)
713 # @multifd-zlib-level: Set the compression level to be used in live
714 #                      migration, the compression level is an integer between 0
715 #                      and 9, where 0 means no compression, 1 means the best
716 #                      compression speed, and 9 means best compression ratio which
717 #                      will consume more CPU.
718 #                      Defaults to 1. (Since 5.0)
720 # @multifd-zstd-level: Set the compression level to be used in live
721 #                      migration, the compression level is an integer between 0
722 #                      and 20, where 0 means no compression, 1 means the best
723 #                      compression speed, and 20 means best compression ratio which
724 #                      will consume more CPU.
725 #                      Defaults to 1. (Since 5.0)
727 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
728 #                        aliases for the purpose of dirty bitmap migration.  Such
729 #                        aliases may for example be the corresponding names on the
730 #                        opposite site.
731 #                        The mapping must be one-to-one, but not necessarily
732 #                        complete: On the source, unmapped bitmaps and all bitmaps
733 #                        on unmapped nodes will be ignored.  On the destination,
734 #                        encountering an unmapped alias in the incoming migration
735 #                        stream will result in a report, and all further bitmap
736 #                        migration data will then be discarded.
737 #                        Note that the destination does not know about bitmaps it
738 #                        does not receive, so there is no limitation or requirement
739 #                        regarding the number of bitmaps received, or how they are
740 #                        named, or on which nodes they are placed.
741 #                        By default (when this parameter has never been set), bitmap
742 #                        names are mapped to themselves.  Nodes are mapped to their
743 #                        block device name if there is one, and to their node name
744 #                        otherwise. (Since 5.2)
746 # Since: 2.4
748 { 'enum': 'MigrationParameter',
749   'data': ['announce-initial', 'announce-max',
750            'announce-rounds', 'announce-step',
751            'compress-level', 'compress-threads', 'decompress-threads',
752            'compress-wait-thread', 'throttle-trigger-threshold',
753            'cpu-throttle-initial', 'cpu-throttle-increment',
754            'cpu-throttle-tailslow',
755            'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
756            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
757            'multifd-channels',
758            'xbzrle-cache-size', 'max-postcopy-bandwidth',
759            'max-cpu-throttle', 'multifd-compression',
760            'multifd-zlib-level' ,'multifd-zstd-level',
761            'block-bitmap-mapping' ] }
764 # @MigrateSetParameters:
766 # @announce-initial: Initial delay (in milliseconds) before sending the first
767 #                    announce (Since 4.0)
769 # @announce-max: Maximum delay (in milliseconds) between packets in the
770 #                announcement (Since 4.0)
772 # @announce-rounds: Number of self-announce packets sent after migration
773 #                   (Since 4.0)
775 # @announce-step: Increase in delay (in milliseconds) between subsequent
776 #                 packets in the announcement (Since 4.0)
778 # @compress-level: compression level
780 # @compress-threads: compression thread count
782 # @compress-wait-thread: Controls behavior when all compression threads are
783 #                        currently busy. If true (default), wait for a free
784 #                        compression thread to become available; otherwise,
785 #                        send the page uncompressed. (Since 3.1)
787 # @decompress-threads: decompression thread count
789 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
790 #                              to trigger throttling. It is expressed as percentage.
791 #                              The default value is 50. (Since 5.0)
793 # @cpu-throttle-initial: Initial percentage of time guest cpus are
794 #                        throttled when migration auto-converge is activated.
795 #                        The default value is 20. (Since 2.7)
797 # @cpu-throttle-increment: throttle percentage increase each time
798 #                          auto-converge detects that migration is not making
799 #                          progress. The default value is 10. (Since 2.7)
801 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
802 #                         At the tail stage of throttling, the Guest is very
803 #                         sensitive to CPU percentage while the @cpu-throttle
804 #                         -increment is excessive usually at tail stage.
805 #                         If this parameter is true, we will compute the ideal
806 #                         CPU percentage used by the Guest, which may exactly make
807 #                         the dirty rate match the dirty rate threshold. Then we
808 #                         will choose a smaller throttle increment between the
809 #                         one specified by @cpu-throttle-increment and the one
810 #                         generated by ideal CPU percentage.
811 #                         Therefore, it is compatible to traditional throttling,
812 #                         meanwhile the throttle increment won't be excessive
813 #                         at tail stage.
814 #                         The default value is false. (Since 5.1)
816 # @tls-creds: ID of the 'tls-creds' object that provides credentials
817 #             for establishing a TLS connection over the migration data
818 #             channel. On the outgoing side of the migration, the credentials
819 #             must be for a 'client' endpoint, while for the incoming side the
820 #             credentials must be for a 'server' endpoint. Setting this
821 #             to a non-empty string enables TLS for all migrations.
822 #             An empty string means that QEMU will use plain text mode for
823 #             migration, rather than TLS (Since 2.9)
824 #             Previously (since 2.7), this was reported by omitting
825 #             tls-creds instead.
827 # @tls-hostname: hostname of the target host for the migration. This
828 #                is required when using x509 based TLS credentials and the
829 #                migration URI does not already include a hostname. For
830 #                example if using fd: or exec: based migration, the
831 #                hostname must be provided so that the server's x509
832 #                certificate identity can be validated. (Since 2.7)
833 #                An empty string means that QEMU will use the hostname
834 #                associated with the migration URI, if any. (Since 2.9)
835 #                Previously (since 2.7), this was reported by omitting
836 #                tls-hostname instead.
838 # @max-bandwidth: to set maximum speed for migration. maximum speed in
839 #                 bytes per second. (Since 2.8)
841 # @downtime-limit: set maximum tolerated downtime for migration. maximum
842 #                  downtime in milliseconds (Since 2.8)
844 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
846 # @block-incremental: Affects how much storage is migrated when the
847 #                     block migration capability is enabled.  When false, the entire
848 #                     storage backing chain is migrated into a flattened image at
849 #                     the destination; when true, only the active qcow2 layer is
850 #                     migrated and the destination must already have access to the
851 #                     same backing chain as was used on the source.  (since 2.10)
853 # @multifd-channels: Number of channels used to migrate data in
854 #                    parallel. This is the same number that the
855 #                    number of sockets used for migration.  The
856 #                    default value is 2 (since 4.0)
858 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
859 #                     needs to be a multiple of the target page size
860 #                     and a power of 2
861 #                     (Since 2.11)
863 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
864 #                          Defaults to 0 (unlimited).  In bytes per second.
865 #                          (Since 3.0)
867 # @max-cpu-throttle: maximum cpu throttle percentage.
868 #                    The default value is 99. (Since 3.1)
870 # @multifd-compression: Which compression method to use.
871 #                       Defaults to none. (Since 5.0)
873 # @multifd-zlib-level: Set the compression level to be used in live
874 #                      migration, the compression level is an integer between 0
875 #                      and 9, where 0 means no compression, 1 means the best
876 #                      compression speed, and 9 means best compression ratio which
877 #                      will consume more CPU.
878 #                      Defaults to 1. (Since 5.0)
880 # @multifd-zstd-level: Set the compression level to be used in live
881 #                      migration, the compression level is an integer between 0
882 #                      and 20, where 0 means no compression, 1 means the best
883 #                      compression speed, and 20 means best compression ratio which
884 #                      will consume more CPU.
885 #                      Defaults to 1. (Since 5.0)
887 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
888 #                        aliases for the purpose of dirty bitmap migration.  Such
889 #                        aliases may for example be the corresponding names on the
890 #                        opposite site.
891 #                        The mapping must be one-to-one, but not necessarily
892 #                        complete: On the source, unmapped bitmaps and all bitmaps
893 #                        on unmapped nodes will be ignored.  On the destination,
894 #                        encountering an unmapped alias in the incoming migration
895 #                        stream will result in a report, and all further bitmap
896 #                        migration data will then be discarded.
897 #                        Note that the destination does not know about bitmaps it
898 #                        does not receive, so there is no limitation or requirement
899 #                        regarding the number of bitmaps received, or how they are
900 #                        named, or on which nodes they are placed.
901 #                        By default (when this parameter has never been set), bitmap
902 #                        names are mapped to themselves.  Nodes are mapped to their
903 #                        block device name if there is one, and to their node name
904 #                        otherwise. (Since 5.2)
906 # Since: 2.4
908 # TODO either fuse back into MigrationParameters, or make
909 # MigrationParameters members mandatory
910 { 'struct': 'MigrateSetParameters',
911   'data': { '*announce-initial': 'size',
912             '*announce-max': 'size',
913             '*announce-rounds': 'size',
914             '*announce-step': 'size',
915             '*compress-level': 'uint8',
916             '*compress-threads': 'uint8',
917             '*compress-wait-thread': 'bool',
918             '*decompress-threads': 'uint8',
919             '*throttle-trigger-threshold': 'uint8',
920             '*cpu-throttle-initial': 'uint8',
921             '*cpu-throttle-increment': 'uint8',
922             '*cpu-throttle-tailslow': 'bool',
923             '*tls-creds': 'StrOrNull',
924             '*tls-hostname': 'StrOrNull',
925             '*tls-authz': 'StrOrNull',
926             '*max-bandwidth': 'size',
927             '*downtime-limit': 'uint64',
928             '*x-checkpoint-delay': 'uint32',
929             '*block-incremental': 'bool',
930             '*multifd-channels': 'uint8',
931             '*xbzrle-cache-size': 'size',
932             '*max-postcopy-bandwidth': 'size',
933             '*max-cpu-throttle': 'uint8',
934             '*multifd-compression': 'MultiFDCompression',
935             '*multifd-zlib-level': 'uint8',
936             '*multifd-zstd-level': 'uint8',
937             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
940 # @migrate-set-parameters:
942 # Set various migration parameters.
944 # Since: 2.4
946 # Example:
948 # -> { "execute": "migrate-set-parameters" ,
949 #      "arguments": { "compress-level": 1 } }
952 { 'command': 'migrate-set-parameters', 'boxed': true,
953   'data': 'MigrateSetParameters' }
956 # @MigrationParameters:
958 # The optional members aren't actually optional.
960 # @announce-initial: Initial delay (in milliseconds) before sending the
961 #                    first announce (Since 4.0)
963 # @announce-max: Maximum delay (in milliseconds) between packets in the
964 #                announcement (Since 4.0)
966 # @announce-rounds: Number of self-announce packets sent after migration
967 #                   (Since 4.0)
969 # @announce-step: Increase in delay (in milliseconds) between subsequent
970 #                 packets in the announcement (Since 4.0)
972 # @compress-level: compression level
974 # @compress-threads: compression thread count
976 # @compress-wait-thread: Controls behavior when all compression threads are
977 #                        currently busy. If true (default), wait for a free
978 #                        compression thread to become available; otherwise,
979 #                        send the page uncompressed. (Since 3.1)
981 # @decompress-threads: decompression thread count
983 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
984 #                              to trigger throttling. It is expressed as percentage.
985 #                              The default value is 50. (Since 5.0)
987 # @cpu-throttle-initial: Initial percentage of time guest cpus are
988 #                        throttled when migration auto-converge is activated.
989 #                        (Since 2.7)
991 # @cpu-throttle-increment: throttle percentage increase each time
992 #                          auto-converge detects that migration is not making
993 #                          progress. (Since 2.7)
995 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
996 #                         At the tail stage of throttling, the Guest is very
997 #                         sensitive to CPU percentage while the @cpu-throttle
998 #                         -increment is excessive usually at tail stage.
999 #                         If this parameter is true, we will compute the ideal
1000 #                         CPU percentage used by the Guest, which may exactly make
1001 #                         the dirty rate match the dirty rate threshold. Then we
1002 #                         will choose a smaller throttle increment between the
1003 #                         one specified by @cpu-throttle-increment and the one
1004 #                         generated by ideal CPU percentage.
1005 #                         Therefore, it is compatible to traditional throttling,
1006 #                         meanwhile the throttle increment won't be excessive
1007 #                         at tail stage.
1008 #                         The default value is false. (Since 5.1)
1010 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1011 #             for establishing a TLS connection over the migration data
1012 #             channel. On the outgoing side of the migration, the credentials
1013 #             must be for a 'client' endpoint, while for the incoming side the
1014 #             credentials must be for a 'server' endpoint.
1015 #             An empty string means that QEMU will use plain text mode for
1016 #             migration, rather than TLS (Since 2.7)
1017 #             Note: 2.8 reports this by omitting tls-creds instead.
1019 # @tls-hostname: hostname of the target host for the migration. This
1020 #                is required when using x509 based TLS credentials and the
1021 #                migration URI does not already include a hostname. For
1022 #                example if using fd: or exec: based migration, the
1023 #                hostname must be provided so that the server's x509
1024 #                certificate identity can be validated. (Since 2.7)
1025 #                An empty string means that QEMU will use the hostname
1026 #                associated with the migration URI, if any. (Since 2.9)
1027 #                Note: 2.8 reports this by omitting tls-hostname instead.
1029 # @tls-authz: ID of the 'authz' object subclass that provides access control
1030 #             checking of the TLS x509 certificate distinguished name. (Since
1031 #             4.0)
1033 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1034 #                 bytes per second. (Since 2.8)
1036 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1037 #                  downtime in milliseconds (Since 2.8)
1039 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1041 # @block-incremental: Affects how much storage is migrated when the
1042 #                     block migration capability is enabled.  When false, the entire
1043 #                     storage backing chain is migrated into a flattened image at
1044 #                     the destination; when true, only the active qcow2 layer is
1045 #                     migrated and the destination must already have access to the
1046 #                     same backing chain as was used on the source.  (since 2.10)
1048 # @multifd-channels: Number of channels used to migrate data in
1049 #                    parallel. This is the same number that the
1050 #                    number of sockets used for migration.
1051 #                    The default value is 2 (since 4.0)
1053 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
1054 #                     needs to be a multiple of the target page size
1055 #                     and a power of 2
1056 #                     (Since 2.11)
1058 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
1059 #                          Defaults to 0 (unlimited).  In bytes per second.
1060 #                          (Since 3.0)
1062 # @max-cpu-throttle: maximum cpu throttle percentage.
1063 #                    Defaults to 99.
1064 #                    (Since 3.1)
1066 # @multifd-compression: Which compression method to use.
1067 #                       Defaults to none. (Since 5.0)
1069 # @multifd-zlib-level: Set the compression level to be used in live
1070 #                      migration, the compression level is an integer between 0
1071 #                      and 9, where 0 means no compression, 1 means the best
1072 #                      compression speed, and 9 means best compression ratio which
1073 #                      will consume more CPU.
1074 #                      Defaults to 1. (Since 5.0)
1076 # @multifd-zstd-level: Set the compression level to be used in live
1077 #                      migration, the compression level is an integer between 0
1078 #                      and 20, where 0 means no compression, 1 means the best
1079 #                      compression speed, and 20 means best compression ratio which
1080 #                      will consume more CPU.
1081 #                      Defaults to 1. (Since 5.0)
1083 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1084 #                        aliases for the purpose of dirty bitmap migration.  Such
1085 #                        aliases may for example be the corresponding names on the
1086 #                        opposite site.
1087 #                        The mapping must be one-to-one, but not necessarily
1088 #                        complete: On the source, unmapped bitmaps and all bitmaps
1089 #                        on unmapped nodes will be ignored.  On the destination,
1090 #                        encountering an unmapped alias in the incoming migration
1091 #                        stream will result in a report, and all further bitmap
1092 #                        migration data will then be discarded.
1093 #                        Note that the destination does not know about bitmaps it
1094 #                        does not receive, so there is no limitation or requirement
1095 #                        regarding the number of bitmaps received, or how they are
1096 #                        named, or on which nodes they are placed.
1097 #                        By default (when this parameter has never been set), bitmap
1098 #                        names are mapped to themselves.  Nodes are mapped to their
1099 #                        block device name if there is one, and to their node name
1100 #                        otherwise. (Since 5.2)
1102 # Since: 2.4
1104 { 'struct': 'MigrationParameters',
1105   'data': { '*announce-initial': 'size',
1106             '*announce-max': 'size',
1107             '*announce-rounds': 'size',
1108             '*announce-step': 'size',
1109             '*compress-level': 'uint8',
1110             '*compress-threads': 'uint8',
1111             '*compress-wait-thread': 'bool',
1112             '*decompress-threads': 'uint8',
1113             '*throttle-trigger-threshold': 'uint8',
1114             '*cpu-throttle-initial': 'uint8',
1115             '*cpu-throttle-increment': 'uint8',
1116             '*cpu-throttle-tailslow': 'bool',
1117             '*tls-creds': 'str',
1118             '*tls-hostname': 'str',
1119             '*tls-authz': 'str',
1120             '*max-bandwidth': 'size',
1121             '*downtime-limit': 'uint64',
1122             '*x-checkpoint-delay': 'uint32',
1123             '*block-incremental': 'bool',
1124             '*multifd-channels': 'uint8',
1125             '*xbzrle-cache-size': 'size',
1126             '*max-postcopy-bandwidth': 'size',
1127             '*max-cpu-throttle': 'uint8',
1128             '*multifd-compression': 'MultiFDCompression',
1129             '*multifd-zlib-level': 'uint8',
1130             '*multifd-zstd-level': 'uint8',
1131             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
1134 # @query-migrate-parameters:
1136 # Returns information about the current migration parameters
1138 # Returns: @MigrationParameters
1140 # Since: 2.4
1142 # Example:
1144 # -> { "execute": "query-migrate-parameters" }
1145 # <- { "return": {
1146 #          "decompress-threads": 2,
1147 #          "cpu-throttle-increment": 10,
1148 #          "compress-threads": 8,
1149 #          "compress-level": 1,
1150 #          "cpu-throttle-initial": 20,
1151 #          "max-bandwidth": 33554432,
1152 #          "downtime-limit": 300
1153 #       }
1154 #    }
1157 { 'command': 'query-migrate-parameters',
1158   'returns': 'MigrationParameters' }
1161 # @client_migrate_info:
1163 # Set migration information for remote display.  This makes the server
1164 # ask the client to automatically reconnect using the new parameters
1165 # once migration finished successfully.  Only implemented for SPICE.
1167 # @protocol:     must be "spice"
1168 # @hostname:     migration target hostname
1169 # @port:         spice tcp port for plaintext channels
1170 # @tls-port:     spice tcp port for tls-secured channels
1171 # @cert-subject: server certificate subject
1173 # Since: 0.14
1175 # Example:
1177 # -> { "execute": "client_migrate_info",
1178 #      "arguments": { "protocol": "spice",
1179 #                     "hostname": "virt42.lab.kraxel.org",
1180 #                     "port": 1234 } }
1181 # <- { "return": {} }
1184 { 'command': 'client_migrate_info',
1185   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1186             '*tls-port': 'int', '*cert-subject': 'str' } }
1189 # @migrate-start-postcopy:
1191 # Followup to a migration command to switch the migration to postcopy mode.
1192 # The postcopy-ram capability must be set on both source and destination
1193 # before the original migration command.
1195 # Since: 2.5
1197 # Example:
1199 # -> { "execute": "migrate-start-postcopy" }
1200 # <- { "return": {} }
1203 { 'command': 'migrate-start-postcopy' }
1206 # @MIGRATION:
1208 # Emitted when a migration event happens
1210 # @status: @MigrationStatus describing the current migration status.
1212 # Since: 2.4
1214 # Example:
1216 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1217 #     "event": "MIGRATION",
1218 #     "data": {"status": "completed"} }
1221 { 'event': 'MIGRATION',
1222   'data': {'status': 'MigrationStatus'}}
1225 # @MIGRATION_PASS:
1227 # Emitted from the source side of a migration at the start of each pass
1228 # (when it syncs the dirty bitmap)
1230 # @pass: An incrementing count (starting at 1 on the first pass)
1232 # Since: 2.6
1234 # Example:
1236 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1237 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
1240 { 'event': 'MIGRATION_PASS',
1241   'data': { 'pass': 'int' } }
1244 # @COLOMessage:
1246 # The message transmission between Primary side and Secondary side.
1248 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1250 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1252 # @checkpoint-reply: SVM gets PVM's checkpoint request
1254 # @vmstate-send: VM's state will be sent by PVM.
1256 # @vmstate-size: The total size of VMstate.
1258 # @vmstate-received: VM's state has been received by SVM.
1260 # @vmstate-loaded: VM's state has been loaded by SVM.
1262 # Since: 2.8
1264 { 'enum': 'COLOMessage',
1265   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1266             'vmstate-send', 'vmstate-size', 'vmstate-received',
1267             'vmstate-loaded' ] }
1270 # @COLOMode:
1272 # The COLO current mode.
1274 # @none: COLO is disabled.
1276 # @primary: COLO node in primary side.
1278 # @secondary: COLO node in slave side.
1280 # Since: 2.8
1282 { 'enum': 'COLOMode',
1283   'data': [ 'none', 'primary', 'secondary'] }
1286 # @FailoverStatus:
1288 # An enumeration of COLO failover status
1290 # @none: no failover has ever happened
1292 # @require: got failover requirement but not handled
1294 # @active: in the process of doing failover
1296 # @completed: finish the process of failover
1298 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1300 # Since: 2.8
1302 { 'enum': 'FailoverStatus',
1303   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1306 # @COLO_EXIT:
1308 # Emitted when VM finishes COLO mode due to some errors happening or
1309 # at the request of users.
1311 # @mode: report COLO mode when COLO exited.
1313 # @reason: describes the reason for the COLO exit.
1315 # Since: 3.1
1317 # Example:
1319 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1320 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1323 { 'event': 'COLO_EXIT',
1324   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1327 # @COLOExitReason:
1329 # The reason for a COLO exit.
1331 # @none: failover has never happened. This state does not occur
1332 #        in the COLO_EXIT event, and is only visible in the result of
1333 #        query-colo-status.
1335 # @request: COLO exit is due to an external request.
1337 # @error: COLO exit is due to an internal error.
1339 # @processing: COLO is currently handling a failover (since 4.0).
1341 # Since: 3.1
1343 { 'enum': 'COLOExitReason',
1344   'data': [ 'none', 'request', 'error' , 'processing' ] }
1347 # @x-colo-lost-heartbeat:
1349 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1350 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1351 # If sent to the Secondary, the Secondary side will run failover work,
1352 # then takes over server operation to become the service VM.
1354 # Since: 2.8
1356 # Example:
1358 # -> { "execute": "x-colo-lost-heartbeat" }
1359 # <- { "return": {} }
1362 { 'command': 'x-colo-lost-heartbeat' }
1365 # @migrate_cancel:
1367 # Cancel the current executing migration process.
1369 # Returns: nothing on success
1371 # Notes: This command succeeds even if there is no migration process running.
1373 # Since: 0.14
1375 # Example:
1377 # -> { "execute": "migrate_cancel" }
1378 # <- { "return": {} }
1381 { 'command': 'migrate_cancel' }
1384 # @migrate-continue:
1386 # Continue migration when it's in a paused state.
1388 # @state: The state the migration is currently expected to be in
1390 # Returns: nothing on success
1391 # Since: 2.11
1392 # Example:
1394 # -> { "execute": "migrate-continue" , "arguments":
1395 #      { "state": "pre-switchover" } }
1396 # <- { "return": {} }
1398 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1401 # @migrate:
1403 # Migrates the current running guest to another Virtual Machine.
1405 # @uri: the Uniform Resource Identifier of the destination VM
1407 # @blk: do block migration (full disk copy)
1409 # @inc: incremental disk copy migration
1411 # @detach: this argument exists only for compatibility reasons and
1412 #          is ignored by QEMU
1414 # @resume: resume one paused migration, default "off". (since 3.0)
1416 # Returns: nothing on success
1418 # Since: 0.14
1420 # Notes:
1422 # 1. The 'query-migrate' command should be used to check migration's progress
1423 #    and final result (this information is provided by the 'status' member)
1425 # 2. All boolean arguments default to false
1427 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1428 #    be used
1430 # Example:
1432 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1433 # <- { "return": {} }
1436 { 'command': 'migrate',
1437   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1438            '*detach': 'bool', '*resume': 'bool' } }
1441 # @migrate-incoming:
1443 # Start an incoming migration, the qemu must have been started
1444 # with -incoming defer
1446 # @uri: The Uniform Resource Identifier identifying the source or
1447 #       address to listen on
1449 # Returns: nothing on success
1451 # Since: 2.3
1453 # Notes:
1455 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1456 #    compatible with -incoming and the format of the uri is already exposed
1457 #    above libvirt.
1459 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1460 #    be used.
1462 # 3. The uri format is the same as for -incoming
1464 # Example:
1466 # -> { "execute": "migrate-incoming",
1467 #      "arguments": { "uri": "tcp::4446" } }
1468 # <- { "return": {} }
1471 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1474 # @xen-save-devices-state:
1476 # Save the state of all devices to file. The RAM and the block devices
1477 # of the VM are not saved by this command.
1479 # @filename: the file to save the state of the devices to as binary
1480 #            data. See xen-save-devices-state.txt for a description of the binary
1481 #            format.
1483 # @live: Optional argument to ask QEMU to treat this command as part of a live
1484 #        migration. Default to true. (since 2.11)
1486 # Returns: Nothing on success
1488 # Since: 1.1
1490 # Example:
1492 # -> { "execute": "xen-save-devices-state",
1493 #      "arguments": { "filename": "/tmp/save" } }
1494 # <- { "return": {} }
1497 { 'command': 'xen-save-devices-state',
1498   'data': {'filename': 'str', '*live':'bool' } }
1501 # @xen-set-global-dirty-log:
1503 # Enable or disable the global dirty log mode.
1505 # @enable: true to enable, false to disable.
1507 # Returns: nothing
1509 # Since: 1.3
1511 # Example:
1513 # -> { "execute": "xen-set-global-dirty-log",
1514 #      "arguments": { "enable": true } }
1515 # <- { "return": {} }
1518 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1521 # @xen-load-devices-state:
1523 # Load the state of all devices from file. The RAM and the block devices
1524 # of the VM are not loaded by this command.
1526 # @filename: the file to load the state of the devices from as binary
1527 #            data. See xen-save-devices-state.txt for a description of the binary
1528 #            format.
1530 # Since: 2.7
1532 # Example:
1534 # -> { "execute": "xen-load-devices-state",
1535 #      "arguments": { "filename": "/tmp/resume" } }
1536 # <- { "return": {} }
1539 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1542 # @xen-set-replication:
1544 # Enable or disable replication.
1546 # @enable: true to enable, false to disable.
1548 # @primary: true for primary or false for secondary.
1550 # @failover: true to do failover, false to stop. but cannot be
1551 #            specified if 'enable' is true. default value is false.
1553 # Returns: nothing.
1555 # Example:
1557 # -> { "execute": "xen-set-replication",
1558 #      "arguments": {"enable": true, "primary": false} }
1559 # <- { "return": {} }
1561 # Since: 2.9
1563 { 'command': 'xen-set-replication',
1564   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1565   'if': 'defined(CONFIG_REPLICATION)' }
1568 # @ReplicationStatus:
1570 # The result format for 'query-xen-replication-status'.
1572 # @error: true if an error happened, false if replication is normal.
1574 # @desc: the human readable error description string, when
1575 #        @error is 'true'.
1577 # Since: 2.9
1579 { 'struct': 'ReplicationStatus',
1580   'data': { 'error': 'bool', '*desc': 'str' },
1581   'if': 'defined(CONFIG_REPLICATION)' }
1584 # @query-xen-replication-status:
1586 # Query replication status while the vm is running.
1588 # Returns: A @ReplicationResult object showing the status.
1590 # Example:
1592 # -> { "execute": "query-xen-replication-status" }
1593 # <- { "return": { "error": false } }
1595 # Since: 2.9
1597 { 'command': 'query-xen-replication-status',
1598   'returns': 'ReplicationStatus',
1599   'if': 'defined(CONFIG_REPLICATION)' }
1602 # @xen-colo-do-checkpoint:
1604 # Xen uses this command to notify replication to trigger a checkpoint.
1606 # Returns: nothing.
1608 # Example:
1610 # -> { "execute": "xen-colo-do-checkpoint" }
1611 # <- { "return": {} }
1613 # Since: 2.9
1615 { 'command': 'xen-colo-do-checkpoint',
1616   'if': 'defined(CONFIG_REPLICATION)' }
1619 # @COLOStatus:
1621 # The result format for 'query-colo-status'.
1623 # @mode: COLO running mode. If COLO is running, this field will return
1624 #        'primary' or 'secondary'.
1626 # @last-mode: COLO last running mode. If COLO is running, this field
1627 #             will return same like mode field, after failover we can
1628 #             use this field to get last colo mode. (since 4.0)
1630 # @reason: describes the reason for the COLO exit.
1632 # Since: 3.1
1634 { 'struct': 'COLOStatus',
1635   'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1636             'reason': 'COLOExitReason' } }
1639 # @query-colo-status:
1641 # Query COLO status while the vm is running.
1643 # Returns: A @COLOStatus object showing the status.
1645 # Example:
1647 # -> { "execute": "query-colo-status" }
1648 # <- { "return": { "mode": "primary", "reason": "request" } }
1650 # Since: 3.1
1652 { 'command': 'query-colo-status',
1653   'returns': 'COLOStatus' }
1656 # @migrate-recover:
1658 # Provide a recovery migration stream URI.
1660 # @uri: the URI to be used for the recovery of migration stream.
1662 # Returns: nothing.
1664 # Example:
1666 # -> { "execute": "migrate-recover",
1667 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1668 # <- { "return": {} }
1670 # Since: 3.0
1672 { 'command': 'migrate-recover',
1673   'data': { 'uri': 'str' },
1674   'allow-oob': true }
1677 # @migrate-pause:
1679 # Pause a migration.  Currently it only supports postcopy.
1681 # Returns: nothing.
1683 # Example:
1685 # -> { "execute": "migrate-pause" }
1686 # <- { "return": {} }
1688 # Since: 3.0
1690 { 'command': 'migrate-pause', 'allow-oob': true }
1693 # @UNPLUG_PRIMARY:
1695 # Emitted from source side of a migration when migration state is
1696 # WAIT_UNPLUG. Device was unplugged by guest operating system.
1697 # Device resources in QEMU are kept on standby to be able to re-plug it in case
1698 # of migration failure.
1700 # @device-id: QEMU device id of the unplugged device
1702 # Since: 4.2
1704 # Example:
1705 #   {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1708 { 'event': 'UNPLUG_PRIMARY',
1709   'data': { 'device-id': 'str' } }
1712 # @DirtyRateStatus:
1714 # An enumeration of dirtyrate status.
1716 # @unstarted: the dirtyrate thread has not been started.
1718 # @measuring: the dirtyrate thread is measuring.
1720 # @measured: the dirtyrate thread has measured and results are available.
1722 # Since: 5.2
1725 { 'enum': 'DirtyRateStatus',
1726   'data': [ 'unstarted', 'measuring', 'measured'] }
1729 # @DirtyRateInfo:
1731 # Information about current dirty page rate of vm.
1733 # @dirty-rate: an estimate of the dirty page rate of the VM in units of
1734 #              MB/s, present only when estimating the rate has completed.
1736 # @status: status containing dirtyrate query status includes
1737 #          'unstarted' or 'measuring' or 'measured'
1739 # @start-time: start time in units of second for calculation
1741 # @calc-time: time in units of second for sample dirty pages
1743 # Since: 5.2
1746 { 'struct': 'DirtyRateInfo',
1747   'data': {'*dirty-rate': 'int64',
1748            'status': 'DirtyRateStatus',
1749            'start-time': 'int64',
1750            'calc-time': 'int64'} }
1753 # @calc-dirty-rate:
1755 # start calculating dirty page rate for vm
1757 # @calc-time: time in units of second for sample dirty pages
1759 # Since: 5.2
1761 # Example:
1762 #   {"command": "calc-dirty-rate", "data": {"calc-time": 1} }
1765 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64'} }
1768 # @query-dirty-rate:
1770 # query dirty page rate in units of MB/s for vm
1772 # Since: 5.2
1774 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1777 # @snapshot-save:
1779 # Save a VM snapshot
1781 # @job-id: identifier for the newly created job
1782 # @tag: name of the snapshot to create
1783 # @vmstate: block device node name to save vmstate to
1784 # @devices: list of block device node names to save a snapshot to
1786 # Applications should not assume that the snapshot save is complete
1787 # when this command returns. The job commands / events must be used
1788 # to determine completion and to fetch details of any errors that arise.
1790 # Note that execution of the guest CPUs may be stopped during the
1791 # time it takes to save the snapshot. A future version of QEMU
1792 # may ensure CPUs are executing continuously.
1794 # It is strongly recommended that @devices contain all writable
1795 # block device nodes if a consistent snapshot is required.
1797 # If @tag already exists, an error will be reported
1799 # Returns: nothing
1801 # Example:
1803 # -> { "execute": "snapshot-save",
1804 #      "data": {
1805 #         "job-id": "snapsave0",
1806 #         "tag": "my-snap",
1807 #         "vmstate": "disk0",
1808 #         "devices": ["disk0", "disk1"]
1809 #      }
1810 #    }
1811 # <- { "return": { } }
1812 # <- {"event": "JOB_STATUS_CHANGE",
1813 #     "data": {"status": "created", "id": "snapsave0"}}
1814 # <- {"event": "JOB_STATUS_CHANGE",
1815 #     "data": {"status": "running", "id": "snapsave0"}}
1816 # <- {"event": "STOP"}
1817 # <- {"event": "RESUME"}
1818 # <- {"event": "JOB_STATUS_CHANGE",
1819 #     "data": {"status": "waiting", "id": "snapsave0"}}
1820 # <- {"event": "JOB_STATUS_CHANGE",
1821 #     "data": {"status": "pending", "id": "snapsave0"}}
1822 # <- {"event": "JOB_STATUS_CHANGE",
1823 #     "data": {"status": "concluded", "id": "snapsave0"}}
1824 # -> {"execute": "query-jobs"}
1825 # <- {"return": [{"current-progress": 1,
1826 #                 "status": "concluded",
1827 #                 "total-progress": 1,
1828 #                 "type": "snapshot-save",
1829 #                 "id": "snapsave0"}]}
1831 # Since: 6.0
1833 { 'command': 'snapshot-save',
1834   'data': { 'job-id': 'str',
1835             'tag': 'str',
1836             'vmstate': 'str',
1837             'devices': ['str'] } }
1840 # @snapshot-load:
1842 # Load a VM snapshot
1844 # @job-id: identifier for the newly created job
1845 # @tag: name of the snapshot to load.
1846 # @vmstate: block device node name to load vmstate from
1847 # @devices: list of block device node names to load a snapshot from
1849 # Applications should not assume that the snapshot load is complete
1850 # when this command returns. The job commands / events must be used
1851 # to determine completion and to fetch details of any errors that arise.
1853 # Note that execution of the guest CPUs will be stopped during the
1854 # time it takes to load the snapshot.
1856 # It is strongly recommended that @devices contain all writable
1857 # block device nodes that can have changed since the original
1858 # @snapshot-save command execution.
1860 # Returns: nothing
1862 # Example:
1864 # -> { "execute": "snapshot-load",
1865 #      "data": {
1866 #         "job-id": "snapload0",
1867 #         "tag": "my-snap",
1868 #         "vmstate": "disk0",
1869 #         "devices": ["disk0", "disk1"]
1870 #      }
1871 #    }
1872 # <- { "return": { } }
1873 # <- {"event": "JOB_STATUS_CHANGE",
1874 #     "data": {"status": "created", "id": "snapload0"}}
1875 # <- {"event": "JOB_STATUS_CHANGE",
1876 #     "data": {"status": "running", "id": "snapload0"}}
1877 # <- {"event": "STOP"}
1878 # <- {"event": "RESUME"}
1879 # <- {"event": "JOB_STATUS_CHANGE",
1880 #     "data": {"status": "waiting", "id": "snapload0"}}
1881 # <- {"event": "JOB_STATUS_CHANGE",
1882 #     "data": {"status": "pending", "id": "snapload0"}}
1883 # <- {"event": "JOB_STATUS_CHANGE",
1884 #     "data": {"status": "concluded", "id": "snapload0"}}
1885 # -> {"execute": "query-jobs"}
1886 # <- {"return": [{"current-progress": 1,
1887 #                 "status": "concluded",
1888 #                 "total-progress": 1,
1889 #                 "type": "snapshot-load",
1890 #                 "id": "snapload0"}]}
1892 # Since: 6.0
1894 { 'command': 'snapshot-load',
1895   'data': { 'job-id': 'str',
1896             'tag': 'str',
1897             'vmstate': 'str',
1898             'devices': ['str'] } }
1901 # @snapshot-delete:
1903 # Delete a VM snapshot
1905 # @job-id: identifier for the newly created job
1906 # @tag: name of the snapshot to delete.
1907 # @devices: list of block device node names to delete a snapshot from
1909 # Applications should not assume that the snapshot delete is complete
1910 # when this command returns. The job commands / events must be used
1911 # to determine completion and to fetch details of any errors that arise.
1913 # Returns: nothing
1915 # Example:
1917 # -> { "execute": "snapshot-delete",
1918 #      "data": {
1919 #         "job-id": "snapdelete0",
1920 #         "tag": "my-snap",
1921 #         "devices": ["disk0", "disk1"]
1922 #      }
1923 #    }
1924 # <- { "return": { } }
1925 # <- {"event": "JOB_STATUS_CHANGE",
1926 #     "data": {"status": "created", "id": "snapdelete0"}}
1927 # <- {"event": "JOB_STATUS_CHANGE",
1928 #     "data": {"status": "running", "id": "snapdelete0"}}
1929 # <- {"event": "JOB_STATUS_CHANGE",
1930 #     "data": {"status": "waiting", "id": "snapdelete0"}}
1931 # <- {"event": "JOB_STATUS_CHANGE",
1932 #     "data": {"status": "pending", "id": "snapdelete0"}}
1933 # <- {"event": "JOB_STATUS_CHANGE",
1934 #     "data": {"status": "concluded", "id": "snapdelete0"}}
1935 # -> {"execute": "query-jobs"}
1936 # <- {"return": [{"current-progress": 1,
1937 #                 "status": "concluded",
1938 #                 "total-progress": 1,
1939 #                 "type": "snapshot-delete",
1940 #                 "id": "snapdelete0"}]}
1942 # Since: 6.0
1944 { 'command': 'snapshot-delete',
1945   'data': { 'job-id': 'str',
1946             'tag': 'str',
1947             'devices': ['str'] } }