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