]> Git Repo - qemu.git/blob - qapi-schema.json
qapi-schema: Collect UI stuff in qapi/ui.json
[qemu.git] / qapi-schema.json
1 # -*- Mode: Python -*-
2 ##
3 # = Introduction
4 #
5 # This document describes all commands currently supported by QMP.
6 #
7 # Most of the time their usage is exactly the same as in the user Monitor, this
8 # means that any other document which also describe commands (the manpage,
9 # QEMU's manual, etc) can and should be consulted.
10 #
11 # QMP has two types of commands: regular and query commands. Regular commands
12 # usually change the Virtual Machine's state someway, while query commands just
13 # return information. The sections below are divided accordingly.
14 #
15 # It's important to observe that all communication examples are formatted in
16 # a reader-friendly way, so that they're easier to understand. However, in real
17 # protocol usage, they're emitted as a single line.
18 #
19 # Also, the following notation is used to denote data flow:
20 #
21 # Example:
22 #
23 # | -> data issued by the Client
24 # | <- Server data response
25 #
26 # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for
27 # detailed information on the Server command and response formats.
28 #
29 # = Stability Considerations
30 #
31 # The current QMP command set (described in this file) may be useful for a
32 # number of use cases, however it's limited and several commands have bad
33 # defined semantics, specially with regard to command completion.
34 #
35 # These problems are going to be solved incrementally in the next QEMU releases
36 # and we're going to establish a deprecation policy for badly defined commands.
37 #
38 # If you're planning to adopt QMP, please observe the following:
39 #
40 #     1. The deprecation policy will take effect and be documented soon, please
41 #        check the documentation of each used command as soon as a new release of
42 #        QEMU is available
43 #
44 #     2. DO NOT rely on anything which is not explicit documented
45 #
46 #     3. Errors, in special, are not documented. Applications should NOT check
47 #        for specific errors classes or data (it's strongly recommended to only
48 #        check for the "error" key)
49 #
50 ##
51
52 { 'pragma': { 'doc-required': true } }
53
54 # Whitelists to permit QAPI rule violations; think twice before you
55 # add to them!
56 { 'pragma': {
57     # Commands allowed to return a non-dictionary:
58     'returns-whitelist': [
59         'human-monitor-command',
60         'qom-get',
61         'query-migrate-cache-size',
62         'query-tpm-models',
63         'query-tpm-types',
64         'ringbuf-read' ],
65     'name-case-whitelist': [
66         'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
67         'CpuInfoMIPS',          # PC, visible through query-cpu
68         'CpuInfoTricore',       # PC, visible through query-cpu
69         'QapiErrorClass',       # all members, visible through errors
70         'UuidInfo',             # UUID, visible through query-uuid
71         'X86CPURegister32',     # all members, visible indirectly through qom-get
72         'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
73     ] } }
74
75 # Documentation generated with qapi2texi.py is in source order, with
76 # included sub-schemas inserted at the first include directive
77 # (subsequent include directives have no effect).  To get a sane and
78 # stable order, it's best to include each sub-schema just once, or
79 # include it first in qapi-schema.json.
80
81 { 'include': 'qapi/common.json' }
82 { 'include': 'qapi/sockets.json' }
83 { 'include': 'qapi/run-state.json' }
84 { 'include': 'qapi/crypto.json' }
85 { 'include': 'qapi/block.json' }
86 { 'include': 'qapi/char.json' }
87 { 'include': 'qapi/net.json' }
88 { 'include': 'qapi/rocker.json' }
89 { 'include': 'qapi/ui.json' }
90 { 'include': 'qapi/event.json' }
91 { 'include': 'qapi/trace.json' }
92 { 'include': 'qapi/introspect.json' }
93
94 ##
95 # = QMP commands
96 ##
97
98 ##
99 # @qmp_capabilities:
100 #
101 # Enable QMP capabilities.
102 #
103 # Arguments: None.
104 #
105 # Example:
106 #
107 # -> { "execute": "qmp_capabilities" }
108 # <- { "return": {} }
109 #
110 # Notes: This command is valid exactly when first connecting: it must be
111 # issued before any other command will be accepted, and will fail once the
112 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
113 #
114 # Since: 0.13
115 #
116 ##
117 { 'command': 'qmp_capabilities' }
118
119 ##
120 # @StrOrNull:
121 #
122 # This is a string value or the explicit lack of a string (null
123 # pointer in C).  Intended for cases when 'optional absent' already
124 # has a different meaning.
125 #
126 # @s: the string value
127 # @n: no string value
128 #
129 # Since: 2.10
130 ##
131 { 'alternate': 'StrOrNull',
132   'data': { 's': 'str',
133             'n': 'null' } }
134
135 ##
136 # @LostTickPolicy:
137 #
138 # Policy for handling lost ticks in timer devices.
139 #
140 # @discard: throw away the missed tick(s) and continue with future injection
141 #           normally.  Guest time may be delayed, unless the OS has explicit
142 #           handling of lost ticks
143 #
144 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
145 #         delayed due to the late tick
146 #
147 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
148 #         may be delayed, depending on how the OS reacts to the merging
149 #         of ticks
150 #
151 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
152 #        guest time should not be delayed once catchup is complete.
153 #
154 # Since: 2.0
155 ##
156 { 'enum': 'LostTickPolicy',
157   'data': ['discard', 'delay', 'merge', 'slew' ] }
158
159 ##
160 # @add_client:
161 #
162 # Allow client connections for VNC, Spice and socket based
163 # character devices to be passed in to QEMU via SCM_RIGHTS.
164 #
165 # @protocol: protocol name. Valid names are "vnc", "spice" or the
166 #            name of a character device (eg. from -chardev id=XXXX)
167 #
168 # @fdname: file descriptor name previously passed via 'getfd' command
169 #
170 # @skipauth: whether to skip authentication. Only applies
171 #            to "vnc" and "spice" protocols
172 #
173 # @tls: whether to perform TLS. Only applies to the "spice"
174 #       protocol
175 #
176 # Returns: nothing on success.
177 #
178 # Since: 0.14.0
179 #
180 # Example:
181 #
182 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
183 #                                              "fdname": "myclient" } }
184 # <- { "return": {} }
185 #
186 ##
187 { 'command': 'add_client',
188   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
189             '*tls': 'bool' } }
190
191 ##
192 # @NameInfo:
193 #
194 # Guest name information.
195 #
196 # @name: The name of the guest
197 #
198 # Since: 0.14.0
199 ##
200 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
201
202 ##
203 # @query-name:
204 #
205 # Return the name information of a guest.
206 #
207 # Returns: @NameInfo of the guest
208 #
209 # Since: 0.14.0
210 #
211 # Example:
212 #
213 # -> { "execute": "query-name" }
214 # <- { "return": { "name": "qemu-name" } }
215 #
216 ##
217 { 'command': 'query-name', 'returns': 'NameInfo' }
218
219 ##
220 # @KvmInfo:
221 #
222 # Information about support for KVM acceleration
223 #
224 # @enabled: true if KVM acceleration is active
225 #
226 # @present: true if KVM acceleration is built into this executable
227 #
228 # Since: 0.14.0
229 ##
230 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
231
232 ##
233 # @query-kvm:
234 #
235 # Returns information about KVM acceleration
236 #
237 # Returns: @KvmInfo
238 #
239 # Since: 0.14.0
240 #
241 # Example:
242 #
243 # -> { "execute": "query-kvm" }
244 # <- { "return": { "enabled": true, "present": true } }
245 #
246 ##
247 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
248
249 ##
250 # @UuidInfo:
251 #
252 # Guest UUID information (Universally Unique Identifier).
253 #
254 # @UUID: the UUID of the guest
255 #
256 # Since: 0.14.0
257 #
258 # Notes: If no UUID was specified for the guest, a null UUID is returned.
259 ##
260 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
261
262 ##
263 # @query-uuid:
264 #
265 # Query the guest UUID information.
266 #
267 # Returns: The @UuidInfo for the guest
268 #
269 # Since: 0.14.0
270 #
271 # Example:
272 #
273 # -> { "execute": "query-uuid" }
274 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
275 #
276 ##
277 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
278
279 ##
280 # @EventInfo:
281 #
282 # Information about a QMP event
283 #
284 # @name: The event name
285 #
286 # Since: 1.2.0
287 ##
288 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
289
290 ##
291 # @query-events:
292 #
293 # Return a list of supported QMP events by this server
294 #
295 # Returns: A list of @EventInfo for all supported events
296 #
297 # Since: 1.2.0
298 #
299 # Example:
300 #
301 # -> { "execute": "query-events" }
302 # <- {
303 #      "return": [
304 #          {
305 #             "name":"SHUTDOWN"
306 #          },
307 #          {
308 #             "name":"RESET"
309 #          }
310 #       ]
311 #    }
312 #
313 # Note: This example has been shortened as the real response is too long.
314 #
315 ##
316 { 'command': 'query-events', 'returns': ['EventInfo'] }
317
318 ##
319 # @MigrationStats:
320 #
321 # Detailed migration status.
322 #
323 # @transferred: amount of bytes already transferred to the target VM
324 #
325 # @remaining: amount of bytes remaining to be transferred to the target VM
326 #
327 # @total: total amount of bytes involved in the migration process
328 #
329 # @duplicate: number of duplicate (zero) pages (since 1.2)
330 #
331 # @skipped: number of skipped zero pages (since 1.5)
332 #
333 # @normal: number of normal pages (since 1.2)
334 #
335 # @normal-bytes: number of normal bytes sent (since 1.2)
336 #
337 # @dirty-pages-rate: number of pages dirtied by second by the
338 #        guest (since 1.3)
339 #
340 # @mbps: throughput in megabits/sec. (since 1.6)
341 #
342 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
343 #
344 # @postcopy-requests: The number of page requests received from the destination
345 #        (since 2.7)
346 #
347 # @page-size: The number of bytes per page for the various page-based
348 #        statistics (since 2.10)
349 #
350 # Since: 0.14.0
351 ##
352 { 'struct': 'MigrationStats',
353   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
354            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
355            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
356            'mbps' : 'number', 'dirty-sync-count' : 'int',
357            'postcopy-requests' : 'int', 'page-size' : 'int' } }
358
359 ##
360 # @XBZRLECacheStats:
361 #
362 # Detailed XBZRLE migration cache statistics
363 #
364 # @cache-size: XBZRLE cache size
365 #
366 # @bytes: amount of bytes already transferred to the target VM
367 #
368 # @pages: amount of pages transferred to the target VM
369 #
370 # @cache-miss: number of cache miss
371 #
372 # @cache-miss-rate: rate of cache miss (since 2.1)
373 #
374 # @overflow: number of overflows
375 #
376 # Since: 1.2
377 ##
378 { 'struct': 'XBZRLECacheStats',
379   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
380            'cache-miss': 'int', 'cache-miss-rate': 'number',
381            'overflow': 'int' } }
382
383 ##
384 # @MigrationStatus:
385 #
386 # An enumeration of migration status.
387 #
388 # @none: no migration has ever happened.
389 #
390 # @setup: migration process has been initiated.
391 #
392 # @cancelling: in the process of cancelling migration.
393 #
394 # @cancelled: cancelling migration is finished.
395 #
396 # @active: in the process of doing migration.
397 #
398 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
399 #
400 # @completed: migration is finished.
401 #
402 # @failed: some error occurred during migration process.
403 #
404 # @colo: VM is in the process of fault tolerance, VM can not get into this
405 #        state unless colo capability is enabled for migration. (since 2.8)
406 #
407 # Since: 2.3
408 #
409 ##
410 { 'enum': 'MigrationStatus',
411   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
412             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
413
414 ##
415 # @MigrationInfo:
416 #
417 # Information about current migration process.
418 #
419 # @status: @MigrationStatus describing the current migration status.
420 #          If this field is not returned, no migration process
421 #          has been initiated
422 #
423 # @ram: @MigrationStats containing detailed migration
424 #       status, only returned if status is 'active' or
425 #       'completed'(since 1.2)
426 #
427 # @disk: @MigrationStats containing detailed disk migration
428 #        status, only returned if status is 'active' and it is a block
429 #        migration
430 #
431 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
432 #                migration statistics, only returned if XBZRLE feature is on and
433 #                status is 'active' or 'completed' (since 1.2)
434 #
435 # @total-time: total amount of milliseconds since migration started.
436 #        If migration has ended, it returns the total migration
437 #        time. (since 1.2)
438 #
439 # @downtime: only present when migration finishes correctly
440 #        total downtime in milliseconds for the guest.
441 #        (since 1.3)
442 #
443 # @expected-downtime: only present while migration is active
444 #        expected downtime in milliseconds for the guest in last walk
445 #        of the dirty bitmap. (since 1.3)
446 #
447 # @setup-time: amount of setup time in milliseconds _before_ the
448 #        iterations begin but _after_ the QMP command is issued. This is designed
449 #        to provide an accounting of any activities (such as RDMA pinning) which
450 #        may be expensive, but do not actually occur during the iterative
451 #        migration rounds themselves. (since 1.6)
452 #
453 # @cpu-throttle-percentage: percentage of time guest cpus are being
454 #        throttled during auto-converge. This is only present when auto-converge
455 #        has started throttling guest cpus. (Since 2.7)
456 #
457 # @error-desc: the human readable error description string, when
458 #              @status is 'failed'. Clients should not attempt to parse the
459 #              error strings. (Since 2.7)
460 #
461 # Since: 0.14.0
462 ##
463 { 'struct': 'MigrationInfo',
464   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
465            '*disk': 'MigrationStats',
466            '*xbzrle-cache': 'XBZRLECacheStats',
467            '*total-time': 'int',
468            '*expected-downtime': 'int',
469            '*downtime': 'int',
470            '*setup-time': 'int',
471            '*cpu-throttle-percentage': 'int',
472            '*error-desc': 'str'} }
473
474 ##
475 # @query-migrate:
476 #
477 # Returns information about current migration process. If migration
478 # is active there will be another json-object with RAM migration
479 # status and if block migration is active another one with block
480 # migration status.
481 #
482 # Returns: @MigrationInfo
483 #
484 # Since: 0.14.0
485 #
486 # Example:
487 #
488 # 1. Before the first migration
489 #
490 # -> { "execute": "query-migrate" }
491 # <- { "return": {} }
492 #
493 # 2. Migration is done and has succeeded
494 #
495 # -> { "execute": "query-migrate" }
496 # <- { "return": {
497 #         "status": "completed",
498 #         "ram":{
499 #           "transferred":123,
500 #           "remaining":123,
501 #           "total":246,
502 #           "total-time":12345,
503 #           "setup-time":12345,
504 #           "downtime":12345,
505 #           "duplicate":123,
506 #           "normal":123,
507 #           "normal-bytes":123456,
508 #           "dirty-sync-count":15
509 #         }
510 #      }
511 #    }
512 #
513 # 3. Migration is done and has failed
514 #
515 # -> { "execute": "query-migrate" }
516 # <- { "return": { "status": "failed" } }
517 #
518 # 4. Migration is being performed and is not a block migration:
519 #
520 # -> { "execute": "query-migrate" }
521 # <- {
522 #       "return":{
523 #          "status":"active",
524 #          "ram":{
525 #             "transferred":123,
526 #             "remaining":123,
527 #             "total":246,
528 #             "total-time":12345,
529 #             "setup-time":12345,
530 #             "expected-downtime":12345,
531 #             "duplicate":123,
532 #             "normal":123,
533 #             "normal-bytes":123456,
534 #             "dirty-sync-count":15
535 #          }
536 #       }
537 #    }
538 #
539 # 5. Migration is being performed and is a block migration:
540 #
541 # -> { "execute": "query-migrate" }
542 # <- {
543 #       "return":{
544 #          "status":"active",
545 #          "ram":{
546 #             "total":1057024,
547 #             "remaining":1053304,
548 #             "transferred":3720,
549 #             "total-time":12345,
550 #             "setup-time":12345,
551 #             "expected-downtime":12345,
552 #             "duplicate":123,
553 #             "normal":123,
554 #             "normal-bytes":123456,
555 #             "dirty-sync-count":15
556 #          },
557 #          "disk":{
558 #             "total":20971520,
559 #             "remaining":20880384,
560 #             "transferred":91136
561 #          }
562 #       }
563 #    }
564 #
565 # 6. Migration is being performed and XBZRLE is active:
566 #
567 # -> { "execute": "query-migrate" }
568 # <- {
569 #       "return":{
570 #          "status":"active",
571 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
572 #          "ram":{
573 #             "total":1057024,
574 #             "remaining":1053304,
575 #             "transferred":3720,
576 #             "total-time":12345,
577 #             "setup-time":12345,
578 #             "expected-downtime":12345,
579 #             "duplicate":10,
580 #             "normal":3333,
581 #             "normal-bytes":3412992,
582 #             "dirty-sync-count":15
583 #          },
584 #          "xbzrle-cache":{
585 #             "cache-size":67108864,
586 #             "bytes":20971520,
587 #             "pages":2444343,
588 #             "cache-miss":2244,
589 #             "cache-miss-rate":0.123,
590 #             "overflow":34434
591 #          }
592 #       }
593 #    }
594 #
595 ##
596 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
597
598 ##
599 # @MigrationCapability:
600 #
601 # Migration capabilities enumeration
602 #
603 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
604 #          This feature allows us to minimize migration traffic for certain work
605 #          loads, by sending compressed difference of the pages
606 #
607 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
608 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
609 #          Disabled by default. (since 2.0)
610 #
611 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
612 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
613 #          source and target VM to support this feature. To enable it is sufficient
614 #          to enable the capability on the source VM. The feature is disabled by
615 #          default. (since 1.6)
616 #
617 # @compress: Use multiple compression threads to accelerate live migration.
618 #          This feature can help to reduce the migration traffic, by sending
619 #          compressed pages. Please note that if compress and xbzrle are both
620 #          on, compress only takes effect in the ram bulk stage, after that,
621 #          it will be disabled and only xbzrle takes effect, this can help to
622 #          minimize migration traffic. The feature is disabled by default.
623 #          (since 2.4 )
624 #
625 # @events: generate events for each migration state change
626 #          (since 2.4 )
627 #
628 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
629 #          to speed up convergence of RAM migration. (since 1.6)
630 #
631 # @postcopy-ram: Start executing on the migration target before all of RAM has
632 #          been migrated, pulling the remaining pages along as needed. NOTE: If
633 #          the migration fails during postcopy the VM will fail.  (since 2.6)
634 #
635 # @x-colo: If enabled, migration will never end, and the state of the VM on the
636 #        primary side will be migrated continuously to the VM on secondary
637 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
638 #        Non-stop Service. (since 2.8)
639 #
640 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
641 #        during postcopy-ram migration. (since 2.9)
642 #
643 # @block: If enabled, QEMU will also migrate the contents of all block
644 #          devices.  Default is disabled.  A possible alternative uses
645 #          mirror jobs to a builtin NBD server on the destination, which
646 #          offers more flexibility.
647 #          (Since 2.10)
648 #
649 # @return-path: If enabled, migration will use the return path even
650 #               for precopy. (since 2.10)
651 #
652 # Since: 1.2
653 ##
654 { 'enum': 'MigrationCapability',
655   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
656            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
657            'block', 'return-path' ] }
658
659 ##
660 # @MigrationCapabilityStatus:
661 #
662 # Migration capability information
663 #
664 # @capability: capability enum
665 #
666 # @state: capability state bool
667 #
668 # Since: 1.2
669 ##
670 { 'struct': 'MigrationCapabilityStatus',
671   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
672
673 ##
674 # @migrate-set-capabilities:
675 #
676 # Enable/Disable the following migration capabilities (like xbzrle)
677 #
678 # @capabilities: json array of capability modifications to make
679 #
680 # Since: 1.2
681 #
682 # Example:
683 #
684 # -> { "execute": "migrate-set-capabilities" , "arguments":
685 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
686 #
687 ##
688 { 'command': 'migrate-set-capabilities',
689   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
690
691 ##
692 # @query-migrate-capabilities:
693 #
694 # Returns information about the current migration capabilities status
695 #
696 # Returns: @MigrationCapabilitiesStatus
697 #
698 # Since: 1.2
699 #
700 # Example:
701 #
702 # -> { "execute": "query-migrate-capabilities" }
703 # <- { "return": [
704 #       {"state": false, "capability": "xbzrle"},
705 #       {"state": false, "capability": "rdma-pin-all"},
706 #       {"state": false, "capability": "auto-converge"},
707 #       {"state": false, "capability": "zero-blocks"},
708 #       {"state": false, "capability": "compress"},
709 #       {"state": true, "capability": "events"},
710 #       {"state": false, "capability": "postcopy-ram"},
711 #       {"state": false, "capability": "x-colo"}
712 #    ]}
713 #
714 ##
715 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
716
717 ##
718 # @MigrationParameter:
719 #
720 # Migration parameters enumeration
721 #
722 # @compress-level: Set the compression level to be used in live migration,
723 #          the compression level is an integer between 0 and 9, where 0 means
724 #          no compression, 1 means the best compression speed, and 9 means best
725 #          compression ratio which will consume more CPU.
726 #
727 # @compress-threads: Set compression thread count to be used in live migration,
728 #          the compression thread count is an integer between 1 and 255.
729 #
730 # @decompress-threads: Set decompression thread count to be used in live
731 #          migration, the decompression thread count is an integer between 1
732 #          and 255. Usually, decompression is at least 4 times as fast as
733 #          compression, so set the decompress-threads to the number about 1/4
734 #          of compress-threads is adequate.
735 #
736 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
737 #                        when migration auto-converge is activated. The
738 #                        default value is 20. (Since 2.7)
739 #
740 # @cpu-throttle-increment: throttle percentage increase each time
741 #                          auto-converge detects that migration is not making
742 #                          progress. The default value is 10. (Since 2.7)
743 #
744 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
745 #             establishing a TLS connection over the migration data channel.
746 #             On the outgoing side of the migration, the credentials must
747 #             be for a 'client' endpoint, while for the incoming side the
748 #             credentials must be for a 'server' endpoint. Setting this
749 #             will enable TLS for all migrations. The default is unset,
750 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
751 #
752 # @tls-hostname: hostname of the target host for the migration. This is
753 #                required when using x509 based TLS credentials and the
754 #                migration URI does not already include a hostname. For
755 #                example if using fd: or exec: based migration, the
756 #                hostname must be provided so that the server's x509
757 #                certificate identity can be validated. (Since 2.7)
758 #
759 # @max-bandwidth: to set maximum speed for migration. maximum speed in
760 #                 bytes per second. (Since 2.8)
761 #
762 # @downtime-limit: set maximum tolerated downtime for migration. maximum
763 #                  downtime in milliseconds (Since 2.8)
764 #
765 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
766 #          periodic mode. (Since 2.8)
767 #
768 # @block-incremental: Affects how much storage is migrated when the
769 #       block migration capability is enabled.  When false, the entire
770 #       storage backing chain is migrated into a flattened image at
771 #       the destination; when true, only the active qcow2 layer is
772 #       migrated and the destination must already have access to the
773 #       same backing chain as was used on the source.  (since 2.10)
774 #
775 # Since: 2.4
776 ##
777 { 'enum': 'MigrationParameter',
778   'data': ['compress-level', 'compress-threads', 'decompress-threads',
779            'cpu-throttle-initial', 'cpu-throttle-increment',
780            'tls-creds', 'tls-hostname', 'max-bandwidth',
781            'downtime-limit', 'x-checkpoint-delay', 'block-incremental' ] }
782
783 ##
784 # @MigrateSetParameters:
785 #
786 # @compress-level: compression level
787 #
788 # @compress-threads: compression thread count
789 #
790 # @decompress-threads: decompression thread count
791 #
792 # @cpu-throttle-initial: Initial percentage of time guest cpus are
793 #                        throttled when migration auto-converge is activated.
794 #                        The default value is 20. (Since 2.7)
795 #
796 # @cpu-throttle-increment: throttle percentage increase each time
797 #                          auto-converge detects that migration is not making
798 #                          progress. The default value is 10. (Since 2.7)
799 #
800 # @tls-creds: ID of the 'tls-creds' object that provides credentials
801 #             for establishing a TLS connection over the migration data
802 #             channel. On the outgoing side of the migration, the credentials
803 #             must be for a 'client' endpoint, while for the incoming side the
804 #             credentials must be for a 'server' endpoint. Setting this
805 #             to a non-empty string enables TLS for all migrations.
806 #             An empty string means that QEMU will use plain text mode for
807 #             migration, rather than TLS (Since 2.9)
808 #             Previously (since 2.7), this was reported by omitting
809 #             tls-creds instead.
810 #
811 # @tls-hostname: hostname of the target host for the migration. This
812 #                is required when using x509 based TLS credentials and the
813 #                migration URI does not already include a hostname. For
814 #                example if using fd: or exec: based migration, the
815 #                hostname must be provided so that the server's x509
816 #                certificate identity can be validated. (Since 2.7)
817 #                An empty string means that QEMU will use the hostname
818 #                associated with the migration URI, if any. (Since 2.9)
819 #                Previously (since 2.7), this was reported by omitting
820 #                tls-hostname instead.
821 #
822 # @max-bandwidth: to set maximum speed for migration. maximum speed in
823 #                 bytes per second. (Since 2.8)
824 #
825 # @downtime-limit: set maximum tolerated downtime for migration. maximum
826 #                  downtime in milliseconds (Since 2.8)
827 #
828 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
829 #
830 # @block-incremental: Affects how much storage is migrated when the
831 #       block migration capability is enabled.  When false, the entire
832 #       storage backing chain is migrated into a flattened image at
833 #       the destination; when true, only the active qcow2 layer is
834 #       migrated and the destination must already have access to the
835 #       same backing chain as was used on the source.  (since 2.10)
836 #
837 # Since: 2.4
838 ##
839 # TODO either fuse back into MigrationParameters, or make
840 # MigrationParameters members mandatory
841 { 'struct': 'MigrateSetParameters',
842   'data': { '*compress-level': 'int',
843             '*compress-threads': 'int',
844             '*decompress-threads': 'int',
845             '*cpu-throttle-initial': 'int',
846             '*cpu-throttle-increment': 'int',
847             '*tls-creds': 'StrOrNull',
848             '*tls-hostname': 'StrOrNull',
849             '*max-bandwidth': 'int',
850             '*downtime-limit': 'int',
851             '*x-checkpoint-delay': 'int',
852             '*block-incremental': 'bool' } }
853
854 ##
855 # @migrate-set-parameters:
856 #
857 # Set various migration parameters.
858 #
859 # Since: 2.4
860 #
861 # Example:
862 #
863 # -> { "execute": "migrate-set-parameters" ,
864 #      "arguments": { "compress-level": 1 } }
865 #
866 ##
867 { 'command': 'migrate-set-parameters', 'boxed': true,
868   'data': 'MigrateSetParameters' }
869
870 ##
871 # @MigrationParameters:
872 #
873 # The optional members aren't actually optional.
874 #
875 # @compress-level: compression level
876 #
877 # @compress-threads: compression thread count
878 #
879 # @decompress-threads: decompression thread count
880 #
881 # @cpu-throttle-initial: Initial percentage of time guest cpus are
882 #                        throttled when migration auto-converge is activated.
883 #                        (Since 2.7)
884 #
885 # @cpu-throttle-increment: throttle percentage increase each time
886 #                          auto-converge detects that migration is not making
887 #                          progress. (Since 2.7)
888 #
889 # @tls-creds: ID of the 'tls-creds' object that provides credentials
890 #             for establishing a TLS connection over the migration data
891 #             channel. On the outgoing side of the migration, the credentials
892 #             must be for a 'client' endpoint, while for the incoming side the
893 #             credentials must be for a 'server' endpoint.
894 #             An empty string means that QEMU will use plain text mode for
895 #             migration, rather than TLS (Since 2.7)
896 #             Note: 2.8 reports this by omitting tls-creds instead.
897 #
898 # @tls-hostname: hostname of the target host for the migration. This
899 #                is required when using x509 based TLS credentials and the
900 #                migration URI does not already include a hostname. For
901 #                example if using fd: or exec: based migration, the
902 #                hostname must be provided so that the server's x509
903 #                certificate identity can be validated. (Since 2.7)
904 #                An empty string means that QEMU will use the hostname
905 #                associated with the migration URI, if any. (Since 2.9)
906 #                Note: 2.8 reports this by omitting tls-hostname instead.
907 #
908 # @max-bandwidth: to set maximum speed for migration. maximum speed in
909 #                 bytes per second. (Since 2.8)
910 #
911 # @downtime-limit: set maximum tolerated downtime for migration. maximum
912 #                  downtime in milliseconds (Since 2.8)
913 #
914 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
915 #
916 # @block-incremental: Affects how much storage is migrated when the
917 #       block migration capability is enabled.  When false, the entire
918 #       storage backing chain is migrated into a flattened image at
919 #       the destination; when true, only the active qcow2 layer is
920 #       migrated and the destination must already have access to the
921 #       same backing chain as was used on the source.  (since 2.10)
922 #
923 # Since: 2.4
924 ##
925 { 'struct': 'MigrationParameters',
926   'data': { '*compress-level': 'int',
927             '*compress-threads': 'int',
928             '*decompress-threads': 'int',
929             '*cpu-throttle-initial': 'int',
930             '*cpu-throttle-increment': 'int',
931             '*tls-creds': 'str',
932             '*tls-hostname': 'str',
933             '*max-bandwidth': 'int',
934             '*downtime-limit': 'int',
935             '*x-checkpoint-delay': 'int',
936             '*block-incremental': 'bool' } }
937
938 ##
939 # @query-migrate-parameters:
940 #
941 # Returns information about the current migration parameters
942 #
943 # Returns: @MigrationParameters
944 #
945 # Since: 2.4
946 #
947 # Example:
948 #
949 # -> { "execute": "query-migrate-parameters" }
950 # <- { "return": {
951 #          "decompress-threads": 2,
952 #          "cpu-throttle-increment": 10,
953 #          "compress-threads": 8,
954 #          "compress-level": 1,
955 #          "cpu-throttle-initial": 20,
956 #          "max-bandwidth": 33554432,
957 #          "downtime-limit": 300
958 #       }
959 #    }
960 #
961 ##
962 { 'command': 'query-migrate-parameters',
963   'returns': 'MigrationParameters' }
964
965 ##
966 # @client_migrate_info:
967 #
968 # Set migration information for remote display.  This makes the server
969 # ask the client to automatically reconnect using the new parameters
970 # once migration finished successfully.  Only implemented for SPICE.
971 #
972 # @protocol:     must be "spice"
973 # @hostname:     migration target hostname
974 # @port:         spice tcp port for plaintext channels
975 # @tls-port:     spice tcp port for tls-secured channels
976 # @cert-subject: server certificate subject
977 #
978 # Since: 0.14.0
979 #
980 # Example:
981 #
982 # -> { "execute": "client_migrate_info",
983 #      "arguments": { "protocol": "spice",
984 #                     "hostname": "virt42.lab.kraxel.org",
985 #                     "port": 1234 } }
986 # <- { "return": {} }
987 #
988 ##
989 { 'command': 'client_migrate_info',
990   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
991             '*tls-port': 'int', '*cert-subject': 'str' } }
992
993 ##
994 # @migrate-start-postcopy:
995 #
996 # Followup to a migration command to switch the migration to postcopy mode.
997 # The postcopy-ram capability must be set before the original migration
998 # command.
999 #
1000 # Since: 2.5
1001 #
1002 # Example:
1003 #
1004 # -> { "execute": "migrate-start-postcopy" }
1005 # <- { "return": {} }
1006 #
1007 ##
1008 { 'command': 'migrate-start-postcopy' }
1009
1010 ##
1011 # @COLOMessage:
1012 #
1013 # The message transmission between Primary side and Secondary side.
1014 #
1015 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1016 #
1017 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1018 #
1019 # @checkpoint-reply: SVM gets PVM's checkpoint request
1020 #
1021 # @vmstate-send: VM's state will be sent by PVM.
1022 #
1023 # @vmstate-size: The total size of VMstate.
1024 #
1025 # @vmstate-received: VM's state has been received by SVM.
1026 #
1027 # @vmstate-loaded: VM's state has been loaded by SVM.
1028 #
1029 # Since: 2.8
1030 ##
1031 { 'enum': 'COLOMessage',
1032   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1033             'vmstate-send', 'vmstate-size', 'vmstate-received',
1034             'vmstate-loaded' ] }
1035
1036 ##
1037 # @COLOMode:
1038 #
1039 # The colo mode
1040 #
1041 # @unknown: unknown mode
1042 #
1043 # @primary: master side
1044 #
1045 # @secondary: slave side
1046 #
1047 # Since: 2.8
1048 ##
1049 { 'enum': 'COLOMode',
1050   'data': [ 'unknown', 'primary', 'secondary'] }
1051
1052 ##
1053 # @FailoverStatus:
1054 #
1055 # An enumeration of COLO failover status
1056 #
1057 # @none: no failover has ever happened
1058 #
1059 # @require: got failover requirement but not handled
1060 #
1061 # @active: in the process of doing failover
1062 #
1063 # @completed: finish the process of failover
1064 #
1065 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1066 #
1067 # Since: 2.8
1068 ##
1069 { 'enum': 'FailoverStatus',
1070   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1071
1072 ##
1073 # @x-colo-lost-heartbeat:
1074 #
1075 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1076 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1077 # If sent to the Secondary, the Secondary side will run failover work,
1078 # then takes over server operation to become the service VM.
1079 #
1080 # Since: 2.8
1081 #
1082 # Example:
1083 #
1084 # -> { "execute": "x-colo-lost-heartbeat" }
1085 # <- { "return": {} }
1086 #
1087 ##
1088 { 'command': 'x-colo-lost-heartbeat' }
1089
1090 ##
1091 # @CpuInfoArch:
1092 #
1093 # An enumeration of cpu types that enable additional information during
1094 # @query-cpus.
1095 #
1096 # Since: 2.6
1097 ##
1098 { 'enum': 'CpuInfoArch',
1099   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1100
1101 ##
1102 # @CpuInfo:
1103 #
1104 # Information about a virtual CPU
1105 #
1106 # @CPU: the index of the virtual CPU
1107 #
1108 # @current: this only exists for backwards compatibility and should be ignored
1109 #
1110 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1111 #          to a processor specific low power mode.
1112 #
1113 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1114 #
1115 # @thread_id: ID of the underlying host thread
1116 #
1117 # @props: properties describing to which node/socket/core/thread
1118 #         virtual CPU belongs to, provided if supported by board (since 2.10)
1119 #
1120 # @arch: architecture of the cpu, which determines which additional fields
1121 #        will be listed (since 2.6)
1122 #
1123 # Since: 0.14.0
1124 #
1125 # Notes: @halted is a transient state that changes frequently.  By the time the
1126 #        data is sent to the client, the guest may no longer be halted.
1127 ##
1128 { 'union': 'CpuInfo',
1129   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1130            'qom_path': 'str', 'thread_id': 'int',
1131            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
1132   'discriminator': 'arch',
1133   'data': { 'x86': 'CpuInfoX86',
1134             'sparc': 'CpuInfoSPARC',
1135             'ppc': 'CpuInfoPPC',
1136             'mips': 'CpuInfoMIPS',
1137             'tricore': 'CpuInfoTricore',
1138             'other': 'CpuInfoOther' } }
1139
1140 ##
1141 # @CpuInfoX86:
1142 #
1143 # Additional information about a virtual i386 or x86_64 CPU
1144 #
1145 # @pc: the 64-bit instruction pointer
1146 #
1147 # Since: 2.6
1148 ##
1149 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1150
1151 ##
1152 # @CpuInfoSPARC:
1153 #
1154 # Additional information about a virtual SPARC CPU
1155 #
1156 # @pc: the PC component of the instruction pointer
1157 #
1158 # @npc: the NPC component of the instruction pointer
1159 #
1160 # Since: 2.6
1161 ##
1162 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1163
1164 ##
1165 # @CpuInfoPPC:
1166 #
1167 # Additional information about a virtual PPC CPU
1168 #
1169 # @nip: the instruction pointer
1170 #
1171 # Since: 2.6
1172 ##
1173 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1174
1175 ##
1176 # @CpuInfoMIPS:
1177 #
1178 # Additional information about a virtual MIPS CPU
1179 #
1180 # @PC: the instruction pointer
1181 #
1182 # Since: 2.6
1183 ##
1184 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1185
1186 ##
1187 # @CpuInfoTricore:
1188 #
1189 # Additional information about a virtual Tricore CPU
1190 #
1191 # @PC: the instruction pointer
1192 #
1193 # Since: 2.6
1194 ##
1195 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1196
1197 ##
1198 # @CpuInfoOther:
1199 #
1200 # No additional information is available about the virtual CPU
1201 #
1202 # Since: 2.6
1203 #
1204 ##
1205 { 'struct': 'CpuInfoOther', 'data': { } }
1206
1207 ##
1208 # @query-cpus:
1209 #
1210 # Returns a list of information about each virtual CPU.
1211 #
1212 # Returns: a list of @CpuInfo for each virtual CPU
1213 #
1214 # Since: 0.14.0
1215 #
1216 # Example:
1217 #
1218 # -> { "execute": "query-cpus" }
1219 # <- { "return": [
1220 #          {
1221 #             "CPU":0,
1222 #             "current":true,
1223 #             "halted":false,
1224 #             "qom_path":"/machine/unattached/device[0]",
1225 #             "arch":"x86",
1226 #             "pc":3227107138,
1227 #             "thread_id":3134
1228 #          },
1229 #          {
1230 #             "CPU":1,
1231 #             "current":false,
1232 #             "halted":true,
1233 #             "qom_path":"/machine/unattached/device[2]",
1234 #             "arch":"x86",
1235 #             "pc":7108165,
1236 #             "thread_id":3135
1237 #          }
1238 #       ]
1239 #    }
1240 #
1241 ##
1242 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1243
1244 ##
1245 # @IOThreadInfo:
1246 #
1247 # Information about an iothread
1248 #
1249 # @id: the identifier of the iothread
1250 #
1251 # @thread-id: ID of the underlying host thread
1252 #
1253 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1254 #               (since 2.9)
1255 #
1256 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1257 #             configured (since 2.9)
1258 #
1259 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1260 #               it's not configured (since 2.9)
1261 #
1262 # Since: 2.0
1263 ##
1264 { 'struct': 'IOThreadInfo',
1265   'data': {'id': 'str',
1266            'thread-id': 'int',
1267            'poll-max-ns': 'int',
1268            'poll-grow': 'int',
1269            'poll-shrink': 'int' } }
1270
1271 ##
1272 # @query-iothreads:
1273 #
1274 # Returns a list of information about each iothread.
1275 #
1276 # Note: this list excludes the QEMU main loop thread, which is not declared
1277 # using the -object iothread command-line option.  It is always the main thread
1278 # of the process.
1279 #
1280 # Returns: a list of @IOThreadInfo for each iothread
1281 #
1282 # Since: 2.0
1283 #
1284 # Example:
1285 #
1286 # -> { "execute": "query-iothreads" }
1287 # <- { "return": [
1288 #          {
1289 #             "id":"iothread0",
1290 #             "thread-id":3134
1291 #          },
1292 #          {
1293 #             "id":"iothread1",
1294 #             "thread-id":3135
1295 #          }
1296 #       ]
1297 #    }
1298 #
1299 ##
1300 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1301
1302 ##
1303 # @BalloonInfo:
1304 #
1305 # Information about the guest balloon device.
1306 #
1307 # @actual: the number of bytes the balloon currently contains
1308 #
1309 # Since: 0.14.0
1310 #
1311 ##
1312 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1313
1314 ##
1315 # @query-balloon:
1316 #
1317 # Return information about the balloon device.
1318 #
1319 # Returns: @BalloonInfo on success
1320 #
1321 #          If the balloon driver is enabled but not functional because the KVM
1322 #          kernel module cannot support it, KvmMissingCap
1323 #
1324 #          If no balloon device is present, DeviceNotActive
1325 #
1326 # Since: 0.14.0
1327 #
1328 # Example:
1329 #
1330 # -> { "execute": "query-balloon" }
1331 # <- { "return": {
1332 #          "actual": 1073741824,
1333 #       }
1334 #    }
1335 #
1336 ##
1337 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1338
1339 ##
1340 # @PciMemoryRange:
1341 #
1342 # A PCI device memory region
1343 #
1344 # @base: the starting address (guest physical)
1345 #
1346 # @limit: the ending address (guest physical)
1347 #
1348 # Since: 0.14.0
1349 ##
1350 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1351
1352 ##
1353 # @PciMemoryRegion:
1354 #
1355 # Information about a PCI device I/O region.
1356 #
1357 # @bar: the index of the Base Address Register for this region
1358 #
1359 # @type: 'io' if the region is a PIO region
1360 #        'memory' if the region is a MMIO region
1361 #
1362 # @size: memory size
1363 #
1364 # @prefetch: if @type is 'memory', true if the memory is prefetchable
1365 #
1366 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
1367 #
1368 # Since: 0.14.0
1369 ##
1370 { 'struct': 'PciMemoryRegion',
1371   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1372            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1373
1374 ##
1375 # @PciBusInfo:
1376 #
1377 # Information about a bus of a PCI Bridge device
1378 #
1379 # @number: primary bus interface number.  This should be the number of the
1380 #          bus the device resides on.
1381 #
1382 # @secondary: secondary bus interface number.  This is the number of the
1383 #             main bus for the bridge
1384 #
1385 # @subordinate: This is the highest number bus that resides below the
1386 #               bridge.
1387 #
1388 # @io_range: The PIO range for all devices on this bridge
1389 #
1390 # @memory_range: The MMIO range for all devices on this bridge
1391 #
1392 # @prefetchable_range: The range of prefetchable MMIO for all devices on
1393 #                      this bridge
1394 #
1395 # Since: 2.4
1396 ##
1397 { 'struct': 'PciBusInfo',
1398   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1399            'io_range': 'PciMemoryRange',
1400            'memory_range': 'PciMemoryRange',
1401            'prefetchable_range': 'PciMemoryRange' } }
1402
1403 ##
1404 # @PciBridgeInfo:
1405 #
1406 # Information about a PCI Bridge device
1407 #
1408 # @bus: information about the bus the device resides on
1409 #
1410 # @devices: a list of @PciDeviceInfo for each device on this bridge
1411 #
1412 # Since: 0.14.0
1413 ##
1414 { 'struct': 'PciBridgeInfo',
1415   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
1416
1417 ##
1418 # @PciDeviceClass:
1419 #
1420 # Information about the Class of a PCI device
1421 #
1422 # @desc: a string description of the device's class
1423 #
1424 # @class: the class code of the device
1425 #
1426 # Since: 2.4
1427 ##
1428 { 'struct': 'PciDeviceClass',
1429   'data': {'*desc': 'str', 'class': 'int'} }
1430
1431 ##
1432 # @PciDeviceId:
1433 #
1434 # Information about the Id of a PCI device
1435 #
1436 # @device: the PCI device id
1437 #
1438 # @vendor: the PCI vendor id
1439 #
1440 # Since: 2.4
1441 ##
1442 { 'struct': 'PciDeviceId',
1443   'data': {'device': 'int', 'vendor': 'int'} }
1444
1445 ##
1446 # @PciDeviceInfo:
1447 #
1448 # Information about a PCI device
1449 #
1450 # @bus: the bus number of the device
1451 #
1452 # @slot: the slot the device is located in
1453 #
1454 # @function: the function of the slot used by the device
1455 #
1456 # @class_info: the class of the device
1457 #
1458 # @id: the PCI device id
1459 #
1460 # @irq: if an IRQ is assigned to the device, the IRQ number
1461 #
1462 # @qdev_id: the device name of the PCI device
1463 #
1464 # @pci_bridge: if the device is a PCI bridge, the bridge information
1465 #
1466 # @regions: a list of the PCI I/O regions associated with the device
1467 #
1468 # Notes: the contents of @class_info.desc are not stable and should only be
1469 #        treated as informational.
1470 #
1471 # Since: 0.14.0
1472 ##
1473 { 'struct': 'PciDeviceInfo',
1474   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1475            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
1476            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1477            'regions': ['PciMemoryRegion']} }
1478
1479 ##
1480 # @PciInfo:
1481 #
1482 # Information about a PCI bus
1483 #
1484 # @bus: the bus index
1485 #
1486 # @devices: a list of devices on this bus
1487 #
1488 # Since: 0.14.0
1489 ##
1490 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1491
1492 ##
1493 # @query-pci:
1494 #
1495 # Return information about the PCI bus topology of the guest.
1496 #
1497 # Returns: a list of @PciInfo for each PCI bus. Each bus is
1498 # represented by a json-object, which has a key with a json-array of
1499 # all PCI devices attached to it. Each device is represented by a
1500 # json-object.
1501 #
1502 # Since: 0.14.0
1503 #
1504 # Example:
1505 #
1506 # -> { "execute": "query-pci" }
1507 # <- { "return": [
1508 #          {
1509 #             "bus": 0,
1510 #             "devices": [
1511 #                {
1512 #                   "bus": 0,
1513 #                   "qdev_id": "",
1514 #                   "slot": 0,
1515 #                   "class_info": {
1516 #                      "class": 1536,
1517 #                      "desc": "Host bridge"
1518 #                   },
1519 #                   "id": {
1520 #                      "device": 32902,
1521 #                      "vendor": 4663
1522 #                   },
1523 #                   "function": 0,
1524 #                   "regions": [
1525 #                   ]
1526 #                },
1527 #                {
1528 #                   "bus": 0,
1529 #                   "qdev_id": "",
1530 #                   "slot": 1,
1531 #                   "class_info": {
1532 #                      "class": 1537,
1533 #                      "desc": "ISA bridge"
1534 #                   },
1535 #                   "id": {
1536 #                      "device": 32902,
1537 #                      "vendor": 28672
1538 #                   },
1539 #                   "function": 0,
1540 #                   "regions": [
1541 #                   ]
1542 #                },
1543 #                {
1544 #                   "bus": 0,
1545 #                   "qdev_id": "",
1546 #                   "slot": 1,
1547 #                   "class_info": {
1548 #                      "class": 257,
1549 #                      "desc": "IDE controller"
1550 #                   },
1551 #                   "id": {
1552 #                      "device": 32902,
1553 #                      "vendor": 28688
1554 #                   },
1555 #                   "function": 1,
1556 #                   "regions": [
1557 #                      {
1558 #                         "bar": 4,
1559 #                         "size": 16,
1560 #                         "address": 49152,
1561 #                         "type": "io"
1562 #                      }
1563 #                   ]
1564 #                },
1565 #                {
1566 #                   "bus": 0,
1567 #                   "qdev_id": "",
1568 #                   "slot": 2,
1569 #                   "class_info": {
1570 #                      "class": 768,
1571 #                      "desc": "VGA controller"
1572 #                   },
1573 #                   "id": {
1574 #                      "device": 4115,
1575 #                      "vendor": 184
1576 #                   },
1577 #                   "function": 0,
1578 #                   "regions": [
1579 #                      {
1580 #                         "prefetch": true,
1581 #                         "mem_type_64": false,
1582 #                         "bar": 0,
1583 #                         "size": 33554432,
1584 #                         "address": 4026531840,
1585 #                         "type": "memory"
1586 #                      },
1587 #                      {
1588 #                         "prefetch": false,
1589 #                         "mem_type_64": false,
1590 #                         "bar": 1,
1591 #                         "size": 4096,
1592 #                         "address": 4060086272,
1593 #                         "type": "memory"
1594 #                      },
1595 #                      {
1596 #                         "prefetch": false,
1597 #                         "mem_type_64": false,
1598 #                         "bar": 6,
1599 #                         "size": 65536,
1600 #                         "address": -1,
1601 #                         "type": "memory"
1602 #                      }
1603 #                   ]
1604 #                },
1605 #                {
1606 #                   "bus": 0,
1607 #                   "qdev_id": "",
1608 #                   "irq": 11,
1609 #                   "slot": 4,
1610 #                   "class_info": {
1611 #                      "class": 1280,
1612 #                      "desc": "RAM controller"
1613 #                   },
1614 #                   "id": {
1615 #                      "device": 6900,
1616 #                      "vendor": 4098
1617 #                   },
1618 #                   "function": 0,
1619 #                   "regions": [
1620 #                      {
1621 #                         "bar": 0,
1622 #                         "size": 32,
1623 #                         "address": 49280,
1624 #                         "type": "io"
1625 #                      }
1626 #                   ]
1627 #                }
1628 #             ]
1629 #          }
1630 #       ]
1631 #    }
1632 #
1633 # Note: This example has been shortened as the real response is too long.
1634 #
1635 ##
1636 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1637
1638 ##
1639 # @quit:
1640 #
1641 # This command will cause the QEMU process to exit gracefully.  While every
1642 # attempt is made to send the QMP response before terminating, this is not
1643 # guaranteed.  When using this interface, a premature EOF would not be
1644 # unexpected.
1645 #
1646 # Since: 0.14.0
1647 #
1648 # Example:
1649 #
1650 # -> { "execute": "quit" }
1651 # <- { "return": {} }
1652 ##
1653 { 'command': 'quit' }
1654
1655 ##
1656 # @stop:
1657 #
1658 # Stop all guest VCPU execution.
1659 #
1660 # Since:  0.14.0
1661 #
1662 # Notes:  This function will succeed even if the guest is already in the stopped
1663 #         state.  In "inmigrate" state, it will ensure that the guest
1664 #         remains paused once migration finishes, as if the -S option was
1665 #         passed on the command line.
1666 #
1667 # Example:
1668 #
1669 # -> { "execute": "stop" }
1670 # <- { "return": {} }
1671 #
1672 ##
1673 { 'command': 'stop' }
1674
1675 ##
1676 # @system_reset:
1677 #
1678 # Performs a hard reset of a guest.
1679 #
1680 # Since: 0.14.0
1681 #
1682 # Example:
1683 #
1684 # -> { "execute": "system_reset" }
1685 # <- { "return": {} }
1686 #
1687 ##
1688 { 'command': 'system_reset' }
1689
1690 ##
1691 # @system_powerdown:
1692 #
1693 # Requests that a guest perform a powerdown operation.
1694 #
1695 # Since: 0.14.0
1696 #
1697 # Notes: A guest may or may not respond to this command.  This command
1698 #        returning does not indicate that a guest has accepted the request or
1699 #        that it has shut down.  Many guests will respond to this command by
1700 #        prompting the user in some way.
1701 # Example:
1702 #
1703 # -> { "execute": "system_powerdown" }
1704 # <- { "return": {} }
1705 #
1706 ##
1707 { 'command': 'system_powerdown' }
1708
1709 ##
1710 # @cpu:
1711 #
1712 # This command is a nop that is only provided for the purposes of compatibility.
1713 #
1714 # Since: 0.14.0
1715 #
1716 # Notes: Do not use this command.
1717 ##
1718 { 'command': 'cpu', 'data': {'index': 'int'} }
1719
1720 ##
1721 # @cpu-add:
1722 #
1723 # Adds CPU with specified ID
1724 #
1725 # @id: ID of CPU to be created, valid values [0..max_cpus)
1726 #
1727 # Returns: Nothing on success
1728 #
1729 # Since: 1.5
1730 #
1731 # Example:
1732 #
1733 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1734 # <- { "return": {} }
1735 #
1736 ##
1737 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1738
1739 ##
1740 # @memsave:
1741 #
1742 # Save a portion of guest memory to a file.
1743 #
1744 # @val: the virtual address of the guest to start from
1745 #
1746 # @size: the size of memory region to save
1747 #
1748 # @filename: the file to save the memory to as binary data
1749 #
1750 # @cpu-index: the index of the virtual CPU to use for translating the
1751 #                       virtual address (defaults to CPU 0)
1752 #
1753 # Returns: Nothing on success
1754 #
1755 # Since: 0.14.0
1756 #
1757 # Notes: Errors were not reliably returned until 1.1
1758 #
1759 # Example:
1760 #
1761 # -> { "execute": "memsave",
1762 #      "arguments": { "val": 10,
1763 #                     "size": 100,
1764 #                     "filename": "/tmp/virtual-mem-dump" } }
1765 # <- { "return": {} }
1766 #
1767 ##
1768 { 'command': 'memsave',
1769   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1770
1771 ##
1772 # @pmemsave:
1773 #
1774 # Save a portion of guest physical memory to a file.
1775 #
1776 # @val: the physical address of the guest to start from
1777 #
1778 # @size: the size of memory region to save
1779 #
1780 # @filename: the file to save the memory to as binary data
1781 #
1782 # Returns: Nothing on success
1783 #
1784 # Since: 0.14.0
1785 #
1786 # Notes: Errors were not reliably returned until 1.1
1787 #
1788 # Example:
1789 #
1790 # -> { "execute": "pmemsave",
1791 #      "arguments": { "val": 10,
1792 #                     "size": 100,
1793 #                     "filename": "/tmp/physical-mem-dump" } }
1794 # <- { "return": {} }
1795 #
1796 ##
1797 { 'command': 'pmemsave',
1798   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1799
1800 ##
1801 # @cont:
1802 #
1803 # Resume guest VCPU execution.
1804 #
1805 # Since:  0.14.0
1806 #
1807 # Returns:  If successful, nothing
1808 #
1809 # Notes:  This command will succeed if the guest is currently running.  It
1810 #         will also succeed if the guest is in the "inmigrate" state; in
1811 #         this case, the effect of the command is to make sure the guest
1812 #         starts once migration finishes, removing the effect of the -S
1813 #         command line option if it was passed.
1814 #
1815 # Example:
1816 #
1817 # -> { "execute": "cont" }
1818 # <- { "return": {} }
1819 #
1820 ##
1821 { 'command': 'cont' }
1822
1823 ##
1824 # @system_wakeup:
1825 #
1826 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1827 #
1828 # Since:  1.1
1829 #
1830 # Returns:  nothing.
1831 #
1832 # Example:
1833 #
1834 # -> { "execute": "system_wakeup" }
1835 # <- { "return": {} }
1836 #
1837 ##
1838 { 'command': 'system_wakeup' }
1839
1840 ##
1841 # @inject-nmi:
1842 #
1843 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1844 # The command fails when the guest doesn't support injecting.
1845 #
1846 # Returns:  If successful, nothing
1847 #
1848 # Since:  0.14.0
1849 #
1850 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1851 #
1852 # Example:
1853 #
1854 # -> { "execute": "inject-nmi" }
1855 # <- { "return": {} }
1856 #
1857 ##
1858 { 'command': 'inject-nmi' }
1859
1860 ##
1861 # @balloon:
1862 #
1863 # Request the balloon driver to change its balloon size.
1864 #
1865 # @value: the target size of the balloon in bytes
1866 #
1867 # Returns: Nothing on success
1868 #          If the balloon driver is enabled but not functional because the KVM
1869 #            kernel module cannot support it, KvmMissingCap
1870 #          If no balloon device is present, DeviceNotActive
1871 #
1872 # Notes: This command just issues a request to the guest.  When it returns,
1873 #        the balloon size may not have changed.  A guest can change the balloon
1874 #        size independent of this command.
1875 #
1876 # Since: 0.14.0
1877 #
1878 # Example:
1879 #
1880 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1881 # <- { "return": {} }
1882 #
1883 ##
1884 { 'command': 'balloon', 'data': {'value': 'int'} }
1885
1886 ##
1887 # @Abort:
1888 #
1889 # This action can be used to test transaction failure.
1890 #
1891 # Since: 1.6
1892 ##
1893 { 'struct': 'Abort',
1894   'data': { } }
1895
1896 ##
1897 # @ActionCompletionMode:
1898 #
1899 # An enumeration of Transactional completion modes.
1900 #
1901 # @individual: Do not attempt to cancel any other Actions if any Actions fail
1902 #              after the Transaction request succeeds. All Actions that
1903 #              can complete successfully will do so without waiting on others.
1904 #              This is the default.
1905 #
1906 # @grouped: If any Action fails after the Transaction succeeds, cancel all
1907 #           Actions. Actions do not complete until all Actions are ready to
1908 #           complete. May be rejected by Actions that do not support this
1909 #           completion mode.
1910 #
1911 # Since: 2.5
1912 ##
1913 { 'enum': 'ActionCompletionMode',
1914   'data': [ 'individual', 'grouped' ] }
1915
1916 ##
1917 # @TransactionAction:
1918 #
1919 # A discriminated record of operations that can be performed with
1920 # @transaction. Action @type can be:
1921 #
1922 # - @abort: since 1.6
1923 # - @block-dirty-bitmap-add: since 2.5
1924 # - @block-dirty-bitmap-clear: since 2.5
1925 # - @blockdev-backup: since 2.3
1926 # - @blockdev-snapshot: since 2.5
1927 # - @blockdev-snapshot-internal-sync: since 1.7
1928 # - @blockdev-snapshot-sync: since 1.1
1929 # - @drive-backup: since 1.6
1930 #
1931 # Since: 1.1
1932 ##
1933 { 'union': 'TransactionAction',
1934   'data': {
1935        'abort': 'Abort',
1936        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
1937        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
1938        'blockdev-backup': 'BlockdevBackup',
1939        'blockdev-snapshot': 'BlockdevSnapshot',
1940        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
1941        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
1942        'drive-backup': 'DriveBackup'
1943    } }
1944
1945 ##
1946 # @TransactionProperties:
1947 #
1948 # Optional arguments to modify the behavior of a Transaction.
1949 #
1950 # @completion-mode: Controls how jobs launched asynchronously by
1951 #                   Actions will complete or fail as a group.
1952 #                   See @ActionCompletionMode for details.
1953 #
1954 # Since: 2.5
1955 ##
1956 { 'struct': 'TransactionProperties',
1957   'data': {
1958        '*completion-mode': 'ActionCompletionMode'
1959   }
1960 }
1961
1962 ##
1963 # @transaction:
1964 #
1965 # Executes a number of transactionable QMP commands atomically. If any
1966 # operation fails, then the entire set of actions will be abandoned and the
1967 # appropriate error returned.
1968 #
1969 # For external snapshots, the dictionary contains the device, the file to use for
1970 # the new snapshot, and the format.  The default format, if not specified, is
1971 # qcow2.
1972 #
1973 # Each new snapshot defaults to being created by QEMU (wiping any
1974 # contents if the file already exists), but it is also possible to reuse
1975 # an externally-created file.  In the latter case, you should ensure that
1976 # the new image file has the same contents as the current one; QEMU cannot
1977 # perform any meaningful check.  Typically this is achieved by using the
1978 # current image file as the backing file for the new image.
1979 #
1980 # On failure, the original disks pre-snapshot attempt will be used.
1981 #
1982 # For internal snapshots, the dictionary contains the device and the snapshot's
1983 # name.  If an internal snapshot matching name already exists, the request will
1984 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
1985 # and sheepdog.
1986 #
1987 # On failure, qemu will try delete the newly created internal snapshot in the
1988 # transaction.  When an I/O error occurs during deletion, the user needs to fix
1989 # it later with qemu-img or other command.
1990 #
1991 # @actions: List of @TransactionAction;
1992 #           information needed for the respective operations.
1993 #
1994 # @properties: structure of additional options to control the
1995 #              execution of the transaction. See @TransactionProperties
1996 #              for additional detail.
1997 #
1998 # Returns: nothing on success
1999 #
2000 #          Errors depend on the operations of the transaction
2001 #
2002 # Note: The transaction aborts on the first failure.  Therefore, there will be
2003 # information on only one failed operation returned in an error condition, and
2004 # subsequent actions will not have been attempted.
2005 #
2006 # Since: 1.1
2007 #
2008 # Example:
2009 #
2010 # -> { "execute": "transaction",
2011 #      "arguments": { "actions": [
2012 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2013 #                                      "snapshot-file": "/some/place/my-image",
2014 #                                      "format": "qcow2" } },
2015 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2016 #                                      "snapshot-file": "/some/place/my-image2",
2017 #                                      "snapshot-node-name": "node3432",
2018 #                                      "mode": "existing",
2019 #                                      "format": "qcow2" } },
2020 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2021 #                                      "snapshot-file": "/some/place/my-image2",
2022 #                                      "mode": "existing",
2023 #                                      "format": "qcow2" } },
2024 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2025 #                                      "device": "ide-hd2",
2026 #                                      "name": "snapshot0" } } ] } }
2027 # <- { "return": {} }
2028 #
2029 ##
2030 { 'command': 'transaction',
2031   'data': { 'actions': [ 'TransactionAction' ],
2032             '*properties': 'TransactionProperties'
2033           }
2034 }
2035
2036 ##
2037 # @human-monitor-command:
2038 #
2039 # Execute a command on the human monitor and return the output.
2040 #
2041 # @command-line: the command to execute in the human monitor
2042 #
2043 # @cpu-index: The CPU to use for commands that require an implicit CPU
2044 #
2045 # Returns: the output of the command as a string
2046 #
2047 # Since: 0.14.0
2048 #
2049 # Notes: This command only exists as a stop-gap.  Its use is highly
2050 #        discouraged.  The semantics of this command are not
2051 #        guaranteed: this means that command names, arguments and
2052 #        responses can change or be removed at ANY time.  Applications
2053 #        that rely on long term stability guarantees should NOT
2054 #        use this command.
2055 #
2056 #        Known limitations:
2057 #
2058 #        * This command is stateless, this means that commands that depend
2059 #          on state information (such as getfd) might not work
2060 #
2061 #        * Commands that prompt the user for data don't currently work
2062 #
2063 # Example:
2064 #
2065 # -> { "execute": "human-monitor-command",
2066 #      "arguments": { "command-line": "info kvm" } }
2067 # <- { "return": "kvm support: enabled\r\n" }
2068 #
2069 ##
2070 { 'command': 'human-monitor-command',
2071   'data': {'command-line': 'str', '*cpu-index': 'int'},
2072   'returns': 'str' }
2073
2074 ##
2075 # @migrate_cancel:
2076 #
2077 # Cancel the current executing migration process.
2078 #
2079 # Returns: nothing on success
2080 #
2081 # Notes: This command succeeds even if there is no migration process running.
2082 #
2083 # Since: 0.14.0
2084 #
2085 # Example:
2086 #
2087 # -> { "execute": "migrate_cancel" }
2088 # <- { "return": {} }
2089 #
2090 ##
2091 { 'command': 'migrate_cancel' }
2092
2093 ##
2094 # @migrate_set_downtime:
2095 #
2096 # Set maximum tolerated downtime for migration.
2097 #
2098 # @value: maximum downtime in seconds
2099 #
2100 # Returns: nothing on success
2101 #
2102 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2103 #
2104 # Since: 0.14.0
2105 #
2106 # Example:
2107 #
2108 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2109 # <- { "return": {} }
2110 #
2111 ##
2112 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2113
2114 ##
2115 # @migrate_set_speed:
2116 #
2117 # Set maximum speed for migration.
2118 #
2119 # @value: maximum speed in bytes per second.
2120 #
2121 # Returns: nothing on success
2122 #
2123 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2124 #
2125 # Since: 0.14.0
2126 #
2127 # Example:
2128 #
2129 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2130 # <- { "return": {} }
2131 #
2132 ##
2133 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2134
2135 ##
2136 # @migrate-set-cache-size:
2137 #
2138 # Set cache size to be used by XBZRLE migration
2139 #
2140 # @value: cache size in bytes
2141 #
2142 # The size will be rounded down to the nearest power of 2.
2143 # The cache size can be modified before and during ongoing migration
2144 #
2145 # Returns: nothing on success
2146 #
2147 # Since: 1.2
2148 #
2149 # Example:
2150 #
2151 # -> { "execute": "migrate-set-cache-size",
2152 #      "arguments": { "value": 536870912 } }
2153 # <- { "return": {} }
2154 #
2155 ##
2156 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2157
2158 ##
2159 # @query-migrate-cache-size:
2160 #
2161 # Query migration XBZRLE cache size
2162 #
2163 # Returns: XBZRLE cache size in bytes
2164 #
2165 # Since: 1.2
2166 #
2167 # Example:
2168 #
2169 # -> { "execute": "query-migrate-cache-size" }
2170 # <- { "return": 67108864 }
2171 #
2172 ##
2173 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2174
2175 ##
2176 # @ObjectPropertyInfo:
2177 #
2178 # @name: the name of the property
2179 #
2180 # @type: the type of the property.  This will typically come in one of four
2181 #        forms:
2182 #
2183 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2184 #           These types are mapped to the appropriate JSON type.
2185 #
2186 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2187 #           device type name.  Child properties create the composition tree.
2188 #
2189 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2190 #           device type name.  Link properties form the device model graph.
2191 #
2192 # Since: 1.2
2193 ##
2194 { 'struct': 'ObjectPropertyInfo',
2195   'data': { 'name': 'str', 'type': 'str' } }
2196
2197 ##
2198 # @qom-list:
2199 #
2200 # This command will list any properties of a object given a path in the object
2201 # model.
2202 #
2203 # @path: the path within the object model.  See @qom-get for a description of
2204 #        this parameter.
2205 #
2206 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2207 #          object.
2208 #
2209 # Since: 1.2
2210 ##
2211 { 'command': 'qom-list',
2212   'data': { 'path': 'str' },
2213   'returns': [ 'ObjectPropertyInfo' ] }
2214
2215 ##
2216 # @qom-get:
2217 #
2218 # This command will get a property from a object model path and return the
2219 # value.
2220 #
2221 # @path: The path within the object model.  There are two forms of supported
2222 #        paths--absolute and partial paths.
2223 #
2224 #        Absolute paths are derived from the root object and can follow child<>
2225 #        or link<> properties.  Since they can follow link<> properties, they
2226 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2227 #        and are prefixed  with a leading slash.
2228 #
2229 #        Partial paths look like relative filenames.  They do not begin
2230 #        with a prefix.  The matching rules for partial paths are subtle but
2231 #        designed to make specifying objects easy.  At each level of the
2232 #        composition tree, the partial path is matched as an absolute path.
2233 #        The first match is not returned.  At least two matches are searched
2234 #        for.  A successful result is only returned if only one match is
2235 #        found.  If more than one match is found, a flag is return to
2236 #        indicate that the match was ambiguous.
2237 #
2238 # @property: The property name to read
2239 #
2240 # Returns: The property value.  The type depends on the property
2241 #          type. child<> and link<> properties are returned as #str
2242 #          pathnames.  All integer property types (u8, u16, etc) are
2243 #          returned as #int.
2244 #
2245 # Since: 1.2
2246 ##
2247 { 'command': 'qom-get',
2248   'data': { 'path': 'str', 'property': 'str' },
2249   'returns': 'any' }
2250
2251 ##
2252 # @qom-set:
2253 #
2254 # This command will set a property from a object model path.
2255 #
2256 # @path: see @qom-get for a description of this parameter
2257 #
2258 # @property: the property name to set
2259 #
2260 # @value: a value who's type is appropriate for the property type.  See @qom-get
2261 #         for a description of type mapping.
2262 #
2263 # Since: 1.2
2264 ##
2265 { 'command': 'qom-set',
2266   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2267
2268 ##
2269 # @change:
2270 #
2271 # This command is multiple commands multiplexed together.
2272 #
2273 # @device: This is normally the name of a block device but it may also be 'vnc'.
2274 #          when it's 'vnc', then sub command depends on @target
2275 #
2276 # @target: If @device is a block device, then this is the new filename.
2277 #          If @device is 'vnc', then if the value 'password' selects the vnc
2278 #          change password command.   Otherwise, this specifies a new server URI
2279 #          address to listen to for VNC connections.
2280 #
2281 # @arg:    If @device is a block device, then this is an optional format to open
2282 #          the device with.
2283 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2284 #          password to set.  See change-vnc-password for additional notes.
2285 #
2286 # Returns: Nothing on success.
2287 #          If @device is not a valid block device, DeviceNotFound
2288 #
2289 # Notes:  This interface is deprecated, and it is strongly recommended that you
2290 #         avoid using it.  For changing block devices, use
2291 #         blockdev-change-medium; for changing VNC parameters, use
2292 #         change-vnc-password.
2293 #
2294 # Since: 0.14.0
2295 #
2296 # Example:
2297 #
2298 # 1. Change a removable medium
2299 #
2300 # -> { "execute": "change",
2301 #      "arguments": { "device": "ide1-cd0",
2302 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
2303 # <- { "return": {} }
2304 #
2305 # 2. Change VNC password
2306 #
2307 # -> { "execute": "change",
2308 #      "arguments": { "device": "vnc", "target": "password",
2309 #                     "arg": "foobar1" } }
2310 # <- { "return": {} }
2311 #
2312 ##
2313 { 'command': 'change',
2314   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2315
2316 ##
2317 # @ObjectTypeInfo:
2318 #
2319 # This structure describes a search result from @qom-list-types
2320 #
2321 # @name: the type name found in the search
2322 #
2323 # @abstract: the type is abstract and can't be directly instantiated.
2324 #            Omitted if false. (since 2.10)
2325 #
2326 # @parent: Name of parent type, if any (since 2.10)
2327 #
2328 # Since: 1.1
2329 ##
2330 { 'struct': 'ObjectTypeInfo',
2331   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
2332
2333 ##
2334 # @qom-list-types:
2335 #
2336 # This command will return a list of types given search parameters
2337 #
2338 # @implements: if specified, only return types that implement this type name
2339 #
2340 # @abstract: if true, include abstract types in the results
2341 #
2342 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2343 #
2344 # Since: 1.1
2345 ##
2346 { 'command': 'qom-list-types',
2347   'data': { '*implements': 'str', '*abstract': 'bool' },
2348   'returns': [ 'ObjectTypeInfo' ] }
2349
2350 ##
2351 # @DevicePropertyInfo:
2352 #
2353 # Information about device properties.
2354 #
2355 # @name: the name of the property
2356 # @type: the typename of the property
2357 # @description: if specified, the description of the property.
2358 #               (since 2.2)
2359 #
2360 # Since: 1.2
2361 ##
2362 { 'struct': 'DevicePropertyInfo',
2363   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
2364
2365 ##
2366 # @device-list-properties:
2367 #
2368 # List properties associated with a device.
2369 #
2370 # @typename: the type name of a device
2371 #
2372 # Returns: a list of DevicePropertyInfo describing a devices properties
2373 #
2374 # Since: 1.2
2375 ##
2376 { 'command': 'device-list-properties',
2377   'data': { 'typename': 'str'},
2378   'returns': [ 'DevicePropertyInfo' ] }
2379
2380 ##
2381 # @migrate:
2382 #
2383 # Migrates the current running guest to another Virtual Machine.
2384 #
2385 # @uri: the Uniform Resource Identifier of the destination VM
2386 #
2387 # @blk: do block migration (full disk copy)
2388 #
2389 # @inc: incremental disk copy migration
2390 #
2391 # @detach: this argument exists only for compatibility reasons and
2392 #          is ignored by QEMU
2393 #
2394 # Returns: nothing on success
2395 #
2396 # Since: 0.14.0
2397 #
2398 # Notes:
2399 #
2400 # 1. The 'query-migrate' command should be used to check migration's progress
2401 #    and final result (this information is provided by the 'status' member)
2402 #
2403 # 2. All boolean arguments default to false
2404 #
2405 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
2406 #    be used
2407 #
2408 # Example:
2409 #
2410 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
2411 # <- { "return": {} }
2412 #
2413 ##
2414 { 'command': 'migrate',
2415   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2416
2417 ##
2418 # @migrate-incoming:
2419 #
2420 # Start an incoming migration, the qemu must have been started
2421 # with -incoming defer
2422 #
2423 # @uri: The Uniform Resource Identifier identifying the source or
2424 #       address to listen on
2425 #
2426 # Returns: nothing on success
2427 #
2428 # Since: 2.3
2429 #
2430 # Notes:
2431 #
2432 # 1. It's a bad idea to use a string for the uri, but it needs to stay
2433 #    compatible with -incoming and the format of the uri is already exposed
2434 #    above libvirt.
2435 #
2436 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
2437 #    be used.
2438 #
2439 # 3. The uri format is the same as for -incoming
2440 #
2441 # Example:
2442 #
2443 # -> { "execute": "migrate-incoming",
2444 #      "arguments": { "uri": "tcp::4446" } }
2445 # <- { "return": {} }
2446 #
2447 ##
2448 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
2449
2450 ##
2451 # @xen-save-devices-state:
2452 #
2453 # Save the state of all devices to file. The RAM and the block devices
2454 # of the VM are not saved by this command.
2455 #
2456 # @filename: the file to save the state of the devices to as binary
2457 # data. See xen-save-devices-state.txt for a description of the binary
2458 # format.
2459 #
2460 # Returns: Nothing on success
2461 #
2462 # Since: 1.1
2463 #
2464 # Example:
2465 #
2466 # -> { "execute": "xen-save-devices-state",
2467 #      "arguments": { "filename": "/tmp/save" } }
2468 # <- { "return": {} }
2469 #
2470 ##
2471 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2472
2473 ##
2474 # @xen-set-global-dirty-log:
2475 #
2476 # Enable or disable the global dirty log mode.
2477 #
2478 # @enable: true to enable, false to disable.
2479 #
2480 # Returns: nothing
2481 #
2482 # Since: 1.3
2483 #
2484 # Example:
2485 #
2486 # -> { "execute": "xen-set-global-dirty-log",
2487 #      "arguments": { "enable": true } }
2488 # <- { "return": {} }
2489 #
2490 ##
2491 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2492
2493 ##
2494 # @device_add:
2495 #
2496 # @driver: the name of the new device's driver
2497 #
2498 # @bus: the device's parent bus (device tree path)
2499 #
2500 # @id: the device's ID, must be unique
2501 #
2502 # Additional arguments depend on the type.
2503 #
2504 # Add a device.
2505 #
2506 # Notes:
2507 # 1. For detailed information about this command, please refer to the
2508 #    'docs/qdev-device-use.txt' file.
2509 #
2510 # 2. It's possible to list device properties by running QEMU with the
2511 #    "-device DEVICE,help" command-line argument, where DEVICE is the
2512 #    device's name
2513 #
2514 # Example:
2515 #
2516 # -> { "execute": "device_add",
2517 #      "arguments": { "driver": "e1000", "id": "net1",
2518 #                     "bus": "pci.0",
2519 #                     "mac": "52:54:00:12:34:56" } }
2520 # <- { "return": {} }
2521 #
2522 # TODO: This command effectively bypasses QAPI completely due to its
2523 # "additional arguments" business.  It shouldn't have been added to
2524 # the schema in this form.  It should be qapified properly, or
2525 # replaced by a properly qapified command.
2526 #
2527 # Since: 0.13
2528 ##
2529 { 'command': 'device_add',
2530   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
2531   'gen': false } # so we can get the additional arguments
2532
2533 ##
2534 # @device_del:
2535 #
2536 # Remove a device from a guest
2537 #
2538 # @id: the device's ID or QOM path
2539 #
2540 # Returns: Nothing on success
2541 #          If @id is not a valid device, DeviceNotFound
2542 #
2543 # Notes: When this command completes, the device may not be removed from the
2544 #        guest.  Hot removal is an operation that requires guest cooperation.
2545 #        This command merely requests that the guest begin the hot removal
2546 #        process.  Completion of the device removal process is signaled with a
2547 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2548 #        for all devices.
2549 #
2550 # Since: 0.14.0
2551 #
2552 # Example:
2553 #
2554 # -> { "execute": "device_del",
2555 #      "arguments": { "id": "net1" } }
2556 # <- { "return": {} }
2557 #
2558 # -> { "execute": "device_del",
2559 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
2560 # <- { "return": {} }
2561 #
2562 ##
2563 { 'command': 'device_del', 'data': {'id': 'str'} }
2564
2565 ##
2566 # @DumpGuestMemoryFormat:
2567 #
2568 # An enumeration of guest-memory-dump's format.
2569 #
2570 # @elf: elf format
2571 #
2572 # @kdump-zlib: kdump-compressed format with zlib-compressed
2573 #
2574 # @kdump-lzo: kdump-compressed format with lzo-compressed
2575 #
2576 # @kdump-snappy: kdump-compressed format with snappy-compressed
2577 #
2578 # Since: 2.0
2579 ##
2580 { 'enum': 'DumpGuestMemoryFormat',
2581   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
2582
2583 ##
2584 # @dump-guest-memory:
2585 #
2586 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2587 # very long depending on the amount of guest memory.
2588 #
2589 # @paging: if true, do paging to get guest's memory mapping. This allows
2590 #          using gdb to process the core file.
2591 #
2592 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2593 #                     of RAM. This can happen for a large guest, or a
2594 #                     malicious guest pretending to be large.
2595 #
2596 #          Also, paging=true has the following limitations:
2597 #
2598 #             1. The guest may be in a catastrophic state or can have corrupted
2599 #                memory, which cannot be trusted
2600 #             2. The guest can be in real-mode even if paging is enabled. For
2601 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2602 #                goes in real-mode
2603 #             3. Currently only supported on i386 and x86_64.
2604 #
2605 # @protocol: the filename or file descriptor of the vmcore. The supported
2606 #            protocols are:
2607 #
2608 #            1. file: the protocol starts with "file:", and the following
2609 #               string is the file's path.
2610 #            2. fd: the protocol starts with "fd:", and the following string
2611 #               is the fd's name.
2612 #
2613 # @detach: if true, QMP will return immediately rather than
2614 #          waiting for the dump to finish. The user can track progress
2615 #          using "query-dump". (since 2.6).
2616 #
2617 # @begin: if specified, the starting physical address.
2618 #
2619 # @length: if specified, the memory size, in bytes. If you don't
2620 #          want to dump all guest's memory, please specify the start @begin
2621 #          and @length
2622 #
2623 # @format: if specified, the format of guest memory dump. But non-elf
2624 #          format is conflict with paging and filter, ie. @paging, @begin and
2625 #          @length is not allowed to be specified with non-elf @format at the
2626 #          same time (since 2.0)
2627 #
2628 # Note: All boolean arguments default to false
2629 #
2630 # Returns: nothing on success
2631 #
2632 # Since: 1.2
2633 #
2634 # Example:
2635 #
2636 # -> { "execute": "dump-guest-memory",
2637 #      "arguments": { "protocol": "fd:dump" } }
2638 # <- { "return": {} }
2639 #
2640 ##
2641 { 'command': 'dump-guest-memory',
2642   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
2643             '*begin': 'int', '*length': 'int',
2644             '*format': 'DumpGuestMemoryFormat'} }
2645
2646 ##
2647 # @DumpStatus:
2648 #
2649 # Describe the status of a long-running background guest memory dump.
2650 #
2651 # @none: no dump-guest-memory has started yet.
2652 #
2653 # @active: there is one dump running in background.
2654 #
2655 # @completed: the last dump has finished successfully.
2656 #
2657 # @failed: the last dump has failed.
2658 #
2659 # Since: 2.6
2660 ##
2661 { 'enum': 'DumpStatus',
2662   'data': [ 'none', 'active', 'completed', 'failed' ] }
2663
2664 ##
2665 # @DumpQueryResult:
2666 #
2667 # The result format for 'query-dump'.
2668 #
2669 # @status: enum of @DumpStatus, which shows current dump status
2670 #
2671 # @completed: bytes written in latest dump (uncompressed)
2672 #
2673 # @total: total bytes to be written in latest dump (uncompressed)
2674 #
2675 # Since: 2.6
2676 ##
2677 { 'struct': 'DumpQueryResult',
2678   'data': { 'status': 'DumpStatus',
2679             'completed': 'int',
2680             'total': 'int' } }
2681
2682 ##
2683 # @query-dump:
2684 #
2685 # Query latest dump status.
2686 #
2687 # Returns: A @DumpStatus object showing the dump status.
2688 #
2689 # Since: 2.6
2690 #
2691 # Example:
2692 #
2693 # -> { "execute": "query-dump" }
2694 # <- { "return": { "status": "active", "completed": 1024000,
2695 #                  "total": 2048000 } }
2696 #
2697 ##
2698 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
2699
2700 ##
2701 # @DumpGuestMemoryCapability:
2702 #
2703 # A list of the available formats for dump-guest-memory
2704 #
2705 # Since: 2.0
2706 ##
2707 { 'struct': 'DumpGuestMemoryCapability',
2708   'data': {
2709       'formats': ['DumpGuestMemoryFormat'] } }
2710
2711 ##
2712 # @query-dump-guest-memory-capability:
2713 #
2714 # Returns the available formats for dump-guest-memory
2715 #
2716 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
2717 #           dump-guest-memory
2718 #
2719 # Since: 2.0
2720 #
2721 # Example:
2722 #
2723 # -> { "execute": "query-dump-guest-memory-capability" }
2724 # <- { "return": { "formats":
2725 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
2726 #
2727 ##
2728 { 'command': 'query-dump-guest-memory-capability',
2729   'returns': 'DumpGuestMemoryCapability' }
2730
2731 ##
2732 # @dump-skeys:
2733 #
2734 # Dump guest's storage keys
2735 #
2736 # @filename: the path to the file to dump to
2737 #
2738 # This command is only supported on s390 architecture.
2739 #
2740 # Since: 2.5
2741 #
2742 # Example:
2743 #
2744 # -> { "execute": "dump-skeys",
2745 #      "arguments": { "filename": "/tmp/skeys" } }
2746 # <- { "return": {} }
2747 #
2748 ##
2749 { 'command': 'dump-skeys',
2750   'data': { 'filename': 'str' } }
2751
2752 ##
2753 # @object-add:
2754 #
2755 # Create a QOM object.
2756 #
2757 # @qom-type: the class name for the object to be created
2758 #
2759 # @id: the name of the new object
2760 #
2761 # @props: a dictionary of properties to be passed to the backend
2762 #
2763 # Returns: Nothing on success
2764 #          Error if @qom-type is not a valid class name
2765 #
2766 # Since: 2.0
2767 #
2768 # Example:
2769 #
2770 # -> { "execute": "object-add",
2771 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
2772 #                     "props": { "filename": "/dev/hwrng" } } }
2773 # <- { "return": {} }
2774 #
2775 ##
2776 { 'command': 'object-add',
2777   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
2778
2779 ##
2780 # @object-del:
2781 #
2782 # Remove a QOM object.
2783 #
2784 # @id: the name of the QOM object to remove
2785 #
2786 # Returns: Nothing on success
2787 #          Error if @id is not a valid id for a QOM object
2788 #
2789 # Since: 2.0
2790 #
2791 # Example:
2792 #
2793 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
2794 # <- { "return": {} }
2795 #
2796 ##
2797 { 'command': 'object-del', 'data': {'id': 'str'} }
2798
2799 ##
2800 # @getfd:
2801 #
2802 # Receive a file descriptor via SCM rights and assign it a name
2803 #
2804 # @fdname: file descriptor name
2805 #
2806 # Returns: Nothing on success
2807 #
2808 # Since: 0.14.0
2809 #
2810 # Notes: If @fdname already exists, the file descriptor assigned to
2811 #        it will be closed and replaced by the received file
2812 #        descriptor.
2813 #
2814 #        The 'closefd' command can be used to explicitly close the
2815 #        file descriptor when it is no longer needed.
2816 #
2817 # Example:
2818 #
2819 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
2820 # <- { "return": {} }
2821 #
2822 ##
2823 { 'command': 'getfd', 'data': {'fdname': 'str'} }
2824
2825 ##
2826 # @closefd:
2827 #
2828 # Close a file descriptor previously passed via SCM rights
2829 #
2830 # @fdname: file descriptor name
2831 #
2832 # Returns: Nothing on success
2833 #
2834 # Since: 0.14.0
2835 #
2836 # Example:
2837 #
2838 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
2839 # <- { "return": {} }
2840 #
2841 ##
2842 { 'command': 'closefd', 'data': {'fdname': 'str'} }
2843
2844 ##
2845 # @MachineInfo:
2846 #
2847 # Information describing a machine.
2848 #
2849 # @name: the name of the machine
2850 #
2851 # @alias: an alias for the machine name
2852 #
2853 # @is-default: whether the machine is default
2854 #
2855 # @cpu-max: maximum number of CPUs supported by the machine type
2856 #           (since 1.5.0)
2857 #
2858 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
2859 #
2860 # Since: 1.2.0
2861 ##
2862 { 'struct': 'MachineInfo',
2863   'data': { 'name': 'str', '*alias': 'str',
2864             '*is-default': 'bool', 'cpu-max': 'int',
2865             'hotpluggable-cpus': 'bool'} }
2866
2867 ##
2868 # @query-machines:
2869 #
2870 # Return a list of supported machines
2871 #
2872 # Returns: a list of MachineInfo
2873 #
2874 # Since: 1.2.0
2875 ##
2876 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2877
2878 ##
2879 # @CpuDefinitionInfo:
2880 #
2881 # Virtual CPU definition.
2882 #
2883 # @name: the name of the CPU definition
2884 #
2885 # @migration-safe: whether a CPU definition can be safely used for
2886 #                  migration in combination with a QEMU compatibility machine
2887 #                  when migrating between different QMU versions and between
2888 #                  hosts with different sets of (hardware or software)
2889 #                  capabilities. If not provided, information is not available
2890 #                  and callers should not assume the CPU definition to be
2891 #                  migration-safe. (since 2.8)
2892 #
2893 # @static: whether a CPU definition is static and will not change depending on
2894 #          QEMU version, machine type, machine options and accelerator options.
2895 #          A static model is always migration-safe. (since 2.8)
2896 #
2897 # @unavailable-features: List of properties that prevent
2898 #                        the CPU model from running in the current
2899 #                        host. (since 2.8)
2900 # @typename: Type name that can be used as argument to @device-list-properties,
2901 #            to introspect properties configurable using -cpu or -global.
2902 #            (since 2.9)
2903 #
2904 # @unavailable-features is a list of QOM property names that
2905 # represent CPU model attributes that prevent the CPU from running.
2906 # If the QOM property is read-only, that means there's no known
2907 # way to make the CPU model run in the current host. Implementations
2908 # that choose not to provide specific information return the
2909 # property name "type".
2910 # If the property is read-write, it means that it MAY be possible
2911 # to run the CPU model in the current host if that property is
2912 # changed. Management software can use it as hints to suggest or
2913 # choose an alternative for the user, or just to generate meaningful
2914 # error messages explaining why the CPU model can't be used.
2915 # If @unavailable-features is an empty list, the CPU model is
2916 # runnable using the current host and machine-type.
2917 # If @unavailable-features is not present, runnability
2918 # information for the CPU is not available.
2919 #
2920 # Since: 1.2.0
2921 ##
2922 { 'struct': 'CpuDefinitionInfo',
2923   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
2924             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
2925
2926 ##
2927 # @query-cpu-definitions:
2928 #
2929 # Return a list of supported virtual CPU definitions
2930 #
2931 # Returns: a list of CpuDefInfo
2932 #
2933 # Since: 1.2.0
2934 ##
2935 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2936
2937 ##
2938 # @CpuModelInfo:
2939 #
2940 # Virtual CPU model.
2941 #
2942 # A CPU model consists of the name of a CPU definition, to which
2943 # delta changes are applied (e.g. features added/removed). Most magic values
2944 # that an architecture might require should be hidden behind the name.
2945 # However, if required, architectures can expose relevant properties.
2946 #
2947 # @name: the name of the CPU definition the model is based on
2948 # @props: a dictionary of QOM properties to be applied
2949 #
2950 # Since: 2.8.0
2951 ##
2952 { 'struct': 'CpuModelInfo',
2953   'data': { 'name': 'str',
2954             '*props': 'any' } }
2955
2956 ##
2957 # @CpuModelExpansionType:
2958 #
2959 # An enumeration of CPU model expansion types.
2960 #
2961 # @static: Expand to a static CPU model, a combination of a static base
2962 #          model name and property delta changes. As the static base model will
2963 #          never change, the expanded CPU model will be the same, independant of
2964 #          independent of QEMU version, machine type, machine options, and
2965 #          accelerator options. Therefore, the resulting model can be used by
2966 #          tooling without having to specify a compatibility machine - e.g. when
2967 #          displaying the "host" model. static CPU models are migration-safe.
2968 #
2969 # @full: Expand all properties. The produced model is not guaranteed to be
2970 #        migration-safe, but allows tooling to get an insight and work with
2971 #        model details.
2972 #
2973 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2974 # features enabled by the CPU model may be omitted, because they can't be
2975 # implemented by a static CPU model definition (e.g. cache info passthrough and
2976 # PMU passthrough in x86). If you need an accurate representation of the
2977 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2978 # static representation that will keep ABI compatibility even when changing QEMU
2979 # version or machine-type, use @static (but keep in mind that some features may
2980 # be omitted).
2981 #
2982 # Since: 2.8.0
2983 ##
2984 { 'enum': 'CpuModelExpansionType',
2985   'data': [ 'static', 'full' ] }
2986
2987
2988 ##
2989 # @CpuModelExpansionInfo:
2990 #
2991 # The result of a cpu model expansion.
2992 #
2993 # @model: the expanded CpuModelInfo.
2994 #
2995 # Since: 2.8.0
2996 ##
2997 { 'struct': 'CpuModelExpansionInfo',
2998   'data': { 'model': 'CpuModelInfo' } }
2999
3000
3001 ##
3002 # @query-cpu-model-expansion:
3003 #
3004 # Expands a given CPU model (or a combination of CPU model + additional options)
3005 # to different granularities, allowing tooling to get an understanding what a
3006 # specific CPU model looks like in QEMU under a certain configuration.
3007 #
3008 # This interface can be used to query the "host" CPU model.
3009 #
3010 # The data returned by this command may be affected by:
3011 #
3012 # * QEMU version: CPU models may look different depending on the QEMU version.
3013 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3014 # * machine-type: CPU model  may look different depending on the machine-type.
3015 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3016 # * machine options (including accelerator): in some architectures, CPU models
3017 #   may look different depending on machine and accelerator options. (Except for
3018 #   CPU models reported as "static" in query-cpu-definitions.)
3019 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3020 #   global properties may affect expansion of CPU models. Using
3021 #   query-cpu-model-expansion while using these is not advised.
3022 #
3023 # Some architectures may not support all expansion types. s390x supports
3024 # "full" and "static".
3025 #
3026 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
3027 #          not supported, if the model cannot be expanded, if the model contains
3028 #          an unknown CPU definition name, unknown properties or properties
3029 #          with a wrong type. Also returns an error if an expansion type is
3030 #          not supported.
3031 #
3032 # Since: 2.8.0
3033 ##
3034 { 'command': 'query-cpu-model-expansion',
3035   'data': { 'type': 'CpuModelExpansionType',
3036             'model': 'CpuModelInfo' },
3037   'returns': 'CpuModelExpansionInfo' }
3038
3039 ##
3040 # @CpuModelCompareResult:
3041 #
3042 # An enumeration of CPU model comparation results. The result is usually
3043 # calculated using e.g. CPU features or CPU generations.
3044 #
3045 # @incompatible: If model A is incompatible to model B, model A is not
3046 #                guaranteed to run where model B runs and the other way around.
3047 #
3048 # @identical: If model A is identical to model B, model A is guaranteed to run
3049 #             where model B runs and the other way around.
3050 #
3051 # @superset: If model A is a superset of model B, model B is guaranteed to run
3052 #            where model A runs. There are no guarantees about the other way.
3053 #
3054 # @subset: If model A is a subset of model B, model A is guaranteed to run
3055 #          where model B runs. There are no guarantees about the other way.
3056 #
3057 # Since: 2.8.0
3058 ##
3059 { 'enum': 'CpuModelCompareResult',
3060   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
3061
3062 ##
3063 # @CpuModelCompareInfo:
3064 #
3065 # The result of a CPU model comparison.
3066 #
3067 # @result: The result of the compare operation.
3068 # @responsible-properties: List of properties that led to the comparison result
3069 #                          not being identical.
3070 #
3071 # @responsible-properties is a list of QOM property names that led to
3072 # both CPUs not being detected as identical. For identical models, this
3073 # list is empty.
3074 # If a QOM property is read-only, that means there's no known way to make the
3075 # CPU models identical. If the special property name "type" is included, the
3076 # models are by definition not identical and cannot be made identical.
3077 #
3078 # Since: 2.8.0
3079 ##
3080 { 'struct': 'CpuModelCompareInfo',
3081   'data': {'result': 'CpuModelCompareResult',
3082            'responsible-properties': ['str']
3083           }
3084 }
3085
3086 ##
3087 # @query-cpu-model-comparison:
3088 #
3089 # Compares two CPU models, returning how they compare in a specific
3090 # configuration. The results indicates how both models compare regarding
3091 # runnability. This result can be used by tooling to make decisions if a
3092 # certain CPU model will run in a certain configuration or if a compatible
3093 # CPU model has to be created by baselining.
3094 #
3095 # Usually, a CPU model is compared against the maximum possible CPU model
3096 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
3097 # model is identical or a subset, it will run in that configuration.
3098 #
3099 # The result returned by this command may be affected by:
3100 #
3101 # * QEMU version: CPU models may look different depending on the QEMU version.
3102 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3103 # * machine-type: CPU model may look different depending on the machine-type.
3104 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3105 # * machine options (including accelerator): in some architectures, CPU models
3106 #   may look different depending on machine and accelerator options. (Except for
3107 #   CPU models reported as "static" in query-cpu-definitions.)
3108 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3109 #   global properties may affect expansion of CPU models. Using
3110 #   query-cpu-model-expansion while using these is not advised.
3111 #
3112 # Some architectures may not support comparing CPU models. s390x supports
3113 # comparing CPU models.
3114 #
3115 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
3116 #          not supported, if a model cannot be used, if a model contains
3117 #          an unknown cpu definition name, unknown properties or properties
3118 #          with wrong types.
3119 #
3120 # Since: 2.8.0
3121 ##
3122 { 'command': 'query-cpu-model-comparison',
3123   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
3124   'returns': 'CpuModelCompareInfo' }
3125
3126 ##
3127 # @CpuModelBaselineInfo:
3128 #
3129 # The result of a CPU model baseline.
3130 #
3131 # @model: the baselined CpuModelInfo.
3132 #
3133 # Since: 2.8.0
3134 ##
3135 { 'struct': 'CpuModelBaselineInfo',
3136   'data': { 'model': 'CpuModelInfo' } }
3137
3138 ##
3139 # @query-cpu-model-baseline:
3140 #
3141 # Baseline two CPU models, creating a compatible third model. The created
3142 # model will always be a static, migration-safe CPU model (see "static"
3143 # CPU model expansion for details).
3144 #
3145 # This interface can be used by tooling to create a compatible CPU model out
3146 # two CPU models. The created CPU model will be identical to or a subset of
3147 # both CPU models when comparing them. Therefore, the created CPU model is
3148 # guaranteed to run where the given CPU models run.
3149 #
3150 # The result returned by this command may be affected by:
3151 #
3152 # * QEMU version: CPU models may look different depending on the QEMU version.
3153 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3154 # * machine-type: CPU model may look different depending on the machine-type.
3155 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3156 # * machine options (including accelerator): in some architectures, CPU models
3157 #   may look different depending on machine and accelerator options. (Except for
3158 #   CPU models reported as "static" in query-cpu-definitions.)
3159 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3160 #   global properties may affect expansion of CPU models. Using
3161 #   query-cpu-model-expansion while using these is not advised.
3162 #
3163 # Some architectures may not support baselining CPU models. s390x supports
3164 # baselining CPU models.
3165 #
3166 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
3167 #          not supported, if a model cannot be used, if a model contains
3168 #          an unknown cpu definition name, unknown properties or properties
3169 #          with wrong types.
3170 #
3171 # Since: 2.8.0
3172 ##
3173 { 'command': 'query-cpu-model-baseline',
3174   'data': { 'modela': 'CpuModelInfo',
3175             'modelb': 'CpuModelInfo' },
3176   'returns': 'CpuModelBaselineInfo' }
3177
3178 ##
3179 # @AddfdInfo:
3180 #
3181 # Information about a file descriptor that was added to an fd set.
3182 #
3183 # @fdset-id: The ID of the fd set that @fd was added to.
3184 #
3185 # @fd: The file descriptor that was received via SCM rights and
3186 #      added to the fd set.
3187 #
3188 # Since: 1.2.0
3189 ##
3190 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3191
3192 ##
3193 # @add-fd:
3194 #
3195 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3196 #
3197 # @fdset-id: The ID of the fd set to add the file descriptor to.
3198 #
3199 # @opaque: A free-form string that can be used to describe the fd.
3200 #
3201 # Returns: @AddfdInfo on success
3202 #
3203 #          If file descriptor was not received, FdNotSupplied
3204 #
3205 #          If @fdset-id is a negative value, InvalidParameterValue
3206 #
3207 # Notes: The list of fd sets is shared by all monitor connections.
3208 #
3209 #        If @fdset-id is not specified, a new fd set will be created.
3210 #
3211 # Since: 1.2.0
3212 #
3213 # Example:
3214 #
3215 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
3216 # <- { "return": { "fdset-id": 1, "fd": 3 } }
3217 #
3218 ##
3219 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3220   'returns': 'AddfdInfo' }
3221
3222 ##
3223 # @remove-fd:
3224 #
3225 # Remove a file descriptor from an fd set.
3226 #
3227 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3228 #
3229 # @fd: The file descriptor that is to be removed.
3230 #
3231 # Returns: Nothing on success
3232 #          If @fdset-id or @fd is not found, FdNotFound
3233 #
3234 # Since: 1.2.0
3235 #
3236 # Notes: The list of fd sets is shared by all monitor connections.
3237 #
3238 #        If @fd is not specified, all file descriptors in @fdset-id
3239 #        will be removed.
3240 #
3241 # Example:
3242 #
3243 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
3244 # <- { "return": {} }
3245 #
3246 ##
3247 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3248
3249 ##
3250 # @FdsetFdInfo:
3251 #
3252 # Information about a file descriptor that belongs to an fd set.
3253 #
3254 # @fd: The file descriptor value.
3255 #
3256 # @opaque: A free-form string that can be used to describe the fd.
3257 #
3258 # Since: 1.2.0
3259 ##
3260 { 'struct': 'FdsetFdInfo',
3261   'data': {'fd': 'int', '*opaque': 'str'} }
3262
3263 ##
3264 # @FdsetInfo:
3265 #
3266 # Information about an fd set.
3267 #
3268 # @fdset-id: The ID of the fd set.
3269 #
3270 # @fds: A list of file descriptors that belong to this fd set.
3271 #
3272 # Since: 1.2.0
3273 ##
3274 { 'struct': 'FdsetInfo',
3275   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3276
3277 ##
3278 # @query-fdsets:
3279 #
3280 # Return information describing all fd sets.
3281 #
3282 # Returns: A list of @FdsetInfo
3283 #
3284 # Since: 1.2.0
3285 #
3286 # Note: The list of fd sets is shared by all monitor connections.
3287 #
3288 # Example:
3289 #
3290 # -> { "execute": "query-fdsets" }
3291 # <- { "return": [
3292 #        {
3293 #          "fds": [
3294 #            {
3295 #              "fd": 30,
3296 #              "opaque": "rdonly:/path/to/file"
3297 #            },
3298 #            {
3299 #              "fd": 24,
3300 #              "opaque": "rdwr:/path/to/file"
3301 #            }
3302 #          ],
3303 #          "fdset-id": 1
3304 #        },
3305 #        {
3306 #          "fds": [
3307 #            {
3308 #              "fd": 28
3309 #            },
3310 #            {
3311 #              "fd": 29
3312 #            }
3313 #          ],
3314 #          "fdset-id": 0
3315 #        }
3316 #      ]
3317 #    }
3318 #
3319 ##
3320 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3321
3322 ##
3323 # @TargetInfo:
3324 #
3325 # Information describing the QEMU target.
3326 #
3327 # @arch: the target architecture (eg "x86_64", "i386", etc)
3328 #
3329 # Since: 1.2.0
3330 ##
3331 { 'struct': 'TargetInfo',
3332   'data': { 'arch': 'str' } }
3333
3334 ##
3335 # @query-target:
3336 #
3337 # Return information about the target for this QEMU
3338 #
3339 # Returns: TargetInfo
3340 #
3341 # Since: 1.2.0
3342 ##
3343 { 'command': 'query-target', 'returns': 'TargetInfo' }
3344
3345 ##
3346 # @TpmModel:
3347 #
3348 # An enumeration of TPM models
3349 #
3350 # @tpm-tis: TPM TIS model
3351 #
3352 # Since: 1.5
3353 ##
3354 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3355
3356 ##
3357 # @query-tpm-models:
3358 #
3359 # Return a list of supported TPM models
3360 #
3361 # Returns: a list of TpmModel
3362 #
3363 # Since: 1.5
3364 #
3365 # Example:
3366 #
3367 # -> { "execute": "query-tpm-models" }
3368 # <- { "return": [ "tpm-tis" ] }
3369 #
3370 ##
3371 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3372
3373 ##
3374 # @TpmType:
3375 #
3376 # An enumeration of TPM types
3377 #
3378 # @passthrough: TPM passthrough type
3379 #
3380 # Since: 1.5
3381 ##
3382 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3383
3384 ##
3385 # @query-tpm-types:
3386 #
3387 # Return a list of supported TPM types
3388 #
3389 # Returns: a list of TpmType
3390 #
3391 # Since: 1.5
3392 #
3393 # Example:
3394 #
3395 # -> { "execute": "query-tpm-types" }
3396 # <- { "return": [ "passthrough" ] }
3397 #
3398 ##
3399 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3400
3401 ##
3402 # @TPMPassthroughOptions:
3403 #
3404 # Information about the TPM passthrough type
3405 #
3406 # @path: string describing the path used for accessing the TPM device
3407 #
3408 # @cancel-path: string showing the TPM's sysfs cancel file
3409 #               for cancellation of TPM commands while they are executing
3410 #
3411 # Since: 1.5
3412 ##
3413 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3414                                              '*cancel-path' : 'str'} }
3415
3416 ##
3417 # @TpmTypeOptions:
3418 #
3419 # A union referencing different TPM backend types' configuration options
3420 #
3421 # @type: 'passthrough' The configuration options for the TPM passthrough type
3422 #
3423 # Since: 1.5
3424 ##
3425 { 'union': 'TpmTypeOptions',
3426    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3427
3428 ##
3429 # @TPMInfo:
3430 #
3431 # Information about the TPM
3432 #
3433 # @id: The Id of the TPM
3434 #
3435 # @model: The TPM frontend model
3436 #
3437 # @options: The TPM (backend) type configuration options
3438 #
3439 # Since: 1.5
3440 ##
3441 { 'struct': 'TPMInfo',
3442   'data': {'id': 'str',
3443            'model': 'TpmModel',
3444            'options': 'TpmTypeOptions' } }
3445
3446 ##
3447 # @query-tpm:
3448 #
3449 # Return information about the TPM device
3450 #
3451 # Returns: @TPMInfo on success
3452 #
3453 # Since: 1.5
3454 #
3455 # Example:
3456 #
3457 # -> { "execute": "query-tpm" }
3458 # <- { "return":
3459 #      [
3460 #        { "model": "tpm-tis",
3461 #          "options":
3462 #            { "type": "passthrough",
3463 #              "data":
3464 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3465 #                  "path": "/dev/tpm0"
3466 #                }
3467 #            },
3468 #          "id": "tpm0"
3469 #        }
3470 #      ]
3471 #    }
3472 #
3473 ##
3474 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3475
3476 ##
3477 # @AcpiTableOptions:
3478 #
3479 # Specify an ACPI table on the command line to load.
3480 #
3481 # At most one of @file and @data can be specified. The list of files specified
3482 # by any one of them is loaded and concatenated in order. If both are omitted,
3483 # @data is implied.
3484 #
3485 # Other fields / optargs can be used to override fields of the generic ACPI
3486 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3487 # Description Table Header. If a header field is not overridden, then the
3488 # corresponding value from the concatenated blob is used (in case of @file), or
3489 # it is filled in with a hard-coded value (in case of @data).
3490 #
3491 # String fields are copied into the matching ACPI member from lowest address
3492 # upwards, and silently truncated / NUL-padded to length.
3493 #
3494 # @sig: table signature / identifier (4 bytes)
3495 #
3496 # @rev: table revision number (dependent on signature, 1 byte)
3497 #
3498 # @oem_id: OEM identifier (6 bytes)
3499 #
3500 # @oem_table_id: OEM table identifier (8 bytes)
3501 #
3502 # @oem_rev: OEM-supplied revision number (4 bytes)
3503 #
3504 # @asl_compiler_id: identifier of the utility that created the table
3505 #                   (4 bytes)
3506 #
3507 # @asl_compiler_rev: revision number of the utility that created the
3508 #                    table (4 bytes)
3509 #
3510 # @file: colon (:) separated list of pathnames to load and
3511 #        concatenate as table data. The resultant binary blob is expected to
3512 #        have an ACPI table header. At least one file is required. This field
3513 #        excludes @data.
3514 #
3515 # @data: colon (:) separated list of pathnames to load and
3516 #        concatenate as table data. The resultant binary blob must not have an
3517 #        ACPI table header. At least one file is required. This field excludes
3518 #        @file.
3519 #
3520 # Since: 1.5
3521 ##
3522 { 'struct': 'AcpiTableOptions',
3523   'data': {
3524     '*sig':               'str',
3525     '*rev':               'uint8',
3526     '*oem_id':            'str',
3527     '*oem_table_id':      'str',
3528     '*oem_rev':           'uint32',
3529     '*asl_compiler_id':   'str',
3530     '*asl_compiler_rev':  'uint32',
3531     '*file':              'str',
3532     '*data':              'str' }}
3533
3534 ##
3535 # @CommandLineParameterType:
3536 #
3537 # Possible types for an option parameter.
3538 #
3539 # @string: accepts a character string
3540 #
3541 # @boolean: accepts "on" or "off"
3542 #
3543 # @number: accepts a number
3544 #
3545 # @size: accepts a number followed by an optional suffix (K)ilo,
3546 #        (M)ega, (G)iga, (T)era
3547 #
3548 # Since: 1.5
3549 ##
3550 { 'enum': 'CommandLineParameterType',
3551   'data': ['string', 'boolean', 'number', 'size'] }
3552
3553 ##
3554 # @CommandLineParameterInfo:
3555 #
3556 # Details about a single parameter of a command line option.
3557 #
3558 # @name: parameter name
3559 #
3560 # @type: parameter @CommandLineParameterType
3561 #
3562 # @help: human readable text string, not suitable for parsing.
3563 #
3564 # @default: default value string (since 2.1)
3565 #
3566 # Since: 1.5
3567 ##
3568 { 'struct': 'CommandLineParameterInfo',
3569   'data': { 'name': 'str',
3570             'type': 'CommandLineParameterType',
3571             '*help': 'str',
3572             '*default': 'str' } }
3573
3574 ##
3575 # @CommandLineOptionInfo:
3576 #
3577 # Details about a command line option, including its list of parameter details
3578 #
3579 # @option: option name
3580 #
3581 # @parameters: an array of @CommandLineParameterInfo
3582 #
3583 # Since: 1.5
3584 ##
3585 { 'struct': 'CommandLineOptionInfo',
3586   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3587
3588 ##
3589 # @query-command-line-options:
3590 #
3591 # Query command line option schema.
3592 #
3593 # @option: option name
3594 #
3595 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3596 #          @option).  Returns an error if the given @option doesn't exist.
3597 #
3598 # Since: 1.5
3599 #
3600 # Example:
3601 #
3602 # -> { "execute": "query-command-line-options",
3603 #      "arguments": { "option": "option-rom" } }
3604 # <- { "return": [
3605 #         {
3606 #             "parameters": [
3607 #                 {
3608 #                     "name": "romfile",
3609 #                     "type": "string"
3610 #                 },
3611 #                 {
3612 #                     "name": "bootindex",
3613 #                     "type": "number"
3614 #                 }
3615 #             ],
3616 #             "option": "option-rom"
3617 #         }
3618 #      ]
3619 #    }
3620 #
3621 ##
3622 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3623  'returns': ['CommandLineOptionInfo'] }
3624
3625 ##
3626 # @X86CPURegister32:
3627 #
3628 # A X86 32-bit register
3629 #
3630 # Since: 1.5
3631 ##
3632 { 'enum': 'X86CPURegister32',
3633   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3634
3635 ##
3636 # @X86CPUFeatureWordInfo:
3637 #
3638 # Information about a X86 CPU feature word
3639 #
3640 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3641 #
3642 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
3643 #                   feature word
3644 #
3645 # @cpuid-register: Output register containing the feature bits
3646 #
3647 # @features: value of output register, containing the feature bits
3648 #
3649 # Since: 1.5
3650 ##
3651 { 'struct': 'X86CPUFeatureWordInfo',
3652   'data': { 'cpuid-input-eax': 'int',
3653             '*cpuid-input-ecx': 'int',
3654             'cpuid-register': 'X86CPURegister32',
3655             'features': 'int' } }
3656
3657 ##
3658 # @DummyForceArrays:
3659 #
3660 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
3661 #
3662 # Since: 2.5
3663 ##
3664 { 'struct': 'DummyForceArrays',
3665   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
3666
3667
3668 ##
3669 # @NumaOptionsType:
3670 #
3671 # @node: NUMA nodes configuration
3672 #
3673 # @dist: NUMA distance configuration (since 2.10)
3674 #
3675 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
3676 #
3677 # Since: 2.1
3678 ##
3679 { 'enum': 'NumaOptionsType',
3680   'data': [ 'node', 'dist', 'cpu' ] }
3681
3682 ##
3683 # @NumaOptions:
3684 #
3685 # A discriminated record of NUMA options. (for OptsVisitor)
3686 #
3687 # Since: 2.1
3688 ##
3689 { 'union': 'NumaOptions',
3690   'base': { 'type': 'NumaOptionsType' },
3691   'discriminator': 'type',
3692   'data': {
3693     'node': 'NumaNodeOptions',
3694     'dist': 'NumaDistOptions',
3695     'cpu': 'NumaCpuOptions' }}
3696
3697 ##
3698 # @NumaNodeOptions:
3699 #
3700 # Create a guest NUMA node. (for OptsVisitor)
3701 #
3702 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
3703 #
3704 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
3705 #         if omitted)
3706 #
3707 # @mem: memory size of this node; mutually exclusive with @memdev.
3708 #       Equally divide total memory among nodes if both @mem and @memdev are
3709 #       omitted.
3710 #
3711 # @memdev: memory backend object.  If specified for one node,
3712 #          it must be specified for all nodes.
3713 #
3714 # Since: 2.1
3715 ##
3716 { 'struct': 'NumaNodeOptions',
3717   'data': {
3718    '*nodeid': 'uint16',
3719    '*cpus':   ['uint16'],
3720    '*mem':    'size',
3721    '*memdev': 'str' }}
3722
3723 ##
3724 # @NumaDistOptions:
3725 #
3726 # Set the distance between 2 NUMA nodes.
3727 #
3728 # @src: source NUMA node.
3729 #
3730 # @dst: destination NUMA node.
3731 #
3732 # @val: NUMA distance from source node to destination node.
3733 #       When a node is unreachable from another node, set the distance
3734 #       between them to 255.
3735 #
3736 # Since: 2.10
3737 ##
3738 { 'struct': 'NumaDistOptions',
3739   'data': {
3740    'src': 'uint16',
3741    'dst': 'uint16',
3742    'val': 'uint8' }}
3743
3744 ##
3745 # @NumaCpuOptions:
3746 #
3747 # Option "-numa cpu" overrides default cpu to node mapping.
3748 # It accepts the same set of cpu properties as returned by
3749 # query-hotpluggable-cpus[].props, where node-id could be used to
3750 # override default node mapping.
3751 #
3752 # Since: 2.10
3753 ##
3754 { 'struct': 'NumaCpuOptions',
3755    'base': 'CpuInstanceProperties',
3756    'data' : {} }
3757
3758 ##
3759 # @HostMemPolicy:
3760 #
3761 # Host memory policy types
3762 #
3763 # @default: restore default policy, remove any nondefault policy
3764 #
3765 # @preferred: set the preferred host nodes for allocation
3766 #
3767 # @bind: a strict policy that restricts memory allocation to the
3768 #        host nodes specified
3769 #
3770 # @interleave: memory allocations are interleaved across the set
3771 #              of host nodes specified
3772 #
3773 # Since: 2.1
3774 ##
3775 { 'enum': 'HostMemPolicy',
3776   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
3777
3778 ##
3779 # @Memdev:
3780 #
3781 # Information about memory backend
3782 #
3783 # @id: backend's ID if backend has 'id' property (since 2.9)
3784 #
3785 # @size: memory backend size
3786 #
3787 # @merge: enables or disables memory merge support
3788 #
3789 # @dump: includes memory backend's memory in a core dump or not
3790 #
3791 # @prealloc: enables or disables memory preallocation
3792 #
3793 # @host-nodes: host nodes for its memory policy
3794 #
3795 # @policy: memory policy of memory backend
3796 #
3797 # Since: 2.1
3798 ##
3799 { 'struct': 'Memdev',
3800   'data': {
3801     '*id':        'str',
3802     'size':       'size',
3803     'merge':      'bool',
3804     'dump':       'bool',
3805     'prealloc':   'bool',
3806     'host-nodes': ['uint16'],
3807     'policy':     'HostMemPolicy' }}
3808
3809 ##
3810 # @query-memdev:
3811 #
3812 # Returns information for all memory backends.
3813 #
3814 # Returns: a list of @Memdev.
3815 #
3816 # Since: 2.1
3817 #
3818 # Example:
3819 #
3820 # -> { "execute": "query-memdev" }
3821 # <- { "return": [
3822 #        {
3823 #          "id": "mem1",
3824 #          "size": 536870912,
3825 #          "merge": false,
3826 #          "dump": true,
3827 #          "prealloc": false,
3828 #          "host-nodes": [0, 1],
3829 #          "policy": "bind"
3830 #        },
3831 #        {
3832 #          "size": 536870912,
3833 #          "merge": false,
3834 #          "dump": true,
3835 #          "prealloc": true,
3836 #          "host-nodes": [2, 3],
3837 #          "policy": "preferred"
3838 #        }
3839 #      ]
3840 #    }
3841 #
3842 ##
3843 { 'command': 'query-memdev', 'returns': ['Memdev'] }
3844
3845 ##
3846 # @PCDIMMDeviceInfo:
3847 #
3848 # PCDIMMDevice state information
3849 #
3850 # @id: device's ID
3851 #
3852 # @addr: physical address, where device is mapped
3853 #
3854 # @size: size of memory that the device provides
3855 #
3856 # @slot: slot number at which device is plugged in
3857 #
3858 # @node: NUMA node number where device is plugged in
3859 #
3860 # @memdev: memory backend linked with device
3861 #
3862 # @hotplugged: true if device was hotplugged
3863 #
3864 # @hotpluggable: true if device if could be added/removed while machine is running
3865 #
3866 # Since: 2.1
3867 ##
3868 { 'struct': 'PCDIMMDeviceInfo',
3869   'data': { '*id': 'str',
3870             'addr': 'int',
3871             'size': 'int',
3872             'slot': 'int',
3873             'node': 'int',
3874             'memdev': 'str',
3875             'hotplugged': 'bool',
3876             'hotpluggable': 'bool'
3877           }
3878 }
3879
3880 ##
3881 # @MemoryDeviceInfo:
3882 #
3883 # Union containing information about a memory device
3884 #
3885 # Since: 2.1
3886 ##
3887 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
3888
3889 ##
3890 # @query-memory-devices:
3891 #
3892 # Lists available memory devices and their state
3893 #
3894 # Since: 2.1
3895 #
3896 # Example:
3897 #
3898 # -> { "execute": "query-memory-devices" }
3899 # <- { "return": [ { "data":
3900 #                       { "addr": 5368709120,
3901 #                         "hotpluggable": true,
3902 #                         "hotplugged": true,
3903 #                         "id": "d1",
3904 #                         "memdev": "/objects/memX",
3905 #                         "node": 0,
3906 #                         "size": 1073741824,
3907 #                         "slot": 0},
3908 #                    "type": "dimm"
3909 #                  } ] }
3910 #
3911 ##
3912 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
3913
3914 ##
3915 # @ACPISlotType:
3916 #
3917 # @DIMM: memory slot
3918 # @CPU: logical CPU slot (since 2.7)
3919 ##
3920 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
3921
3922 ##
3923 # @ACPIOSTInfo:
3924 #
3925 # OSPM Status Indication for a device
3926 # For description of possible values of @source and @status fields
3927 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
3928 #
3929 # @device: device ID associated with slot
3930 #
3931 # @slot: slot ID, unique per slot of a given @slot-type
3932 #
3933 # @slot-type: type of the slot
3934 #
3935 # @source: an integer containing the source event
3936 #
3937 # @status: an integer containing the status code
3938 #
3939 # Since: 2.1
3940 ##
3941 { 'struct': 'ACPIOSTInfo',
3942   'data'  : { '*device': 'str',
3943               'slot': 'str',
3944               'slot-type': 'ACPISlotType',
3945               'source': 'int',
3946               'status': 'int' } }
3947
3948 ##
3949 # @query-acpi-ospm-status:
3950 #
3951 # Return a list of ACPIOSTInfo for devices that support status
3952 # reporting via ACPI _OST method.
3953 #
3954 # Since: 2.1
3955 #
3956 # Example:
3957 #
3958 # -> { "execute": "query-acpi-ospm-status" }
3959 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3960 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3961 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3962 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3963 #    ]}
3964 #
3965 ##
3966 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
3967
3968 ##
3969 # @IoOperationType:
3970 #
3971 # An enumeration of the I/O operation types
3972 #
3973 # @read: read operation
3974 #
3975 # @write: write operation
3976 #
3977 # Since: 2.1
3978 ##
3979 { 'enum': 'IoOperationType',
3980   'data': [ 'read', 'write' ] }
3981
3982 ##
3983 # @rtc-reset-reinjection:
3984 #
3985 # This command will reset the RTC interrupt reinjection backlog.
3986 # Can be used if another mechanism to synchronize guest time
3987 # is in effect, for example QEMU guest agent's guest-set-time
3988 # command.
3989 #
3990 # Since: 2.1
3991 #
3992 # Example:
3993 #
3994 # -> { "execute": "rtc-reset-reinjection" }
3995 # <- { "return": {} }
3996 #
3997 ##
3998 { 'command': 'rtc-reset-reinjection' }
3999
4000 ##
4001 # @ReplayMode:
4002 #
4003 # Mode of the replay subsystem.
4004 #
4005 # @none: normal execution mode. Replay or record are not enabled.
4006 #
4007 # @record: record mode. All non-deterministic data is written into the
4008 #          replay log.
4009 #
4010 # @play: replay mode. Non-deterministic data required for system execution
4011 #        is read from the log.
4012 #
4013 # Since: 2.5
4014 ##
4015 { 'enum': 'ReplayMode',
4016   'data': [ 'none', 'record', 'play' ] }
4017
4018 ##
4019 # @xen-load-devices-state:
4020 #
4021 # Load the state of all devices from file. The RAM and the block devices
4022 # of the VM are not loaded by this command.
4023 #
4024 # @filename: the file to load the state of the devices from as binary
4025 # data. See xen-save-devices-state.txt for a description of the binary
4026 # format.
4027 #
4028 # Since: 2.7
4029 #
4030 # Example:
4031 #
4032 # -> { "execute": "xen-load-devices-state",
4033 #      "arguments": { "filename": "/tmp/resume" } }
4034 # <- { "return": {} }
4035 #
4036 ##
4037 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
4038
4039 ##
4040 # @xen-set-replication:
4041 #
4042 # Enable or disable replication.
4043 #
4044 # @enable: true to enable, false to disable.
4045 #
4046 # @primary: true for primary or false for secondary.
4047 #
4048 # @failover: true to do failover, false to stop. but cannot be
4049 #            specified if 'enable' is true. default value is false.
4050 #
4051 # Returns: nothing.
4052 #
4053 # Example:
4054 #
4055 # -> { "execute": "xen-set-replication",
4056 #      "arguments": {"enable": true, "primary": false} }
4057 # <- { "return": {} }
4058 #
4059 # Since: 2.9
4060 ##
4061 { 'command': 'xen-set-replication',
4062   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
4063
4064 ##
4065 # @ReplicationStatus:
4066 #
4067 # The result format for 'query-xen-replication-status'.
4068 #
4069 # @error: true if an error happened, false if replication is normal.
4070 #
4071 # @desc: the human readable error description string, when
4072 #        @error is 'true'.
4073 #
4074 # Since: 2.9
4075 ##
4076 { 'struct': 'ReplicationStatus',
4077   'data': { 'error': 'bool', '*desc': 'str' } }
4078
4079 ##
4080 # @query-xen-replication-status:
4081 #
4082 # Query replication status while the vm is running.
4083 #
4084 # Returns: A @ReplicationResult object showing the status.
4085 #
4086 # Example:
4087 #
4088 # -> { "execute": "query-xen-replication-status" }
4089 # <- { "return": { "error": false } }
4090 #
4091 # Since: 2.9
4092 ##
4093 { 'command': 'query-xen-replication-status',
4094   'returns': 'ReplicationStatus' }
4095
4096 ##
4097 # @xen-colo-do-checkpoint:
4098 #
4099 # Xen uses this command to notify replication to trigger a checkpoint.
4100 #
4101 # Returns: nothing.
4102 #
4103 # Example:
4104 #
4105 # -> { "execute": "xen-colo-do-checkpoint" }
4106 # <- { "return": {} }
4107 #
4108 # Since: 2.9
4109 ##
4110 { 'command': 'xen-colo-do-checkpoint' }
4111
4112 ##
4113 # @GICCapability:
4114 #
4115 # The struct describes capability for a specific GIC (Generic
4116 # Interrupt Controller) version. These bits are not only decided by
4117 # QEMU/KVM software version, but also decided by the hardware that
4118 # the program is running upon.
4119 #
4120 # @version:  version of GIC to be described. Currently, only 2 and 3
4121 #            are supported.
4122 #
4123 # @emulated: whether current QEMU/hardware supports emulated GIC
4124 #            device in user space.
4125 #
4126 # @kernel:   whether current QEMU/hardware supports hardware
4127 #            accelerated GIC device in kernel.
4128 #
4129 # Since: 2.6
4130 ##
4131 { 'struct': 'GICCapability',
4132   'data': { 'version': 'int',
4133             'emulated': 'bool',
4134             'kernel': 'bool' } }
4135
4136 ##
4137 # @query-gic-capabilities:
4138 #
4139 # This command is ARM-only. It will return a list of GICCapability
4140 # objects that describe its capability bits.
4141 #
4142 # Returns: a list of GICCapability objects.
4143 #
4144 # Since: 2.6
4145 #
4146 # Example:
4147 #
4148 # -> { "execute": "query-gic-capabilities" }
4149 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
4150 #                 { "version": 3, "emulated": false, "kernel": true } ] }
4151 #
4152 ##
4153 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
4154
4155 ##
4156 # @CpuInstanceProperties:
4157 #
4158 # List of properties to be used for hotplugging a CPU instance,
4159 # it should be passed by management with device_add command when
4160 # a CPU is being hotplugged.
4161 #
4162 # @node-id: NUMA node ID the CPU belongs to
4163 # @socket-id: socket number within node/board the CPU belongs to
4164 # @core-id: core number within socket the CPU belongs to
4165 # @thread-id: thread number within core the CPU belongs to
4166 #
4167 # Note: currently there are 4 properties that could be present
4168 # but management should be prepared to pass through other
4169 # properties with device_add command to allow for future
4170 # interface extension. This also requires the filed names to be kept in
4171 # sync with the properties passed to -device/device_add.
4172 #
4173 # Since: 2.7
4174 ##
4175 { 'struct': 'CpuInstanceProperties',
4176   'data': { '*node-id': 'int',
4177             '*socket-id': 'int',
4178             '*core-id': 'int',
4179             '*thread-id': 'int'
4180   }
4181 }
4182
4183 ##
4184 # @HotpluggableCPU:
4185 #
4186 # @type: CPU object type for usage with device_add command
4187 # @props: list of properties to be used for hotplugging CPU
4188 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
4189 # @qom-path: link to existing CPU object if CPU is present or
4190 #            omitted if CPU is not present.
4191 #
4192 # Since: 2.7
4193 ##
4194 { 'struct': 'HotpluggableCPU',
4195   'data': { 'type': 'str',
4196             'vcpus-count': 'int',
4197             'props': 'CpuInstanceProperties',
4198             '*qom-path': 'str'
4199           }
4200 }
4201
4202 ##
4203 # @query-hotpluggable-cpus:
4204 #
4205 # Returns: a list of HotpluggableCPU objects.
4206 #
4207 # Since: 2.7
4208 #
4209 # Example:
4210 #
4211 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
4212 #
4213 # -> { "execute": "query-hotpluggable-cpus" }
4214 # <- {"return": [
4215 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
4216 #        "vcpus-count": 1 },
4217 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
4218 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
4219 #    ]}'
4220 #
4221 # For pc machine type started with -smp 1,maxcpus=2:
4222 #
4223 # -> { "execute": "query-hotpluggable-cpus" }
4224 # <- {"return": [
4225 #      {
4226 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
4227 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
4228 #      },
4229 #      {
4230 #         "qom-path": "/machine/unattached/device[0]",
4231 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
4232 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
4233 #      }
4234 #    ]}
4235 #
4236 ##
4237 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
4238
4239 ##
4240 # @GuidInfo:
4241 #
4242 # GUID information.
4243 #
4244 # @guid: the globally unique identifier
4245 #
4246 # Since: 2.9
4247 ##
4248 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
4249
4250 ##
4251 # @query-vm-generation-id:
4252 #
4253 # Show Virtual Machine Generation ID
4254 #
4255 # Since 2.9
4256 ##
4257 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
This page took 0.256474 seconds and 4 git commands to generate.