xref: /openbmc/qemu/qapi/migration.json (revision 638511e9)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
4
5##
6# = Migration
7##
8
9{ 'include': 'common.json' }
10{ 'include': 'sockets.json' }
11
12##
13# @MigrationStats:
14#
15# Detailed migration status.
16#
17# @transferred: amount of bytes already transferred to the target VM
18#
19# @remaining: amount of bytes remaining to be transferred to the
20#     target VM
21#
22# @total: total amount of bytes involved in the migration process
23#
24# @duplicate: number of duplicate (zero) pages (since 1.2)
25#
26# @skipped: number of skipped zero pages. Always zero, only provided for
27#     compatibility (since 1.5)
28#
29# @normal: number of normal pages (since 1.2)
30#
31# @normal-bytes: number of normal bytes sent (since 1.2)
32#
33# @dirty-pages-rate: number of pages dirtied by second by the guest
34#     (since 1.3)
35#
36# @mbps: throughput in megabits/sec.  (since 1.6)
37#
38# @dirty-sync-count: number of times that dirty ram was synchronized
39#     (since 2.1)
40#
41# @postcopy-requests: The number of page requests received from the
42#     destination (since 2.7)
43#
44# @page-size: The number of bytes per page for the various page-based
45#     statistics (since 2.10)
46#
47# @multifd-bytes: The number of bytes sent through multifd (since 3.0)
48#
49# @pages-per-second: the number of memory pages transferred per second
50#     (Since 4.0)
51#
52# @precopy-bytes: The number of bytes sent in the pre-copy phase
53#     (since 7.0).
54#
55# @downtime-bytes: The number of bytes sent while the guest is paused
56#     (since 7.0).
57#
58# @postcopy-bytes: The number of bytes sent during the post-copy phase
59#     (since 7.0).
60#
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
64#     7.1)
65#
66# Features:
67#
68# @deprecated: Member @skipped is always zero since 1.5.3
69#
70# Since: 0.14
71#
72##
73{ 'struct': 'MigrationStats',
74  'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
75           'duplicate': 'int',
76           'skipped': { 'type': 'int', 'features': ['deprecated'] },
77           'normal': 'int',
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' } }
85
86##
87# @XBZRLECacheStats:
88#
89# Detailed XBZRLE migration cache statistics
90#
91# @cache-size: XBZRLE cache size
92#
93# @bytes: amount of bytes already transferred to the target VM
94#
95# @pages: amount of pages transferred to the target VM
96#
97# @cache-miss: number of cache miss
98#
99# @cache-miss-rate: rate of cache miss (since 2.1)
100#
101# @encoding-rate: rate of encoded bytes (since 5.1)
102#
103# @overflow: number of overflows
104#
105# Since: 1.2
106##
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' } }
111
112##
113# @CompressionStats:
114#
115# Detailed migration compression statistics
116#
117# @pages: amount of pages compressed and transferred to the target VM
118#
119# @busy: count of times that no free thread was available to compress
120#     data
121#
122# @busy-rate: rate of thread busy
123#
124# @compressed-size: amount of bytes after compression
125#
126# @compression-rate: rate of compressed size
127#
128# Since: 3.1
129##
130{ 'struct': 'CompressionStats',
131  'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
132           'compressed-size': 'int', 'compression-rate': 'number' } }
133
134##
135# @MigrationStatus:
136#
137# An enumeration of migration status.
138#
139# @none: no migration has ever happened.
140#
141# @setup: migration process has been initiated.
142#
143# @cancelling: in the process of cancelling migration.
144#
145# @cancelled: cancelling migration is finished.
146#
147# @active: in the process of doing migration.
148#
149# @postcopy-active: like active, but now in postcopy mode.  (since
150#     2.5)
151#
152# @postcopy-paused: during postcopy but paused.  (since 3.0)
153#
154# @postcopy-recover: trying to recover from a paused postcopy.  (since
155#     3.0)
156#
157# @completed: migration is finished.
158#
159# @failed: some error occurred during migration process.
160#
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.
163#     (since 2.8)
164#
165# @pre-switchover: Paused before device serialisation.  (since 2.11)
166#
167# @device: During device serialisation when pause-before-switchover is
168#     enabled (since 2.11)
169#
170# @wait-unplug: wait for device unplug request by guest OS to be
171#     completed.  (since 4.2)
172#
173# Since: 2.3
174##
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' ] }
180##
181# @VfioStats:
182#
183# Detailed VFIO devices migration statistics
184#
185# @transferred: amount of bytes transferred to the target VM by VFIO
186#     devices
187#
188# Since: 5.2
189##
190{ 'struct': 'VfioStats',
191  'data': {'transferred': 'int' } }
192
193##
194# @MigrationInfo:
195#
196# Information about current migration process.
197#
198# @status: @MigrationStatus describing the current migration status.
199#     If this field is not returned, no migration process has been
200#     initiated
201#
202# @ram: @MigrationStats containing detailed migration status, only
203#     returned if status is 'active' or 'completed'(since 1.2)
204#
205# @disk: @MigrationStats containing detailed disk migration status,
206#     only returned if status is 'active' and it is a block migration
207#
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)
211#
212# @total-time: total amount of milliseconds since migration started.
213#     If migration has ended, it returns the total migration time.
214#     (since 1.2)
215#
216# @downtime: only present when migration finishes correctly total
217#     downtime in milliseconds for the guest.  (since 1.3)
218#
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)
222#
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)
228#
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)
232#
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)
236#
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)
240#
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)
244#
245# @compression: migration compression statistics, only returned if
246#     compression feature is on and status is 'active' or 'completed'
247#     (Since 3.1)
248#
249# @socket-address: Only used for tcp, to know what the real port is
250#     (Since 4.0)
251#
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)
256#
257# @blocked-reasons: A list of reasons an outgoing migration is
258#     blocked.  Present and non-empty when migration is blocked.
259#     (since 6.0)
260#
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)
265#
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)
272#
273# Since: 0.14
274##
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',
282           '*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'} }
293
294##
295# @query-migrate:
296#
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
300# migration status.
301#
302# Returns: @MigrationInfo
303#
304# Since: 0.14
305#
306# Examples:
307#
308# 1. Before the first migration
309#
310# -> { "execute": "query-migrate" }
311# <- { "return": {} }
312#
313# 2. Migration is done and has succeeded
314#
315# -> { "execute": "query-migrate" }
316# <- { "return": {
317#         "status": "completed",
318#         "total-time":12345,
319#         "setup-time":12345,
320#         "downtime":12345,
321#         "ram":{
322#           "transferred":123,
323#           "remaining":123,
324#           "total":246,
325#           "duplicate":123,
326#           "normal":123,
327#           "normal-bytes":123456,
328#           "dirty-sync-count":15
329#         }
330#      }
331#    }
332#
333# 3. Migration is done and has failed
334#
335# -> { "execute": "query-migrate" }
336# <- { "return": { "status": "failed" } }
337#
338# 4. Migration is being performed and is not a block migration:
339#
340# -> { "execute": "query-migrate" }
341# <- {
342#       "return":{
343#          "status":"active",
344#          "total-time":12345,
345#          "setup-time":12345,
346#          "expected-downtime":12345,
347#          "ram":{
348#             "transferred":123,
349#             "remaining":123,
350#             "total":246,
351#             "duplicate":123,
352#             "normal":123,
353#             "normal-bytes":123456,
354#             "dirty-sync-count":15
355#          }
356#       }
357#    }
358#
359# 5. Migration is being performed and is a block migration:
360#
361# -> { "execute": "query-migrate" }
362# <- {
363#       "return":{
364#          "status":"active",
365#          "total-time":12345,
366#          "setup-time":12345,
367#          "expected-downtime":12345,
368#          "ram":{
369#             "total":1057024,
370#             "remaining":1053304,
371#             "transferred":3720,
372#             "duplicate":123,
373#             "normal":123,
374#             "normal-bytes":123456,
375#             "dirty-sync-count":15
376#          },
377#          "disk":{
378#             "total":20971520,
379#             "remaining":20880384,
380#             "transferred":91136
381#          }
382#       }
383#    }
384#
385# 6. Migration is being performed and XBZRLE is active:
386#
387# -> { "execute": "query-migrate" }
388# <- {
389#       "return":{
390#          "status":"active",
391#          "total-time":12345,
392#          "setup-time":12345,
393#          "expected-downtime":12345,
394#          "ram":{
395#             "total":1057024,
396#             "remaining":1053304,
397#             "transferred":3720,
398#             "duplicate":10,
399#             "normal":3333,
400#             "normal-bytes":3412992,
401#             "dirty-sync-count":15
402#          },
403#          "xbzrle-cache":{
404#             "cache-size":67108864,
405#             "bytes":20971520,
406#             "pages":2444343,
407#             "cache-miss":2244,
408#             "cache-miss-rate":0.123,
409#             "encoding-rate":80.1,
410#             "overflow":34434
411#          }
412#       }
413#    }
414##
415{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
416
417##
418# @MigrationCapability:
419#
420# Migration capabilities enumeration
421#
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
425#     pages
426#
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)
430#
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.
436#     (since 1.6)
437#
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 )
445#
446# @events: generate events for each migration state change (since 2.4
447#     )
448#
449# @auto-converge: If enabled, QEMU will automatically throttle down
450#     the guest to speed up convergence of RAM migration.  (since 1.6)
451#
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)
457#
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)
462#
463# @release-ram: if enabled, qemu will free the migrated ram pages on
464#     the source during postcopy-ram migration.  (since 2.9)
465#
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)
470#
471# @return-path: If enabled, migration will use the return path even
472#     for precopy.  (since 2.10)
473#
474# @pause-before-switchover: Pause outgoing migration before
475#     serialising device state and before disabling block IO (since
476#     2.11)
477#
478# @multifd: Use more than one fd for migration (since 4.0)
479#
480# @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
481#     (since 2.12)
482#
483# @postcopy-blocktime: Calculate downtime for postcopy live migration
484#     (since 3.0)
485#
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)
489#
490# @x-ignore-shared: If enabled, QEMU will not migrate shared memory
491#     that is accessible on the destination machine.  (since 4.0)
492#
493# @validate-uuid: Send the UUID of the source to allow the destination
494#     to ensure it is the same.  (since 4.2)
495#
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
499#     6.0)
500#
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)
505#
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.
510#     (since 7.1)
511#
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.  For
516#     example, a device can use it to make sure some of its data is
517#     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
520#     it.  (since 8.1)
521#
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.
530#               (since 8.1)
531#
532# Features:
533#
534# @unstable: Members @x-colo and @x-ignore-shared are experimental.
535#
536# Since: 1.2
537##
538{ 'enum': 'MigrationCapability',
539  'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
540           'compress', 'events', 'postcopy-ram',
541           { 'name': 'x-colo', 'features': [ 'unstable' ] },
542           'release-ram',
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',
548           'dirty-limit'] }
549
550##
551# @MigrationCapabilityStatus:
552#
553# Migration capability information
554#
555# @capability: capability enum
556#
557# @state: capability state bool
558#
559# Since: 1.2
560##
561{ 'struct': 'MigrationCapabilityStatus',
562  'data': { 'capability': 'MigrationCapability', 'state': 'bool' } }
563
564##
565# @migrate-set-capabilities:
566#
567# Enable/Disable the following migration capabilities (like xbzrle)
568#
569# @capabilities: json array of capability modifications to make
570#
571# Since: 1.2
572#
573# Example:
574#
575# -> { "execute": "migrate-set-capabilities" , "arguments":
576#      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
577# <- { "return": {} }
578##
579{ 'command': 'migrate-set-capabilities',
580  'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
581
582##
583# @query-migrate-capabilities:
584#
585# Returns information about the current migration capabilities status
586#
587# Returns: @MigrationCapabilityStatus
588#
589# Since: 1.2
590#
591# Example:
592#
593# -> { "execute": "query-migrate-capabilities" }
594# <- { "return": [
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"}
603#    ]}
604##
605{ 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
606
607##
608# @MultiFDCompression:
609#
610# An enumeration of multifd compression methods.
611#
612# @none: no compression.
613#
614# @zlib: use zlib compression method.
615#
616# @zstd: use zstd compression method.
617#
618# Since: 5.0
619##
620{ 'enum': 'MultiFDCompression',
621  'data': [ 'none', 'zlib',
622            { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
623
624##
625# @BitmapMigrationBitmapAliasTransform:
626#
627# @persistent: If present, the bitmap will be made persistent or
628#     transient depending on this parameter.
629#
630# Since: 6.0
631##
632{ 'struct': 'BitmapMigrationBitmapAliasTransform',
633  'data': {
634      '*persistent': 'bool'
635  } }
636
637##
638# @BitmapMigrationBitmapAlias:
639#
640# @name: The name of the bitmap.
641#
642# @alias: An alias name for migration (for example the bitmap name on
643#     the opposite site).
644#
645# @transform: Allows the modification of the migrated bitmap.  (since
646#     6.0)
647#
648# Since: 5.2
649##
650{ 'struct': 'BitmapMigrationBitmapAlias',
651  'data': {
652      'name': 'str',
653      'alias': 'str',
654      '*transform': 'BitmapMigrationBitmapAliasTransform'
655  } }
656
657##
658# @BitmapMigrationNodeAlias:
659#
660# Maps a block node name and the bitmaps it has to aliases for dirty
661# bitmap migration.
662#
663# @node-name: A block node name.
664#
665# @alias: An alias block node name for migration (for example the node
666#     name on the opposite site).
667#
668# @bitmaps: Mappings for the bitmaps on this node.
669#
670# Since: 5.2
671##
672{ 'struct': 'BitmapMigrationNodeAlias',
673  'data': {
674      'node-name': 'str',
675      'alias': 'str',
676      'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
677  } }
678
679##
680# @MigrationParameter:
681#
682# Migration parameters enumeration
683#
684# @announce-initial: Initial delay (in milliseconds) before sending
685#     the first announce (Since 4.0)
686#
687# @announce-max: Maximum delay (in milliseconds) between packets in
688#     the announcement (Since 4.0)
689#
690# @announce-rounds: Number of self-announce packets sent after
691#     migration (Since 4.0)
692#
693# @announce-step: Increase in delay (in milliseconds) between
694#     subsequent packets in the announcement (Since 4.0)
695#
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
700#     more CPU.
701#
702# @compress-threads: Set compression thread count to be used in live
703#     migration, the compression thread count is an integer between 1
704#     and 255.
705#
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)
710#
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.
716#
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)
720#
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)
724#
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)
728#
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
740#     5.1)
741#
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)
749#
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)
756#
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)
762#
763# @max-bandwidth: to set maximum speed for migration.  maximum speed
764#     in bytes per second.  (Since 2.8)
765#
766# @downtime-limit: set maximum tolerated downtime for migration.
767#     maximum downtime in milliseconds (Since 2.8)
768#
769# @x-checkpoint-delay: The delay time (in ms) between two COLO
770#     checkpoints in periodic mode.  (Since 2.8)
771#
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)
778#
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)
782#
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
785#     (Since 2.11)
786#
787# @max-postcopy-bandwidth: Background transfer bandwidth during
788#     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
789#     (Since 3.0)
790#
791# @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
792#     (Since 3.1)
793#
794# @multifd-compression: Which compression method to use.  Defaults to
795#     none.  (Since 5.0)
796#
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)
802#
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)
808#
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)
824#
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)
828#
829# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
830#                    Defaults to 1. (Since 8.1)
831#
832# Features:
833#
834# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
835#            are experimental.
836#
837# Since: 2.4
838##
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',
847           'downtime-limit',
848           { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
849           'block-incremental',
850           'multifd-channels',
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'] }
857
858##
859# @MigrateSetParameters:
860#
861# @announce-initial: Initial delay (in milliseconds) before sending
862#     the first announce (Since 4.0)
863#
864# @announce-max: Maximum delay (in milliseconds) between packets in
865#     the announcement (Since 4.0)
866#
867# @announce-rounds: Number of self-announce packets sent after
868#     migration (Since 4.0)
869#
870# @announce-step: Increase in delay (in milliseconds) between
871#     subsequent packets in the announcement (Since 4.0)
872#
873# @compress-level: compression level
874#
875# @compress-threads: compression thread count
876#
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)
881#
882# @decompress-threads: decompression thread count
883#
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)
887#
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)
891#
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)
895#
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
907#     5.1)
908#
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.
918#
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.
928#
929# @max-bandwidth: to set maximum speed for migration.  maximum speed
930#     in bytes per second.  (Since 2.8)
931#
932# @downtime-limit: set maximum tolerated downtime for migration.
933#     maximum downtime in milliseconds (Since 2.8)
934#
935# @x-checkpoint-delay: the delay time between two COLO checkpoints.
936#     (Since 2.8)
937#
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)
944#
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)
948#
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
951#     (Since 2.11)
952#
953# @max-postcopy-bandwidth: Background transfer bandwidth during
954#     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
955#     (Since 3.0)
956#
957# @max-cpu-throttle: maximum cpu throttle percentage.  The default
958#     value is 99. (Since 3.1)
959#
960# @multifd-compression: Which compression method to use.  Defaults to
961#     none.  (Since 5.0)
962#
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)
968#
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)
974#
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)
990#
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)
994#
995# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
996#                    Defaults to 1. (Since 8.1)
997#
998# Features:
999#
1000# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
1001#            are experimental.
1002#
1003# TODO: either fuse back into MigrationParameters, or make
1004#     MigrationParameters members mandatory
1005#
1006# Since: 2.4
1007##
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'} }
1040
1041##
1042# @migrate-set-parameters:
1043#
1044# Set various migration parameters.
1045#
1046# Since: 2.4
1047#
1048# Example:
1049#
1050# -> { "execute": "migrate-set-parameters" ,
1051#      "arguments": { "compress-level": 1 } }
1052# <- { "return": {} }
1053##
1054{ 'command': 'migrate-set-parameters', 'boxed': true,
1055  'data': 'MigrateSetParameters' }
1056
1057##
1058# @MigrationParameters:
1059#
1060# The optional members aren't actually optional.
1061#
1062# @announce-initial: Initial delay (in milliseconds) before sending
1063#     the first announce (Since 4.0)
1064#
1065# @announce-max: Maximum delay (in milliseconds) between packets in
1066#     the announcement (Since 4.0)
1067#
1068# @announce-rounds: Number of self-announce packets sent after
1069#     migration (Since 4.0)
1070#
1071# @announce-step: Increase in delay (in milliseconds) between
1072#     subsequent packets in the announcement (Since 4.0)
1073#
1074# @compress-level: compression level
1075#
1076# @compress-threads: compression thread count
1077#
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)
1082#
1083# @decompress-threads: decompression thread count
1084#
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)
1088#
1089# @cpu-throttle-initial: Initial percentage of time guest cpus are
1090#     throttled when migration auto-converge is activated.  (Since
1091#     2.7)
1092#
1093# @cpu-throttle-increment: throttle percentage increase each time
1094#     auto-converge detects that migration is not making progress.
1095#     (Since 2.7)
1096#
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
1108#     5.1)
1109#
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.
1118#
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.
1127#
1128# @tls-authz: ID of the 'authz' object subclass that provides access
1129#     control checking of the TLS x509 certificate distinguished name.
1130#     (Since 4.0)
1131#
1132# @max-bandwidth: to set maximum speed for migration.  maximum speed
1133#     in bytes per second.  (Since 2.8)
1134#
1135# @downtime-limit: set maximum tolerated downtime for migration.
1136#     maximum downtime in milliseconds (Since 2.8)
1137#
1138# @x-checkpoint-delay: the delay time between two COLO checkpoints.
1139#     (Since 2.8)
1140#
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)
1147#
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)
1151#
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
1154#     (Since 2.11)
1155#
1156# @max-postcopy-bandwidth: Background transfer bandwidth during
1157#     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
1158#     (Since 3.0)
1159#
1160# @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
1161#     (Since 3.1)
1162#
1163# @multifd-compression: Which compression method to use.  Defaults to
1164#     none.  (Since 5.0)
1165#
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)
1171#
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)
1177#
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)
1193#
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)
1197#
1198# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
1199#                    Defaults to 1. (Since 8.1)
1200#
1201# Features:
1202#
1203# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
1204#            are experimental.
1205#
1206# Since: 2.4
1207##
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'} }
1240
1241##
1242# @query-migrate-parameters:
1243#
1244# Returns information about the current migration parameters
1245#
1246# Returns: @MigrationParameters
1247#
1248# Since: 2.4
1249#
1250# Example:
1251#
1252# -> { "execute": "query-migrate-parameters" }
1253# <- { "return": {
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
1261#       }
1262#    }
1263##
1264{ 'command': 'query-migrate-parameters',
1265  'returns': 'MigrationParameters' }
1266
1267##
1268# @migrate-start-postcopy:
1269#
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.
1273#
1274# Since: 2.5
1275#
1276# Example:
1277#
1278# -> { "execute": "migrate-start-postcopy" }
1279# <- { "return": {} }
1280##
1281{ 'command': 'migrate-start-postcopy' }
1282
1283##
1284# @MIGRATION:
1285#
1286# Emitted when a migration event happens
1287#
1288# @status: @MigrationStatus describing the current migration status.
1289#
1290# Since: 2.4
1291#
1292# Example:
1293#
1294# <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1295#     "event": "MIGRATION",
1296#     "data": {"status": "completed"} }
1297##
1298{ 'event': 'MIGRATION',
1299  'data': {'status': 'MigrationStatus'}}
1300
1301##
1302# @MIGRATION_PASS:
1303#
1304# Emitted from the source side of a migration at the start of each
1305# pass (when it syncs the dirty bitmap)
1306#
1307# @pass: An incrementing count (starting at 1 on the first pass)
1308#
1309# Since: 2.6
1310#
1311# Example:
1312#
1313# <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1314#       "event": "MIGRATION_PASS", "data": {"pass": 2} }
1315##
1316{ 'event': 'MIGRATION_PASS',
1317  'data': { 'pass': 'int' } }
1318
1319##
1320# @COLOMessage:
1321#
1322# The message transmission between Primary side and Secondary side.
1323#
1324# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1325#
1326# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for
1327#     checkpointing
1328#
1329# @checkpoint-reply: SVM gets PVM's checkpoint request
1330#
1331# @vmstate-send: VM's state will be sent by PVM.
1332#
1333# @vmstate-size: The total size of VMstate.
1334#
1335# @vmstate-received: VM's state has been received by SVM.
1336#
1337# @vmstate-loaded: VM's state has been loaded by SVM.
1338#
1339# Since: 2.8
1340##
1341{ 'enum': 'COLOMessage',
1342  'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1343            'vmstate-send', 'vmstate-size', 'vmstate-received',
1344            'vmstate-loaded' ] }
1345
1346##
1347# @COLOMode:
1348#
1349# The COLO current mode.
1350#
1351# @none: COLO is disabled.
1352#
1353# @primary: COLO node in primary side.
1354#
1355# @secondary: COLO node in slave side.
1356#
1357# Since: 2.8
1358##
1359{ 'enum': 'COLOMode',
1360  'data': [ 'none', 'primary', 'secondary'] }
1361
1362##
1363# @FailoverStatus:
1364#
1365# An enumeration of COLO failover status
1366#
1367# @none: no failover has ever happened
1368#
1369# @require: got failover requirement but not handled
1370#
1371# @active: in the process of doing failover
1372#
1373# @completed: finish the process of failover
1374#
1375# @relaunch: restart the failover process, from 'none' -> 'completed'
1376#     (Since 2.9)
1377#
1378# Since: 2.8
1379##
1380{ 'enum': 'FailoverStatus',
1381  'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1382
1383##
1384# @COLO_EXIT:
1385#
1386# Emitted when VM finishes COLO mode due to some errors happening or
1387# at the request of users.
1388#
1389# @mode: report COLO mode when COLO exited.
1390#
1391# @reason: describes the reason for the COLO exit.
1392#
1393# Since: 3.1
1394#
1395# Example:
1396#
1397# <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1398#      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1399##
1400{ 'event': 'COLO_EXIT',
1401  'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1402
1403##
1404# @COLOExitReason:
1405#
1406# The reason for a COLO exit.
1407#
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.
1411#
1412# @request: COLO exit is due to an external request.
1413#
1414# @error: COLO exit is due to an internal error.
1415#
1416# @processing: COLO is currently handling a failover (since 4.0).
1417#
1418# Since: 3.1
1419##
1420{ 'enum': 'COLOExitReason',
1421  'data': [ 'none', 'request', 'error' , 'processing' ] }
1422
1423##
1424# @x-colo-lost-heartbeat:
1425#
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
1430# the service VM.
1431#
1432# Features:
1433#
1434# @unstable: This command is experimental.
1435#
1436# Since: 2.8
1437#
1438# Example:
1439#
1440# -> { "execute": "x-colo-lost-heartbeat" }
1441# <- { "return": {} }
1442##
1443{ 'command': 'x-colo-lost-heartbeat',
1444  'features': [ 'unstable' ],
1445  'if': 'CONFIG_REPLICATION' }
1446
1447##
1448# @migrate_cancel:
1449#
1450# Cancel the current executing migration process.
1451#
1452# Returns: nothing on success
1453#
1454# Notes: This command succeeds even if there is no migration process
1455#     running.
1456#
1457# Since: 0.14
1458#
1459# Example:
1460#
1461# -> { "execute": "migrate_cancel" }
1462# <- { "return": {} }
1463##
1464{ 'command': 'migrate_cancel' }
1465
1466##
1467# @migrate-continue:
1468#
1469# Continue migration when it's in a paused state.
1470#
1471# @state: The state the migration is currently expected to be in
1472#
1473# Returns: nothing on success
1474#
1475# Since: 2.11
1476#
1477# Example:
1478#
1479# -> { "execute": "migrate-continue" , "arguments":
1480#      { "state": "pre-switchover" } }
1481# <- { "return": {} }
1482##
1483{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1484
1485##
1486# @migrate:
1487#
1488# Migrates the current running guest to another Virtual Machine.
1489#
1490# @uri: the Uniform Resource Identifier of the destination VM
1491#
1492# @blk: do block migration (full disk copy)
1493#
1494# @inc: incremental disk copy migration
1495#
1496# @detach: this argument exists only for compatibility reasons and is
1497#     ignored by QEMU
1498#
1499# @resume: resume one paused migration, default "off". (since 3.0)
1500#
1501# Returns: nothing on success
1502#
1503# Since: 0.14
1504#
1505# Notes:
1506#
1507# 1. The 'query-migrate' command should be used to check migration's
1508#    progress and final result (this information is provided by the
1509#    'status' member)
1510#
1511# 2. All boolean arguments default to false
1512#
1513# 3. The user Monitor's "detach" argument is invalid in QMP and should
1514#    not be used
1515#
1516# Example:
1517#
1518# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1519# <- { "return": {} }
1520##
1521{ 'command': 'migrate',
1522  'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1523           '*detach': 'bool', '*resume': 'bool' } }
1524
1525##
1526# @migrate-incoming:
1527#
1528# Start an incoming migration, the qemu must have been started with
1529# -incoming defer
1530#
1531# @uri: The Uniform Resource Identifier identifying the source or
1532#     address to listen on
1533#
1534# Returns: nothing on success
1535#
1536# Since: 2.3
1537#
1538# Notes:
1539#
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.
1543#
1544# 2. QEMU must be started with -incoming defer to allow
1545#    migrate-incoming to be used.
1546#
1547# 3. The uri format is the same as for -incoming
1548#
1549# Example:
1550#
1551# -> { "execute": "migrate-incoming",
1552#      "arguments": { "uri": "tcp::4446" } }
1553# <- { "return": {} }
1554##
1555{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1556
1557##
1558# @xen-save-devices-state:
1559#
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.
1562#
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
1565#     binary format.
1566#
1567# @live: Optional argument to ask QEMU to treat this command as part
1568#     of a live migration.  Default to true.  (since 2.11)
1569#
1570# Returns: Nothing on success
1571#
1572# Since: 1.1
1573#
1574# Example:
1575#
1576# -> { "execute": "xen-save-devices-state",
1577#      "arguments": { "filename": "/tmp/save" } }
1578# <- { "return": {} }
1579##
1580{ 'command': 'xen-save-devices-state',
1581  'data': {'filename': 'str', '*live':'bool' } }
1582
1583##
1584# @xen-set-global-dirty-log:
1585#
1586# Enable or disable the global dirty log mode.
1587#
1588# @enable: true to enable, false to disable.
1589#
1590# Returns: nothing
1591#
1592# Since: 1.3
1593#
1594# Example:
1595#
1596# -> { "execute": "xen-set-global-dirty-log",
1597#      "arguments": { "enable": true } }
1598# <- { "return": {} }
1599##
1600{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1601
1602##
1603# @xen-load-devices-state:
1604#
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.
1607#
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
1610#     binary format.
1611#
1612# Since: 2.7
1613#
1614# Example:
1615#
1616# -> { "execute": "xen-load-devices-state",
1617#      "arguments": { "filename": "/tmp/resume" } }
1618# <- { "return": {} }
1619##
1620{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1621
1622##
1623# @xen-set-replication:
1624#
1625# Enable or disable replication.
1626#
1627# @enable: true to enable, false to disable.
1628#
1629# @primary: true for primary or false for secondary.
1630#
1631# @failover: true to do failover, false to stop.  but cannot be
1632#     specified if 'enable' is true.  default value is false.
1633#
1634# Returns: nothing.
1635#
1636# Example:
1637#
1638# -> { "execute": "xen-set-replication",
1639#      "arguments": {"enable": true, "primary": false} }
1640# <- { "return": {} }
1641#
1642# Since: 2.9
1643##
1644{ 'command': 'xen-set-replication',
1645  'data': { 'enable': 'bool', 'primary': 'bool', '*failover': 'bool' },
1646  'if': 'CONFIG_REPLICATION' }
1647
1648##
1649# @ReplicationStatus:
1650#
1651# The result format for 'query-xen-replication-status'.
1652#
1653# @error: true if an error happened, false if replication is normal.
1654#
1655# @desc: the human readable error description string, when @error is
1656#     'true'.
1657#
1658# Since: 2.9
1659##
1660{ 'struct': 'ReplicationStatus',
1661  'data': { 'error': 'bool', '*desc': 'str' },
1662  'if': 'CONFIG_REPLICATION' }
1663
1664##
1665# @query-xen-replication-status:
1666#
1667# Query replication status while the vm is running.
1668#
1669# Returns: A @ReplicationStatus object showing the status.
1670#
1671# Example:
1672#
1673# -> { "execute": "query-xen-replication-status" }
1674# <- { "return": { "error": false } }
1675#
1676# Since: 2.9
1677##
1678{ 'command': 'query-xen-replication-status',
1679  'returns': 'ReplicationStatus',
1680  'if': 'CONFIG_REPLICATION' }
1681
1682##
1683# @xen-colo-do-checkpoint:
1684#
1685# Xen uses this command to notify replication to trigger a checkpoint.
1686#
1687# Returns: nothing.
1688#
1689# Example:
1690#
1691# -> { "execute": "xen-colo-do-checkpoint" }
1692# <- { "return": {} }
1693#
1694# Since: 2.9
1695##
1696{ 'command': 'xen-colo-do-checkpoint',
1697  'if': 'CONFIG_REPLICATION' }
1698
1699##
1700# @COLOStatus:
1701#
1702# The result format for 'query-colo-status'.
1703#
1704# @mode: COLO running mode.  If COLO is running, this field will
1705#     return 'primary' or 'secondary'.
1706#
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)
1710#
1711# @reason: describes the reason for the COLO exit.
1712#
1713# Since: 3.1
1714##
1715{ 'struct': 'COLOStatus',
1716  'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1717            'reason': 'COLOExitReason' },
1718  'if': 'CONFIG_REPLICATION' }
1719
1720##
1721# @query-colo-status:
1722#
1723# Query COLO status while the vm is running.
1724#
1725# Returns: A @COLOStatus object showing the status.
1726#
1727# Example:
1728#
1729# -> { "execute": "query-colo-status" }
1730# <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
1731#
1732# Since: 3.1
1733##
1734{ 'command': 'query-colo-status',
1735  'returns': 'COLOStatus',
1736  'if': 'CONFIG_REPLICATION' }
1737
1738##
1739# @migrate-recover:
1740#
1741# Provide a recovery migration stream URI.
1742#
1743# @uri: the URI to be used for the recovery of migration stream.
1744#
1745# Returns: nothing.
1746#
1747# Example:
1748#
1749# -> { "execute": "migrate-recover",
1750#      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1751# <- { "return": {} }
1752#
1753# Since: 3.0
1754##
1755{ 'command': 'migrate-recover',
1756  'data': { 'uri': 'str' },
1757  'allow-oob': true }
1758
1759##
1760# @migrate-pause:
1761#
1762# Pause a migration.  Currently it only supports postcopy.
1763#
1764# Returns: nothing.
1765#
1766# Example:
1767#
1768# -> { "execute": "migrate-pause" }
1769# <- { "return": {} }
1770#
1771# Since: 3.0
1772##
1773{ 'command': 'migrate-pause', 'allow-oob': true }
1774
1775##
1776# @UNPLUG_PRIMARY:
1777#
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.
1782#
1783# @device-id: QEMU device id of the unplugged device
1784#
1785# Since: 4.2
1786#
1787# Example:
1788#
1789# <- { "event": "UNPLUG_PRIMARY",
1790#      "data": { "device-id": "hostdev0" },
1791#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1792##
1793{ 'event': 'UNPLUG_PRIMARY',
1794  'data': { 'device-id': 'str' } }
1795
1796##
1797# @DirtyRateVcpu:
1798#
1799# Dirty rate of vcpu.
1800#
1801# @id: vcpu index.
1802#
1803# @dirty-rate: dirty rate.
1804#
1805# Since: 6.2
1806##
1807{ 'struct': 'DirtyRateVcpu',
1808  'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1809
1810##
1811# @DirtyRateStatus:
1812#
1813# Dirty page rate measurement status.
1814#
1815# @unstarted: measuring thread has not been started yet
1816#
1817# @measuring: measuring thread is running
1818#
1819# @measured: dirty page rate is measured and the results are available
1820#
1821# Since: 5.2
1822##
1823{ 'enum': 'DirtyRateStatus',
1824  'data': [ 'unstarted', 'measuring', 'measured'] }
1825
1826##
1827# @DirtyRateMeasureMode:
1828#
1829# Method used to measure dirty page rate.  Differences between
1830# available methods are explained in @calc-dirty-rate.
1831#
1832# @page-sampling: use page sampling
1833#
1834# @dirty-ring: use dirty ring
1835#
1836# @dirty-bitmap: use dirty bitmap
1837#
1838# Since: 6.2
1839##
1840{ 'enum': 'DirtyRateMeasureMode',
1841  'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
1842
1843##
1844# @DirtyRateInfo:
1845#
1846# Information about measured dirty page rate.
1847#
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'.
1850#
1851# @status: current status of dirty page rate measurements
1852#
1853# @start-time: start time in units of second for calculation
1854#
1855# @calc-time: time period for which dirty page rate was measured
1856#     (in seconds)
1857#
1858# @sample-pages: number of sampled pages per GiB of guest memory.
1859#     Valid only in page-sampling mode (Since 6.1)
1860#
1861# @mode: mode that was used to measure dirty page rate (Since 6.2)
1862#
1863# @vcpu-dirty-rate: dirty rate for each vCPU if dirty-ring mode was
1864#     specified (Since 6.2)
1865#
1866# Since: 5.2
1867##
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' ] } }
1876
1877##
1878# @calc-dirty-rate:
1879#
1880# Start measuring dirty page rate of the VM.  Results can be retrieved
1881# with @query-dirty-rate after measurements are completed.
1882#
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
1885# available:
1886#
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
1894#    overhead.
1895#
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*
1901#    set.
1902#
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.
1907#
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.
1914#
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)
1919#
1920# @mode: mechanism for tracking dirty pages.  Default value is
1921#     'page-sampling'.  Others are 'dirty-bitmap' and 'dirty-ring'.
1922#     (Since 6.1)
1923#
1924# Since: 5.2
1925#
1926# Example:
1927#
1928# -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
1929#                                                 'sample-pages': 512} }
1930# <- { "return": {} }
1931##
1932{ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
1933                                         '*sample-pages': 'int',
1934                                         '*mode': 'DirtyRateMeasureMode'} }
1935
1936##
1937# @query-dirty-rate:
1938#
1939# Query results of the most recent invocation of @calc-dirty-rate.
1940#
1941# Since: 5.2
1942#
1943# Examples:
1944#
1945# 1. Measurement is in progress:
1946#
1947# <- {"status": "measuring", "sample-pages": 512,
1948#     "mode": "page-sampling", "start-time": 3665220, "calc-time": 10}
1949#
1950# 2. Measurement has been completed:
1951#
1952# <- {"status": "measured", "sample-pages": 512, "dirty-rate": 108,
1953#     "mode": "page-sampling", "start-time": 3665220, "calc-time": 10}
1954##
1955{ 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1956
1957##
1958# @DirtyLimitInfo:
1959#
1960# Dirty page rate limit information of a virtual CPU.
1961#
1962# @cpu-index: index of a virtual CPU.
1963#
1964# @limit-rate: upper limit of dirty page rate (MB/s) for a virtual
1965#     CPU, 0 means unlimited.
1966#
1967# @current-rate: current dirty page rate (MB/s) for a virtual CPU.
1968#
1969# Since: 7.1
1970##
1971{ 'struct': 'DirtyLimitInfo',
1972  'data': { 'cpu-index': 'int',
1973            'limit-rate': 'uint64',
1974            'current-rate': 'uint64' } }
1975
1976##
1977# @set-vcpu-dirty-limit:
1978#
1979# Set the upper limit of dirty page rate for virtual CPUs.
1980#
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.
1984#
1985# @cpu-index: index of a virtual CPU, default is all.
1986#
1987# @dirty-rate: upper limit of dirty page rate (MB/s) for virtual CPUs.
1988#
1989# Since: 7.1
1990#
1991# Example:
1992#
1993# -> {"execute": "set-vcpu-dirty-limit"}
1994#     "arguments": { "dirty-rate": 200,
1995#                    "cpu-index": 1 } }
1996# <- { "return": {} }
1997##
1998{ 'command': 'set-vcpu-dirty-limit',
1999  'data': { '*cpu-index': 'int',
2000            'dirty-rate': 'uint64' } }
2001
2002##
2003# @cancel-vcpu-dirty-limit:
2004#
2005# Cancel the upper limit of dirty page rate for virtual CPUs.
2006#
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".
2010#
2011# @cpu-index: index of a virtual CPU, default is all.
2012#
2013# Since: 7.1
2014#
2015# Example:
2016#
2017# -> {"execute": "cancel-vcpu-dirty-limit"},
2018#     "arguments": { "cpu-index": 1 } }
2019# <- { "return": {} }
2020##
2021{ 'command': 'cancel-vcpu-dirty-limit',
2022  'data': { '*cpu-index': 'int'} }
2023
2024##
2025# @query-vcpu-dirty-limit:
2026#
2027# Returns information about virtual CPU dirty page rate limits, if
2028# any.
2029#
2030# Since: 7.1
2031#
2032# Example:
2033#
2034# -> {"execute": "query-vcpu-dirty-limit"}
2035# <- {"return": [
2036#        { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
2037#        { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
2038##
2039{ 'command': 'query-vcpu-dirty-limit',
2040  'returns': [ 'DirtyLimitInfo' ] }
2041
2042##
2043# @MigrationThreadInfo:
2044#
2045# Information about migrationthreads
2046#
2047# @name: the name of migration thread
2048#
2049# @thread-id: ID of the underlying host thread
2050#
2051# Since: 7.2
2052##
2053{ 'struct': 'MigrationThreadInfo',
2054  'data': {'name': 'str',
2055           'thread-id': 'int'} }
2056
2057##
2058# @query-migrationthreads:
2059#
2060# Returns information of migration threads
2061#
2062# data: migration thread name
2063#
2064# Returns: information about migration threads
2065#
2066# Since: 7.2
2067##
2068{ 'command': 'query-migrationthreads',
2069  'returns': ['MigrationThreadInfo'] }
2070
2071##
2072# @snapshot-save:
2073#
2074# Save a VM snapshot
2075#
2076# @job-id: identifier for the newly created job
2077#
2078# @tag: name of the snapshot to create
2079#
2080# @vmstate: block device node name to save vmstate to
2081#
2082# @devices: list of block device node names to save a snapshot to
2083#
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
2087# arise.
2088#
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.
2092#
2093# It is strongly recommended that @devices contain all writable block
2094# device nodes if a consistent snapshot is required.
2095#
2096# If @tag already exists, an error will be reported
2097#
2098# Returns: nothing
2099#
2100# Example:
2101#
2102# -> { "execute": "snapshot-save",
2103#      "arguments": {
2104#         "job-id": "snapsave0",
2105#         "tag": "my-snap",
2106#         "vmstate": "disk0",
2107#         "devices": ["disk0", "disk1"]
2108#      }
2109#    }
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"}]}
2136#
2137# Since: 6.0
2138##
2139{ 'command': 'snapshot-save',
2140  'data': { 'job-id': 'str',
2141            'tag': 'str',
2142            'vmstate': 'str',
2143            'devices': ['str'] } }
2144
2145##
2146# @snapshot-load:
2147#
2148# Load a VM snapshot
2149#
2150# @job-id: identifier for the newly created job
2151#
2152# @tag: name of the snapshot to load.
2153#
2154# @vmstate: block device node name to load vmstate from
2155#
2156# @devices: list of block device node names to load a snapshot from
2157#
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
2161# arise.
2162#
2163# Note that execution of the guest CPUs will be stopped during the
2164# time it takes to load the snapshot.
2165#
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.
2169#
2170# Returns: nothing
2171#
2172# Example:
2173#
2174# -> { "execute": "snapshot-load",
2175#      "arguments": {
2176#         "job-id": "snapload0",
2177#         "tag": "my-snap",
2178#         "vmstate": "disk0",
2179#         "devices": ["disk0", "disk1"]
2180#      }
2181#    }
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"}]}
2208#
2209# Since: 6.0
2210##
2211{ 'command': 'snapshot-load',
2212  'data': { 'job-id': 'str',
2213            'tag': 'str',
2214            'vmstate': 'str',
2215            'devices': ['str'] } }
2216
2217##
2218# @snapshot-delete:
2219#
2220# Delete a VM snapshot
2221#
2222# @job-id: identifier for the newly created job
2223#
2224# @tag: name of the snapshot to delete.
2225#
2226# @devices: list of block device node names to delete a snapshot from
2227#
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
2231# arise.
2232#
2233# Returns: nothing
2234#
2235# Example:
2236#
2237# -> { "execute": "snapshot-delete",
2238#      "arguments": {
2239#         "job-id": "snapdelete0",
2240#         "tag": "my-snap",
2241#         "devices": ["disk0", "disk1"]
2242#      }
2243#    }
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"}]}
2266#
2267# Since: 6.0
2268##
2269{ 'command': 'snapshot-delete',
2270  'data': { 'job-id': 'str',
2271            'tag': 'str',
2272            'devices': ['str'] } }
2273