8 { 'include': 'common.json' }
9 { 'include': 'sockets.json' }
14 # Detailed migration status.
16 # @transferred: amount of bytes already transferred to the target VM
18 # @remaining: amount of bytes remaining to be transferred to the target VM
20 # @total: total amount of bytes involved in the migration process
22 # @duplicate: number of duplicate (zero) pages (since 1.2)
24 # @skipped: number of skipped zero pages (since 1.5)
26 # @normal: number of normal pages (since 1.2)
28 # @normal-bytes: number of normal bytes sent (since 1.2)
30 # @dirty-pages-rate: number of pages dirtied by second by the
33 # @mbps: throughput in megabits/sec. (since 1.6)
35 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
37 # @postcopy-requests: The number of page requests received from the destination
40 # @page-size: The number of bytes per page for the various page-based
41 # statistics (since 2.10)
43 # @multifd-bytes: The number of bytes sent through multifd (since 3.0)
45 # @pages-per-second: the number of memory pages transferred per second
50 { 'struct': 'MigrationStats',
51 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
52 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
53 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
54 'mbps' : 'number', 'dirty-sync-count' : 'int',
55 'postcopy-requests' : 'int', 'page-size' : 'int',
56 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64' } }
61 # Detailed XBZRLE migration cache statistics
63 # @cache-size: XBZRLE cache size
65 # @bytes: amount of bytes already transferred to the target VM
67 # @pages: amount of pages transferred to the target VM
69 # @cache-miss: number of cache miss
71 # @cache-miss-rate: rate of cache miss (since 2.1)
73 # @encoding-rate: rate of encoded bytes (since 5.1)
75 # @overflow: number of overflows
79 { 'struct': 'XBZRLECacheStats',
80 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
81 'cache-miss': 'int', 'cache-miss-rate': 'number',
82 'encoding-rate': 'number', 'overflow': 'int' } }
87 # Detailed migration compression statistics
89 # @pages: amount of pages compressed and transferred to the target VM
91 # @busy: count of times that no free thread was available to compress data
93 # @busy-rate: rate of thread busy
95 # @compressed-size: amount of bytes after compression
97 # @compression-rate: rate of compressed size
101 { 'struct': 'CompressionStats',
102 'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
103 'compressed-size': 'int', 'compression-rate': 'number' } }
108 # An enumeration of migration status.
110 # @none: no migration has ever happened.
112 # @setup: migration process has been initiated.
114 # @cancelling: in the process of cancelling migration.
116 # @cancelled: cancelling migration is finished.
118 # @active: in the process of doing migration.
120 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
122 # @postcopy-paused: during postcopy but paused. (since 3.0)
124 # @postcopy-recover: trying to recover from a paused postcopy. (since 3.0)
126 # @completed: migration is finished.
128 # @failed: some error occurred during migration process.
130 # @colo: VM is in the process of fault tolerance, VM can not get into this
131 # state unless colo capability is enabled for migration. (since 2.8)
133 # @pre-switchover: Paused before device serialisation. (since 2.11)
135 # @device: During device serialisation when pause-before-switchover is enabled
138 # @wait-unplug: wait for device unplug request by guest OS to be completed.
144 { 'enum': 'MigrationStatus',
145 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
146 'active', 'postcopy-active', 'postcopy-paused',
147 'postcopy-recover', 'completed', 'failed', 'colo',
148 'pre-switchover', 'device', 'wait-unplug' ] }
153 # Information about current migration process.
155 # @status: @MigrationStatus describing the current migration status.
156 # If this field is not returned, no migration process
159 # @ram: @MigrationStats containing detailed migration
160 # status, only returned if status is 'active' or
161 # 'completed'(since 1.2)
163 # @disk: @MigrationStats containing detailed disk migration
164 # status, only returned if status is 'active' and it is a block
167 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
168 # migration statistics, only returned if XBZRLE feature is on and
169 # status is 'active' or 'completed' (since 1.2)
171 # @total-time: total amount of milliseconds since migration started.
172 # If migration has ended, it returns the total migration
175 # @downtime: only present when migration finishes correctly
176 # total downtime in milliseconds for the guest.
179 # @expected-downtime: only present while migration is active
180 # expected downtime in milliseconds for the guest in last walk
181 # of the dirty bitmap. (since 1.3)
183 # @setup-time: amount of setup time in milliseconds *before* the
184 # iterations begin but *after* the QMP command is issued. This is designed
185 # to provide an accounting of any activities (such as RDMA pinning) which
186 # may be expensive, but do not actually occur during the iterative
187 # migration rounds themselves. (since 1.6)
189 # @cpu-throttle-percentage: percentage of time guest cpus are being
190 # throttled during auto-converge. This is only present when auto-converge
191 # has started throttling guest cpus. (Since 2.7)
193 # @error-desc: the human readable error description string, when
194 # @status is 'failed'. Clients should not attempt to parse the
195 # error strings. (Since 2.7)
197 # @postcopy-blocktime: total time when all vCPU were blocked during postcopy
198 # live migration. This is only present when the postcopy-blocktime
199 # migration capability is enabled. (Since 3.0)
201 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU. This is
202 # only present when the postcopy-blocktime migration capability
203 # is enabled. (Since 3.0)
205 # @compression: migration compression statistics, only returned if compression
206 # feature is on and status is 'active' or 'completed' (Since 3.1)
208 # @socket-address: Only used for tcp, to know what the real port is (Since 4.0)
212 { 'struct': 'MigrationInfo',
213 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
214 '*disk': 'MigrationStats',
215 '*xbzrle-cache': 'XBZRLECacheStats',
216 '*total-time': 'int',
217 '*expected-downtime': 'int',
219 '*setup-time': 'int',
220 '*cpu-throttle-percentage': 'int',
221 '*error-desc': 'str',
222 '*postcopy-blocktime' : 'uint32',
223 '*postcopy-vcpu-blocktime': ['uint32'],
224 '*compression': 'CompressionStats',
225 '*socket-address': ['SocketAddress'] } }
230 # Returns information about current migration process. If migration
231 # is active there will be another json-object with RAM migration
232 # status and if block migration is active another one with block
235 # Returns: @MigrationInfo
241 # 1. Before the first migration
243 # -> { "execute": "query-migrate" }
244 # <- { "return": {} }
246 # 2. Migration is done and has succeeded
248 # -> { "execute": "query-migrate" }
250 # "status": "completed",
251 # "total-time":12345,
252 # "setup-time":12345,
260 # "normal-bytes":123456,
261 # "dirty-sync-count":15
266 # 3. Migration is done and has failed
268 # -> { "execute": "query-migrate" }
269 # <- { "return": { "status": "failed" } }
271 # 4. Migration is being performed and is not a block migration:
273 # -> { "execute": "query-migrate" }
277 # "total-time":12345,
278 # "setup-time":12345,
279 # "expected-downtime":12345,
286 # "normal-bytes":123456,
287 # "dirty-sync-count":15
292 # 5. Migration is being performed and is a block migration:
294 # -> { "execute": "query-migrate" }
298 # "total-time":12345,
299 # "setup-time":12345,
300 # "expected-downtime":12345,
303 # "remaining":1053304,
304 # "transferred":3720,
307 # "normal-bytes":123456,
308 # "dirty-sync-count":15
312 # "remaining":20880384,
313 # "transferred":91136
318 # 6. Migration is being performed and XBZRLE is active:
320 # -> { "execute": "query-migrate" }
324 # "total-time":12345,
325 # "setup-time":12345,
326 # "expected-downtime":12345,
329 # "remaining":1053304,
330 # "transferred":3720,
333 # "normal-bytes":3412992,
334 # "dirty-sync-count":15
337 # "cache-size":67108864,
341 # "cache-miss-rate":0.123,
342 # "encoding-rate":80.1,
349 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
352 # @MigrationCapability:
354 # Migration capabilities enumeration
356 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
357 # This feature allows us to minimize migration traffic for certain work
358 # loads, by sending compressed difference of the pages
360 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
361 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
362 # Disabled by default. (since 2.0)
364 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
365 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
366 # source and target VM to support this feature. To enable it is sufficient
367 # to enable the capability on the source VM. The feature is disabled by
368 # default. (since 1.6)
370 # @compress: Use multiple compression threads to accelerate live migration.
371 # This feature can help to reduce the migration traffic, by sending
372 # compressed pages. Please note that if compress and xbzrle are both
373 # on, compress only takes effect in the ram bulk stage, after that,
374 # it will be disabled and only xbzrle takes effect, this can help to
375 # minimize migration traffic. The feature is disabled by default.
378 # @events: generate events for each migration state change
381 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
382 # to speed up convergence of RAM migration. (since 1.6)
384 # @postcopy-ram: Start executing on the migration target before all of RAM has
385 # been migrated, pulling the remaining pages along as needed. The
386 # capacity must have the same setting on both source and target
387 # or migration will not even start. NOTE: If the migration fails during
388 # postcopy the VM will fail. (since 2.6)
390 # @x-colo: If enabled, migration will never end, and the state of the VM on the
391 # primary side will be migrated continuously to the VM on secondary
392 # side, this process is called COarse-Grain LOck Stepping (COLO) for
393 # Non-stop Service. (since 2.8)
395 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
396 # during postcopy-ram migration. (since 2.9)
398 # @block: If enabled, QEMU will also migrate the contents of all block
399 # devices. Default is disabled. A possible alternative uses
400 # mirror jobs to a builtin NBD server on the destination, which
401 # offers more flexibility.
404 # @return-path: If enabled, migration will use the return path even
405 # for precopy. (since 2.10)
407 # @pause-before-switchover: Pause outgoing migration before serialising device
408 # state and before disabling block IO (since 2.11)
410 # @multifd: Use more than one fd for migration (since 4.0)
412 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
415 # @postcopy-blocktime: Calculate downtime for postcopy live migration
418 # @late-block-activate: If enabled, the destination will not activate block
419 # devices (and thus take locks) immediately at the end of migration.
422 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
424 # @validate-uuid: Send the UUID of the source to allow the destination
425 # to ensure it is the same. (since 4.2)
429 { 'enum': 'MigrationCapability',
430 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
431 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
432 'block', 'return-path', 'pause-before-switchover', 'multifd',
433 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
434 'x-ignore-shared', 'validate-uuid' ] }
437 # @MigrationCapabilityStatus:
439 # Migration capability information
441 # @capability: capability enum
443 # @state: capability state bool
447 { 'struct': 'MigrationCapabilityStatus',
448 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
451 # @migrate-set-capabilities:
453 # Enable/Disable the following migration capabilities (like xbzrle)
455 # @capabilities: json array of capability modifications to make
461 # -> { "execute": "migrate-set-capabilities" , "arguments":
462 # { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
465 { 'command': 'migrate-set-capabilities',
466 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
469 # @query-migrate-capabilities:
471 # Returns information about the current migration capabilities status
473 # Returns: @MigrationCapabilitiesStatus
479 # -> { "execute": "query-migrate-capabilities" }
481 # {"state": false, "capability": "xbzrle"},
482 # {"state": false, "capability": "rdma-pin-all"},
483 # {"state": false, "capability": "auto-converge"},
484 # {"state": false, "capability": "zero-blocks"},
485 # {"state": false, "capability": "compress"},
486 # {"state": true, "capability": "events"},
487 # {"state": false, "capability": "postcopy-ram"},
488 # {"state": false, "capability": "x-colo"}
492 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
495 # @MultiFDCompression:
497 # An enumeration of multifd compression methods.
499 # @none: no compression.
500 # @zlib: use zlib compression method.
501 # @zstd: use zstd compression method.
506 { 'enum': 'MultiFDCompression',
507 'data': [ 'none', 'zlib',
508 { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
511 # @MigrationParameter:
513 # Migration parameters enumeration
515 # @announce-initial: Initial delay (in milliseconds) before sending the first
516 # announce (Since 4.0)
518 # @announce-max: Maximum delay (in milliseconds) between packets in the
519 # announcement (Since 4.0)
521 # @announce-rounds: Number of self-announce packets sent after migration
524 # @announce-step: Increase in delay (in milliseconds) between subsequent
525 # packets in the announcement (Since 4.0)
527 # @compress-level: Set the compression level to be used in live migration,
528 # the compression level is an integer between 0 and 9, where 0 means
529 # no compression, 1 means the best compression speed, and 9 means best
530 # compression ratio which will consume more CPU.
532 # @compress-threads: Set compression thread count to be used in live migration,
533 # the compression thread count is an integer between 1 and 255.
535 # @compress-wait-thread: Controls behavior when all compression threads are
536 # currently busy. If true (default), wait for a free
537 # compression thread to become available; otherwise,
538 # send the page uncompressed. (Since 3.1)
540 # @decompress-threads: Set decompression thread count to be used in live
541 # migration, the decompression thread count is an integer between 1
542 # and 255. Usually, decompression is at least 4 times as fast as
543 # compression, so set the decompress-threads to the number about 1/4
544 # of compress-threads is adequate.
546 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
547 # to trigger throttling. It is expressed as percentage.
548 # The default value is 50. (Since 5.0)
550 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
551 # when migration auto-converge is activated. The
552 # default value is 20. (Since 2.7)
554 # @cpu-throttle-increment: throttle percentage increase each time
555 # auto-converge detects that migration is not making
556 # progress. The default value is 10. (Since 2.7)
558 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
559 # At the tail stage of throttling, the Guest is very
560 # sensitive to CPU percentage while the @cpu-throttle
561 # -increment is excessive usually at tail stage.
562 # If this parameter is true, we will compute the ideal
563 # CPU percentage used by the Guest, which may exactly make
564 # the dirty rate match the dirty rate threshold. Then we
565 # will choose a smaller throttle increment between the
566 # one specified by @cpu-throttle-increment and the one
567 # generated by ideal CPU percentage.
568 # Therefore, it is compatible to traditional throttling,
569 # meanwhile the throttle increment won't be excessive
571 # The default value is false. (Since 5.1)
573 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
574 # establishing a TLS connection over the migration data channel.
575 # On the outgoing side of the migration, the credentials must
576 # be for a 'client' endpoint, while for the incoming side the
577 # credentials must be for a 'server' endpoint. Setting this
578 # will enable TLS for all migrations. The default is unset,
579 # resulting in unsecured migration at the QEMU level. (Since 2.7)
581 # @tls-hostname: hostname of the target host for the migration. This is
582 # required when using x509 based TLS credentials and the
583 # migration URI does not already include a hostname. For
584 # example if using fd: or exec: based migration, the
585 # hostname must be provided so that the server's x509
586 # certificate identity can be validated. (Since 2.7)
588 # @tls-authz: ID of the 'authz' object subclass that provides access control
589 # checking of the TLS x509 certificate distinguished name.
590 # This object is only resolved at time of use, so can be deleted
591 # and recreated on the fly while the migration server is active.
592 # If missing, it will default to denying access (Since 4.0)
594 # @max-bandwidth: to set maximum speed for migration. maximum speed in
595 # bytes per second. (Since 2.8)
597 # @downtime-limit: set maximum tolerated downtime for migration. maximum
598 # downtime in milliseconds (Since 2.8)
600 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
601 # periodic mode. (Since 2.8)
603 # @block-incremental: Affects how much storage is migrated when the
604 # block migration capability is enabled. When false, the entire
605 # storage backing chain is migrated into a flattened image at
606 # the destination; when true, only the active qcow2 layer is
607 # migrated and the destination must already have access to the
608 # same backing chain as was used on the source. (since 2.10)
610 # @multifd-channels: Number of channels used to migrate data in
611 # parallel. This is the same number that the
612 # number of sockets used for migration. The
613 # default value is 2 (since 4.0)
615 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
616 # needs to be a multiple of the target page size
620 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
621 # Defaults to 0 (unlimited). In bytes per second.
624 # @max-cpu-throttle: maximum cpu throttle percentage.
625 # Defaults to 99. (Since 3.1)
627 # @multifd-compression: Which compression method to use.
628 # Defaults to none. (Since 5.0)
630 # @multifd-zlib-level: Set the compression level to be used in live
631 # migration, the compression level is an integer between 0
632 # and 9, where 0 means no compression, 1 means the best
633 # compression speed, and 9 means best compression ratio which
634 # will consume more CPU.
635 # Defaults to 1. (Since 5.0)
637 # @multifd-zstd-level: Set the compression level to be used in live
638 # migration, the compression level is an integer between 0
639 # and 20, where 0 means no compression, 1 means the best
640 # compression speed, and 20 means best compression ratio which
641 # will consume more CPU.
642 # Defaults to 1. (Since 5.0)
646 { 'enum': 'MigrationParameter',
647 'data': ['announce-initial', 'announce-max',
648 'announce-rounds', 'announce-step',
649 'compress-level', 'compress-threads', 'decompress-threads',
650 'compress-wait-thread', 'throttle-trigger-threshold',
651 'cpu-throttle-initial', 'cpu-throttle-increment',
652 'cpu-throttle-tailslow',
653 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
654 'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
656 'xbzrle-cache-size', 'max-postcopy-bandwidth',
657 'max-cpu-throttle', 'multifd-compression',
658 'multifd-zlib-level' ,'multifd-zstd-level' ] }
661 # @MigrateSetParameters:
663 # @announce-initial: Initial delay (in milliseconds) before sending the first
664 # announce (Since 4.0)
666 # @announce-max: Maximum delay (in milliseconds) between packets in the
667 # announcement (Since 4.0)
669 # @announce-rounds: Number of self-announce packets sent after migration
672 # @announce-step: Increase in delay (in milliseconds) between subsequent
673 # packets in the announcement (Since 4.0)
675 # @compress-level: compression level
677 # @compress-threads: compression thread count
679 # @compress-wait-thread: Controls behavior when all compression threads are
680 # currently busy. If true (default), wait for a free
681 # compression thread to become available; otherwise,
682 # send the page uncompressed. (Since 3.1)
684 # @decompress-threads: decompression thread count
686 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
687 # to trigger throttling. It is expressed as percentage.
688 # The default value is 50. (Since 5.0)
690 # @cpu-throttle-initial: Initial percentage of time guest cpus are
691 # throttled when migration auto-converge is activated.
692 # The default value is 20. (Since 2.7)
694 # @cpu-throttle-increment: throttle percentage increase each time
695 # auto-converge detects that migration is not making
696 # progress. The default value is 10. (Since 2.7)
698 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
699 # At the tail stage of throttling, the Guest is very
700 # sensitive to CPU percentage while the @cpu-throttle
701 # -increment is excessive usually at tail stage.
702 # If this parameter is true, we will compute the ideal
703 # CPU percentage used by the Guest, which may exactly make
704 # the dirty rate match the dirty rate threshold. Then we
705 # will choose a smaller throttle increment between the
706 # one specified by @cpu-throttle-increment and the one
707 # generated by ideal CPU percentage.
708 # Therefore, it is compatible to traditional throttling,
709 # meanwhile the throttle increment won't be excessive
711 # The default value is false. (Since 5.1)
713 # @tls-creds: ID of the 'tls-creds' object that provides credentials
714 # for establishing a TLS connection over the migration data
715 # channel. On the outgoing side of the migration, the credentials
716 # must be for a 'client' endpoint, while for the incoming side the
717 # credentials must be for a 'server' endpoint. Setting this
718 # to a non-empty string enables TLS for all migrations.
719 # An empty string means that QEMU will use plain text mode for
720 # migration, rather than TLS (Since 2.9)
721 # Previously (since 2.7), this was reported by omitting
724 # @tls-hostname: hostname of the target host for the migration. This
725 # is required when using x509 based TLS credentials and the
726 # migration URI does not already include a hostname. For
727 # example if using fd: or exec: based migration, the
728 # hostname must be provided so that the server's x509
729 # certificate identity can be validated. (Since 2.7)
730 # An empty string means that QEMU will use the hostname
731 # associated with the migration URI, if any. (Since 2.9)
732 # Previously (since 2.7), this was reported by omitting
733 # tls-hostname instead.
735 # @max-bandwidth: to set maximum speed for migration. maximum speed in
736 # bytes per second. (Since 2.8)
738 # @downtime-limit: set maximum tolerated downtime for migration. maximum
739 # downtime in milliseconds (Since 2.8)
741 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
743 # @block-incremental: Affects how much storage is migrated when the
744 # block migration capability is enabled. When false, the entire
745 # storage backing chain is migrated into a flattened image at
746 # the destination; when true, only the active qcow2 layer is
747 # migrated and the destination must already have access to the
748 # same backing chain as was used on the source. (since 2.10)
750 # @multifd-channels: Number of channels used to migrate data in
751 # parallel. This is the same number that the
752 # number of sockets used for migration. The
753 # default value is 2 (since 4.0)
755 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
756 # needs to be a multiple of the target page size
760 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
761 # Defaults to 0 (unlimited). In bytes per second.
764 # @max-cpu-throttle: maximum cpu throttle percentage.
765 # The default value is 99. (Since 3.1)
767 # @multifd-compression: Which compression method to use.
768 # Defaults to none. (Since 5.0)
770 # @multifd-zlib-level: Set the compression level to be used in live
771 # migration, the compression level is an integer between 0
772 # and 9, where 0 means no compression, 1 means the best
773 # compression speed, and 9 means best compression ratio which
774 # will consume more CPU.
775 # Defaults to 1. (Since 5.0)
777 # @multifd-zstd-level: Set the compression level to be used in live
778 # migration, the compression level is an integer between 0
779 # and 20, where 0 means no compression, 1 means the best
780 # compression speed, and 20 means best compression ratio which
781 # will consume more CPU.
782 # Defaults to 1. (Since 5.0)
786 # TODO either fuse back into MigrationParameters, or make
787 # MigrationParameters members mandatory
788 { 'struct': 'MigrateSetParameters',
789 'data': { '*announce-initial': 'size',
790 '*announce-max': 'size',
791 '*announce-rounds': 'size',
792 '*announce-step': 'size',
793 '*compress-level': 'int',
794 '*compress-threads': 'int',
795 '*compress-wait-thread': 'bool',
796 '*decompress-threads': 'int',
797 '*throttle-trigger-threshold': 'int',
798 '*cpu-throttle-initial': 'int',
799 '*cpu-throttle-increment': 'int',
800 '*cpu-throttle-tailslow': 'bool',
801 '*tls-creds': 'StrOrNull',
802 '*tls-hostname': 'StrOrNull',
803 '*tls-authz': 'StrOrNull',
804 '*max-bandwidth': 'int',
805 '*downtime-limit': 'int',
806 '*x-checkpoint-delay': 'int',
807 '*block-incremental': 'bool',
808 '*multifd-channels': 'int',
809 '*xbzrle-cache-size': 'size',
810 '*max-postcopy-bandwidth': 'size',
811 '*max-cpu-throttle': 'int',
812 '*multifd-compression': 'MultiFDCompression',
813 '*multifd-zlib-level': 'int',
814 '*multifd-zstd-level': 'int' } }
817 # @migrate-set-parameters:
819 # Set various migration parameters.
825 # -> { "execute": "migrate-set-parameters" ,
826 # "arguments": { "compress-level": 1 } }
829 { 'command': 'migrate-set-parameters', 'boxed': true,
830 'data': 'MigrateSetParameters' }
833 # @MigrationParameters:
835 # The optional members aren't actually optional.
837 # @announce-initial: Initial delay (in milliseconds) before sending the
838 # first announce (Since 4.0)
840 # @announce-max: Maximum delay (in milliseconds) between packets in the
841 # announcement (Since 4.0)
843 # @announce-rounds: Number of self-announce packets sent after migration
846 # @announce-step: Increase in delay (in milliseconds) between subsequent
847 # packets in the announcement (Since 4.0)
849 # @compress-level: compression level
851 # @compress-threads: compression thread count
853 # @compress-wait-thread: Controls behavior when all compression threads are
854 # currently busy. If true (default), wait for a free
855 # compression thread to become available; otherwise,
856 # send the page uncompressed. (Since 3.1)
858 # @decompress-threads: decompression thread count
860 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and bytes_xfer_period
861 # to trigger throttling. It is expressed as percentage.
862 # The default value is 50. (Since 5.0)
864 # @cpu-throttle-initial: Initial percentage of time guest cpus are
865 # throttled when migration auto-converge is activated.
868 # @cpu-throttle-increment: throttle percentage increase each time
869 # auto-converge detects that migration is not making
870 # progress. (Since 2.7)
872 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage
873 # At the tail stage of throttling, the Guest is very
874 # sensitive to CPU percentage while the @cpu-throttle
875 # -increment is excessive usually at tail stage.
876 # If this parameter is true, we will compute the ideal
877 # CPU percentage used by the Guest, which may exactly make
878 # the dirty rate match the dirty rate threshold. Then we
879 # will choose a smaller throttle increment between the
880 # one specified by @cpu-throttle-increment and the one
881 # generated by ideal CPU percentage.
882 # Therefore, it is compatible to traditional throttling,
883 # meanwhile the throttle increment won't be excessive
885 # The default value is false. (Since 5.1)
887 # @tls-creds: ID of the 'tls-creds' object that provides credentials
888 # for establishing a TLS connection over the migration data
889 # channel. On the outgoing side of the migration, the credentials
890 # must be for a 'client' endpoint, while for the incoming side the
891 # credentials must be for a 'server' endpoint.
892 # An empty string means that QEMU will use plain text mode for
893 # migration, rather than TLS (Since 2.7)
894 # Note: 2.8 reports this by omitting tls-creds instead.
896 # @tls-hostname: hostname of the target host for the migration. This
897 # is required when using x509 based TLS credentials and the
898 # migration URI does not already include a hostname. For
899 # example if using fd: or exec: based migration, the
900 # hostname must be provided so that the server's x509
901 # certificate identity can be validated. (Since 2.7)
902 # An empty string means that QEMU will use the hostname
903 # associated with the migration URI, if any. (Since 2.9)
904 # Note: 2.8 reports this by omitting tls-hostname instead.
906 # @tls-authz: ID of the 'authz' object subclass that provides access control
907 # checking of the TLS x509 certificate distinguished name. (Since
910 # @max-bandwidth: to set maximum speed for migration. maximum speed in
911 # bytes per second. (Since 2.8)
913 # @downtime-limit: set maximum tolerated downtime for migration. maximum
914 # downtime in milliseconds (Since 2.8)
916 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
918 # @block-incremental: Affects how much storage is migrated when the
919 # block migration capability is enabled. When false, the entire
920 # storage backing chain is migrated into a flattened image at
921 # the destination; when true, only the active qcow2 layer is
922 # migrated and the destination must already have access to the
923 # same backing chain as was used on the source. (since 2.10)
925 # @multifd-channels: Number of channels used to migrate data in
926 # parallel. This is the same number that the
927 # number of sockets used for migration.
928 # The default value is 2 (since 4.0)
930 # @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
931 # needs to be a multiple of the target page size
935 # @max-postcopy-bandwidth: Background transfer bandwidth during postcopy.
936 # Defaults to 0 (unlimited). In bytes per second.
939 # @max-cpu-throttle: maximum cpu throttle percentage.
943 # @multifd-compression: Which compression method to use.
944 # Defaults to none. (Since 5.0)
946 # @multifd-zlib-level: Set the compression level to be used in live
947 # migration, the compression level is an integer between 0
948 # and 9, where 0 means no compression, 1 means the best
949 # compression speed, and 9 means best compression ratio which
950 # will consume more CPU.
951 # Defaults to 1. (Since 5.0)
953 # @multifd-zstd-level: Set the compression level to be used in live
954 # migration, the compression level is an integer between 0
955 # and 20, where 0 means no compression, 1 means the best
956 # compression speed, and 20 means best compression ratio which
957 # will consume more CPU.
958 # Defaults to 1. (Since 5.0)
962 { 'struct': 'MigrationParameters',
963 'data': { '*announce-initial': 'size',
964 '*announce-max': 'size',
965 '*announce-rounds': 'size',
966 '*announce-step': 'size',
967 '*compress-level': 'uint8',
968 '*compress-threads': 'uint8',
969 '*compress-wait-thread': 'bool',
970 '*decompress-threads': 'uint8',
971 '*throttle-trigger-threshold': 'uint8',
972 '*cpu-throttle-initial': 'uint8',
973 '*cpu-throttle-increment': 'uint8',
974 '*cpu-throttle-tailslow': 'bool',
976 '*tls-hostname': 'str',
978 '*max-bandwidth': 'size',
979 '*downtime-limit': 'uint64',
980 '*x-checkpoint-delay': 'uint32',
981 '*block-incremental': 'bool' ,
982 '*multifd-channels': 'uint8',
983 '*xbzrle-cache-size': 'size',
984 '*max-postcopy-bandwidth': 'size',
985 '*max-cpu-throttle': 'uint8',
986 '*multifd-compression': 'MultiFDCompression',
987 '*multifd-zlib-level': 'uint8',
988 '*multifd-zstd-level': 'uint8' } }
991 # @query-migrate-parameters:
993 # Returns information about the current migration parameters
995 # Returns: @MigrationParameters
1001 # -> { "execute": "query-migrate-parameters" }
1003 # "decompress-threads": 2,
1004 # "cpu-throttle-increment": 10,
1005 # "compress-threads": 8,
1006 # "compress-level": 1,
1007 # "cpu-throttle-initial": 20,
1008 # "max-bandwidth": 33554432,
1009 # "downtime-limit": 300
1014 { 'command': 'query-migrate-parameters',
1015 'returns': 'MigrationParameters' }
1018 # @client_migrate_info:
1020 # Set migration information for remote display. This makes the server
1021 # ask the client to automatically reconnect using the new parameters
1022 # once migration finished successfully. Only implemented for SPICE.
1024 # @protocol: must be "spice"
1025 # @hostname: migration target hostname
1026 # @port: spice tcp port for plaintext channels
1027 # @tls-port: spice tcp port for tls-secured channels
1028 # @cert-subject: server certificate subject
1034 # -> { "execute": "client_migrate_info",
1035 # "arguments": { "protocol": "spice",
1036 # "hostname": "virt42.lab.kraxel.org",
1038 # <- { "return": {} }
1041 { 'command': 'client_migrate_info',
1042 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1043 '*tls-port': 'int', '*cert-subject': 'str' } }
1046 # @migrate-start-postcopy:
1048 # Followup to a migration command to switch the migration to postcopy mode.
1049 # The postcopy-ram capability must be set on both source and destination
1050 # before the original migration command.
1056 # -> { "execute": "migrate-start-postcopy" }
1057 # <- { "return": {} }
1060 { 'command': 'migrate-start-postcopy' }
1065 # Emitted when a migration event happens
1067 # @status: @MigrationStatus describing the current migration status.
1073 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1074 # "event": "MIGRATION",
1075 # "data": {"status": "completed"} }
1078 { 'event': 'MIGRATION',
1079 'data': {'status': 'MigrationStatus'}}
1084 # Emitted from the source side of a migration at the start of each pass
1085 # (when it syncs the dirty bitmap)
1087 # @pass: An incrementing count (starting at 1 on the first pass)
1093 # { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1094 # "event": "MIGRATION_PASS", "data": {"pass": 2} }
1097 { 'event': 'MIGRATION_PASS',
1098 'data': { 'pass': 'int' } }
1103 # The message transmission between Primary side and Secondary side.
1105 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1107 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1109 # @checkpoint-reply: SVM gets PVM's checkpoint request
1111 # @vmstate-send: VM's state will be sent by PVM.
1113 # @vmstate-size: The total size of VMstate.
1115 # @vmstate-received: VM's state has been received by SVM.
1117 # @vmstate-loaded: VM's state has been loaded by SVM.
1121 { 'enum': 'COLOMessage',
1122 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1123 'vmstate-send', 'vmstate-size', 'vmstate-received',
1124 'vmstate-loaded' ] }
1129 # The COLO current mode.
1131 # @none: COLO is disabled.
1133 # @primary: COLO node in primary side.
1135 # @secondary: COLO node in slave side.
1139 { 'enum': 'COLOMode',
1140 'data': [ 'none', 'primary', 'secondary'] }
1145 # An enumeration of COLO failover status
1147 # @none: no failover has ever happened
1149 # @require: got failover requirement but not handled
1151 # @active: in the process of doing failover
1153 # @completed: finish the process of failover
1155 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1159 { 'enum': 'FailoverStatus',
1160 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1165 # Emitted when VM finishes COLO mode due to some errors happening or
1166 # at the request of users.
1168 # @mode: report COLO mode when COLO exited.
1170 # @reason: describes the reason for the COLO exit.
1176 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1177 # "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1180 { 'event': 'COLO_EXIT',
1181 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1186 # The reason for a COLO exit.
1188 # @none: failover has never happened. This state does not occur
1189 # in the COLO_EXIT event, and is only visible in the result of
1190 # query-colo-status.
1192 # @request: COLO exit is due to an external request.
1194 # @error: COLO exit is due to an internal error.
1196 # @processing: COLO is currently handling a failover (since 4.0).
1200 { 'enum': 'COLOExitReason',
1201 'data': [ 'none', 'request', 'error' , 'processing' ] }
1204 # @x-colo-lost-heartbeat:
1206 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1207 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1208 # If sent to the Secondary, the Secondary side will run failover work,
1209 # then takes over server operation to become the service VM.
1215 # -> { "execute": "x-colo-lost-heartbeat" }
1216 # <- { "return": {} }
1219 { 'command': 'x-colo-lost-heartbeat' }
1224 # Cancel the current executing migration process.
1226 # Returns: nothing on success
1228 # Notes: This command succeeds even if there is no migration process running.
1234 # -> { "execute": "migrate_cancel" }
1235 # <- { "return": {} }
1238 { 'command': 'migrate_cancel' }
1241 # @migrate-continue:
1243 # Continue migration when it's in a paused state.
1245 # @state: The state the migration is currently expected to be in
1247 # Returns: nothing on success
1251 # -> { "execute": "migrate-continue" , "arguments":
1252 # { "state": "pre-switchover" } }
1253 # <- { "return": {} }
1255 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1258 # @migrate_set_downtime:
1260 # Set maximum tolerated downtime for migration.
1262 # @value: maximum downtime in seconds
1265 # @deprecated: This command is deprecated. Use
1266 # 'migrate-set-parameters' instead.
1268 # Returns: nothing on success
1274 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1275 # <- { "return": {} }
1278 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'},
1279 'features': [ 'deprecated' ] }
1282 # @migrate_set_speed:
1284 # Set maximum speed for migration.
1286 # @value: maximum speed in bytes per second.
1289 # @deprecated: This command is deprecated. Use
1290 # 'migrate-set-parameters' instead.
1292 # Returns: nothing on success
1298 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1299 # <- { "return": {} }
1302 { 'command': 'migrate_set_speed', 'data': {'value': 'int'},
1303 'features': [ 'deprecated' ] }
1306 # @migrate-set-cache-size:
1308 # Set cache size to be used by XBZRLE migration
1310 # @value: cache size in bytes
1313 # @deprecated: This command is deprecated. Use
1314 # 'migrate-set-parameters' instead.
1316 # The size will be rounded down to the nearest power of 2.
1317 # The cache size can be modified before and during ongoing migration
1319 # Returns: nothing on success
1325 # -> { "execute": "migrate-set-cache-size",
1326 # "arguments": { "value": 536870912 } }
1327 # <- { "return": {} }
1330 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'},
1331 'features': [ 'deprecated' ] }
1334 # @query-migrate-cache-size:
1336 # Query migration XBZRLE cache size
1339 # @deprecated: This command is deprecated. Use
1340 # 'query-migrate-parameters' instead.
1342 # Returns: XBZRLE cache size in bytes
1348 # -> { "execute": "query-migrate-cache-size" }
1349 # <- { "return": 67108864 }
1352 { 'command': 'query-migrate-cache-size', 'returns': 'int',
1353 'features': [ 'deprecated' ] }
1358 # Migrates the current running guest to another Virtual Machine.
1360 # @uri: the Uniform Resource Identifier of the destination VM
1362 # @blk: do block migration (full disk copy)
1364 # @inc: incremental disk copy migration
1366 # @detach: this argument exists only for compatibility reasons and
1367 # is ignored by QEMU
1369 # @resume: resume one paused migration, default "off". (since 3.0)
1371 # Returns: nothing on success
1377 # 1. The 'query-migrate' command should be used to check migration's progress
1378 # and final result (this information is provided by the 'status' member)
1380 # 2. All boolean arguments default to false
1382 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
1387 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1388 # <- { "return": {} }
1391 { 'command': 'migrate',
1392 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1393 '*detach': 'bool', '*resume': 'bool' } }
1396 # @migrate-incoming:
1398 # Start an incoming migration, the qemu must have been started
1399 # with -incoming defer
1401 # @uri: The Uniform Resource Identifier identifying the source or
1402 # address to listen on
1404 # Returns: nothing on success
1410 # 1. It's a bad idea to use a string for the uri, but it needs to stay
1411 # compatible with -incoming and the format of the uri is already exposed
1414 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1417 # 3. The uri format is the same as for -incoming
1421 # -> { "execute": "migrate-incoming",
1422 # "arguments": { "uri": "tcp::4446" } }
1423 # <- { "return": {} }
1426 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1429 # @xen-save-devices-state:
1431 # Save the state of all devices to file. The RAM and the block devices
1432 # of the VM are not saved by this command.
1434 # @filename: the file to save the state of the devices to as binary
1435 # data. See xen-save-devices-state.txt for a description of the binary
1438 # @live: Optional argument to ask QEMU to treat this command as part of a live
1439 # migration. Default to true. (since 2.11)
1441 # Returns: Nothing on success
1447 # -> { "execute": "xen-save-devices-state",
1448 # "arguments": { "filename": "/tmp/save" } }
1449 # <- { "return": {} }
1452 { 'command': 'xen-save-devices-state',
1453 'data': {'filename': 'str', '*live':'bool' } }
1456 # @xen-set-replication:
1458 # Enable or disable replication.
1460 # @enable: true to enable, false to disable.
1462 # @primary: true for primary or false for secondary.
1464 # @failover: true to do failover, false to stop. but cannot be
1465 # specified if 'enable' is true. default value is false.
1471 # -> { "execute": "xen-set-replication",
1472 # "arguments": {"enable": true, "primary": false} }
1473 # <- { "return": {} }
1477 { 'command': 'xen-set-replication',
1478 'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' },
1479 'if': 'defined(CONFIG_REPLICATION)' }
1482 # @ReplicationStatus:
1484 # The result format for 'query-xen-replication-status'.
1486 # @error: true if an error happened, false if replication is normal.
1488 # @desc: the human readable error description string, when
1493 { 'struct': 'ReplicationStatus',
1494 'data': { 'error': 'bool', '*desc': 'str' },
1495 'if': 'defined(CONFIG_REPLICATION)' }
1498 # @query-xen-replication-status:
1500 # Query replication status while the vm is running.
1502 # Returns: A @ReplicationResult object showing the status.
1506 # -> { "execute": "query-xen-replication-status" }
1507 # <- { "return": { "error": false } }
1511 { 'command': 'query-xen-replication-status',
1512 'returns': 'ReplicationStatus',
1513 'if': 'defined(CONFIG_REPLICATION)' }
1516 # @xen-colo-do-checkpoint:
1518 # Xen uses this command to notify replication to trigger a checkpoint.
1524 # -> { "execute": "xen-colo-do-checkpoint" }
1525 # <- { "return": {} }
1529 { 'command': 'xen-colo-do-checkpoint',
1530 'if': 'defined(CONFIG_REPLICATION)' }
1535 # The result format for 'query-colo-status'.
1537 # @mode: COLO running mode. If COLO is running, this field will return
1538 # 'primary' or 'secondary'.
1540 # @last-mode: COLO last running mode. If COLO is running, this field
1541 # will return same like mode field, after failover we can
1542 # use this field to get last colo mode. (since 4.0)
1544 # @reason: describes the reason for the COLO exit.
1548 { 'struct': 'COLOStatus',
1549 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1550 'reason': 'COLOExitReason' } }
1553 # @query-colo-status:
1555 # Query COLO status while the vm is running.
1557 # Returns: A @COLOStatus object showing the status.
1561 # -> { "execute": "query-colo-status" }
1562 # <- { "return": { "mode": "primary", "reason": "request" } }
1566 { 'command': 'query-colo-status',
1567 'returns': 'COLOStatus' }
1572 # Provide a recovery migration stream URI.
1574 # @uri: the URI to be used for the recovery of migration stream.
1580 # -> { "execute": "migrate-recover",
1581 # "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1582 # <- { "return": {} }
1586 { 'command': 'migrate-recover',
1587 'data': { 'uri': 'str' },
1593 # Pause a migration. Currently it only supports postcopy.
1599 # -> { "execute": "migrate-pause" }
1600 # <- { "return": {} }
1604 { 'command': 'migrate-pause', 'allow-oob': true }
1609 # Emitted from source side of a migration when migration state is
1610 # WAIT_UNPLUG. Device was unplugged by guest operating system.
1611 # Device resources in QEMU are kept on standby to be able to re-plug it in case
1612 # of migration failure.
1614 # @device-id: QEMU device id of the unplugged device
1619 # {"event": "UNPLUG_PRIMARY", "data": {"device-id": "hostdev0"} }
1622 { 'event': 'UNPLUG_PRIMARY',
1623 'data': { 'device-id': 'str' } }