Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210330' into...
[qemu/ar7.git] / qapi / migration.json
blob9bf0bc4d25e68adaebb8beca640f156fde70934f
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: True if outgoing migration is blocked (since 6.0)
229 # @blocked-reasons: A list of reasons an outgoing migration is blocked (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': 'bool',
245            '*blocked-reasons': ['str'],
246            '*postcopy-blocktime' : 'uint32',
247            '*postcopy-vcpu-blocktime': ['uint32'],
248            '*compression': 'CompressionStats',
249            '*socket-address': ['SocketAddress'] } }
252 # @query-migrate:
254 # Returns information about current migration process. If migration
255 # is active there will be another json-object with RAM migration
256 # status and if block migration is active another one with block
257 # migration status.
259 # Returns: @MigrationInfo
261 # Since: 0.14
263 # Example:
265 # 1. Before the first migration
267 # -> { "execute": "query-migrate" }
268 # <- { "return": {} }
270 # 2. Migration is done and has succeeded
272 # -> { "execute": "query-migrate" }
273 # <- { "return": {
274 #         "status": "completed",
275 #         "total-time":12345,
276 #         "setup-time":12345,
277 #         "downtime":12345,
278 #         "ram":{
279 #           "transferred":123,
280 #           "remaining":123,
281 #           "total":246,
282 #           "duplicate":123,
283 #           "normal":123,
284 #           "normal-bytes":123456,
285 #           "dirty-sync-count":15
286 #         }
287 #      }
288 #    }
290 # 3. Migration is done and has failed
292 # -> { "execute": "query-migrate" }
293 # <- { "return": { "status": "failed" } }
295 # 4. Migration is being performed and is not a block migration:
297 # -> { "execute": "query-migrate" }
298 # <- {
299 #       "return":{
300 #          "status":"active",
301 #          "total-time":12345,
302 #          "setup-time":12345,
303 #          "expected-downtime":12345,
304 #          "ram":{
305 #             "transferred":123,
306 #             "remaining":123,
307 #             "total":246,
308 #             "duplicate":123,
309 #             "normal":123,
310 #             "normal-bytes":123456,
311 #             "dirty-sync-count":15
312 #          }
313 #       }
314 #    }
316 # 5. Migration is being performed and is a block migration:
318 # -> { "execute": "query-migrate" }
319 # <- {
320 #       "return":{
321 #          "status":"active",
322 #          "total-time":12345,
323 #          "setup-time":12345,
324 #          "expected-downtime":12345,
325 #          "ram":{
326 #             "total":1057024,
327 #             "remaining":1053304,
328 #             "transferred":3720,
329 #             "duplicate":123,
330 #             "normal":123,
331 #             "normal-bytes":123456,
332 #             "dirty-sync-count":15
333 #          },
334 #          "disk":{
335 #             "total":20971520,
336 #             "remaining":20880384,
337 #             "transferred":91136
338 #          }
339 #       }
340 #    }
342 # 6. Migration is being performed and XBZRLE is active:
344 # -> { "execute": "query-migrate" }
345 # <- {
346 #       "return":{
347 #          "status":"active",
348 #          "total-time":12345,
349 #          "setup-time":12345,
350 #          "expected-downtime":12345,
351 #          "ram":{
352 #             "total":1057024,
353 #             "remaining":1053304,
354 #             "transferred":3720,
355 #             "duplicate":10,
356 #             "normal":3333,
357 #             "normal-bytes":3412992,
358 #             "dirty-sync-count":15
359 #          },
360 #          "xbzrle-cache":{
361 #             "cache-size":67108864,
362 #             "bytes":20971520,
363 #             "pages":2444343,
364 #             "cache-miss":2244,
365 #             "cache-miss-rate":0.123,
366 #             "encoding-rate":80.1,
367 #             "overflow":34434
368 #          }
369 #       }
370 #    }
373 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
376 # @MigrationCapability:
378 # Migration capabilities enumeration
380 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
381 #          This feature allows us to minimize migration traffic for certain work
382 #          loads, by sending compressed difference of the pages
384 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
385 #                mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
386 #                Disabled by default. (since 2.0)
388 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
389 #               essentially saves 1MB of zeroes per block on the wire. Enabling requires
390 #               source and target VM to support this feature. To enable it is sufficient
391 #               to enable the capability on the source VM. The feature is disabled by
392 #               default. (since 1.6)
394 # @compress: Use multiple compression threads to accelerate live migration.
395 #            This feature can help to reduce the migration traffic, by sending
396 #            compressed pages. Please note that if compress and xbzrle are both
397 #            on, compress only takes effect in the ram bulk stage, after that,
398 #            it will be disabled and only xbzrle takes effect, this can help to
399 #            minimize migration traffic. The feature is disabled by default.
400 #            (since 2.4 )
402 # @events: generate events for each migration state change
403 #          (since 2.4 )
405 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
406 #                 to speed up convergence of RAM migration. (since 1.6)
408 # @postcopy-ram: Start executing on the migration target before all of RAM has
409 #                been migrated, pulling the remaining pages along as needed. The
410 #                capacity must have the same setting on both source and target
411 #                or migration will not even start. NOTE: If the migration fails during
412 #                postcopy the VM will fail.  (since 2.6)
414 # @x-colo: If enabled, migration will never end, and the state of the VM on the
415 #          primary side will be migrated continuously to the VM on secondary
416 #          side, this process is called COarse-Grain LOck Stepping (COLO) for
417 #          Non-stop Service. (since 2.8)
419 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
420 #               during postcopy-ram migration. (since 2.9)
422 # @block: If enabled, QEMU will also migrate the contents of all block
423 #         devices.  Default is disabled.  A possible alternative uses
424 #         mirror jobs to a builtin NBD server on the destination, which
425 #         offers more flexibility.
426 #         (Since 2.10)
428 # @return-path: If enabled, migration will use the return path even
429 #               for precopy. (since 2.10)
431 # @pause-before-switchover: Pause outgoing migration before serialising device
432 #                           state and before disabling block IO (since 2.11)
434 # @multifd: Use more than one fd for migration (since 4.0)
436 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
437 #                 (since 2.12)
439 # @postcopy-blocktime: Calculate downtime for postcopy live migration
440 #                      (since 3.0)
442 # @late-block-activate: If enabled, the destination will not activate block
443 #                       devices (and thus take locks) immediately at the end of migration.
444 #                       (since 3.0)
446 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
448 # @validate-uuid: Send the UUID of the source to allow the destination
449 #                 to ensure it is the same. (since 4.2)
451 # @background-snapshot: If enabled, the migration stream will be a snapshot
452 #                       of the VM exactly at the point when the migration
453 #                       procedure starts. The VM RAM is saved with running VM.
454 #                       (since 6.0)
456 # Since: 1.2
458 { 'enum': 'MigrationCapability',
459   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
460            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
461            'block', 'return-path', 'pause-before-switchover', 'multifd',
462            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
463            'x-ignore-shared', 'validate-uuid', 'background-snapshot'] }
466 # @MigrationCapabilityStatus:
468 # Migration capability information
470 # @capability: capability enum
472 # @state: capability state bool
474 # Since: 1.2
476 { 'struct': 'MigrationCapabilityStatus',
477   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
480 # @migrate-set-capabilities:
482 # Enable/Disable the following migration capabilities (like xbzrle)
484 # @capabilities: json array of capability modifications to make
486 # Since: 1.2
488 # Example:
490 # -> { "execute": "migrate-set-capabilities" , "arguments":
491 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
494 { 'command': 'migrate-set-capabilities',
495   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
498 # @query-migrate-capabilities:
500 # Returns information about the current migration capabilities status
502 # Returns: @MigrationCapabilitiesStatus
504 # Since: 1.2
506 # Example:
508 # -> { "execute": "query-migrate-capabilities" }
509 # <- { "return": [
510 #       {"state": false, "capability": "xbzrle"},
511 #       {"state": false, "capability": "rdma-pin-all"},
512 #       {"state": false, "capability": "auto-converge"},
513 #       {"state": false, "capability": "zero-blocks"},
514 #       {"state": false, "capability": "compress"},
515 #       {"state": true, "capability": "events"},
516 #       {"state": false, "capability": "postcopy-ram"},
517 #       {"state": false, "capability": "x-colo"}
518 #    ]}
521 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
524 # @MultiFDCompression:
526 # An enumeration of multifd compression methods.
528 # @none: no compression.
529 # @zlib: use zlib compression method.
530 # @zstd: use zstd compression method.
532 # Since: 5.0
535 { 'enum': 'MultiFDCompression',
536   'data': [ 'none', 'zlib',
537             { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
540 # @BitmapMigrationBitmapAliasTransform:
542 # @persistent: If present, the bitmap will be made persistent
543 #              or transient depending on this parameter.
545 # Since: 6.0
547 { 'struct': 'BitmapMigrationBitmapAliasTransform',
548   'data': {
549       '*persistent': 'bool'
550   } }
553 # @BitmapMigrationBitmapAlias:
555 # @name: The name of the bitmap.
557 # @alias: An alias name for migration (for example the bitmap name on
558 #         the opposite site).
560 # @transform: Allows the modification of the migrated bitmap.
561 #             (since 6.0)
563 # Since: 5.2
565 { 'struct': 'BitmapMigrationBitmapAlias',
566   'data': {
567       'name': 'str',
568       'alias': 'str',
569       '*transform': 'BitmapMigrationBitmapAliasTransform'
570   } }
573 # @BitmapMigrationNodeAlias:
575 # Maps a block node name and the bitmaps it has to aliases for dirty
576 # bitmap migration.
578 # @node-name: A block node name.
580 # @alias: An alias block node name for migration (for example the
581 #         node name on the opposite site).
583 # @bitmaps: Mappings for the bitmaps on this node.
585 # Since: 5.2
587 { 'struct': 'BitmapMigrationNodeAlias',
588   'data': {
589       'node-name': 'str',
590       'alias': 'str',
591       'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
592   } }
595 # @MigrationParameter:
597 # Migration parameters enumeration
599 # @announce-initial: Initial delay (in milliseconds) before sending the first
600 #                    announce (Since 4.0)
602 # @announce-max: Maximum delay (in milliseconds) between packets in the
603 #                announcement (Since 4.0)
605 # @announce-rounds: Number of self-announce packets sent after migration
606 #                   (Since 4.0)
608 # @announce-step: Increase in delay (in milliseconds) between subsequent
609 #                 packets in the announcement (Since 4.0)
611 # @compress-level: Set the compression level to be used in live migration,
612 #                  the compression level is an integer between 0 and 9, where 0 means
613 #                  no compression, 1 means the best compression speed, and 9 means best
614 #                  compression ratio which will consume more CPU.
616 # @compress-threads: Set compression thread count to be used in live migration,
617 #                    the compression thread count is an integer between 1 and 255.
619 # @compress-wait-thread: Controls behavior when all compression threads are
620 #                        currently busy. If true (default), wait for a free
621 #                        compression thread to become available; otherwise,
622 #                        send the page uncompressed. (Since 3.1)
624 # @decompress-threads: Set decompression thread count to be used in live
625 #                      migration, the decompression thread count is an integer between 1
626 #                      and 255. Usually, decompression is at least 4 times as fast as
627 #                      compression, so set the decompress-threads to the number about 1/4
628 #                      of compress-threads is adequate.
630 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
631 #                              to trigger throttling. It is expressed as percentage.
632 #                              The default value is 50. (Since 5.0)
634 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
635 #                        when migration auto-converge is activated. The
636 #                        default value is 20. (Since 2.7)
638 # @cpu-throttle-increment: throttle percentage increase each time
639 #                          auto-converge detects that migration is not making
640 #                          progress. The default value is 10. (Since 2.7)
642 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
643 #                         At the tail stage of throttling, the Guest is very
644 #                         sensitive to CPU percentage while the @cpu-throttle
645 #                         -increment is excessive usually at tail stage.
646 #                         If this parameter is true, we will compute the ideal
647 #                         CPU percentage used by the Guest, which may exactly make
648 #                         the dirty rate match the dirty rate threshold. Then we
649 #                         will choose a smaller throttle increment between the
650 #                         one specified by @cpu-throttle-increment and the one
651 #                         generated by ideal CPU percentage.
652 #                         Therefore, it is compatible to traditional throttling,
653 #                         meanwhile the throttle increment won't be excessive
654 #                         at tail stage.
655 #                         The default value is false. (Since 5.1)
657 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
658 #             establishing a TLS connection over the migration data channel.
659 #             On the outgoing side of the migration, the credentials must
660 #             be for a 'client' endpoint, while for the incoming side the
661 #             credentials must be for a 'server' endpoint. Setting this
662 #             will enable TLS for all migrations. The default is unset,
663 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
665 # @tls-hostname: hostname of the target host for the migration. This is
666 #                required when using x509 based TLS credentials and the
667 #                migration URI does not already include a hostname. For
668 #                example if using fd: or exec: based migration, the
669 #                hostname must be provided so that the server's x509
670 #                certificate identity can be validated. (Since 2.7)
672 # @tls-authz: ID of the 'authz' object subclass that provides access control
673 #             checking of the TLS x509 certificate distinguished name.
674 #             This object is only resolved at time of use, so can be deleted
675 #             and recreated on the fly while the migration server is active.
676 #             If missing, it will default to denying access (Since 4.0)
678 # @max-bandwidth: to set maximum speed for migration. maximum speed in
679 #                 bytes per second. (Since 2.8)
681 # @downtime-limit: set maximum tolerated downtime for migration. maximum
682 #                  downtime in milliseconds (Since 2.8)
684 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
685 #                      periodic mode. (Since 2.8)
687 # @block-incremental: Affects how much storage is migrated when the
688 #                     block migration capability is enabled.  When false, the entire
689 #                     storage backing chain is migrated into a flattened image at
690 #                     the destination; when true, only the active qcow2 layer is
691 #                     migrated and the destination must already have access to the
692 #                     same backing chain as was used on the source.  (since 2.10)
694 # @multifd-channels: Number of channels used to migrate data in
695 #                    parallel. This is the same number that the
696 #                    number of sockets used for migration.  The
697 #                    default value is 2 (since 4.0)
699 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
700 #                     needs to be a multiple of the target page size
701 #                     and a power of 2
702 #                     (Since 2.11)
704 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
705 #                          Defaults to 0 (unlimited).  In bytes per second.
706 #                          (Since 3.0)
708 # @max-cpu-throttle: maximum cpu throttle percentage.
709 #                    Defaults to 99. (Since 3.1)
711 # @multifd-compression: Which compression method to use.
712 #                       Defaults to none. (Since 5.0)
714 # @multifd-zlib-level: Set the compression level to be used in live
715 #                      migration, the compression level is an integer between 0
716 #                      and 9, where 0 means no compression, 1 means the best
717 #                      compression speed, and 9 means best compression ratio which
718 #                      will consume more CPU.
719 #                      Defaults to 1. (Since 5.0)
721 # @multifd-zstd-level: Set the compression level to be used in live
722 #                      migration, the compression level is an integer between 0
723 #                      and 20, where 0 means no compression, 1 means the best
724 #                      compression speed, and 20 means best compression ratio which
725 #                      will consume more CPU.
726 #                      Defaults to 1. (Since 5.0)
728 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
729 #                        aliases for the purpose of dirty bitmap migration.  Such
730 #                        aliases may for example be the corresponding names on the
731 #                        opposite site.
732 #                        The mapping must be one-to-one, but not necessarily
733 #                        complete: On the source, unmapped bitmaps and all bitmaps
734 #                        on unmapped nodes will be ignored.  On the destination,
735 #                        encountering an unmapped alias in the incoming migration
736 #                        stream will result in a report, and all further bitmap
737 #                        migration data will then be discarded.
738 #                        Note that the destination does not know about bitmaps it
739 #                        does not receive, so there is no limitation or requirement
740 #                        regarding the number of bitmaps received, or how they are
741 #                        named, or on which nodes they are placed.
742 #                        By default (when this parameter has never been set), bitmap
743 #                        names are mapped to themselves.  Nodes are mapped to their
744 #                        block device name if there is one, and to their node name
745 #                        otherwise. (Since 5.2)
747 # Since: 2.4
749 { 'enum': 'MigrationParameter',
750   'data': ['announce-initial', 'announce-max',
751            'announce-rounds', 'announce-step',
752            'compress-level', 'compress-threads', 'decompress-threads',
753            'compress-wait-thread', 'throttle-trigger-threshold',
754            'cpu-throttle-initial', 'cpu-throttle-increment',
755            'cpu-throttle-tailslow',
756            'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
757            'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
758            'multifd-channels',
759            'xbzrle-cache-size', 'max-postcopy-bandwidth',
760            'max-cpu-throttle', 'multifd-compression',
761            'multifd-zlib-level' ,'multifd-zstd-level',
762            'block-bitmap-mapping' ] }
765 # @MigrateSetParameters:
767 # @announce-initial: Initial delay (in milliseconds) before sending the first
768 #                    announce (Since 4.0)
770 # @announce-max: Maximum delay (in milliseconds) between packets in the
771 #                announcement (Since 4.0)
773 # @announce-rounds: Number of self-announce packets sent after migration
774 #                   (Since 4.0)
776 # @announce-step: Increase in delay (in milliseconds) between subsequent
777 #                 packets in the announcement (Since 4.0)
779 # @compress-level: compression level
781 # @compress-threads: compression thread count
783 # @compress-wait-thread: Controls behavior when all compression threads are
784 #                        currently busy. If true (default), wait for a free
785 #                        compression thread to become available; otherwise,
786 #                        send the page uncompressed. (Since 3.1)
788 # @decompress-threads: decompression thread count
790 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
791 #                              to trigger throttling. It is expressed as percentage.
792 #                              The default value is 50. (Since 5.0)
794 # @cpu-throttle-initial: Initial percentage of time guest cpus are
795 #                        throttled when migration auto-converge is activated.
796 #                        The default value is 20. (Since 2.7)
798 # @cpu-throttle-increment: throttle percentage increase each time
799 #                          auto-converge detects that migration is not making
800 #                          progress. The default value is 10. (Since 2.7)
802 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
803 #                         At the tail stage of throttling, the Guest is very
804 #                         sensitive to CPU percentage while the @cpu-throttle
805 #                         -increment is excessive usually at tail stage.
806 #                         If this parameter is true, we will compute the ideal
807 #                         CPU percentage used by the Guest, which may exactly make
808 #                         the dirty rate match the dirty rate threshold. Then we
809 #                         will choose a smaller throttle increment between the
810 #                         one specified by @cpu-throttle-increment and the one
811 #                         generated by ideal CPU percentage.
812 #                         Therefore, it is compatible to traditional throttling,
813 #                         meanwhile the throttle increment won't be excessive
814 #                         at tail stage.
815 #                         The default value is false. (Since 5.1)
817 # @tls-creds: ID of the 'tls-creds' object that provides credentials
818 #             for establishing a TLS connection over the migration data
819 #             channel. On the outgoing side of the migration, the credentials
820 #             must be for a 'client' endpoint, while for the incoming side the
821 #             credentials must be for a 'server' endpoint. Setting this
822 #             to a non-empty string enables TLS for all migrations.
823 #             An empty string means that QEMU will use plain text mode for
824 #             migration, rather than TLS (Since 2.9)
825 #             Previously (since 2.7), this was reported by omitting
826 #             tls-creds instead.
828 # @tls-hostname: hostname of the target host for the migration. This
829 #                is required when using x509 based TLS credentials and the
830 #                migration URI does not already include a hostname. For
831 #                example if using fd: or exec: based migration, the
832 #                hostname must be provided so that the server's x509
833 #                certificate identity can be validated. (Since 2.7)
834 #                An empty string means that QEMU will use the hostname
835 #                associated with the migration URI, if any. (Since 2.9)
836 #                Previously (since 2.7), this was reported by omitting
837 #                tls-hostname instead.
839 # @max-bandwidth: to set maximum speed for migration. maximum speed in
840 #                 bytes per second. (Since 2.8)
842 # @downtime-limit: set maximum tolerated downtime for migration. maximum
843 #                  downtime in milliseconds (Since 2.8)
845 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
847 # @block-incremental: Affects how much storage is migrated when the
848 #                     block migration capability is enabled.  When false, the entire
849 #                     storage backing chain is migrated into a flattened image at
850 #                     the destination; when true, only the active qcow2 layer is
851 #                     migrated and the destination must already have access to the
852 #                     same backing chain as was used on the source.  (since 2.10)
854 # @multifd-channels: Number of channels used to migrate data in
855 #                    parallel. This is the same number that the
856 #                    number of sockets used for migration.  The
857 #                    default value is 2 (since 4.0)
859 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
860 #                     needs to be a multiple of the target page size
861 #                     and a power of 2
862 #                     (Since 2.11)
864 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
865 #                          Defaults to 0 (unlimited).  In bytes per second.
866 #                          (Since 3.0)
868 # @max-cpu-throttle: maximum cpu throttle percentage.
869 #                    The default value is 99. (Since 3.1)
871 # @multifd-compression: Which compression method to use.
872 #                       Defaults to none. (Since 5.0)
874 # @multifd-zlib-level: Set the compression level to be used in live
875 #                      migration, the compression level is an integer between 0
876 #                      and 9, where 0 means no compression, 1 means the best
877 #                      compression speed, and 9 means best compression ratio which
878 #                      will consume more CPU.
879 #                      Defaults to 1. (Since 5.0)
881 # @multifd-zstd-level: Set the compression level to be used in live
882 #                      migration, the compression level is an integer between 0
883 #                      and 20, where 0 means no compression, 1 means the best
884 #                      compression speed, and 20 means best compression ratio which
885 #                      will consume more CPU.
886 #                      Defaults to 1. (Since 5.0)
888 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
889 #                        aliases for the purpose of dirty bitmap migration.  Such
890 #                        aliases may for example be the corresponding names on the
891 #                        opposite site.
892 #                        The mapping must be one-to-one, but not necessarily
893 #                        complete: On the source, unmapped bitmaps and all bitmaps
894 #                        on unmapped nodes will be ignored.  On the destination,
895 #                        encountering an unmapped alias in the incoming migration
896 #                        stream will result in a report, and all further bitmap
897 #                        migration data will then be discarded.
898 #                        Note that the destination does not know about bitmaps it
899 #                        does not receive, so there is no limitation or requirement
900 #                        regarding the number of bitmaps received, or how they are
901 #                        named, or on which nodes they are placed.
902 #                        By default (when this parameter has never been set), bitmap
903 #                        names are mapped to themselves.  Nodes are mapped to their
904 #                        block device name if there is one, and to their node name
905 #                        otherwise. (Since 5.2)
907 # Since: 2.4
909 # TODO either fuse back into MigrationParameters, or make
910 # MigrationParameters members mandatory
911 { 'struct': 'MigrateSetParameters',
912   'data': { '*announce-initial': 'size',
913             '*announce-max': 'size',
914             '*announce-rounds': 'size',
915             '*announce-step': 'size',
916             '*compress-level': 'uint8',
917             '*compress-threads': 'uint8',
918             '*compress-wait-thread': 'bool',
919             '*decompress-threads': 'uint8',
920             '*throttle-trigger-threshold': 'uint8',
921             '*cpu-throttle-initial': 'uint8',
922             '*cpu-throttle-increment': 'uint8',
923             '*cpu-throttle-tailslow': 'bool',
924             '*tls-creds': 'StrOrNull',
925             '*tls-hostname': 'StrOrNull',
926             '*tls-authz': 'StrOrNull',
927             '*max-bandwidth': 'size',
928             '*downtime-limit': 'uint64',
929             '*x-checkpoint-delay': 'uint32',
930             '*block-incremental': 'bool',
931             '*multifd-channels': 'uint8',
932             '*xbzrle-cache-size': 'size',
933             '*max-postcopy-bandwidth': 'size',
934             '*max-cpu-throttle': 'uint8',
935             '*multifd-compression': 'MultiFDCompression',
936             '*multifd-zlib-level': 'uint8',
937             '*multifd-zstd-level': 'uint8',
938             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
941 # @migrate-set-parameters:
943 # Set various migration parameters.
945 # Since: 2.4
947 # Example:
949 # -> { "execute": "migrate-set-parameters" ,
950 #      "arguments": { "compress-level": 1 } }
953 { 'command': 'migrate-set-parameters', 'boxed': true,
954   'data': 'MigrateSetParameters' }
957 # @MigrationParameters:
959 # The optional members aren't actually optional.
961 # @announce-initial: Initial delay (in milliseconds) before sending the
962 #                    first announce (Since 4.0)
964 # @announce-max: Maximum delay (in milliseconds) between packets in the
965 #                announcement (Since 4.0)
967 # @announce-rounds: Number of self-announce packets sent after migration
968 #                   (Since 4.0)
970 # @announce-step: Increase in delay (in milliseconds) between subsequent
971 #                 packets in the announcement (Since 4.0)
973 # @compress-level: compression level
975 # @compress-threads: compression thread count
977 # @compress-wait-thread: Controls behavior when all compression threads are
978 #                        currently busy. If true (default), wait for a free
979 #                        compression thread to become available; otherwise,
980 #                        send the page uncompressed. (Since 3.1)
982 # @decompress-threads: decompression thread count
984 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
985 #                              to trigger throttling. It is expressed as percentage.
986 #                              The default value is 50. (Since 5.0)
988 # @cpu-throttle-initial: Initial percentage of time guest cpus are
989 #                        throttled when migration auto-converge is activated.
990 #                        (Since 2.7)
992 # @cpu-throttle-increment: throttle percentage increase each time
993 #                          auto-converge detects that migration is not making
994 #                          progress. (Since 2.7)
996 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
997 #                         At the tail stage of throttling, the Guest is very
998 #                         sensitive to CPU percentage while the @cpu-throttle
999 #                         -increment is excessive usually at tail stage.
1000 #                         If this parameter is true, we will compute the ideal
1001 #                         CPU percentage used by the Guest, which may exactly make
1002 #                         the dirty rate match the dirty rate threshold. Then we
1003 #                         will choose a smaller throttle increment between the
1004 #                         one specified by @cpu-throttle-increment and the one
1005 #                         generated by ideal CPU percentage.
1006 #                         Therefore, it is compatible to traditional throttling,
1007 #                         meanwhile the throttle increment won't be excessive
1008 #                         at tail stage.
1009 #                         The default value is false. (Since 5.1)
1011 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1012 #             for establishing a TLS connection over the migration data
1013 #             channel. On the outgoing side of the migration, the credentials
1014 #             must be for a 'client' endpoint, while for the incoming side the
1015 #             credentials must be for a 'server' endpoint.
1016 #             An empty string means that QEMU will use plain text mode for
1017 #             migration, rather than TLS (Since 2.7)
1018 #             Note: 2.8 reports this by omitting tls-creds instead.
1020 # @tls-hostname: hostname of the target host for the migration. This
1021 #                is required when using x509 based TLS credentials and the
1022 #                migration URI does not already include a hostname. For
1023 #                example if using fd: or exec: based migration, the
1024 #                hostname must be provided so that the server's x509
1025 #                certificate identity can be validated. (Since 2.7)
1026 #                An empty string means that QEMU will use the hostname
1027 #                associated with the migration URI, if any. (Since 2.9)
1028 #                Note: 2.8 reports this by omitting tls-hostname instead.
1030 # @tls-authz: ID of the 'authz' object subclass that provides access control
1031 #             checking of the TLS x509 certificate distinguished name. (Since
1032 #             4.0)
1034 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1035 #                 bytes per second. (Since 2.8)
1037 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1038 #                  downtime in milliseconds (Since 2.8)
1040 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1042 # @block-incremental: Affects how much storage is migrated when the
1043 #                     block migration capability is enabled.  When false, the entire
1044 #                     storage backing chain is migrated into a flattened image at
1045 #                     the destination; when true, only the active qcow2 layer is
1046 #                     migrated and the destination must already have access to the
1047 #                     same backing chain as was used on the source.  (since 2.10)
1049 # @multifd-channels: Number of channels used to migrate data in
1050 #                    parallel. This is the same number that the
1051 #                    number of sockets used for migration.
1052 #                    The default value is 2 (since 4.0)
1054 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
1055 #                     needs to be a multiple of the target page size
1056 #                     and a power of 2
1057 #                     (Since 2.11)
1059 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
1060 #                          Defaults to 0 (unlimited).  In bytes per second.
1061 #                          (Since 3.0)
1063 # @max-cpu-throttle: maximum cpu throttle percentage.
1064 #                    Defaults to 99.
1065 #                    (Since 3.1)
1067 # @multifd-compression: Which compression method to use.
1068 #                       Defaults to none. (Since 5.0)
1070 # @multifd-zlib-level: Set the compression level to be used in live
1071 #                      migration, the compression level is an integer between 0
1072 #                      and 9, where 0 means no compression, 1 means the best
1073 #                      compression speed, and 9 means best compression ratio which
1074 #                      will consume more CPU.
1075 #                      Defaults to 1. (Since 5.0)
1077 # @multifd-zstd-level: Set the compression level to be used in live
1078 #                      migration, the compression level is an integer between 0
1079 #                      and 20, where 0 means no compression, 1 means the best
1080 #                      compression speed, and 20 means best compression ratio which
1081 #                      will consume more CPU.
1082 #                      Defaults to 1. (Since 5.0)
1084 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1085 #                        aliases for the purpose of dirty bitmap migration.  Such
1086 #                        aliases may for example be the corresponding names on the
1087 #                        opposite site.
1088 #                        The mapping must be one-to-one, but not necessarily
1089 #                        complete: On the source, unmapped bitmaps and all bitmaps
1090 #                        on unmapped nodes will be ignored.  On the destination,
1091 #                        encountering an unmapped alias in the incoming migration
1092 #                        stream will result in a report, and all further bitmap
1093 #                        migration data will then be discarded.
1094 #                        Note that the destination does not know about bitmaps it
1095 #                        does not receive, so there is no limitation or requirement
1096 #                        regarding the number of bitmaps received, or how they are
1097 #                        named, or on which nodes they are placed.
1098 #                        By default (when this parameter has never been set), bitmap
1099 #                        names are mapped to themselves.  Nodes are mapped to their
1100 #                        block device name if there is one, and to their node name
1101 #                        otherwise. (Since 5.2)
1103 # Since: 2.4
1105 { 'struct': 'MigrationParameters',
1106   'data': { '*announce-initial': 'size',
1107             '*announce-max': 'size',
1108             '*announce-rounds': 'size',
1109             '*announce-step': 'size',
1110             '*compress-level': 'uint8',
1111             '*compress-threads': 'uint8',
1112             '*compress-wait-thread': 'bool',
1113             '*decompress-threads': 'uint8',
1114             '*throttle-trigger-threshold': 'uint8',
1115             '*cpu-throttle-initial': 'uint8',
1116             '*cpu-throttle-increment': 'uint8',
1117             '*cpu-throttle-tailslow': 'bool',
1118             '*tls-creds': 'str',
1119             '*tls-hostname': 'str',
1120             '*tls-authz': 'str',
1121             '*max-bandwidth': 'size',
1122             '*downtime-limit': 'uint64',
1123             '*x-checkpoint-delay': 'uint32',
1124             '*block-incremental': 'bool',
1125             '*multifd-channels': 'uint8',
1126             '*xbzrle-cache-size': 'size',
1127             '*max-postcopy-bandwidth': 'size',
1128             '*max-cpu-throttle': 'uint8',
1129             '*multifd-compression': 'MultiFDCompression',
1130             '*multifd-zlib-level': 'uint8',
1131             '*multifd-zstd-level': 'uint8',
1132             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
1135 # @query-migrate-parameters:
1137 # Returns information about the current migration parameters
1139 # Returns: @MigrationParameters
1141 # Since: 2.4
1143 # Example:
1145 # -> { "execute": "query-migrate-parameters" }
1146 # <- { "return": {
1147 #          "decompress-threads": 2,
1148 #          "cpu-throttle-increment": 10,
1149 #          "compress-threads": 8,
1150 #          "compress-level": 1,
1151 #          "cpu-throttle-initial": 20,
1152 #          "max-bandwidth": 33554432,
1153 #          "downtime-limit": 300
1154 #       }
1155 #    }
1158 { 'command': 'query-migrate-parameters',
1159   'returns': 'MigrationParameters' }
1162 # @client_migrate_info:
1164 # Set migration information for remote display.  This makes the server
1165 # ask the client to automatically reconnect using the new parameters
1166 # once migration finished successfully.  Only implemented for SPICE.
1168 # @protocol:     must be "spice"
1169 # @hostname:     migration target hostname
1170 # @port:         spice tcp port for plaintext channels
1171 # @tls-port:     spice tcp port for tls-secured channels
1172 # @cert-subject: server certificate subject
1174 # Since: 0.14
1176 # Example:
1178 # -> { "execute": "client_migrate_info",
1179 #      "arguments": { "protocol": "spice",
1180 #                     "hostname": "virt42.lab.kraxel.org",
1181 #                     "port": 1234 } }
1182 # <- { "return": {} }
1185 { 'command': 'client_migrate_info',
1186   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1187             '*tls-port': 'int', '*cert-subject': 'str' } }
1190 # @migrate-start-postcopy:
1192 # Followup to a migration command to switch the migration to postcopy mode.
1193 # The postcopy-ram capability must be set on both source and destination
1194 # before the original migration command.
1196 # Since: 2.5
1198 # Example:
1200 # -> { "execute": "migrate-start-postcopy" }
1201 # <- { "return": {} }
1204 { 'command': 'migrate-start-postcopy' }
1207 # @MIGRATION:
1209 # Emitted when a migration event happens
1211 # @status: @MigrationStatus describing the current migration status.
1213 # Since: 2.4
1215 # Example:
1217 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1218 #     "event": "MIGRATION",
1219 #     "data": {"status": "completed"} }
1222 { 'event': 'MIGRATION',
1223   'data': {'status': 'MigrationStatus'}}
1226 # @MIGRATION_PASS:
1228 # Emitted from the source side of a migration at the start of each pass
1229 # (when it syncs the dirty bitmap)
1231 # @pass: An incrementing count (starting at 1 on the first pass)
1233 # Since: 2.6
1235 # Example:
1237 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1238 #   "event": "MIGRATION_PASS", "data": {"pass": 2} }
1241 { 'event': 'MIGRATION_PASS',
1242   'data': { 'pass': 'int' } }
1245 # @COLOMessage:
1247 # The message transmission between Primary side and Secondary side.
1249 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1251 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1253 # @checkpoint-reply: SVM gets PVM's checkpoint request
1255 # @vmstate-send: VM's state will be sent by PVM.
1257 # @vmstate-size: The total size of VMstate.
1259 # @vmstate-received: VM's state has been received by SVM.
1261 # @vmstate-loaded: VM's state has been loaded by SVM.
1263 # Since: 2.8
1265 { 'enum': 'COLOMessage',
1266   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1267             'vmstate-send', 'vmstate-size', 'vmstate-received',
1268             'vmstate-loaded' ] }
1271 # @COLOMode:
1273 # The COLO current mode.
1275 # @none: COLO is disabled.
1277 # @primary: COLO node in primary side.
1279 # @secondary: COLO node in slave side.
1281 # Since: 2.8
1283 { 'enum': 'COLOMode',
1284   'data': [ 'none', 'primary', 'secondary'] }
1287 # @FailoverStatus:
1289 # An enumeration of COLO failover status
1291 # @none: no failover has ever happened
1293 # @require: got failover requirement but not handled
1295 # @active: in the process of doing failover
1297 # @completed: finish the process of failover
1299 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1301 # Since: 2.8
1303 { 'enum': 'FailoverStatus',
1304   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1307 # @COLO_EXIT:
1309 # Emitted when VM finishes COLO mode due to some errors happening or
1310 # at the request of users.
1312 # @mode: report COLO mode when COLO exited.
1314 # @reason: describes the reason for the COLO exit.
1316 # Since: 3.1
1318 # Example:
1320 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1321 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1324 { 'event': 'COLO_EXIT',
1325   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1328 # @COLOExitReason:
1330 # The reason for a COLO exit.
1332 # @none: failover has never happened. This state does not occur
1333 #        in the COLO_EXIT event, and is only visible in the result of
1334 #        query-colo-status.
1336 # @request: COLO exit is due to an external request.
1338 # @error: COLO exit is due to an internal error.
1340 # @processing: COLO is currently handling a failover (since 4.0).
1342 # Since: 3.1
1344 { 'enum': 'COLOExitReason',
1345   'data': [ 'none', 'request', 'error' , 'processing' ] }
1348 # @x-colo-lost-heartbeat:
1350 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1351 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1352 # If sent to the Secondary, the Secondary side will run failover work,
1353 # then takes over server operation to become the service VM.
1355 # Since: 2.8
1357 # Example:
1359 # -> { "execute": "x-colo-lost-heartbeat" }
1360 # <- { "return": {} }
1363 { 'command': 'x-colo-lost-heartbeat' }
1366 # @migrate_cancel:
1368 # Cancel the current executing migration process.
1370 # Returns: nothing on success
1372 # Notes: This command succeeds even if there is no migration process running.
1374 # Since: 0.14
1376 # Example:
1378 # -> { "execute": "migrate_cancel" }
1379 # <- { "return": {} }
1382 { 'command': 'migrate_cancel' }
1385 # @migrate-continue:
1387 # Continue migration when it's in a paused state.
1389 # @state: The state the migration is currently expected to be in
1391 # Returns: nothing on success
1392 # Since: 2.11
1393 # Example:
1395 # -> { "execute": "migrate-continue" , "arguments":
1396 #      { "state": "pre-switchover" } }
1397 # <- { "return": {} }
1399 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1402 # @migrate:
1404 # Migrates the current running guest to another Virtual Machine.
1406 # @uri: the Uniform Resource Identifier of the destination VM
1408 # @blk: do block migration (full disk copy)
1410 # @inc: incremental disk copy migration
1412 # @detach: this argument exists only for compatibility reasons and
1413 #          is ignored by QEMU
1415 # @resume: resume one paused migration, default "off". (since 3.0)
1417 # Returns: nothing on success
1419 # Since: 0.14
1421 # Notes:
1423 # 1. The 'query-migrate' command should be used to check migration's progress
1424 #    and final result (this information is provided by the 'status' member)
1426 # 2. All boolean arguments default to false
1428 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1429 #    be used
1431 # Example:
1433 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1434 # <- { "return": {} }
1437 { 'command': 'migrate',
1438   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1439            '*detach': 'bool', '*resume': 'bool' } }
1442 # @migrate-incoming:
1444 # Start an incoming migration, the qemu must have been started
1445 # with -incoming defer
1447 # @uri: The Uniform Resource Identifier identifying the source or
1448 #       address to listen on
1450 # Returns: nothing on success
1452 # Since: 2.3
1454 # Notes:
1456 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1457 #    compatible with -incoming and the format of the uri is already exposed
1458 #    above libvirt.
1460 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1461 #    be used.
1463 # 3. The uri format is the same as for -incoming
1465 # Example:
1467 # -> { "execute": "migrate-incoming",
1468 #      "arguments": { "uri": "tcp::4446" } }
1469 # <- { "return": {} }
1472 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1475 # @xen-save-devices-state:
1477 # Save the state of all devices to file. The RAM and the block devices
1478 # of the VM are not saved by this command.
1480 # @filename: the file to save the state of the devices to as binary
1481 #            data. See xen-save-devices-state.txt for a description of the binary
1482 #            format.
1484 # @live: Optional argument to ask QEMU to treat this command as part of a live
1485 #        migration. Default to true. (since 2.11)
1487 # Returns: Nothing on success
1489 # Since: 1.1
1491 # Example:
1493 # -> { "execute": "xen-save-devices-state",
1494 #      "arguments": { "filename": "/tmp/save" } }
1495 # <- { "return": {} }
1498 { 'command': 'xen-save-devices-state',
1499   'data': {'filename': 'str', '*live':'bool' } }
1502 # @xen-set-global-dirty-log:
1504 # Enable or disable the global dirty log mode.
1506 # @enable: true to enable, false to disable.
1508 # Returns: nothing
1510 # Since: 1.3
1512 # Example:
1514 # -> { "execute": "xen-set-global-dirty-log",
1515 #      "arguments": { "enable": true } }
1516 # <- { "return": {} }
1519 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1522 # @xen-load-devices-state:
1524 # Load the state of all devices from file. The RAM and the block devices
1525 # of the VM are not loaded by this command.
1527 # @filename: the file to load the state of the devices from as binary
1528 #            data. See xen-save-devices-state.txt for a description of the binary
1529 #            format.
1531 # Since: 2.7
1533 # Example:
1535 # -> { "execute": "xen-load-devices-state",
1536 #      "arguments": { "filename": "/tmp/resume" } }
1537 # <- { "return": {} }
1540 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1543 # @xen-set-replication:
1545 # Enable or disable replication.
1547 # @enable: true to enable, false to disable.
1549 # @primary: true for primary or false for secondary.
1551 # @failover: true to do failover, false to stop. but cannot be
1552 #            specified if 'enable' is true. default value is false.
1554 # Returns: nothing.
1556 # Example:
1558 # -> { "execute": "xen-set-replication",
1559 #      "arguments": {"enable": true, "primary": false} }
1560 # <- { "return": {} }
1562 # Since: 2.9
1564 { 'command': 'xen-set-replication',
1565   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1566   'if': 'defined(CONFIG_REPLICATION)' }
1569 # @ReplicationStatus:
1571 # The result format for 'query-xen-replication-status'.
1573 # @error: true if an error happened, false if replication is normal.
1575 # @desc: the human readable error description string, when
1576 #        @error is 'true'.
1578 # Since: 2.9
1580 { 'struct': 'ReplicationStatus',
1581   'data': { 'error': 'bool', '*desc': 'str' },
1582   'if': 'defined(CONFIG_REPLICATION)' }
1585 # @query-xen-replication-status:
1587 # Query replication status while the vm is running.
1589 # Returns: A @ReplicationResult object showing the status.
1591 # Example:
1593 # -> { "execute": "query-xen-replication-status" }
1594 # <- { "return": { "error": false } }
1596 # Since: 2.9
1598 { 'command': 'query-xen-replication-status',
1599   'returns': 'ReplicationStatus',
1600   'if': 'defined(CONFIG_REPLICATION)' }
1603 # @xen-colo-do-checkpoint:
1605 # Xen uses this command to notify replication to trigger a checkpoint.
1607 # Returns: nothing.
1609 # Example:
1611 # -> { "execute": "xen-colo-do-checkpoint" }
1612 # <- { "return": {} }
1614 # Since: 2.9
1616 { 'command': 'xen-colo-do-checkpoint',
1617   'if': 'defined(CONFIG_REPLICATION)' }
1620 # @COLOStatus:
1622 # The result format for 'query-colo-status'.
1624 # @mode: COLO running mode. If COLO is running, this field will return
1625 #        'primary' or 'secondary'.
1627 # @last-mode: COLO last running mode. If COLO is running, this field
1628 #             will return same like mode field, after failover we can
1629 #             use this field to get last colo mode. (since 4.0)
1631 # @reason: describes the reason for the COLO exit.
1633 # Since: 3.1
1635 { 'struct': 'COLOStatus',
1636   'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1637             'reason': 'COLOExitReason' } }
1640 # @query-colo-status:
1642 # Query COLO status while the vm is running.
1644 # Returns: A @COLOStatus object showing the status.
1646 # Example:
1648 # -> { "execute": "query-colo-status" }
1649 # <- { "return": { "mode": "primary", "reason": "request" } }
1651 # Since: 3.1
1653 { 'command': 'query-colo-status',
1654   'returns': 'COLOStatus' }
1657 # @migrate-recover:
1659 # Provide a recovery migration stream URI.
1661 # @uri: the URI to be used for the recovery of migration stream.
1663 # Returns: nothing.
1665 # Example:
1667 # -> { "execute": "migrate-recover",
1668 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1669 # <- { "return": {} }
1671 # Since: 3.0
1673 { 'command': 'migrate-recover',
1674   'data': { 'uri': 'str' },
1675   'allow-oob': true }
1678 # @migrate-pause:
1680 # Pause a migration.  Currently it only supports postcopy.
1682 # Returns: nothing.
1684 # Example:
1686 # -> { "execute": "migrate-pause" }
1687 # <- { "return": {} }
1689 # Since: 3.0
1691 { 'command': 'migrate-pause', 'allow-oob': true }
1694 # @UNPLUG_PRIMARY:
1696 # Emitted from source side of a migration when migration state is
1697 # WAIT_UNPLUG. Device was unplugged by guest operating system.
1698 # Device resources in QEMU are kept on standby to be able to re-plug it in case
1699 # of migration failure.
1701 # @device-id: QEMU device id of the unplugged device
1703 # Since: 4.2
1705 # Example:
1706 #   {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1709 { 'event': 'UNPLUG_PRIMARY',
1710   'data': { 'device-id': 'str' } }
1713 # @DirtyRateStatus:
1715 # An enumeration of dirtyrate status.
1717 # @unstarted: the dirtyrate thread has not been started.
1719 # @measuring: the dirtyrate thread is measuring.
1721 # @measured: the dirtyrate thread has measured and results are available.
1723 # Since: 5.2
1726 { 'enum': 'DirtyRateStatus',
1727   'data': [ 'unstarted', 'measuring', 'measured'] }
1730 # @DirtyRateInfo:
1732 # Information about current dirty page rate of vm.
1734 # @dirty-rate: an estimate of the dirty page rate of the VM in units of
1735 #              MB/s, present only when estimating the rate has completed.
1737 # @status: status containing dirtyrate query status includes
1738 #          'unstarted' or 'measuring' or 'measured'
1740 # @start-time: start time in units of second for calculation
1742 # @calc-time: time in units of second for sample dirty pages
1744 # Since: 5.2
1747 { 'struct': 'DirtyRateInfo',
1748   'data': {'*dirty-rate': 'int64',
1749            'status': 'DirtyRateStatus',
1750            'start-time': 'int64',
1751            'calc-time': 'int64'} }
1754 # @calc-dirty-rate:
1756 # start calculating dirty page rate for vm
1758 # @calc-time: time in units of second for sample dirty pages
1760 # Since: 5.2
1762 # Example:
1763 #   {"command": "calc-dirty-rate", "data": {"calc-time": 1} }
1766 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64'} }
1769 # @query-dirty-rate:
1771 # query dirty page rate in units of MB/s for vm
1773 # Since: 5.2
1775 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1778 # @snapshot-save:
1780 # Save a VM snapshot
1782 # @job-id: identifier for the newly created job
1783 # @tag: name of the snapshot to create
1784 # @vmstate: block device node name to save vmstate to
1785 # @devices: list of block device node names to save a snapshot to
1787 # Applications should not assume that the snapshot save is complete
1788 # when this command returns. The job commands / events must be used
1789 # to determine completion and to fetch details of any errors that arise.
1791 # Note that execution of the guest CPUs may be stopped during the
1792 # time it takes to save the snapshot. A future version of QEMU
1793 # may ensure CPUs are executing continuously.
1795 # It is strongly recommended that @devices contain all writable
1796 # block device nodes if a consistent snapshot is required.
1798 # If @tag already exists, an error will be reported
1800 # Returns: nothing
1802 # Example:
1804 # -> { "execute": "snapshot-save",
1805 #      "data": {
1806 #         "job-id": "snapsave0",
1807 #         "tag": "my-snap",
1808 #         "vmstate": "disk0",
1809 #         "devices": ["disk0", "disk1"]
1810 #      }
1811 #    }
1812 # <- { "return": { } }
1813 # <- {"event": "JOB_STATUS_CHANGE",
1814 #     "data": {"status": "created", "id": "snapsave0"}}
1815 # <- {"event": "JOB_STATUS_CHANGE",
1816 #     "data": {"status": "running", "id": "snapsave0"}}
1817 # <- {"event": "STOP"}
1818 # <- {"event": "RESUME"}
1819 # <- {"event": "JOB_STATUS_CHANGE",
1820 #     "data": {"status": "waiting", "id": "snapsave0"}}
1821 # <- {"event": "JOB_STATUS_CHANGE",
1822 #     "data": {"status": "pending", "id": "snapsave0"}}
1823 # <- {"event": "JOB_STATUS_CHANGE",
1824 #     "data": {"status": "concluded", "id": "snapsave0"}}
1825 # -> {"execute": "query-jobs"}
1826 # <- {"return": [{"current-progress": 1,
1827 #                 "status": "concluded",
1828 #                 "total-progress": 1,
1829 #                 "type": "snapshot-save",
1830 #                 "id": "snapsave0"}]}
1832 # Since: 6.0
1834 { 'command': 'snapshot-save',
1835   'data': { 'job-id': 'str',
1836             'tag': 'str',
1837             'vmstate': 'str',
1838             'devices': ['str'] } }
1841 # @snapshot-load:
1843 # Load a VM snapshot
1845 # @job-id: identifier for the newly created job
1846 # @tag: name of the snapshot to load.
1847 # @vmstate: block device node name to load vmstate from
1848 # @devices: list of block device node names to load a snapshot from
1850 # Applications should not assume that the snapshot load is complete
1851 # when this command returns. The job commands / events must be used
1852 # to determine completion and to fetch details of any errors that arise.
1854 # Note that execution of the guest CPUs will be stopped during the
1855 # time it takes to load the snapshot.
1857 # It is strongly recommended that @devices contain all writable
1858 # block device nodes that can have changed since the original
1859 # @snapshot-save command execution.
1861 # Returns: nothing
1863 # Example:
1865 # -> { "execute": "snapshot-load",
1866 #      "data": {
1867 #         "job-id": "snapload0",
1868 #         "tag": "my-snap",
1869 #         "vmstate": "disk0",
1870 #         "devices": ["disk0", "disk1"]
1871 #      }
1872 #    }
1873 # <- { "return": { } }
1874 # <- {"event": "JOB_STATUS_CHANGE",
1875 #     "data": {"status": "created", "id": "snapload0"}}
1876 # <- {"event": "JOB_STATUS_CHANGE",
1877 #     "data": {"status": "running", "id": "snapload0"}}
1878 # <- {"event": "STOP"}
1879 # <- {"event": "RESUME"}
1880 # <- {"event": "JOB_STATUS_CHANGE",
1881 #     "data": {"status": "waiting", "id": "snapload0"}}
1882 # <- {"event": "JOB_STATUS_CHANGE",
1883 #     "data": {"status": "pending", "id": "snapload0"}}
1884 # <- {"event": "JOB_STATUS_CHANGE",
1885 #     "data": {"status": "concluded", "id": "snapload0"}}
1886 # -> {"execute": "query-jobs"}
1887 # <- {"return": [{"current-progress": 1,
1888 #                 "status": "concluded",
1889 #                 "total-progress": 1,
1890 #                 "type": "snapshot-load",
1891 #                 "id": "snapload0"}]}
1893 # Since: 6.0
1895 { 'command': 'snapshot-load',
1896   'data': { 'job-id': 'str',
1897             'tag': 'str',
1898             'vmstate': 'str',
1899             'devices': ['str'] } }
1902 # @snapshot-delete:
1904 # Delete a VM snapshot
1906 # @job-id: identifier for the newly created job
1907 # @tag: name of the snapshot to delete.
1908 # @devices: list of block device node names to delete a snapshot from
1910 # Applications should not assume that the snapshot delete is complete
1911 # when this command returns. The job commands / events must be used
1912 # to determine completion and to fetch details of any errors that arise.
1914 # Returns: nothing
1916 # Example:
1918 # -> { "execute": "snapshot-delete",
1919 #      "data": {
1920 #         "job-id": "snapdelete0",
1921 #         "tag": "my-snap",
1922 #         "devices": ["disk0", "disk1"]
1923 #      }
1924 #    }
1925 # <- { "return": { } }
1926 # <- {"event": "JOB_STATUS_CHANGE",
1927 #     "data": {"status": "created", "id": "snapdelete0"}}
1928 # <- {"event": "JOB_STATUS_CHANGE",
1929 #     "data": {"status": "running", "id": "snapdelete0"}}
1930 # <- {"event": "JOB_STATUS_CHANGE",
1931 #     "data": {"status": "waiting", "id": "snapdelete0"}}
1932 # <- {"event": "JOB_STATUS_CHANGE",
1933 #     "data": {"status": "pending", "id": "snapdelete0"}}
1934 # <- {"event": "JOB_STATUS_CHANGE",
1935 #     "data": {"status": "concluded", "id": "snapdelete0"}}
1936 # -> {"execute": "query-jobs"}
1937 # <- {"return": [{"current-progress": 1,
1938 #                 "status": "concluded",
1939 #                 "total-progress": 1,
1940 #                 "type": "snapshot-delete",
1941 #                 "id": "snapdelete0"}]}
1943 # Since: 6.0
1945 { 'command': 'snapshot-delete',
1946   'data': { 'job-id': 'str',
1947             'tag': 'str',
1948             'devices': ['str'] } }