]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/migration.json
migration: Add tracepoints for downtime checkpoints
[mirror_qemu.git] / qapi / migration.json
CommitLineData
48685a8e 1# -*- Mode: Python -*-
f7160f32 2# vim: filetype=python
48685a8e
MA
3#
4
5##
6# = Migration
7##
8
9{ 'include': 'common.json' }
9aca82ba 10{ 'include': 'sockets.json' }
48685a8e
MA
11
12##
13# @MigrationStats:
14#
15# Detailed migration status.
16#
17# @transferred: amount of bytes already transferred to the target VM
18#
a937b6aa
MA
19# @remaining: amount of bytes remaining to be transferred to the
20# target VM
48685a8e
MA
21#
22# @total: total amount of bytes involved in the migration process
23#
24# @duplicate: number of duplicate (zero) pages (since 1.2)
25#
7b24d326
JQ
26# @skipped: number of skipped zero pages. Always zero, only provided for
27# compatibility (since 1.5)
48685a8e
MA
28#
29# @normal: number of normal pages (since 1.2)
30#
31# @normal-bytes: number of normal bytes sent (since 1.2)
32#
a937b6aa
MA
33# @dirty-pages-rate: number of pages dirtied by second by the guest
34# (since 1.3)
48685a8e 35#
a937b6aa 36# @mbps: throughput in megabits/sec. (since 1.6)
48685a8e 37#
a937b6aa
MA
38# @dirty-sync-count: number of times that dirty ram was synchronized
39# (since 2.1)
48685a8e 40#
a937b6aa
MA
41# @postcopy-requests: The number of page requests received from the
42# destination (since 2.7)
48685a8e
MA
43#
44# @page-size: The number of bytes per page for the various page-based
a937b6aa 45# statistics (since 2.10)
48685a8e 46#
a61c45bd
JQ
47# @multifd-bytes: The number of bytes sent through multifd (since 3.0)
48#
aecbfe9c 49# @pages-per-second: the number of memory pages transferred per second
a937b6aa 50# (Since 4.0)
aecbfe9c 51#
ae680668 52# @precopy-bytes: The number of bytes sent in the pre-copy phase
a937b6aa 53# (since 7.0).
ae680668
DE
54#
55# @downtime-bytes: The number of bytes sent while the guest is paused
a937b6aa 56# (since 7.0).
ae680668
DE
57#
58# @postcopy-bytes: The number of bytes sent during the post-copy phase
a937b6aa
MA
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)
ae680668 65#
7b24d326
JQ
66# Features:
67#
68# @deprecated: Member @skipped is always zero since 1.5.3
69#
9bc6e893 70# Since: 0.14
7b24d326 71#
48685a8e
MA
72##
73{ 'struct': 'MigrationStats',
74 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
7b24d326 75 'duplicate': 'int',
e4ceec29 76 'skipped': { 'type': 'int', 'features': [ 'deprecated' ] },
7b24d326 77 'normal': 'int',
fd658a7b
JQ
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' } }
48685a8e
MA
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#
e460a4b1
WW
101# @encoding-rate: rate of encoded bytes (since 5.1)
102#
48685a8e
MA
103# @overflow: number of overflows
104#
105# Since: 1.2
106##
107{ 'struct': 'XBZRLECacheStats',
8b9407a0 108 'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
48685a8e 109 'cache-miss': 'int', 'cache-miss-rate': 'number',
e460a4b1 110 'encoding-rate': 'number', 'overflow': 'int' } }
48685a8e 111
76e03000
XG
112##
113# @CompressionStats:
114#
115# Detailed migration compression statistics
116#
117# @pages: amount of pages compressed and transferred to the target VM
118#
a937b6aa
MA
119# @busy: count of times that no free thread was available to compress
120# data
76e03000
XG
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',
dbb28bc8 132 'compressed-size': 'int', 'compression-rate': 'number' } }
76e03000 133
48685a8e
MA
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#
a937b6aa
MA
149# @postcopy-active: like active, but now in postcopy mode. (since
150# 2.5)
48685a8e 151#
a937b6aa 152# @postcopy-paused: during postcopy but paused. (since 3.0)
a688d2c1 153#
a937b6aa
MA
154# @postcopy-recover: trying to recover from a paused postcopy. (since
155# 3.0)
135b87b4 156#
48685a8e
MA
157# @completed: migration is finished.
158#
159# @failed: some error occurred during migration process.
160#
a937b6aa
MA
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)
48685a8e 164#
a937b6aa 165# @pre-switchover: Paused before device serialisation. (since 2.11)
31e06077 166#
a937b6aa
MA
167# @device: During device serialisation when pause-before-switchover is
168# enabled (since 2.11)
31e06077 169#
a937b6aa
MA
170# @wait-unplug: wait for device unplug request by guest OS to be
171# completed. (since 4.2)
c7e0acd5 172#
48685a8e 173# Since: 2.3
48685a8e
MA
174##
175{ 'enum': 'MigrationStatus',
176 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
a688d2c1 177 'active', 'postcopy-active', 'postcopy-paused',
135b87b4 178 'postcopy-recover', 'completed', 'failed', 'colo',
c7e0acd5 179 'pre-switchover', 'device', 'wait-unplug' ] }
3710586c
KW
180##
181# @VfioStats:
182#
183# Detailed VFIO devices migration statistics
184#
a937b6aa
MA
185# @transferred: amount of bytes transferred to the target VM by VFIO
186# devices
3710586c
KW
187#
188# Since: 5.2
3710586c
KW
189##
190{ 'struct': 'VfioStats',
191 'data': {'transferred': 'int' } }
48685a8e
MA
192
193##
194# @MigrationInfo:
195#
196# Information about current migration process.
197#
198# @status: @MigrationStatus describing the current migration status.
a937b6aa
MA
199# If this field is not returned, no migration process has been
200# initiated
48685a8e 201#
a937b6aa
MA
202# @ram: @MigrationStats containing detailed migration status, only
203# returned if status is 'active' or 'completed'(since 1.2)
48685a8e 204#
a937b6aa
MA
205# @disk: @MigrationStats containing detailed disk migration status,
206# only returned if status is 'active' and it is a block migration
48685a8e
MA
207#
208# @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
a937b6aa
MA
209# migration statistics, only returned if XBZRLE feature is on and
210# status is 'active' or 'completed' (since 1.2)
48685a8e
MA
211#
212# @total-time: total amount of milliseconds since migration started.
a937b6aa
MA
213# If migration has ended, it returns the total migration time.
214# (since 1.2)
48685a8e 215#
a937b6aa
MA
216# @downtime: only present when migration finishes correctly total
217# downtime in milliseconds for the guest. (since 1.3)
48685a8e 218#
a937b6aa
MA
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)
48685a8e 222#
a660eed4 223# @setup-time: amount of setup time in milliseconds *before* the
a937b6aa
MA
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)
48685a8e
MA
228#
229# @cpu-throttle-percentage: percentage of time guest cpus are being
a937b6aa
MA
230# throttled during auto-converge. This is only present when
231# auto-converge has started throttling guest cpus. (Since 2.7)
48685a8e 232#
c94143e5
PX
233# @error-desc: the human readable error description string. Clients
234# should not attempt to parse the error strings. (Since 2.7)
65ace060 235#
a937b6aa
MA
236# @postcopy-blocktime: total time when all vCPU were blocked during
237# postcopy live migration. This is only present when the
238# postcopy-blocktime migration capability is enabled. (Since 3.0)
65ace060 239#
a937b6aa
MA
240# @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.
241# This is only present when the postcopy-blocktime migration
242# capability is enabled. (Since 3.0)
65ace060 243#
a937b6aa
MA
244# @compression: migration compression statistics, only returned if
245# compression feature is on and status is 'active' or 'completed'
246# (Since 3.1)
48685a8e 247#
a937b6aa
MA
248# @socket-address: Only used for tcp, to know what the real port is
249# (Since 4.0)
9aca82ba 250#
a937b6aa
MA
251# @vfio: @VfioStats containing detailed VFIO devices migration
252# statistics, only returned if VFIO device is present, migration
253# is supported by all VFIO devices and status is 'active' or
254# 'completed' (since 5.2)
3710586c 255#
a937b6aa
MA
256# @blocked-reasons: A list of reasons an outgoing migration is
257# blocked. Present and non-empty when migration is blocked.
258# (since 6.0)
e11ce6c0 259#
8abc8115
HH
260# @dirty-limit-throttle-time-per-round: Maximum throttle time
261# (in microseconds) of virtual CPUs each dirty ring full round,
262# which shows how MigrationCapability dirty-limit affects the
263# guest during live migration. (Since 8.1)
264#
265# @dirty-limit-ring-full-time: Estimated average dirty ring full time
266# (in microseconds) for each dirty ring full round. The value
267# equals the dirty ring memory size divided by the average dirty
268# page rate of the virtual CPU, which can be used to observe the
269# average memory load of the virtual CPU indirectly. Note that
270# zero means guest doesn't dirty memory. (Since 8.1)
15699cf5 271#
66db46ca
JQ
272# Features:
273#
274# @deprecated: Member @disk is deprecated because block migration is.
864128df
JQ
275# Member @compression is deprecated because it is unreliable and
276# untested. It is recommended to use multifd migration, which
277# offers an alternative compression implementation that is
278# reliable and tested.
66db46ca 279#
9bc6e893 280# Since: 0.14
48685a8e
MA
281##
282{ 'struct': 'MigrationInfo',
283 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
66db46ca 284 '*disk': { 'type': 'MigrationStats', 'features': [ 'deprecated' ] },
3710586c 285 '*vfio': 'VfioStats',
48685a8e
MA
286 '*xbzrle-cache': 'XBZRLECacheStats',
287 '*total-time': 'int',
288 '*expected-downtime': 'int',
289 '*downtime': 'int',
290 '*setup-time': 'int',
291 '*cpu-throttle-percentage': 'int',
65ace060 292 '*error-desc': 'str',
3af8554b 293 '*blocked-reasons': ['str'],
fd658a7b 294 '*postcopy-blocktime': 'uint32',
76e03000 295 '*postcopy-vcpu-blocktime': ['uint32'],
864128df 296 '*compression': { 'type': 'CompressionStats', 'features': [ 'deprecated' ] },
15699cf5
HH
297 '*socket-address': ['SocketAddress'],
298 '*dirty-limit-throttle-time-per-round': 'uint64',
299 '*dirty-limit-ring-full-time': 'uint64'} }
48685a8e
MA
300
301##
302# @query-migrate:
303#
a937b6aa 304# Returns information about current migration process. If migration
48685a8e
MA
305# is active there will be another json-object with RAM migration
306# status and if block migration is active another one with block
307# migration status.
308#
309# Returns: @MigrationInfo
310#
9bc6e893 311# Since: 0.14
48685a8e 312#
37fa48a4 313# Examples:
48685a8e
MA
314#
315# 1. Before the first migration
316#
317# -> { "execute": "query-migrate" }
318# <- { "return": {} }
319#
320# 2. Migration is done and has succeeded
321#
322# -> { "execute": "query-migrate" }
323# <- { "return": {
324# "status": "completed",
be1d2c49 325# "total-time":12345,
326# "setup-time":12345,
327# "downtime":12345,
48685a8e
MA
328# "ram":{
329# "transferred":123,
330# "remaining":123,
331# "total":246,
48685a8e
MA
332# "duplicate":123,
333# "normal":123,
334# "normal-bytes":123456,
335# "dirty-sync-count":15
336# }
337# }
338# }
339#
340# 3. Migration is done and has failed
341#
342# -> { "execute": "query-migrate" }
343# <- { "return": { "status": "failed" } }
344#
345# 4. Migration is being performed and is not a block migration:
346#
347# -> { "execute": "query-migrate" }
348# <- {
349# "return":{
350# "status":"active",
be1d2c49 351# "total-time":12345,
352# "setup-time":12345,
353# "expected-downtime":12345,
48685a8e
MA
354# "ram":{
355# "transferred":123,
356# "remaining":123,
357# "total":246,
48685a8e
MA
358# "duplicate":123,
359# "normal":123,
360# "normal-bytes":123456,
361# "dirty-sync-count":15
362# }
363# }
364# }
365#
366# 5. Migration is being performed and is a block migration:
367#
368# -> { "execute": "query-migrate" }
369# <- {
370# "return":{
371# "status":"active",
be1d2c49 372# "total-time":12345,
373# "setup-time":12345,
374# "expected-downtime":12345,
48685a8e
MA
375# "ram":{
376# "total":1057024,
377# "remaining":1053304,
378# "transferred":3720,
48685a8e
MA
379# "duplicate":123,
380# "normal":123,
381# "normal-bytes":123456,
382# "dirty-sync-count":15
383# },
384# "disk":{
385# "total":20971520,
386# "remaining":20880384,
387# "transferred":91136
388# }
389# }
390# }
391#
392# 6. Migration is being performed and XBZRLE is active:
393#
394# -> { "execute": "query-migrate" }
395# <- {
396# "return":{
397# "status":"active",
be1d2c49 398# "total-time":12345,
399# "setup-time":12345,
400# "expected-downtime":12345,
48685a8e
MA
401# "ram":{
402# "total":1057024,
403# "remaining":1053304,
404# "transferred":3720,
48685a8e
MA
405# "duplicate":10,
406# "normal":3333,
407# "normal-bytes":3412992,
408# "dirty-sync-count":15
409# },
410# "xbzrle-cache":{
411# "cache-size":67108864,
412# "bytes":20971520,
413# "pages":2444343,
414# "cache-miss":2244,
415# "cache-miss-rate":0.123,
e460a4b1 416# "encoding-rate":80.1,
48685a8e
MA
417# "overflow":34434
418# }
419# }
420# }
48685a8e
MA
421##
422{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
423
424##
425# @MigrationCapability:
426#
427# Migration capabilities enumeration
428#
a937b6aa
MA
429# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length
430# Encoding). This feature allows us to minimize migration traffic
431# for certain work loads, by sending compressed difference of the
432# pages
433#
434# @rdma-pin-all: Controls whether or not the entire VM memory
435# footprint is mlock()'d on demand or all at once. Refer to
436# docs/rdma.txt for usage. Disabled by default. (since 2.0)
437#
438# @zero-blocks: During storage migration encode blocks of zeroes
439# efficiently. This essentially saves 1MB of zeroes per block on
440# the wire. Enabling requires source and target VM to support
441# this feature. To enable it is sufficient to enable the
442# capability on the source VM. The feature is disabled by default.
443# (since 1.6)
444#
445# @compress: Use multiple compression threads to accelerate live
446# migration. This feature can help to reduce the migration
447# traffic, by sending compressed pages. Please note that if
448# compress and xbzrle are both on, compress only takes effect in
449# the ram bulk stage, after that, it will be disabled and only
450# xbzrle takes effect, this can help to minimize migration
e4ceec29 451# traffic. The feature is disabled by default. (since 2.4)
a937b6aa 452#
e4ceec29 453# @events: generate events for each migration state change (since 2.4)
a937b6aa
MA
454#
455# @auto-converge: If enabled, QEMU will automatically throttle down
456# the guest to speed up convergence of RAM migration. (since 1.6)
457#
458# @postcopy-ram: Start executing on the migration target before all of
459# RAM has been migrated, pulling the remaining pages along as
460# needed. The capacity must have the same setting on both source
461# and target or migration will not even start. NOTE: If the
462# migration fails during postcopy the VM will fail. (since 2.6)
463#
464# @x-colo: If enabled, migration will never end, and the state of the
465# VM on the primary side will be migrated continuously to the VM
466# on secondary side, this process is called COarse-Grain LOck
467# Stepping (COLO) for Non-stop Service. (since 2.8)
468#
469# @release-ram: if enabled, qemu will free the migrated ram pages on
470# the source during postcopy-ram migration. (since 2.9)
48685a8e
MA
471#
472# @block: If enabled, QEMU will also migrate the contents of all block
a937b6aa
MA
473# devices. Default is disabled. A possible alternative uses
474# mirror jobs to a builtin NBD server on the destination, which
475# offers more flexibility. (Since 2.10)
48685a8e
MA
476#
477# @return-path: If enabled, migration will use the return path even
a937b6aa 478# for precopy. (since 2.10)
48685a8e 479#
a937b6aa
MA
480# @pause-before-switchover: Pause outgoing migration before
481# serialising device state and before disabling block IO (since
482# 2.11)
93fbd031 483#
cbfd6c95 484# @multifd: Use more than one fd for migration (since 4.0)
30126bbf 485#
55efc8c2 486# @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
a937b6aa 487# (since 2.12)
55efc8c2 488#
f22f928e 489# @postcopy-blocktime: Calculate downtime for postcopy live migration
a937b6aa 490# (since 3.0)
f22f928e 491#
a937b6aa
MA
492# @late-block-activate: If enabled, the destination will not activate
493# block devices (and thus take locks) immediately at the end of
494# migration. (since 3.0)
0f073f44 495#
9e272073
MA
496# @x-ignore-shared: If enabled, QEMU will not migrate shared memory
497# that is accessible on the destination machine. (since 4.0)
18269069 498#
b9d68df6 499# @validate-uuid: Send the UUID of the source to allow the destination
a937b6aa
MA
500# to ensure it is the same. (since 4.2)
501#
502# @background-snapshot: If enabled, the migration stream will be a
503# snapshot of the VM exactly at the point when the migration
504# procedure starts. The VM RAM is saved with running VM. (since
505# 6.0)
506#
507# @zero-copy-send: Controls behavior on sending memory pages on
508# migration. When true, enables a zero-copy mechanism for sending
509# memory pages, if host supports it. Requires that QEMU be
510# permitted to use locked memory for guest RAM pages. (since 7.1)
511#
512# @postcopy-preempt: If enabled, the migration process will allow
513# postcopy requests to preempt precopy stream, so postcopy
514# requests will be handled faster. This is a performance feature
515# and should not affect the correctness of postcopy migration.
516# (since 7.1)
1abaec9a 517#
6574232f
AH
518# @switchover-ack: If enabled, migration will not stop the source VM
519# and complete the migration until an ACK is received from the
520# destination that it's OK to do so. Exactly when this ACK is
9e272073
MA
521# sent depends on the migrated devices that use this feature. For
522# example, a device can use it to make sure some of its data is
523# sent and loaded in the destination before doing switchover.
6574232f
AH
524# This can reduce downtime if devices that support this capability
525# are present. 'return-path' capability must be enabled to use
526# it. (since 8.1)
527#
ef965377
HH
528# @dirty-limit: If enabled, migration will throttle vCPUs as needed to
529# keep their dirty page rate within @vcpu-dirty-limit. This can
530# improve responsiveness of large guests during live migration,
531# and can result in more stable read performance. Requires KVM
532# with accelerator property "dirty-ring-size" set. (Since 8.1)
dc623955 533#
9fb49daa 534# Features:
a937b6aa 535#
66db46ca 536# @deprecated: Member @block is deprecated. Use blockdev-mirror with
864128df
JQ
537# NBD instead. Member @compression is deprecated because it is
538# unreliable and untested. It is recommended to use multifd
539# migration, which offers an alternative compression
540# implementation that is reliable and tested.
66db46ca 541#
9fb49daa
MA
542# @unstable: Members @x-colo and @x-ignore-shared are experimental.
543#
48685a8e
MA
544# Since: 1.2
545##
546{ 'enum': 'MigrationCapability',
547 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
864128df
JQ
548 { 'name': 'compress', 'features': [ 'deprecated' ] },
549 'events', 'postcopy-ram',
9fb49daa
MA
550 { 'name': 'x-colo', 'features': [ 'unstable' ] },
551 'release-ram',
66db46ca
JQ
552 { 'name': 'block', 'features': [ 'deprecated' ] },
553 'return-path', 'pause-before-switchover', 'multifd',
18269069 554 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
9fb49daa 555 { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
1abaec9a 556 'validate-uuid', 'background-snapshot',
dc623955
HH
557 'zero-copy-send', 'postcopy-preempt', 'switchover-ack',
558 'dirty-limit'] }
48685a8e
MA
559
560##
561# @MigrationCapabilityStatus:
562#
563# Migration capability information
564#
565# @capability: capability enum
566#
567# @state: capability state bool
568#
569# Since: 1.2
570##
571{ 'struct': 'MigrationCapabilityStatus',
fd658a7b 572 'data': { 'capability': 'MigrationCapability', 'state': 'bool' } }
48685a8e
MA
573
574##
575# @migrate-set-capabilities:
576#
577# Enable/Disable the following migration capabilities (like xbzrle)
578#
579# @capabilities: json array of capability modifications to make
580#
581# Since: 1.2
582#
583# Example:
584#
585# -> { "execute": "migrate-set-capabilities" , "arguments":
586# { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
37fa48a4 587# <- { "return": {} }
48685a8e
MA
588##
589{ 'command': 'migrate-set-capabilities',
590 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
591
592##
593# @query-migrate-capabilities:
594#
595# Returns information about the current migration capabilities status
596#
d93ed1bd 597# Returns: @MigrationCapabilityStatus
48685a8e
MA
598#
599# Since: 1.2
600#
601# Example:
602#
603# -> { "execute": "query-migrate-capabilities" }
604# <- { "return": [
605# {"state": false, "capability": "xbzrle"},
606# {"state": false, "capability": "rdma-pin-all"},
607# {"state": false, "capability": "auto-converge"},
608# {"state": false, "capability": "zero-blocks"},
609# {"state": false, "capability": "compress"},
610# {"state": true, "capability": "events"},
611# {"state": false, "capability": "postcopy-ram"},
612# {"state": false, "capability": "x-colo"}
613# ]}
48685a8e
MA
614##
615{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
616
96eef042
JQ
617##
618# @MultiFDCompression:
619#
620# An enumeration of multifd compression methods.
621#
622# @none: no compression.
a937b6aa 623#
7ec2c2b3 624# @zlib: use zlib compression method.
a937b6aa 625#
87dc6f5f 626# @zstd: use zstd compression method.
96eef042
JQ
627#
628# Since: 5.0
96eef042
JQ
629##
630{ 'enum': 'MultiFDCompression',
87dc6f5f 631 'data': [ 'none', 'zlib',
8a9f1e1d 632 { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
96eef042 633
6e9f21a2
PK
634##
635# @BitmapMigrationBitmapAliasTransform:
636#
a937b6aa
MA
637# @persistent: If present, the bitmap will be made persistent or
638# transient depending on this parameter.
6e9f21a2
PK
639#
640# Since: 6.0
641##
642{ 'struct': 'BitmapMigrationBitmapAliasTransform',
643 'data': {
644 '*persistent': 'bool'
645 } }
646
31e4c354
HR
647##
648# @BitmapMigrationBitmapAlias:
649#
650# @name: The name of the bitmap.
651#
652# @alias: An alias name for migration (for example the bitmap name on
a937b6aa 653# the opposite site).
31e4c354 654#
a937b6aa
MA
655# @transform: Allows the modification of the migrated bitmap. (since
656# 6.0)
6e9f21a2 657#
31e4c354
HR
658# Since: 5.2
659##
660{ 'struct': 'BitmapMigrationBitmapAlias',
661 'data': {
662 'name': 'str',
6e9f21a2
PK
663 'alias': 'str',
664 '*transform': 'BitmapMigrationBitmapAliasTransform'
31e4c354
HR
665 } }
666
667##
668# @BitmapMigrationNodeAlias:
669#
670# Maps a block node name and the bitmaps it has to aliases for dirty
671# bitmap migration.
672#
673# @node-name: A block node name.
674#
a937b6aa
MA
675# @alias: An alias block node name for migration (for example the node
676# name on the opposite site).
31e4c354
HR
677#
678# @bitmaps: Mappings for the bitmaps on this node.
679#
680# Since: 5.2
681##
682{ 'struct': 'BitmapMigrationNodeAlias',
683 'data': {
684 'node-name': 'str',
685 'alias': 'str',
686 'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
687 } }
688
48685a8e
MA
689##
690# @MigrationParameter:
691#
692# Migration parameters enumeration
693#
a937b6aa
MA
694# @announce-initial: Initial delay (in milliseconds) before sending
695# the first announce (Since 4.0)
ee3d96ba 696#
a937b6aa
MA
697# @announce-max: Maximum delay (in milliseconds) between packets in
698# the announcement (Since 4.0)
ee3d96ba 699#
a937b6aa
MA
700# @announce-rounds: Number of self-announce packets sent after
701# migration (Since 4.0)
ee3d96ba 702#
a937b6aa
MA
703# @announce-step: Increase in delay (in milliseconds) between
704# subsequent packets in the announcement (Since 4.0)
ee3d96ba 705#
a937b6aa
MA
706# @compress-level: Set the compression level to be used in live
707# migration, the compression level is an integer between 0 and 9,
708# where 0 means no compression, 1 means the best compression
709# speed, and 9 means best compression ratio which will consume
710# more CPU.
48685a8e 711#
a937b6aa
MA
712# @compress-threads: Set compression thread count to be used in live
713# migration, the compression thread count is an integer between 1
714# and 255.
48685a8e 715#
a937b6aa
MA
716# @compress-wait-thread: Controls behavior when all compression
717# threads are currently busy. If true (default), wait for a free
718# compression thread to become available; otherwise, send the page
719# uncompressed. (Since 3.1)
1d58872a 720#
a937b6aa
MA
721# @decompress-threads: Set decompression thread count to be used in
722# live migration, the decompression thread count is an integer
723# between 1 and 255. Usually, decompression is at least 4 times as
724# fast as compression, so set the decompress-threads to the number
725# about 1/4 of compress-threads is adequate.
48685a8e 726#
a937b6aa
MA
727# @throttle-trigger-threshold: The ratio of bytes_dirty_period and
728# bytes_xfer_period to trigger throttling. It is expressed as
729# percentage. The default value is 50. (Since 5.0)
dc14a470 730#
a937b6aa
MA
731# @cpu-throttle-initial: Initial percentage of time guest cpus are
732# throttled when migration auto-converge is activated. The
733# default value is 20. (Since 2.7)
48685a8e
MA
734#
735# @cpu-throttle-increment: throttle percentage increase each time
a937b6aa
MA
736# auto-converge detects that migration is not making progress.
737# The default value is 10. (Since 2.7)
738#
739# @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
740# the tail stage of throttling, the Guest is very sensitive to CPU
741# percentage while the @cpu-throttle -increment is excessive
742# usually at tail stage. If this parameter is true, we will
743# compute the ideal CPU percentage used by the Guest, which may
744# exactly make the dirty rate match the dirty rate threshold.
745# Then we will choose a smaller throttle increment between the one
746# specified by @cpu-throttle-increment and the one generated by
747# ideal CPU percentage. Therefore, it is compatible to
748# traditional throttling, meanwhile the throttle increment won't
749# be excessive at tail stage. The default value is false. (Since
750# 5.1)
751#
752# @tls-creds: ID of the 'tls-creds' object that provides credentials
753# for establishing a TLS connection over the migration data
754# channel. On the outgoing side of the migration, the credentials
755# must be for a 'client' endpoint, while for the incoming side the
756# credentials must be for a 'server' endpoint. Setting this will
757# enable TLS for all migrations. The default is unset, resulting
758# in unsecured migration at the QEMU level. (Since 2.7)
759#
760# @tls-hostname: hostname of the target host for the migration. This
761# is required when using x509 based TLS credentials and the
762# migration URI does not already include a hostname. For example
763# if using fd: or exec: based migration, the hostname must be
764# provided so that the server's x509 certificate identity can be
765# validated. (Since 2.7)
766#
767# @tls-authz: ID of the 'authz' object subclass that provides access
768# control checking of the TLS x509 certificate distinguished name.
769# This object is only resolved at time of use, so can be deleted
770# and recreated on the fly while the migration server is active.
771# If missing, it will default to denying access (Since 4.0)
772#
773# @max-bandwidth: to set maximum speed for migration. maximum speed
774# in bytes per second. (Since 2.8)
775#
8b239597
PX
776# @avail-switchover-bandwidth: to set the available bandwidth that
777# migration can use during switchover phase. NOTE! This does not
778# limit the bandwidth during switchover, but only for calculations when
779# making decisions to switchover. By default, this value is zero,
780# which means QEMU will estimate the bandwidth automatically. This can
781# be set when the estimated value is not accurate, while the user is
782# able to guarantee such bandwidth is available when switching over.
783# When specified correctly, this can make the switchover decision much
784# more accurate. (Since 8.2)
785#
a937b6aa
MA
786# @downtime-limit: set maximum tolerated downtime for migration.
787# maximum downtime in milliseconds (Since 2.8)
788#
789# @x-checkpoint-delay: The delay time (in ms) between two COLO
790# checkpoints in periodic mode. (Since 2.8)
48685a8e
MA
791#
792# @block-incremental: Affects how much storage is migrated when the
a937b6aa
MA
793# block migration capability is enabled. When false, the entire
794# storage backing chain is migrated into a flattened image at the
795# destination; when true, only the active qcow2 layer is migrated
796# and the destination must already have access to the same backing
797# chain as was used on the source. (since 2.10)
48685a8e 798#
cbfd6c95 799# @multifd-channels: Number of channels used to migrate data in
a937b6aa
MA
800# parallel. This is the same number that the number of sockets
801# used for migration. The default value is 2 (since 4.0)
4075fb1c 802#
73af8dd8 803# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
a937b6aa
MA
804# needs to be a multiple of the target page size and a power of 2
805# (Since 2.11)
73af8dd8 806#
a937b6aa
MA
807# @max-postcopy-bandwidth: Background transfer bandwidth during
808# postcopy. Defaults to 0 (unlimited). In bytes per second.
809# (Since 3.0)
4cbc9c7f 810#
a937b6aa
MA
811# @max-cpu-throttle: maximum cpu throttle percentage. Defaults to 99.
812# (Since 3.1)
ee3d96ba 813#
a937b6aa
MA
814# @multifd-compression: Which compression method to use. Defaults to
815# none. (Since 5.0)
96eef042 816#
9004db48 817# @multifd-zlib-level: Set the compression level to be used in live
a937b6aa
MA
818# migration, the compression level is an integer between 0 and 9,
819# where 0 means no compression, 1 means the best compression
820# speed, and 9 means best compression ratio which will consume
821# more CPU. Defaults to 1. (Since 5.0)
9004db48 822#
6a9ad154 823# @multifd-zstd-level: Set the compression level to be used in live
a937b6aa
MA
824# migration, the compression level is an integer between 0 and 20,
825# where 0 means no compression, 1 means the best compression
826# speed, and 20 means best compression ratio which will consume
827# more CPU. Defaults to 1. (Since 5.0)
abb6295b 828#
31e4c354 829# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
a937b6aa
MA
830# aliases for the purpose of dirty bitmap migration. Such aliases
831# may for example be the corresponding names on the opposite site.
832# The mapping must be one-to-one, but not necessarily complete: On
833# the source, unmapped bitmaps and all bitmaps on unmapped nodes
834# will be ignored. On the destination, encountering an unmapped
835# alias in the incoming migration stream will result in a report,
836# and all further bitmap migration data will then be discarded.
837# Note that the destination does not know about bitmaps it does
838# not receive, so there is no limitation or requirement regarding
839# the number of bitmaps received, or how they are named, or on
840# which nodes they are placed. By default (when this parameter
841# has never been set), bitmap names are mapped to themselves.
842# Nodes are mapped to their block device name if there is one, and
843# to their node name otherwise. (Since 5.2)
31e4c354 844#
8abc8115
HH
845# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
846# limit during live migration. Should be in the range 1 to 1000ms.
847# Defaults to 1000ms. (Since 8.1)
4d807857 848#
09f9ec99 849# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
8abc8115 850# Defaults to 1. (Since 8.1)
09f9ec99 851#
9fb49daa 852# Features:
a937b6aa 853#
66db46ca 854# @deprecated: Member @block-incremental is deprecated. Use
864128df
JQ
855# blockdev-mirror with NBD instead. Members @compress-level,
856# @compress-threads, @decompress-threads and @compress-wait-thread
857# are deprecated because @compression is deprecated.
66db46ca 858#
4d807857 859# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
8abc8115 860# are experimental.
9fb49daa 861#
48685a8e
MA
862# Since: 2.4
863##
864{ 'enum': 'MigrationParameter',
ee3d96ba
DDAG
865 'data': ['announce-initial', 'announce-max',
866 'announce-rounds', 'announce-step',
864128df
JQ
867 { 'name': 'compress-level', 'features': [ 'deprecated' ] },
868 { 'name': 'compress-threads', 'features': [ 'deprecated' ] },
869 { 'name': 'decompress-threads', 'features': [ 'deprecated' ] },
870 { 'name': 'compress-wait-thread', 'features': [ 'deprecated' ] },
871 'throttle-trigger-threshold',
48685a8e 872 'cpu-throttle-initial', 'cpu-throttle-increment',
cbbf8182 873 'cpu-throttle-tailslow',
d2f1d29b 874 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
8b239597 875 'avail-switchover-bandwidth', 'downtime-limit',
9fb49daa 876 { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
66db46ca 877 { 'name': 'block-incremental', 'features': [ 'deprecated' ] },
cbfd6c95 878 'multifd-channels',
4cbc9c7f 879 'xbzrle-cache-size', 'max-postcopy-bandwidth',
9004db48 880 'max-cpu-throttle', 'multifd-compression',
4d807857
HH
881 'multifd-zlib-level', 'multifd-zstd-level',
882 'block-bitmap-mapping',
09f9ec99
HH
883 { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] },
884 'vcpu-dirty-limit'] }
48685a8e
MA
885
886##
887# @MigrateSetParameters:
888#
a937b6aa
MA
889# @announce-initial: Initial delay (in milliseconds) before sending
890# the first announce (Since 4.0)
ee3d96ba 891#
a937b6aa
MA
892# @announce-max: Maximum delay (in milliseconds) between packets in
893# the announcement (Since 4.0)
ee3d96ba 894#
a937b6aa
MA
895# @announce-rounds: Number of self-announce packets sent after
896# migration (Since 4.0)
ee3d96ba 897#
a937b6aa
MA
898# @announce-step: Increase in delay (in milliseconds) between
899# subsequent packets in the announcement (Since 4.0)
ee3d96ba 900#
48685a8e
MA
901# @compress-level: compression level
902#
903# @compress-threads: compression thread count
904#
a937b6aa
MA
905# @compress-wait-thread: Controls behavior when all compression
906# threads are currently busy. If true (default), wait for a free
907# compression thread to become available; otherwise, send the page
908# uncompressed. (Since 3.1)
1d58872a 909#
48685a8e
MA
910# @decompress-threads: decompression thread count
911#
a937b6aa
MA
912# @throttle-trigger-threshold: The ratio of bytes_dirty_period and
913# bytes_xfer_period to trigger throttling. It is expressed as
914# percentage. The default value is 50. (Since 5.0)
dc14a470 915#
48685a8e 916# @cpu-throttle-initial: Initial percentage of time guest cpus are
a937b6aa
MA
917# throttled when migration auto-converge is activated. The
918# default value is 20. (Since 2.7)
48685a8e
MA
919#
920# @cpu-throttle-increment: throttle percentage increase each time
a937b6aa
MA
921# auto-converge detects that migration is not making progress.
922# The default value is 10. (Since 2.7)
923#
924# @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
925# the tail stage of throttling, the Guest is very sensitive to CPU
926# percentage while the @cpu-throttle -increment is excessive
927# usually at tail stage. If this parameter is true, we will
928# compute the ideal CPU percentage used by the Guest, which may
929# exactly make the dirty rate match the dirty rate threshold.
930# Then we will choose a smaller throttle increment between the one
931# specified by @cpu-throttle-increment and the one generated by
932# ideal CPU percentage. Therefore, it is compatible to
933# traditional throttling, meanwhile the throttle increment won't
934# be excessive at tail stage. The default value is false. (Since
935# 5.1)
cbbf8182 936#
48685a8e 937# @tls-creds: ID of the 'tls-creds' object that provides credentials
a937b6aa
MA
938# for establishing a TLS connection over the migration data
939# channel. On the outgoing side of the migration, the credentials
940# must be for a 'client' endpoint, while for the incoming side the
941# credentials must be for a 'server' endpoint. Setting this to a
942# non-empty string enables TLS for all migrations. An empty
943# string means that QEMU will use plain text mode for migration,
944# rather than TLS (Since 2.9) Previously (since 2.7), this was
945# reported by omitting tls-creds instead.
946#
947# @tls-hostname: hostname of the target host for the migration. This
948# is required when using x509 based TLS credentials and the
949# migration URI does not already include a hostname. For example
950# if using fd: or exec: based migration, the hostname must be
951# provided so that the server's x509 certificate identity can be
952# validated. (Since 2.7) An empty string means that QEMU will use
953# the hostname associated with the migration URI, if any. (Since
954# 2.9) Previously (since 2.7), this was reported by omitting
955# tls-hostname instead.
956#
957# @max-bandwidth: to set maximum speed for migration. maximum speed
958# in bytes per second. (Since 2.8)
959#
8b239597
PX
960# @avail-switchover-bandwidth: to set the available bandwidth that
961# migration can use during switchover phase. NOTE! This does not
962# limit the bandwidth during switchover, but only for calculations when
963# making decisions to switchover. By default, this value is zero,
964# which means QEMU will estimate the bandwidth automatically. This can
965# be set when the estimated value is not accurate, while the user is
966# able to guarantee such bandwidth is available when switching over.
967# When specified correctly, this can make the switchover decision much
968# more accurate. (Since 8.2)
969#
a937b6aa
MA
970# @downtime-limit: set maximum tolerated downtime for migration.
971# maximum downtime in milliseconds (Since 2.8)
972#
973# @x-checkpoint-delay: the delay time between two COLO checkpoints.
974# (Since 2.8)
48685a8e
MA
975#
976# @block-incremental: Affects how much storage is migrated when the
a937b6aa
MA
977# block migration capability is enabled. When false, the entire
978# storage backing chain is migrated into a flattened image at the
979# destination; when true, only the active qcow2 layer is migrated
980# and the destination must already have access to the same backing
981# chain as was used on the source. (since 2.10)
48685a8e 982#
cbfd6c95 983# @multifd-channels: Number of channels used to migrate data in
a937b6aa
MA
984# parallel. This is the same number that the number of sockets
985# used for migration. The default value is 2 (since 4.0)
4075fb1c 986#
73af8dd8 987# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
a937b6aa
MA
988# needs to be a multiple of the target page size and a power of 2
989# (Since 2.11)
7e555c6c 990#
a937b6aa
MA
991# @max-postcopy-bandwidth: Background transfer bandwidth during
992# postcopy. Defaults to 0 (unlimited). In bytes per second.
993# (Since 3.0)
4cbc9c7f 994#
a937b6aa
MA
995# @max-cpu-throttle: maximum cpu throttle percentage. The default
996# value is 99. (Since 3.1)
4cbc9c7f 997#
a937b6aa
MA
998# @multifd-compression: Which compression method to use. Defaults to
999# none. (Since 5.0)
96eef042 1000#
9004db48 1001# @multifd-zlib-level: Set the compression level to be used in live
a937b6aa
MA
1002# migration, the compression level is an integer between 0 and 9,
1003# where 0 means no compression, 1 means the best compression
1004# speed, and 9 means best compression ratio which will consume
1005# more CPU. Defaults to 1. (Since 5.0)
9004db48 1006#
6a9ad154 1007# @multifd-zstd-level: Set the compression level to be used in live
a937b6aa
MA
1008# migration, the compression level is an integer between 0 and 20,
1009# where 0 means no compression, 1 means the best compression
1010# speed, and 20 means best compression ratio which will consume
1011# more CPU. Defaults to 1. (Since 5.0)
6a9ad154 1012#
31e4c354 1013# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
a937b6aa
MA
1014# aliases for the purpose of dirty bitmap migration. Such aliases
1015# may for example be the corresponding names on the opposite site.
1016# The mapping must be one-to-one, but not necessarily complete: On
1017# the source, unmapped bitmaps and all bitmaps on unmapped nodes
1018# will be ignored. On the destination, encountering an unmapped
1019# alias in the incoming migration stream will result in a report,
1020# and all further bitmap migration data will then be discarded.
1021# Note that the destination does not know about bitmaps it does
1022# not receive, so there is no limitation or requirement regarding
1023# the number of bitmaps received, or how they are named, or on
1024# which nodes they are placed. By default (when this parameter
1025# has never been set), bitmap names are mapped to themselves.
1026# Nodes are mapped to their block device name if there is one, and
1027# to their node name otherwise. (Since 5.2)
31e4c354 1028#
8abc8115
HH
1029# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
1030# limit during live migration. Should be in the range 1 to 1000ms.
1031# Defaults to 1000ms. (Since 8.1)
4d807857 1032#
09f9ec99 1033# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
8abc8115 1034# Defaults to 1. (Since 8.1)
09f9ec99 1035#
9fb49daa 1036# Features:
a937b6aa 1037#
66db46ca 1038# @deprecated: Member @block-incremental is deprecated. Use
864128df
JQ
1039# blockdev-mirror with NBD instead. Members @compress-level,
1040# @compress-threads, @decompress-threads and @compress-wait-thread
1041# are deprecated because @compression is deprecated.
66db46ca 1042#
4d807857 1043# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
8abc8115 1044# are experimental.
9fb49daa 1045#
56266c6d 1046# TODO: either fuse back into MigrationParameters, or make
a937b6aa 1047# MigrationParameters members mandatory
56266c6d 1048#
48685a8e
MA
1049# Since: 2.4
1050##
48685a8e 1051{ 'struct': 'MigrateSetParameters',
ee3d96ba
DDAG
1052 'data': { '*announce-initial': 'size',
1053 '*announce-max': 'size',
1054 '*announce-rounds': 'size',
1055 '*announce-step': 'size',
864128df
JQ
1056 '*compress-level': { 'type': 'uint8',
1057 'features': [ 'deprecated' ] },
1058 '*compress-threads': { 'type': 'uint8',
1059 'features': [ 'deprecated' ] },
1060 '*compress-wait-thread': { 'type': 'bool',
1061 'features': [ 'deprecated' ] },
1062 '*decompress-threads': { 'type': 'uint8',
1063 'features': [ 'deprecated' ] },
ec17de0a
MA
1064 '*throttle-trigger-threshold': 'uint8',
1065 '*cpu-throttle-initial': 'uint8',
1066 '*cpu-throttle-increment': 'uint8',
cbbf8182 1067 '*cpu-throttle-tailslow': 'bool',
48685a8e
MA
1068 '*tls-creds': 'StrOrNull',
1069 '*tls-hostname': 'StrOrNull',
d2f1d29b 1070 '*tls-authz': 'StrOrNull',
ec17de0a 1071 '*max-bandwidth': 'size',
8b239597 1072 '*avail-switchover-bandwidth': 'size',
ec17de0a 1073 '*downtime-limit': 'uint64',
9fb49daa
MA
1074 '*x-checkpoint-delay': { 'type': 'uint32',
1075 'features': [ 'unstable' ] },
66db46ca
JQ
1076 '*block-incremental': { 'type': 'bool',
1077 'features': [ 'deprecated' ] },
ec17de0a 1078 '*multifd-channels': 'uint8',
7e555c6c 1079 '*xbzrle-cache-size': 'size',
4cbc9c7f 1080 '*max-postcopy-bandwidth': 'size',
ec17de0a 1081 '*max-cpu-throttle': 'uint8',
9004db48 1082 '*multifd-compression': 'MultiFDCompression',
ec17de0a
MA
1083 '*multifd-zlib-level': 'uint8',
1084 '*multifd-zstd-level': 'uint8',
4d807857
HH
1085 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
1086 '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
09f9ec99
HH
1087 'features': [ 'unstable' ] },
1088 '*vcpu-dirty-limit': 'uint64'} }
48685a8e
MA
1089
1090##
1091# @migrate-set-parameters:
1092#
1093# Set various migration parameters.
1094#
1095# Since: 2.4
1096#
1097# Example:
1098#
1099# -> { "execute": "migrate-set-parameters" ,
864128df 1100# "arguments": { "multifd-channels": 5 } }
37fa48a4 1101# <- { "return": {} }
48685a8e
MA
1102##
1103{ 'command': 'migrate-set-parameters', 'boxed': true,
1104 'data': 'MigrateSetParameters' }
1105
1106##
1107# @MigrationParameters:
1108#
1109# The optional members aren't actually optional.
1110#
a937b6aa
MA
1111# @announce-initial: Initial delay (in milliseconds) before sending
1112# the first announce (Since 4.0)
ee3d96ba 1113#
a937b6aa
MA
1114# @announce-max: Maximum delay (in milliseconds) between packets in
1115# the announcement (Since 4.0)
ee3d96ba 1116#
a937b6aa
MA
1117# @announce-rounds: Number of self-announce packets sent after
1118# migration (Since 4.0)
ee3d96ba 1119#
a937b6aa
MA
1120# @announce-step: Increase in delay (in milliseconds) between
1121# subsequent packets in the announcement (Since 4.0)
ee3d96ba 1122#
48685a8e
MA
1123# @compress-level: compression level
1124#
1125# @compress-threads: compression thread count
1126#
a937b6aa
MA
1127# @compress-wait-thread: Controls behavior when all compression
1128# threads are currently busy. If true (default), wait for a free
1129# compression thread to become available; otherwise, send the page
1130# uncompressed. (Since 3.1)
1d58872a 1131#
48685a8e
MA
1132# @decompress-threads: decompression thread count
1133#
a937b6aa
MA
1134# @throttle-trigger-threshold: The ratio of bytes_dirty_period and
1135# bytes_xfer_period to trigger throttling. It is expressed as
1136# percentage. The default value is 50. (Since 5.0)
dc14a470 1137#
48685a8e 1138# @cpu-throttle-initial: Initial percentage of time guest cpus are
a937b6aa
MA
1139# throttled when migration auto-converge is activated. (Since
1140# 2.7)
48685a8e
MA
1141#
1142# @cpu-throttle-increment: throttle percentage increase each time
a937b6aa
MA
1143# auto-converge detects that migration is not making progress.
1144# (Since 2.7)
1145#
1146# @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
1147# the tail stage of throttling, the Guest is very sensitive to CPU
1148# percentage while the @cpu-throttle -increment is excessive
1149# usually at tail stage. If this parameter is true, we will
1150# compute the ideal CPU percentage used by the Guest, which may
1151# exactly make the dirty rate match the dirty rate threshold.
1152# Then we will choose a smaller throttle increment between the one
1153# specified by @cpu-throttle-increment and the one generated by
1154# ideal CPU percentage. Therefore, it is compatible to
1155# traditional throttling, meanwhile the throttle increment won't
1156# be excessive at tail stage. The default value is false. (Since
1157# 5.1)
cbbf8182 1158#
48685a8e 1159# @tls-creds: ID of the 'tls-creds' object that provides credentials
a937b6aa
MA
1160# for establishing a TLS connection over the migration data
1161# channel. On the outgoing side of the migration, the credentials
1162# must be for a 'client' endpoint, while for the incoming side the
1163# credentials must be for a 'server' endpoint. An empty string
1164# means that QEMU will use plain text mode for migration, rather
1165# than TLS (Since 2.7) Note: 2.8 reports this by omitting
1166# tls-creds instead.
1167#
1168# @tls-hostname: hostname of the target host for the migration. This
1169# is required when using x509 based TLS credentials and the
1170# migration URI does not already include a hostname. For example
1171# if using fd: or exec: based migration, the hostname must be
1172# provided so that the server's x509 certificate identity can be
1173# validated. (Since 2.7) An empty string means that QEMU will use
1174# the hostname associated with the migration URI, if any. (Since
1175# 2.9) Note: 2.8 reports this by omitting tls-hostname instead.
1176#
1177# @tls-authz: ID of the 'authz' object subclass that provides access
1178# control checking of the TLS x509 certificate distinguished name.
1179# (Since 4.0)
1180#
1181# @max-bandwidth: to set maximum speed for migration. maximum speed
1182# in bytes per second. (Since 2.8)
1183#
8b239597
PX
1184# @avail-switchover-bandwidth: to set the available bandwidth that
1185# migration can use during switchover phase. NOTE! This does not
1186# limit the bandwidth during switchover, but only for calculations when
1187# making decisions to switchover. By default, this value is zero,
1188# which means QEMU will estimate the bandwidth automatically. This can
1189# be set when the estimated value is not accurate, while the user is
1190# able to guarantee such bandwidth is available when switching over.
1191# When specified correctly, this can make the switchover decision much
1192# more accurate. (Since 8.2)
1193#
a937b6aa
MA
1194# @downtime-limit: set maximum tolerated downtime for migration.
1195# maximum downtime in milliseconds (Since 2.8)
1196#
1197# @x-checkpoint-delay: the delay time between two COLO checkpoints.
1198# (Since 2.8)
48685a8e
MA
1199#
1200# @block-incremental: Affects how much storage is migrated when the
a937b6aa
MA
1201# block migration capability is enabled. When false, the entire
1202# storage backing chain is migrated into a flattened image at the
1203# destination; when true, only the active qcow2 layer is migrated
1204# and the destination must already have access to the same backing
1205# chain as was used on the source. (since 2.10)
48685a8e 1206#
cbfd6c95 1207# @multifd-channels: Number of channels used to migrate data in
a937b6aa
MA
1208# parallel. This is the same number that the number of sockets
1209# used for migration. The default value is 2 (since 4.0)
4075fb1c 1210#
73af8dd8 1211# @xbzrle-cache-size: cache size to be used by XBZRLE migration. It
a937b6aa
MA
1212# needs to be a multiple of the target page size and a power of 2
1213# (Since 2.11)
7e555c6c 1214#
a937b6aa
MA
1215# @max-postcopy-bandwidth: Background transfer bandwidth during
1216# postcopy. Defaults to 0 (unlimited). In bytes per second.
1217# (Since 3.0)
4cbc9c7f 1218#
a937b6aa
MA
1219# @max-cpu-throttle: maximum cpu throttle percentage. Defaults to 99.
1220# (Since 3.1)
4cbc9c7f 1221#
a937b6aa
MA
1222# @multifd-compression: Which compression method to use. Defaults to
1223# none. (Since 5.0)
96eef042 1224#
9004db48 1225# @multifd-zlib-level: Set the compression level to be used in live
a937b6aa
MA
1226# migration, the compression level is an integer between 0 and 9,
1227# where 0 means no compression, 1 means the best compression
1228# speed, and 9 means best compression ratio which will consume
1229# more CPU. Defaults to 1. (Since 5.0)
9004db48 1230#
6a9ad154 1231# @multifd-zstd-level: Set the compression level to be used in live
a937b6aa
MA
1232# migration, the compression level is an integer between 0 and 20,
1233# where 0 means no compression, 1 means the best compression
1234# speed, and 20 means best compression ratio which will consume
1235# more CPU. Defaults to 1. (Since 5.0)
6a9ad154 1236#
31e4c354 1237# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
a937b6aa
MA
1238# aliases for the purpose of dirty bitmap migration. Such aliases
1239# may for example be the corresponding names on the opposite site.
1240# The mapping must be one-to-one, but not necessarily complete: On
1241# the source, unmapped bitmaps and all bitmaps on unmapped nodes
1242# will be ignored. On the destination, encountering an unmapped
1243# alias in the incoming migration stream will result in a report,
1244# and all further bitmap migration data will then be discarded.
1245# Note that the destination does not know about bitmaps it does
1246# not receive, so there is no limitation or requirement regarding
1247# the number of bitmaps received, or how they are named, or on
1248# which nodes they are placed. By default (when this parameter
1249# has never been set), bitmap names are mapped to themselves.
1250# Nodes are mapped to their block device name if there is one, and
1251# to their node name otherwise. (Since 5.2)
31e4c354 1252#
8abc8115
HH
1253# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
1254# limit during live migration. Should be in the range 1 to 1000ms.
1255# Defaults to 1000ms. (Since 8.1)
4d807857 1256#
09f9ec99 1257# @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
8abc8115 1258# Defaults to 1. (Since 8.1)
09f9ec99 1259#
9fb49daa 1260# Features:
a937b6aa 1261#
66db46ca 1262# @deprecated: Member @block-incremental is deprecated. Use
864128df
JQ
1263# blockdev-mirror with NBD instead. Members @compress-level,
1264# @compress-threads, @decompress-threads and @compress-wait-thread
1265# are deprecated because @compression is deprecated.
66db46ca 1266#
4d807857 1267# @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
8abc8115 1268# are experimental.
9fb49daa 1269#
48685a8e
MA
1270# Since: 2.4
1271##
1272{ 'struct': 'MigrationParameters',
ee3d96ba
DDAG
1273 'data': { '*announce-initial': 'size',
1274 '*announce-max': 'size',
1275 '*announce-rounds': 'size',
1276 '*announce-step': 'size',
864128df
JQ
1277 '*compress-level': { 'type': 'uint8',
1278 'features': [ 'deprecated' ] },
1279 '*compress-threads': { 'type': 'uint8',
1280 'features': [ 'deprecated' ] },
1281 '*compress-wait-thread': { 'type': 'bool',
1282 'features': [ 'deprecated' ] },
1283 '*decompress-threads': { 'type': 'uint8',
1284 'features': [ 'deprecated' ] },
dc14a470 1285 '*throttle-trigger-threshold': 'uint8',
741d4086
JQ
1286 '*cpu-throttle-initial': 'uint8',
1287 '*cpu-throttle-increment': 'uint8',
cbbf8182 1288 '*cpu-throttle-tailslow': 'bool',
48685a8e
MA
1289 '*tls-creds': 'str',
1290 '*tls-hostname': 'str',
d2f1d29b 1291 '*tls-authz': 'str',
741d4086 1292 '*max-bandwidth': 'size',
8b239597 1293 '*avail-switchover-bandwidth': 'size',
741d4086 1294 '*downtime-limit': 'uint64',
9fb49daa
MA
1295 '*x-checkpoint-delay': { 'type': 'uint32',
1296 'features': [ 'unstable' ] },
66db46ca
JQ
1297 '*block-incremental': { 'type': 'bool',
1298 'features': [ 'deprecated' ] },
cbfd6c95 1299 '*multifd-channels': 'uint8',
7e555c6c 1300 '*xbzrle-cache-size': 'size',
dbb28bc8 1301 '*max-postcopy-bandwidth': 'size',
96eef042 1302 '*max-cpu-throttle': 'uint8',
9004db48 1303 '*multifd-compression': 'MultiFDCompression',
6a9ad154 1304 '*multifd-zlib-level': 'uint8',
31e4c354 1305 '*multifd-zstd-level': 'uint8',
4d807857
HH
1306 '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
1307 '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
09f9ec99
HH
1308 'features': [ 'unstable' ] },
1309 '*vcpu-dirty-limit': 'uint64'} }
48685a8e
MA
1310
1311##
1312# @query-migrate-parameters:
1313#
1314# Returns information about the current migration parameters
1315#
1316# Returns: @MigrationParameters
1317#
1318# Since: 2.4
1319#
1320# Example:
1321#
1322# -> { "execute": "query-migrate-parameters" }
1323# <- { "return": {
864128df 1324# "multifd-channels": 2,
48685a8e 1325# "cpu-throttle-increment": 10,
48685a8e
MA
1326# "cpu-throttle-initial": 20,
1327# "max-bandwidth": 33554432,
1328# "downtime-limit": 300
1329# }
1330# }
48685a8e
MA
1331##
1332{ 'command': 'query-migrate-parameters',
1333 'returns': 'MigrationParameters' }
1334
48685a8e
MA
1335##
1336# @migrate-start-postcopy:
1337#
a937b6aa
MA
1338# Followup to a migration command to switch the migration to postcopy
1339# mode. The postcopy-ram capability must be set on both source and
1340# destination before the original migration command.
48685a8e
MA
1341#
1342# Since: 2.5
1343#
1344# Example:
1345#
1346# -> { "execute": "migrate-start-postcopy" }
1347# <- { "return": {} }
48685a8e
MA
1348##
1349{ 'command': 'migrate-start-postcopy' }
1350
1351##
1352# @MIGRATION:
1353#
1354# Emitted when a migration event happens
1355#
1356# @status: @MigrationStatus describing the current migration status.
1357#
1358# Since: 2.4
1359#
1360# Example:
1361#
1362# <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1363# "event": "MIGRATION",
1364# "data": {"status": "completed"} }
48685a8e
MA
1365##
1366{ 'event': 'MIGRATION',
1367 'data': {'status': 'MigrationStatus'}}
1368
1369##
1370# @MIGRATION_PASS:
1371#
a937b6aa
MA
1372# Emitted from the source side of a migration at the start of each
1373# pass (when it syncs the dirty bitmap)
48685a8e
MA
1374#
1375# @pass: An incrementing count (starting at 1 on the first pass)
1376#
1377# Since: 2.6
1378#
1379# Example:
1380#
37fa48a4
MA
1381# <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1382# "event": "MIGRATION_PASS", "data": {"pass": 2} }
48685a8e
MA
1383##
1384{ 'event': 'MIGRATION_PASS',
1385 'data': { 'pass': 'int' } }
1386
1387##
1388# @COLOMessage:
1389#
1390# The message transmission between Primary side and Secondary side.
1391#
1392# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1393#
a937b6aa
MA
1394# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for
1395# checkpointing
48685a8e
MA
1396#
1397# @checkpoint-reply: SVM gets PVM's checkpoint request
1398#
1399# @vmstate-send: VM's state will be sent by PVM.
1400#
1401# @vmstate-size: The total size of VMstate.
1402#
1403# @vmstate-received: VM's state has been received by SVM.
1404#
1405# @vmstate-loaded: VM's state has been loaded by SVM.
1406#
1407# Since: 2.8
1408##
1409{ 'enum': 'COLOMessage',
1410 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1411 'vmstate-send', 'vmstate-size', 'vmstate-received',
1412 'vmstate-loaded' ] }
1413
1414##
1415# @COLOMode:
1416#
41b6b779 1417# The COLO current mode.
48685a8e 1418#
41b6b779 1419# @none: COLO is disabled.
48685a8e 1420#
41b6b779 1421# @primary: COLO node in primary side.
48685a8e 1422#
41b6b779 1423# @secondary: COLO node in slave side.
48685a8e
MA
1424#
1425# Since: 2.8
1426##
1427{ 'enum': 'COLOMode',
41b6b779 1428 'data': [ 'none', 'primary', 'secondary'] }
48685a8e
MA
1429
1430##
1431# @FailoverStatus:
1432#
1433# An enumeration of COLO failover status
1434#
1435# @none: no failover has ever happened
1436#
1437# @require: got failover requirement but not handled
1438#
1439# @active: in the process of doing failover
1440#
1441# @completed: finish the process of failover
1442#
a937b6aa
MA
1443# @relaunch: restart the failover process, from 'none' -> 'completed'
1444# (Since 2.9)
48685a8e
MA
1445#
1446# Since: 2.8
1447##
1448{ 'enum': 'FailoverStatus',
1449 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1450
9ecff6d6
HZ
1451##
1452# @COLO_EXIT:
1453#
1454# Emitted when VM finishes COLO mode due to some errors happening or
1455# at the request of users.
1456#
1457# @mode: report COLO mode when COLO exited.
1458#
1459# @reason: describes the reason for the COLO exit.
1460#
1461# Since: 3.1
1462#
1463# Example:
1464#
1465# <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1466# "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
9ecff6d6
HZ
1467##
1468{ 'event': 'COLO_EXIT',
1469 'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1470
1471##
1472# @COLOExitReason:
1473#
3a43ac47 1474# The reason for a COLO exit.
9ecff6d6 1475#
a937b6aa
MA
1476# @none: failover has never happened. This state does not occur in
1477# the COLO_EXIT event, and is only visible in the result of
1478# query-colo-status.
9ecff6d6 1479#
3a43ac47 1480# @request: COLO exit is due to an external request.
9ecff6d6 1481#
3a43ac47
ZC
1482# @error: COLO exit is due to an internal error.
1483#
1484# @processing: COLO is currently handling a failover (since 4.0).
9ecff6d6
HZ
1485#
1486# Since: 3.1
1487##
1488{ 'enum': 'COLOExitReason',
3a43ac47 1489 'data': [ 'none', 'request', 'error' , 'processing' ] }
9ecff6d6 1490
48685a8e
MA
1491##
1492# @x-colo-lost-heartbeat:
1493#
a937b6aa
MA
1494# Tell qemu that heartbeat is lost, request it to do takeover
1495# procedures. If this command is sent to the PVM, the Primary side
1496# will exit COLO mode. If sent to the Secondary, the Secondary side
1497# will run failover work, then takes over server operation to become
1498# the service VM.
48685a8e 1499#
9fb49daa 1500# Features:
a937b6aa 1501#
9fb49daa
MA
1502# @unstable: This command is experimental.
1503#
48685a8e
MA
1504# Since: 2.8
1505#
1506# Example:
1507#
1508# -> { "execute": "x-colo-lost-heartbeat" }
1509# <- { "return": {} }
48685a8e 1510##
9fb49daa 1511{ 'command': 'x-colo-lost-heartbeat',
51e47cf8
VSO
1512 'features': [ 'unstable' ],
1513 'if': 'CONFIG_REPLICATION' }
48685a8e
MA
1514
1515##
1516# @migrate_cancel:
1517#
1518# Cancel the current executing migration process.
1519#
1520# Returns: nothing on success
1521#
a937b6aa
MA
1522# Notes: This command succeeds even if there is no migration process
1523# running.
48685a8e 1524#
9bc6e893 1525# Since: 0.14
48685a8e
MA
1526#
1527# Example:
1528#
1529# -> { "execute": "migrate_cancel" }
1530# <- { "return": {} }
48685a8e
MA
1531##
1532{ 'command': 'migrate_cancel' }
1533
89cfc02c
DDAG
1534##
1535# @migrate-continue:
1536#
1537# Continue migration when it's in a paused state.
1538#
1539# @state: The state the migration is currently expected to be in
1540#
1541# Returns: nothing on success
4ae65a52 1542#
89cfc02c 1543# Since: 2.11
4ae65a52 1544#
89cfc02c
DDAG
1545# Example:
1546#
1547# -> { "execute": "migrate-continue" , "arguments":
1548# { "state": "pre-switchover" } }
1549# <- { "return": {} }
1550##
1551{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1552
48685a8e
MA
1553##
1554# @migrate:
1555#
1556# Migrates the current running guest to another Virtual Machine.
1557#
1558# @uri: the Uniform Resource Identifier of the destination VM
1559#
1560# @blk: do block migration (full disk copy)
1561#
1562# @inc: incremental disk copy migration
1563#
a937b6aa
MA
1564# @detach: this argument exists only for compatibility reasons and is
1565# ignored by QEMU
48685a8e 1566#
51f63ec7 1567# @resume: resume one paused migration, default "off". (since 3.0)
7a4da28b 1568#
40101f32
JQ
1569# Features:
1570#
8846b5bf
JQ
1571# @deprecated: Members @inc and @blk are deprecated. Use
1572# blockdev-mirror with NBD instead.
40101f32 1573#
48685a8e
MA
1574# Returns: nothing on success
1575#
9bc6e893 1576# Since: 0.14
48685a8e
MA
1577#
1578# Notes:
1579#
a937b6aa
MA
1580# 1. The 'query-migrate' command should be used to check migration's
1581# progress and final result (this information is provided by the
1582# 'status' member)
48685a8e
MA
1583#
1584# 2. All boolean arguments default to false
1585#
a937b6aa
MA
1586# 3. The user Monitor's "detach" argument is invalid in QMP and should
1587# not be used
48685a8e
MA
1588#
1589# Example:
1590#
1591# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1592# <- { "return": {} }
48685a8e
MA
1593##
1594{ 'command': 'migrate',
8846b5bf
JQ
1595 'data': {'uri': 'str',
1596 '*blk': { 'type': 'bool', 'features': [ 'deprecated' ] },
40101f32 1597 '*inc': { 'type': 'bool', 'features': [ 'deprecated' ] },
7a4da28b 1598 '*detach': 'bool', '*resume': 'bool' } }
48685a8e
MA
1599
1600##
1601# @migrate-incoming:
1602#
a937b6aa
MA
1603# Start an incoming migration, the qemu must have been started with
1604# -incoming defer
48685a8e
MA
1605#
1606# @uri: The Uniform Resource Identifier identifying the source or
a937b6aa 1607# address to listen on
48685a8e
MA
1608#
1609# Returns: nothing on success
1610#
1611# Since: 2.3
1612#
1613# Notes:
1614#
a937b6aa
MA
1615# 1. It's a bad idea to use a string for the uri, but it needs
1616# to stay compatible with -incoming and the format of the uri
1617# is already exposed above libvirt.
48685a8e 1618#
a937b6aa
MA
1619# 2. QEMU must be started with -incoming defer to allow
1620# migrate-incoming to be used.
48685a8e
MA
1621#
1622# 3. The uri format is the same as for -incoming
1623#
1624# Example:
1625#
1626# -> { "execute": "migrate-incoming",
1627# "arguments": { "uri": "tcp::4446" } }
1628# <- { "return": {} }
48685a8e
MA
1629##
1630{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1631
1632##
1633# @xen-save-devices-state:
1634#
a937b6aa
MA
1635# Save the state of all devices to file. The RAM and the block
1636# devices of the VM are not saved by this command.
48685a8e
MA
1637#
1638# @filename: the file to save the state of the devices to as binary
a937b6aa
MA
1639# data. See xen-save-devices-state.txt for a description of the
1640# binary format.
48685a8e 1641#
a937b6aa
MA
1642# @live: Optional argument to ask QEMU to treat this command as part
1643# of a live migration. Default to true. (since 2.11)
5d6c599f 1644#
48685a8e
MA
1645# Returns: Nothing on success
1646#
1647# Since: 1.1
1648#
1649# Example:
1650#
1651# -> { "execute": "xen-save-devices-state",
1652# "arguments": { "filename": "/tmp/save" } }
1653# <- { "return": {} }
48685a8e 1654##
5d6c599f
AP
1655{ 'command': 'xen-save-devices-state',
1656 'data': {'filename': 'str', '*live':'bool' } }
48685a8e 1657
28af9ba2
PMD
1658##
1659# @xen-set-global-dirty-log:
1660#
1661# Enable or disable the global dirty log mode.
1662#
1663# @enable: true to enable, false to disable.
1664#
1665# Returns: nothing
1666#
1667# Since: 1.3
1668#
1669# Example:
1670#
1671# -> { "execute": "xen-set-global-dirty-log",
1672# "arguments": { "enable": true } }
1673# <- { "return": {} }
28af9ba2
PMD
1674##
1675{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1676
1677##
1678# @xen-load-devices-state:
1679#
a937b6aa
MA
1680# Load the state of all devices from file. The RAM and the block
1681# devices of the VM are not loaded by this command.
28af9ba2
PMD
1682#
1683# @filename: the file to load the state of the devices from as binary
a937b6aa
MA
1684# data. See xen-save-devices-state.txt for a description of the
1685# binary format.
28af9ba2
PMD
1686#
1687# Since: 2.7
1688#
1689# Example:
1690#
1691# -> { "execute": "xen-load-devices-state",
1692# "arguments": { "filename": "/tmp/resume" } }
1693# <- { "return": {} }
28af9ba2
PMD
1694##
1695{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1696
48685a8e
MA
1697##
1698# @xen-set-replication:
1699#
1700# Enable or disable replication.
1701#
1702# @enable: true to enable, false to disable.
1703#
1704# @primary: true for primary or false for secondary.
1705#
a937b6aa
MA
1706# @failover: true to do failover, false to stop. but cannot be
1707# specified if 'enable' is true. default value is false.
48685a8e
MA
1708#
1709# Returns: nothing.
1710#
1711# Example:
1712#
1713# -> { "execute": "xen-set-replication",
1714# "arguments": {"enable": true, "primary": false} }
1715# <- { "return": {} }
1716#
1717# Since: 2.9
1718##
1719{ 'command': 'xen-set-replication',
fd658a7b 1720 'data': { 'enable': 'bool', 'primary': 'bool', '*failover': 'bool' },
8a9f1e1d 1721 'if': 'CONFIG_REPLICATION' }
48685a8e
MA
1722
1723##
1724# @ReplicationStatus:
1725#
1726# The result format for 'query-xen-replication-status'.
1727#
1728# @error: true if an error happened, false if replication is normal.
1729#
a937b6aa
MA
1730# @desc: the human readable error description string, when @error is
1731# 'true'.
48685a8e
MA
1732#
1733# Since: 2.9
1734##
1735{ 'struct': 'ReplicationStatus',
335d10cd 1736 'data': { 'error': 'bool', '*desc': 'str' },
8a9f1e1d 1737 'if': 'CONFIG_REPLICATION' }
48685a8e
MA
1738
1739##
1740# @query-xen-replication-status:
1741#
1742# Query replication status while the vm is running.
1743#
f4347129 1744# Returns: A @ReplicationStatus object showing the status.
48685a8e
MA
1745#
1746# Example:
1747#
1748# -> { "execute": "query-xen-replication-status" }
1749# <- { "return": { "error": false } }
1750#
1751# Since: 2.9
1752##
1753{ 'command': 'query-xen-replication-status',
335d10cd 1754 'returns': 'ReplicationStatus',
8a9f1e1d 1755 'if': 'CONFIG_REPLICATION' }
48685a8e
MA
1756
1757##
1758# @xen-colo-do-checkpoint:
1759#
1760# Xen uses this command to notify replication to trigger a checkpoint.
1761#
1762# Returns: nothing.
1763#
1764# Example:
1765#
1766# -> { "execute": "xen-colo-do-checkpoint" }
1767# <- { "return": {} }
1768#
1769# Since: 2.9
1770##
335d10cd 1771{ 'command': 'xen-colo-do-checkpoint',
8a9f1e1d 1772 'if': 'CONFIG_REPLICATION' }
02affd41 1773
f56c0065
ZC
1774##
1775# @COLOStatus:
1776#
1777# The result format for 'query-colo-status'.
1778#
a937b6aa
MA
1779# @mode: COLO running mode. If COLO is running, this field will
1780# return 'primary' or 'secondary'.
f56c0065 1781#
a937b6aa
MA
1782# @last-mode: COLO last running mode. If COLO is running, this field
1783# will return same like mode field, after failover we can use this
1784# field to get last colo mode. (since 4.0)
5ed0deca 1785#
f56c0065
ZC
1786# @reason: describes the reason for the COLO exit.
1787#
ea3b23e5 1788# Since: 3.1
f56c0065
ZC
1789##
1790{ 'struct': 'COLOStatus',
5cc8f9eb 1791 'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
51e47cf8
VSO
1792 'reason': 'COLOExitReason' },
1793 'if': 'CONFIG_REPLICATION' }
f56c0065
ZC
1794
1795##
1796# @query-colo-status:
1797#
1798# Query COLO status while the vm is running.
1799#
1800# Returns: A @COLOStatus object showing the status.
1801#
1802# Example:
1803#
1804# -> { "execute": "query-colo-status" }
51ec294d 1805# <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
f56c0065 1806#
ea3b23e5 1807# Since: 3.1
f56c0065
ZC
1808##
1809{ 'command': 'query-colo-status',
51e47cf8
VSO
1810 'returns': 'COLOStatus',
1811 'if': 'CONFIG_REPLICATION' }
f56c0065 1812
02affd41
PX
1813##
1814# @migrate-recover:
1815#
1816# Provide a recovery migration stream URI.
1817#
1818# @uri: the URI to be used for the recovery of migration stream.
1819#
1820# Returns: nothing.
1821#
1822# Example:
1823#
1824# -> { "execute": "migrate-recover",
1825# "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1826# <- { "return": {} }
1827#
51f63ec7 1828# Since: 3.0
02affd41 1829##
b0ddeba2
MAL
1830{ 'command': 'migrate-recover',
1831 'data': { 'uri': 'str' },
02affd41 1832 'allow-oob': true }
bfbf89c2
PX
1833
1834##
1835# @migrate-pause:
1836#
1837# Pause a migration. Currently it only supports postcopy.
1838#
1839# Returns: nothing.
1840#
1841# Example:
1842#
1843# -> { "execute": "migrate-pause" }
1844# <- { "return": {} }
1845#
51f63ec7 1846# Since: 3.0
bfbf89c2
PX
1847##
1848{ 'command': 'migrate-pause', 'allow-oob': true }
d328e6f3
JF
1849
1850##
1851# @UNPLUG_PRIMARY:
1852#
1853# Emitted from source side of a migration when migration state is
a937b6aa
MA
1854# WAIT_UNPLUG. Device was unplugged by guest operating system. Device
1855# resources in QEMU are kept on standby to be able to re-plug it in
1856# case of migration failure.
d328e6f3
JF
1857#
1858# @device-id: QEMU device id of the unplugged device
1859#
1860# Since: 4.2
1861#
1862# Example:
4ae65a52 1863#
0df5e9a3
VT
1864# <- { "event": "UNPLUG_PRIMARY",
1865# "data": { "device-id": "hostdev0" },
1866# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
d328e6f3
JF
1867##
1868{ 'event': 'UNPLUG_PRIMARY',
1869 'data': { 'device-id': 'str' } }
7df3aa30 1870
71864ead
HH
1871##
1872# @DirtyRateVcpu:
1873#
1874# Dirty rate of vcpu.
1875#
1876# @id: vcpu index.
1877#
1878# @dirty-rate: dirty rate.
1879#
f78d4ed7 1880# Since: 6.2
71864ead
HH
1881##
1882{ 'struct': 'DirtyRateVcpu',
1883 'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1884
7df3aa30
CZ
1885##
1886# @DirtyRateStatus:
1887#
5034e3d4 1888# Dirty page rate measurement status.
7df3aa30 1889#
5034e3d4 1890# @unstarted: measuring thread has not been started yet
7df3aa30 1891#
5034e3d4 1892# @measuring: measuring thread is running
7df3aa30 1893#
5034e3d4 1894# @measured: dirty page rate is measured and the results are available
7df3aa30
CZ
1895#
1896# Since: 5.2
7df3aa30
CZ
1897##
1898{ 'enum': 'DirtyRateStatus',
1899 'data': [ 'unstarted', 'measuring', 'measured'] }
4c437254 1900
71864ead
HH
1901##
1902# @DirtyRateMeasureMode:
1903#
5034e3d4
AG
1904# Method used to measure dirty page rate. Differences between
1905# available methods are explained in @calc-dirty-rate.
71864ead 1906#
5034e3d4 1907# @page-sampling: use page sampling
71864ead 1908#
5034e3d4 1909# @dirty-ring: use dirty ring
826b8bc8 1910#
5034e3d4 1911# @dirty-bitmap: use dirty bitmap
71864ead 1912#
f78d4ed7 1913# Since: 6.2
71864ead
HH
1914##
1915{ 'enum': 'DirtyRateMeasureMode',
826b8bc8 1916 'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
71864ead 1917
34a68001
AG
1918##
1919# @TimeUnit:
1920#
1921# Specifies unit in which time-related value is specified.
1922#
1923# @second: value is in seconds
1924#
1925# @millisecond: value is in milliseconds
1926#
1927# Since 8.2
1928#
1929##
1930{ 'enum': 'TimeUnit',
1931 'data': ['second', 'millisecond'] }
1932
4c437254
CZ
1933##
1934# @DirtyRateInfo:
1935#
5034e3d4 1936# Information about measured dirty page rate.
4c437254 1937#
a937b6aa 1938# @dirty-rate: an estimate of the dirty page rate of the VM in units
5034e3d4 1939# of MiB/s. Value is present only when @status is 'measured'.
4c437254 1940#
5034e3d4 1941# @status: current status of dirty page rate measurements
4c437254
CZ
1942#
1943# @start-time: start time in units of second for calculation
1944#
34a68001
AG
1945# @calc-time: time period for which dirty page rate was measured,
1946# expressed and rounded down to @calc-time-unit.
1947#
1948# @calc-time-unit: time unit of @calc-time (Since 8.2)
4c437254 1949#
5034e3d4
AG
1950# @sample-pages: number of sampled pages per GiB of guest memory.
1951# Valid only in page-sampling mode (Since 6.1)
7afa08cd 1952#
5034e3d4 1953# @mode: mode that was used to measure dirty page rate (Since 6.2)
0e21bf24 1954#
5034e3d4 1955# @vcpu-dirty-rate: dirty rate for each vCPU if dirty-ring mode was
a937b6aa 1956# specified (Since 6.2)
0e21bf24 1957#
4c437254 1958# Since: 5.2
4c437254
CZ
1959##
1960{ 'struct': 'DirtyRateInfo',
b1a859cf 1961 'data': {'*dirty-rate': 'int64',
4c437254
CZ
1962 'status': 'DirtyRateStatus',
1963 'start-time': 'int64',
7afa08cd 1964 'calc-time': 'int64',
34a68001 1965 'calc-time-unit': 'TimeUnit',
0e21bf24
HH
1966 'sample-pages': 'uint64',
1967 'mode': 'DirtyRateMeasureMode',
1968 '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
4c437254
CZ
1969
1970##
1971# @calc-dirty-rate:
1972#
5034e3d4
AG
1973# Start measuring dirty page rate of the VM. Results can be retrieved
1974# with @query-dirty-rate after measurements are completed.
1975#
1976# Dirty page rate is the number of pages changed in a given time
1977# period expressed in MiB/s. The following methods of calculation are
1978# available:
1979#
1980# 1. In page sampling mode, a random subset of pages are selected and
1981# hashed twice: once at the beginning of measurement time period,
1982# and once again at the end. If two hashes for some page are
1983# different, the page is counted as changed. Since this method
1984# relies on sampling and hashing, calculated dirty page rate is
1985# only an estimate of its true value. Increasing @sample-pages
1986# improves estimation quality at the cost of higher computational
1987# overhead.
1988#
1989# 2. Dirty bitmap mode captures writes to memory (for example by
1990# temporarily revoking write access to all pages) and counting page
1991# faults. Information about modified pages is collected into a
1992# bitmap, where each bit corresponds to one guest page. This mode
1993# requires that KVM accelerator property "dirty-ring-size" is *not*
1994# set.
1995#
1996# 3. Dirty ring mode is similar to dirty bitmap mode, but the
1997# information about modified pages is collected into ring buffer.
1998# This mode tracks page modification per each vCPU separately. It
1999# requires that KVM accelerator property "dirty-ring-size" is set.
2000#
34a68001
AG
2001# @calc-time: time period for which dirty page rate is calculated.
2002# By default it is specified in seconds, but the unit can be set
2003# explicitly with @calc-time-unit. Note that larger @calc-time
2004# values will typically result in smaller dirty page rates because
2005# page dirtying is a one-time event. Once some page is counted
2006# as dirty during @calc-time period, further writes to this page
2007# will not increase dirty page rate anymore.
2008#
2009# @calc-time-unit: time unit in which @calc-time is specified.
2010# By default it is seconds. (Since 8.2)
5034e3d4
AG
2011#
2012# @sample-pages: number of sampled pages per each GiB of guest memory.
2013# Default value is 512. For 4KiB guest pages this corresponds to
2014# sampling ratio of 0.2%. This argument is used only in page
2015# sampling mode. (Since 6.1)
2016#
2017# @mode: mechanism for tracking dirty pages. Default value is
2018# 'page-sampling'. Others are 'dirty-bitmap' and 'dirty-ring'.
2019# (Since 6.1)
0e21bf24 2020#
4c437254
CZ
2021# Since: 5.2
2022#
2023# Example:
4ae65a52 2024#
37fa48a4
MA
2025# -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
2026# 'sample-pages': 512} }
2027# <- { "return": {} }
34a68001
AG
2028#
2029# Measure dirty rate using dirty bitmap for 500 milliseconds:
2030#
2031# -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 500,
2032# "calc-time-unit": "millisecond", "mode": "dirty-bitmap"} }
2033#
2034# <- { "return": {} }
4c437254 2035##
7afa08cd 2036{ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
34a68001 2037 '*calc-time-unit': 'TimeUnit',
0e21bf24
HH
2038 '*sample-pages': 'int',
2039 '*mode': 'DirtyRateMeasureMode'} }
4c437254
CZ
2040
2041##
2042# @query-dirty-rate:
2043#
5034e3d4 2044# Query results of the most recent invocation of @calc-dirty-rate.
4c437254 2045#
34a68001
AG
2046# @calc-time-unit: time unit in which to report calculation time.
2047# By default it is reported in seconds. (Since 8.2)
2048#
4c437254 2049# Since: 5.2
5034e3d4
AG
2050#
2051# Examples:
2052#
2053# 1. Measurement is in progress:
2054#
2055# <- {"status": "measuring", "sample-pages": 512,
320a6ccc 2056# "mode": "page-sampling", "start-time": 1693900454, "calc-time": 10,
34a68001 2057# "calc-time-unit": "second"}
5034e3d4
AG
2058#
2059# 2. Measurement has been completed:
2060#
2061# <- {"status": "measured", "sample-pages": 512, "dirty-rate": 108,
320a6ccc 2062# "mode": "page-sampling", "start-time": 1693900454, "calc-time": 10,
34a68001 2063# "calc-time-unit": "second"}
4c437254 2064##
34a68001
AG
2065{ 'command': 'query-dirty-rate', 'data': {'*calc-time-unit': 'TimeUnit' },
2066 'returns': 'DirtyRateInfo' }
0f0d83a4 2067
f3b2e38c
HH
2068##
2069# @DirtyLimitInfo:
2070#
2071# Dirty page rate limit information of a virtual CPU.
2072#
2073# @cpu-index: index of a virtual CPU.
2074#
2075# @limit-rate: upper limit of dirty page rate (MB/s) for a virtual
a937b6aa 2076# CPU, 0 means unlimited.
f3b2e38c
HH
2077#
2078# @current-rate: current dirty page rate (MB/s) for a virtual CPU.
2079#
2080# Since: 7.1
f3b2e38c
HH
2081##
2082{ 'struct': 'DirtyLimitInfo',
2083 'data': { 'cpu-index': 'int',
2084 'limit-rate': 'uint64',
2085 'current-rate': 'uint64' } }
2086
2087##
2088# @set-vcpu-dirty-limit:
2089#
2090# Set the upper limit of dirty page rate for virtual CPUs.
2091#
a937b6aa
MA
2092# Requires KVM with accelerator property "dirty-ring-size" set. A
2093# virtual CPU's dirty page rate is a measure of its memory load. To
2094# observe dirty page rates, use @calc-dirty-rate.
f3b2e38c
HH
2095#
2096# @cpu-index: index of a virtual CPU, default is all.
2097#
2098# @dirty-rate: upper limit of dirty page rate (MB/s) for virtual CPUs.
2099#
2100# Since: 7.1
2101#
2102# Example:
37fa48a4
MA
2103#
2104# -> {"execute": "set-vcpu-dirty-limit"}
2105# "arguments": { "dirty-rate": 200,
2106# "cpu-index": 1 } }
2107# <- { "return": {} }
f3b2e38c
HH
2108##
2109{ 'command': 'set-vcpu-dirty-limit',
2110 'data': { '*cpu-index': 'int',
2111 'dirty-rate': 'uint64' } }
2112
2113##
2114# @cancel-vcpu-dirty-limit:
2115#
2116# Cancel the upper limit of dirty page rate for virtual CPUs.
2117#
2118# Cancel the dirty page limit for the vCPU which has been set with
a937b6aa 2119# set-vcpu-dirty-limit command. Note that this command requires
f3b2e38c
HH
2120# support from dirty ring, same as the "set-vcpu-dirty-limit".
2121#
2122# @cpu-index: index of a virtual CPU, default is all.
2123#
2124# Since: 7.1
2125#
2126# Example:
37fa48a4
MA
2127#
2128# -> {"execute": "cancel-vcpu-dirty-limit"},
2129# "arguments": { "cpu-index": 1 } }
2130# <- { "return": {} }
f3b2e38c
HH
2131##
2132{ 'command': 'cancel-vcpu-dirty-limit',
2133 'data': { '*cpu-index': 'int'} }
2134
2135##
2136# @query-vcpu-dirty-limit:
2137#
a937b6aa
MA
2138# Returns information about virtual CPU dirty page rate limits, if
2139# any.
f3b2e38c
HH
2140#
2141# Since: 7.1
2142#
2143# Example:
37fa48a4
MA
2144#
2145# -> {"execute": "query-vcpu-dirty-limit"}
2146# <- {"return": [
2147# { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
2148# { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
f3b2e38c
HH
2149##
2150{ 'command': 'query-vcpu-dirty-limit',
2151 'returns': [ 'DirtyLimitInfo' ] }
2152
67132620
JJ
2153##
2154# @MigrationThreadInfo:
2155#
2156# Information about migrationthreads
2157#
2158# @name: the name of migration thread
2159#
2160# @thread-id: ID of the underlying host thread
2161#
2162# Since: 7.2
2163##
2164{ 'struct': 'MigrationThreadInfo',
2165 'data': {'name': 'str',
2166 'thread-id': 'int'} }
2167
2168##
2169# @query-migrationthreads:
2170#
2171# Returns information of migration threads
2172#
2173# data: migration thread name
2174#
7c3def93 2175# Returns: information about migration threads
67132620
JJ
2176#
2177# Since: 7.2
2178##
2179{ 'command': 'query-migrationthreads',
2180 'returns': ['MigrationThreadInfo'] }
2181
0f0d83a4
DB
2182##
2183# @snapshot-save:
2184#
2185# Save a VM snapshot
2186#
2187# @job-id: identifier for the newly created job
a937b6aa 2188#
0f0d83a4 2189# @tag: name of the snapshot to create
a937b6aa 2190#
0f0d83a4 2191# @vmstate: block device node name to save vmstate to
a937b6aa 2192#
0f0d83a4
DB
2193# @devices: list of block device node names to save a snapshot to
2194#
2195# Applications should not assume that the snapshot save is complete
a937b6aa
MA
2196# when this command returns. The job commands / events must be used
2197# to determine completion and to fetch details of any errors that
2198# arise.
0f0d83a4 2199#
a937b6aa
MA
2200# Note that execution of the guest CPUs may be stopped during the time
2201# it takes to save the snapshot. A future version of QEMU may ensure
2202# CPUs are executing continuously.
0f0d83a4 2203#
a937b6aa
MA
2204# It is strongly recommended that @devices contain all writable block
2205# device nodes if a consistent snapshot is required.
0f0d83a4
DB
2206#
2207# If @tag already exists, an error will be reported
2208#
2209# Returns: nothing
2210#
2211# Example:
2212#
2213# -> { "execute": "snapshot-save",
b1ca5322 2214# "arguments": {
0f0d83a4
DB
2215# "job-id": "snapsave0",
2216# "tag": "my-snap",
2217# "vmstate": "disk0",
2218# "devices": ["disk0", "disk1"]
2219# }
2220# }
2221# <- { "return": { } }
2222# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2223# "timestamp": {"seconds": 1432121972, "microseconds": 744001},
0f0d83a4
DB
2224# "data": {"status": "created", "id": "snapsave0"}}
2225# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2226# "timestamp": {"seconds": 1432122172, "microseconds": 744001},
0f0d83a4 2227# "data": {"status": "running", "id": "snapsave0"}}
6e7a37ff
VT
2228# <- {"event": "STOP",
2229# "timestamp": {"seconds": 1432122372, "microseconds": 744001} }
2230# <- {"event": "RESUME",
2231# "timestamp": {"seconds": 1432122572, "microseconds": 744001} }
0f0d83a4 2232# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2233# "timestamp": {"seconds": 1432122772, "microseconds": 744001},
0f0d83a4
DB
2234# "data": {"status": "waiting", "id": "snapsave0"}}
2235# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2236# "timestamp": {"seconds": 1432122972, "microseconds": 744001},
0f0d83a4
DB
2237# "data": {"status": "pending", "id": "snapsave0"}}
2238# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2239# "timestamp": {"seconds": 1432123172, "microseconds": 744001},
0f0d83a4
DB
2240# "data": {"status": "concluded", "id": "snapsave0"}}
2241# -> {"execute": "query-jobs"}
2242# <- {"return": [{"current-progress": 1,
2243# "status": "concluded",
2244# "total-progress": 1,
2245# "type": "snapshot-save",
2246# "id": "snapsave0"}]}
2247#
2248# Since: 6.0
2249##
2250{ 'command': 'snapshot-save',
2251 'data': { 'job-id': 'str',
2252 'tag': 'str',
2253 'vmstate': 'str',
2254 'devices': ['str'] } }
2255
2256##
2257# @snapshot-load:
2258#
2259# Load a VM snapshot
2260#
2261# @job-id: identifier for the newly created job
a937b6aa 2262#
0f0d83a4 2263# @tag: name of the snapshot to load.
a937b6aa 2264#
0f0d83a4 2265# @vmstate: block device node name to load vmstate from
a937b6aa 2266#
0f0d83a4
DB
2267# @devices: list of block device node names to load a snapshot from
2268#
2269# Applications should not assume that the snapshot load is complete
a937b6aa
MA
2270# when this command returns. The job commands / events must be used
2271# to determine completion and to fetch details of any errors that
2272# arise.
0f0d83a4
DB
2273#
2274# Note that execution of the guest CPUs will be stopped during the
2275# time it takes to load the snapshot.
2276#
a937b6aa
MA
2277# It is strongly recommended that @devices contain all writable block
2278# device nodes that can have changed since the original @snapshot-save
2279# command execution.
0f0d83a4
DB
2280#
2281# Returns: nothing
2282#
2283# Example:
2284#
2285# -> { "execute": "snapshot-load",
b1ca5322 2286# "arguments": {
0f0d83a4
DB
2287# "job-id": "snapload0",
2288# "tag": "my-snap",
2289# "vmstate": "disk0",
2290# "devices": ["disk0", "disk1"]
2291# }
2292# }
2293# <- { "return": { } }
2294# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2295# "timestamp": {"seconds": 1472124172, "microseconds": 744001},
0f0d83a4
DB
2296# "data": {"status": "created", "id": "snapload0"}}
2297# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2298# "timestamp": {"seconds": 1472125172, "microseconds": 744001},
0f0d83a4 2299# "data": {"status": "running", "id": "snapload0"}}
6e7a37ff
VT
2300# <- {"event": "STOP",
2301# "timestamp": {"seconds": 1472125472, "microseconds": 744001} }
2302# <- {"event": "RESUME",
2303# "timestamp": {"seconds": 1472125872, "microseconds": 744001} }
0f0d83a4 2304# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2305# "timestamp": {"seconds": 1472126172, "microseconds": 744001},
0f0d83a4
DB
2306# "data": {"status": "waiting", "id": "snapload0"}}
2307# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2308# "timestamp": {"seconds": 1472127172, "microseconds": 744001},
0f0d83a4
DB
2309# "data": {"status": "pending", "id": "snapload0"}}
2310# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2311# "timestamp": {"seconds": 1472128172, "microseconds": 744001},
0f0d83a4
DB
2312# "data": {"status": "concluded", "id": "snapload0"}}
2313# -> {"execute": "query-jobs"}
2314# <- {"return": [{"current-progress": 1,
2315# "status": "concluded",
2316# "total-progress": 1,
2317# "type": "snapshot-load",
2318# "id": "snapload0"}]}
2319#
2320# Since: 6.0
2321##
2322{ 'command': 'snapshot-load',
2323 'data': { 'job-id': 'str',
2324 'tag': 'str',
2325 'vmstate': 'str',
2326 'devices': ['str'] } }
2327
2328##
2329# @snapshot-delete:
2330#
2331# Delete a VM snapshot
2332#
2333# @job-id: identifier for the newly created job
a937b6aa 2334#
0f0d83a4 2335# @tag: name of the snapshot to delete.
a937b6aa 2336#
0f0d83a4
DB
2337# @devices: list of block device node names to delete a snapshot from
2338#
2339# Applications should not assume that the snapshot delete is complete
a937b6aa
MA
2340# when this command returns. The job commands / events must be used
2341# to determine completion and to fetch details of any errors that
2342# arise.
0f0d83a4
DB
2343#
2344# Returns: nothing
2345#
2346# Example:
2347#
2348# -> { "execute": "snapshot-delete",
b1ca5322 2349# "arguments": {
0f0d83a4
DB
2350# "job-id": "snapdelete0",
2351# "tag": "my-snap",
2352# "devices": ["disk0", "disk1"]
2353# }
2354# }
2355# <- { "return": { } }
2356# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2357# "timestamp": {"seconds": 1442124172, "microseconds": 744001},
0f0d83a4
DB
2358# "data": {"status": "created", "id": "snapdelete0"}}
2359# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2360# "timestamp": {"seconds": 1442125172, "microseconds": 744001},
0f0d83a4
DB
2361# "data": {"status": "running", "id": "snapdelete0"}}
2362# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2363# "timestamp": {"seconds": 1442126172, "microseconds": 744001},
0f0d83a4
DB
2364# "data": {"status": "waiting", "id": "snapdelete0"}}
2365# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2366# "timestamp": {"seconds": 1442127172, "microseconds": 744001},
0f0d83a4
DB
2367# "data": {"status": "pending", "id": "snapdelete0"}}
2368# <- {"event": "JOB_STATUS_CHANGE",
6e7a37ff 2369# "timestamp": {"seconds": 1442128172, "microseconds": 744001},
0f0d83a4
DB
2370# "data": {"status": "concluded", "id": "snapdelete0"}}
2371# -> {"execute": "query-jobs"}
2372# <- {"return": [{"current-progress": 1,
2373# "status": "concluded",
2374# "total-progress": 1,
2375# "type": "snapshot-delete",
2376# "id": "snapdelete0"}]}
2377#
2378# Since: 6.0
2379##
2380{ 'command': 'snapshot-delete',
2381 'data': { 'job-id': 'str',
2382 'tag': 'str',
2383 'devices': ['str'] } }