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