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
22 # @total: total amount of bytes involved in the migration process
24 # @duplicate: number of duplicate (zero) pages (since 1.2)
26 # @skipped: number of skipped zero pages. Always zero, only provided for
27 # compatibility (since 1.5)
29 # @normal: number of normal pages (since 1.2)
31 # @normal-bytes: number of normal bytes sent (since 1.2)
33 # @dirty-pages-rate: number of pages dirtied by second by the guest
36 # @mbps: throughput in megabits/sec. (since 1.6)
38 # @dirty-sync-count: number of times that dirty ram was synchronized
41 # @postcopy-requests: The number of page requests received from the
42 # destination (since 2.7)
44 # @page-size: The number of bytes per page for the various page-based
45 # statistics (since 2.10)
47 # @multifd-bytes: The number of bytes sent through multifd (since 3.0)
49 # @pages-per-second: the number of memory pages transferred per second
52 # @precopy-bytes: The number of bytes sent in the pre-copy phase
55 # @downtime-bytes: The number of bytes sent while the guest is paused
58 # @postcopy-bytes: The number of bytes sent during the post-copy phase
61 # @dirty-sync-missed-zero-copy: Number of times dirty RAM
62 # synchronization could not avoid copying dirty pages. This is
63 # between 0 and @dirty-sync-count * @multifd-channels. (since
68 # @deprecated: Member @skipped is always zero since 1.5.3
73 { 'struct': 'MigrationStats',
74 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
76 'skipped': { 'type': 'int', 'features': ['deprecated'] },
78 'normal-bytes': 'int', 'dirty-pages-rate': 'int',
79 'mbps': 'number', 'dirty-sync-count': 'int',
80 'postcopy-requests': 'int', 'page-size': 'int',
81 'multifd-bytes': 'uint64', 'pages-per-second': 'uint64',
82 'precopy-bytes': 'uint64', 'downtime-bytes': 'uint64',
83 'postcopy-bytes': 'uint64',
84 'dirty-sync-missed-zero-copy': 'uint64' } }
89 # Detailed XBZRLE migration cache statistics
91 # @cache-size: XBZRLE cache size
93 # @bytes: amount of bytes already transferred to the target VM
95 # @pages: amount of pages transferred to the target VM
97 # @cache-miss: number of cache miss
99 # @cache-miss-rate: rate of cache miss (since 2.1)
101 # @encoding-rate: rate of encoded bytes (since 5.1)
103 # @overflow: number of overflows
107 { 'struct': 'XBZRLECacheStats',
108 'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
109 'cache-miss': 'int', 'cache-miss-rate': 'number',
110 'encoding-rate': 'number', 'overflow': 'int' } }
115 # Detailed migration compression statistics
117 # @pages: amount of pages compressed and transferred to the target VM
119 # @busy: count of times that no free thread was available to compress
122 # @busy-rate: rate of thread busy
124 # @compressed-size: amount of bytes after compression
126 # @compression-rate: rate of compressed size
130 { 'struct': 'CompressionStats',
131 'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
132 'compressed-size': 'int', 'compression-rate': 'number' } }
137 # An enumeration of migration status.
139 # @none: no migration has ever happened.
141 # @setup: migration process has been initiated.
143 # @cancelling: in the process of cancelling migration.
145 # @cancelled: cancelling migration is finished.
147 # @active: in the process of doing migration.
149 # @postcopy-active: like active, but now in postcopy mode. (since
152 # @postcopy-paused: during postcopy but paused. (since 3.0)
154 # @postcopy-recover: trying to recover from a paused postcopy. (since
157 # @completed: migration is finished.
159 # @failed: some error occurred during migration process.
161 # @colo: VM is in the process of fault tolerance, VM can not get into
162 # this state unless colo capability is enabled for migration.
165 # @pre-switchover: Paused before device serialisation. (since 2.11)
167 # @device: During device serialisation when pause-before-switchover is
168 # enabled (since 2.11)
170 # @wait-unplug: wait for device unplug request by guest OS to be
171 # completed. (since 4.2)
175 { 'enum': 'MigrationStatus',
176 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
177 'active', 'postcopy-active', 'postcopy-paused',
178 'postcopy-recover', 'completed', 'failed', 'colo',
179 'pre-switchover', 'device', 'wait-unplug' ] }
183 # Detailed VFIO devices migration statistics
185 # @transferred: amount of bytes transferred to the target VM by VFIO
190 { 'struct': 'VfioStats',
191 'data': {'transferred': 'int' } }
196 # Information about current migration process.
198 # @status: @MigrationStatus describing the current migration status.
199 # If this field is not returned, no migration process has been
202 # @ram: @MigrationStats containing detailed migration status, only
203 # returned if status is 'active' or 'completed'(since 1.2)
205 # @disk: @MigrationStats containing detailed disk migration status,
206 # only returned if status is 'active' and it is a block migration
208 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
209 # migration statistics, only returned if XBZRLE feature is on and
210 # status is 'active' or 'completed' (since 1.2)
212 # @total-time: total amount of milliseconds since migration started.
213 # If migration has ended, it returns the total migration time.
216 # @downtime: only present when migration finishes correctly total
217 # downtime in milliseconds for the guest. (since 1.3)
219 # @expected-downtime: only present while migration is active expected
220 # downtime in milliseconds for the guest in last walk of the dirty
221 # bitmap. (since 1.3)
223 # @setup-time: amount of setup time in milliseconds *before* the
224 # iterations begin but *after* the QMP command is issued. This is
225 # designed to provide an accounting of any activities (such as
226 # RDMA pinning) which may be expensive, but do not actually occur
227 # during the iterative migration rounds themselves. (since 1.6)
229 # @cpu-throttle-percentage: percentage of time guest cpus are being
230 # throttled during auto-converge. This is only present when
231 # auto-converge has started throttling guest cpus. (Since 2.7)
233 # @error-desc: the human readable error description string. Clients
234 # should not attempt to parse the error strings. (Since 2.7)
236 # @postcopy-blocktime: total time when all vCPU were blocked during
237 # postcopy live migration. This is only present when the
238 # postcopy-blocktime migration capability is enabled. (Since 3.0)
240 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.
241 # This is only present when the postcopy-blocktime migration
242 # capability is enabled. (Since 3.0)
244 # @compression: migration compression statistics, only returned if
245 # compression feature is on and status is 'active' or 'completed'
248 # @socket-address: Only used for tcp, to know what the real port is
251 # @vfio: @VfioStats containing detailed VFIO devices migration
252 # statistics, only returned if VFIO device is present, migration
253 # is supported by all VFIO devices and status is 'active' or
254 # 'completed' (since 5.2)
256 # @blocked-reasons: A list of reasons an outgoing migration is
257 # blocked. Present and non-empty when migration is blocked.
260 # @dirty-limit-throttle-time-per-round: Maximum throttle time
261 # (in microseconds) of virtual CPUs each dirty ring full round,
262 # which shows how MigrationCapability dirty-limit affects the
263 # guest during live migration. (Since 8.1)
265 # @dirty-limit-ring-full-time: Estimated average dirty ring full time
266 # (in microseconds) for each dirty ring full round. The value
267 # equals the dirty ring memory size divided by the average dirty
268 # page rate of the virtual CPU, which can be used to observe the
269 # average memory load of the virtual CPU indirectly. Note that
270 # zero means guest doesn't dirty memory. (Since 8.1)
274 { 'struct': 'MigrationInfo',
275 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
276 '*disk': 'MigrationStats',
277 '*vfio': 'VfioStats',
278 '*xbzrle-cache': 'XBZRLECacheStats',
279 '*total-time': 'int',
280 '*expected-downtime': 'int',
282 '*setup-time': 'int',
283 '*cpu-throttle-percentage': 'int',
284 '*error-desc': 'str',
285 '*blocked-reasons': ['str'],
286 '*postcopy-blocktime': 'uint32',
287 '*postcopy-vcpu-blocktime': ['uint32'],
288 '*compression': 'CompressionStats',
289 '*socket-address': ['SocketAddress'],
290 '*dirty-limit-throttle-time-per-round': 'uint64',
291 '*dirty-limit-ring-full-time': 'uint64'} }
296 # Returns information about current migration process. If migration
297 # is active there will be another json-object with RAM migration
298 # status and if block migration is active another one with block
301 # Returns: @MigrationInfo
307 # 1. Before the first migration
309 # -> { "execute": "query-migrate" }
310 # <- { "return": {} }
312 # 2. Migration is done and has succeeded
314 # -> { "execute": "query-migrate" }
316 # "status": "completed",
317 # "total-time":12345,
318 # "setup-time":12345,
326 # "normal-bytes":123456,
327 # "dirty-sync-count":15
332 # 3. Migration is done and has failed
334 # -> { "execute": "query-migrate" }
335 # <- { "return": { "status": "failed" } }
337 # 4. Migration is being performed and is not a block migration:
339 # -> { "execute": "query-migrate" }
343 # "total-time":12345,
344 # "setup-time":12345,
345 # "expected-downtime":12345,
352 # "normal-bytes":123456,
353 # "dirty-sync-count":15
358 # 5. Migration is being performed and is a block migration:
360 # -> { "execute": "query-migrate" }
364 # "total-time":12345,
365 # "setup-time":12345,
366 # "expected-downtime":12345,
369 # "remaining":1053304,
370 # "transferred":3720,
373 # "normal-bytes":123456,
374 # "dirty-sync-count":15
378 # "remaining":20880384,
379 # "transferred":91136
384 # 6. Migration is being performed and XBZRLE is active:
386 # -> { "execute": "query-migrate" }
390 # "total-time":12345,
391 # "setup-time":12345,
392 # "expected-downtime":12345,
395 # "remaining":1053304,
396 # "transferred":3720,
399 # "normal-bytes":3412992,
400 # "dirty-sync-count":15
403 # "cache-size":67108864,
407 # "cache-miss-rate":0.123,
408 # "encoding-rate":80.1,
414 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
417 # @MigrationCapability:
419 # Migration capabilities enumeration
421 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length
422 # Encoding). This feature allows us to minimize migration traffic
423 # for certain work loads, by sending compressed difference of the
426 # @rdma-pin-all: Controls whether or not the entire VM memory
427 # footprint is mlock()'d on demand or all at once. Refer to
428 # docs/rdma.txt for usage. Disabled by default. (since 2.0)
430 # @zero-blocks: During storage migration encode blocks of zeroes
431 # efficiently. This essentially saves 1MB of zeroes per block on
432 # the wire. Enabling requires source and target VM to support
433 # this feature. To enable it is sufficient to enable the
434 # capability on the source VM. The feature is disabled by default.
437 # @compress: Use multiple compression threads to accelerate live
438 # migration. This feature can help to reduce the migration
439 # traffic, by sending compressed pages. Please note that if
440 # compress and xbzrle are both on, compress only takes effect in
441 # the ram bulk stage, after that, it will be disabled and only
442 # xbzrle takes effect, this can help to minimize migration
443 # traffic. The feature is disabled by default. (since 2.4 )
445 # @events: generate events for each migration state change (since 2.4
448 # @auto-converge: If enabled, QEMU will automatically throttle down
449 # the guest to speed up convergence of RAM migration. (since 1.6)
451 # @postcopy-ram: Start executing on the migration target before all of
452 # RAM has been migrated, pulling the remaining pages along as
453 # needed. The capacity must have the same setting on both source
454 # and target or migration will not even start. NOTE: If the
455 # migration fails during postcopy the VM will fail. (since 2.6)
457 # @x-colo: If enabled, migration will never end, and the state of the
458 # VM on the primary side will be migrated continuously to the VM
459 # on secondary side, this process is called COarse-Grain LOck
460 # Stepping (COLO) for Non-stop Service. (since 2.8)
462 # @release-ram: if enabled, qemu will free the migrated ram pages on
463 # the source during postcopy-ram migration. (since 2.9)
465 # @block: If enabled, QEMU will also migrate the contents of all block
466 # devices. Default is disabled. A possible alternative uses
467 # mirror jobs to a builtin NBD server on the destination, which
468 # offers more flexibility. (Since 2.10)
470 # @return-path: If enabled, migration will use the return path even
471 # for precopy. (since 2.10)
473 # @pause-before-switchover: Pause outgoing migration before
474 # serialising device state and before disabling block IO (since
477 # @multifd: Use more than one fd for migration (since 4.0)
479 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
482 # @postcopy-blocktime: Calculate downtime for postcopy live migration
485 # @late-block-activate: If enabled, the destination will not activate
486 # block devices (and thus take locks) immediately at the end of
487 # migration. (since 3.0)
489 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory
490 # that is accessible on the destination machine. (since 4.0)
492 # @validate-uuid: Send the UUID of the source to allow the destination
493 # to ensure it is the same. (since 4.2)
495 # @background-snapshot: If enabled, the migration stream will be a
496 # snapshot of the VM exactly at the point when the migration
497 # procedure starts. The VM RAM is saved with running VM. (since
500 # @zero-copy-send: Controls behavior on sending memory pages on
501 # migration. When true, enables a zero-copy mechanism for sending
502 # memory pages, if host supports it. Requires that QEMU be
503 # permitted to use locked memory for guest RAM pages. (since 7.1)
505 # @postcopy-preempt: If enabled, the migration process will allow
506 # postcopy requests to preempt precopy stream, so postcopy
507 # requests will be handled faster. This is a performance feature
508 # and should not affect the correctness of postcopy migration.
511 # @switchover-ack: If enabled, migration will not stop the source VM
512 # and complete the migration until an ACK is received from the
513 # destination that it's OK to do so. Exactly when this ACK is
514 # sent depends on the migrated devices that use this feature. For
515 # example, a device can use it to make sure some of its data is
516 # sent and loaded in the destination before doing switchover.
517 # This can reduce downtime if devices that support this capability
518 # are present. 'return-path' capability must be enabled to use
521 # @dirty-limit: If enabled, migration will throttle vCPUs as needed to
522 # keep their dirty page rate within @vcpu-dirty-limit. This can
523 # improve responsiveness of large guests during live migration,
524 # and can result in more stable read performance. Requires KVM
525 # with accelerator property "dirty-ring-size" set. (Since 8.1)
529 # @unstable: Members @x-colo and @x-ignore-shared are experimental.
533 { 'enum': 'MigrationCapability',
534 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
535 'compress', 'events', 'postcopy-ram',
536 { 'name': 'x-colo', 'features': [ 'unstable' ] },
538 'block', 'return-path', 'pause-before-switchover', 'multifd',
539 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
540 { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
541 'validate-uuid', 'background-snapshot',
542 'zero-copy-send', 'postcopy-preempt', 'switchover-ack',
546 # @MigrationCapabilityStatus:
548 # Migration capability information
550 # @capability: capability enum
552 # @state: capability state bool
556 { 'struct': 'MigrationCapabilityStatus',
557 'data': { 'capability': 'MigrationCapability', 'state': 'bool' } }
560 # @migrate-set-capabilities:
562 # Enable/Disable the following migration capabilities (like xbzrle)
564 # @capabilities: json array of capability modifications to make
570 # -> { "execute": "migrate-set-capabilities" , "arguments":
571 # { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
572 # <- { "return": {} }
574 { 'command': 'migrate-set-capabilities',
575 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
578 # @query-migrate-capabilities:
580 # Returns information about the current migration capabilities status
582 # Returns: @MigrationCapabilityStatus
588 # -> { "execute": "query-migrate-capabilities" }
590 # {"state": false, "capability": "xbzrle"},
591 # {"state": false, "capability": "rdma-pin-all"},
592 # {"state": false, "capability": "auto-converge"},
593 # {"state": false, "capability": "zero-blocks"},
594 # {"state": false, "capability": "compress"},
595 # {"state": true, "capability": "events"},
596 # {"state": false, "capability": "postcopy-ram"},
597 # {"state": false, "capability": "x-colo"}
600 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
603 # @MultiFDCompression:
605 # An enumeration of multifd compression methods.
607 # @none: no compression.
609 # @zlib: use zlib compression method.
611 # @zstd: use zstd compression method.
615 { 'enum': 'MultiFDCompression',
616 'data': [ 'none', 'zlib',
617 { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
620 # @BitmapMigrationBitmapAliasTransform:
622 # @persistent: If present, the bitmap will be made persistent or
623 # transient depending on this parameter.
627 { 'struct': 'BitmapMigrationBitmapAliasTransform',
629 '*persistent': 'bool'
633 # @BitmapMigrationBitmapAlias:
635 # @name: The name of the bitmap.
637 # @alias: An alias name for migration (for example the bitmap name on
638 # the opposite site).
640 # @transform: Allows the modification of the migrated bitmap. (since
645 { 'struct': 'BitmapMigrationBitmapAlias',
649 '*transform': 'BitmapMigrationBitmapAliasTransform'
653 # @BitmapMigrationNodeAlias:
655 # Maps a block node name and the bitmaps it has to aliases for dirty
658 # @node-name: A block node name.
660 # @alias: An alias block node name for migration (for example the node
661 # name on the opposite site).
663 # @bitmaps: Mappings for the bitmaps on this node.
667 { 'struct': 'BitmapMigrationNodeAlias',
671 'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
675 # @MigrationParameter:
677 # Migration parameters enumeration
679 # @announce-initial: Initial delay (in milliseconds) before sending
680 # the first announce (Since 4.0)
682 # @announce-max: Maximum delay (in milliseconds) between packets in
683 # the announcement (Since 4.0)
685 # @announce-rounds: Number of self-announce packets sent after
686 # migration (Since 4.0)
688 # @announce-step: Increase in delay (in milliseconds) between
689 # subsequent packets in the announcement (Since 4.0)
691 # @compress-level: Set the compression level to be used in live
692 # migration, the compression level is an integer between 0 and 9,
693 # where 0 means no compression, 1 means the best compression
694 # speed, and 9 means best compression ratio which will consume
697 # @compress-threads: Set compression thread count to be used in live
698 # migration, the compression thread count is an integer between 1
701 # @compress-wait-thread: Controls behavior when all compression
702 # threads are currently busy. If true (default), wait for a free
703 # compression thread to become available; otherwise, send the page
704 # uncompressed. (Since 3.1)
706 # @decompress-threads: Set decompression thread count to be used in
707 # live migration, the decompression thread count is an integer
708 # between 1 and 255. Usually, decompression is at least 4 times as
709 # fast as compression, so set the decompress-threads to the number
710 # about 1/4 of compress-threads is adequate.
712 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
713 # bytes_xfer_period to trigger throttling. It is expressed as
714 # percentage. The default value is 50. (Since 5.0)
716 # @cpu-throttle-initial: Initial percentage of time guest cpus are
717 # throttled when migration auto-converge is activated. The
718 # default value is 20. (Since 2.7)
720 # @cpu-throttle-increment: throttle percentage increase each time
721 # auto-converge detects that migration is not making progress.
722 # The default value is 10. (Since 2.7)
724 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
725 # the tail stage of throttling, the Guest is very sensitive to CPU
726 # percentage while the @cpu-throttle -increment is excessive
727 # usually at tail stage. If this parameter is true, we will
728 # compute the ideal CPU percentage used by the Guest, which may
729 # exactly make the dirty rate match the dirty rate threshold.
730 # Then we will choose a smaller throttle increment between the one
731 # specified by @cpu-throttle-increment and the one generated by
732 # ideal CPU percentage. Therefore, it is compatible to
733 # traditional throttling, meanwhile the throttle increment won't
734 # be excessive at tail stage. The default value is false. (Since
737 # @tls-creds: ID of the 'tls-creds' object that provides credentials
738 # for establishing a TLS connection over the migration data
739 # channel. On the outgoing side of the migration, the credentials
740 # must be for a 'client' endpoint, while for the incoming side the
741 # credentials must be for a 'server' endpoint. Setting this will
742 # enable TLS for all migrations. The default is unset, resulting
743 # in unsecured migration at the QEMU level. (Since 2.7)
745 # @tls-hostname: hostname of the target host for the migration. This
746 # is required when using x509 based TLS credentials and the
747 # migration URI does not already include a hostname. For example
748 # if using fd: or exec: based migration, the hostname must be
749 # provided so that the server's x509 certificate identity can be
750 # validated. (Since 2.7)
752 # @tls-authz: ID of the 'authz' object subclass that provides access
753 # control checking of the TLS x509 certificate distinguished name.
754 # This object is only resolved at time of use, so can be deleted
755 # and recreated on the fly while the migration server is active.
756 # If missing, it will default to denying access (Since 4.0)
758 # @max-bandwidth: to set maximum speed for migration. maximum speed
759 # in bytes per second. (Since 2.8)
761 # @downtime-limit: set maximum tolerated downtime for migration.
762 # maximum downtime in milliseconds (Since 2.8)
764 # @x-checkpoint-delay: The delay time (in ms) between two COLO
765 # checkpoints in periodic mode. (Since 2.8)
767 # @block-incremental: Affects how much storage is migrated when the
768 # block migration capability is enabled. When false, the entire
769 # storage backing chain is migrated into a flattened image at the
770 # destination; when true, only the active qcow2 layer is migrated
771 # and the destination must already have access to the same backing
772 # chain as was used on the source. (since 2.10)
774 # @multifd-channels: Number of channels used to migrate data in
775 # parallel. This is the same number that the number of sockets
776 # used for migration. The default value is 2 (since 4.0)
778 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
779 # needs to be a multiple of the target page size and a power of 2
782 # @max-postcopy-bandwidth: Background transfer bandwidth during
783 # postcopy. Defaults to 0 (unlimited). In bytes per second.
786 # @max-cpu-throttle: maximum cpu throttle percentage. Defaults to 99.
789 # @multifd-compression: Which compression method to use. Defaults to
792 # @multifd-zlib-level: Set the compression level to be used in live
793 # migration, the compression level is an integer between 0 and 9,
794 # where 0 means no compression, 1 means the best compression
795 # speed, and 9 means best compression ratio which will consume
796 # more CPU. Defaults to 1. (Since 5.0)
798 # @multifd-zstd-level: Set the compression level to be used in live
799 # migration, the compression level is an integer between 0 and 20,
800 # where 0 means no compression, 1 means the best compression
801 # speed, and 20 means best compression ratio which will consume
802 # more CPU. Defaults to 1. (Since 5.0)
804 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
805 # aliases for the purpose of dirty bitmap migration. Such aliases
806 # may for example be the corresponding names on the opposite site.
807 # The mapping must be one-to-one, but not necessarily complete: On
808 # the source, unmapped bitmaps and all bitmaps on unmapped nodes
809 # will be ignored. On the destination, encountering an unmapped
810 # alias in the incoming migration stream will result in a report,
811 # and all further bitmap migration data will then be discarded.
812 # Note that the destination does not know about bitmaps it does
813 # not receive, so there is no limitation or requirement regarding
814 # the number of bitmaps received, or how they are named, or on
815 # which nodes they are placed. By default (when this parameter
816 # has never been set), bitmap names are mapped to themselves.
817 # Nodes are mapped to their block device name if there is one, and
818 # to their node name otherwise. (Since 5.2)
820 # @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
821 # limit during live migration. Should be in the range 1 to 1000ms.
822 # Defaults to 1000ms. (Since 8.1)
824 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
825 # Defaults to 1. (Since 8.1)
829 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
834 { 'enum': 'MigrationParameter',
835 'data': ['announce-initial', 'announce-max',
836 'announce-rounds', 'announce-step',
837 'compress-level', 'compress-threads', 'decompress-threads',
838 'compress-wait-thread', 'throttle-trigger-threshold',
839 'cpu-throttle-initial', 'cpu-throttle-increment',
840 'cpu-throttle-tailslow',
841 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
843 { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
846 'xbzrle-cache-size', 'max-postcopy-bandwidth',
847 'max-cpu-throttle', 'multifd-compression',
848 'multifd-zlib-level', 'multifd-zstd-level',
849 'block-bitmap-mapping',
850 { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] },
851 'vcpu-dirty-limit'] }
854 # @MigrateSetParameters:
856 # @announce-initial: Initial delay (in milliseconds) before sending
857 # the first announce (Since 4.0)
859 # @announce-max: Maximum delay (in milliseconds) between packets in
860 # the announcement (Since 4.0)
862 # @announce-rounds: Number of self-announce packets sent after
863 # migration (Since 4.0)
865 # @announce-step: Increase in delay (in milliseconds) between
866 # subsequent packets in the announcement (Since 4.0)
868 # @compress-level: compression level
870 # @compress-threads: compression thread count
872 # @compress-wait-thread: Controls behavior when all compression
873 # threads are currently busy. If true (default), wait for a free
874 # compression thread to become available; otherwise, send the page
875 # uncompressed. (Since 3.1)
877 # @decompress-threads: decompression thread count
879 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
880 # bytes_xfer_period to trigger throttling. It is expressed as
881 # percentage. The default value is 50. (Since 5.0)
883 # @cpu-throttle-initial: Initial percentage of time guest cpus are
884 # throttled when migration auto-converge is activated. The
885 # default value is 20. (Since 2.7)
887 # @cpu-throttle-increment: throttle percentage increase each time
888 # auto-converge detects that migration is not making progress.
889 # The default value is 10. (Since 2.7)
891 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
892 # the tail stage of throttling, the Guest is very sensitive to CPU
893 # percentage while the @cpu-throttle -increment is excessive
894 # usually at tail stage. If this parameter is true, we will
895 # compute the ideal CPU percentage used by the Guest, which may
896 # exactly make the dirty rate match the dirty rate threshold.
897 # Then we will choose a smaller throttle increment between the one
898 # specified by @cpu-throttle-increment and the one generated by
899 # ideal CPU percentage. Therefore, it is compatible to
900 # traditional throttling, meanwhile the throttle increment won't
901 # be excessive at tail stage. The default value is false. (Since
904 # @tls-creds: ID of the 'tls-creds' object that provides credentials
905 # for establishing a TLS connection over the migration data
906 # channel. On the outgoing side of the migration, the credentials
907 # must be for a 'client' endpoint, while for the incoming side the
908 # credentials must be for a 'server' endpoint. Setting this to a
909 # non-empty string enables TLS for all migrations. An empty
910 # string means that QEMU will use plain text mode for migration,
911 # rather than TLS (Since 2.9) Previously (since 2.7), this was
912 # reported by omitting tls-creds instead.
914 # @tls-hostname: hostname of the target host for the migration. This
915 # is required when using x509 based TLS credentials and the
916 # migration URI does not already include a hostname. For example
917 # if using fd: or exec: based migration, the hostname must be
918 # provided so that the server's x509 certificate identity can be
919 # validated. (Since 2.7) An empty string means that QEMU will use
920 # the hostname associated with the migration URI, if any. (Since
921 # 2.9) Previously (since 2.7), this was reported by omitting
922 # tls-hostname instead.
924 # @max-bandwidth: to set maximum speed for migration. maximum speed
925 # in bytes per second. (Since 2.8)
927 # @downtime-limit: set maximum tolerated downtime for migration.
928 # maximum downtime in milliseconds (Since 2.8)
930 # @x-checkpoint-delay: the delay time between two COLO checkpoints.
933 # @block-incremental: Affects how much storage is migrated when the
934 # block migration capability is enabled. When false, the entire
935 # storage backing chain is migrated into a flattened image at the
936 # destination; when true, only the active qcow2 layer is migrated
937 # and the destination must already have access to the same backing
938 # chain as was used on the source. (since 2.10)
940 # @multifd-channels: Number of channels used to migrate data in
941 # parallel. This is the same number that the number of sockets
942 # used for migration. The default value is 2 (since 4.0)
944 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
945 # needs to be a multiple of the target page size and a power of 2
948 # @max-postcopy-bandwidth: Background transfer bandwidth during
949 # postcopy. Defaults to 0 (unlimited). In bytes per second.
952 # @max-cpu-throttle: maximum cpu throttle percentage. The default
953 # value is 99. (Since 3.1)
955 # @multifd-compression: Which compression method to use. Defaults to
958 # @multifd-zlib-level: Set the compression level to be used in live
959 # migration, the compression level is an integer between 0 and 9,
960 # where 0 means no compression, 1 means the best compression
961 # speed, and 9 means best compression ratio which will consume
962 # more CPU. Defaults to 1. (Since 5.0)
964 # @multifd-zstd-level: Set the compression level to be used in live
965 # migration, the compression level is an integer between 0 and 20,
966 # where 0 means no compression, 1 means the best compression
967 # speed, and 20 means best compression ratio which will consume
968 # more CPU. Defaults to 1. (Since 5.0)
970 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
971 # aliases for the purpose of dirty bitmap migration. Such aliases
972 # may for example be the corresponding names on the opposite site.
973 # The mapping must be one-to-one, but not necessarily complete: On
974 # the source, unmapped bitmaps and all bitmaps on unmapped nodes
975 # will be ignored. On the destination, encountering an unmapped
976 # alias in the incoming migration stream will result in a report,
977 # and all further bitmap migration data will then be discarded.
978 # Note that the destination does not know about bitmaps it does
979 # not receive, so there is no limitation or requirement regarding
980 # the number of bitmaps received, or how they are named, or on
981 # which nodes they are placed. By default (when this parameter
982 # has never been set), bitmap names are mapped to themselves.
983 # Nodes are mapped to their block device name if there is one, and
984 # to their node name otherwise. (Since 5.2)
986 # @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
987 # limit during live migration. Should be in the range 1 to 1000ms.
988 # Defaults to 1000ms. (Since 8.1)
990 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
991 # Defaults to 1. (Since 8.1)
995 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
998 # TODO: either fuse back into MigrationParameters, or make
999 # MigrationParameters members mandatory
1003 { 'struct': 'MigrateSetParameters',
1004 'data': { '*announce-initial': 'size',
1005 '*announce-max': 'size',
1006 '*announce-rounds': 'size',
1007 '*announce-step': 'size',
1008 '*compress-level': 'uint8',
1009 '*compress-threads': 'uint8',
1010 '*compress-wait-thread': 'bool',
1011 '*decompress-threads': 'uint8',
1012 '*throttle-trigger-threshold': 'uint8',
1013 '*cpu-throttle-initial': 'uint8',
1014 '*cpu-throttle-increment': 'uint8',
1015 '*cpu-throttle-tailslow': 'bool',
1016 '*tls-creds': 'StrOrNull',
1017 '*tls-hostname': 'StrOrNull',
1018 '*tls-authz': 'StrOrNull',
1019 '*max-bandwidth': 'size',
1020 '*downtime-limit': 'uint64',
1021 '*x-checkpoint-delay': { 'type': 'uint32',
1022 'features': [ 'unstable' ] },
1023 '*block-incremental': 'bool',
1024 '*multifd-channels': 'uint8',
1025 '*xbzrle-cache-size': 'size',
1026 '*max-postcopy-bandwidth': 'size',
1027 '*max-cpu-throttle': 'uint8',
1028 '*multifd-compression': 'MultiFDCompression',
1029 '*multifd-zlib-level': 'uint8',
1030 '*multifd-zstd-level': 'uint8',
1031 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
1032 '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
1033 'features': [ 'unstable' ] },
1034 '*vcpu-dirty-limit': 'uint64'} }
1037 # @migrate-set-parameters:
1039 # Set various migration parameters.
1045 # -> { "execute": "migrate-set-parameters" ,
1046 # "arguments": { "compress-level": 1 } }
1047 # <- { "return": {} }
1049 { 'command': 'migrate-set-parameters', 'boxed': true,
1050 'data': 'MigrateSetParameters' }
1053 # @MigrationParameters:
1055 # The optional members aren't actually optional.
1057 # @announce-initial: Initial delay (in milliseconds) before sending
1058 # the first announce (Since 4.0)
1060 # @announce-max: Maximum delay (in milliseconds) between packets in
1061 # the announcement (Since 4.0)
1063 # @announce-rounds: Number of self-announce packets sent after
1064 # migration (Since 4.0)
1066 # @announce-step: Increase in delay (in milliseconds) between
1067 # subsequent packets in the announcement (Since 4.0)
1069 # @compress-level: compression level
1071 # @compress-threads: compression thread count
1073 # @compress-wait-thread: Controls behavior when all compression
1074 # threads are currently busy. If true (default), wait for a free
1075 # compression thread to become available; otherwise, send the page
1076 # uncompressed. (Since 3.1)
1078 # @decompress-threads: decompression thread count
1080 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
1081 # bytes_xfer_period to trigger throttling. It is expressed as
1082 # percentage. The default value is 50. (Since 5.0)
1084 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1085 # throttled when migration auto-converge is activated. (Since
1088 # @cpu-throttle-increment: throttle percentage increase each time
1089 # auto-converge detects that migration is not making progress.
1092 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
1093 # the tail stage of throttling, the Guest is very sensitive to CPU
1094 # percentage while the @cpu-throttle -increment is excessive
1095 # usually at tail stage. If this parameter is true, we will
1096 # compute the ideal CPU percentage used by the Guest, which may
1097 # exactly make the dirty rate match the dirty rate threshold.
1098 # Then we will choose a smaller throttle increment between the one
1099 # specified by @cpu-throttle-increment and the one generated by
1100 # ideal CPU percentage. Therefore, it is compatible to
1101 # traditional throttling, meanwhile the throttle increment won't
1102 # be excessive at tail stage. The default value is false. (Since
1105 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1106 # for establishing a TLS connection over the migration data
1107 # channel. On the outgoing side of the migration, the credentials
1108 # must be for a 'client' endpoint, while for the incoming side the
1109 # credentials must be for a 'server' endpoint. An empty string
1110 # means that QEMU will use plain text mode for migration, rather
1111 # than TLS (Since 2.7) Note: 2.8 reports this by omitting
1112 # tls-creds instead.
1114 # @tls-hostname: hostname of the target host for the migration. This
1115 # is required when using x509 based TLS credentials and the
1116 # migration URI does not already include a hostname. For example
1117 # if using fd: or exec: based migration, the hostname must be
1118 # provided so that the server's x509 certificate identity can be
1119 # validated. (Since 2.7) An empty string means that QEMU will use
1120 # the hostname associated with the migration URI, if any. (Since
1121 # 2.9) Note: 2.8 reports this by omitting tls-hostname instead.
1123 # @tls-authz: ID of the 'authz' object subclass that provides access
1124 # control checking of the TLS x509 certificate distinguished name.
1127 # @max-bandwidth: to set maximum speed for migration. maximum speed
1128 # in bytes per second. (Since 2.8)
1130 # @downtime-limit: set maximum tolerated downtime for migration.
1131 # maximum downtime in milliseconds (Since 2.8)
1133 # @x-checkpoint-delay: the delay time between two COLO checkpoints.
1136 # @block-incremental: Affects how much storage is migrated when the
1137 # block migration capability is enabled. When false, the entire
1138 # storage backing chain is migrated into a flattened image at the
1139 # destination; when true, only the active qcow2 layer is migrated
1140 # and the destination must already have access to the same backing
1141 # chain as was used on the source. (since 2.10)
1143 # @multifd-channels: Number of channels used to migrate data in
1144 # parallel. This is the same number that the number of sockets
1145 # used for migration. The default value is 2 (since 4.0)
1147 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
1148 # needs to be a multiple of the target page size and a power of 2
1151 # @max-postcopy-bandwidth: Background transfer bandwidth during
1152 # postcopy. Defaults to 0 (unlimited). In bytes per second.
1155 # @max-cpu-throttle: maximum cpu throttle percentage. Defaults to 99.
1158 # @multifd-compression: Which compression method to use. Defaults to
1161 # @multifd-zlib-level: Set the compression level to be used in live
1162 # migration, the compression level is an integer between 0 and 9,
1163 # where 0 means no compression, 1 means the best compression
1164 # speed, and 9 means best compression ratio which will consume
1165 # more CPU. Defaults to 1. (Since 5.0)
1167 # @multifd-zstd-level: Set the compression level to be used in live
1168 # migration, the compression level is an integer between 0 and 20,
1169 # where 0 means no compression, 1 means the best compression
1170 # speed, and 20 means best compression ratio which will consume
1171 # more CPU. Defaults to 1. (Since 5.0)
1173 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1174 # aliases for the purpose of dirty bitmap migration. Such aliases
1175 # may for example be the corresponding names on the opposite site.
1176 # The mapping must be one-to-one, but not necessarily complete: On
1177 # the source, unmapped bitmaps and all bitmaps on unmapped nodes
1178 # will be ignored. On the destination, encountering an unmapped
1179 # alias in the incoming migration stream will result in a report,
1180 # and all further bitmap migration data will then be discarded.
1181 # Note that the destination does not know about bitmaps it does
1182 # not receive, so there is no limitation or requirement regarding
1183 # the number of bitmaps received, or how they are named, or on
1184 # which nodes they are placed. By default (when this parameter
1185 # has never been set), bitmap names are mapped to themselves.
1186 # Nodes are mapped to their block device name if there is one, and
1187 # to their node name otherwise. (Since 5.2)
1189 # @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
1190 # limit during live migration. Should be in the range 1 to 1000ms.
1191 # Defaults to 1000ms. (Since 8.1)
1193 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
1194 # Defaults to 1. (Since 8.1)
1198 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
1203 { 'struct': 'MigrationParameters',
1204 'data': { '*announce-initial': 'size',
1205 '*announce-max': 'size',
1206 '*announce-rounds': 'size',
1207 '*announce-step': 'size',
1208 '*compress-level': 'uint8',
1209 '*compress-threads': 'uint8',
1210 '*compress-wait-thread': 'bool',
1211 '*decompress-threads': 'uint8',
1212 '*throttle-trigger-threshold': 'uint8',
1213 '*cpu-throttle-initial': 'uint8',
1214 '*cpu-throttle-increment': 'uint8',
1215 '*cpu-throttle-tailslow': 'bool',
1216 '*tls-creds': 'str',
1217 '*tls-hostname': 'str',
1218 '*tls-authz': 'str',
1219 '*max-bandwidth': 'size',
1220 '*downtime-limit': 'uint64',
1221 '*x-checkpoint-delay': { 'type': 'uint32',
1222 'features': [ 'unstable' ] },
1223 '*block-incremental': 'bool',
1224 '*multifd-channels': 'uint8',
1225 '*xbzrle-cache-size': 'size',
1226 '*max-postcopy-bandwidth': 'size',
1227 '*max-cpu-throttle': 'uint8',
1228 '*multifd-compression': 'MultiFDCompression',
1229 '*multifd-zlib-level': 'uint8',
1230 '*multifd-zstd-level': 'uint8',
1231 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
1232 '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
1233 'features': [ 'unstable' ] },
1234 '*vcpu-dirty-limit': 'uint64'} }
1237 # @query-migrate-parameters:
1239 # Returns information about the current migration parameters
1241 # Returns: @MigrationParameters
1247 # -> { "execute": "query-migrate-parameters" }
1249 # "decompress-threads": 2,
1250 # "cpu-throttle-increment": 10,
1251 # "compress-threads": 8,
1252 # "compress-level": 1,
1253 # "cpu-throttle-initial": 20,
1254 # "max-bandwidth": 33554432,
1255 # "downtime-limit": 300
1259 { 'command': 'query-migrate-parameters',
1260 'returns': 'MigrationParameters' }
1263 # @migrate-start-postcopy:
1265 # Followup to a migration command to switch the migration to postcopy
1266 # mode. The postcopy-ram capability must be set on both source and
1267 # destination before the original migration command.
1273 # -> { "execute": "migrate-start-postcopy" }
1274 # <- { "return": {} }
1276 { 'command': 'migrate-start-postcopy' }
1281 # Emitted when a migration event happens
1283 # @status: @MigrationStatus describing the current migration status.
1289 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1290 # "event": "MIGRATION",
1291 # "data": {"status": "completed"} }
1293 { 'event': 'MIGRATION',
1294 'data': {'status': 'MigrationStatus'}}
1299 # Emitted from the source side of a migration at the start of each
1300 # pass (when it syncs the dirty bitmap)
1302 # @pass: An incrementing count (starting at 1 on the first pass)
1308 # <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1309 # "event": "MIGRATION_PASS", "data": {"pass": 2} }
1311 { 'event': 'MIGRATION_PASS',
1312 'data': { 'pass': 'int' } }
1317 # The message transmission between Primary side and Secondary side.
1319 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1321 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for
1324 # @checkpoint-reply: SVM gets PVM's checkpoint request
1326 # @vmstate-send: VM's state will be sent by PVM.
1328 # @vmstate-size: The total size of VMstate.
1330 # @vmstate-received: VM's state has been received by SVM.
1332 # @vmstate-loaded: VM's state has been loaded by SVM.
1336 { 'enum': 'COLOMessage',
1337 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1338 'vmstate-send', 'vmstate-size', 'vmstate-received',
1339 'vmstate-loaded' ] }
1344 # The COLO current mode.
1346 # @none: COLO is disabled.
1348 # @primary: COLO node in primary side.
1350 # @secondary: COLO node in slave side.
1354 { 'enum': 'COLOMode',
1355 'data': [ 'none', 'primary', 'secondary'] }
1360 # An enumeration of COLO failover status
1362 # @none: no failover has ever happened
1364 # @require: got failover requirement but not handled
1366 # @active: in the process of doing failover
1368 # @completed: finish the process of failover
1370 # @relaunch: restart the failover process, from 'none' -> 'completed'
1375 { 'enum': 'FailoverStatus',
1376 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1381 # Emitted when VM finishes COLO mode due to some errors happening or
1382 # at the request of users.
1384 # @mode: report COLO mode when COLO exited.
1386 # @reason: describes the reason for the COLO exit.
1392 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1393 # "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1395 { 'event': 'COLO_EXIT',
1396 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1401 # The reason for a COLO exit.
1403 # @none: failover has never happened. This state does not occur in
1404 # the COLO_EXIT event, and is only visible in the result of
1405 # query-colo-status.
1407 # @request: COLO exit is due to an external request.
1409 # @error: COLO exit is due to an internal error.
1411 # @processing: COLO is currently handling a failover (since 4.0).
1415 { 'enum': 'COLOExitReason',
1416 'data': [ 'none', 'request', 'error' , 'processing' ] }
1419 # @x-colo-lost-heartbeat:
1421 # Tell qemu that heartbeat is lost, request it to do takeover
1422 # procedures. If this command is sent to the PVM, the Primary side
1423 # will exit COLO mode. If sent to the Secondary, the Secondary side
1424 # will run failover work, then takes over server operation to become
1429 # @unstable: This command is experimental.
1435 # -> { "execute": "x-colo-lost-heartbeat" }
1436 # <- { "return": {} }
1438 { 'command': 'x-colo-lost-heartbeat',
1439 'features': [ 'unstable' ],
1440 'if': 'CONFIG_REPLICATION' }
1445 # Cancel the current executing migration process.
1447 # Returns: nothing on success
1449 # Notes: This command succeeds even if there is no migration process
1456 # -> { "execute": "migrate_cancel" }
1457 # <- { "return": {} }
1459 { 'command': 'migrate_cancel' }
1462 # @migrate-continue:
1464 # Continue migration when it's in a paused state.
1466 # @state: The state the migration is currently expected to be in
1468 # Returns: nothing on success
1474 # -> { "execute": "migrate-continue" , "arguments":
1475 # { "state": "pre-switchover" } }
1476 # <- { "return": {} }
1478 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1483 # Migrates the current running guest to another Virtual Machine.
1485 # @uri: the Uniform Resource Identifier of the destination VM
1487 # @blk: do block migration (full disk copy)
1489 # @inc: incremental disk copy migration
1491 # @detach: this argument exists only for compatibility reasons and is
1494 # @resume: resume one paused migration, default "off". (since 3.0)
1496 # Returns: nothing on success
1502 # 1. The 'query-migrate' command should be used to check migration's
1503 # progress and final result (this information is provided by the
1506 # 2. All boolean arguments default to false
1508 # 3. The user Monitor's "detach" argument is invalid in QMP and should
1513 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1514 # <- { "return": {} }
1516 { 'command': 'migrate',
1517 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1518 '*detach': 'bool', '*resume': 'bool' } }
1521 # @migrate-incoming:
1523 # Start an incoming migration, the qemu must have been started with
1526 # @uri: The Uniform Resource Identifier identifying the source or
1527 # address to listen on
1529 # Returns: nothing on success
1535 # 1. It's a bad idea to use a string for the uri, but it needs
1536 # to stay compatible with -incoming and the format of the uri
1537 # is already exposed above libvirt.
1539 # 2. QEMU must be started with -incoming defer to allow
1540 # migrate-incoming to be used.
1542 # 3. The uri format is the same as for -incoming
1546 # -> { "execute": "migrate-incoming",
1547 # "arguments": { "uri": "tcp::4446" } }
1548 # <- { "return": {} }
1550 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1553 # @xen-save-devices-state:
1555 # Save the state of all devices to file. The RAM and the block
1556 # devices of the VM are not saved by this command.
1558 # @filename: the file to save the state of the devices to as binary
1559 # data. See xen-save-devices-state.txt for a description of the
1562 # @live: Optional argument to ask QEMU to treat this command as part
1563 # of a live migration. Default to true. (since 2.11)
1565 # Returns: Nothing on success
1571 # -> { "execute": "xen-save-devices-state",
1572 # "arguments": { "filename": "/tmp/save" } }
1573 # <- { "return": {} }
1575 { 'command': 'xen-save-devices-state',
1576 'data': {'filename': 'str', '*live':'bool' } }
1579 # @xen-set-global-dirty-log:
1581 # Enable or disable the global dirty log mode.
1583 # @enable: true to enable, false to disable.
1591 # -> { "execute": "xen-set-global-dirty-log",
1592 # "arguments": { "enable": true } }
1593 # <- { "return": {} }
1595 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1598 # @xen-load-devices-state:
1600 # Load the state of all devices from file. The RAM and the block
1601 # devices of the VM are not loaded by this command.
1603 # @filename: the file to load the state of the devices from as binary
1604 # data. See xen-save-devices-state.txt for a description of the
1611 # -> { "execute": "xen-load-devices-state",
1612 # "arguments": { "filename": "/tmp/resume" } }
1613 # <- { "return": {} }
1615 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1618 # @xen-set-replication:
1620 # Enable or disable replication.
1622 # @enable: true to enable, false to disable.
1624 # @primary: true for primary or false for secondary.
1626 # @failover: true to do failover, false to stop. but cannot be
1627 # specified if 'enable' is true. default value is false.
1633 # -> { "execute": "xen-set-replication",
1634 # "arguments": {"enable": true, "primary": false} }
1635 # <- { "return": {} }
1639 { 'command': 'xen-set-replication',
1640 'data': { 'enable': 'bool', 'primary': 'bool', '*failover': 'bool' },
1641 'if': 'CONFIG_REPLICATION' }
1644 # @ReplicationStatus:
1646 # The result format for 'query-xen-replication-status'.
1648 # @error: true if an error happened, false if replication is normal.
1650 # @desc: the human readable error description string, when @error is
1655 { 'struct': 'ReplicationStatus',
1656 'data': { 'error': 'bool', '*desc': 'str' },
1657 'if': 'CONFIG_REPLICATION' }
1660 # @query-xen-replication-status:
1662 # Query replication status while the vm is running.
1664 # Returns: A @ReplicationStatus object showing the status.
1668 # -> { "execute": "query-xen-replication-status" }
1669 # <- { "return": { "error": false } }
1673 { 'command': 'query-xen-replication-status',
1674 'returns': 'ReplicationStatus',
1675 'if': 'CONFIG_REPLICATION' }
1678 # @xen-colo-do-checkpoint:
1680 # Xen uses this command to notify replication to trigger a checkpoint.
1686 # -> { "execute": "xen-colo-do-checkpoint" }
1687 # <- { "return": {} }
1691 { 'command': 'xen-colo-do-checkpoint',
1692 'if': 'CONFIG_REPLICATION' }
1697 # The result format for 'query-colo-status'.
1699 # @mode: COLO running mode. If COLO is running, this field will
1700 # return 'primary' or 'secondary'.
1702 # @last-mode: COLO last running mode. If COLO is running, this field
1703 # will return same like mode field, after failover we can use this
1704 # field to get last colo mode. (since 4.0)
1706 # @reason: describes the reason for the COLO exit.
1710 { 'struct': 'COLOStatus',
1711 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1712 'reason': 'COLOExitReason' },
1713 'if': 'CONFIG_REPLICATION' }
1716 # @query-colo-status:
1718 # Query COLO status while the vm is running.
1720 # Returns: A @COLOStatus object showing the status.
1724 # -> { "execute": "query-colo-status" }
1725 # <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
1729 { 'command': 'query-colo-status',
1730 'returns': 'COLOStatus',
1731 'if': 'CONFIG_REPLICATION' }
1736 # Provide a recovery migration stream URI.
1738 # @uri: the URI to be used for the recovery of migration stream.
1744 # -> { "execute": "migrate-recover",
1745 # "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1746 # <- { "return": {} }
1750 { 'command': 'migrate-recover',
1751 'data': { 'uri': 'str' },
1757 # Pause a migration. Currently it only supports postcopy.
1763 # -> { "execute": "migrate-pause" }
1764 # <- { "return": {} }
1768 { 'command': 'migrate-pause', 'allow-oob': true }
1773 # Emitted from source side of a migration when migration state is
1774 # WAIT_UNPLUG. Device was unplugged by guest operating system. Device
1775 # resources in QEMU are kept on standby to be able to re-plug it in
1776 # case of migration failure.
1778 # @device-id: QEMU device id of the unplugged device
1784 # <- { "event": "UNPLUG_PRIMARY",
1785 # "data": { "device-id": "hostdev0" },
1786 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1788 { 'event': 'UNPLUG_PRIMARY',
1789 'data': { 'device-id': 'str' } }
1794 # Dirty rate of vcpu.
1798 # @dirty-rate: dirty rate.
1802 { 'struct': 'DirtyRateVcpu',
1803 'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1808 # Dirty page rate measurement status.
1810 # @unstarted: measuring thread has not been started yet
1812 # @measuring: measuring thread is running
1814 # @measured: dirty page rate is measured and the results are available
1818 { 'enum': 'DirtyRateStatus',
1819 'data': [ 'unstarted', 'measuring', 'measured'] }
1822 # @DirtyRateMeasureMode:
1824 # Method used to measure dirty page rate. Differences between
1825 # available methods are explained in @calc-dirty-rate.
1827 # @page-sampling: use page sampling
1829 # @dirty-ring: use dirty ring
1831 # @dirty-bitmap: use dirty bitmap
1835 { 'enum': 'DirtyRateMeasureMode',
1836 'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
1841 # Specifies unit in which time-related value is specified.
1843 # @second: value is in seconds
1845 # @millisecond: value is in milliseconds
1850 { 'enum': 'TimeUnit',
1851 'data': ['second', 'millisecond'] }
1856 # Information about measured dirty page rate.
1858 # @dirty-rate: an estimate of the dirty page rate of the VM in units
1859 # of MiB/s. Value is present only when @status is 'measured'.
1861 # @status: current status of dirty page rate measurements
1863 # @start-time: start time in units of second for calculation
1865 # @calc-time: time period for which dirty page rate was measured,
1866 # expressed and rounded down to @calc-time-unit.
1868 # @calc-time-unit: time unit of @calc-time (Since 8.2)
1870 # @sample-pages: number of sampled pages per GiB of guest memory.
1871 # Valid only in page-sampling mode (Since 6.1)
1873 # @mode: mode that was used to measure dirty page rate (Since 6.2)
1875 # @vcpu-dirty-rate: dirty rate for each vCPU if dirty-ring mode was
1876 # specified (Since 6.2)
1880 { 'struct': 'DirtyRateInfo',
1881 'data': {'*dirty-rate': 'int64',
1882 'status': 'DirtyRateStatus',
1883 'start-time': 'int64',
1884 'calc-time': 'int64',
1885 'calc-time-unit': 'TimeUnit',
1886 'sample-pages': 'uint64',
1887 'mode': 'DirtyRateMeasureMode',
1888 '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
1893 # Start measuring dirty page rate of the VM. Results can be retrieved
1894 # with @query-dirty-rate after measurements are completed.
1896 # Dirty page rate is the number of pages changed in a given time
1897 # period expressed in MiB/s. The following methods of calculation are
1900 # 1. In page sampling mode, a random subset of pages are selected and
1901 # hashed twice: once at the beginning of measurement time period,
1902 # and once again at the end. If two hashes for some page are
1903 # different, the page is counted as changed. Since this method
1904 # relies on sampling and hashing, calculated dirty page rate is
1905 # only an estimate of its true value. Increasing @sample-pages
1906 # improves estimation quality at the cost of higher computational
1909 # 2. Dirty bitmap mode captures writes to memory (for example by
1910 # temporarily revoking write access to all pages) and counting page
1911 # faults. Information about modified pages is collected into a
1912 # bitmap, where each bit corresponds to one guest page. This mode
1913 # requires that KVM accelerator property "dirty-ring-size" is *not*
1916 # 3. Dirty ring mode is similar to dirty bitmap mode, but the
1917 # information about modified pages is collected into ring buffer.
1918 # This mode tracks page modification per each vCPU separately. It
1919 # requires that KVM accelerator property "dirty-ring-size" is set.
1921 # @calc-time: time period for which dirty page rate is calculated.
1922 # By default it is specified in seconds, but the unit can be set
1923 # explicitly with @calc-time-unit. Note that larger @calc-time
1924 # values will typically result in smaller dirty page rates because
1925 # page dirtying is a one-time event. Once some page is counted
1926 # as dirty during @calc-time period, further writes to this page
1927 # will not increase dirty page rate anymore.
1929 # @calc-time-unit: time unit in which @calc-time is specified.
1930 # By default it is seconds. (Since 8.2)
1932 # @sample-pages: number of sampled pages per each GiB of guest memory.
1933 # Default value is 512. For 4KiB guest pages this corresponds to
1934 # sampling ratio of 0.2%. This argument is used only in page
1935 # sampling mode. (Since 6.1)
1937 # @mode: mechanism for tracking dirty pages. Default value is
1938 # 'page-sampling'. Others are 'dirty-bitmap' and 'dirty-ring'.
1945 # -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
1946 # 'sample-pages': 512} }
1947 # <- { "return": {} }
1949 # Measure dirty rate using dirty bitmap for 500 milliseconds:
1951 # -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 500,
1952 # "calc-time-unit": "millisecond", "mode": "dirty-bitmap"} }
1954 # <- { "return": {} }
1956 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
1957 '*calc-time-unit': 'TimeUnit',
1958 '*sample-pages': 'int',
1959 '*mode': 'DirtyRateMeasureMode'} }
1962 # @query-dirty-rate:
1964 # Query results of the most recent invocation of @calc-dirty-rate.
1966 # @calc-time-unit: time unit in which to report calculation time.
1967 # By default it is reported in seconds. (Since 8.2)
1973 # 1. Measurement is in progress:
1975 # <- {"status": "measuring", "sample-pages": 512,
1976 # "mode": "page-sampling", "start-time": 1693900454, "calc-time": 10,
1977 # "calc-time-unit": "second"}
1979 # 2. Measurement has been completed:
1981 # <- {"status": "measured", "sample-pages": 512, "dirty-rate": 108,
1982 # "mode": "page-sampling", "start-time": 1693900454, "calc-time": 10,
1983 # "calc-time-unit": "second"}
1985 { 'command': 'query-dirty-rate', 'data': {'*calc-time-unit': 'TimeUnit' },
1986 'returns': 'DirtyRateInfo' }
1991 # Dirty page rate limit information of a virtual CPU.
1993 # @cpu-index: index of a virtual CPU.
1995 # @limit-rate: upper limit of dirty page rate (MB/s) for a virtual
1996 # CPU, 0 means unlimited.
1998 # @current-rate: current dirty page rate (MB/s) for a virtual CPU.
2002 { 'struct': 'DirtyLimitInfo',
2003 'data': { 'cpu-index': 'int',
2004 'limit-rate': 'uint64',
2005 'current-rate': 'uint64' } }
2008 # @set-vcpu-dirty-limit:
2010 # Set the upper limit of dirty page rate for virtual CPUs.
2012 # Requires KVM with accelerator property "dirty-ring-size" set. A
2013 # virtual CPU's dirty page rate is a measure of its memory load. To
2014 # observe dirty page rates, use @calc-dirty-rate.
2016 # @cpu-index: index of a virtual CPU, default is all.
2018 # @dirty-rate: upper limit of dirty page rate (MB/s) for virtual CPUs.
2024 # -> {"execute": "set-vcpu-dirty-limit"}
2025 # "arguments": { "dirty-rate": 200,
2026 # "cpu-index": 1 } }
2027 # <- { "return": {} }
2029 { 'command': 'set-vcpu-dirty-limit',
2030 'data': { '*cpu-index': 'int',
2031 'dirty-rate': 'uint64' } }
2034 # @cancel-vcpu-dirty-limit:
2036 # Cancel the upper limit of dirty page rate for virtual CPUs.
2038 # Cancel the dirty page limit for the vCPU which has been set with
2039 # set-vcpu-dirty-limit command. Note that this command requires
2040 # support from dirty ring, same as the "set-vcpu-dirty-limit".
2042 # @cpu-index: index of a virtual CPU, default is all.
2048 # -> {"execute": "cancel-vcpu-dirty-limit"},
2049 # "arguments": { "cpu-index": 1 } }
2050 # <- { "return": {} }
2052 { 'command': 'cancel-vcpu-dirty-limit',
2053 'data': { '*cpu-index': 'int'} }
2056 # @query-vcpu-dirty-limit:
2058 # Returns information about virtual CPU dirty page rate limits, if
2065 # -> {"execute": "query-vcpu-dirty-limit"}
2067 # { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
2068 # { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
2070 { 'command': 'query-vcpu-dirty-limit',
2071 'returns': [ 'DirtyLimitInfo' ] }
2074 # @MigrationThreadInfo:
2076 # Information about migrationthreads
2078 # @name: the name of migration thread
2080 # @thread-id: ID of the underlying host thread
2084 { 'struct': 'MigrationThreadInfo',
2085 'data': {'name': 'str',
2086 'thread-id': 'int'} }
2089 # @query-migrationthreads:
2091 # Returns information of migration threads
2093 # data: migration thread name
2095 # Returns: information about migration threads
2099 { 'command': 'query-migrationthreads',
2100 'returns': ['MigrationThreadInfo'] }
2105 # Save a VM snapshot
2107 # @job-id: identifier for the newly created job
2109 # @tag: name of the snapshot to create
2111 # @vmstate: block device node name to save vmstate to
2113 # @devices: list of block device node names to save a snapshot to
2115 # Applications should not assume that the snapshot save is complete
2116 # when this command returns. The job commands / events must be used
2117 # to determine completion and to fetch details of any errors that
2120 # Note that execution of the guest CPUs may be stopped during the time
2121 # it takes to save the snapshot. A future version of QEMU may ensure
2122 # CPUs are executing continuously.
2124 # It is strongly recommended that @devices contain all writable block
2125 # device nodes if a consistent snapshot is required.
2127 # If @tag already exists, an error will be reported
2133 # -> { "execute": "snapshot-save",
2135 # "job-id": "snapsave0",
2137 # "vmstate": "disk0",
2138 # "devices": ["disk0", "disk1"]
2141 # <- { "return": { } }
2142 # <- {"event": "JOB_STATUS_CHANGE",
2143 # "timestamp": {"seconds": 1432121972, "microseconds": 744001},
2144 # "data": {"status": "created", "id": "snapsave0"}}
2145 # <- {"event": "JOB_STATUS_CHANGE",
2146 # "timestamp": {"seconds": 1432122172, "microseconds": 744001},
2147 # "data": {"status": "running", "id": "snapsave0"}}
2148 # <- {"event": "STOP",
2149 # "timestamp": {"seconds": 1432122372, "microseconds": 744001} }
2150 # <- {"event": "RESUME",
2151 # "timestamp": {"seconds": 1432122572, "microseconds": 744001} }
2152 # <- {"event": "JOB_STATUS_CHANGE",
2153 # "timestamp": {"seconds": 1432122772, "microseconds": 744001},
2154 # "data": {"status": "waiting", "id": "snapsave0"}}
2155 # <- {"event": "JOB_STATUS_CHANGE",
2156 # "timestamp": {"seconds": 1432122972, "microseconds": 744001},
2157 # "data": {"status": "pending", "id": "snapsave0"}}
2158 # <- {"event": "JOB_STATUS_CHANGE",
2159 # "timestamp": {"seconds": 1432123172, "microseconds": 744001},
2160 # "data": {"status": "concluded", "id": "snapsave0"}}
2161 # -> {"execute": "query-jobs"}
2162 # <- {"return": [{"current-progress": 1,
2163 # "status": "concluded",
2164 # "total-progress": 1,
2165 # "type": "snapshot-save",
2166 # "id": "snapsave0"}]}
2170 { 'command': 'snapshot-save',
2171 'data': { 'job-id': 'str',
2174 'devices': ['str'] } }
2179 # Load a VM snapshot
2181 # @job-id: identifier for the newly created job
2183 # @tag: name of the snapshot to load.
2185 # @vmstate: block device node name to load vmstate from
2187 # @devices: list of block device node names to load a snapshot from
2189 # Applications should not assume that the snapshot load is complete
2190 # when this command returns. The job commands / events must be used
2191 # to determine completion and to fetch details of any errors that
2194 # Note that execution of the guest CPUs will be stopped during the
2195 # time it takes to load the snapshot.
2197 # It is strongly recommended that @devices contain all writable block
2198 # device nodes that can have changed since the original @snapshot-save
2199 # command execution.
2205 # -> { "execute": "snapshot-load",
2207 # "job-id": "snapload0",
2209 # "vmstate": "disk0",
2210 # "devices": ["disk0", "disk1"]
2213 # <- { "return": { } }
2214 # <- {"event": "JOB_STATUS_CHANGE",
2215 # "timestamp": {"seconds": 1472124172, "microseconds": 744001},
2216 # "data": {"status": "created", "id": "snapload0"}}
2217 # <- {"event": "JOB_STATUS_CHANGE",
2218 # "timestamp": {"seconds": 1472125172, "microseconds": 744001},
2219 # "data": {"status": "running", "id": "snapload0"}}
2220 # <- {"event": "STOP",
2221 # "timestamp": {"seconds": 1472125472, "microseconds": 744001} }
2222 # <- {"event": "RESUME",
2223 # "timestamp": {"seconds": 1472125872, "microseconds": 744001} }
2224 # <- {"event": "JOB_STATUS_CHANGE",
2225 # "timestamp": {"seconds": 1472126172, "microseconds": 744001},
2226 # "data": {"status": "waiting", "id": "snapload0"}}
2227 # <- {"event": "JOB_STATUS_CHANGE",
2228 # "timestamp": {"seconds": 1472127172, "microseconds": 744001},
2229 # "data": {"status": "pending", "id": "snapload0"}}
2230 # <- {"event": "JOB_STATUS_CHANGE",
2231 # "timestamp": {"seconds": 1472128172, "microseconds": 744001},
2232 # "data": {"status": "concluded", "id": "snapload0"}}
2233 # -> {"execute": "query-jobs"}
2234 # <- {"return": [{"current-progress": 1,
2235 # "status": "concluded",
2236 # "total-progress": 1,
2237 # "type": "snapshot-load",
2238 # "id": "snapload0"}]}
2242 { 'command': 'snapshot-load',
2243 'data': { 'job-id': 'str',
2246 'devices': ['str'] } }
2251 # Delete a VM snapshot
2253 # @job-id: identifier for the newly created job
2255 # @tag: name of the snapshot to delete.
2257 # @devices: list of block device node names to delete a snapshot from
2259 # Applications should not assume that the snapshot delete is complete
2260 # when this command returns. The job commands / events must be used
2261 # to determine completion and to fetch details of any errors that
2268 # -> { "execute": "snapshot-delete",
2270 # "job-id": "snapdelete0",
2272 # "devices": ["disk0", "disk1"]
2275 # <- { "return": { } }
2276 # <- {"event": "JOB_STATUS_CHANGE",
2277 # "timestamp": {"seconds": 1442124172, "microseconds": 744001},
2278 # "data": {"status": "created", "id": "snapdelete0"}}
2279 # <- {"event": "JOB_STATUS_CHANGE",
2280 # "timestamp": {"seconds": 1442125172, "microseconds": 744001},
2281 # "data": {"status": "running", "id": "snapdelete0"}}
2282 # <- {"event": "JOB_STATUS_CHANGE",
2283 # "timestamp": {"seconds": 1442126172, "microseconds": 744001},
2284 # "data": {"status": "waiting", "id": "snapdelete0"}}
2285 # <- {"event": "JOB_STATUS_CHANGE",
2286 # "timestamp": {"seconds": 1442127172, "microseconds": 744001},
2287 # "data": {"status": "pending", "id": "snapdelete0"}}
2288 # <- {"event": "JOB_STATUS_CHANGE",
2289 # "timestamp": {"seconds": 1442128172, "microseconds": 744001},
2290 # "data": {"status": "concluded", "id": "snapdelete0"}}
2291 # -> {"execute": "query-jobs"}
2292 # <- {"return": [{"current-progress": 1,
2293 # "status": "concluded",
2294 # "total-progress": 1,
2295 # "type": "snapshot-delete",
2296 # "id": "snapdelete0"}]}
2300 { 'command': 'snapshot-delete',
2301 'data': { 'job-id': 'str',
2303 'devices': ['str'] } }