ppc/pnv: move nest_regs_mr to PnvPHB4
[qemu.git] / qapi / migration.json
blobbbfd48cf0b170f8400fa33e8261a6d18cb41dc82
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 # Features:
456 # @unstable: Members @x-colo and @x-ignore-shared are experimental.
458 # Since: 1.2
460 { 'enum': 'MigrationCapability',
461   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
462            'compress', 'events', 'postcopy-ram',
463            { 'name': 'x-colo', 'features': [ 'unstable' ] },
464            'release-ram',
465            'block', 'return-path', 'pause-before-switchover', 'multifd',
466            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
467            { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
468            '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': '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 # Features:
753 # @unstable: Member @x-checkpoint-delay is experimental.
755 # Since: 2.4
757 { 'enum': 'MigrationParameter',
758   'data': ['announce-initial', 'announce-max',
759            'announce-rounds', 'announce-step',
760            'compress-level', 'compress-threads', 'decompress-threads',
761            'compress-wait-thread', 'throttle-trigger-threshold',
762            'cpu-throttle-initial', 'cpu-throttle-increment',
763            'cpu-throttle-tailslow',
764            'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
765            'downtime-limit',
766            { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
767            'block-incremental',
768            'multifd-channels',
769            'xbzrle-cache-size', 'max-postcopy-bandwidth',
770            'max-cpu-throttle', 'multifd-compression',
771            'multifd-zlib-level' ,'multifd-zstd-level',
772            'block-bitmap-mapping' ] }
775 # @MigrateSetParameters:
777 # @announce-initial: Initial delay (in milliseconds) before sending the first
778 #                    announce (Since 4.0)
780 # @announce-max: Maximum delay (in milliseconds) between packets in the
781 #                announcement (Since 4.0)
783 # @announce-rounds: Number of self-announce packets sent after migration
784 #                   (Since 4.0)
786 # @announce-step: Increase in delay (in milliseconds) between subsequent
787 #                 packets in the announcement (Since 4.0)
789 # @compress-level: compression level
791 # @compress-threads: compression thread count
793 # @compress-wait-thread: Controls behavior when all compression threads are
794 #                        currently busy. If true (default), wait for a free
795 #                        compression thread to become available; otherwise,
796 #                        send the page uncompressed. (Since 3.1)
798 # @decompress-threads: decompression thread count
800 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
801 #                              to trigger throttling. It is expressed as percentage.
802 #                              The default value is 50. (Since 5.0)
804 # @cpu-throttle-initial: Initial percentage of time guest cpus are
805 #                        throttled when migration auto-converge is activated.
806 #                        The default value is 20. (Since 2.7)
808 # @cpu-throttle-increment: throttle percentage increase each time
809 #                          auto-converge detects that migration is not making
810 #                          progress. The default value is 10. (Since 2.7)
812 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
813 #                         At the tail stage of throttling, the Guest is very
814 #                         sensitive to CPU percentage while the @cpu-throttle
815 #                         -increment is excessive usually at tail stage.
816 #                         If this parameter is true, we will compute the ideal
817 #                         CPU percentage used by the Guest, which may exactly make
818 #                         the dirty rate match the dirty rate threshold. Then we
819 #                         will choose a smaller throttle increment between the
820 #                         one specified by @cpu-throttle-increment and the one
821 #                         generated by ideal CPU percentage.
822 #                         Therefore, it is compatible to traditional throttling,
823 #                         meanwhile the throttle increment won't be excessive
824 #                         at tail stage.
825 #                         The default value is false. (Since 5.1)
827 # @tls-creds: ID of the 'tls-creds' object that provides credentials
828 #             for establishing a TLS connection over the migration data
829 #             channel. On the outgoing side of the migration, the credentials
830 #             must be for a 'client' endpoint, while for the incoming side the
831 #             credentials must be for a 'server' endpoint. Setting this
832 #             to a non-empty string enables TLS for all migrations.
833 #             An empty string means that QEMU will use plain text mode for
834 #             migration, rather than TLS (Since 2.9)
835 #             Previously (since 2.7), this was reported by omitting
836 #             tls-creds instead.
838 # @tls-hostname: hostname of the target host for the migration. This
839 #                is required when using x509 based TLS credentials and the
840 #                migration URI does not already include a hostname. For
841 #                example if using fd: or exec: based migration, the
842 #                hostname must be provided so that the server's x509
843 #                certificate identity can be validated. (Since 2.7)
844 #                An empty string means that QEMU will use the hostname
845 #                associated with the migration URI, if any. (Since 2.9)
846 #                Previously (since 2.7), this was reported by omitting
847 #                tls-hostname instead.
849 # @max-bandwidth: to set maximum speed for migration. maximum speed in
850 #                 bytes per second. (Since 2.8)
852 # @downtime-limit: set maximum tolerated downtime for migration. maximum
853 #                  downtime in milliseconds (Since 2.8)
855 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
857 # @block-incremental: Affects how much storage is migrated when the
858 #                     block migration capability is enabled.  When false, the entire
859 #                     storage backing chain is migrated into a flattened image at
860 #                     the destination; when true, only the active qcow2 layer is
861 #                     migrated and the destination must already have access to the
862 #                     same backing chain as was used on the source.  (since 2.10)
864 # @multifd-channels: Number of channels used to migrate data in
865 #                    parallel. This is the same number that the
866 #                    number of sockets used for migration.  The
867 #                    default value is 2 (since 4.0)
869 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
870 #                     needs to be a multiple of the target page size
871 #                     and a power of 2
872 #                     (Since 2.11)
874 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
875 #                          Defaults to 0 (unlimited).  In bytes per second.
876 #                          (Since 3.0)
878 # @max-cpu-throttle: maximum cpu throttle percentage.
879 #                    The default value is 99. (Since 3.1)
881 # @multifd-compression: Which compression method to use.
882 #                       Defaults to none. (Since 5.0)
884 # @multifd-zlib-level: Set the compression level to be used in live
885 #                      migration, the compression level is an integer between 0
886 #                      and 9, where 0 means no compression, 1 means the best
887 #                      compression speed, and 9 means best compression ratio which
888 #                      will consume more CPU.
889 #                      Defaults to 1. (Since 5.0)
891 # @multifd-zstd-level: Set the compression level to be used in live
892 #                      migration, the compression level is an integer between 0
893 #                      and 20, where 0 means no compression, 1 means the best
894 #                      compression speed, and 20 means best compression ratio which
895 #                      will consume more CPU.
896 #                      Defaults to 1. (Since 5.0)
898 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
899 #                        aliases for the purpose of dirty bitmap migration.  Such
900 #                        aliases may for example be the corresponding names on the
901 #                        opposite site.
902 #                        The mapping must be one-to-one, but not necessarily
903 #                        complete: On the source, unmapped bitmaps and all bitmaps
904 #                        on unmapped nodes will be ignored.  On the destination,
905 #                        encountering an unmapped alias in the incoming migration
906 #                        stream will result in a report, and all further bitmap
907 #                        migration data will then be discarded.
908 #                        Note that the destination does not know about bitmaps it
909 #                        does not receive, so there is no limitation or requirement
910 #                        regarding the number of bitmaps received, or how they are
911 #                        named, or on which nodes they are placed.
912 #                        By default (when this parameter has never been set), bitmap
913 #                        names are mapped to themselves.  Nodes are mapped to their
914 #                        block device name if there is one, and to their node name
915 #                        otherwise. (Since 5.2)
917 # Features:
918 # @unstable: Member @x-checkpoint-delay is experimental.
920 # Since: 2.4
922 # TODO either fuse back into MigrationParameters, or make
923 # MigrationParameters members mandatory
924 { 'struct': 'MigrateSetParameters',
925   'data': { '*announce-initial': 'size',
926             '*announce-max': 'size',
927             '*announce-rounds': 'size',
928             '*announce-step': 'size',
929             '*compress-level': 'uint8',
930             '*compress-threads': 'uint8',
931             '*compress-wait-thread': 'bool',
932             '*decompress-threads': 'uint8',
933             '*throttle-trigger-threshold': 'uint8',
934             '*cpu-throttle-initial': 'uint8',
935             '*cpu-throttle-increment': 'uint8',
936             '*cpu-throttle-tailslow': 'bool',
937             '*tls-creds': 'StrOrNull',
938             '*tls-hostname': 'StrOrNull',
939             '*tls-authz': 'StrOrNull',
940             '*max-bandwidth': 'size',
941             '*downtime-limit': 'uint64',
942             '*x-checkpoint-delay': { 'type': 'uint32',
943                                      'features': [ 'unstable' ] },
944             '*block-incremental': 'bool',
945             '*multifd-channels': 'uint8',
946             '*xbzrle-cache-size': 'size',
947             '*max-postcopy-bandwidth': 'size',
948             '*max-cpu-throttle': 'uint8',
949             '*multifd-compression': 'MultiFDCompression',
950             '*multifd-zlib-level': 'uint8',
951             '*multifd-zstd-level': 'uint8',
952             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
955 # @migrate-set-parameters:
957 # Set various migration parameters.
959 # Since: 2.4
961 # Example:
963 # -> { "execute": "migrate-set-parameters" ,
964 #      "arguments": { "compress-level": 1 } }
967 { 'command': 'migrate-set-parameters', 'boxed': true,
968   'data': 'MigrateSetParameters' }
971 # @MigrationParameters:
973 # The optional members aren't actually optional.
975 # @announce-initial: Initial delay (in milliseconds) before sending the
976 #                    first announce (Since 4.0)
978 # @announce-max: Maximum delay (in milliseconds) between packets in the
979 #                announcement (Since 4.0)
981 # @announce-rounds: Number of self-announce packets sent after migration
982 #                   (Since 4.0)
984 # @announce-step: Increase in delay (in milliseconds) between subsequent
985 #                 packets in the announcement (Since 4.0)
987 # @compress-level: compression level
989 # @compress-threads: compression thread count
991 # @compress-wait-thread: Controls behavior when all compression threads are
992 #                        currently busy. If true (default), wait for a free
993 #                        compression thread to become available; otherwise,
994 #                        send the page uncompressed. (Since 3.1)
996 # @decompress-threads: decompression thread count
998 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
999 #                              to trigger throttling. It is expressed as percentage.
1000 #                              The default value is 50. (Since 5.0)
1002 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1003 #                        throttled when migration auto-converge is activated.
1004 #                        (Since 2.7)
1006 # @cpu-throttle-increment: throttle percentage increase each time
1007 #                          auto-converge detects that migration is not making
1008 #                          progress. (Since 2.7)
1010 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
1011 #                         At the tail stage of throttling, the Guest is very
1012 #                         sensitive to CPU percentage while the @cpu-throttle
1013 #                         -increment is excessive usually at tail stage.
1014 #                         If this parameter is true, we will compute the ideal
1015 #                         CPU percentage used by the Guest, which may exactly make
1016 #                         the dirty rate match the dirty rate threshold. Then we
1017 #                         will choose a smaller throttle increment between the
1018 #                         one specified by @cpu-throttle-increment and the one
1019 #                         generated by ideal CPU percentage.
1020 #                         Therefore, it is compatible to traditional throttling,
1021 #                         meanwhile the throttle increment won't be excessive
1022 #                         at tail stage.
1023 #                         The default value is false. (Since 5.1)
1025 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1026 #             for establishing a TLS connection over the migration data
1027 #             channel. On the outgoing side of the migration, the credentials
1028 #             must be for a 'client' endpoint, while for the incoming side the
1029 #             credentials must be for a 'server' endpoint.
1030 #             An empty string means that QEMU will use plain text mode for
1031 #             migration, rather than TLS (Since 2.7)
1032 #             Note: 2.8 reports this by omitting tls-creds instead.
1034 # @tls-hostname: hostname of the target host for the migration. This
1035 #                is required when using x509 based TLS credentials and the
1036 #                migration URI does not already include a hostname. For
1037 #                example if using fd: or exec: based migration, the
1038 #                hostname must be provided so that the server's x509
1039 #                certificate identity can be validated. (Since 2.7)
1040 #                An empty string means that QEMU will use the hostname
1041 #                associated with the migration URI, if any. (Since 2.9)
1042 #                Note: 2.8 reports this by omitting tls-hostname instead.
1044 # @tls-authz: ID of the 'authz' object subclass that provides access control
1045 #             checking of the TLS x509 certificate distinguished name. (Since
1046 #             4.0)
1048 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1049 #                 bytes per second. (Since 2.8)
1051 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1052 #                  downtime in milliseconds (Since 2.8)
1054 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1056 # @block-incremental: Affects how much storage is migrated when the
1057 #                     block migration capability is enabled.  When false, the entire
1058 #                     storage backing chain is migrated into a flattened image at
1059 #                     the destination; when true, only the active qcow2 layer is
1060 #                     migrated and the destination must already have access to the
1061 #                     same backing chain as was used on the source.  (since 2.10)
1063 # @multifd-channels: Number of channels used to migrate data in
1064 #                    parallel. This is the same number that the
1065 #                    number of sockets used for migration.
1066 #                    The default value is 2 (since 4.0)
1068 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
1069 #                     needs to be a multiple of the target page size
1070 #                     and a power of 2
1071 #                     (Since 2.11)
1073 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
1074 #                          Defaults to 0 (unlimited).  In bytes per second.
1075 #                          (Since 3.0)
1077 # @max-cpu-throttle: maximum cpu throttle percentage.
1078 #                    Defaults to 99.
1079 #                    (Since 3.1)
1081 # @multifd-compression: Which compression method to use.
1082 #                       Defaults to none. (Since 5.0)
1084 # @multifd-zlib-level: Set the compression level to be used in live
1085 #                      migration, the compression level is an integer between 0
1086 #                      and 9, where 0 means no compression, 1 means the best
1087 #                      compression speed, and 9 means best compression ratio which
1088 #                      will consume more CPU.
1089 #                      Defaults to 1. (Since 5.0)
1091 # @multifd-zstd-level: Set the compression level to be used in live
1092 #                      migration, the compression level is an integer between 0
1093 #                      and 20, where 0 means no compression, 1 means the best
1094 #                      compression speed, and 20 means best compression ratio which
1095 #                      will consume more CPU.
1096 #                      Defaults to 1. (Since 5.0)
1098 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1099 #                        aliases for the purpose of dirty bitmap migration.  Such
1100 #                        aliases may for example be the corresponding names on the
1101 #                        opposite site.
1102 #                        The mapping must be one-to-one, but not necessarily
1103 #                        complete: On the source, unmapped bitmaps and all bitmaps
1104 #                        on unmapped nodes will be ignored.  On the destination,
1105 #                        encountering an unmapped alias in the incoming migration
1106 #                        stream will result in a report, and all further bitmap
1107 #                        migration data will then be discarded.
1108 #                        Note that the destination does not know about bitmaps it
1109 #                        does not receive, so there is no limitation or requirement
1110 #                        regarding the number of bitmaps received, or how they are
1111 #                        named, or on which nodes they are placed.
1112 #                        By default (when this parameter has never been set), bitmap
1113 #                        names are mapped to themselves.  Nodes are mapped to their
1114 #                        block device name if there is one, and to their node name
1115 #                        otherwise. (Since 5.2)
1117 # Features:
1118 # @unstable: Member @x-checkpoint-delay is experimental.
1120 # Since: 2.4
1122 { 'struct': 'MigrationParameters',
1123   'data': { '*announce-initial': 'size',
1124             '*announce-max': 'size',
1125             '*announce-rounds': 'size',
1126             '*announce-step': 'size',
1127             '*compress-level': 'uint8',
1128             '*compress-threads': 'uint8',
1129             '*compress-wait-thread': 'bool',
1130             '*decompress-threads': 'uint8',
1131             '*throttle-trigger-threshold': 'uint8',
1132             '*cpu-throttle-initial': 'uint8',
1133             '*cpu-throttle-increment': 'uint8',
1134             '*cpu-throttle-tailslow': 'bool',
1135             '*tls-creds': 'str',
1136             '*tls-hostname': 'str',
1137             '*tls-authz': 'str',
1138             '*max-bandwidth': 'size',
1139             '*downtime-limit': 'uint64',
1140             '*x-checkpoint-delay': { 'type': 'uint32',
1141                                      'features': [ 'unstable' ] },
1142             '*block-incremental': 'bool',
1143             '*multifd-channels': 'uint8',
1144             '*xbzrle-cache-size': 'size',
1145             '*max-postcopy-bandwidth': 'size',
1146             '*max-cpu-throttle': 'uint8',
1147             '*multifd-compression': 'MultiFDCompression',
1148             '*multifd-zlib-level': 'uint8',
1149             '*multifd-zstd-level': 'uint8',
1150             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
1153 # @query-migrate-parameters:
1155 # Returns information about the current migration parameters
1157 # Returns: @MigrationParameters
1159 # Since: 2.4
1161 # Example:
1163 # -> { "execute": "query-migrate-parameters" }
1164 # <- { "return": {
1165 #          "decompress-threads": 2,
1166 #          "cpu-throttle-increment": 10,
1167 #          "compress-threads": 8,
1168 #          "compress-level": 1,
1169 #          "cpu-throttle-initial": 20,
1170 #          "max-bandwidth": 33554432,
1171 #          "downtime-limit": 300
1172 #       }
1173 #    }
1176 { 'command': 'query-migrate-parameters',
1177   'returns': 'MigrationParameters' }
1180 # @client_migrate_info:
1182 # Set migration information for remote display.  This makes the server
1183 # ask the client to automatically reconnect using the new parameters
1184 # once migration finished successfully.  Only implemented for SPICE.
1186 # @protocol:     must be "spice"
1187 # @hostname:     migration target hostname
1188 # @port:         spice tcp port for plaintext channels
1189 # @tls-port:     spice tcp port for tls-secured channels
1190 # @cert-subject: server certificate subject
1192 # Since: 0.14
1194 # Example:
1196 # -> { "execute": "client_migrate_info",
1197 #      "arguments": { "protocol": "spice",
1198 #                     "hostname": "virt42.lab.kraxel.org",
1199 #                     "port": 1234 } }
1200 # <- { "return": {} }
1203 { 'command': 'client_migrate_info',
1204   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1205             '*tls-port': 'int', '*cert-subject': 'str' } }
1208 # @migrate-start-postcopy:
1210 # Followup to a migration command to switch the migration to postcopy mode.
1211 # The postcopy-ram capability must be set on both source and destination
1212 # before the original migration command.
1214 # Since: 2.5
1216 # Example:
1218 # -> { "execute": "migrate-start-postcopy" }
1219 # <- { "return": {} }
1222 { 'command': 'migrate-start-postcopy' }
1225 # @MIGRATION:
1227 # Emitted when a migration event happens
1229 # @status: @MigrationStatus describing the current migration status.
1231 # Since: 2.4
1233 # Example:
1235 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1236 #     "event": "MIGRATION",
1237 #     "data": {"status": "completed"} }
1240 { 'event': 'MIGRATION',
1241   'data': {'status': 'MigrationStatus'}}
1244 # @MIGRATION_PASS:
1246 # Emitted from the source side of a migration at the start of each pass
1247 # (when it syncs the dirty bitmap)
1249 # @pass: An incrementing count (starting at 1 on the first pass)
1251 # Since: 2.6
1253 # Example:
1255 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1256 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
1259 { 'event': 'MIGRATION_PASS',
1260   'data': { 'pass': 'int' } }
1263 # @COLOMessage:
1265 # The message transmission between Primary side and Secondary side.
1267 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1269 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1271 # @checkpoint-reply: SVM gets PVM's checkpoint request
1273 # @vmstate-send: VM's state will be sent by PVM.
1275 # @vmstate-size: The total size of VMstate.
1277 # @vmstate-received: VM's state has been received by SVM.
1279 # @vmstate-loaded: VM's state has been loaded by SVM.
1281 # Since: 2.8
1283 { 'enum': 'COLOMessage',
1284   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1285             'vmstate-send', 'vmstate-size', 'vmstate-received',
1286             'vmstate-loaded' ] }
1289 # @COLOMode:
1291 # The COLO current mode.
1293 # @none: COLO is disabled.
1295 # @primary: COLO node in primary side.
1297 # @secondary: COLO node in slave side.
1299 # Since: 2.8
1301 { 'enum': 'COLOMode',
1302   'data': [ 'none', 'primary', 'secondary'] }
1305 # @FailoverStatus:
1307 # An enumeration of COLO failover status
1309 # @none: no failover has ever happened
1311 # @require: got failover requirement but not handled
1313 # @active: in the process of doing failover
1315 # @completed: finish the process of failover
1317 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1319 # Since: 2.8
1321 { 'enum': 'FailoverStatus',
1322   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1325 # @COLO_EXIT:
1327 # Emitted when VM finishes COLO mode due to some errors happening or
1328 # at the request of users.
1330 # @mode: report COLO mode when COLO exited.
1332 # @reason: describes the reason for the COLO exit.
1334 # Since: 3.1
1336 # Example:
1338 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1339 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1342 { 'event': 'COLO_EXIT',
1343   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1346 # @COLOExitReason:
1348 # The reason for a COLO exit.
1350 # @none: failover has never happened. This state does not occur
1351 #        in the COLO_EXIT event, and is only visible in the result of
1352 #        query-colo-status.
1354 # @request: COLO exit is due to an external request.
1356 # @error: COLO exit is due to an internal error.
1358 # @processing: COLO is currently handling a failover (since 4.0).
1360 # Since: 3.1
1362 { 'enum': 'COLOExitReason',
1363   'data': [ 'none', 'request', 'error' , 'processing' ] }
1366 # @x-colo-lost-heartbeat:
1368 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1369 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1370 # If sent to the Secondary, the Secondary side will run failover work,
1371 # then takes over server operation to become the service VM.
1373 # Features:
1374 # @unstable: This command is experimental.
1376 # Since: 2.8
1378 # Example:
1380 # -> { "execute": "x-colo-lost-heartbeat" }
1381 # <- { "return": {} }
1384 { 'command': 'x-colo-lost-heartbeat',
1385   'features': [ 'unstable' ] }
1388 # @migrate_cancel:
1390 # Cancel the current executing migration process.
1392 # Returns: nothing on success
1394 # Notes: This command succeeds even if there is no migration process running.
1396 # Since: 0.14
1398 # Example:
1400 # -> { "execute": "migrate_cancel" }
1401 # <- { "return": {} }
1404 { 'command': 'migrate_cancel' }
1407 # @migrate-continue:
1409 # Continue migration when it's in a paused state.
1411 # @state: The state the migration is currently expected to be in
1413 # Returns: nothing on success
1414 # Since: 2.11
1415 # Example:
1417 # -> { "execute": "migrate-continue" , "arguments":
1418 #      { "state": "pre-switchover" } }
1419 # <- { "return": {} }
1421 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1424 # @migrate:
1426 # Migrates the current running guest to another Virtual Machine.
1428 # @uri: the Uniform Resource Identifier of the destination VM
1430 # @blk: do block migration (full disk copy)
1432 # @inc: incremental disk copy migration
1434 # @detach: this argument exists only for compatibility reasons and
1435 #          is ignored by QEMU
1437 # @resume: resume one paused migration, default "off". (since 3.0)
1439 # Returns: nothing on success
1441 # Since: 0.14
1443 # Notes:
1445 # 1. The 'query-migrate' command should be used to check migration's progress
1446 #    and final result (this information is provided by the 'status' member)
1448 # 2. All boolean arguments default to false
1450 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1451 #    be used
1453 # Example:
1455 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1456 # <- { "return": {} }
1459 { 'command': 'migrate',
1460   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1461            '*detach': 'bool', '*resume': 'bool' } }
1464 # @migrate-incoming:
1466 # Start an incoming migration, the qemu must have been started
1467 # with -incoming defer
1469 # @uri: The Uniform Resource Identifier identifying the source or
1470 #       address to listen on
1472 # Returns: nothing on success
1474 # Since: 2.3
1476 # Notes:
1478 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1479 #    compatible with -incoming and the format of the uri is already exposed
1480 #    above libvirt.
1482 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1483 #    be used.
1485 # 3. The uri format is the same as for -incoming
1487 # Example:
1489 # -> { "execute": "migrate-incoming",
1490 #      "arguments": { "uri": "tcp::4446" } }
1491 # <- { "return": {} }
1494 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1497 # @xen-save-devices-state:
1499 # Save the state of all devices to file. The RAM and the block devices
1500 # of the VM are not saved by this command.
1502 # @filename: the file to save the state of the devices to as binary
1503 #            data. See xen-save-devices-state.txt for a description of the binary
1504 #            format.
1506 # @live: Optional argument to ask QEMU to treat this command as part of a live
1507 #        migration. Default to true. (since 2.11)
1509 # Returns: Nothing on success
1511 # Since: 1.1
1513 # Example:
1515 # -> { "execute": "xen-save-devices-state",
1516 #      "arguments": { "filename": "/tmp/save" } }
1517 # <- { "return": {} }
1520 { 'command': 'xen-save-devices-state',
1521   'data': {'filename': 'str', '*live':'bool' } }
1524 # @xen-set-global-dirty-log:
1526 # Enable or disable the global dirty log mode.
1528 # @enable: true to enable, false to disable.
1530 # Returns: nothing
1532 # Since: 1.3
1534 # Example:
1536 # -> { "execute": "xen-set-global-dirty-log",
1537 #      "arguments": { "enable": true } }
1538 # <- { "return": {} }
1541 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1544 # @xen-load-devices-state:
1546 # Load the state of all devices from file. The RAM and the block devices
1547 # of the VM are not loaded by this command.
1549 # @filename: the file to load the state of the devices from as binary
1550 #            data. See xen-save-devices-state.txt for a description of the binary
1551 #            format.
1553 # Since: 2.7
1555 # Example:
1557 # -> { "execute": "xen-load-devices-state",
1558 #      "arguments": { "filename": "/tmp/resume" } }
1559 # <- { "return": {} }
1562 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1565 # @xen-set-replication:
1567 # Enable or disable replication.
1569 # @enable: true to enable, false to disable.
1571 # @primary: true for primary or false for secondary.
1573 # @failover: true to do failover, false to stop. but cannot be
1574 #            specified if 'enable' is true. default value is false.
1576 # Returns: nothing.
1578 # Example:
1580 # -> { "execute": "xen-set-replication",
1581 #      "arguments": {"enable": true, "primary": false} }
1582 # <- { "return": {} }
1584 # Since: 2.9
1586 { 'command': 'xen-set-replication',
1587   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1588   'if': 'CONFIG_REPLICATION' }
1591 # @ReplicationStatus:
1593 # The result format for 'query-xen-replication-status'.
1595 # @error: true if an error happened, false if replication is normal.
1597 # @desc: the human readable error description string, when
1598 #        @error is 'true'.
1600 # Since: 2.9
1602 { 'struct': 'ReplicationStatus',
1603   'data': { 'error': 'bool', '*desc': 'str' },
1604   'if': 'CONFIG_REPLICATION' }
1607 # @query-xen-replication-status:
1609 # Query replication status while the vm is running.
1611 # Returns: A @ReplicationResult object showing the status.
1613 # Example:
1615 # -> { "execute": "query-xen-replication-status" }
1616 # <- { "return": { "error": false } }
1618 # Since: 2.9
1620 { 'command': 'query-xen-replication-status',
1621   'returns': 'ReplicationStatus',
1622   'if': 'CONFIG_REPLICATION' }
1625 # @xen-colo-do-checkpoint:
1627 # Xen uses this command to notify replication to trigger a checkpoint.
1629 # Returns: nothing.
1631 # Example:
1633 # -> { "execute": "xen-colo-do-checkpoint" }
1634 # <- { "return": {} }
1636 # Since: 2.9
1638 { 'command': 'xen-colo-do-checkpoint',
1639   'if': 'CONFIG_REPLICATION' }
1642 # @COLOStatus:
1644 # The result format for 'query-colo-status'.
1646 # @mode: COLO running mode. If COLO is running, this field will return
1647 #        'primary' or 'secondary'.
1649 # @last-mode: COLO last running mode. If COLO is running, this field
1650 #             will return same like mode field, after failover we can
1651 #             use this field to get last colo mode. (since 4.0)
1653 # @reason: describes the reason for the COLO exit.
1655 # Since: 3.1
1657 { 'struct': 'COLOStatus',
1658   'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1659             'reason': 'COLOExitReason' } }
1662 # @query-colo-status:
1664 # Query COLO status while the vm is running.
1666 # Returns: A @COLOStatus object showing the status.
1668 # Example:
1670 # -> { "execute": "query-colo-status" }
1671 # <- { "return": { "mode": "primary", "reason": "request" } }
1673 # Since: 3.1
1675 { 'command': 'query-colo-status',
1676   'returns': 'COLOStatus' }
1679 # @migrate-recover:
1681 # Provide a recovery migration stream URI.
1683 # @uri: the URI to be used for the recovery of migration stream.
1685 # Returns: nothing.
1687 # Example:
1689 # -> { "execute": "migrate-recover",
1690 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1691 # <- { "return": {} }
1693 # Since: 3.0
1695 { 'command': 'migrate-recover',
1696   'data': { 'uri': 'str' },
1697   'allow-oob': true }
1700 # @migrate-pause:
1702 # Pause a migration.  Currently it only supports postcopy.
1704 # Returns: nothing.
1706 # Example:
1708 # -> { "execute": "migrate-pause" }
1709 # <- { "return": {} }
1711 # Since: 3.0
1713 { 'command': 'migrate-pause', 'allow-oob': true }
1716 # @UNPLUG_PRIMARY:
1718 # Emitted from source side of a migration when migration state is
1719 # WAIT_UNPLUG. Device was unplugged by guest operating system.
1720 # Device resources in QEMU are kept on standby to be able to re-plug it in case
1721 # of migration failure.
1723 # @device-id: QEMU device id of the unplugged device
1725 # Since: 4.2
1727 # Example:
1728 #   {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1731 { 'event': 'UNPLUG_PRIMARY',
1732   'data': { 'device-id': 'str' } }
1735 # @DirtyRateVcpu:
1737 # Dirty rate of vcpu.
1739 # @id: vcpu index.
1741 # @dirty-rate: dirty rate.
1743 # Since: 6.2
1746 { 'struct': 'DirtyRateVcpu',
1747   'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1750 # @DirtyRateStatus:
1752 # An enumeration of dirtyrate status.
1754 # @unstarted: the dirtyrate thread has not been started.
1756 # @measuring: the dirtyrate thread is measuring.
1758 # @measured: the dirtyrate thread has measured and results are available.
1760 # Since: 5.2
1763 { 'enum': 'DirtyRateStatus',
1764   'data': [ 'unstarted', 'measuring', 'measured'] }
1767 # @DirtyRateMeasureMode:
1769 # An enumeration of mode of measuring dirtyrate.
1771 # @page-sampling: calculate dirtyrate by sampling pages.
1773 # @dirty-ring: calculate dirtyrate by dirty ring.
1775 # @dirty-bitmap: calculate dirtyrate by dirty bitmap.
1777 # Since: 6.2
1780 { 'enum': 'DirtyRateMeasureMode',
1781   'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
1784 # @DirtyRateInfo:
1786 # Information about current dirty page rate of vm.
1788 # @dirty-rate: an estimate of the dirty page rate of the VM in units of
1789 #              MB/s, present only when estimating the rate has completed.
1791 # @status: status containing dirtyrate query status includes
1792 #          'unstarted' or 'measuring' or 'measured'
1794 # @start-time: start time in units of second for calculation
1796 # @calc-time: time in units of second for sample dirty pages
1798 # @sample-pages: page count per GB for sample dirty pages
1799 #                the default value is 512 (since 6.1)
1801 # @mode: mode containing method of calculate dirtyrate includes
1802 #        'page-sampling' and 'dirty-ring' (Since 6.2)
1804 # @vcpu-dirty-rate: dirtyrate for each vcpu if dirty-ring
1805 #                   mode specified (Since 6.2)
1807 # Since: 5.2
1810 { 'struct': 'DirtyRateInfo',
1811   'data': {'*dirty-rate': 'int64',
1812            'status': 'DirtyRateStatus',
1813            'start-time': 'int64',
1814            'calc-time': 'int64',
1815            'sample-pages': 'uint64',
1816            'mode': 'DirtyRateMeasureMode',
1817            '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
1820 # @calc-dirty-rate:
1822 # start calculating dirty page rate for vm
1824 # @calc-time: time in units of second for sample dirty pages
1826 # @sample-pages: page count per GB for sample dirty pages
1827 #                the default value is 512 (since 6.1)
1829 # @mode: mechanism of calculating dirtyrate includes
1830 #        'page-sampling' and 'dirty-ring' (Since 6.1)
1832 # Since: 5.2
1834 # Example:
1835 #   {"command": "calc-dirty-rate", "data": {"calc-time": 1,
1836 #                                           'sample-pages': 512} }
1839 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
1840                                          '*sample-pages': 'int',
1841                                          '*mode': 'DirtyRateMeasureMode'} }
1844 # @query-dirty-rate:
1846 # query dirty page rate in units of MB/s for vm
1848 # Since: 5.2
1850 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1853 # @snapshot-save:
1855 # Save a VM snapshot
1857 # @job-id: identifier for the newly created job
1858 # @tag: name of the snapshot to create
1859 # @vmstate: block device node name to save vmstate to
1860 # @devices: list of block device node names to save a snapshot to
1862 # Applications should not assume that the snapshot save is complete
1863 # when this command returns. The job commands / events must be used
1864 # to determine completion and to fetch details of any errors that arise.
1866 # Note that execution of the guest CPUs may be stopped during the
1867 # time it takes to save the snapshot. A future version of QEMU
1868 # may ensure CPUs are executing continuously.
1870 # It is strongly recommended that @devices contain all writable
1871 # block device nodes if a consistent snapshot is required.
1873 # If @tag already exists, an error will be reported
1875 # Returns: nothing
1877 # Example:
1879 # -> { "execute": "snapshot-save",
1880 #      "data": {
1881 #         "job-id": "snapsave0",
1882 #         "tag": "my-snap",
1883 #         "vmstate": "disk0",
1884 #         "devices": ["disk0", "disk1"]
1885 #      }
1886 #    }
1887 # <- { "return": { } }
1888 # <- {"event": "JOB_STATUS_CHANGE",
1889 #     "data": {"status": "created", "id": "snapsave0"}}
1890 # <- {"event": "JOB_STATUS_CHANGE",
1891 #     "data": {"status": "running", "id": "snapsave0"}}
1892 # <- {"event": "STOP"}
1893 # <- {"event": "RESUME"}
1894 # <- {"event": "JOB_STATUS_CHANGE",
1895 #     "data": {"status": "waiting", "id": "snapsave0"}}
1896 # <- {"event": "JOB_STATUS_CHANGE",
1897 #     "data": {"status": "pending", "id": "snapsave0"}}
1898 # <- {"event": "JOB_STATUS_CHANGE",
1899 #     "data": {"status": "concluded", "id": "snapsave0"}}
1900 # -> {"execute": "query-jobs"}
1901 # <- {"return": [{"current-progress": 1,
1902 #                 "status": "concluded",
1903 #                 "total-progress": 1,
1904 #                 "type": "snapshot-save",
1905 #                 "id": "snapsave0"}]}
1907 # Since: 6.0
1909 { 'command': 'snapshot-save',
1910   'data': { 'job-id': 'str',
1911             'tag': 'str',
1912             'vmstate': 'str',
1913             'devices': ['str'] } }
1916 # @snapshot-load:
1918 # Load a VM snapshot
1920 # @job-id: identifier for the newly created job
1921 # @tag: name of the snapshot to load.
1922 # @vmstate: block device node name to load vmstate from
1923 # @devices: list of block device node names to load a snapshot from
1925 # Applications should not assume that the snapshot load is complete
1926 # when this command returns. The job commands / events must be used
1927 # to determine completion and to fetch details of any errors that arise.
1929 # Note that execution of the guest CPUs will be stopped during the
1930 # time it takes to load the snapshot.
1932 # It is strongly recommended that @devices contain all writable
1933 # block device nodes that can have changed since the original
1934 # @snapshot-save command execution.
1936 # Returns: nothing
1938 # Example:
1940 # -> { "execute": "snapshot-load",
1941 #      "data": {
1942 #         "job-id": "snapload0",
1943 #         "tag": "my-snap",
1944 #         "vmstate": "disk0",
1945 #         "devices": ["disk0", "disk1"]
1946 #      }
1947 #    }
1948 # <- { "return": { } }
1949 # <- {"event": "JOB_STATUS_CHANGE",
1950 #     "data": {"status": "created", "id": "snapload0"}}
1951 # <- {"event": "JOB_STATUS_CHANGE",
1952 #     "data": {"status": "running", "id": "snapload0"}}
1953 # <- {"event": "STOP"}
1954 # <- {"event": "RESUME"}
1955 # <- {"event": "JOB_STATUS_CHANGE",
1956 #     "data": {"status": "waiting", "id": "snapload0"}}
1957 # <- {"event": "JOB_STATUS_CHANGE",
1958 #     "data": {"status": "pending", "id": "snapload0"}}
1959 # <- {"event": "JOB_STATUS_CHANGE",
1960 #     "data": {"status": "concluded", "id": "snapload0"}}
1961 # -> {"execute": "query-jobs"}
1962 # <- {"return": [{"current-progress": 1,
1963 #                 "status": "concluded",
1964 #                 "total-progress": 1,
1965 #                 "type": "snapshot-load",
1966 #                 "id": "snapload0"}]}
1968 # Since: 6.0
1970 { 'command': 'snapshot-load',
1971   'data': { 'job-id': 'str',
1972             'tag': 'str',
1973             'vmstate': 'str',
1974             'devices': ['str'] } }
1977 # @snapshot-delete:
1979 # Delete a VM snapshot
1981 # @job-id: identifier for the newly created job
1982 # @tag: name of the snapshot to delete.
1983 # @devices: list of block device node names to delete a snapshot from
1985 # Applications should not assume that the snapshot delete is complete
1986 # when this command returns. The job commands / events must be used
1987 # to determine completion and to fetch details of any errors that arise.
1989 # Returns: nothing
1991 # Example:
1993 # -> { "execute": "snapshot-delete",
1994 #      "data": {
1995 #         "job-id": "snapdelete0",
1996 #         "tag": "my-snap",
1997 #         "devices": ["disk0", "disk1"]
1998 #      }
1999 #    }
2000 # <- { "return": { } }
2001 # <- {"event": "JOB_STATUS_CHANGE",
2002 #     "data": {"status": "created", "id": "snapdelete0"}}
2003 # <- {"event": "JOB_STATUS_CHANGE",
2004 #     "data": {"status": "running", "id": "snapdelete0"}}
2005 # <- {"event": "JOB_STATUS_CHANGE",
2006 #     "data": {"status": "waiting", "id": "snapdelete0"}}
2007 # <- {"event": "JOB_STATUS_CHANGE",
2008 #     "data": {"status": "pending", "id": "snapdelete0"}}
2009 # <- {"event": "JOB_STATUS_CHANGE",
2010 #     "data": {"status": "concluded", "id": "snapdelete0"}}
2011 # -> {"execute": "query-jobs"}
2012 # <- {"return": [{"current-progress": 1,
2013 #                 "status": "concluded",
2014 #                 "total-progress": 1,
2015 #                 "type": "snapshot-delete",
2016 #                 "id": "snapdelete0"}]}
2018 # Since: 6.0
2020 { 'command': 'snapshot-delete',
2021   'data': { 'job-id': 'str',
2022             'tag': 'str',
2023             'devices': ['str'] } }