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, when
234 # @status is 'failed'. Clients should not attempt to parse the
235 # error strings. (Since 2.7)
237 # @postcopy-blocktime: total time when all vCPU were blocked during
238 # postcopy live migration. This is only present when the
239 # postcopy-blocktime migration capability is enabled. (Since 3.0)
241 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.
242 # This is only present when the postcopy-blocktime migration
243 # capability is enabled. (Since 3.0)
245 # @compression: migration compression statistics, only returned if
246 # compression feature is on and status is 'active' or 'completed'
249 # @socket-address: Only used for tcp, to know what the real port is
252 # @vfio: @VfioStats containing detailed VFIO devices migration
253 # statistics, only returned if VFIO device is present, migration
254 # is supported by all VFIO devices and status is 'active' or
255 # 'completed' (since 5.2)
257 # @blocked-reasons: A list of reasons an outgoing migration is
258 # blocked. Present and non-empty when migration is blocked.
261 # @dirty-limit-throttle-time-per-round: Maximum throttle time (in microseconds) of virtual
262 # CPUs each dirty ring full round, which shows how
263 # MigrationCapability dirty-limit affects the guest
264 # during live migration. (since 8.1)
266 # @dirty-limit-ring-full-time: Estimated average dirty ring full time (in microseconds)
267 # each dirty ring full round, note that the value equals
268 # dirty ring memory size divided by average dirty page rate
269 # of virtual CPU, which can be used to observe the average
270 # memory load of virtual CPU indirectly. Note that zero
271 # means guest doesn't dirty memory (since 8.1)
275 { 'struct': 'MigrationInfo',
276 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
277 '*disk': 'MigrationStats',
278 '*vfio': 'VfioStats',
279 '*xbzrle-cache': 'XBZRLECacheStats',
280 '*total-time': 'int',
281 '*expected-downtime': 'int',
283 '*setup-time': 'int',
284 '*cpu-throttle-percentage': 'int',
285 '*error-desc': 'str',
286 '*blocked-reasons': ['str'],
287 '*postcopy-blocktime': 'uint32',
288 '*postcopy-vcpu-blocktime': ['uint32'],
289 '*compression': 'CompressionStats',
290 '*socket-address': ['SocketAddress'],
291 '*dirty-limit-throttle-time-per-round': 'uint64',
292 '*dirty-limit-ring-full-time': 'uint64'} }
297 # Returns information about current migration process. If migration
298 # is active there will be another json-object with RAM migration
299 # status and if block migration is active another one with block
302 # Returns: @MigrationInfo
308 # 1. Before the first migration
310 # -> { "execute": "query-migrate" }
311 # <- { "return": {} }
313 # 2. Migration is done and has succeeded
315 # -> { "execute": "query-migrate" }
317 # "status": "completed",
318 # "total-time":12345,
319 # "setup-time":12345,
327 # "normal-bytes":123456,
328 # "dirty-sync-count":15
333 # 3. Migration is done and has failed
335 # -> { "execute": "query-migrate" }
336 # <- { "return": { "status": "failed" } }
338 # 4. Migration is being performed and is not a block migration:
340 # -> { "execute": "query-migrate" }
344 # "total-time":12345,
345 # "setup-time":12345,
346 # "expected-downtime":12345,
353 # "normal-bytes":123456,
354 # "dirty-sync-count":15
359 # 5. Migration is being performed and is a block migration:
361 # -> { "execute": "query-migrate" }
365 # "total-time":12345,
366 # "setup-time":12345,
367 # "expected-downtime":12345,
370 # "remaining":1053304,
371 # "transferred":3720,
374 # "normal-bytes":123456,
375 # "dirty-sync-count":15
379 # "remaining":20880384,
380 # "transferred":91136
385 # 6. Migration is being performed and XBZRLE is active:
387 # -> { "execute": "query-migrate" }
391 # "total-time":12345,
392 # "setup-time":12345,
393 # "expected-downtime":12345,
396 # "remaining":1053304,
397 # "transferred":3720,
400 # "normal-bytes":3412992,
401 # "dirty-sync-count":15
404 # "cache-size":67108864,
408 # "cache-miss-rate":0.123,
409 # "encoding-rate":80.1,
415 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
418 # @MigrationCapability:
420 # Migration capabilities enumeration
422 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length
423 # Encoding). This feature allows us to minimize migration traffic
424 # for certain work loads, by sending compressed difference of the
427 # @rdma-pin-all: Controls whether or not the entire VM memory
428 # footprint is mlock()'d on demand or all at once. Refer to
429 # docs/rdma.txt for usage. Disabled by default. (since 2.0)
431 # @zero-blocks: During storage migration encode blocks of zeroes
432 # efficiently. This essentially saves 1MB of zeroes per block on
433 # the wire. Enabling requires source and target VM to support
434 # this feature. To enable it is sufficient to enable the
435 # capability on the source VM. The feature is disabled by default.
438 # @compress: Use multiple compression threads to accelerate live
439 # migration. This feature can help to reduce the migration
440 # traffic, by sending compressed pages. Please note that if
441 # compress and xbzrle are both on, compress only takes effect in
442 # the ram bulk stage, after that, it will be disabled and only
443 # xbzrle takes effect, this can help to minimize migration
444 # traffic. The feature is disabled by default. (since 2.4 )
446 # @events: generate events for each migration state change (since 2.4
449 # @auto-converge: If enabled, QEMU will automatically throttle down
450 # the guest to speed up convergence of RAM migration. (since 1.6)
452 # @postcopy-ram: Start executing on the migration target before all of
453 # RAM has been migrated, pulling the remaining pages along as
454 # needed. The capacity must have the same setting on both source
455 # and target or migration will not even start. NOTE: If the
456 # migration fails during postcopy the VM will fail. (since 2.6)
458 # @x-colo: If enabled, migration will never end, and the state of the
459 # VM on the primary side will be migrated continuously to the VM
460 # on secondary side, this process is called COarse-Grain LOck
461 # Stepping (COLO) for Non-stop Service. (since 2.8)
463 # @release-ram: if enabled, qemu will free the migrated ram pages on
464 # the source during postcopy-ram migration. (since 2.9)
466 # @block: If enabled, QEMU will also migrate the contents of all block
467 # devices. Default is disabled. A possible alternative uses
468 # mirror jobs to a builtin NBD server on the destination, which
469 # offers more flexibility. (Since 2.10)
471 # @return-path: If enabled, migration will use the return path even
472 # for precopy. (since 2.10)
474 # @pause-before-switchover: Pause outgoing migration before
475 # serialising device state and before disabling block IO (since
478 # @multifd: Use more than one fd for migration (since 4.0)
480 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
483 # @postcopy-blocktime: Calculate downtime for postcopy live migration
486 # @late-block-activate: If enabled, the destination will not activate
487 # block devices (and thus take locks) immediately at the end of
488 # migration. (since 3.0)
490 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory that is
491 # accessible on the destination machine. (since 4.0)
493 # @validate-uuid: Send the UUID of the source to allow the destination
494 # to ensure it is the same. (since 4.2)
496 # @background-snapshot: If enabled, the migration stream will be a
497 # snapshot of the VM exactly at the point when the migration
498 # procedure starts. The VM RAM is saved with running VM. (since
501 # @zero-copy-send: Controls behavior on sending memory pages on
502 # migration. When true, enables a zero-copy mechanism for sending
503 # memory pages, if host supports it. Requires that QEMU be
504 # permitted to use locked memory for guest RAM pages. (since 7.1)
506 # @postcopy-preempt: If enabled, the migration process will allow
507 # postcopy requests to preempt precopy stream, so postcopy
508 # requests will be handled faster. This is a performance feature
509 # and should not affect the correctness of postcopy migration.
512 # @switchover-ack: If enabled, migration will not stop the source VM
513 # and complete the migration until an ACK is received from the
514 # destination that it's OK to do so. Exactly when this ACK is
515 # sent depends on the migrated devices that use this feature.
516 # For example, a device can use it to make sure some of its data
517 # is sent and loaded in the destination before doing switchover.
518 # This can reduce downtime if devices that support this capability
519 # are present. 'return-path' capability must be enabled to use
522 # @dirty-limit: If enabled, migration will use the dirty-limit algo to
523 # throttle down guest instead of auto-converge algo.
524 # Throttle algo only works when vCPU's dirtyrate greater
525 # than 'vcpu-dirty-limit', read processes in guest os
526 # aren't penalized any more, so this algo can improve
527 # performance of vCPU during live migration. This is an
528 # optional performance feature and should not affect the
529 # correctness of the existing auto-converge algo.
534 # @unstable: Members @x-colo and @x-ignore-shared are experimental.
538 { 'enum': 'MigrationCapability',
539 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
540 'compress', 'events', 'postcopy-ram',
541 { 'name': 'x-colo', 'features': [ 'unstable' ] },
543 'block', 'return-path', 'pause-before-switchover', 'multifd',
544 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
545 { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
546 'validate-uuid', 'background-snapshot',
547 'zero-copy-send', 'postcopy-preempt', 'switchover-ack',
551 # @MigrationCapabilityStatus:
553 # Migration capability information
555 # @capability: capability enum
557 # @state: capability state bool
561 { 'struct': 'MigrationCapabilityStatus',
562 'data': { 'capability': 'MigrationCapability', 'state': 'bool' } }
565 # @migrate-set-capabilities:
567 # Enable/Disable the following migration capabilities (like xbzrle)
569 # @capabilities: json array of capability modifications to make
575 # -> { "execute": "migrate-set-capabilities" , "arguments":
576 # { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
577 # <- { "return": {} }
579 { 'command': 'migrate-set-capabilities',
580 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
583 # @query-migrate-capabilities:
585 # Returns information about the current migration capabilities status
587 # Returns: @MigrationCapabilityStatus
593 # -> { "execute": "query-migrate-capabilities" }
595 # {"state": false, "capability": "xbzrle"},
596 # {"state": false, "capability": "rdma-pin-all"},
597 # {"state": false, "capability": "auto-converge"},
598 # {"state": false, "capability": "zero-blocks"},
599 # {"state": false, "capability": "compress"},
600 # {"state": true, "capability": "events"},
601 # {"state": false, "capability": "postcopy-ram"},
602 # {"state": false, "capability": "x-colo"}
605 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
608 # @MultiFDCompression:
610 # An enumeration of multifd compression methods.
612 # @none: no compression.
614 # @zlib: use zlib compression method.
616 # @zstd: use zstd compression method.
620 { 'enum': 'MultiFDCompression',
621 'data': [ 'none', 'zlib',
622 { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
625 # @BitmapMigrationBitmapAliasTransform:
627 # @persistent: If present, the bitmap will be made persistent or
628 # transient depending on this parameter.
632 { 'struct': 'BitmapMigrationBitmapAliasTransform',
634 '*persistent': 'bool'
638 # @BitmapMigrationBitmapAlias:
640 # @name: The name of the bitmap.
642 # @alias: An alias name for migration (for example the bitmap name on
643 # the opposite site).
645 # @transform: Allows the modification of the migrated bitmap. (since
650 { 'struct': 'BitmapMigrationBitmapAlias',
654 '*transform': 'BitmapMigrationBitmapAliasTransform'
658 # @BitmapMigrationNodeAlias:
660 # Maps a block node name and the bitmaps it has to aliases for dirty
663 # @node-name: A block node name.
665 # @alias: An alias block node name for migration (for example the node
666 # name on the opposite site).
668 # @bitmaps: Mappings for the bitmaps on this node.
672 { 'struct': 'BitmapMigrationNodeAlias',
676 'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
680 # @MigrationParameter:
682 # Migration parameters enumeration
684 # @announce-initial: Initial delay (in milliseconds) before sending
685 # the first announce (Since 4.0)
687 # @announce-max: Maximum delay (in milliseconds) between packets in
688 # the announcement (Since 4.0)
690 # @announce-rounds: Number of self-announce packets sent after
691 # migration (Since 4.0)
693 # @announce-step: Increase in delay (in milliseconds) between
694 # subsequent packets in the announcement (Since 4.0)
696 # @compress-level: Set the compression level to be used in live
697 # migration, the compression level is an integer between 0 and 9,
698 # where 0 means no compression, 1 means the best compression
699 # speed, and 9 means best compression ratio which will consume
702 # @compress-threads: Set compression thread count to be used in live
703 # migration, the compression thread count is an integer between 1
706 # @compress-wait-thread: Controls behavior when all compression
707 # threads are currently busy. If true (default), wait for a free
708 # compression thread to become available; otherwise, send the page
709 # uncompressed. (Since 3.1)
711 # @decompress-threads: Set decompression thread count to be used in
712 # live migration, the decompression thread count is an integer
713 # between 1 and 255. Usually, decompression is at least 4 times as
714 # fast as compression, so set the decompress-threads to the number
715 # about 1/4 of compress-threads is adequate.
717 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
718 # bytes_xfer_period to trigger throttling. It is expressed as
719 # percentage. The default value is 50. (Since 5.0)
721 # @cpu-throttle-initial: Initial percentage of time guest cpus are
722 # throttled when migration auto-converge is activated. The
723 # default value is 20. (Since 2.7)
725 # @cpu-throttle-increment: throttle percentage increase each time
726 # auto-converge detects that migration is not making progress.
727 # The default value is 10. (Since 2.7)
729 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
730 # the tail stage of throttling, the Guest is very sensitive to CPU
731 # percentage while the @cpu-throttle -increment is excessive
732 # usually at tail stage. If this parameter is true, we will
733 # compute the ideal CPU percentage used by the Guest, which may
734 # exactly make the dirty rate match the dirty rate threshold.
735 # Then we will choose a smaller throttle increment between the one
736 # specified by @cpu-throttle-increment and the one generated by
737 # ideal CPU percentage. Therefore, it is compatible to
738 # traditional throttling, meanwhile the throttle increment won't
739 # be excessive at tail stage. The default value is false. (Since
742 # @tls-creds: ID of the 'tls-creds' object that provides credentials
743 # for establishing a TLS connection over the migration data
744 # channel. On the outgoing side of the migration, the credentials
745 # must be for a 'client' endpoint, while for the incoming side the
746 # credentials must be for a 'server' endpoint. Setting this will
747 # enable TLS for all migrations. The default is unset, resulting
748 # in unsecured migration at the QEMU level. (Since 2.7)
750 # @tls-hostname: hostname of the target host for the migration. This
751 # is required when using x509 based TLS credentials and the
752 # migration URI does not already include a hostname. For example
753 # if using fd: or exec: based migration, the hostname must be
754 # provided so that the server's x509 certificate identity can be
755 # validated. (Since 2.7)
757 # @tls-authz: ID of the 'authz' object subclass that provides access
758 # control checking of the TLS x509 certificate distinguished name.
759 # This object is only resolved at time of use, so can be deleted
760 # and recreated on the fly while the migration server is active.
761 # If missing, it will default to denying access (Since 4.0)
763 # @max-bandwidth: to set maximum speed for migration. maximum speed
764 # in bytes per second. (Since 2.8)
766 # @downtime-limit: set maximum tolerated downtime for migration.
767 # maximum downtime in milliseconds (Since 2.8)
769 # @x-checkpoint-delay: The delay time (in ms) between two COLO
770 # checkpoints in periodic mode. (Since 2.8)
772 # @block-incremental: Affects how much storage is migrated when the
773 # block migration capability is enabled. When false, the entire
774 # storage backing chain is migrated into a flattened image at the
775 # destination; when true, only the active qcow2 layer is migrated
776 # and the destination must already have access to the same backing
777 # chain as was used on the source. (since 2.10)
779 # @multifd-channels: Number of channels used to migrate data in
780 # parallel. This is the same number that the number of sockets
781 # used for migration. The default value is 2 (since 4.0)
783 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
784 # needs to be a multiple of the target page size and a power of 2
787 # @max-postcopy-bandwidth: Background transfer bandwidth during
788 # postcopy. Defaults to 0 (unlimited). In bytes per second.
791 # @max-cpu-throttle: maximum cpu throttle percentage. Defaults to 99.
794 # @multifd-compression: Which compression method to use. Defaults to
797 # @multifd-zlib-level: Set the compression level to be used in live
798 # migration, the compression level is an integer between 0 and 9,
799 # where 0 means no compression, 1 means the best compression
800 # speed, and 9 means best compression ratio which will consume
801 # more CPU. Defaults to 1. (Since 5.0)
803 # @multifd-zstd-level: Set the compression level to be used in live
804 # migration, the compression level is an integer between 0 and 20,
805 # where 0 means no compression, 1 means the best compression
806 # speed, and 20 means best compression ratio which will consume
807 # more CPU. Defaults to 1. (Since 5.0)
809 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
810 # aliases for the purpose of dirty bitmap migration. Such aliases
811 # may for example be the corresponding names on the opposite site.
812 # The mapping must be one-to-one, but not necessarily complete: On
813 # the source, unmapped bitmaps and all bitmaps on unmapped nodes
814 # will be ignored. On the destination, encountering an unmapped
815 # alias in the incoming migration stream will result in a report,
816 # and all further bitmap migration data will then be discarded.
817 # Note that the destination does not know about bitmaps it does
818 # not receive, so there is no limitation or requirement regarding
819 # the number of bitmaps received, or how they are named, or on
820 # which nodes they are placed. By default (when this parameter
821 # has never been set), bitmap names are mapped to themselves.
822 # Nodes are mapped to their block device name if there is one, and
823 # to their node name otherwise. (Since 5.2)
825 # @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
826 # live migration. Should be in the range 1 to 1000ms,
827 # defaults to 1000ms. (Since 8.1)
829 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
830 # Defaults to 1. (Since 8.1)
834 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
839 { 'enum': 'MigrationParameter',
840 'data': ['announce-initial', 'announce-max',
841 'announce-rounds', 'announce-step',
842 'compress-level', 'compress-threads', 'decompress-threads',
843 'compress-wait-thread', 'throttle-trigger-threshold',
844 'cpu-throttle-initial', 'cpu-throttle-increment',
845 'cpu-throttle-tailslow',
846 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
848 { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
851 'xbzrle-cache-size', 'max-postcopy-bandwidth',
852 'max-cpu-throttle', 'multifd-compression',
853 'multifd-zlib-level', 'multifd-zstd-level',
854 'block-bitmap-mapping',
855 { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] },
856 'vcpu-dirty-limit'] }
859 # @MigrateSetParameters:
861 # @announce-initial: Initial delay (in milliseconds) before sending
862 # the first announce (Since 4.0)
864 # @announce-max: Maximum delay (in milliseconds) between packets in
865 # the announcement (Since 4.0)
867 # @announce-rounds: Number of self-announce packets sent after
868 # migration (Since 4.0)
870 # @announce-step: Increase in delay (in milliseconds) between
871 # subsequent packets in the announcement (Since 4.0)
873 # @compress-level: compression level
875 # @compress-threads: compression thread count
877 # @compress-wait-thread: Controls behavior when all compression
878 # threads are currently busy. If true (default), wait for a free
879 # compression thread to become available; otherwise, send the page
880 # uncompressed. (Since 3.1)
882 # @decompress-threads: decompression thread count
884 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
885 # bytes_xfer_period to trigger throttling. It is expressed as
886 # percentage. The default value is 50. (Since 5.0)
888 # @cpu-throttle-initial: Initial percentage of time guest cpus are
889 # throttled when migration auto-converge is activated. The
890 # default value is 20. (Since 2.7)
892 # @cpu-throttle-increment: throttle percentage increase each time
893 # auto-converge detects that migration is not making progress.
894 # The default value is 10. (Since 2.7)
896 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
897 # the tail stage of throttling, the Guest is very sensitive to CPU
898 # percentage while the @cpu-throttle -increment is excessive
899 # usually at tail stage. If this parameter is true, we will
900 # compute the ideal CPU percentage used by the Guest, which may
901 # exactly make the dirty rate match the dirty rate threshold.
902 # Then we will choose a smaller throttle increment between the one
903 # specified by @cpu-throttle-increment and the one generated by
904 # ideal CPU percentage. Therefore, it is compatible to
905 # traditional throttling, meanwhile the throttle increment won't
906 # be excessive at tail stage. The default value is false. (Since
909 # @tls-creds: ID of the 'tls-creds' object that provides credentials
910 # for establishing a TLS connection over the migration data
911 # channel. On the outgoing side of the migration, the credentials
912 # must be for a 'client' endpoint, while for the incoming side the
913 # credentials must be for a 'server' endpoint. Setting this to a
914 # non-empty string enables TLS for all migrations. An empty
915 # string means that QEMU will use plain text mode for migration,
916 # rather than TLS (Since 2.9) Previously (since 2.7), this was
917 # reported by omitting tls-creds instead.
919 # @tls-hostname: hostname of the target host for the migration. This
920 # is required when using x509 based TLS credentials and the
921 # migration URI does not already include a hostname. For example
922 # if using fd: or exec: based migration, the hostname must be
923 # provided so that the server's x509 certificate identity can be
924 # validated. (Since 2.7) An empty string means that QEMU will use
925 # the hostname associated with the migration URI, if any. (Since
926 # 2.9) Previously (since 2.7), this was reported by omitting
927 # tls-hostname instead.
929 # @max-bandwidth: to set maximum speed for migration. maximum speed
930 # in bytes per second. (Since 2.8)
932 # @downtime-limit: set maximum tolerated downtime for migration.
933 # maximum downtime in milliseconds (Since 2.8)
935 # @x-checkpoint-delay: the delay time between two COLO checkpoints.
938 # @block-incremental: Affects how much storage is migrated when the
939 # block migration capability is enabled. When false, the entire
940 # storage backing chain is migrated into a flattened image at the
941 # destination; when true, only the active qcow2 layer is migrated
942 # and the destination must already have access to the same backing
943 # chain as was used on the source. (since 2.10)
945 # @multifd-channels: Number of channels used to migrate data in
946 # parallel. This is the same number that the number of sockets
947 # used for migration. The default value is 2 (since 4.0)
949 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
950 # needs to be a multiple of the target page size and a power of 2
953 # @max-postcopy-bandwidth: Background transfer bandwidth during
954 # postcopy. Defaults to 0 (unlimited). In bytes per second.
957 # @max-cpu-throttle: maximum cpu throttle percentage. The default
958 # value is 99. (Since 3.1)
960 # @multifd-compression: Which compression method to use. Defaults to
963 # @multifd-zlib-level: Set the compression level to be used in live
964 # migration, the compression level is an integer between 0 and 9,
965 # where 0 means no compression, 1 means the best compression
966 # speed, and 9 means best compression ratio which will consume
967 # more CPU. Defaults to 1. (Since 5.0)
969 # @multifd-zstd-level: Set the compression level to be used in live
970 # migration, the compression level is an integer between 0 and 20,
971 # where 0 means no compression, 1 means the best compression
972 # speed, and 20 means best compression ratio which will consume
973 # more CPU. Defaults to 1. (Since 5.0)
975 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
976 # aliases for the purpose of dirty bitmap migration. Such aliases
977 # may for example be the corresponding names on the opposite site.
978 # The mapping must be one-to-one, but not necessarily complete: On
979 # the source, unmapped bitmaps and all bitmaps on unmapped nodes
980 # will be ignored. On the destination, encountering an unmapped
981 # alias in the incoming migration stream will result in a report,
982 # and all further bitmap migration data will then be discarded.
983 # Note that the destination does not know about bitmaps it does
984 # not receive, so there is no limitation or requirement regarding
985 # the number of bitmaps received, or how they are named, or on
986 # which nodes they are placed. By default (when this parameter
987 # has never been set), bitmap names are mapped to themselves.
988 # Nodes are mapped to their block device name if there is one, and
989 # to their node name otherwise. (Since 5.2)
991 # @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
992 # live migration. Should be in the range 1 to 1000ms,
993 # defaults to 1000ms. (Since 8.1)
995 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
996 # Defaults to 1. (Since 8.1)
1000 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
1003 # TODO: either fuse back into MigrationParameters, or make
1004 # MigrationParameters members mandatory
1008 { 'struct': 'MigrateSetParameters',
1009 'data': { '*announce-initial': 'size',
1010 '*announce-max': 'size',
1011 '*announce-rounds': 'size',
1012 '*announce-step': 'size',
1013 '*compress-level': 'uint8',
1014 '*compress-threads': 'uint8',
1015 '*compress-wait-thread': 'bool',
1016 '*decompress-threads': 'uint8',
1017 '*throttle-trigger-threshold': 'uint8',
1018 '*cpu-throttle-initial': 'uint8',
1019 '*cpu-throttle-increment': 'uint8',
1020 '*cpu-throttle-tailslow': 'bool',
1021 '*tls-creds': 'StrOrNull',
1022 '*tls-hostname': 'StrOrNull',
1023 '*tls-authz': 'StrOrNull',
1024 '*max-bandwidth': 'size',
1025 '*downtime-limit': 'uint64',
1026 '*x-checkpoint-delay': { 'type': 'uint32',
1027 'features': [ 'unstable' ] },
1028 '*block-incremental': 'bool',
1029 '*multifd-channels': 'uint8',
1030 '*xbzrle-cache-size': 'size',
1031 '*max-postcopy-bandwidth': 'size',
1032 '*max-cpu-throttle': 'uint8',
1033 '*multifd-compression': 'MultiFDCompression',
1034 '*multifd-zlib-level': 'uint8',
1035 '*multifd-zstd-level': 'uint8',
1036 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
1037 '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
1038 'features': [ 'unstable' ] },
1039 '*vcpu-dirty-limit': 'uint64'} }
1042 # @migrate-set-parameters:
1044 # Set various migration parameters.
1050 # -> { "execute": "migrate-set-parameters" ,
1051 # "arguments": { "compress-level": 1 } }
1052 # <- { "return": {} }
1054 { 'command': 'migrate-set-parameters', 'boxed': true,
1055 'data': 'MigrateSetParameters' }
1058 # @MigrationParameters:
1060 # The optional members aren't actually optional.
1062 # @announce-initial: Initial delay (in milliseconds) before sending
1063 # the first announce (Since 4.0)
1065 # @announce-max: Maximum delay (in milliseconds) between packets in
1066 # the announcement (Since 4.0)
1068 # @announce-rounds: Number of self-announce packets sent after
1069 # migration (Since 4.0)
1071 # @announce-step: Increase in delay (in milliseconds) between
1072 # subsequent packets in the announcement (Since 4.0)
1074 # @compress-level: compression level
1076 # @compress-threads: compression thread count
1078 # @compress-wait-thread: Controls behavior when all compression
1079 # threads are currently busy. If true (default), wait for a free
1080 # compression thread to become available; otherwise, send the page
1081 # uncompressed. (Since 3.1)
1083 # @decompress-threads: decompression thread count
1085 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
1086 # bytes_xfer_period to trigger throttling. It is expressed as
1087 # percentage. The default value is 50. (Since 5.0)
1089 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1090 # throttled when migration auto-converge is activated. (Since
1093 # @cpu-throttle-increment: throttle percentage increase each time
1094 # auto-converge detects that migration is not making progress.
1097 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
1098 # the tail stage of throttling, the Guest is very sensitive to CPU
1099 # percentage while the @cpu-throttle -increment is excessive
1100 # usually at tail stage. If this parameter is true, we will
1101 # compute the ideal CPU percentage used by the Guest, which may
1102 # exactly make the dirty rate match the dirty rate threshold.
1103 # Then we will choose a smaller throttle increment between the one
1104 # specified by @cpu-throttle-increment and the one generated by
1105 # ideal CPU percentage. Therefore, it is compatible to
1106 # traditional throttling, meanwhile the throttle increment won't
1107 # be excessive at tail stage. The default value is false. (Since
1110 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1111 # for establishing a TLS connection over the migration data
1112 # channel. On the outgoing side of the migration, the credentials
1113 # must be for a 'client' endpoint, while for the incoming side the
1114 # credentials must be for a 'server' endpoint. An empty string
1115 # means that QEMU will use plain text mode for migration, rather
1116 # than TLS (Since 2.7) Note: 2.8 reports this by omitting
1117 # tls-creds instead.
1119 # @tls-hostname: hostname of the target host for the migration. This
1120 # is required when using x509 based TLS credentials and the
1121 # migration URI does not already include a hostname. For example
1122 # if using fd: or exec: based migration, the hostname must be
1123 # provided so that the server's x509 certificate identity can be
1124 # validated. (Since 2.7) An empty string means that QEMU will use
1125 # the hostname associated with the migration URI, if any. (Since
1126 # 2.9) Note: 2.8 reports this by omitting tls-hostname instead.
1128 # @tls-authz: ID of the 'authz' object subclass that provides access
1129 # control checking of the TLS x509 certificate distinguished name.
1132 # @max-bandwidth: to set maximum speed for migration. maximum speed
1133 # in bytes per second. (Since 2.8)
1135 # @downtime-limit: set maximum tolerated downtime for migration.
1136 # maximum downtime in milliseconds (Since 2.8)
1138 # @x-checkpoint-delay: the delay time between two COLO checkpoints.
1141 # @block-incremental: Affects how much storage is migrated when the
1142 # block migration capability is enabled. When false, the entire
1143 # storage backing chain is migrated into a flattened image at the
1144 # destination; when true, only the active qcow2 layer is migrated
1145 # and the destination must already have access to the same backing
1146 # chain as was used on the source. (since 2.10)
1148 # @multifd-channels: Number of channels used to migrate data in
1149 # parallel. This is the same number that the number of sockets
1150 # used for migration. The default value is 2 (since 4.0)
1152 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
1153 # needs to be a multiple of the target page size and a power of 2
1156 # @max-postcopy-bandwidth: Background transfer bandwidth during
1157 # postcopy. Defaults to 0 (unlimited). In bytes per second.
1160 # @max-cpu-throttle: maximum cpu throttle percentage. Defaults to 99.
1163 # @multifd-compression: Which compression method to use. Defaults to
1166 # @multifd-zlib-level: Set the compression level to be used in live
1167 # migration, the compression level is an integer between 0 and 9,
1168 # where 0 means no compression, 1 means the best compression
1169 # speed, and 9 means best compression ratio which will consume
1170 # more CPU. Defaults to 1. (Since 5.0)
1172 # @multifd-zstd-level: Set the compression level to be used in live
1173 # migration, the compression level is an integer between 0 and 20,
1174 # where 0 means no compression, 1 means the best compression
1175 # speed, and 20 means best compression ratio which will consume
1176 # more CPU. Defaults to 1. (Since 5.0)
1178 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1179 # aliases for the purpose of dirty bitmap migration. Such aliases
1180 # may for example be the corresponding names on the opposite site.
1181 # The mapping must be one-to-one, but not necessarily complete: On
1182 # the source, unmapped bitmaps and all bitmaps on unmapped nodes
1183 # will be ignored. On the destination, encountering an unmapped
1184 # alias in the incoming migration stream will result in a report,
1185 # and all further bitmap migration data will then be discarded.
1186 # Note that the destination does not know about bitmaps it does
1187 # not receive, so there is no limitation or requirement regarding
1188 # the number of bitmaps received, or how they are named, or on
1189 # which nodes they are placed. By default (when this parameter
1190 # has never been set), bitmap names are mapped to themselves.
1191 # Nodes are mapped to their block device name if there is one, and
1192 # to their node name otherwise. (Since 5.2)
1194 # @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
1195 # live migration. Should be in the range 1 to 1000ms,
1196 # defaults to 1000ms. (Since 8.1)
1198 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
1199 # Defaults to 1. (Since 8.1)
1203 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
1208 { 'struct': 'MigrationParameters',
1209 'data': { '*announce-initial': 'size',
1210 '*announce-max': 'size',
1211 '*announce-rounds': 'size',
1212 '*announce-step': 'size',
1213 '*compress-level': 'uint8',
1214 '*compress-threads': 'uint8',
1215 '*compress-wait-thread': 'bool',
1216 '*decompress-threads': 'uint8',
1217 '*throttle-trigger-threshold': 'uint8',
1218 '*cpu-throttle-initial': 'uint8',
1219 '*cpu-throttle-increment': 'uint8',
1220 '*cpu-throttle-tailslow': 'bool',
1221 '*tls-creds': 'str',
1222 '*tls-hostname': 'str',
1223 '*tls-authz': 'str',
1224 '*max-bandwidth': 'size',
1225 '*downtime-limit': 'uint64',
1226 '*x-checkpoint-delay': { 'type': 'uint32',
1227 'features': [ 'unstable' ] },
1228 '*block-incremental': 'bool',
1229 '*multifd-channels': 'uint8',
1230 '*xbzrle-cache-size': 'size',
1231 '*max-postcopy-bandwidth': 'size',
1232 '*max-cpu-throttle': 'uint8',
1233 '*multifd-compression': 'MultiFDCompression',
1234 '*multifd-zlib-level': 'uint8',
1235 '*multifd-zstd-level': 'uint8',
1236 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
1237 '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
1238 'features': [ 'unstable' ] },
1239 '*vcpu-dirty-limit': 'uint64'} }
1242 # @query-migrate-parameters:
1244 # Returns information about the current migration parameters
1246 # Returns: @MigrationParameters
1252 # -> { "execute": "query-migrate-parameters" }
1254 # "decompress-threads": 2,
1255 # "cpu-throttle-increment": 10,
1256 # "compress-threads": 8,
1257 # "compress-level": 1,
1258 # "cpu-throttle-initial": 20,
1259 # "max-bandwidth": 33554432,
1260 # "downtime-limit": 300
1264 { 'command': 'query-migrate-parameters',
1265 'returns': 'MigrationParameters' }
1268 # @migrate-start-postcopy:
1270 # Followup to a migration command to switch the migration to postcopy
1271 # mode. The postcopy-ram capability must be set on both source and
1272 # destination before the original migration command.
1278 # -> { "execute": "migrate-start-postcopy" }
1279 # <- { "return": {} }
1281 { 'command': 'migrate-start-postcopy' }
1286 # Emitted when a migration event happens
1288 # @status: @MigrationStatus describing the current migration status.
1294 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1295 # "event": "MIGRATION",
1296 # "data": {"status": "completed"} }
1298 { 'event': 'MIGRATION',
1299 'data': {'status': 'MigrationStatus'}}
1304 # Emitted from the source side of a migration at the start of each
1305 # pass (when it syncs the dirty bitmap)
1307 # @pass: An incrementing count (starting at 1 on the first pass)
1313 # <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1314 # "event": "MIGRATION_PASS", "data": {"pass": 2} }
1316 { 'event': 'MIGRATION_PASS',
1317 'data': { 'pass': 'int' } }
1322 # The message transmission between Primary side and Secondary side.
1324 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1326 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for
1329 # @checkpoint-reply: SVM gets PVM's checkpoint request
1331 # @vmstate-send: VM's state will be sent by PVM.
1333 # @vmstate-size: The total size of VMstate.
1335 # @vmstate-received: VM's state has been received by SVM.
1337 # @vmstate-loaded: VM's state has been loaded by SVM.
1341 { 'enum': 'COLOMessage',
1342 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1343 'vmstate-send', 'vmstate-size', 'vmstate-received',
1344 'vmstate-loaded' ] }
1349 # The COLO current mode.
1351 # @none: COLO is disabled.
1353 # @primary: COLO node in primary side.
1355 # @secondary: COLO node in slave side.
1359 { 'enum': 'COLOMode',
1360 'data': [ 'none', 'primary', 'secondary'] }
1365 # An enumeration of COLO failover status
1367 # @none: no failover has ever happened
1369 # @require: got failover requirement but not handled
1371 # @active: in the process of doing failover
1373 # @completed: finish the process of failover
1375 # @relaunch: restart the failover process, from 'none' -> 'completed'
1380 { 'enum': 'FailoverStatus',
1381 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1386 # Emitted when VM finishes COLO mode due to some errors happening or
1387 # at the request of users.
1389 # @mode: report COLO mode when COLO exited.
1391 # @reason: describes the reason for the COLO exit.
1397 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1398 # "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1400 { 'event': 'COLO_EXIT',
1401 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1406 # The reason for a COLO exit.
1408 # @none: failover has never happened. This state does not occur in
1409 # the COLO_EXIT event, and is only visible in the result of
1410 # query-colo-status.
1412 # @request: COLO exit is due to an external request.
1414 # @error: COLO exit is due to an internal error.
1416 # @processing: COLO is currently handling a failover (since 4.0).
1420 { 'enum': 'COLOExitReason',
1421 'data': [ 'none', 'request', 'error' , 'processing' ] }
1424 # @x-colo-lost-heartbeat:
1426 # Tell qemu that heartbeat is lost, request it to do takeover
1427 # procedures. If this command is sent to the PVM, the Primary side
1428 # will exit COLO mode. If sent to the Secondary, the Secondary side
1429 # will run failover work, then takes over server operation to become
1434 # @unstable: This command is experimental.
1440 # -> { "execute": "x-colo-lost-heartbeat" }
1441 # <- { "return": {} }
1443 { 'command': 'x-colo-lost-heartbeat',
1444 'features': [ 'unstable' ],
1445 'if': 'CONFIG_REPLICATION' }
1450 # Cancel the current executing migration process.
1452 # Returns: nothing on success
1454 # Notes: This command succeeds even if there is no migration process
1461 # -> { "execute": "migrate_cancel" }
1462 # <- { "return": {} }
1464 { 'command': 'migrate_cancel' }
1467 # @migrate-continue:
1469 # Continue migration when it's in a paused state.
1471 # @state: The state the migration is currently expected to be in
1473 # Returns: nothing on success
1479 # -> { "execute": "migrate-continue" , "arguments":
1480 # { "state": "pre-switchover" } }
1481 # <- { "return": {} }
1483 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1488 # Migrates the current running guest to another Virtual Machine.
1490 # @uri: the Uniform Resource Identifier of the destination VM
1492 # @blk: do block migration (full disk copy)
1494 # @inc: incremental disk copy migration
1496 # @detach: this argument exists only for compatibility reasons and is
1499 # @resume: resume one paused migration, default "off". (since 3.0)
1501 # Returns: nothing on success
1507 # 1. The 'query-migrate' command should be used to check migration's
1508 # progress and final result (this information is provided by the
1511 # 2. All boolean arguments default to false
1513 # 3. The user Monitor's "detach" argument is invalid in QMP and should
1518 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1519 # <- { "return": {} }
1521 { 'command': 'migrate',
1522 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1523 '*detach': 'bool', '*resume': 'bool' } }
1526 # @migrate-incoming:
1528 # Start an incoming migration, the qemu must have been started with
1531 # @uri: The Uniform Resource Identifier identifying the source or
1532 # address to listen on
1534 # Returns: nothing on success
1540 # 1. It's a bad idea to use a string for the uri, but it needs
1541 # to stay compatible with -incoming and the format of the uri
1542 # is already exposed above libvirt.
1544 # 2. QEMU must be started with -incoming defer to allow
1545 # migrate-incoming to be used.
1547 # 3. The uri format is the same as for -incoming
1551 # -> { "execute": "migrate-incoming",
1552 # "arguments": { "uri": "tcp::4446" } }
1553 # <- { "return": {} }
1555 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1558 # @xen-save-devices-state:
1560 # Save the state of all devices to file. The RAM and the block
1561 # devices of the VM are not saved by this command.
1563 # @filename: the file to save the state of the devices to as binary
1564 # data. See xen-save-devices-state.txt for a description of the
1567 # @live: Optional argument to ask QEMU to treat this command as part
1568 # of a live migration. Default to true. (since 2.11)
1570 # Returns: Nothing on success
1576 # -> { "execute": "xen-save-devices-state",
1577 # "arguments": { "filename": "/tmp/save" } }
1578 # <- { "return": {} }
1580 { 'command': 'xen-save-devices-state',
1581 'data': {'filename': 'str', '*live':'bool' } }
1584 # @xen-set-global-dirty-log:
1586 # Enable or disable the global dirty log mode.
1588 # @enable: true to enable, false to disable.
1596 # -> { "execute": "xen-set-global-dirty-log",
1597 # "arguments": { "enable": true } }
1598 # <- { "return": {} }
1600 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1603 # @xen-load-devices-state:
1605 # Load the state of all devices from file. The RAM and the block
1606 # devices of the VM are not loaded by this command.
1608 # @filename: the file to load the state of the devices from as binary
1609 # data. See xen-save-devices-state.txt for a description of the
1616 # -> { "execute": "xen-load-devices-state",
1617 # "arguments": { "filename": "/tmp/resume" } }
1618 # <- { "return": {} }
1620 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1623 # @xen-set-replication:
1625 # Enable or disable replication.
1627 # @enable: true to enable, false to disable.
1629 # @primary: true for primary or false for secondary.
1631 # @failover: true to do failover, false to stop. but cannot be
1632 # specified if 'enable' is true. default value is false.
1638 # -> { "execute": "xen-set-replication",
1639 # "arguments": {"enable": true, "primary": false} }
1640 # <- { "return": {} }
1644 { 'command': 'xen-set-replication',
1645 'data': { 'enable': 'bool', 'primary': 'bool', '*failover': 'bool' },
1646 'if': 'CONFIG_REPLICATION' }
1649 # @ReplicationStatus:
1651 # The result format for 'query-xen-replication-status'.
1653 # @error: true if an error happened, false if replication is normal.
1655 # @desc: the human readable error description string, when @error is
1660 { 'struct': 'ReplicationStatus',
1661 'data': { 'error': 'bool', '*desc': 'str' },
1662 'if': 'CONFIG_REPLICATION' }
1665 # @query-xen-replication-status:
1667 # Query replication status while the vm is running.
1669 # Returns: A @ReplicationStatus object showing the status.
1673 # -> { "execute": "query-xen-replication-status" }
1674 # <- { "return": { "error": false } }
1678 { 'command': 'query-xen-replication-status',
1679 'returns': 'ReplicationStatus',
1680 'if': 'CONFIG_REPLICATION' }
1683 # @xen-colo-do-checkpoint:
1685 # Xen uses this command to notify replication to trigger a checkpoint.
1691 # -> { "execute": "xen-colo-do-checkpoint" }
1692 # <- { "return": {} }
1696 { 'command': 'xen-colo-do-checkpoint',
1697 'if': 'CONFIG_REPLICATION' }
1702 # The result format for 'query-colo-status'.
1704 # @mode: COLO running mode. If COLO is running, this field will
1705 # return 'primary' or 'secondary'.
1707 # @last-mode: COLO last running mode. If COLO is running, this field
1708 # will return same like mode field, after failover we can use this
1709 # field to get last colo mode. (since 4.0)
1711 # @reason: describes the reason for the COLO exit.
1715 { 'struct': 'COLOStatus',
1716 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1717 'reason': 'COLOExitReason' },
1718 'if': 'CONFIG_REPLICATION' }
1721 # @query-colo-status:
1723 # Query COLO status while the vm is running.
1725 # Returns: A @COLOStatus object showing the status.
1729 # -> { "execute": "query-colo-status" }
1730 # <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
1734 { 'command': 'query-colo-status',
1735 'returns': 'COLOStatus',
1736 'if': 'CONFIG_REPLICATION' }
1741 # Provide a recovery migration stream URI.
1743 # @uri: the URI to be used for the recovery of migration stream.
1749 # -> { "execute": "migrate-recover",
1750 # "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1751 # <- { "return": {} }
1755 { 'command': 'migrate-recover',
1756 'data': { 'uri': 'str' },
1762 # Pause a migration. Currently it only supports postcopy.
1768 # -> { "execute": "migrate-pause" }
1769 # <- { "return": {} }
1773 { 'command': 'migrate-pause', 'allow-oob': true }
1778 # Emitted from source side of a migration when migration state is
1779 # WAIT_UNPLUG. Device was unplugged by guest operating system. Device
1780 # resources in QEMU are kept on standby to be able to re-plug it in
1781 # case of migration failure.
1783 # @device-id: QEMU device id of the unplugged device
1789 # <- { "event": "UNPLUG_PRIMARY",
1790 # "data": { "device-id": "hostdev0" },
1791 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1793 { 'event': 'UNPLUG_PRIMARY',
1794 'data': { 'device-id': 'str' } }
1799 # Dirty rate of vcpu.
1803 # @dirty-rate: dirty rate.
1807 { 'struct': 'DirtyRateVcpu',
1808 'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1813 # Dirty page rate measurement status.
1815 # @unstarted: measuring thread has not been started yet
1817 # @measuring: measuring thread is running
1819 # @measured: dirty page rate is measured and the results are available
1823 { 'enum': 'DirtyRateStatus',
1824 'data': [ 'unstarted', 'measuring', 'measured'] }
1827 # @DirtyRateMeasureMode:
1829 # Method used to measure dirty page rate. Differences between
1830 # available methods are explained in @calc-dirty-rate.
1832 # @page-sampling: use page sampling
1834 # @dirty-ring: use dirty ring
1836 # @dirty-bitmap: use dirty bitmap
1840 { 'enum': 'DirtyRateMeasureMode',
1841 'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
1846 # Information about measured dirty page rate.
1848 # @dirty-rate: an estimate of the dirty page rate of the VM in units
1849 # of MiB/s. Value is present only when @status is 'measured'.
1851 # @status: current status of dirty page rate measurements
1853 # @start-time: start time in units of second for calculation
1855 # @calc-time: time period for which dirty page rate was measured
1858 # @sample-pages: number of sampled pages per GiB of guest memory.
1859 # Valid only in page-sampling mode (Since 6.1)
1861 # @mode: mode that was used to measure dirty page rate (Since 6.2)
1863 # @vcpu-dirty-rate: dirty rate for each vCPU if dirty-ring mode was
1864 # specified (Since 6.2)
1868 { 'struct': 'DirtyRateInfo',
1869 'data': {'*dirty-rate': 'int64',
1870 'status': 'DirtyRateStatus',
1871 'start-time': 'int64',
1872 'calc-time': 'int64',
1873 'sample-pages': 'uint64',
1874 'mode': 'DirtyRateMeasureMode',
1875 '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
1880 # Start measuring dirty page rate of the VM. Results can be retrieved
1881 # with @query-dirty-rate after measurements are completed.
1883 # Dirty page rate is the number of pages changed in a given time
1884 # period expressed in MiB/s. The following methods of calculation are
1887 # 1. In page sampling mode, a random subset of pages are selected and
1888 # hashed twice: once at the beginning of measurement time period,
1889 # and once again at the end. If two hashes for some page are
1890 # different, the page is counted as changed. Since this method
1891 # relies on sampling and hashing, calculated dirty page rate is
1892 # only an estimate of its true value. Increasing @sample-pages
1893 # improves estimation quality at the cost of higher computational
1896 # 2. Dirty bitmap mode captures writes to memory (for example by
1897 # temporarily revoking write access to all pages) and counting page
1898 # faults. Information about modified pages is collected into a
1899 # bitmap, where each bit corresponds to one guest page. This mode
1900 # requires that KVM accelerator property "dirty-ring-size" is *not*
1903 # 3. Dirty ring mode is similar to dirty bitmap mode, but the
1904 # information about modified pages is collected into ring buffer.
1905 # This mode tracks page modification per each vCPU separately. It
1906 # requires that KVM accelerator property "dirty-ring-size" is set.
1908 # @calc-time: time period in units of second for which dirty page rate
1909 # is calculated. Note that larger @calc-time values will
1910 # typically result in smaller dirty page rates because page
1911 # dirtying is a one-time event. Once some page is counted as
1912 # dirty during @calc-time period, further writes to this page will
1913 # not increase dirty page rate anymore.
1915 # @sample-pages: number of sampled pages per each GiB of guest memory.
1916 # Default value is 512. For 4KiB guest pages this corresponds to
1917 # sampling ratio of 0.2%. This argument is used only in page
1918 # sampling mode. (Since 6.1)
1920 # @mode: mechanism for tracking dirty pages. Default value is
1921 # 'page-sampling'. Others are 'dirty-bitmap' and 'dirty-ring'.
1928 # -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
1929 # 'sample-pages': 512} }
1930 # <- { "return": {} }
1932 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
1933 '*sample-pages': 'int',
1934 '*mode': 'DirtyRateMeasureMode'} }
1937 # @query-dirty-rate:
1939 # Query results of the most recent invocation of @calc-dirty-rate.
1945 # 1. Measurement is in progress:
1947 # <- {"status": "measuring", "sample-pages": 512,
1948 # "mode": "page-sampling", "start-time": 3665220, "calc-time": 10}
1950 # 2. Measurement has been completed:
1952 # <- {"status": "measured", "sample-pages": 512, "dirty-rate": 108,
1953 # "mode": "page-sampling", "start-time": 3665220, "calc-time": 10}
1955 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1960 # Dirty page rate limit information of a virtual CPU.
1962 # @cpu-index: index of a virtual CPU.
1964 # @limit-rate: upper limit of dirty page rate (MB/s) for a virtual
1965 # CPU, 0 means unlimited.
1967 # @current-rate: current dirty page rate (MB/s) for a virtual CPU.
1971 { 'struct': 'DirtyLimitInfo',
1972 'data': { 'cpu-index': 'int',
1973 'limit-rate': 'uint64',
1974 'current-rate': 'uint64' } }
1977 # @set-vcpu-dirty-limit:
1979 # Set the upper limit of dirty page rate for virtual CPUs.
1981 # Requires KVM with accelerator property "dirty-ring-size" set. A
1982 # virtual CPU's dirty page rate is a measure of its memory load. To
1983 # observe dirty page rates, use @calc-dirty-rate.
1985 # @cpu-index: index of a virtual CPU, default is all.
1987 # @dirty-rate: upper limit of dirty page rate (MB/s) for virtual CPUs.
1993 # -> {"execute": "set-vcpu-dirty-limit"}
1994 # "arguments": { "dirty-rate": 200,
1995 # "cpu-index": 1 } }
1996 # <- { "return": {} }
1998 { 'command': 'set-vcpu-dirty-limit',
1999 'data': { '*cpu-index': 'int',
2000 'dirty-rate': 'uint64' } }
2003 # @cancel-vcpu-dirty-limit:
2005 # Cancel the upper limit of dirty page rate for virtual CPUs.
2007 # Cancel the dirty page limit for the vCPU which has been set with
2008 # set-vcpu-dirty-limit command. Note that this command requires
2009 # support from dirty ring, same as the "set-vcpu-dirty-limit".
2011 # @cpu-index: index of a virtual CPU, default is all.
2017 # -> {"execute": "cancel-vcpu-dirty-limit"},
2018 # "arguments": { "cpu-index": 1 } }
2019 # <- { "return": {} }
2021 { 'command': 'cancel-vcpu-dirty-limit',
2022 'data': { '*cpu-index': 'int'} }
2025 # @query-vcpu-dirty-limit:
2027 # Returns information about virtual CPU dirty page rate limits, if
2034 # -> {"execute": "query-vcpu-dirty-limit"}
2036 # { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
2037 # { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
2039 { 'command': 'query-vcpu-dirty-limit',
2040 'returns': [ 'DirtyLimitInfo' ] }
2043 # @MigrationThreadInfo:
2045 # Information about migrationthreads
2047 # @name: the name of migration thread
2049 # @thread-id: ID of the underlying host thread
2053 { 'struct': 'MigrationThreadInfo',
2054 'data': {'name': 'str',
2055 'thread-id': 'int'} }
2058 # @query-migrationthreads:
2060 # Returns information of migration threads
2062 # data: migration thread name
2064 # Returns: information about migration threads
2068 { 'command': 'query-migrationthreads',
2069 'returns': ['MigrationThreadInfo'] }
2074 # Save a VM snapshot
2076 # @job-id: identifier for the newly created job
2078 # @tag: name of the snapshot to create
2080 # @vmstate: block device node name to save vmstate to
2082 # @devices: list of block device node names to save a snapshot to
2084 # Applications should not assume that the snapshot save is complete
2085 # when this command returns. The job commands / events must be used
2086 # to determine completion and to fetch details of any errors that
2089 # Note that execution of the guest CPUs may be stopped during the time
2090 # it takes to save the snapshot. A future version of QEMU may ensure
2091 # CPUs are executing continuously.
2093 # It is strongly recommended that @devices contain all writable block
2094 # device nodes if a consistent snapshot is required.
2096 # If @tag already exists, an error will be reported
2102 # -> { "execute": "snapshot-save",
2104 # "job-id": "snapsave0",
2106 # "vmstate": "disk0",
2107 # "devices": ["disk0", "disk1"]
2110 # <- { "return": { } }
2111 # <- {"event": "JOB_STATUS_CHANGE",
2112 # "timestamp": {"seconds": 1432121972, "microseconds": 744001},
2113 # "data": {"status": "created", "id": "snapsave0"}}
2114 # <- {"event": "JOB_STATUS_CHANGE",
2115 # "timestamp": {"seconds": 1432122172, "microseconds": 744001},
2116 # "data": {"status": "running", "id": "snapsave0"}}
2117 # <- {"event": "STOP",
2118 # "timestamp": {"seconds": 1432122372, "microseconds": 744001} }
2119 # <- {"event": "RESUME",
2120 # "timestamp": {"seconds": 1432122572, "microseconds": 744001} }
2121 # <- {"event": "JOB_STATUS_CHANGE",
2122 # "timestamp": {"seconds": 1432122772, "microseconds": 744001},
2123 # "data": {"status": "waiting", "id": "snapsave0"}}
2124 # <- {"event": "JOB_STATUS_CHANGE",
2125 # "timestamp": {"seconds": 1432122972, "microseconds": 744001},
2126 # "data": {"status": "pending", "id": "snapsave0"}}
2127 # <- {"event": "JOB_STATUS_CHANGE",
2128 # "timestamp": {"seconds": 1432123172, "microseconds": 744001},
2129 # "data": {"status": "concluded", "id": "snapsave0"}}
2130 # -> {"execute": "query-jobs"}
2131 # <- {"return": [{"current-progress": 1,
2132 # "status": "concluded",
2133 # "total-progress": 1,
2134 # "type": "snapshot-save",
2135 # "id": "snapsave0"}]}
2139 { 'command': 'snapshot-save',
2140 'data': { 'job-id': 'str',
2143 'devices': ['str'] } }
2148 # Load a VM snapshot
2150 # @job-id: identifier for the newly created job
2152 # @tag: name of the snapshot to load.
2154 # @vmstate: block device node name to load vmstate from
2156 # @devices: list of block device node names to load a snapshot from
2158 # Applications should not assume that the snapshot load is complete
2159 # when this command returns. The job commands / events must be used
2160 # to determine completion and to fetch details of any errors that
2163 # Note that execution of the guest CPUs will be stopped during the
2164 # time it takes to load the snapshot.
2166 # It is strongly recommended that @devices contain all writable block
2167 # device nodes that can have changed since the original @snapshot-save
2168 # command execution.
2174 # -> { "execute": "snapshot-load",
2176 # "job-id": "snapload0",
2178 # "vmstate": "disk0",
2179 # "devices": ["disk0", "disk1"]
2182 # <- { "return": { } }
2183 # <- {"event": "JOB_STATUS_CHANGE",
2184 # "timestamp": {"seconds": 1472124172, "microseconds": 744001},
2185 # "data": {"status": "created", "id": "snapload0"}}
2186 # <- {"event": "JOB_STATUS_CHANGE",
2187 # "timestamp": {"seconds": 1472125172, "microseconds": 744001},
2188 # "data": {"status": "running", "id": "snapload0"}}
2189 # <- {"event": "STOP",
2190 # "timestamp": {"seconds": 1472125472, "microseconds": 744001} }
2191 # <- {"event": "RESUME",
2192 # "timestamp": {"seconds": 1472125872, "microseconds": 744001} }
2193 # <- {"event": "JOB_STATUS_CHANGE",
2194 # "timestamp": {"seconds": 1472126172, "microseconds": 744001},
2195 # "data": {"status": "waiting", "id": "snapload0"}}
2196 # <- {"event": "JOB_STATUS_CHANGE",
2197 # "timestamp": {"seconds": 1472127172, "microseconds": 744001},
2198 # "data": {"status": "pending", "id": "snapload0"}}
2199 # <- {"event": "JOB_STATUS_CHANGE",
2200 # "timestamp": {"seconds": 1472128172, "microseconds": 744001},
2201 # "data": {"status": "concluded", "id": "snapload0"}}
2202 # -> {"execute": "query-jobs"}
2203 # <- {"return": [{"current-progress": 1,
2204 # "status": "concluded",
2205 # "total-progress": 1,
2206 # "type": "snapshot-load",
2207 # "id": "snapload0"}]}
2211 { 'command': 'snapshot-load',
2212 'data': { 'job-id': 'str',
2215 'devices': ['str'] } }
2220 # Delete a VM snapshot
2222 # @job-id: identifier for the newly created job
2224 # @tag: name of the snapshot to delete.
2226 # @devices: list of block device node names to delete a snapshot from
2228 # Applications should not assume that the snapshot delete is complete
2229 # when this command returns. The job commands / events must be used
2230 # to determine completion and to fetch details of any errors that
2237 # -> { "execute": "snapshot-delete",
2239 # "job-id": "snapdelete0",
2241 # "devices": ["disk0", "disk1"]
2244 # <- { "return": { } }
2245 # <- {"event": "JOB_STATUS_CHANGE",
2246 # "timestamp": {"seconds": 1442124172, "microseconds": 744001},
2247 # "data": {"status": "created", "id": "snapdelete0"}}
2248 # <- {"event": "JOB_STATUS_CHANGE",
2249 # "timestamp": {"seconds": 1442125172, "microseconds": 744001},
2250 # "data": {"status": "running", "id": "snapdelete0"}}
2251 # <- {"event": "JOB_STATUS_CHANGE",
2252 # "timestamp": {"seconds": 1442126172, "microseconds": 744001},
2253 # "data": {"status": "waiting", "id": "snapdelete0"}}
2254 # <- {"event": "JOB_STATUS_CHANGE",
2255 # "timestamp": {"seconds": 1442127172, "microseconds": 744001},
2256 # "data": {"status": "pending", "id": "snapdelete0"}}
2257 # <- {"event": "JOB_STATUS_CHANGE",
2258 # "timestamp": {"seconds": 1442128172, "microseconds": 744001},
2259 # "data": {"status": "concluded", "id": "snapdelete0"}}
2260 # -> {"execute": "query-jobs"}
2261 # <- {"return": [{"current-progress": 1,
2262 # "status": "concluded",
2263 # "total-progress": 1,
2264 # "type": "snapshot-delete",
2265 # "id": "snapdelete0"}]}
2269 { 'command': 'snapshot-delete',
2270 'data': { 'job-id': 'str',
2272 'devices': ['str'] } }