qapi/qdev: Tidy up device_add documentation
[qemu/armbru.git] / qapi / migration.json
blob2a6565a0f8ee777758997bfb4b8a7135986a189c
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Migration
7 ##
9 { 'include': 'common.json' }
10 { 'include': 'sockets.json' }
13 # @MigrationStats:
15 # Detailed migration status.
17 # @transferred: amount of bytes already transferred to the target VM
19 # @remaining: amount of bytes remaining to be transferred to the
20 #     target VM
22 # @total: total amount of bytes involved in the migration process
24 # @duplicate: number of duplicate (zero) pages (since 1.2)
26 # @skipped: number of skipped zero pages (since 1.5)
28 # @normal: number of normal pages (since 1.2)
30 # @normal-bytes: number of normal bytes sent (since 1.2)
32 # @dirty-pages-rate: number of pages dirtied by second by the guest
33 #     (since 1.3)
35 # @mbps: throughput in megabits/sec.  (since 1.6)
37 # @dirty-sync-count: number of times that dirty ram was synchronized
38 #     (since 2.1)
40 # @postcopy-requests: The number of page requests received from the
41 #     destination (since 2.7)
43 # @page-size: The number of bytes per page for the various page-based
44 #     statistics (since 2.10)
46 # @multifd-bytes: The number of bytes sent through multifd (since 3.0)
48 # @pages-per-second: the number of memory pages transferred per second
49 #     (Since 4.0)
51 # @precopy-bytes: The number of bytes sent in the pre-copy phase
52 #     (since 7.0).
54 # @downtime-bytes: The number of bytes sent while the guest is paused
55 #     (since 7.0).
57 # @postcopy-bytes: The number of bytes sent during the post-copy phase
58 #     (since 7.0).
60 # @dirty-sync-missed-zero-copy: Number of times dirty RAM
61 #     synchronization could not avoid copying dirty pages.  This is
62 #     between 0 and @dirty-sync-count * @multifd-channels.  (since
63 #     7.1)
65 # Since: 0.14
67 { 'struct': 'MigrationStats',
68   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
69            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
70            'normal-bytes': 'int', 'dirty-pages-rate': 'int',
71            'mbps': 'number', 'dirty-sync-count': 'int',
72            'postcopy-requests': 'int', 'page-size': 'int',
73            'multifd-bytes': 'uint64', 'pages-per-second': 'uint64',
74            'precopy-bytes': 'uint64', 'downtime-bytes': 'uint64',
75            'postcopy-bytes': 'uint64',
76            'dirty-sync-missed-zero-copy': 'uint64' } }
79 # @XBZRLECacheStats:
81 # Detailed XBZRLE migration cache statistics
83 # @cache-size: XBZRLE cache size
85 # @bytes: amount of bytes already transferred to the target VM
87 # @pages: amount of pages transferred to the target VM
89 # @cache-miss: number of cache miss
91 # @cache-miss-rate: rate of cache miss (since 2.1)
93 # @encoding-rate: rate of encoded bytes (since 5.1)
95 # @overflow: number of overflows
97 # Since: 1.2
99 { 'struct': 'XBZRLECacheStats',
100   'data': {'cache-size': 'size', 'bytes': 'int', 'pages': 'int',
101            'cache-miss': 'int', 'cache-miss-rate': 'number',
102            'encoding-rate': 'number', 'overflow': 'int' } }
105 # @CompressionStats:
107 # Detailed migration compression statistics
109 # @pages: amount of pages compressed and transferred to the target VM
111 # @busy: count of times that no free thread was available to compress
112 #     data
114 # @busy-rate: rate of thread busy
116 # @compressed-size: amount of bytes after compression
118 # @compression-rate: rate of compressed size
120 # Since: 3.1
122 { 'struct': 'CompressionStats',
123   'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number',
124            'compressed-size': 'int', 'compression-rate': 'number' } }
127 # @MigrationStatus:
129 # An enumeration of migration status.
131 # @none: no migration has ever happened.
133 # @setup: migration process has been initiated.
135 # @cancelling: in the process of cancelling migration.
137 # @cancelled: cancelling migration is finished.
139 # @active: in the process of doing migration.
141 # @postcopy-active: like active, but now in postcopy mode.  (since
142 #     2.5)
144 # @postcopy-paused: during postcopy but paused.  (since 3.0)
146 # @postcopy-recover: trying to recover from a paused postcopy.  (since
147 #     3.0)
149 # @completed: migration is finished.
151 # @failed: some error occurred during migration process.
153 # @colo: VM is in the process of fault tolerance, VM can not get into
154 #     this state unless colo capability is enabled for migration.
155 #     (since 2.8)
157 # @pre-switchover: Paused before device serialisation.  (since 2.11)
159 # @device: During device serialisation when pause-before-switchover is
160 #     enabled (since 2.11)
162 # @wait-unplug: wait for device unplug request by guest OS to be
163 #     completed.  (since 4.2)
165 # Since: 2.3
167 { 'enum': 'MigrationStatus',
168   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
169             'active', 'postcopy-active', 'postcopy-paused',
170             'postcopy-recover', 'completed', 'failed', 'colo',
171             'pre-switchover', 'device', 'wait-unplug' ] }
173 # @VfioStats:
175 # Detailed VFIO devices migration statistics
177 # @transferred: amount of bytes transferred to the target VM by VFIO
178 #     devices
180 # Since: 5.2
182 { 'struct': 'VfioStats',
183   'data': {'transferred': 'int' } }
186 # @MigrationInfo:
188 # Information about current migration process.
190 # @status: @MigrationStatus describing the current migration status.
191 #     If this field is not returned, no migration process has been
192 #     initiated
194 # @ram: @MigrationStats containing detailed migration status, only
195 #     returned if status is 'active' or 'completed'(since 1.2)
197 # @disk: @MigrationStats containing detailed disk migration status,
198 #     only returned if status is 'active' and it is a block migration
200 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
201 #     migration statistics, only returned if XBZRLE feature is on and
202 #     status is 'active' or 'completed' (since 1.2)
204 # @total-time: total amount of milliseconds since migration started.
205 #     If migration has ended, it returns the total migration time.
206 #     (since 1.2)
208 # @downtime: only present when migration finishes correctly total
209 #     downtime in milliseconds for the guest.  (since 1.3)
211 # @expected-downtime: only present while migration is active expected
212 #     downtime in milliseconds for the guest in last walk of the dirty
213 #     bitmap.  (since 1.3)
215 # @setup-time: amount of setup time in milliseconds *before* the
216 #     iterations begin but *after* the QMP command is issued.  This is
217 #     designed to provide an accounting of any activities (such as
218 #     RDMA pinning) which may be expensive, but do not actually occur
219 #     during the iterative migration rounds themselves.  (since 1.6)
221 # @cpu-throttle-percentage: percentage of time guest cpus are being
222 #     throttled during auto-converge.  This is only present when
223 #     auto-converge has started throttling guest cpus.  (Since 2.7)
225 # @error-desc: the human readable error description string, when
226 #     @status is 'failed'. Clients should not attempt to parse the
227 #     error strings.  (Since 2.7)
229 # @postcopy-blocktime: total time when all vCPU were blocked during
230 #     postcopy live migration.  This is only present when the
231 #     postcopy-blocktime migration capability is enabled.  (Since 3.0)
233 # @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU.
234 #     This is only present when the postcopy-blocktime migration
235 #     capability is enabled.  (Since 3.0)
237 # @compression: migration compression statistics, only returned if
238 #     compression feature is on and status is 'active' or 'completed'
239 #     (Since 3.1)
241 # @socket-address: Only used for tcp, to know what the real port is
242 #     (Since 4.0)
244 # @vfio: @VfioStats containing detailed VFIO devices migration
245 #     statistics, only returned if VFIO device is present, migration
246 #     is supported by all VFIO devices and status is 'active' or
247 #     'completed' (since 5.2)
249 # @blocked-reasons: A list of reasons an outgoing migration is
250 #     blocked.  Present and non-empty when migration is blocked.
251 #     (since 6.0)
253 # Since: 0.14
255 { 'struct': 'MigrationInfo',
256   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
257            '*disk': 'MigrationStats',
258            '*vfio': 'VfioStats',
259            '*xbzrle-cache': 'XBZRLECacheStats',
260            '*total-time': 'int',
261            '*expected-downtime': 'int',
262            '*downtime': 'int',
263            '*setup-time': 'int',
264            '*cpu-throttle-percentage': 'int',
265            '*error-desc': 'str',
266            '*blocked-reasons': ['str'],
267            '*postcopy-blocktime': 'uint32',
268            '*postcopy-vcpu-blocktime': ['uint32'],
269            '*compression': 'CompressionStats',
270            '*socket-address': ['SocketAddress'] } }
273 # @query-migrate:
275 # Returns information about current migration process.  If migration
276 # is active there will be another json-object with RAM migration
277 # status and if block migration is active another one with block
278 # migration status.
280 # Returns: @MigrationInfo
282 # Since: 0.14
284 # Examples:
286 # 1. Before the first migration
288 # -> { "execute": "query-migrate" }
289 # <- { "return": {} }
291 # 2. Migration is done and has succeeded
293 # -> { "execute": "query-migrate" }
294 # <- { "return": {
295 #         "status": "completed",
296 #         "total-time":12345,
297 #         "setup-time":12345,
298 #         "downtime":12345,
299 #         "ram":{
300 #           "transferred":123,
301 #           "remaining":123,
302 #           "total":246,
303 #           "duplicate":123,
304 #           "normal":123,
305 #           "normal-bytes":123456,
306 #           "dirty-sync-count":15
307 #         }
308 #      }
309 #    }
311 # 3. Migration is done and has failed
313 # -> { "execute": "query-migrate" }
314 # <- { "return": { "status": "failed" } }
316 # 4. Migration is being performed and is not a block migration:
318 # -> { "execute": "query-migrate" }
319 # <- {
320 #       "return":{
321 #          "status":"active",
322 #          "total-time":12345,
323 #          "setup-time":12345,
324 #          "expected-downtime":12345,
325 #          "ram":{
326 #             "transferred":123,
327 #             "remaining":123,
328 #             "total":246,
329 #             "duplicate":123,
330 #             "normal":123,
331 #             "normal-bytes":123456,
332 #             "dirty-sync-count":15
333 #          }
334 #       }
335 #    }
337 # 5. Migration is being performed and is a block migration:
339 # -> { "execute": "query-migrate" }
340 # <- {
341 #       "return":{
342 #          "status":"active",
343 #          "total-time":12345,
344 #          "setup-time":12345,
345 #          "expected-downtime":12345,
346 #          "ram":{
347 #             "total":1057024,
348 #             "remaining":1053304,
349 #             "transferred":3720,
350 #             "duplicate":123,
351 #             "normal":123,
352 #             "normal-bytes":123456,
353 #             "dirty-sync-count":15
354 #          },
355 #          "disk":{
356 #             "total":20971520,
357 #             "remaining":20880384,
358 #             "transferred":91136
359 #          }
360 #       }
361 #    }
363 # 6. Migration is being performed and XBZRLE is active:
365 # -> { "execute": "query-migrate" }
366 # <- {
367 #       "return":{
368 #          "status":"active",
369 #          "total-time":12345,
370 #          "setup-time":12345,
371 #          "expected-downtime":12345,
372 #          "ram":{
373 #             "total":1057024,
374 #             "remaining":1053304,
375 #             "transferred":3720,
376 #             "duplicate":10,
377 #             "normal":3333,
378 #             "normal-bytes":3412992,
379 #             "dirty-sync-count":15
380 #          },
381 #          "xbzrle-cache":{
382 #             "cache-size":67108864,
383 #             "bytes":20971520,
384 #             "pages":2444343,
385 #             "cache-miss":2244,
386 #             "cache-miss-rate":0.123,
387 #             "encoding-rate":80.1,
388 #             "overflow":34434
389 #          }
390 #       }
391 #    }
393 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
396 # @MigrationCapability:
398 # Migration capabilities enumeration
400 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length
401 #     Encoding). This feature allows us to minimize migration traffic
402 #     for certain work loads, by sending compressed difference of the
403 #     pages
405 # @rdma-pin-all: Controls whether or not the entire VM memory
406 #     footprint is mlock()'d on demand or all at once.  Refer to
407 #     docs/rdma.txt for usage.  Disabled by default.  (since 2.0)
409 # @zero-blocks: During storage migration encode blocks of zeroes
410 #     efficiently.  This essentially saves 1MB of zeroes per block on
411 #     the wire.  Enabling requires source and target VM to support
412 #     this feature.  To enable it is sufficient to enable the
413 #     capability on the source VM. The feature is disabled by default.
414 #     (since 1.6)
416 # @compress: Use multiple compression threads to accelerate live
417 #     migration.  This feature can help to reduce the migration
418 #     traffic, by sending compressed pages.  Please note that if
419 #     compress and xbzrle are both on, compress only takes effect in
420 #     the ram bulk stage, after that, it will be disabled and only
421 #     xbzrle takes effect, this can help to minimize migration
422 #     traffic.  The feature is disabled by default.  (since 2.4 )
424 # @events: generate events for each migration state change (since 2.4
425 #     )
427 # @auto-converge: If enabled, QEMU will automatically throttle down
428 #     the guest to speed up convergence of RAM migration.  (since 1.6)
430 # @postcopy-ram: Start executing on the migration target before all of
431 #     RAM has been migrated, pulling the remaining pages along as
432 #     needed.  The capacity must have the same setting on both source
433 #     and target or migration will not even start.  NOTE: If the
434 #     migration fails during postcopy the VM will fail.  (since 2.6)
436 # @x-colo: If enabled, migration will never end, and the state of the
437 #     VM on the primary side will be migrated continuously to the VM
438 #     on secondary side, this process is called COarse-Grain LOck
439 #     Stepping (COLO) for Non-stop Service.  (since 2.8)
441 # @release-ram: if enabled, qemu will free the migrated ram pages on
442 #     the source during postcopy-ram migration.  (since 2.9)
444 # @block: If enabled, QEMU will also migrate the contents of all block
445 #     devices.  Default is disabled.  A possible alternative uses
446 #     mirror jobs to a builtin NBD server on the destination, which
447 #     offers more flexibility.  (Since 2.10)
449 # @return-path: If enabled, migration will use the return path even
450 #     for precopy.  (since 2.10)
452 # @pause-before-switchover: Pause outgoing migration before
453 #     serialising device state and before disabling block IO (since
454 #     2.11)
456 # @multifd: Use more than one fd for migration (since 4.0)
458 # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps.
459 #     (since 2.12)
461 # @postcopy-blocktime: Calculate downtime for postcopy live migration
462 #     (since 3.0)
464 # @late-block-activate: If enabled, the destination will not activate
465 #     block devices (and thus take locks) immediately at the end of
466 #     migration.  (since 3.0)
468 # @x-ignore-shared: If enabled, QEMU will not migrate shared memory that is
469 #     accessible on the destination machine. (since 4.0)
471 # @validate-uuid: Send the UUID of the source to allow the destination
472 #     to ensure it is the same.  (since 4.2)
474 # @background-snapshot: If enabled, the migration stream will be a
475 #     snapshot of the VM exactly at the point when the migration
476 #     procedure starts.  The VM RAM is saved with running VM. (since
477 #     6.0)
479 # @zero-copy-send: Controls behavior on sending memory pages on
480 #     migration.  When true, enables a zero-copy mechanism for sending
481 #     memory pages, if host supports it.  Requires that QEMU be
482 #     permitted to use locked memory for guest RAM pages.  (since 7.1)
484 # @postcopy-preempt: If enabled, the migration process will allow
485 #     postcopy requests to preempt precopy stream, so postcopy
486 #     requests will be handled faster.  This is a performance feature
487 #     and should not affect the correctness of postcopy migration.
488 #     (since 7.1)
490 # @switchover-ack: If enabled, migration will not stop the source VM
491 #     and complete the migration until an ACK is received from the
492 #     destination that it's OK to do so.  Exactly when this ACK is
493 #     sent depends on the migrated devices that use this feature.
494 #     For example, a device can use it to make sure some of its data
495 #     is sent and loaded in the destination before doing switchover.
496 #     This can reduce downtime if devices that support this capability
497 #     are present.  'return-path' capability must be enabled to use
498 #     it.  (since 8.1)
500 # Features:
502 # @unstable: Members @x-colo and @x-ignore-shared are experimental.
504 # Since: 1.2
506 { 'enum': 'MigrationCapability',
507   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
508            'compress', 'events', 'postcopy-ram',
509            { 'name': 'x-colo', 'features': [ 'unstable' ] },
510            'release-ram',
511            'block', 'return-path', 'pause-before-switchover', 'multifd',
512            'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
513            { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
514            'validate-uuid', 'background-snapshot',
515            'zero-copy-send', 'postcopy-preempt', 'switchover-ack'] }
518 # @MigrationCapabilityStatus:
520 # Migration capability information
522 # @capability: capability enum
524 # @state: capability state bool
526 # Since: 1.2
528 { 'struct': 'MigrationCapabilityStatus',
529   'data': { 'capability': 'MigrationCapability', 'state': 'bool' } }
532 # @migrate-set-capabilities:
534 # Enable/Disable the following migration capabilities (like xbzrle)
536 # @capabilities: json array of capability modifications to make
538 # Since: 1.2
540 # Example:
542 # -> { "execute": "migrate-set-capabilities" , "arguments":
543 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
544 # <- { "return": {} }
546 { 'command': 'migrate-set-capabilities',
547   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
550 # @query-migrate-capabilities:
552 # Returns information about the current migration capabilities status
554 # Returns: @MigrationCapabilityStatus
556 # Since: 1.2
558 # Example:
560 # -> { "execute": "query-migrate-capabilities" }
561 # <- { "return": [
562 #       {"state": false, "capability": "xbzrle"},
563 #       {"state": false, "capability": "rdma-pin-all"},
564 #       {"state": false, "capability": "auto-converge"},
565 #       {"state": false, "capability": "zero-blocks"},
566 #       {"state": false, "capability": "compress"},
567 #       {"state": true, "capability": "events"},
568 #       {"state": false, "capability": "postcopy-ram"},
569 #       {"state": false, "capability": "x-colo"}
570 #    ]}
572 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
575 # @MultiFDCompression:
577 # An enumeration of multifd compression methods.
579 # @none: no compression.
581 # @zlib: use zlib compression method.
583 # @zstd: use zstd compression method.
585 # Since: 5.0
587 { 'enum': 'MultiFDCompression',
588   'data': [ 'none', 'zlib',
589             { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
592 # @BitmapMigrationBitmapAliasTransform:
594 # @persistent: If present, the bitmap will be made persistent or
595 #     transient depending on this parameter.
597 # Since: 6.0
599 { 'struct': 'BitmapMigrationBitmapAliasTransform',
600   'data': {
601       '*persistent': 'bool'
602   } }
605 # @BitmapMigrationBitmapAlias:
607 # @name: The name of the bitmap.
609 # @alias: An alias name for migration (for example the bitmap name on
610 #     the opposite site).
612 # @transform: Allows the modification of the migrated bitmap.  (since
613 #     6.0)
615 # Since: 5.2
617 { 'struct': 'BitmapMigrationBitmapAlias',
618   'data': {
619       'name': 'str',
620       'alias': 'str',
621       '*transform': 'BitmapMigrationBitmapAliasTransform'
622   } }
625 # @BitmapMigrationNodeAlias:
627 # Maps a block node name and the bitmaps it has to aliases for dirty
628 # bitmap migration.
630 # @node-name: A block node name.
632 # @alias: An alias block node name for migration (for example the node
633 #     name on the opposite site).
635 # @bitmaps: Mappings for the bitmaps on this node.
637 # Since: 5.2
639 { 'struct': 'BitmapMigrationNodeAlias',
640   'data': {
641       'node-name': 'str',
642       'alias': 'str',
643       'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
644   } }
647 # @MigrationParameter:
649 # Migration parameters enumeration
651 # @announce-initial: Initial delay (in milliseconds) before sending
652 #     the first announce (Since 4.0)
654 # @announce-max: Maximum delay (in milliseconds) between packets in
655 #     the announcement (Since 4.0)
657 # @announce-rounds: Number of self-announce packets sent after
658 #     migration (Since 4.0)
660 # @announce-step: Increase in delay (in milliseconds) between
661 #     subsequent packets in the announcement (Since 4.0)
663 # @compress-level: Set the compression level to be used in live
664 #     migration, the compression level is an integer between 0 and 9,
665 #     where 0 means no compression, 1 means the best compression
666 #     speed, and 9 means best compression ratio which will consume
667 #     more CPU.
669 # @compress-threads: Set compression thread count to be used in live
670 #     migration, the compression thread count is an integer between 1
671 #     and 255.
673 # @compress-wait-thread: Controls behavior when all compression
674 #     threads are currently busy.  If true (default), wait for a free
675 #     compression thread to become available; otherwise, send the page
676 #     uncompressed.  (Since 3.1)
678 # @decompress-threads: Set decompression thread count to be used in
679 #     live migration, the decompression thread count is an integer
680 #     between 1 and 255. Usually, decompression is at least 4 times as
681 #     fast as compression, so set the decompress-threads to the number
682 #     about 1/4 of compress-threads is adequate.
684 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
685 #     bytes_xfer_period to trigger throttling.  It is expressed as
686 #     percentage.  The default value is 50. (Since 5.0)
688 # @cpu-throttle-initial: Initial percentage of time guest cpus are
689 #     throttled when migration auto-converge is activated.  The
690 #     default value is 20. (Since 2.7)
692 # @cpu-throttle-increment: throttle percentage increase each time
693 #     auto-converge detects that migration is not making progress.
694 #     The default value is 10. (Since 2.7)
696 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
697 #     the tail stage of throttling, the Guest is very sensitive to CPU
698 #     percentage while the @cpu-throttle -increment is excessive
699 #     usually at tail stage.  If this parameter is true, we will
700 #     compute the ideal CPU percentage used by the Guest, which may
701 #     exactly make the dirty rate match the dirty rate threshold.
702 #     Then we will choose a smaller throttle increment between the one
703 #     specified by @cpu-throttle-increment and the one generated by
704 #     ideal CPU percentage.  Therefore, it is compatible to
705 #     traditional throttling, meanwhile the throttle increment won't
706 #     be excessive at tail stage.  The default value is false.  (Since
707 #     5.1)
709 # @tls-creds: ID of the 'tls-creds' object that provides credentials
710 #     for establishing a TLS connection over the migration data
711 #     channel.  On the outgoing side of the migration, the credentials
712 #     must be for a 'client' endpoint, while for the incoming side the
713 #     credentials must be for a 'server' endpoint.  Setting this will
714 #     enable TLS for all migrations.  The default is unset, resulting
715 #     in unsecured migration at the QEMU level.  (Since 2.7)
717 # @tls-hostname: hostname of the target host for the migration.  This
718 #     is required when using x509 based TLS credentials and the
719 #     migration URI does not already include a hostname.  For example
720 #     if using fd: or exec: based migration, the hostname must be
721 #     provided so that the server's x509 certificate identity can be
722 #     validated.  (Since 2.7)
724 # @tls-authz: ID of the 'authz' object subclass that provides access
725 #     control checking of the TLS x509 certificate distinguished name.
726 #     This object is only resolved at time of use, so can be deleted
727 #     and recreated on the fly while the migration server is active.
728 #     If missing, it will default to denying access (Since 4.0)
730 # @max-bandwidth: to set maximum speed for migration.  maximum speed
731 #     in bytes per second.  (Since 2.8)
733 # @downtime-limit: set maximum tolerated downtime for migration.
734 #     maximum downtime in milliseconds (Since 2.8)
736 # @x-checkpoint-delay: The delay time (in ms) between two COLO
737 #     checkpoints in periodic mode.  (Since 2.8)
739 # @block-incremental: Affects how much storage is migrated when the
740 #     block migration capability is enabled.  When false, the entire
741 #     storage backing chain is migrated into a flattened image at the
742 #     destination; when true, only the active qcow2 layer is migrated
743 #     and the destination must already have access to the same backing
744 #     chain as was used on the source.  (since 2.10)
746 # @multifd-channels: Number of channels used to migrate data in
747 #     parallel.  This is the same number that the number of sockets
748 #     used for migration.  The default value is 2 (since 4.0)
750 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
751 #     needs to be a multiple of the target page size and a power of 2
752 #     (Since 2.11)
754 # @max-postcopy-bandwidth: Background transfer bandwidth during
755 #     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
756 #     (Since 3.0)
758 # @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
759 #     (Since 3.1)
761 # @multifd-compression: Which compression method to use.  Defaults to
762 #     none.  (Since 5.0)
764 # @multifd-zlib-level: Set the compression level to be used in live
765 #     migration, the compression level is an integer between 0 and 9,
766 #     where 0 means no compression, 1 means the best compression
767 #     speed, and 9 means best compression ratio which will consume
768 #     more CPU. Defaults to 1. (Since 5.0)
770 # @multifd-zstd-level: Set the compression level to be used in live
771 #     migration, the compression level is an integer between 0 and 20,
772 #     where 0 means no compression, 1 means the best compression
773 #     speed, and 20 means best compression ratio which will consume
774 #     more CPU. Defaults to 1. (Since 5.0)
776 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
777 #     aliases for the purpose of dirty bitmap migration.  Such aliases
778 #     may for example be the corresponding names on the opposite site.
779 #     The mapping must be one-to-one, but not necessarily complete: On
780 #     the source, unmapped bitmaps and all bitmaps on unmapped nodes
781 #     will be ignored.  On the destination, encountering an unmapped
782 #     alias in the incoming migration stream will result in a report,
783 #     and all further bitmap migration data will then be discarded.
784 #     Note that the destination does not know about bitmaps it does
785 #     not receive, so there is no limitation or requirement regarding
786 #     the number of bitmaps received, or how they are named, or on
787 #     which nodes they are placed.  By default (when this parameter
788 #     has never been set), bitmap names are mapped to themselves.
789 #     Nodes are mapped to their block device name if there is one, and
790 #     to their node name otherwise.  (Since 5.2)
792 # Features:
794 # @unstable: Member @x-checkpoint-delay is experimental.
796 # Since: 2.4
798 { 'enum': 'MigrationParameter',
799   'data': ['announce-initial', 'announce-max',
800            'announce-rounds', 'announce-step',
801            'compress-level', 'compress-threads', 'decompress-threads',
802            'compress-wait-thread', 'throttle-trigger-threshold',
803            'cpu-throttle-initial', 'cpu-throttle-increment',
804            'cpu-throttle-tailslow',
805            'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth',
806            'downtime-limit',
807            { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] },
808            'block-incremental',
809            'multifd-channels',
810            'xbzrle-cache-size', 'max-postcopy-bandwidth',
811            'max-cpu-throttle', 'multifd-compression',
812            'multifd-zlib-level' ,'multifd-zstd-level',
813            'block-bitmap-mapping' ] }
816 # @MigrateSetParameters:
818 # @announce-initial: Initial delay (in milliseconds) before sending
819 #     the first announce (Since 4.0)
821 # @announce-max: Maximum delay (in milliseconds) between packets in
822 #     the announcement (Since 4.0)
824 # @announce-rounds: Number of self-announce packets sent after
825 #     migration (Since 4.0)
827 # @announce-step: Increase in delay (in milliseconds) between
828 #     subsequent packets in the announcement (Since 4.0)
830 # @compress-level: compression level
832 # @compress-threads: compression thread count
834 # @compress-wait-thread: Controls behavior when all compression
835 #     threads are currently busy.  If true (default), wait for a free
836 #     compression thread to become available; otherwise, send the page
837 #     uncompressed.  (Since 3.1)
839 # @decompress-threads: decompression thread count
841 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
842 #     bytes_xfer_period to trigger throttling.  It is expressed as
843 #     percentage.  The default value is 50. (Since 5.0)
845 # @cpu-throttle-initial: Initial percentage of time guest cpus are
846 #     throttled when migration auto-converge is activated.  The
847 #     default value is 20. (Since 2.7)
849 # @cpu-throttle-increment: throttle percentage increase each time
850 #     auto-converge detects that migration is not making progress.
851 #     The default value is 10. (Since 2.7)
853 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
854 #     the tail stage of throttling, the Guest is very sensitive to CPU
855 #     percentage while the @cpu-throttle -increment is excessive
856 #     usually at tail stage.  If this parameter is true, we will
857 #     compute the ideal CPU percentage used by the Guest, which may
858 #     exactly make the dirty rate match the dirty rate threshold.
859 #     Then we will choose a smaller throttle increment between the one
860 #     specified by @cpu-throttle-increment and the one generated by
861 #     ideal CPU percentage.  Therefore, it is compatible to
862 #     traditional throttling, meanwhile the throttle increment won't
863 #     be excessive at tail stage.  The default value is false.  (Since
864 #     5.1)
866 # @tls-creds: ID of the 'tls-creds' object that provides credentials
867 #     for establishing a TLS connection over the migration data
868 #     channel.  On the outgoing side of the migration, the credentials
869 #     must be for a 'client' endpoint, while for the incoming side the
870 #     credentials must be for a 'server' endpoint.  Setting this to a
871 #     non-empty string enables TLS for all migrations.  An empty
872 #     string means that QEMU will use plain text mode for migration,
873 #     rather than TLS (Since 2.9) Previously (since 2.7), this was
874 #     reported by omitting tls-creds instead.
876 # @tls-hostname: hostname of the target host for the migration.  This
877 #     is required when using x509 based TLS credentials and the
878 #     migration URI does not already include a hostname.  For example
879 #     if using fd: or exec: based migration, the hostname must be
880 #     provided so that the server's x509 certificate identity can be
881 #     validated.  (Since 2.7) An empty string means that QEMU will use
882 #     the hostname associated with the migration URI, if any.  (Since
883 #     2.9) Previously (since 2.7), this was reported by omitting
884 #     tls-hostname instead.
886 # @max-bandwidth: to set maximum speed for migration.  maximum speed
887 #     in bytes per second.  (Since 2.8)
889 # @downtime-limit: set maximum tolerated downtime for migration.
890 #     maximum downtime in milliseconds (Since 2.8)
892 # @x-checkpoint-delay: the delay time between two COLO checkpoints.
893 #     (Since 2.8)
895 # @block-incremental: Affects how much storage is migrated when the
896 #     block migration capability is enabled.  When false, the entire
897 #     storage backing chain is migrated into a flattened image at the
898 #     destination; when true, only the active qcow2 layer is migrated
899 #     and the destination must already have access to the same backing
900 #     chain as was used on the source.  (since 2.10)
902 # @multifd-channels: Number of channels used to migrate data in
903 #     parallel.  This is the same number that the number of sockets
904 #     used for migration.  The default value is 2 (since 4.0)
906 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
907 #     needs to be a multiple of the target page size and a power of 2
908 #     (Since 2.11)
910 # @max-postcopy-bandwidth: Background transfer bandwidth during
911 #     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
912 #     (Since 3.0)
914 # @max-cpu-throttle: maximum cpu throttle percentage.  The default
915 #     value is 99. (Since 3.1)
917 # @multifd-compression: Which compression method to use.  Defaults to
918 #     none.  (Since 5.0)
920 # @multifd-zlib-level: Set the compression level to be used in live
921 #     migration, the compression level is an integer between 0 and 9,
922 #     where 0 means no compression, 1 means the best compression
923 #     speed, and 9 means best compression ratio which will consume
924 #     more CPU. Defaults to 1. (Since 5.0)
926 # @multifd-zstd-level: Set the compression level to be used in live
927 #     migration, the compression level is an integer between 0 and 20,
928 #     where 0 means no compression, 1 means the best compression
929 #     speed, and 20 means best compression ratio which will consume
930 #     more CPU. Defaults to 1. (Since 5.0)
932 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
933 #     aliases for the purpose of dirty bitmap migration.  Such aliases
934 #     may for example be the corresponding names on the opposite site.
935 #     The mapping must be one-to-one, but not necessarily complete: On
936 #     the source, unmapped bitmaps and all bitmaps on unmapped nodes
937 #     will be ignored.  On the destination, encountering an unmapped
938 #     alias in the incoming migration stream will result in a report,
939 #     and all further bitmap migration data will then be discarded.
940 #     Note that the destination does not know about bitmaps it does
941 #     not receive, so there is no limitation or requirement regarding
942 #     the number of bitmaps received, or how they are named, or on
943 #     which nodes they are placed.  By default (when this parameter
944 #     has never been set), bitmap names are mapped to themselves.
945 #     Nodes are mapped to their block device name if there is one, and
946 #     to their node name otherwise.  (Since 5.2)
948 # Features:
950 # @unstable: Member @x-checkpoint-delay is experimental.
952 # TODO: either fuse back into MigrationParameters, or make
953 #     MigrationParameters members mandatory
955 # Since: 2.4
957 { 'struct': 'MigrateSetParameters',
958   'data': { '*announce-initial': 'size',
959             '*announce-max': 'size',
960             '*announce-rounds': 'size',
961             '*announce-step': 'size',
962             '*compress-level': 'uint8',
963             '*compress-threads': 'uint8',
964             '*compress-wait-thread': 'bool',
965             '*decompress-threads': 'uint8',
966             '*throttle-trigger-threshold': 'uint8',
967             '*cpu-throttle-initial': 'uint8',
968             '*cpu-throttle-increment': 'uint8',
969             '*cpu-throttle-tailslow': 'bool',
970             '*tls-creds': 'StrOrNull',
971             '*tls-hostname': 'StrOrNull',
972             '*tls-authz': 'StrOrNull',
973             '*max-bandwidth': 'size',
974             '*downtime-limit': 'uint64',
975             '*x-checkpoint-delay': { 'type': 'uint32',
976                                      'features': [ 'unstable' ] },
977             '*block-incremental': 'bool',
978             '*multifd-channels': 'uint8',
979             '*xbzrle-cache-size': 'size',
980             '*max-postcopy-bandwidth': 'size',
981             '*max-cpu-throttle': 'uint8',
982             '*multifd-compression': 'MultiFDCompression',
983             '*multifd-zlib-level': 'uint8',
984             '*multifd-zstd-level': 'uint8',
985             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
988 # @migrate-set-parameters:
990 # Set various migration parameters.
992 # Since: 2.4
994 # Example:
996 # -> { "execute": "migrate-set-parameters" ,
997 #      "arguments": { "compress-level": 1 } }
998 # <- { "return": {} }
1000 { 'command': 'migrate-set-parameters', 'boxed': true,
1001   'data': 'MigrateSetParameters' }
1004 # @MigrationParameters:
1006 # The optional members aren't actually optional.
1008 # @announce-initial: Initial delay (in milliseconds) before sending
1009 #     the first announce (Since 4.0)
1011 # @announce-max: Maximum delay (in milliseconds) between packets in
1012 #     the announcement (Since 4.0)
1014 # @announce-rounds: Number of self-announce packets sent after
1015 #     migration (Since 4.0)
1017 # @announce-step: Increase in delay (in milliseconds) between
1018 #     subsequent packets in the announcement (Since 4.0)
1020 # @compress-level: compression level
1022 # @compress-threads: compression thread count
1024 # @compress-wait-thread: Controls behavior when all compression
1025 #     threads are currently busy.  If true (default), wait for a free
1026 #     compression thread to become available; otherwise, send the page
1027 #     uncompressed.  (Since 3.1)
1029 # @decompress-threads: decompression thread count
1031 # @throttle-trigger-threshold: The ratio of bytes_dirty_period and
1032 #     bytes_xfer_period to trigger throttling.  It is expressed as
1033 #     percentage.  The default value is 50. (Since 5.0)
1035 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1036 #     throttled when migration auto-converge is activated.  (Since
1037 #     2.7)
1039 # @cpu-throttle-increment: throttle percentage increase each time
1040 #     auto-converge detects that migration is not making progress.
1041 #     (Since 2.7)
1043 # @cpu-throttle-tailslow: Make CPU throttling slower at tail stage At
1044 #     the tail stage of throttling, the Guest is very sensitive to CPU
1045 #     percentage while the @cpu-throttle -increment is excessive
1046 #     usually at tail stage.  If this parameter is true, we will
1047 #     compute the ideal CPU percentage used by the Guest, which may
1048 #     exactly make the dirty rate match the dirty rate threshold.
1049 #     Then we will choose a smaller throttle increment between the one
1050 #     specified by @cpu-throttle-increment and the one generated by
1051 #     ideal CPU percentage.  Therefore, it is compatible to
1052 #     traditional throttling, meanwhile the throttle increment won't
1053 #     be excessive at tail stage.  The default value is false.  (Since
1054 #     5.1)
1056 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1057 #     for establishing a TLS connection over the migration data
1058 #     channel.  On the outgoing side of the migration, the credentials
1059 #     must be for a 'client' endpoint, while for the incoming side the
1060 #     credentials must be for a 'server' endpoint.  An empty string
1061 #     means that QEMU will use plain text mode for migration, rather
1062 #     than TLS (Since 2.7) Note: 2.8 reports this by omitting
1063 #     tls-creds instead.
1065 # @tls-hostname: hostname of the target host for the migration.  This
1066 #     is required when using x509 based TLS credentials and the
1067 #     migration URI does not already include a hostname.  For example
1068 #     if using fd: or exec: based migration, the hostname must be
1069 #     provided so that the server's x509 certificate identity can be
1070 #     validated.  (Since 2.7) An empty string means that QEMU will use
1071 #     the hostname associated with the migration URI, if any.  (Since
1072 #     2.9) Note: 2.8 reports this by omitting tls-hostname instead.
1074 # @tls-authz: ID of the 'authz' object subclass that provides access
1075 #     control checking of the TLS x509 certificate distinguished name.
1076 #     (Since 4.0)
1078 # @max-bandwidth: to set maximum speed for migration.  maximum speed
1079 #     in bytes per second.  (Since 2.8)
1081 # @downtime-limit: set maximum tolerated downtime for migration.
1082 #     maximum downtime in milliseconds (Since 2.8)
1084 # @x-checkpoint-delay: the delay time between two COLO checkpoints.
1085 #     (Since 2.8)
1087 # @block-incremental: Affects how much storage is migrated when the
1088 #     block migration capability is enabled.  When false, the entire
1089 #     storage backing chain is migrated into a flattened image at the
1090 #     destination; when true, only the active qcow2 layer is migrated
1091 #     and the destination must already have access to the same backing
1092 #     chain as was used on the source.  (since 2.10)
1094 # @multifd-channels: Number of channels used to migrate data in
1095 #     parallel.  This is the same number that the number of sockets
1096 #     used for migration.  The default value is 2 (since 4.0)
1098 # @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
1099 #     needs to be a multiple of the target page size and a power of 2
1100 #     (Since 2.11)
1102 # @max-postcopy-bandwidth: Background transfer bandwidth during
1103 #     postcopy.  Defaults to 0 (unlimited).  In bytes per second.
1104 #     (Since 3.0)
1106 # @max-cpu-throttle: maximum cpu throttle percentage.  Defaults to 99.
1107 #     (Since 3.1)
1109 # @multifd-compression: Which compression method to use.  Defaults to
1110 #     none.  (Since 5.0)
1112 # @multifd-zlib-level: Set the compression level to be used in live
1113 #     migration, the compression level is an integer between 0 and 9,
1114 #     where 0 means no compression, 1 means the best compression
1115 #     speed, and 9 means best compression ratio which will consume
1116 #     more CPU. Defaults to 1. (Since 5.0)
1118 # @multifd-zstd-level: Set the compression level to be used in live
1119 #     migration, the compression level is an integer between 0 and 20,
1120 #     where 0 means no compression, 1 means the best compression
1121 #     speed, and 20 means best compression ratio which will consume
1122 #     more CPU. Defaults to 1. (Since 5.0)
1124 # @block-bitmap-mapping: Maps block nodes and bitmaps on them to
1125 #     aliases for the purpose of dirty bitmap migration.  Such aliases
1126 #     may for example be the corresponding names on the opposite site.
1127 #     The mapping must be one-to-one, but not necessarily complete: On
1128 #     the source, unmapped bitmaps and all bitmaps on unmapped nodes
1129 #     will be ignored.  On the destination, encountering an unmapped
1130 #     alias in the incoming migration stream will result in a report,
1131 #     and all further bitmap migration data will then be discarded.
1132 #     Note that the destination does not know about bitmaps it does
1133 #     not receive, so there is no limitation or requirement regarding
1134 #     the number of bitmaps received, or how they are named, or on
1135 #     which nodes they are placed.  By default (when this parameter
1136 #     has never been set), bitmap names are mapped to themselves.
1137 #     Nodes are mapped to their block device name if there is one, and
1138 #     to their node name otherwise.  (Since 5.2)
1140 # Features:
1142 # @unstable: Member @x-checkpoint-delay is experimental.
1144 # Since: 2.4
1146 { 'struct': 'MigrationParameters',
1147   'data': { '*announce-initial': 'size',
1148             '*announce-max': 'size',
1149             '*announce-rounds': 'size',
1150             '*announce-step': 'size',
1151             '*compress-level': 'uint8',
1152             '*compress-threads': 'uint8',
1153             '*compress-wait-thread': 'bool',
1154             '*decompress-threads': 'uint8',
1155             '*throttle-trigger-threshold': 'uint8',
1156             '*cpu-throttle-initial': 'uint8',
1157             '*cpu-throttle-increment': 'uint8',
1158             '*cpu-throttle-tailslow': 'bool',
1159             '*tls-creds': 'str',
1160             '*tls-hostname': 'str',
1161             '*tls-authz': 'str',
1162             '*max-bandwidth': 'size',
1163             '*downtime-limit': 'uint64',
1164             '*x-checkpoint-delay': { 'type': 'uint32',
1165                                      'features': [ 'unstable' ] },
1166             '*block-incremental': 'bool',
1167             '*multifd-channels': 'uint8',
1168             '*xbzrle-cache-size': 'size',
1169             '*max-postcopy-bandwidth': 'size',
1170             '*max-cpu-throttle': 'uint8',
1171             '*multifd-compression': 'MultiFDCompression',
1172             '*multifd-zlib-level': 'uint8',
1173             '*multifd-zstd-level': 'uint8',
1174             '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
1177 # @query-migrate-parameters:
1179 # Returns information about the current migration parameters
1181 # Returns: @MigrationParameters
1183 # Since: 2.4
1185 # Example:
1187 # -> { "execute": "query-migrate-parameters" }
1188 # <- { "return": {
1189 #          "decompress-threads": 2,
1190 #          "cpu-throttle-increment": 10,
1191 #          "compress-threads": 8,
1192 #          "compress-level": 1,
1193 #          "cpu-throttle-initial": 20,
1194 #          "max-bandwidth": 33554432,
1195 #          "downtime-limit": 300
1196 #       }
1197 #    }
1199 { 'command': 'query-migrate-parameters',
1200   'returns': 'MigrationParameters' }
1203 # @migrate-start-postcopy:
1205 # Followup to a migration command to switch the migration to postcopy
1206 # mode.  The postcopy-ram capability must be set on both source and
1207 # destination before the original migration command.
1209 # Since: 2.5
1211 # Example:
1213 # -> { "execute": "migrate-start-postcopy" }
1214 # <- { "return": {} }
1216 { 'command': 'migrate-start-postcopy' }
1219 # @MIGRATION:
1221 # Emitted when a migration event happens
1223 # @status: @MigrationStatus describing the current migration status.
1225 # Since: 2.4
1227 # Example:
1229 # <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
1230 #     "event": "MIGRATION",
1231 #     "data": {"status": "completed"} }
1233 { 'event': 'MIGRATION',
1234   'data': {'status': 'MigrationStatus'}}
1237 # @MIGRATION_PASS:
1239 # Emitted from the source side of a migration at the start of each
1240 # pass (when it syncs the dirty bitmap)
1242 # @pass: An incrementing count (starting at 1 on the first pass)
1244 # Since: 2.6
1246 # Example:
1248 # <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
1249 #       "event": "MIGRATION_PASS", "data": {"pass": 2} }
1251 { 'event': 'MIGRATION_PASS',
1252   'data': { 'pass': 'int' } }
1255 # @COLOMessage:
1257 # The message transmission between Primary side and Secondary side.
1259 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1261 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for
1262 #     checkpointing
1264 # @checkpoint-reply: SVM gets PVM's checkpoint request
1266 # @vmstate-send: VM's state will be sent by PVM.
1268 # @vmstate-size: The total size of VMstate.
1270 # @vmstate-received: VM's state has been received by SVM.
1272 # @vmstate-loaded: VM's state has been loaded by SVM.
1274 # Since: 2.8
1276 { 'enum': 'COLOMessage',
1277   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1278             'vmstate-send', 'vmstate-size', 'vmstate-received',
1279             'vmstate-loaded' ] }
1282 # @COLOMode:
1284 # The COLO current mode.
1286 # @none: COLO is disabled.
1288 # @primary: COLO node in primary side.
1290 # @secondary: COLO node in slave side.
1292 # Since: 2.8
1294 { 'enum': 'COLOMode',
1295   'data': [ 'none', 'primary', 'secondary'] }
1298 # @FailoverStatus:
1300 # An enumeration of COLO failover status
1302 # @none: no failover has ever happened
1304 # @require: got failover requirement but not handled
1306 # @active: in the process of doing failover
1308 # @completed: finish the process of failover
1310 # @relaunch: restart the failover process, from 'none' -> 'completed'
1311 #     (Since 2.9)
1313 # Since: 2.8
1315 { 'enum': 'FailoverStatus',
1316   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1319 # @COLO_EXIT:
1321 # Emitted when VM finishes COLO mode due to some errors happening or
1322 # at the request of users.
1324 # @mode: report COLO mode when COLO exited.
1326 # @reason: describes the reason for the COLO exit.
1328 # Since: 3.1
1330 # Example:
1332 # <- { "timestamp": {"seconds": 2032141960, "microseconds": 417172},
1333 #      "event": "COLO_EXIT", "data": {"mode": "primary", "reason": "request" } }
1335 { 'event': 'COLO_EXIT',
1336   'data': {'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
1339 # @COLOExitReason:
1341 # The reason for a COLO exit.
1343 # @none: failover has never happened.  This state does not occur in
1344 #     the COLO_EXIT event, and is only visible in the result of
1345 #     query-colo-status.
1347 # @request: COLO exit is due to an external request.
1349 # @error: COLO exit is due to an internal error.
1351 # @processing: COLO is currently handling a failover (since 4.0).
1353 # Since: 3.1
1355 { 'enum': 'COLOExitReason',
1356   'data': [ 'none', 'request', 'error' , 'processing' ] }
1359 # @x-colo-lost-heartbeat:
1361 # Tell qemu that heartbeat is lost, request it to do takeover
1362 # procedures.  If this command is sent to the PVM, the Primary side
1363 # will exit COLO mode.  If sent to the Secondary, the Secondary side
1364 # will run failover work, then takes over server operation to become
1365 # the service VM.
1367 # Features:
1369 # @unstable: This command is experimental.
1371 # Since: 2.8
1373 # Example:
1375 # -> { "execute": "x-colo-lost-heartbeat" }
1376 # <- { "return": {} }
1378 { 'command': 'x-colo-lost-heartbeat',
1379   'features': [ 'unstable' ],
1380   'if': 'CONFIG_REPLICATION' }
1383 # @migrate_cancel:
1385 # Cancel the current executing migration process.
1387 # Returns: nothing on success
1389 # Notes: This command succeeds even if there is no migration process
1390 #     running.
1392 # Since: 0.14
1394 # Example:
1396 # -> { "execute": "migrate_cancel" }
1397 # <- { "return": {} }
1399 { 'command': 'migrate_cancel' }
1402 # @migrate-continue:
1404 # Continue migration when it's in a paused state.
1406 # @state: The state the migration is currently expected to be in
1408 # Returns: nothing on success
1410 # Since: 2.11
1412 # Example:
1414 # -> { "execute": "migrate-continue" , "arguments":
1415 #      { "state": "pre-switchover" } }
1416 # <- { "return": {} }
1418 { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
1421 # @migrate:
1423 # Migrates the current running guest to another Virtual Machine.
1425 # @uri: the Uniform Resource Identifier of the destination VM
1427 # @blk: do block migration (full disk copy)
1429 # @inc: incremental disk copy migration
1431 # @detach: this argument exists only for compatibility reasons and is
1432 #     ignored by QEMU
1434 # @resume: resume one paused migration, default "off". (since 3.0)
1436 # Returns: nothing on success
1438 # Since: 0.14
1440 # Notes:
1442 # 1. The 'query-migrate' command should be used to check migration's
1443 #    progress and final result (this information is provided by the
1444 #    'status' member)
1446 # 2. All boolean arguments default to false
1448 # 3. The user Monitor's "detach" argument is invalid in QMP and should
1449 #    not be used
1451 # Example:
1453 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1454 # <- { "return": {} }
1456 { 'command': 'migrate',
1457   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
1458            '*detach': 'bool', '*resume': 'bool' } }
1461 # @migrate-incoming:
1463 # Start an incoming migration, the qemu must have been started with
1464 # -incoming defer
1466 # @uri: The Uniform Resource Identifier identifying the source or
1467 #     address to listen on
1469 # Returns: nothing on success
1471 # Since: 2.3
1473 # Notes:
1475 # 1. It's a bad idea to use a string for the uri, but it needs
1476 #    to stay compatible with -incoming and the format of the uri
1477 #    is already exposed above libvirt.
1479 # 2. QEMU must be started with -incoming defer to allow
1480 #    migrate-incoming to be used.
1482 # 3. The uri format is the same as for -incoming
1484 # Example:
1486 # -> { "execute": "migrate-incoming",
1487 #      "arguments": { "uri": "tcp::4446" } }
1488 # <- { "return": {} }
1490 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1493 # @xen-save-devices-state:
1495 # Save the state of all devices to file.  The RAM and the block
1496 # devices of the VM are not saved by this command.
1498 # @filename: the file to save the state of the devices to as binary
1499 #     data.  See xen-save-devices-state.txt for a description of the
1500 #     binary format.
1502 # @live: Optional argument to ask QEMU to treat this command as part
1503 #     of a live migration.  Default to true.  (since 2.11)
1505 # Returns: Nothing on success
1507 # Since: 1.1
1509 # Example:
1511 # -> { "execute": "xen-save-devices-state",
1512 #      "arguments": { "filename": "/tmp/save" } }
1513 # <- { "return": {} }
1515 { 'command': 'xen-save-devices-state',
1516   'data': {'filename': 'str', '*live':'bool' } }
1519 # @xen-set-global-dirty-log:
1521 # Enable or disable the global dirty log mode.
1523 # @enable: true to enable, false to disable.
1525 # Returns: nothing
1527 # Since: 1.3
1529 # Example:
1531 # -> { "execute": "xen-set-global-dirty-log",
1532 #      "arguments": { "enable": true } }
1533 # <- { "return": {} }
1535 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1538 # @xen-load-devices-state:
1540 # Load the state of all devices from file.  The RAM and the block
1541 # devices of the VM are not loaded by this command.
1543 # @filename: the file to load the state of the devices from as binary
1544 #     data.  See xen-save-devices-state.txt for a description of the
1545 #     binary format.
1547 # Since: 2.7
1549 # Example:
1551 # -> { "execute": "xen-load-devices-state",
1552 #      "arguments": { "filename": "/tmp/resume" } }
1553 # <- { "return": {} }
1555 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1558 # @xen-set-replication:
1560 # Enable or disable replication.
1562 # @enable: true to enable, false to disable.
1564 # @primary: true for primary or false for secondary.
1566 # @failover: true to do failover, false to stop.  but cannot be
1567 #     specified if 'enable' is true.  default value is false.
1569 # Returns: nothing.
1571 # Example:
1573 # -> { "execute": "xen-set-replication",
1574 #      "arguments": {"enable": true, "primary": false} }
1575 # <- { "return": {} }
1577 # Since: 2.9
1579 { 'command': 'xen-set-replication',
1580   'data': { 'enable': 'bool', 'primary': 'bool', '*failover': 'bool' },
1581   'if': 'CONFIG_REPLICATION' }
1584 # @ReplicationStatus:
1586 # The result format for 'query-xen-replication-status'.
1588 # @error: true if an error happened, false if replication is normal.
1590 # @desc: the human readable error description string, when @error is
1591 #     'true'.
1593 # Since: 2.9
1595 { 'struct': 'ReplicationStatus',
1596   'data': { 'error': 'bool', '*desc': 'str' },
1597   'if': 'CONFIG_REPLICATION' }
1600 # @query-xen-replication-status:
1602 # Query replication status while the vm is running.
1604 # Returns: A @ReplicationStatus object showing the status.
1606 # Example:
1608 # -> { "execute": "query-xen-replication-status" }
1609 # <- { "return": { "error": false } }
1611 # Since: 2.9
1613 { 'command': 'query-xen-replication-status',
1614   'returns': 'ReplicationStatus',
1615   'if': 'CONFIG_REPLICATION' }
1618 # @xen-colo-do-checkpoint:
1620 # Xen uses this command to notify replication to trigger a checkpoint.
1622 # Returns: nothing.
1624 # Example:
1626 # -> { "execute": "xen-colo-do-checkpoint" }
1627 # <- { "return": {} }
1629 # Since: 2.9
1631 { 'command': 'xen-colo-do-checkpoint',
1632   'if': 'CONFIG_REPLICATION' }
1635 # @COLOStatus:
1637 # The result format for 'query-colo-status'.
1639 # @mode: COLO running mode.  If COLO is running, this field will
1640 #     return 'primary' or 'secondary'.
1642 # @last-mode: COLO last running mode.  If COLO is running, this field
1643 #     will return same like mode field, after failover we can use this
1644 #     field to get last colo mode.  (since 4.0)
1646 # @reason: describes the reason for the COLO exit.
1648 # Since: 3.1
1650 { 'struct': 'COLOStatus',
1651   'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
1652             'reason': 'COLOExitReason' },
1653   'if': 'CONFIG_REPLICATION' }
1656 # @query-colo-status:
1658 # Query COLO status while the vm is running.
1660 # Returns: A @COLOStatus object showing the status.
1662 # Example:
1664 # -> { "execute": "query-colo-status" }
1665 # <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
1667 # Since: 3.1
1669 { 'command': 'query-colo-status',
1670   'returns': 'COLOStatus',
1671   'if': 'CONFIG_REPLICATION' }
1674 # @migrate-recover:
1676 # Provide a recovery migration stream URI.
1678 # @uri: the URI to be used for the recovery of migration stream.
1680 # Returns: nothing.
1682 # Example:
1684 # -> { "execute": "migrate-recover",
1685 #      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
1686 # <- { "return": {} }
1688 # Since: 3.0
1690 { 'command': 'migrate-recover',
1691   'data': { 'uri': 'str' },
1692   'allow-oob': true }
1695 # @migrate-pause:
1697 # Pause a migration.  Currently it only supports postcopy.
1699 # Returns: nothing.
1701 # Example:
1703 # -> { "execute": "migrate-pause" }
1704 # <- { "return": {} }
1706 # Since: 3.0
1708 { 'command': 'migrate-pause', 'allow-oob': true }
1711 # @UNPLUG_PRIMARY:
1713 # Emitted from source side of a migration when migration state is
1714 # WAIT_UNPLUG. Device was unplugged by guest operating system.  Device
1715 # resources in QEMU are kept on standby to be able to re-plug it in
1716 # case of migration failure.
1718 # @device-id: QEMU device id of the unplugged device
1720 # Since: 4.2
1722 # Example:
1724 # <- { "event": "UNPLUG_PRIMARY",
1725 #      "data": { "device-id": "hostdev0" },
1726 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1728 { 'event': 'UNPLUG_PRIMARY',
1729   'data': { 'device-id': 'str' } }
1732 # @DirtyRateVcpu:
1734 # Dirty rate of vcpu.
1736 # @id: vcpu index.
1738 # @dirty-rate: dirty rate.
1740 # Since: 6.2
1742 { 'struct': 'DirtyRateVcpu',
1743   'data': { 'id': 'int', 'dirty-rate': 'int64' } }
1746 # @DirtyRateStatus:
1748 # Dirty page rate measurement status.
1750 # @unstarted: measuring thread has not been started yet
1752 # @measuring: measuring thread is running
1754 # @measured: dirty page rate is measured and the results are available
1756 # Since: 5.2
1758 { 'enum': 'DirtyRateStatus',
1759   'data': [ 'unstarted', 'measuring', 'measured'] }
1762 # @DirtyRateMeasureMode:
1764 # Method used to measure dirty page rate.  Differences between
1765 # available methods are explained in @calc-dirty-rate.
1767 # @page-sampling: use page sampling
1769 # @dirty-ring: use dirty ring
1771 # @dirty-bitmap: use dirty bitmap
1773 # Since: 6.2
1775 { 'enum': 'DirtyRateMeasureMode',
1776   'data': ['page-sampling', 'dirty-ring', 'dirty-bitmap'] }
1779 # @DirtyRateInfo:
1781 # Information about measured dirty page rate.
1783 # @dirty-rate: an estimate of the dirty page rate of the VM in units
1784 #     of MiB/s.  Value is present only when @status is 'measured'.
1786 # @status: current status of dirty page rate measurements
1788 # @start-time: start time in units of second for calculation
1790 # @calc-time: time period for which dirty page rate was measured
1791 #     (in seconds)
1793 # @sample-pages: number of sampled pages per GiB of guest memory.
1794 #     Valid only in page-sampling mode (Since 6.1)
1796 # @mode: mode that was used to measure dirty page rate (Since 6.2)
1798 # @vcpu-dirty-rate: dirty rate for each vCPU if dirty-ring mode was
1799 #     specified (Since 6.2)
1801 # Since: 5.2
1803 { 'struct': 'DirtyRateInfo',
1804   'data': {'*dirty-rate': 'int64',
1805            'status': 'DirtyRateStatus',
1806            'start-time': 'int64',
1807            'calc-time': 'int64',
1808            'sample-pages': 'uint64',
1809            'mode': 'DirtyRateMeasureMode',
1810            '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
1813 # @calc-dirty-rate:
1815 # Start measuring dirty page rate of the VM.  Results can be retrieved
1816 # with @query-dirty-rate after measurements are completed.
1818 # Dirty page rate is the number of pages changed in a given time
1819 # period expressed in MiB/s.  The following methods of calculation are
1820 # available:
1822 # 1. In page sampling mode, a random subset of pages are selected and
1823 #    hashed twice: once at the beginning of measurement time period,
1824 #    and once again at the end.  If two hashes for some page are
1825 #    different, the page is counted as changed.  Since this method
1826 #    relies on sampling and hashing, calculated dirty page rate is
1827 #    only an estimate of its true value.  Increasing @sample-pages
1828 #    improves estimation quality at the cost of higher computational
1829 #    overhead.
1831 # 2. Dirty bitmap mode captures writes to memory (for example by
1832 #    temporarily revoking write access to all pages) and counting page
1833 #    faults.  Information about modified pages is collected into a
1834 #    bitmap, where each bit corresponds to one guest page.  This mode
1835 #    requires that KVM accelerator property "dirty-ring-size" is *not*
1836 #    set.
1838 # 3. Dirty ring mode is similar to dirty bitmap mode, but the
1839 #    information about modified pages is collected into ring buffer.
1840 #    This mode tracks page modification per each vCPU separately.  It
1841 #    requires that KVM accelerator property "dirty-ring-size" is set.
1843 # @calc-time: time period in units of second for which dirty page rate
1844 #     is calculated.  Note that larger @calc-time values will
1845 #     typically result in smaller dirty page rates because page
1846 #     dirtying is a one-time event.  Once some page is counted as
1847 #     dirty during @calc-time period, further writes to this page will
1848 #     not increase dirty page rate anymore.
1850 # @sample-pages: number of sampled pages per each GiB of guest memory.
1851 #     Default value is 512.  For 4KiB guest pages this corresponds to
1852 #     sampling ratio of 0.2%.  This argument is used only in page
1853 #     sampling mode.  (Since 6.1)
1855 # @mode: mechanism for tracking dirty pages.  Default value is
1856 #     'page-sampling'.  Others are 'dirty-bitmap' and 'dirty-ring'.
1857 #     (Since 6.1)
1859 # Since: 5.2
1861 # Example:
1863 # -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
1864 #                                                 'sample-pages': 512} }
1865 # <- { "return": {} }
1867 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
1868                                          '*sample-pages': 'int',
1869                                          '*mode': 'DirtyRateMeasureMode'} }
1872 # @query-dirty-rate:
1874 # Query results of the most recent invocation of @calc-dirty-rate.
1876 # Since: 5.2
1878 # Examples:
1880 # 1. Measurement is in progress:
1882 # <- {"status": "measuring", "sample-pages": 512,
1883 #     "mode": "page-sampling", "start-time": 3665220, "calc-time": 10}
1885 # 2. Measurement has been completed:
1887 # <- {"status": "measured", "sample-pages": 512, "dirty-rate": 108,
1888 #     "mode": "page-sampling", "start-time": 3665220, "calc-time": 10}
1890 { 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
1893 # @DirtyLimitInfo:
1895 # Dirty page rate limit information of a virtual CPU.
1897 # @cpu-index: index of a virtual CPU.
1899 # @limit-rate: upper limit of dirty page rate (MB/s) for a virtual
1900 #     CPU, 0 means unlimited.
1902 # @current-rate: current dirty page rate (MB/s) for a virtual CPU.
1904 # Since: 7.1
1906 { 'struct': 'DirtyLimitInfo',
1907   'data': { 'cpu-index': 'int',
1908             'limit-rate': 'uint64',
1909             'current-rate': 'uint64' } }
1912 # @set-vcpu-dirty-limit:
1914 # Set the upper limit of dirty page rate for virtual CPUs.
1916 # Requires KVM with accelerator property "dirty-ring-size" set.  A
1917 # virtual CPU's dirty page rate is a measure of its memory load.  To
1918 # observe dirty page rates, use @calc-dirty-rate.
1920 # @cpu-index: index of a virtual CPU, default is all.
1922 # @dirty-rate: upper limit of dirty page rate (MB/s) for virtual CPUs.
1924 # Since: 7.1
1926 # Example:
1928 # -> {"execute": "set-vcpu-dirty-limit"}
1929 #     "arguments": { "dirty-rate": 200,
1930 #                    "cpu-index": 1 } }
1931 # <- { "return": {} }
1933 { 'command': 'set-vcpu-dirty-limit',
1934   'data': { '*cpu-index': 'int',
1935             'dirty-rate': 'uint64' } }
1938 # @cancel-vcpu-dirty-limit:
1940 # Cancel the upper limit of dirty page rate for virtual CPUs.
1942 # Cancel the dirty page limit for the vCPU which has been set with
1943 # set-vcpu-dirty-limit command.  Note that this command requires
1944 # support from dirty ring, same as the "set-vcpu-dirty-limit".
1946 # @cpu-index: index of a virtual CPU, default is all.
1948 # Since: 7.1
1950 # Example:
1952 # -> {"execute": "cancel-vcpu-dirty-limit"},
1953 #     "arguments": { "cpu-index": 1 } }
1954 # <- { "return": {} }
1956 { 'command': 'cancel-vcpu-dirty-limit',
1957   'data': { '*cpu-index': 'int'} }
1960 # @query-vcpu-dirty-limit:
1962 # Returns information about virtual CPU dirty page rate limits, if
1963 # any.
1965 # Since: 7.1
1967 # Example:
1969 # -> {"execute": "query-vcpu-dirty-limit"}
1970 # <- {"return": [
1971 #        { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
1972 #        { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
1974 { 'command': 'query-vcpu-dirty-limit',
1975   'returns': [ 'DirtyLimitInfo' ] }
1978 # @MigrationThreadInfo:
1980 # Information about migrationthreads
1982 # @name: the name of migration thread
1984 # @thread-id: ID of the underlying host thread
1986 # Since: 7.2
1988 { 'struct': 'MigrationThreadInfo',
1989   'data': {'name': 'str',
1990            'thread-id': 'int'} }
1993 # @query-migrationthreads:
1995 # Returns information of migration threads
1997 # data: migration thread name
1999 # Returns: information about migration threads
2001 # Since: 7.2
2003 { 'command': 'query-migrationthreads',
2004   'returns': ['MigrationThreadInfo'] }
2007 # @snapshot-save:
2009 # Save a VM snapshot
2011 # @job-id: identifier for the newly created job
2013 # @tag: name of the snapshot to create
2015 # @vmstate: block device node name to save vmstate to
2017 # @devices: list of block device node names to save a snapshot to
2019 # Applications should not assume that the snapshot save is complete
2020 # when this command returns.  The job commands / events must be used
2021 # to determine completion and to fetch details of any errors that
2022 # arise.
2024 # Note that execution of the guest CPUs may be stopped during the time
2025 # it takes to save the snapshot.  A future version of QEMU may ensure
2026 # CPUs are executing continuously.
2028 # It is strongly recommended that @devices contain all writable block
2029 # device nodes if a consistent snapshot is required.
2031 # If @tag already exists, an error will be reported
2033 # Returns: nothing
2035 # Example:
2037 # -> { "execute": "snapshot-save",
2038 #      "arguments": {
2039 #         "job-id": "snapsave0",
2040 #         "tag": "my-snap",
2041 #         "vmstate": "disk0",
2042 #         "devices": ["disk0", "disk1"]
2043 #      }
2044 #    }
2045 # <- { "return": { } }
2046 # <- {"event": "JOB_STATUS_CHANGE",
2047 #     "timestamp": {"seconds": 1432121972, "microseconds": 744001},
2048 #     "data": {"status": "created", "id": "snapsave0"}}
2049 # <- {"event": "JOB_STATUS_CHANGE",
2050 #     "timestamp": {"seconds": 1432122172, "microseconds": 744001},
2051 #     "data": {"status": "running", "id": "snapsave0"}}
2052 # <- {"event": "STOP",
2053 #     "timestamp": {"seconds": 1432122372, "microseconds": 744001} }
2054 # <- {"event": "RESUME",
2055 #     "timestamp": {"seconds": 1432122572, "microseconds": 744001} }
2056 # <- {"event": "JOB_STATUS_CHANGE",
2057 #     "timestamp": {"seconds": 1432122772, "microseconds": 744001},
2058 #     "data": {"status": "waiting", "id": "snapsave0"}}
2059 # <- {"event": "JOB_STATUS_CHANGE",
2060 #     "timestamp": {"seconds": 1432122972, "microseconds": 744001},
2061 #     "data": {"status": "pending", "id": "snapsave0"}}
2062 # <- {"event": "JOB_STATUS_CHANGE",
2063 #     "timestamp": {"seconds": 1432123172, "microseconds": 744001},
2064 #     "data": {"status": "concluded", "id": "snapsave0"}}
2065 # -> {"execute": "query-jobs"}
2066 # <- {"return": [{"current-progress": 1,
2067 #                 "status": "concluded",
2068 #                 "total-progress": 1,
2069 #                 "type": "snapshot-save",
2070 #                 "id": "snapsave0"}]}
2072 # Since: 6.0
2074 { 'command': 'snapshot-save',
2075   'data': { 'job-id': 'str',
2076             'tag': 'str',
2077             'vmstate': 'str',
2078             'devices': ['str'] } }
2081 # @snapshot-load:
2083 # Load a VM snapshot
2085 # @job-id: identifier for the newly created job
2087 # @tag: name of the snapshot to load.
2089 # @vmstate: block device node name to load vmstate from
2091 # @devices: list of block device node names to load a snapshot from
2093 # Applications should not assume that the snapshot load is complete
2094 # when this command returns.  The job commands / events must be used
2095 # to determine completion and to fetch details of any errors that
2096 # arise.
2098 # Note that execution of the guest CPUs will be stopped during the
2099 # time it takes to load the snapshot.
2101 # It is strongly recommended that @devices contain all writable block
2102 # device nodes that can have changed since the original @snapshot-save
2103 # command execution.
2105 # Returns: nothing
2107 # Example:
2109 # -> { "execute": "snapshot-load",
2110 #      "arguments": {
2111 #         "job-id": "snapload0",
2112 #         "tag": "my-snap",
2113 #         "vmstate": "disk0",
2114 #         "devices": ["disk0", "disk1"]
2115 #      }
2116 #    }
2117 # <- { "return": { } }
2118 # <- {"event": "JOB_STATUS_CHANGE",
2119 #     "timestamp": {"seconds": 1472124172, "microseconds": 744001},
2120 #     "data": {"status": "created", "id": "snapload0"}}
2121 # <- {"event": "JOB_STATUS_CHANGE",
2122 #     "timestamp": {"seconds": 1472125172, "microseconds": 744001},
2123 #     "data": {"status": "running", "id": "snapload0"}}
2124 # <- {"event": "STOP",
2125 #     "timestamp": {"seconds": 1472125472, "microseconds": 744001} }
2126 # <- {"event": "RESUME",
2127 #     "timestamp": {"seconds": 1472125872, "microseconds": 744001} }
2128 # <- {"event": "JOB_STATUS_CHANGE",
2129 #     "timestamp": {"seconds": 1472126172, "microseconds": 744001},
2130 #     "data": {"status": "waiting", "id": "snapload0"}}
2131 # <- {"event": "JOB_STATUS_CHANGE",
2132 #     "timestamp": {"seconds": 1472127172, "microseconds": 744001},
2133 #     "data": {"status": "pending", "id": "snapload0"}}
2134 # <- {"event": "JOB_STATUS_CHANGE",
2135 #     "timestamp": {"seconds": 1472128172, "microseconds": 744001},
2136 #     "data": {"status": "concluded", "id": "snapload0"}}
2137 # -> {"execute": "query-jobs"}
2138 # <- {"return": [{"current-progress": 1,
2139 #                 "status": "concluded",
2140 #                 "total-progress": 1,
2141 #                 "type": "snapshot-load",
2142 #                 "id": "snapload0"}]}
2144 # Since: 6.0
2146 { 'command': 'snapshot-load',
2147   'data': { 'job-id': 'str',
2148             'tag': 'str',
2149             'vmstate': 'str',
2150             'devices': ['str'] } }
2153 # @snapshot-delete:
2155 # Delete a VM snapshot
2157 # @job-id: identifier for the newly created job
2159 # @tag: name of the snapshot to delete.
2161 # @devices: list of block device node names to delete a snapshot from
2163 # Applications should not assume that the snapshot delete is complete
2164 # when this command returns.  The job commands / events must be used
2165 # to determine completion and to fetch details of any errors that
2166 # arise.
2168 # Returns: nothing
2170 # Example:
2172 # -> { "execute": "snapshot-delete",
2173 #      "arguments": {
2174 #         "job-id": "snapdelete0",
2175 #         "tag": "my-snap",
2176 #         "devices": ["disk0", "disk1"]
2177 #      }
2178 #    }
2179 # <- { "return": { } }
2180 # <- {"event": "JOB_STATUS_CHANGE",
2181 #     "timestamp": {"seconds": 1442124172, "microseconds": 744001},
2182 #     "data": {"status": "created", "id": "snapdelete0"}}
2183 # <- {"event": "JOB_STATUS_CHANGE",
2184 #     "timestamp": {"seconds": 1442125172, "microseconds": 744001},
2185 #     "data": {"status": "running", "id": "snapdelete0"}}
2186 # <- {"event": "JOB_STATUS_CHANGE",
2187 #     "timestamp": {"seconds": 1442126172, "microseconds": 744001},
2188 #     "data": {"status": "waiting", "id": "snapdelete0"}}
2189 # <- {"event": "JOB_STATUS_CHANGE",
2190 #     "timestamp": {"seconds": 1442127172, "microseconds": 744001},
2191 #     "data": {"status": "pending", "id": "snapdelete0"}}
2192 # <- {"event": "JOB_STATUS_CHANGE",
2193 #     "timestamp": {"seconds": 1442128172, "microseconds": 744001},
2194 #     "data": {"status": "concluded", "id": "snapdelete0"}}
2195 # -> {"execute": "query-jobs"}
2196 # <- {"return": [{"current-progress": 1,
2197 #                 "status": "concluded",
2198 #                 "total-progress": 1,
2199 #                 "type": "snapshot-delete",
2200 #                 "id": "snapdelete0"}]}
2202 # Since: 6.0
2204 { 'command': 'snapshot-delete',
2205   'data': { 'job-id': 'str',
2206             'tag': 'str',
2207             'devices': ['str'] } }