xref: /qemu/qapi/migration.json (revision 7271a819)
1# -*- Mode: Python -*-
2#
3
4##
5# = Migration
6##
7
8{ 'include': 'common.json' }
9
10##
11# @MigrationStats:
12#
13# Detailed migration status.
14#
15# @transferred: amount of bytes already transferred to the target VM
16#
17# @remaining: amount of bytes remaining to be transferred to the target VM
18#
19# @total: total amount of bytes involved in the migration process
20#
21# @duplicate: number of duplicate (zero) pages (since 1.2)
22#
23# @skipped: number of skipped zero pages (since 1.5)
24#
25# @normal: number of normal pages (since 1.2)
26#
27# @normal-bytes: number of normal bytes sent (since 1.2)
28#
29# @dirty-pages-rate: number of pages dirtied by second by the
30#        guest (since 1.3)
31#
32# @mbps: throughput in megabits/sec. (since 1.6)
33#
34# @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
35#
36# @postcopy-requests: The number of page requests received from the destination
37#        (since 2.7)
38#
39# @page-size: The number of bytes per page for the various page-based
40#        statistics (since 2.10)
41#
42# Since: 0.14.0
43##
44{ 'struct': 'MigrationStats',
45  'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
46           'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
47           'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
48           'mbps' : 'number', 'dirty-sync-count' : 'int',
49           'postcopy-requests' : 'int', 'page-size' : 'int' } }
50
51##
52# @XBZRLECacheStats:
53#
54# Detailed XBZRLE migration cache statistics
55#
56# @cache-size: XBZRLE cache size
57#
58# @bytes: amount of bytes already transferred to the target VM
59#
60# @pages: amount of pages transferred to the target VM
61#
62# @cache-miss: number of cache miss
63#
64# @cache-miss-rate: rate of cache miss (since 2.1)
65#
66# @overflow: number of overflows
67#
68# Since: 1.2
69##
70{ 'struct': 'XBZRLECacheStats',
71  'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
72           'cache-miss': 'int', 'cache-miss-rate': 'number',
73           'overflow': 'int' } }
74
75##
76# @MigrationStatus:
77#
78# An enumeration of migration status.
79#
80# @none: no migration has ever happened.
81#
82# @setup: migration process has been initiated.
83#
84# @cancelling: in the process of cancelling migration.
85#
86# @cancelled: cancelling migration is finished.
87#
88# @active: in the process of doing migration.
89#
90# @postcopy-active: like active, but now in postcopy mode. (since 2.5)
91#
92# @completed: migration is finished.
93#
94# @failed: some error occurred during migration process.
95#
96# @colo: VM is in the process of fault tolerance, VM can not get into this
97#        state unless colo capability is enabled for migration. (since 2.8)
98#
99# Since: 2.3
100#
101##
102{ 'enum': 'MigrationStatus',
103  'data': [ 'none', 'setup', 'cancelling', 'cancelled',
104            'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
105
106##
107# @MigrationInfo:
108#
109# Information about current migration process.
110#
111# @status: @MigrationStatus describing the current migration status.
112#          If this field is not returned, no migration process
113#          has been initiated
114#
115# @ram: @MigrationStats containing detailed migration
116#       status, only returned if status is 'active' or
117#       'completed'(since 1.2)
118#
119# @disk: @MigrationStats containing detailed disk migration
120#        status, only returned if status is 'active' and it is a block
121#        migration
122#
123# @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
124#                migration statistics, only returned if XBZRLE feature is on and
125#                status is 'active' or 'completed' (since 1.2)
126#
127# @total-time: total amount of milliseconds since migration started.
128#        If migration has ended, it returns the total migration
129#        time. (since 1.2)
130#
131# @downtime: only present when migration finishes correctly
132#        total downtime in milliseconds for the guest.
133#        (since 1.3)
134#
135# @expected-downtime: only present while migration is active
136#        expected downtime in milliseconds for the guest in last walk
137#        of the dirty bitmap. (since 1.3)
138#
139# @setup-time: amount of setup time in milliseconds _before_ the
140#        iterations begin but _after_ the QMP command is issued. This is designed
141#        to provide an accounting of any activities (such as RDMA pinning) which
142#        may be expensive, but do not actually occur during the iterative
143#        migration rounds themselves. (since 1.6)
144#
145# @cpu-throttle-percentage: percentage of time guest cpus are being
146#        throttled during auto-converge. This is only present when auto-converge
147#        has started throttling guest cpus. (Since 2.7)
148#
149# @error-desc: the human readable error description string, when
150#              @status is 'failed'. Clients should not attempt to parse the
151#              error strings. (Since 2.7)
152#
153# Since: 0.14.0
154##
155{ 'struct': 'MigrationInfo',
156  'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
157           '*disk': 'MigrationStats',
158           '*xbzrle-cache': 'XBZRLECacheStats',
159           '*total-time': 'int',
160           '*expected-downtime': 'int',
161           '*downtime': 'int',
162           '*setup-time': 'int',
163           '*cpu-throttle-percentage': 'int',
164           '*error-desc': 'str'} }
165
166##
167# @query-migrate:
168#
169# Returns information about current migration process. If migration
170# is active there will be another json-object with RAM migration
171# status and if block migration is active another one with block
172# migration status.
173#
174# Returns: @MigrationInfo
175#
176# Since: 0.14.0
177#
178# Example:
179#
180# 1. Before the first migration
181#
182# -> { "execute": "query-migrate" }
183# <- { "return": {} }
184#
185# 2. Migration is done and has succeeded
186#
187# -> { "execute": "query-migrate" }
188# <- { "return": {
189#         "status": "completed",
190#         "ram":{
191#           "transferred":123,
192#           "remaining":123,
193#           "total":246,
194#           "total-time":12345,
195#           "setup-time":12345,
196#           "downtime":12345,
197#           "duplicate":123,
198#           "normal":123,
199#           "normal-bytes":123456,
200#           "dirty-sync-count":15
201#         }
202#      }
203#    }
204#
205# 3. Migration is done and has failed
206#
207# -> { "execute": "query-migrate" }
208# <- { "return": { "status": "failed" } }
209#
210# 4. Migration is being performed and is not a block migration:
211#
212# -> { "execute": "query-migrate" }
213# <- {
214#       "return":{
215#          "status":"active",
216#          "ram":{
217#             "transferred":123,
218#             "remaining":123,
219#             "total":246,
220#             "total-time":12345,
221#             "setup-time":12345,
222#             "expected-downtime":12345,
223#             "duplicate":123,
224#             "normal":123,
225#             "normal-bytes":123456,
226#             "dirty-sync-count":15
227#          }
228#       }
229#    }
230#
231# 5. Migration is being performed and is a block migration:
232#
233# -> { "execute": "query-migrate" }
234# <- {
235#       "return":{
236#          "status":"active",
237#          "ram":{
238#             "total":1057024,
239#             "remaining":1053304,
240#             "transferred":3720,
241#             "total-time":12345,
242#             "setup-time":12345,
243#             "expected-downtime":12345,
244#             "duplicate":123,
245#             "normal":123,
246#             "normal-bytes":123456,
247#             "dirty-sync-count":15
248#          },
249#          "disk":{
250#             "total":20971520,
251#             "remaining":20880384,
252#             "transferred":91136
253#          }
254#       }
255#    }
256#
257# 6. Migration is being performed and XBZRLE is active:
258#
259# -> { "execute": "query-migrate" }
260# <- {
261#       "return":{
262#          "status":"active",
263#          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
264#          "ram":{
265#             "total":1057024,
266#             "remaining":1053304,
267#             "transferred":3720,
268#             "total-time":12345,
269#             "setup-time":12345,
270#             "expected-downtime":12345,
271#             "duplicate":10,
272#             "normal":3333,
273#             "normal-bytes":3412992,
274#             "dirty-sync-count":15
275#          },
276#          "xbzrle-cache":{
277#             "cache-size":67108864,
278#             "bytes":20971520,
279#             "pages":2444343,
280#             "cache-miss":2244,
281#             "cache-miss-rate":0.123,
282#             "overflow":34434
283#          }
284#       }
285#    }
286#
287##
288{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
289
290##
291# @MigrationCapability:
292#
293# Migration capabilities enumeration
294#
295# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
296#          This feature allows us to minimize migration traffic for certain work
297#          loads, by sending compressed difference of the pages
298#
299# @rdma-pin-all: Controls whether or not the entire VM memory footprint is
300#          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
301#          Disabled by default. (since 2.0)
302#
303# @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
304#          essentially saves 1MB of zeroes per block on the wire. Enabling requires
305#          source and target VM to support this feature. To enable it is sufficient
306#          to enable the capability on the source VM. The feature is disabled by
307#          default. (since 1.6)
308#
309# @compress: Use multiple compression threads to accelerate live migration.
310#          This feature can help to reduce the migration traffic, by sending
311#          compressed pages. Please note that if compress and xbzrle are both
312#          on, compress only takes effect in the ram bulk stage, after that,
313#          it will be disabled and only xbzrle takes effect, this can help to
314#          minimize migration traffic. The feature is disabled by default.
315#          (since 2.4 )
316#
317# @events: generate events for each migration state change
318#          (since 2.4 )
319#
320# @auto-converge: If enabled, QEMU will automatically throttle down the guest
321#          to speed up convergence of RAM migration. (since 1.6)
322#
323# @postcopy-ram: Start executing on the migration target before all of RAM has
324#          been migrated, pulling the remaining pages along as needed. NOTE: If
325#          the migration fails during postcopy the VM will fail.  (since 2.6)
326#
327# @x-colo: If enabled, migration will never end, and the state of the VM on the
328#        primary side will be migrated continuously to the VM on secondary
329#        side, this process is called COarse-Grain LOck Stepping (COLO) for
330#        Non-stop Service. (since 2.8)
331#
332# @release-ram: if enabled, qemu will free the migrated ram pages on the source
333#        during postcopy-ram migration. (since 2.9)
334#
335# @block: If enabled, QEMU will also migrate the contents of all block
336#          devices.  Default is disabled.  A possible alternative uses
337#          mirror jobs to a builtin NBD server on the destination, which
338#          offers more flexibility.
339#          (Since 2.10)
340#
341# @return-path: If enabled, migration will use the return path even
342#               for precopy. (since 2.10)
343#
344# @x-multifd: Use more than one fd for migration (since 2.11)
345#
346# Since: 1.2
347##
348{ 'enum': 'MigrationCapability',
349  'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
350           'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
351           'block', 'return-path', 'x-multifd' ] }
352
353##
354# @MigrationCapabilityStatus:
355#
356# Migration capability information
357#
358# @capability: capability enum
359#
360# @state: capability state bool
361#
362# Since: 1.2
363##
364{ 'struct': 'MigrationCapabilityStatus',
365  'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
366
367##
368# @migrate-set-capabilities:
369#
370# Enable/Disable the following migration capabilities (like xbzrle)
371#
372# @capabilities: json array of capability modifications to make
373#
374# Since: 1.2
375#
376# Example:
377#
378# -> { "execute": "migrate-set-capabilities" , "arguments":
379#      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
380#
381##
382{ 'command': 'migrate-set-capabilities',
383  'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
384
385##
386# @query-migrate-capabilities:
387#
388# Returns information about the current migration capabilities status
389#
390# Returns: @MigrationCapabilitiesStatus
391#
392# Since: 1.2
393#
394# Example:
395#
396# -> { "execute": "query-migrate-capabilities" }
397# <- { "return": [
398#       {"state": false, "capability": "xbzrle"},
399#       {"state": false, "capability": "rdma-pin-all"},
400#       {"state": false, "capability": "auto-converge"},
401#       {"state": false, "capability": "zero-blocks"},
402#       {"state": false, "capability": "compress"},
403#       {"state": true, "capability": "events"},
404#       {"state": false, "capability": "postcopy-ram"},
405#       {"state": false, "capability": "x-colo"}
406#    ]}
407#
408##
409{ 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
410
411##
412# @MigrationParameter:
413#
414# Migration parameters enumeration
415#
416# @compress-level: Set the compression level to be used in live migration,
417#          the compression level is an integer between 0 and 9, where 0 means
418#          no compression, 1 means the best compression speed, and 9 means best
419#          compression ratio which will consume more CPU.
420#
421# @compress-threads: Set compression thread count to be used in live migration,
422#          the compression thread count is an integer between 1 and 255.
423#
424# @decompress-threads: Set decompression thread count to be used in live
425#          migration, the decompression thread count is an integer between 1
426#          and 255. Usually, decompression is at least 4 times as fast as
427#          compression, so set the decompress-threads to the number about 1/4
428#          of compress-threads is adequate.
429#
430# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
431#                        when migration auto-converge is activated. The
432#                        default value is 20. (Since 2.7)
433#
434# @cpu-throttle-increment: throttle percentage increase each time
435#                          auto-converge detects that migration is not making
436#                          progress. The default value is 10. (Since 2.7)
437#
438# @tls-creds: ID of the 'tls-creds' object that provides credentials for
439#             establishing a TLS connection over the migration data channel.
440#             On the outgoing side of the migration, the credentials must
441#             be for a 'client' endpoint, while for the incoming side the
442#             credentials must be for a 'server' endpoint. Setting this
443#             will enable TLS for all migrations. The default is unset,
444#             resulting in unsecured migration at the QEMU level. (Since 2.7)
445#
446# @tls-hostname: hostname of the target host for the migration. This is
447#                required when using x509 based TLS credentials and the
448#                migration URI does not already include a hostname. For
449#                example if using fd: or exec: based migration, the
450#                hostname must be provided so that the server's x509
451#                certificate identity can be validated. (Since 2.7)
452#
453# @max-bandwidth: to set maximum speed for migration. maximum speed in
454#                 bytes per second. (Since 2.8)
455#
456# @downtime-limit: set maximum tolerated downtime for migration. maximum
457#                  downtime in milliseconds (Since 2.8)
458#
459# @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
460#          periodic mode. (Since 2.8)
461#
462# @block-incremental: Affects how much storage is migrated when the
463# 	block migration capability is enabled.  When false, the entire
464# 	storage backing chain is migrated into a flattened image at
465# 	the destination; when true, only the active qcow2 layer is
466# 	migrated and the destination must already have access to the
467# 	same backing chain as was used on the source.  (since 2.10)
468#
469# @x-multifd-channels: Number of channels used to migrate data in
470#                     parallel. This is the same number that the
471#                     number of sockets used for migration.  The
472#                     default value is 2 (since 2.11)
473#
474# @x-multifd-page-count: Number of pages sent together to a thread
475#                        The default value is 16 (since 2.11)
476#
477# Since: 2.4
478##
479{ 'enum': 'MigrationParameter',
480  'data': ['compress-level', 'compress-threads', 'decompress-threads',
481           'cpu-throttle-initial', 'cpu-throttle-increment',
482           'tls-creds', 'tls-hostname', 'max-bandwidth',
483           'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
484           'x-multifd-channels', 'x-multifd-page-count' ] }
485
486##
487# @MigrateSetParameters:
488#
489# @compress-level: compression level
490#
491# @compress-threads: compression thread count
492#
493# @decompress-threads: decompression thread count
494#
495# @cpu-throttle-initial: Initial percentage of time guest cpus are
496#                        throttled when migration auto-converge is activated.
497#                        The default value is 20. (Since 2.7)
498#
499# @cpu-throttle-increment: throttle percentage increase each time
500#                          auto-converge detects that migration is not making
501#                          progress. The default value is 10. (Since 2.7)
502#
503# @tls-creds: ID of the 'tls-creds' object that provides credentials
504#             for establishing a TLS connection over the migration data
505#             channel. On the outgoing side of the migration, the credentials
506#             must be for a 'client' endpoint, while for the incoming side the
507#             credentials must be for a 'server' endpoint. Setting this
508#             to a non-empty string enables TLS for all migrations.
509#             An empty string means that QEMU will use plain text mode for
510#             migration, rather than TLS (Since 2.9)
511#             Previously (since 2.7), this was reported by omitting
512#             tls-creds instead.
513#
514# @tls-hostname: hostname of the target host for the migration. This
515#                is required when using x509 based TLS credentials and the
516#                migration URI does not already include a hostname. For
517#                example if using fd: or exec: based migration, the
518#                hostname must be provided so that the server's x509
519#                certificate identity can be validated. (Since 2.7)
520#                An empty string means that QEMU will use the hostname
521#                associated with the migration URI, if any. (Since 2.9)
522#                Previously (since 2.7), this was reported by omitting
523#                tls-hostname instead.
524#
525# @max-bandwidth: to set maximum speed for migration. maximum speed in
526#                 bytes per second. (Since 2.8)
527#
528# @downtime-limit: set maximum tolerated downtime for migration. maximum
529#                  downtime in milliseconds (Since 2.8)
530#
531# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
532#
533# @block-incremental: Affects how much storage is migrated when the
534# 	block migration capability is enabled.  When false, the entire
535# 	storage backing chain is migrated into a flattened image at
536# 	the destination; when true, only the active qcow2 layer is
537# 	migrated and the destination must already have access to the
538# 	same backing chain as was used on the source.  (since 2.10)
539#
540# @x-multifd-channels: Number of channels used to migrate data in
541#                     parallel. This is the same number that the
542#                     number of sockets used for migration.  The
543#                     default value is 2 (since 2.11)
544#
545# @x-multifd-page-count: Number of pages sent together to a thread
546#                        The default value is 16 (since 2.11)
547#
548# Since: 2.4
549##
550# TODO either fuse back into MigrationParameters, or make
551# MigrationParameters members mandatory
552{ 'struct': 'MigrateSetParameters',
553  'data': { '*compress-level': 'int',
554            '*compress-threads': 'int',
555            '*decompress-threads': 'int',
556            '*cpu-throttle-initial': 'int',
557            '*cpu-throttle-increment': 'int',
558            '*tls-creds': 'StrOrNull',
559            '*tls-hostname': 'StrOrNull',
560            '*max-bandwidth': 'int',
561            '*downtime-limit': 'int',
562            '*x-checkpoint-delay': 'int',
563            '*block-incremental': 'bool',
564            '*x-multifd-channels': 'int',
565            '*x-multifd-page-count': 'int' } }
566
567##
568# @migrate-set-parameters:
569#
570# Set various migration parameters.
571#
572# Since: 2.4
573#
574# Example:
575#
576# -> { "execute": "migrate-set-parameters" ,
577#      "arguments": { "compress-level": 1 } }
578#
579##
580{ 'command': 'migrate-set-parameters', 'boxed': true,
581  'data': 'MigrateSetParameters' }
582
583##
584# @MigrationParameters:
585#
586# The optional members aren't actually optional.
587#
588# @compress-level: compression level
589#
590# @compress-threads: compression thread count
591#
592# @decompress-threads: decompression thread count
593#
594# @cpu-throttle-initial: Initial percentage of time guest cpus are
595#                        throttled when migration auto-converge is activated.
596#                        (Since 2.7)
597#
598# @cpu-throttle-increment: throttle percentage increase each time
599#                          auto-converge detects that migration is not making
600#                          progress. (Since 2.7)
601#
602# @tls-creds: ID of the 'tls-creds' object that provides credentials
603#             for establishing a TLS connection over the migration data
604#             channel. On the outgoing side of the migration, the credentials
605#             must be for a 'client' endpoint, while for the incoming side the
606#             credentials must be for a 'server' endpoint.
607#             An empty string means that QEMU will use plain text mode for
608#             migration, rather than TLS (Since 2.7)
609#             Note: 2.8 reports this by omitting tls-creds instead.
610#
611# @tls-hostname: hostname of the target host for the migration. This
612#                is required when using x509 based TLS credentials and the
613#                migration URI does not already include a hostname. For
614#                example if using fd: or exec: based migration, the
615#                hostname must be provided so that the server's x509
616#                certificate identity can be validated. (Since 2.7)
617#                An empty string means that QEMU will use the hostname
618#                associated with the migration URI, if any. (Since 2.9)
619#                Note: 2.8 reports this by omitting tls-hostname instead.
620#
621# @max-bandwidth: to set maximum speed for migration. maximum speed in
622#                 bytes per second. (Since 2.8)
623#
624# @downtime-limit: set maximum tolerated downtime for migration. maximum
625#                  downtime in milliseconds (Since 2.8)
626#
627# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
628#
629# @block-incremental: Affects how much storage is migrated when the
630# 	block migration capability is enabled.  When false, the entire
631# 	storage backing chain is migrated into a flattened image at
632# 	the destination; when true, only the active qcow2 layer is
633# 	migrated and the destination must already have access to the
634# 	same backing chain as was used on the source.  (since 2.10)
635#
636# @x-multifd-channels: Number of channels used to migrate data in
637#                     parallel. This is the same number that the
638#                     number of sockets used for migration.
639#                     The default value is 2 (since 2.11)
640#
641# @x-multifd-page-count: Number of pages sent together to a thread
642#                        The default value is 16 (since 2.11)
643#
644# Since: 2.4
645##
646{ 'struct': 'MigrationParameters',
647  'data': { '*compress-level': 'int',
648            '*compress-threads': 'int',
649            '*decompress-threads': 'int',
650            '*cpu-throttle-initial': 'int',
651            '*cpu-throttle-increment': 'int',
652            '*tls-creds': 'str',
653            '*tls-hostname': 'str',
654            '*max-bandwidth': 'int',
655            '*downtime-limit': 'int',
656            '*x-checkpoint-delay': 'int',
657            '*block-incremental': 'bool' ,
658            '*x-multifd-channels': 'int',
659            '*x-multifd-page-count': 'int' } }
660
661##
662# @query-migrate-parameters:
663#
664# Returns information about the current migration parameters
665#
666# Returns: @MigrationParameters
667#
668# Since: 2.4
669#
670# Example:
671#
672# -> { "execute": "query-migrate-parameters" }
673# <- { "return": {
674#          "decompress-threads": 2,
675#          "cpu-throttle-increment": 10,
676#          "compress-threads": 8,
677#          "compress-level": 1,
678#          "cpu-throttle-initial": 20,
679#          "max-bandwidth": 33554432,
680#          "downtime-limit": 300
681#       }
682#    }
683#
684##
685{ 'command': 'query-migrate-parameters',
686  'returns': 'MigrationParameters' }
687
688##
689# @client_migrate_info:
690#
691# Set migration information for remote display.  This makes the server
692# ask the client to automatically reconnect using the new parameters
693# once migration finished successfully.  Only implemented for SPICE.
694#
695# @protocol:     must be "spice"
696# @hostname:     migration target hostname
697# @port:         spice tcp port for plaintext channels
698# @tls-port:     spice tcp port for tls-secured channels
699# @cert-subject: server certificate subject
700#
701# Since: 0.14.0
702#
703# Example:
704#
705# -> { "execute": "client_migrate_info",
706#      "arguments": { "protocol": "spice",
707#                     "hostname": "virt42.lab.kraxel.org",
708#                     "port": 1234 } }
709# <- { "return": {} }
710#
711##
712{ 'command': 'client_migrate_info',
713  'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
714            '*tls-port': 'int', '*cert-subject': 'str' } }
715
716##
717# @migrate-start-postcopy:
718#
719# Followup to a migration command to switch the migration to postcopy mode.
720# The postcopy-ram capability must be set before the original migration
721# command.
722#
723# Since: 2.5
724#
725# Example:
726#
727# -> { "execute": "migrate-start-postcopy" }
728# <- { "return": {} }
729#
730##
731{ 'command': 'migrate-start-postcopy' }
732
733##
734# @MIGRATION:
735#
736# Emitted when a migration event happens
737#
738# @status: @MigrationStatus describing the current migration status.
739#
740# Since: 2.4
741#
742# Example:
743#
744# <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
745#     "event": "MIGRATION",
746#     "data": {"status": "completed"} }
747#
748##
749{ 'event': 'MIGRATION',
750  'data': {'status': 'MigrationStatus'}}
751
752##
753# @MIGRATION_PASS:
754#
755# Emitted from the source side of a migration at the start of each pass
756# (when it syncs the dirty bitmap)
757#
758# @pass: An incrementing count (starting at 1 on the first pass)
759#
760# Since: 2.6
761#
762# Example:
763#
764# { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
765#   "event": "MIGRATION_PASS", "data": {"pass": 2} }
766#
767##
768{ 'event': 'MIGRATION_PASS',
769  'data': { 'pass': 'int' } }
770
771##
772# @COLOMessage:
773#
774# The message transmission between Primary side and Secondary side.
775#
776# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
777#
778# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
779#
780# @checkpoint-reply: SVM gets PVM's checkpoint request
781#
782# @vmstate-send: VM's state will be sent by PVM.
783#
784# @vmstate-size: The total size of VMstate.
785#
786# @vmstate-received: VM's state has been received by SVM.
787#
788# @vmstate-loaded: VM's state has been loaded by SVM.
789#
790# Since: 2.8
791##
792{ 'enum': 'COLOMessage',
793  'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
794            'vmstate-send', 'vmstate-size', 'vmstate-received',
795            'vmstate-loaded' ] }
796
797##
798# @COLOMode:
799#
800# The colo mode
801#
802# @unknown: unknown mode
803#
804# @primary: master side
805#
806# @secondary: slave side
807#
808# Since: 2.8
809##
810{ 'enum': 'COLOMode',
811  'data': [ 'unknown', 'primary', 'secondary'] }
812
813##
814# @FailoverStatus:
815#
816# An enumeration of COLO failover status
817#
818# @none: no failover has ever happened
819#
820# @require: got failover requirement but not handled
821#
822# @active: in the process of doing failover
823#
824# @completed: finish the process of failover
825#
826# @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
827#
828# Since: 2.8
829##
830{ 'enum': 'FailoverStatus',
831  'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
832
833##
834# @x-colo-lost-heartbeat:
835#
836# Tell qemu that heartbeat is lost, request it to do takeover procedures.
837# If this command is sent to the PVM, the Primary side will exit COLO mode.
838# If sent to the Secondary, the Secondary side will run failover work,
839# then takes over server operation to become the service VM.
840#
841# Since: 2.8
842#
843# Example:
844#
845# -> { "execute": "x-colo-lost-heartbeat" }
846# <- { "return": {} }
847#
848##
849{ 'command': 'x-colo-lost-heartbeat' }
850
851##
852# @migrate_cancel:
853#
854# Cancel the current executing migration process.
855#
856# Returns: nothing on success
857#
858# Notes: This command succeeds even if there is no migration process running.
859#
860# Since: 0.14.0
861#
862# Example:
863#
864# -> { "execute": "migrate_cancel" }
865# <- { "return": {} }
866#
867##
868{ 'command': 'migrate_cancel' }
869
870##
871# @migrate_set_downtime:
872#
873# Set maximum tolerated downtime for migration.
874#
875# @value: maximum downtime in seconds
876#
877# Returns: nothing on success
878#
879# Notes: This command is deprecated in favor of 'migrate-set-parameters'
880#
881# Since: 0.14.0
882#
883# Example:
884#
885# -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
886# <- { "return": {} }
887#
888##
889{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
890
891##
892# @migrate_set_speed:
893#
894# Set maximum speed for migration.
895#
896# @value: maximum speed in bytes per second.
897#
898# Returns: nothing on success
899#
900# Notes: This command is deprecated in favor of 'migrate-set-parameters'
901#
902# Since: 0.14.0
903#
904# Example:
905#
906# -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
907# <- { "return": {} }
908#
909##
910{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
911
912##
913# @migrate-set-cache-size:
914#
915# Set cache size to be used by XBZRLE migration
916#
917# @value: cache size in bytes
918#
919# The size will be rounded down to the nearest power of 2.
920# The cache size can be modified before and during ongoing migration
921#
922# Returns: nothing on success
923#
924# Since: 1.2
925#
926# Example:
927#
928# -> { "execute": "migrate-set-cache-size",
929#      "arguments": { "value": 536870912 } }
930# <- { "return": {} }
931#
932##
933{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
934
935##
936# @query-migrate-cache-size:
937#
938# Query migration XBZRLE cache size
939#
940# Returns: XBZRLE cache size in bytes
941#
942# Since: 1.2
943#
944# Example:
945#
946# -> { "execute": "query-migrate-cache-size" }
947# <- { "return": 67108864 }
948#
949##
950{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
951
952##
953# @migrate:
954#
955# Migrates the current running guest to another Virtual Machine.
956#
957# @uri: the Uniform Resource Identifier of the destination VM
958#
959# @blk: do block migration (full disk copy)
960#
961# @inc: incremental disk copy migration
962#
963# @detach: this argument exists only for compatibility reasons and
964#          is ignored by QEMU
965#
966# Returns: nothing on success
967#
968# Since: 0.14.0
969#
970# Notes:
971#
972# 1. The 'query-migrate' command should be used to check migration's progress
973#    and final result (this information is provided by the 'status' member)
974#
975# 2. All boolean arguments default to false
976#
977# 3. The user Monitor's "detach" argument is invalid in QMP and should not
978#    be used
979#
980# Example:
981#
982# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
983# <- { "return": {} }
984#
985##
986{ 'command': 'migrate',
987  'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
988
989##
990# @migrate-incoming:
991#
992# Start an incoming migration, the qemu must have been started
993# with -incoming defer
994#
995# @uri: The Uniform Resource Identifier identifying the source or
996#       address to listen on
997#
998# Returns: nothing on success
999#
1000# Since: 2.3
1001#
1002# Notes:
1003#
1004# 1. It's a bad idea to use a string for the uri, but it needs to stay
1005#    compatible with -incoming and the format of the uri is already exposed
1006#    above libvirt.
1007#
1008# 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1009#    be used.
1010#
1011# 3. The uri format is the same as for -incoming
1012#
1013# Example:
1014#
1015# -> { "execute": "migrate-incoming",
1016#      "arguments": { "uri": "tcp::4446" } }
1017# <- { "return": {} }
1018#
1019##
1020{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1021
1022##
1023# @xen-save-devices-state:
1024#
1025# Save the state of all devices to file. The RAM and the block devices
1026# of the VM are not saved by this command.
1027#
1028# @filename: the file to save the state of the devices to as binary
1029# data. See xen-save-devices-state.txt for a description of the binary
1030# format.
1031#
1032# Returns: Nothing on success
1033#
1034# Since: 1.1
1035#
1036# Example:
1037#
1038# -> { "execute": "xen-save-devices-state",
1039#      "arguments": { "filename": "/tmp/save" } }
1040# <- { "return": {} }
1041#
1042##
1043{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
1044
1045##
1046# @xen-set-replication:
1047#
1048# Enable or disable replication.
1049#
1050# @enable: true to enable, false to disable.
1051#
1052# @primary: true for primary or false for secondary.
1053#
1054# @failover: true to do failover, false to stop. but cannot be
1055#            specified if 'enable' is true. default value is false.
1056#
1057# Returns: nothing.
1058#
1059# Example:
1060#
1061# -> { "execute": "xen-set-replication",
1062#      "arguments": {"enable": true, "primary": false} }
1063# <- { "return": {} }
1064#
1065# Since: 2.9
1066##
1067{ 'command': 'xen-set-replication',
1068  'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
1069
1070##
1071# @ReplicationStatus:
1072#
1073# The result format for 'query-xen-replication-status'.
1074#
1075# @error: true if an error happened, false if replication is normal.
1076#
1077# @desc: the human readable error description string, when
1078#        @error is 'true'.
1079#
1080# Since: 2.9
1081##
1082{ 'struct': 'ReplicationStatus',
1083  'data': { 'error': 'bool', '*desc': 'str' } }
1084
1085##
1086# @query-xen-replication-status:
1087#
1088# Query replication status while the vm is running.
1089#
1090# Returns: A @ReplicationResult object showing the status.
1091#
1092# Example:
1093#
1094# -> { "execute": "query-xen-replication-status" }
1095# <- { "return": { "error": false } }
1096#
1097# Since: 2.9
1098##
1099{ 'command': 'query-xen-replication-status',
1100  'returns': 'ReplicationStatus' }
1101
1102##
1103# @xen-colo-do-checkpoint:
1104#
1105# Xen uses this command to notify replication to trigger a checkpoint.
1106#
1107# Returns: nothing.
1108#
1109# Example:
1110#
1111# -> { "execute": "xen-colo-do-checkpoint" }
1112# <- { "return": {} }
1113#
1114# Since: 2.9
1115##
1116{ 'command': 'xen-colo-do-checkpoint' }
1117