9 { 'include': 'common.json' }
10 { 'include': 'sockets.json' }
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
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
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
49 # @precopy-bytes: The number of bytes sent in the pre-copy phase
52 # @downtime-bytes: The number of bytes sent while the guest is paused
55 # @postcopy-bytes: The number of bytes sent during the post-copy phase
60 { 'struct': 'MigrationStats',
61 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
62 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
63 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
64 'mbps' : 'number', 'dirty-sync-count' : 'int',
65 'postcopy-requests' : 'int', 'page-size' : 'int',
66 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64',
67 'precopy-bytes' : 'uint64', 'downtime-bytes' : 'uint64',
68 'postcopy-bytes' : 'uint64' } }
73 # Detailed XBZRLE migration cache statistics
75 # @cache-size: XBZRLE cache size
77 # @bytes: amount of bytes already transferred to the target VM
79 # @pages: amount of pages transferred to the target VM
81 # @cache-miss: number of cache miss
83 # @cache-miss-rate: rate of cache miss (since 2.1)
85 # @encoding-rate: rate of encoded bytes (since 5.1)
87 # @overflow: number of overflows
91 { 'struct': 'XBZRLECacheStats',
92 'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
93 'cache-miss': 'int', 'cache-miss-rate': 'number',
94 'encoding-rate': 'number', 'overflow': 'int' } }
99 # Detailed migration compression statistics
101 # @pages: amount of pages compressed and transferred to the target VM
103 # @busy: count of times that no free thread was available to compress data
105 # @busy-rate: rate of thread busy
107 # @compressed-size: amount of bytes after compression
109 # @compression-rate: rate of compressed size
113 { 'struct': 'CompressionStats',
114 'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
115 'compressed-size': 'int', 'compression-rate': 'number' } }
120 # An enumeration of migration status.
122 # @none: no migration has ever happened.
124 # @setup: migration process has been initiated.
126 # @cancelling: in the process of cancelling migration.
128 # @cancelled: cancelling migration is finished.
130 # @active: in the process of doing migration.
132 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
134 # @postcopy-paused: during postcopy but paused. (since 3.0)
136 # @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
138 # @completed: migration is finished.
140 # @failed: some error occurred during migration process.
142 # @colo: VM is in the process of fault tolerance, VM can not get into this
143 # state unless colo capability is enabled for migration. (since 2.8)
145 # @pre-switchover: Paused before device serialisation. (since 2.11)
147 # @device: During device serialisation when pause-before-switchover is enabled
150 # @wait-unplug: wait for device unplug request by guest OS to be completed.
156 { 'enum': 'MigrationStatus',
157 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
158 'active', 'postcopy-active', 'postcopy-paused',
159 'postcopy-recover', 'completed', 'failed', 'colo',
160 'pre-switchover', 'device', 'wait-unplug' ] }
164 # Detailed VFIO devices migration statistics
166 # @transferred: amount of bytes transferred to the target VM by VFIO devices
171 { 'struct': 'VfioStats',
172 'data': {'transferred': 'int' } }
177 # Information about current migration process.
179 # @status: @MigrationStatus describing the current migration status.
180 # If this field is not returned, no migration process
183 # @ram: @MigrationStats containing detailed migration
184 # status, only returned if status is 'active' or
185 # 'completed'(since 1.2)
187 # @disk: @MigrationStats containing detailed disk migration
188 # status, only returned if status is 'active' and it is a block
191 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
192 # migration statistics, only returned if XBZRLE feature is on and
193 # status is 'active' or 'completed' (since 1.2)
195 # @total-time: total amount of milliseconds since migration started.
196 # If migration has ended, it returns the total migration
199 # @downtime: only present when migration finishes correctly
200 # total downtime in milliseconds for the guest.
203 # @expected-downtime: only present while migration is active
204 # expected downtime in milliseconds for the guest in last walk
205 # of the dirty bitmap. (since 1.3)
207 # @setup-time: amount of setup time in milliseconds *before* the
208 # iterations begin but *after* the QMP command is issued. This is designed
209 # to provide an accounting of any activities (such as RDMA pinning) which
210 # may be expensive, but do not actually occur during the iterative
211 # migration rounds themselves. (since 1.6)
213 # @cpu-throttle-percentage: percentage of time guest cpus are being
214 # throttled during auto-converge. This is only present when auto-converge
215 # has started throttling guest cpus. (Since 2.7)
217 # @error-desc: the human readable error description string, when
218 # @status is 'failed'. Clients should not attempt to parse the
219 # error strings. (Since 2.7)
221 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
222 # live migration. This is only present when the postcopy-blocktime
223 # migration capability is enabled. (Since 3.0)
225 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU. This is
226 # only present when the postcopy-blocktime migration capability
227 # is enabled. (Since 3.0)
229 # @compression: migration compression statistics, only returned if compression
230 # feature is on and status is 'active' or 'completed' (Since 3.1)
232 # @socket-address: Only used for tcp, to know what the real port is (Since 4.0)
234 # @vfio: @VfioStats containing detailed VFIO devices migration statistics,
235 # only returned if VFIO device is present, migration is supported by all
236 # VFIO devices and status is 'active' or 'completed' (since 5.2)
238 # @blocked-reasons: A list of reasons an outgoing migration is blocked.
239 # Present and non-empty when migration is blocked.
244 { 'struct': 'MigrationInfo',
245 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
246 '*disk': 'MigrationStats',
247 '*vfio': 'VfioStats',
248 '*xbzrle-cache': 'XBZRLECacheStats',
249 '*total-time': 'int',
250 '*expected-downtime': 'int',
252 '*setup-time': 'int',
253 '*cpu-throttle-percentage': 'int',
254 '*error-desc': 'str',
255 '*blocked-reasons': ['str'],
256 '*postcopy-blocktime' : 'uint32',
257 '*postcopy-vcpu-blocktime': ['uint32'],
258 '*compression': 'CompressionStats',
259 '*socket-address': ['SocketAddress'] } }
264 # Returns information about current migration process. If migration
265 # is active there will be another json-object with RAM migration
266 # status and if block migration is active another one with block
269 # Returns: @MigrationInfo
275 # 1. Before the first migration
277 # -> { "execute": "query-migrate" }
278 # <- { "return": {} }
280 # 2. Migration is done and has succeeded
282 # -> { "execute": "query-migrate" }
284 # "status": "completed",
285 # "total-time":12345,
286 # "setup-time":12345,
294 # "normal-bytes":123456,
295 # "dirty-sync-count":15
300 # 3. Migration is done and has failed
302 # -> { "execute": "query-migrate" }
303 # <- { "return": { "status": "failed" } }
305 # 4. Migration is being performed and is not a block migration:
307 # -> { "execute": "query-migrate" }
311 # "total-time":12345,
312 # "setup-time":12345,
313 # "expected-downtime":12345,
320 # "normal-bytes":123456,
321 # "dirty-sync-count":15
326 # 5. Migration is being performed and is a block migration:
328 # -> { "execute": "query-migrate" }
332 # "total-time":12345,
333 # "setup-time":12345,
334 # "expected-downtime":12345,
337 # "remaining":1053304,
338 # "transferred":3720,
341 # "normal-bytes":123456,
342 # "dirty-sync-count":15
346 # "remaining":20880384,
347 # "transferred":91136
352 # 6. Migration is being performed and XBZRLE is active:
354 # -> { "execute": "query-migrate" }
358 # "total-time":12345,
359 # "setup-time":12345,
360 # "expected-downtime":12345,
363 # "remaining":1053304,
364 # "transferred":3720,
367 # "normal-bytes":3412992,
368 # "dirty-sync-count":15
371 # "cache-size":67108864,
375 # "cache-miss-rate":0.123,
376 # "encoding-rate":80.1,
383 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
386 # @MigrationCapability:
388 # Migration capabilities enumeration
390 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
391 # This feature allows us to minimize migration traffic for certain work
392 # loads, by sending compressed difference of the pages
394 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
395 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
396 # Disabled by default. (since 2.0)
398 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
399 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
400 # source and target VM to support this feature. To enable it is sufficient
401 # to enable the capability on the source VM. The feature is disabled by
402 # default. (since 1.6)
404 # @compress: Use multiple compression threads to accelerate live migration.
405 # This feature can help to reduce the migration traffic, by sending
406 # compressed pages. Please note that if compress and xbzrle are both
407 # on, compress only takes effect in the ram bulk stage, after that,
408 # it will be disabled and only xbzrle takes effect, this can help to
409 # minimize migration traffic. The feature is disabled by default.
412 # @events: generate events for each migration state change
415 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
416 # to speed up convergence of RAM migration. (since 1.6)
418 # @postcopy-ram: Start executing on the migration target before all of RAM has
419 # been migrated, pulling the remaining pages along as needed. The
420 # capacity must have the same setting on both source and target
421 # or migration will not even start. NOTE: If the migration fails during
422 # postcopy the VM will fail. (since 2.6)
424 # @x-colo: If enabled, migration will never end, and the state of the VM on the
425 # primary side will be migrated continuously to the VM on secondary
426 # side, this process is called COarse-Grain LOck Stepping (COLO) for
427 # Non-stop Service. (since 2.8)
429 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
430 # during postcopy-ram migration. (since 2.9)
432 # @block: If enabled, QEMU will also migrate the contents of all block
433 # devices. Default is disabled. A possible alternative uses
434 # mirror jobs to a builtin NBD server on the destination, which
435 # offers more flexibility.
438 # @return-path: If enabled, migration will use the return path even
439 # for precopy. (since 2.10)
441 # @pause-before-switchover: Pause outgoing migration before serialising device
442 # state and before disabling block IO (since 2.11)
444 # @multifd: Use more than one fd for migration (since 4.0)
446 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
449 # @postcopy-blocktime: Calculate downtime for postcopy live migration
452 # @late-block-activate: If enabled, the destination will not activate block
453 # devices (and thus take locks) immediately at the end of migration.
456 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
458 # @validate-uuid: Send the UUID of the source to allow the destination
459 # to ensure it is the same. (since 4.2)
461 # @background-snapshot: If enabled, the migration stream will be a snapshot
462 # of the VM exactly at the point when the migration
463 # procedure starts. The VM RAM is saved with running VM.
467 # @unstable: Members @x-colo and @x-ignore-shared are experimental.
471 { 'enum': 'MigrationCapability',
472 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
473 'compress', 'events', 'postcopy-ram',
474 { 'name': 'x-colo', 'features': [ 'unstable' ] },
476 'block', 'return-path', 'pause-before-switchover', 'multifd',
477 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
478 { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
479 'validate-uuid', 'background-snapshot'] }
482 # @MigrationCapabilityStatus:
484 # Migration capability information
486 # @capability: capability enum
488 # @state: capability state bool
492 { 'struct': 'MigrationCapabilityStatus',
493 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
496 # @migrate-set-capabilities:
498 # Enable/Disable the following migration capabilities (like xbzrle)
500 # @capabilities: json array of capability modifications to make
506 # -> { "execute": "migrate-set-capabilities" , "arguments":
507 # { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
510 { 'command': 'migrate-set-capabilities',
511 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
514 # @query-migrate-capabilities:
516 # Returns information about the current migration capabilities status
518 # Returns: @MigrationCapabilitiesStatus
524 # -> { "execute": "query-migrate-capabilities" }
526 # {"state": false, "capability": "xbzrle"},
527 # {"state": false, "capability": "rdma-pin-all"},
528 # {"state": false, "capability": "auto-converge"},
529 # {"state": false, "capability": "zero-blocks"},
530 # {"state": false, "capability": "compress"},
531 # {"state": true, "capability": "events"},
532 # {"state": false, "capability": "postcopy-ram"},
533 # {"state": false, "capability": "x-colo"}
537 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
540 # @MultiFDCompression:
542 # An enumeration of multifd compression methods.
544 # @none: no compression.
545 # @zlib: use zlib compression method.
546 # @zstd: use zstd compression method.
551 { 'enum': 'MultiFDCompression',
552 'data': [ 'none', 'zlib',
553 { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
556 # @BitmapMigrationBitmapAliasTransform:
558 # @persistent: If present, the bitmap will be made persistent
559 # or transient depending on this parameter.
563 { 'struct': 'BitmapMigrationBitmapAliasTransform',
565 '*persistent': 'bool'
569 # @BitmapMigrationBitmapAlias:
571 # @name: The name of the bitmap.
573 # @alias: An alias name for migration (for example the bitmap name on
574 # the opposite site).
576 # @transform: Allows the modification of the migrated bitmap.
581 { 'struct': 'BitmapMigrationBitmapAlias',
585 '*transform': 'BitmapMigrationBitmapAliasTransform'
589 # @BitmapMigrationNodeAlias:
591 # Maps a block node name and the bitmaps it has to aliases for dirty
594 # @node-name: A block node name.
596 # @alias: An alias block node name for migration (for example the
597 # node name on the opposite site).
599 # @bitmaps: Mappings for the bitmaps on this node.
603 { 'struct': 'BitmapMigrationNodeAlias',
607 'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
611 # @MigrationParameter:
613 # Migration parameters enumeration
615 # @announce-initial: Initial delay (in milliseconds) before sending the first
616 # announce (Since 4.0)
618 # @announce-max: Maximum delay (in milliseconds) between packets in the
619 # announcement (Since 4.0)
621 # @announce-rounds: Number of self-announce packets sent after migration
624 # @announce-step: Increase in delay (in milliseconds) between subsequent
625 # packets in the announcement (Since 4.0)
627 # @compress-level: Set the compression level to be used in live migration,
628 # the compression level is an integer between 0 and 9, where 0 means
629 # no compression, 1 means the best compression speed, and 9 means best
630 # compression ratio which will consume more CPU.
632 # @compress-threads: Set compression thread count to be used in live migration,
633 # the compression thread count is an integer between 1 and 255.
635 # @compress-wait-thread: Controls behavior when all compression threads are
636 # currently busy. If true (default), wait for a free
637 # compression thread to become available; otherwise,
638 # send the page uncompressed. (Since 3.1)
640 # @decompress-threads: Set decompression thread count to be used in live
641 # migration, the decompression thread count is an integer between 1
642 # and 255. Usually, decompression is at least 4 times as fast as
643 # compression, so set the decompress-threads to the number about 1/4
644 # of compress-threads is adequate.
646 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
647 # to trigger throttling. It is expressed as percentage.
648 # The default value is 50. (Since 5.0)
650 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
651 # when migration auto-converge is activated. The
652 # default value is 20. (Since 2.7)
654 # @cpu-throttle-increment: throttle percentage increase each time
655 # auto-converge detects that migration is not making
656 # progress. The default value is 10. (Since 2.7)
658 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
659 # At the tail stage of throttling, the Guest is very
660 # sensitive to CPU percentage while the @cpu-throttle
661 # -increment is excessive usually at tail stage.
662 # If this parameter is true, we will compute the ideal
663 # CPU percentage used by the Guest, which may exactly make
664 # the dirty rate match the dirty rate threshold. Then we
665 # will choose a smaller throttle increment between the
666 # one specified by @cpu-throttle-increment and the one
667 # generated by ideal CPU percentage.
668 # Therefore, it is compatible to traditional throttling,
669 # meanwhile the throttle increment won't be excessive
671 # The default value is false. (Since 5.1)
673 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
674 # establishing a TLS connection over the migration data channel.
675 # On the outgoing side of the migration, the credentials must
676 # be for a 'client' endpoint, while for the incoming side the
677 # credentials must be for a 'server' endpoint. Setting this
678 # will enable TLS for all migrations. The default is unset,
679 # resulting in unsecured migration at the QEMU level. (Since 2.7)
681 # @tls-hostname: hostname of the target host for the migration. This is
682 # required when using x509 based TLS credentials and the
683 # migration URI does not already include a hostname. For
684 # example if using fd: or exec: based migration, the
685 # hostname must be provided so that the server's x509
686 # certificate identity can be validated. (Since 2.7)
688 # @tls-authz: ID of the 'authz' object subclass that provides access control
689 # checking of the TLS x509 certificate distinguished name.
690 # This object is only resolved at time of use, so can be deleted
691 # and recreated on the fly while the migration server is active.
692 # If missing, it will default to denying access (Since 4.0)
694 # @max-bandwidth: to set maximum speed for migration. maximum speed in
695 # bytes per second. (Since 2.8)
697 # @downtime-limit: set maximum tolerated downtime for migration. maximum
698 # downtime in milliseconds (Since 2.8)
700 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
701 # periodic mode. (Since 2.8)
703 # @block-incremental: Affects how much storage is migrated when the
704 # block migration capability is enabled. When false, the entire
705 # storage backing chain is migrated into a flattened image at
706 # the destination; when true, only the active qcow2 layer is
707 # migrated and the destination must already have access to the
708 # same backing chain as was used on the source. (since 2.10)
710 # @multifd-channels: Number of channels used to migrate data in
711 # parallel. This is the same number that the
712 # number of sockets used for migration. The
713 # default value is 2 (since 4.0)
715 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
716 # needs to be a multiple of the target page size
720 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
721 # Defaults to 0 (unlimited). In bytes per second.
724 # @max-cpu-throttle: maximum cpu throttle percentage.
725 # Defaults to 99. (Since 3.1)
727 # @multifd-compression: Which compression method to use.
728 # Defaults to none. (Since 5.0)
730 # @multifd-zlib-level: Set the compression level to be used in live
731 # migration, the compression level is an integer between 0
732 # and 9, where 0 means no compression, 1 means the best
733 # compression speed, and 9 means best compression ratio which
734 # will consume more CPU.
735 # Defaults to 1. (Since 5.0)
737 # @multifd-zstd-level: Set the compression level to be used in live
738 # migration, the compression level is an integer between 0
739 # and 20, where 0 means no compression, 1 means the best
740 # compression speed, and 20 means best compression ratio which
741 # will consume more CPU.
742 # Defaults to 1. (Since 5.0)
744 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
745 # aliases for the purpose of dirty bitmap migration. Such
746 # aliases may for example be the corresponding names on the
748 # The mapping must be one-to-one, but not necessarily
749 # complete: On the source, unmapped bitmaps and all bitmaps
750 # on unmapped nodes will be ignored. On the destination,
751 # encountering an unmapped alias in the incoming migration
752 # stream will result in a report, and all further bitmap
753 # migration data will then be discarded.
754 # Note that the destination does not know about bitmaps it
755 # does not receive, so there is no limitation or requirement
756 # regarding the number of bitmaps received, or how they are
757 # named, or on which nodes they are placed.
758 # By default (when this parameter has never been set), bitmap
759 # names are mapped to themselves. Nodes are mapped to their
760 # block device name if there is one, and to their node name
761 # otherwise. (Since 5.2)
764 # @unstable: Member @x-checkpoint-delay is experimental.
768 { 'enum': 'MigrationParameter',
769 'data': ['announce-initial', 'announce-max',
770 'announce-rounds', 'announce-step',
771 'compress-level', 'compress-threads', 'decompress-threads',
772 'compress-wait-thread', 'throttle-trigger-threshold',
773 'cpu-throttle-initial', 'cpu-throttle-increment',
774 'cpu-throttle-tailslow',
775 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
777 { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
780 'xbzrle-cache-size', 'max-postcopy-bandwidth',
781 'max-cpu-throttle', 'multifd-compression',
782 'multifd-zlib-level' ,'multifd-zstd-level',
783 'block-bitmap-mapping' ] }
786 # @MigrateSetParameters:
788 # @announce-initial: Initial delay (in milliseconds) before sending the first
789 # announce (Since 4.0)
791 # @announce-max: Maximum delay (in milliseconds) between packets in the
792 # announcement (Since 4.0)
794 # @announce-rounds: Number of self-announce packets sent after migration
797 # @announce-step: Increase in delay (in milliseconds) between subsequent
798 # packets in the announcement (Since 4.0)
800 # @compress-level: compression level
802 # @compress-threads: compression thread count
804 # @compress-wait-thread: Controls behavior when all compression threads are
805 # currently busy. If true (default), wait for a free
806 # compression thread to become available; otherwise,
807 # send the page uncompressed. (Since 3.1)
809 # @decompress-threads: decompression thread count
811 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
812 # to trigger throttling. It is expressed as percentage.
813 # The default value is 50. (Since 5.0)
815 # @cpu-throttle-initial: Initial percentage of time guest cpus are
816 # throttled when migration auto-converge is activated.
817 # The default value is 20. (Since 2.7)
819 # @cpu-throttle-increment: throttle percentage increase each time
820 # auto-converge detects that migration is not making
821 # progress. The default value is 10. (Since 2.7)
823 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
824 # At the tail stage of throttling, the Guest is very
825 # sensitive to CPU percentage while the @cpu-throttle
826 # -increment is excessive usually at tail stage.
827 # If this parameter is true, we will compute the ideal
828 # CPU percentage used by the Guest, which may exactly make
829 # the dirty rate match the dirty rate threshold. Then we
830 # will choose a smaller throttle increment between the
831 # one specified by @cpu-throttle-increment and the one
832 # generated by ideal CPU percentage.
833 # Therefore, it is compatible to traditional throttling,
834 # meanwhile the throttle increment won't be excessive
836 # The default value is false. (Since 5.1)
838 # @tls-creds: ID of the 'tls-creds' object that provides credentials
839 # for establishing a TLS connection over the migration data
840 # channel. On the outgoing side of the migration, the credentials
841 # must be for a 'client' endpoint, while for the incoming side the
842 # credentials must be for a 'server' endpoint. Setting this
843 # to a non-empty string enables TLS for all migrations.
844 # An empty string means that QEMU will use plain text mode for
845 # migration, rather than TLS (Since 2.9)
846 # Previously (since 2.7), this was reported by omitting
849 # @tls-hostname: hostname of the target host for the migration. This
850 # is required when using x509 based TLS credentials and the
851 # migration URI does not already include a hostname. For
852 # example if using fd: or exec: based migration, the
853 # hostname must be provided so that the server's x509
854 # certificate identity can be validated. (Since 2.7)
855 # An empty string means that QEMU will use the hostname
856 # associated with the migration URI, if any. (Since 2.9)
857 # Previously (since 2.7), this was reported by omitting
858 # tls-hostname instead.
860 # @max-bandwidth: to set maximum speed for migration. maximum speed in
861 # bytes per second. (Since 2.8)
863 # @downtime-limit: set maximum tolerated downtime for migration. maximum
864 # downtime in milliseconds (Since 2.8)
866 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
868 # @block-incremental: Affects how much storage is migrated when the
869 # block migration capability is enabled. When false, the entire
870 # storage backing chain is migrated into a flattened image at
871 # the destination; when true, only the active qcow2 layer is
872 # migrated and the destination must already have access to the
873 # same backing chain as was used on the source. (since 2.10)
875 # @multifd-channels: Number of channels used to migrate data in
876 # parallel. This is the same number that the
877 # number of sockets used for migration. The
878 # default value is 2 (since 4.0)
880 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
881 # needs to be a multiple of the target page size
885 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
886 # Defaults to 0 (unlimited). In bytes per second.
889 # @max-cpu-throttle: maximum cpu throttle percentage.
890 # The default value is 99. (Since 3.1)
892 # @multifd-compression: Which compression method to use.
893 # Defaults to none. (Since 5.0)
895 # @multifd-zlib-level: Set the compression level to be used in live
896 # migration, the compression level is an integer between 0
897 # and 9, where 0 means no compression, 1 means the best
898 # compression speed, and 9 means best compression ratio which
899 # will consume more CPU.
900 # Defaults to 1. (Since 5.0)
902 # @multifd-zstd-level: Set the compression level to be used in live
903 # migration, the compression level is an integer between 0
904 # and 20, where 0 means no compression, 1 means the best
905 # compression speed, and 20 means best compression ratio which
906 # will consume more CPU.
907 # Defaults to 1. (Since 5.0)
909 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
910 # aliases for the purpose of dirty bitmap migration. Such
911 # aliases may for example be the corresponding names on the
913 # The mapping must be one-to-one, but not necessarily
914 # complete: On the source, unmapped bitmaps and all bitmaps
915 # on unmapped nodes will be ignored. On the destination,
916 # encountering an unmapped alias in the incoming migration
917 # stream will result in a report, and all further bitmap
918 # migration data will then be discarded.
919 # Note that the destination does not know about bitmaps it
920 # does not receive, so there is no limitation or requirement
921 # regarding the number of bitmaps received, or how they are
922 # named, or on which nodes they are placed.
923 # By default (when this parameter has never been set), bitmap
924 # names are mapped to themselves. Nodes are mapped to their
925 # block device name if there is one, and to their node name
926 # otherwise. (Since 5.2)
929 # @unstable: Member @x-checkpoint-delay is experimental.
933 # TODO either fuse back into MigrationParameters, or make
934 # MigrationParameters members mandatory
935 { 'struct': 'MigrateSetParameters',
936 'data': { '*announce-initial': 'size',
937 '*announce-max': 'size',
938 '*announce-rounds': 'size',
939 '*announce-step': 'size',
940 '*compress-level': 'uint8',
941 '*compress-threads': 'uint8',
942 '*compress-wait-thread': 'bool',
943 '*decompress-threads': 'uint8',
944 '*throttle-trigger-threshold': 'uint8',
945 '*cpu-throttle-initial': 'uint8',
946 '*cpu-throttle-increment': 'uint8',
947 '*cpu-throttle-tailslow': 'bool',
948 '*tls-creds': 'StrOrNull',
949 '*tls-hostname': 'StrOrNull',
950 '*tls-authz': 'StrOrNull',
951 '*max-bandwidth': 'size',
952 '*downtime-limit': 'uint64',
953 '*x-checkpoint-delay': { 'type': 'uint32',
954 'features': [ 'unstable' ] },
955 '*block-incremental': 'bool',
956 '*multifd-channels': 'uint8',
957 '*xbzrle-cache-size': 'size',
958 '*max-postcopy-bandwidth': 'size',
959 '*max-cpu-throttle': 'uint8',
960 '*multifd-compression': 'MultiFDCompression',
961 '*multifd-zlib-level': 'uint8',
962 '*multifd-zstd-level': 'uint8',
963 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
966 # @migrate-set-parameters:
968 # Set various migration parameters.
974 # -> { "execute": "migrate-set-parameters" ,
975 # "arguments": { "compress-level": 1 } }
978 { 'command': 'migrate-set-parameters', 'boxed': true,
979 'data': 'MigrateSetParameters' }
982 # @MigrationParameters:
984 # The optional members aren't actually optional.
986 # @announce-initial: Initial delay (in milliseconds) before sending the
987 # first announce (Since 4.0)
989 # @announce-max: Maximum delay (in milliseconds) between packets in the
990 # announcement (Since 4.0)
992 # @announce-rounds: Number of self-announce packets sent after migration
995 # @announce-step: Increase in delay (in milliseconds) between subsequent
996 # packets in the announcement (Since 4.0)
998 # @compress-level: compression level
1000 # @compress-threads: compression thread count
1002 # @compress-wait-thread: Controls behavior when all compression threads are
1003 # currently busy. If true (default), wait for a free
1004 # compression thread to become available; otherwise,
1005 # send the page uncompressed. (Since 3.1)
1007 # @decompress-threads: decompression thread count
1009 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
1010 # to trigger throttling. It is expressed as percentage.
1011 # The default value is 50. (Since 5.0)
1013 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1014 # throttled when migration auto-converge is activated.
1017 # @cpu-throttle-increment: throttle percentage increase each time
1018 # auto-converge detects that migration is not making
1019 # progress. (Since 2.7)
1021 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
1022 # At the tail stage of throttling, the Guest is very
1023 # sensitive to CPU percentage while the @cpu-throttle
1024 # -increment is excessive usually at tail stage.
1025 # If this parameter is true, we will compute the ideal
1026 # CPU percentage used by the Guest, which may exactly make
1027 # the dirty rate match the dirty rate threshold. Then we
1028 # will choose a smaller throttle increment between the
1029 # one specified by @cpu-throttle-increment and the one
1030 # generated by ideal CPU percentage.
1031 # Therefore, it is compatible to traditional throttling,
1032 # meanwhile the throttle increment won't be excessive
1034 # The default value is false. (Since 5.1)
1036 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1037 # for establishing a TLS connection over the migration data
1038 # channel. On the outgoing side of the migration, the credentials
1039 # must be for a 'client' endpoint, while for the incoming side the
1040 # credentials must be for a 'server' endpoint.
1041 # An empty string means that QEMU will use plain text mode for
1042 # migration, rather than TLS (Since 2.7)
1043 # Note: 2.8 reports this by omitting tls-creds instead.
1045 # @tls-hostname: hostname of the target host for the migration. This
1046 # is required when using x509 based TLS credentials and the
1047 # migration URI does not already include a hostname. For
1048 # example if using fd: or exec: based migration, the
1049 # hostname must be provided so that the server's x509
1050 # certificate identity can be validated. (Since 2.7)
1051 # An empty string means that QEMU will use the hostname
1052 # associated with the migration URI, if any. (Since 2.9)
1053 # Note: 2.8 reports this by omitting tls-hostname instead.
1055 # @tls-authz: ID of the 'authz' object subclass that provides access control
1056 # checking of the TLS x509 certificate distinguished name. (Since
1059 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1060 # bytes per second. (Since 2.8)
1062 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1063 # downtime in milliseconds (Since 2.8)
1065 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1067 # @block-incremental: Affects how much storage is migrated when the
1068 # block migration capability is enabled. When false, the entire
1069 # storage backing chain is migrated into a flattened image at
1070 # the destination; when true, only the active qcow2 layer is
1071 # migrated and the destination must already have access to the
1072 # same backing chain as was used on the source. (since 2.10)
1074 # @multifd-channels: Number of channels used to migrate data in
1075 # parallel. This is the same number that the
1076 # number of sockets used for migration.
1077 # The default value is 2 (since 4.0)
1079 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
1080 # needs to be a multiple of the target page size
1084 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
1085 # Defaults to 0 (unlimited). In bytes per second.
1088 # @max-cpu-throttle: maximum cpu throttle percentage.
1092 # @multifd-compression: Which compression method to use.
1093 # Defaults to none. (Since 5.0)
1095 # @multifd-zlib-level: Set the compression level to be used in live
1096 # migration, the compression level is an integer between 0
1097 # and 9, where 0 means no compression, 1 means the best
1098 # compression speed, and 9 means best compression ratio which
1099 # will consume more CPU.
1100 # Defaults to 1. (Since 5.0)
1102 # @multifd-zstd-level: Set the compression level to be used in live
1103 # migration, the compression level is an integer between 0
1104 # and 20, where 0 means no compression, 1 means the best
1105 # compression speed, and 20 means best compression ratio which
1106 # will consume more CPU.
1107 # Defaults to 1. (Since 5.0)
1109 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1110 # aliases for the purpose of dirty bitmap migration. Such
1111 # aliases may for example be the corresponding names on the
1113 # The mapping must be one-to-one, but not necessarily
1114 # complete: On the source, unmapped bitmaps and all bitmaps
1115 # on unmapped nodes will be ignored. On the destination,
1116 # encountering an unmapped alias in the incoming migration
1117 # stream will result in a report, and all further bitmap
1118 # migration data will then be discarded.
1119 # Note that the destination does not know about bitmaps it
1120 # does not receive, so there is no limitation or requirement
1121 # regarding the number of bitmaps received, or how they are
1122 # named, or on which nodes they are placed.
1123 # By default (when this parameter has never been set), bitmap
1124 # names are mapped to themselves. Nodes are mapped to their
1125 # block device name if there is one, and to their node name
1126 # otherwise. (Since 5.2)
1129 # @unstable: Member @x-checkpoint-delay is experimental.
1133 { 'struct': 'MigrationParameters',
1134 'data': { '*announce-initial': 'size',
1135 '*announce-max': 'size',
1136 '*announce-rounds': 'size',
1137 '*announce-step': 'size',
1138 '*compress-level': 'uint8',
1139 '*compress-threads': 'uint8',
1140 '*compress-wait-thread': 'bool',
1141 '*decompress-threads': 'uint8',
1142 '*throttle-trigger-threshold': 'uint8',
1143 '*cpu-throttle-initial': 'uint8',
1144 '*cpu-throttle-increment': 'uint8',
1145 '*cpu-throttle-tailslow': 'bool',
1146 '*tls-creds': 'str',
1147 '*tls-hostname': 'str',
1148 '*tls-authz': 'str',
1149 '*max-bandwidth': 'size',
1150 '*downtime-limit': 'uint64',
1151 '*x-checkpoint-delay': { 'type': 'uint32',
1152 'features': [ 'unstable' ] },
1153 '*block-incremental': 'bool',
1154 '*multifd-channels': 'uint8',
1155 '*xbzrle-cache-size': 'size',
1156 '*max-postcopy-bandwidth': 'size',
1157 '*max-cpu-throttle': 'uint8',
1158 '*multifd-compression': 'MultiFDCompression',
1159 '*multifd-zlib-level': 'uint8',
1160 '*multifd-zstd-level': 'uint8',
1161 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
1164 # @query-migrate-parameters:
1166 # Returns information about the current migration parameters
1168 # Returns: @MigrationParameters
1174 # -> { "execute": "query-migrate-parameters" }
1176 # "decompress-threads": 2,
1177 # "cpu-throttle-increment": 10,
1178 # "compress-threads": 8,
1179 # "compress-level": 1,
1180 # "cpu-throttle-initial": 20,
1181 # "max-bandwidth": 33554432,
1182 # "downtime-limit": 300
1187 { 'command': 'query-migrate-parameters',
1188 'returns': 'MigrationParameters' }
1191 # @client_migrate_info:
1193 # Set migration information for remote display. This makes the server
1194 # ask the client to automatically reconnect using the new parameters
1195 # once migration finished successfully. Only implemented for SPICE.
1197 # @protocol: must be "spice"
1198 # @hostname: migration target hostname
1199 # @port: spice tcp port for plaintext channels
1200 # @tls-port: spice tcp port for tls-secured channels
1201 # @cert-subject: server certificate subject
1207 # -> { "execute": "client_migrate_info",
1208 # "arguments": { "protocol": "spice",
1209 # "hostname": "virt42.lab.kraxel.org",
1211 # <- { "return": {} }
1214 { 'command': 'client_migrate_info',
1215 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1216 '*tls-port': 'int', '*cert-subject': 'str' } }
1219 # @migrate-start-postcopy:
1221 # Followup to a migration command to switch the migration to postcopy mode.
1222 # The postcopy-ram capability must be set on both source and destination
1223 # before the original migration command.
1229 # -> { "execute": "migrate-start-postcopy" }
1230 # <- { "return": {} }
1233 { 'command': 'migrate-start-postcopy' }
1238 # Emitted when a migration event happens
1240 # @status: @MigrationStatus describing the current migration status.
1246 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1247 # "event": "MIGRATION",
1248 # "data": {"status": "completed"} }
1251 { 'event': 'MIGRATION',
1252 'data': {'status': 'MigrationStatus'}}
1257 # Emitted from the source side of a migration at the start of each pass
1258 # (when it syncs the dirty bitmap)
1260 # @pass: An incrementing count (starting at 1 on the first pass)
1266 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1267 # "event": "MIGRATION_PASS", "data": {"pass": 2} }
1270 { 'event': 'MIGRATION_PASS',
1271 'data': { 'pass': 'int' } }
1276 # The message transmission between Primary side and Secondary side.
1278 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1280 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1282 # @checkpoint-reply: SVM gets PVM's checkpoint request
1284 # @vmstate-send: VM's state will be sent by PVM.
1286 # @vmstate-size: The total size of VMstate.
1288 # @vmstate-received: VM's state has been received by SVM.
1290 # @vmstate-loaded: VM's state has been loaded by SVM.
1294 { 'enum': 'COLOMessage',
1295 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1296 'vmstate-send', 'vmstate-size', 'vmstate-received',
1297 'vmstate-loaded' ] }
1302 # The COLO current mode.
1304 # @none: COLO is disabled.
1306 # @primary: COLO node in primary side.
1308 # @secondary: COLO node in slave side.
1312 { 'enum': 'COLOMode',
1313 'data': [ 'none', 'primary', 'secondary'] }
1318 # An enumeration of COLO failover status
1320 # @none: no failover has ever happened
1322 # @require: got failover requirement but not handled
1324 # @active: in the process of doing failover
1326 # @completed: finish the process of failover
1328 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1332 { 'enum': 'FailoverStatus',
1333 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1338 # Emitted when VM finishes COLO mode due to some errors happening or
1339 # at the request of users.
1341 # @mode: report COLO mode when COLO exited.
1343 # @reason: describes the reason for the COLO exit.
1349 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1350 # "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1353 { 'event': 'COLO_EXIT',
1354 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1359 # The reason for a COLO exit.
1361 # @none: failover has never happened. This state does not occur
1362 # in the COLO_EXIT event, and is only visible in the result of
1363 # query-colo-status.
1365 # @request: COLO exit is due to an external request.
1367 # @error: COLO exit is due to an internal error.
1369 # @processing: COLO is currently handling a failover (since 4.0).
1373 { 'enum': 'COLOExitReason',
1374 'data': [ 'none', 'request', 'error' , 'processing' ] }
1377 # @x-colo-lost-heartbeat:
1379 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1380 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1381 # If sent to the Secondary, the Secondary side will run failover work,
1382 # then takes over server operation to become the service VM.
1385 # @unstable: This command is experimental.
1391 # -> { "execute": "x-colo-lost-heartbeat" }
1392 # <- { "return": {} }
1395 { 'command': 'x-colo-lost-heartbeat',
1396 'features': [ 'unstable' ] }
1401 # Cancel the current executing migration process.
1403 # Returns: nothing on success
1405 # Notes: This command succeeds even if there is no migration process running.
1411 # -> { "execute": "migrate_cancel" }
1412 # <- { "return": {} }
1415 { 'command': 'migrate_cancel' }
1418 # @migrate-continue:
1420 # Continue migration when it's in a paused state.
1422 # @state: The state the migration is currently expected to be in
1424 # Returns: nothing on success
1428 # -> { "execute": "migrate-continue" , "arguments":
1429 # { "state": "pre-switchover" } }
1430 # <- { "return": {} }
1432 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1437 # Migrates the current running guest to another Virtual Machine.
1439 # @uri: the Uniform Resource Identifier of the destination VM
1441 # @blk: do block migration (full disk copy)
1443 # @inc: incremental disk copy migration
1445 # @detach: this argument exists only for compatibility reasons and
1446 # is ignored by QEMU
1448 # @resume: resume one paused migration, default "off". (since 3.0)
1450 # Returns: nothing on success
1456 # 1. The 'query-migrate' command should be used to check migration's progress
1457 # and final result (this information is provided by the 'status' member)
1459 # 2. All boolean arguments default to false
1461 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1466 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1467 # <- { "return": {} }
1470 { 'command': 'migrate',
1471 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1472 '*detach': 'bool', '*resume': 'bool' } }
1475 # @migrate-incoming:
1477 # Start an incoming migration, the qemu must have been started
1478 # with -incoming defer
1480 # @uri: The Uniform Resource Identifier identifying the source or
1481 # address to listen on
1483 # Returns: nothing on success
1489 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1490 # compatible with -incoming and the format of the uri is already exposed
1493 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1496 # 3. The uri format is the same as for -incoming
1500 # -> { "execute": "migrate-incoming",
1501 # "arguments": { "uri": "tcp::4446" } }
1502 # <- { "return": {} }
1505 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1508 # @xen-save-devices-state:
1510 # Save the state of all devices to file. The RAM and the block devices
1511 # of the VM are not saved by this command.
1513 # @filename: the file to save the state of the devices to as binary
1514 # data. See xen-save-devices-state.txt for a description of the binary
1517 # @live: Optional argument to ask QEMU to treat this command as part of a live
1518 # migration. Default to true. (since 2.11)
1520 # Returns: Nothing on success
1526 # -> { "execute": "xen-save-devices-state",
1527 # "arguments": { "filename": "/tmp/save" } }
1528 # <- { "return": {} }
1531 { 'command': 'xen-save-devices-state',
1532 'data': {'filename': 'str', '*live':'bool' } }
1535 # @xen-set-global-dirty-log:
1537 # Enable or disable the global dirty log mode.
1539 # @enable: true to enable, false to disable.
1547 # -> { "execute": "xen-set-global-dirty-log",
1548 # "arguments": { "enable": true } }
1549 # <- { "return": {} }
1552 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1555 # @xen-load-devices-state:
1557 # Load the state of all devices from file. The RAM and the block devices
1558 # of the VM are not loaded by this command.
1560 # @filename: the file to load the state of the devices from as binary
1561 # data. See xen-save-devices-state.txt for a description of the binary
1568 # -> { "execute": "xen-load-devices-state",
1569 # "arguments": { "filename": "/tmp/resume" } }
1570 # <- { "return": {} }
1573 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1576 # @xen-set-replication:
1578 # Enable or disable replication.
1580 # @enable: true to enable, false to disable.
1582 # @primary: true for primary or false for secondary.
1584 # @failover: true to do failover, false to stop. but cannot be
1585 # specified if 'enable' is true. default value is false.
1591 # -> { "execute": "xen-set-replication",
1592 # "arguments": {"enable": true, "primary": false} }
1593 # <- { "return": {} }
1597 { 'command': 'xen-set-replication',
1598 'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1599 'if': 'CONFIG_REPLICATION' }
1602 # @ReplicationStatus:
1604 # The result format for 'query-xen-replication-status'.
1606 # @error: true if an error happened, false if replication is normal.
1608 # @desc: the human readable error description string, when
1613 { 'struct': 'ReplicationStatus',
1614 'data': { 'error': 'bool', '*desc': 'str' },
1615 'if': 'CONFIG_REPLICATION' }
1618 # @query-xen-replication-status:
1620 # Query replication status while the vm is running.
1622 # Returns: A @ReplicationResult object showing the status.
1626 # -> { "execute": "query-xen-replication-status" }
1627 # <- { "return": { "error": false } }
1631 { 'command': 'query-xen-replication-status',
1632 'returns': 'ReplicationStatus',
1633 'if': 'CONFIG_REPLICATION' }
1636 # @xen-colo-do-checkpoint:
1638 # Xen uses this command to notify replication to trigger a checkpoint.
1644 # -> { "execute": "xen-colo-do-checkpoint" }
1645 # <- { "return": {} }
1649 { 'command': 'xen-colo-do-checkpoint',
1650 'if': 'CONFIG_REPLICATION' }
1655 # The result format for 'query-colo-status'.
1657 # @mode: COLO running mode. If COLO is running, this field will return
1658 # 'primary' or 'secondary'.
1660 # @last-mode: COLO last running mode. If COLO is running, this field
1661 # will return same like mode field, after failover we can
1662 # use this field to get last colo mode. (since 4.0)
1664 # @reason: describes the reason for the COLO exit.
1668 { 'struct': 'COLOStatus',
1669 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1670 'reason': 'COLOExitReason' } }
1673 # @query-colo-status:
1675 # Query COLO status while the vm is running.
1677 # Returns: A @COLOStatus object showing the status.
1681 # -> { "execute": "query-colo-status" }
1682 # <- { "return": { "mode": "primary", "reason": "request" } }
1686 { 'command': 'query-colo-status',
1687 'returns': 'COLOStatus' }
1692 # Provide a recovery migration stream URI.
1694 # @uri: the URI to be used for the recovery of migration stream.
1700 # -> { "execute": "migrate-recover",
1701 # "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1702 # <- { "return": {} }
1706 { 'command': 'migrate-recover',
1707 'data': { 'uri': 'str' },
1713 # Pause a migration. Currently it only supports postcopy.
1719 # -> { "execute": "migrate-pause" }
1720 # <- { "return": {} }
1724 { 'command': 'migrate-pause', 'allow-oob': true }
1729 # Emitted from source side of a migration when migration state is
1730 # WAIT_UNPLUG. Device was unplugged by guest operating system.
1731 # Device resources in QEMU are kept on standby to be able to re-plug it in case
1732 # of migration failure.
1734 # @device-id: QEMU device id of the unplugged device
1739 # {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1742 { 'event': 'UNPLUG_PRIMARY',
1743 'data': { 'device-id': 'str' } }
1748 # Dirty rate of vcpu.
1752 # @dirty-rate: dirty rate.
1757 { 'struct': 'DirtyRateVcpu',
1758 'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1763 # An enumeration of dirtyrate status.
1765 # @unstarted: the dirtyrate thread has not been started.
1767 # @measuring: the dirtyrate thread is measuring.
1769 # @measured: the dirtyrate thread has measured and results are available.
1774 { 'enum': 'DirtyRateStatus',
1775 'data': [ 'unstarted', 'measuring', 'measured'] }
1778 # @DirtyRateMeasureMode:
1780 # An enumeration of mode of measuring dirtyrate.
1782 # @page-sampling: calculate dirtyrate by sampling pages.
1784 # @dirty-ring: calculate dirtyrate by dirty ring.
1786 # @dirty-bitmap: calculate dirtyrate by dirty bitmap.
1791 { 'enum': 'DirtyRateMeasureMode',
1792 'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
1797 # Information about current dirty page rate of vm.
1799 # @dirty-rate: an estimate of the dirty page rate of the VM in units of
1800 # MB/s, present only when estimating the rate has completed.
1802 # @status: status containing dirtyrate query status includes
1803 # 'unstarted' or 'measuring' or 'measured'
1805 # @start-time: start time in units of second for calculation
1807 # @calc-time: time in units of second for sample dirty pages
1809 # @sample-pages: page count per GB for sample dirty pages
1810 # the default value is 512 (since 6.1)
1812 # @mode: mode containing method of calculate dirtyrate includes
1813 # 'page-sampling' and 'dirty-ring' (Since 6.2)
1815 # @vcpu-dirty-rate: dirtyrate for each vcpu if dirty-ring
1816 # mode specified (Since 6.2)
1821 { 'struct': 'DirtyRateInfo',
1822 'data': {'*dirty-rate': 'int64',
1823 'status': 'DirtyRateStatus',
1824 'start-time': 'int64',
1825 'calc-time': 'int64',
1826 'sample-pages': 'uint64',
1827 'mode': 'DirtyRateMeasureMode',
1828 '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
1833 # start calculating dirty page rate for vm
1835 # @calc-time: time in units of second for sample dirty pages
1837 # @sample-pages: page count per GB for sample dirty pages
1838 # the default value is 512 (since 6.1)
1840 # @mode: mechanism of calculating dirtyrate includes
1841 # 'page-sampling' and 'dirty-ring' (Since 6.1)
1846 # {"command": "calc-dirty-rate", "arguments": {"calc-time": 1,
1847 # 'sample-pages': 512} }
1850 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
1851 '*sample-pages': 'int',
1852 '*mode': 'DirtyRateMeasureMode'} }
1855 # @query-dirty-rate:
1857 # query dirty page rate in units of MB/s for vm
1861 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1866 # Save a VM snapshot
1868 # @job-id: identifier for the newly created job
1869 # @tag: name of the snapshot to create
1870 # @vmstate: block device node name to save vmstate to
1871 # @devices: list of block device node names to save a snapshot to
1873 # Applications should not assume that the snapshot save is complete
1874 # when this command returns. The job commands / events must be used
1875 # to determine completion and to fetch details of any errors that arise.
1877 # Note that execution of the guest CPUs may be stopped during the
1878 # time it takes to save the snapshot. A future version of QEMU
1879 # may ensure CPUs are executing continuously.
1881 # It is strongly recommended that @devices contain all writable
1882 # block device nodes if a consistent snapshot is required.
1884 # If @tag already exists, an error will be reported
1890 # -> { "execute": "snapshot-save",
1892 # "job-id": "snapsave0",
1894 # "vmstate": "disk0",
1895 # "devices": ["disk0", "disk1"]
1898 # <- { "return": { } }
1899 # <- {"event": "JOB_STATUS_CHANGE",
1900 # "data": {"status": "created", "id": "snapsave0"}}
1901 # <- {"event": "JOB_STATUS_CHANGE",
1902 # "data": {"status": "running", "id": "snapsave0"}}
1903 # <- {"event": "STOP"}
1904 # <- {"event": "RESUME"}
1905 # <- {"event": "JOB_STATUS_CHANGE",
1906 # "data": {"status": "waiting", "id": "snapsave0"}}
1907 # <- {"event": "JOB_STATUS_CHANGE",
1908 # "data": {"status": "pending", "id": "snapsave0"}}
1909 # <- {"event": "JOB_STATUS_CHANGE",
1910 # "data": {"status": "concluded", "id": "snapsave0"}}
1911 # -> {"execute": "query-jobs"}
1912 # <- {"return": [{"current-progress": 1,
1913 # "status": "concluded",
1914 # "total-progress": 1,
1915 # "type": "snapshot-save",
1916 # "id": "snapsave0"}]}
1920 { 'command': 'snapshot-save',
1921 'data': { 'job-id': 'str',
1924 'devices': ['str'] } }
1929 # Load a VM snapshot
1931 # @job-id: identifier for the newly created job
1932 # @tag: name of the snapshot to load.
1933 # @vmstate: block device node name to load vmstate from
1934 # @devices: list of block device node names to load a snapshot from
1936 # Applications should not assume that the snapshot load is complete
1937 # when this command returns. The job commands / events must be used
1938 # to determine completion and to fetch details of any errors that arise.
1940 # Note that execution of the guest CPUs will be stopped during the
1941 # time it takes to load the snapshot.
1943 # It is strongly recommended that @devices contain all writable
1944 # block device nodes that can have changed since the original
1945 # @snapshot-save command execution.
1951 # -> { "execute": "snapshot-load",
1953 # "job-id": "snapload0",
1955 # "vmstate": "disk0",
1956 # "devices": ["disk0", "disk1"]
1959 # <- { "return": { } }
1960 # <- {"event": "JOB_STATUS_CHANGE",
1961 # "data": {"status": "created", "id": "snapload0"}}
1962 # <- {"event": "JOB_STATUS_CHANGE",
1963 # "data": {"status": "running", "id": "snapload0"}}
1964 # <- {"event": "STOP"}
1965 # <- {"event": "RESUME"}
1966 # <- {"event": "JOB_STATUS_CHANGE",
1967 # "data": {"status": "waiting", "id": "snapload0"}}
1968 # <- {"event": "JOB_STATUS_CHANGE",
1969 # "data": {"status": "pending", "id": "snapload0"}}
1970 # <- {"event": "JOB_STATUS_CHANGE",
1971 # "data": {"status": "concluded", "id": "snapload0"}}
1972 # -> {"execute": "query-jobs"}
1973 # <- {"return": [{"current-progress": 1,
1974 # "status": "concluded",
1975 # "total-progress": 1,
1976 # "type": "snapshot-load",
1977 # "id": "snapload0"}]}
1981 { 'command': 'snapshot-load',
1982 'data': { 'job-id': 'str',
1985 'devices': ['str'] } }
1990 # Delete a VM snapshot
1992 # @job-id: identifier for the newly created job
1993 # @tag: name of the snapshot to delete.
1994 # @devices: list of block device node names to delete a snapshot from
1996 # Applications should not assume that the snapshot delete is complete
1997 # when this command returns. The job commands / events must be used
1998 # to determine completion and to fetch details of any errors that arise.
2004 # -> { "execute": "snapshot-delete",
2006 # "job-id": "snapdelete0",
2008 # "devices": ["disk0", "disk1"]
2011 # <- { "return": { } }
2012 # <- {"event": "JOB_STATUS_CHANGE",
2013 # "data": {"status": "created", "id": "snapdelete0"}}
2014 # <- {"event": "JOB_STATUS_CHANGE",
2015 # "data": {"status": "running", "id": "snapdelete0"}}
2016 # <- {"event": "JOB_STATUS_CHANGE",
2017 # "data": {"status": "waiting", "id": "snapdelete0"}}
2018 # <- {"event": "JOB_STATUS_CHANGE",
2019 # "data": {"status": "pending", "id": "snapdelete0"}}
2020 # <- {"event": "JOB_STATUS_CHANGE",
2021 # "data": {"status": "concluded", "id": "snapdelete0"}}
2022 # -> {"execute": "query-jobs"}
2023 # <- {"return": [{"current-progress": 1,
2024 # "status": "concluded",
2025 # "total-progress": 1,
2026 # "type": "snapshot-delete",
2027 # "id": "snapdelete0"}]}
2031 { 'command': 'snapshot-delete',
2032 'data': { 'job-id': 'str',
2034 'devices': ['str'] } }