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