qapi-schema: Remove obsolete note from ObjectTypeInfo
[qemu/kevin.git] / qapi-schema.json
blobe6da88585a12a48f2a67c06309fc331c55009bb7
1 # -*- Mode: Python -*-
2 ##
3 # = Introduction
5 # This document describes all commands currently supported by QMP.
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.
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.
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.
19 # Also, the following notation is used to denote data flow:
21 # Example:
23 # | -> data issued by the Client
24 # | <- Server data response
26 # Please, refer to the QMP specification (docs/qmp-spec.txt) for
27 # detailed information on the Server command and response formats.
29 # = Stability Considerations
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.
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.
38 # If you're planning to adopt QMP, please observe the following:
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
44 #     2. DO NOT rely on anything which is not explicit documented
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)
52 { 'pragma': { 'doc-required': true } }
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     ] } }
75 # QAPI common definitions
76 { 'include': 'qapi/common.json' }
78 # QAPI crypto definitions
79 { 'include': 'qapi/crypto.json' }
81 # QAPI block definitions
82 { 'include': 'qapi/block.json' }
84 # QAPI event definitions
85 { 'include': 'qapi/event.json' }
87 # Tracing commands
88 { 'include': 'qapi/trace.json' }
90 # QAPI introspection
91 { 'include': 'qapi/introspect.json' }
94 # = QMP commands
98 # @qmp_capabilities:
100 # Enable QMP capabilities.
102 # Arguments: None.
104 # Example:
106 # -> { "execute": "qmp_capabilities" }
107 # <- { "return": {} }
109 # Notes: This command is valid exactly when first connecting: it must be
110 # issued before any other command will be accepted, and will fail once the
111 # monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
113 # Since: 0.13
116 { 'command': 'qmp_capabilities' }
119 # @LostTickPolicy:
121 # Policy for handling lost ticks in timer devices.
123 # @discard: throw away the missed tick(s) and continue with future injection
124 #           normally.  Guest time may be delayed, unless the OS has explicit
125 #           handling of lost ticks
127 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
128 #         delayed due to the late tick
130 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
131 #         may be delayed, depending on how the OS reacts to the merging
132 #         of ticks
134 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
135 #        guest time should not be delayed once catchup is complete.
137 # Since: 2.0
139 { 'enum': 'LostTickPolicy',
140   'data': ['discard', 'delay', 'merge', 'slew' ] }
143 # @add_client:
145 # Allow client connections for VNC, Spice and socket based
146 # character devices to be passed in to QEMU via SCM_RIGHTS.
148 # @protocol: protocol name. Valid names are "vnc", "spice" or the
149 #            name of a character device (eg. from -chardev id=XXXX)
151 # @fdname: file descriptor name previously passed via 'getfd' command
153 # @skipauth: whether to skip authentication. Only applies
154 #            to "vnc" and "spice" protocols
156 # @tls: whether to perform TLS. Only applies to the "spice"
157 #       protocol
159 # Returns: nothing on success.
161 # Since: 0.14.0
163 # Example:
165 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
166 #                                              "fdname": "myclient" } }
167 # <- { "return": {} }
170 { 'command': 'add_client',
171   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
172             '*tls': 'bool' } }
175 # @NameInfo:
177 # Guest name information.
179 # @name: The name of the guest
181 # Since: 0.14.0
183 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
186 # @query-name:
188 # Return the name information of a guest.
190 # Returns: @NameInfo of the guest
192 # Since: 0.14.0
194 # Example:
196 # -> { "execute": "query-name" }
197 # <- { "return": { "name": "qemu-name" } }
200 { 'command': 'query-name', 'returns': 'NameInfo' }
203 # @KvmInfo:
205 # Information about support for KVM acceleration
207 # @enabled: true if KVM acceleration is active
209 # @present: true if KVM acceleration is built into this executable
211 # Since: 0.14.0
213 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
216 # @query-kvm:
218 # Returns information about KVM acceleration
220 # Returns: @KvmInfo
222 # Since: 0.14.0
224 # Example:
226 # -> { "execute": "query-kvm" }
227 # <- { "return": { "enabled": true, "present": true } }
230 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
233 # @RunState:
235 # An enumeration of VM run states.
237 # @debug: QEMU is running on a debugger
239 # @finish-migrate: guest is paused to finish the migration process
241 # @inmigrate: guest is paused waiting for an incoming migration.  Note
242 # that this state does not tell whether the machine will start at the
243 # end of the migration.  This depends on the command-line -S option and
244 # any invocation of 'stop' or 'cont' that has happened since QEMU was
245 # started.
247 # @internal-error: An internal error that prevents further guest execution
248 # has occurred
250 # @io-error: the last IOP has failed and the device is configured to pause
251 # on I/O errors
253 # @paused: guest has been paused via the 'stop' command
255 # @postmigrate: guest is paused following a successful 'migrate'
257 # @prelaunch: QEMU was started with -S and guest has not started
259 # @restore-vm: guest is paused to restore VM state
261 # @running: guest is actively running
263 # @save-vm: guest is paused to save the VM state
265 # @shutdown: guest is shut down (and -no-shutdown is in use)
267 # @suspended: guest is suspended (ACPI S3)
269 # @watchdog: the watchdog action is configured to pause and has been triggered
271 # @guest-panicked: guest has been panicked as a result of guest OS panic
273 # @colo: guest is paused to save/restore VM state under colo checkpoint,
274 #        VM can not get into this state unless colo capability is enabled
275 #        for migration. (since 2.8)
277 { 'enum': 'RunState',
278   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
279             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
280             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
281             'guest-panicked', 'colo' ] }
284 # @StatusInfo:
286 # Information about VCPU run state
288 # @running: true if all VCPUs are runnable, false if not runnable
290 # @singlestep: true if VCPUs are in single-step mode
292 # @status: the virtual machine @RunState
294 # Since:  0.14.0
296 # Notes: @singlestep is enabled through the GDB stub
298 { 'struct': 'StatusInfo',
299   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
302 # @query-status:
304 # Query the run status of all VCPUs
306 # Returns: @StatusInfo reflecting all VCPUs
308 # Since:  0.14.0
310 # Example:
312 # -> { "execute": "query-status" }
313 # <- { "return": { "running": true,
314 #                  "singlestep": false,
315 #                  "status": "running" } }
318 { 'command': 'query-status', 'returns': 'StatusInfo' }
321 # @UuidInfo:
323 # Guest UUID information (Universally Unique Identifier).
325 # @UUID: the UUID of the guest
327 # Since: 0.14.0
329 # Notes: If no UUID was specified for the guest, a null UUID is returned.
331 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
334 # @query-uuid:
336 # Query the guest UUID information.
338 # Returns: The @UuidInfo for the guest
340 # Since: 0.14.0
342 # Example:
344 # -> { "execute": "query-uuid" }
345 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
348 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
351 # @ChardevInfo:
353 # Information about a character device.
355 # @label: the label of the character device
357 # @filename: the filename of the character device
359 # @frontend-open: shows whether the frontend device attached to this backend
360 #                 (eg. with the chardev=... option) is in open or closed state
361 #                 (since 2.1)
363 # Notes: @filename is encoded using the QEMU command line character device
364 #        encoding.  See the QEMU man page for details.
366 # Since: 0.14.0
368 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
369                                   'filename': 'str',
370                                   'frontend-open': 'bool'} }
373 # @query-chardev:
375 # Returns information about current character devices.
377 # Returns: a list of @ChardevInfo
379 # Since: 0.14.0
381 # Example:
383 # -> { "execute": "query-chardev" }
384 # <- {
385 #       "return": [
386 #          {
387 #             "label": "charchannel0",
388 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
389 #             "frontend-open": false
390 #          },
391 #          {
392 #             "label": "charmonitor",
393 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
394 #             "frontend-open": true
395 #          },
396 #          {
397 #             "label": "charserial0",
398 #             "filename": "pty:/dev/pts/2",
399 #             "frontend-open": true
400 #          }
401 #       ]
402 #    }
405 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
408 # @ChardevBackendInfo:
410 # Information about a character device backend
412 # @name: The backend name
414 # Since: 2.0
416 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
419 # @query-chardev-backends:
421 # Returns information about character device backends.
423 # Returns: a list of @ChardevBackendInfo
425 # Since: 2.0
427 # Example:
429 # -> { "execute": "query-chardev-backends" }
430 # <- {
431 #       "return":[
432 #          {
433 #             "name":"udp"
434 #          },
435 #          {
436 #             "name":"tcp"
437 #          },
438 #          {
439 #             "name":"unix"
440 #          },
441 #          {
442 #             "name":"spiceport"
443 #          }
444 #       ]
445 #    }
448 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
451 # @DataFormat:
453 # An enumeration of data format.
455 # @utf8: Data is a UTF-8 string (RFC 3629)
457 # @base64: Data is Base64 encoded binary (RFC 3548)
459 # Since: 1.4
461 { 'enum': 'DataFormat',
462   'data': [ 'utf8', 'base64' ] }
465 # @ringbuf-write:
467 # Write to a ring buffer character device.
469 # @device: the ring buffer character device name
471 # @data: data to write
473 # @format: data encoding (default 'utf8').
474 #          - base64: data must be base64 encoded text.  Its binary
475 #            decoding gets written.
476 #          - utf8: data's UTF-8 encoding is written
477 #          - data itself is always Unicode regardless of format, like
478 #            any other string.
480 # Returns: Nothing on success
482 # Since: 1.4
484 # Example:
486 # -> { "execute": "ringbuf-write",
487 #      "arguments": { "device": "foo",
488 #                     "data": "abcdefgh",
489 #                     "format": "utf8" } }
490 # <- { "return": {} }
493 { 'command': 'ringbuf-write',
494   'data': {'device': 'str', 'data': 'str',
495            '*format': 'DataFormat'} }
498 # @ringbuf-read:
500 # Read from a ring buffer character device.
502 # @device: the ring buffer character device name
504 # @size: how many bytes to read at most
506 # @format: data encoding (default 'utf8').
507 #          - base64: the data read is returned in base64 encoding.
508 #          - utf8: the data read is interpreted as UTF-8.
509 #            Bug: can screw up when the buffer contains invalid UTF-8
510 #            sequences, NUL characters, after the ring buffer lost
511 #            data, and when reading stops because the size limit is
512 #            reached.
513 #          - The return value is always Unicode regardless of format,
514 #            like any other string.
516 # Returns: data read from the device
518 # Since: 1.4
520 # Example:
522 # -> { "execute": "ringbuf-read",
523 #      "arguments": { "device": "foo",
524 #                     "size": 1000,
525 #                     "format": "utf8" } }
526 # <- { "return": "abcdefgh" }
529 { 'command': 'ringbuf-read',
530   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
531   'returns': 'str' }
534 # @EventInfo:
536 # Information about a QMP event
538 # @name: The event name
540 # Since: 1.2.0
542 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
545 # @query-events:
547 # Return a list of supported QMP events by this server
549 # Returns: A list of @EventInfo for all supported events
551 # Since: 1.2.0
553 # Example:
555 # -> { "execute": "query-events" }
556 # <- {
557 #      "return": [
558 #          {
559 #             "name":"SHUTDOWN"
560 #          },
561 #          {
562 #             "name":"RESET"
563 #          }
564 #       ]
565 #    }
567 # Note: This example has been shortened as the real response is too long.
570 { 'command': 'query-events', 'returns': ['EventInfo'] }
573 # @MigrationStats:
575 # Detailed migration status.
577 # @transferred: amount of bytes already transferred to the target VM
579 # @remaining: amount of bytes remaining to be transferred to the target VM
581 # @total: total amount of bytes involved in the migration process
583 # @duplicate: number of duplicate (zero) pages (since 1.2)
585 # @skipped: number of skipped zero pages (since 1.5)
587 # @normal: number of normal pages (since 1.2)
589 # @normal-bytes: number of normal bytes sent (since 1.2)
591 # @dirty-pages-rate: number of pages dirtied by second by the
592 #        guest (since 1.3)
594 # @mbps: throughput in megabits/sec. (since 1.6)
596 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
598 # @postcopy-requests: The number of page requests received from the destination
599 #        (since 2.7)
601 # @page-size: The number of bytes per page for the various page-based
602 #        statistics (since 2.10)
604 # Since: 0.14.0
606 { 'struct': 'MigrationStats',
607   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
608            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
609            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
610            'mbps' : 'number', 'dirty-sync-count' : 'int',
611            'postcopy-requests' : 'int', 'page-size' : 'int' } }
614 # @XBZRLECacheStats:
616 # Detailed XBZRLE migration cache statistics
618 # @cache-size: XBZRLE cache size
620 # @bytes: amount of bytes already transferred to the target VM
622 # @pages: amount of pages transferred to the target VM
624 # @cache-miss: number of cache miss
626 # @cache-miss-rate: rate of cache miss (since 2.1)
628 # @overflow: number of overflows
630 # Since: 1.2
632 { 'struct': 'XBZRLECacheStats',
633   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
634            'cache-miss': 'int', 'cache-miss-rate': 'number',
635            'overflow': 'int' } }
638 # @MigrationStatus:
640 # An enumeration of migration status.
642 # @none: no migration has ever happened.
644 # @setup: migration process has been initiated.
646 # @cancelling: in the process of cancelling migration.
648 # @cancelled: cancelling migration is finished.
650 # @active: in the process of doing migration.
652 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
654 # @completed: migration is finished.
656 # @failed: some error occurred during migration process.
658 # @colo: VM is in the process of fault tolerance, VM can not get into this
659 #        state unless colo capability is enabled for migration. (since 2.8)
661 # Since: 2.3
664 { 'enum': 'MigrationStatus',
665   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
666             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
669 # @MigrationInfo:
671 # Information about current migration process.
673 # @status: @MigrationStatus describing the current migration status.
674 #          If this field is not returned, no migration process
675 #          has been initiated
677 # @ram: @MigrationStats containing detailed migration
678 #       status, only returned if status is 'active' or
679 #       'completed'(since 1.2)
681 # @disk: @MigrationStats containing detailed disk migration
682 #        status, only returned if status is 'active' and it is a block
683 #        migration
685 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
686 #                migration statistics, only returned if XBZRLE feature is on and
687 #                status is 'active' or 'completed' (since 1.2)
689 # @total-time: total amount of milliseconds since migration started.
690 #        If migration has ended, it returns the total migration
691 #        time. (since 1.2)
693 # @downtime: only present when migration finishes correctly
694 #        total downtime in milliseconds for the guest.
695 #        (since 1.3)
697 # @expected-downtime: only present while migration is active
698 #        expected downtime in milliseconds for the guest in last walk
699 #        of the dirty bitmap. (since 1.3)
701 # @setup-time: amount of setup time in milliseconds _before_ the
702 #        iterations begin but _after_ the QMP command is issued. This is designed
703 #        to provide an accounting of any activities (such as RDMA pinning) which
704 #        may be expensive, but do not actually occur during the iterative
705 #        migration rounds themselves. (since 1.6)
707 # @cpu-throttle-percentage: percentage of time guest cpus are being
708 #        throttled during auto-converge. This is only present when auto-converge
709 #        has started throttling guest cpus. (Since 2.7)
711 # @error-desc: the human readable error description string, when
712 #              @status is 'failed'. Clients should not attempt to parse the
713 #              error strings. (Since 2.7)
715 # Since: 0.14.0
717 { 'struct': 'MigrationInfo',
718   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
719            '*disk': 'MigrationStats',
720            '*xbzrle-cache': 'XBZRLECacheStats',
721            '*total-time': 'int',
722            '*expected-downtime': 'int',
723            '*downtime': 'int',
724            '*setup-time': 'int',
725            '*cpu-throttle-percentage': 'int',
726            '*error-desc': 'str'} }
729 # @query-migrate:
731 # Returns information about current migration process. If migration
732 # is active there will be another json-object with RAM migration
733 # status and if block migration is active another one with block
734 # migration status.
736 # Returns: @MigrationInfo
738 # Since: 0.14.0
740 # Example:
742 # 1. Before the first migration
744 # -> { "execute": "query-migrate" }
745 # <- { "return": {} }
747 # 2. Migration is done and has succeeded
749 # -> { "execute": "query-migrate" }
750 # <- { "return": {
751 #         "status": "completed",
752 #         "ram":{
753 #           "transferred":123,
754 #           "remaining":123,
755 #           "total":246,
756 #           "total-time":12345,
757 #           "setup-time":12345,
758 #           "downtime":12345,
759 #           "duplicate":123,
760 #           "normal":123,
761 #           "normal-bytes":123456,
762 #           "dirty-sync-count":15
763 #         }
764 #      }
765 #    }
767 # 3. Migration is done and has failed
769 # -> { "execute": "query-migrate" }
770 # <- { "return": { "status": "failed" } }
772 # 4. Migration is being performed and is not a block migration:
774 # -> { "execute": "query-migrate" }
775 # <- {
776 #       "return":{
777 #          "status":"active",
778 #          "ram":{
779 #             "transferred":123,
780 #             "remaining":123,
781 #             "total":246,
782 #             "total-time":12345,
783 #             "setup-time":12345,
784 #             "expected-downtime":12345,
785 #             "duplicate":123,
786 #             "normal":123,
787 #             "normal-bytes":123456,
788 #             "dirty-sync-count":15
789 #          }
790 #       }
791 #    }
793 # 5. Migration is being performed and is a block migration:
795 # -> { "execute": "query-migrate" }
796 # <- {
797 #       "return":{
798 #          "status":"active",
799 #          "ram":{
800 #             "total":1057024,
801 #             "remaining":1053304,
802 #             "transferred":3720,
803 #             "total-time":12345,
804 #             "setup-time":12345,
805 #             "expected-downtime":12345,
806 #             "duplicate":123,
807 #             "normal":123,
808 #             "normal-bytes":123456,
809 #             "dirty-sync-count":15
810 #          },
811 #          "disk":{
812 #             "total":20971520,
813 #             "remaining":20880384,
814 #             "transferred":91136
815 #          }
816 #       }
817 #    }
819 # 6. Migration is being performed and XBZRLE is active:
821 # -> { "execute": "query-migrate" }
822 # <- {
823 #       "return":{
824 #          "status":"active",
825 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
826 #          "ram":{
827 #             "total":1057024,
828 #             "remaining":1053304,
829 #             "transferred":3720,
830 #             "total-time":12345,
831 #             "setup-time":12345,
832 #             "expected-downtime":12345,
833 #             "duplicate":10,
834 #             "normal":3333,
835 #             "normal-bytes":3412992,
836 #             "dirty-sync-count":15
837 #          },
838 #          "xbzrle-cache":{
839 #             "cache-size":67108864,
840 #             "bytes":20971520,
841 #             "pages":2444343,
842 #             "cache-miss":2244,
843 #             "cache-miss-rate":0.123,
844 #             "overflow":34434
845 #          }
846 #       }
847 #    }
850 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
853 # @MigrationCapability:
855 # Migration capabilities enumeration
857 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
858 #          This feature allows us to minimize migration traffic for certain work
859 #          loads, by sending compressed difference of the pages
861 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
862 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
863 #          Disabled by default. (since 2.0)
865 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
866 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
867 #          source and target VM to support this feature. To enable it is sufficient
868 #          to enable the capability on the source VM. The feature is disabled by
869 #          default. (since 1.6)
871 # @compress: Use multiple compression threads to accelerate live migration.
872 #          This feature can help to reduce the migration traffic, by sending
873 #          compressed pages. Please note that if compress and xbzrle are both
874 #          on, compress only takes effect in the ram bulk stage, after that,
875 #          it will be disabled and only xbzrle takes effect, this can help to
876 #          minimize migration traffic. The feature is disabled by default.
877 #          (since 2.4 )
879 # @events: generate events for each migration state change
880 #          (since 2.4 )
882 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
883 #          to speed up convergence of RAM migration. (since 1.6)
885 # @postcopy-ram: Start executing on the migration target before all of RAM has
886 #          been migrated, pulling the remaining pages along as needed. NOTE: If
887 #          the migration fails during postcopy the VM will fail.  (since 2.6)
889 # @x-colo: If enabled, migration will never end, and the state of the VM on the
890 #        primary side will be migrated continuously to the VM on secondary
891 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
892 #        Non-stop Service. (since 2.8)
894 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
895 #        during postcopy-ram migration. (since 2.9)
897 # Since: 1.2
899 { 'enum': 'MigrationCapability',
900   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
901            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] }
904 # @MigrationCapabilityStatus:
906 # Migration capability information
908 # @capability: capability enum
910 # @state: capability state bool
912 # Since: 1.2
914 { 'struct': 'MigrationCapabilityStatus',
915   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
918 # @migrate-set-capabilities:
920 # Enable/Disable the following migration capabilities (like xbzrle)
922 # @capabilities: json array of capability modifications to make
924 # Since: 1.2
926 # Example:
928 # -> { "execute": "migrate-set-capabilities" , "arguments":
929 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
932 { 'command': 'migrate-set-capabilities',
933   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
936 # @query-migrate-capabilities:
938 # Returns information about the current migration capabilities status
940 # Returns: @MigrationCapabilitiesStatus
942 # Since: 1.2
944 # Example:
946 # -> { "execute": "query-migrate-capabilities" }
947 # <- { "return": [
948 #       {"state": false, "capability": "xbzrle"},
949 #       {"state": false, "capability": "rdma-pin-all"},
950 #       {"state": false, "capability": "auto-converge"},
951 #       {"state": false, "capability": "zero-blocks"},
952 #       {"state": false, "capability": "compress"},
953 #       {"state": true, "capability": "events"},
954 #       {"state": false, "capability": "postcopy-ram"},
955 #       {"state": false, "capability": "x-colo"}
956 #    ]}
959 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
962 # @MigrationParameter:
964 # Migration parameters enumeration
966 # @compress-level: Set the compression level to be used in live migration,
967 #          the compression level is an integer between 0 and 9, where 0 means
968 #          no compression, 1 means the best compression speed, and 9 means best
969 #          compression ratio which will consume more CPU.
971 # @compress-threads: Set compression thread count to be used in live migration,
972 #          the compression thread count is an integer between 1 and 255.
974 # @decompress-threads: Set decompression thread count to be used in live
975 #          migration, the decompression thread count is an integer between 1
976 #          and 255. Usually, decompression is at least 4 times as fast as
977 #          compression, so set the decompress-threads to the number about 1/4
978 #          of compress-threads is adequate.
980 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
981 #                        when migration auto-converge is activated. The
982 #                        default value is 20. (Since 2.7)
984 # @cpu-throttle-increment: throttle percentage increase each time
985 #                          auto-converge detects that migration is not making
986 #                          progress. The default value is 10. (Since 2.7)
988 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
989 #             establishing a TLS connection over the migration data channel.
990 #             On the outgoing side of the migration, the credentials must
991 #             be for a 'client' endpoint, while for the incoming side the
992 #             credentials must be for a 'server' endpoint. Setting this
993 #             will enable TLS for all migrations. The default is unset,
994 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
996 # @tls-hostname: hostname of the target host for the migration. This is
997 #                required when using x509 based TLS credentials and the
998 #                migration URI does not already include a hostname. For
999 #                example if using fd: or exec: based migration, the
1000 #                hostname must be provided so that the server's x509
1001 #                certificate identity can be validated. (Since 2.7)
1003 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1004 #                 bytes per second. (Since 2.8)
1006 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1007 #                  downtime in milliseconds (Since 2.8)
1009 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
1010 #          periodic mode. (Since 2.8)
1012 # Since: 2.4
1014 { 'enum': 'MigrationParameter',
1015   'data': ['compress-level', 'compress-threads', 'decompress-threads',
1016            'cpu-throttle-initial', 'cpu-throttle-increment',
1017            'tls-creds', 'tls-hostname', 'max-bandwidth',
1018            'downtime-limit', 'x-checkpoint-delay' ] }
1021 # @migrate-set-parameters:
1023 # Set various migration parameters.
1025 # Since: 2.4
1027 # Example:
1029 # -> { "execute": "migrate-set-parameters" ,
1030 #      "arguments": { "compress-level": 1 } }
1033 { 'command': 'migrate-set-parameters', 'boxed': true,
1034   'data': 'MigrationParameters' }
1037 # @MigrationParameters:
1039 # Optional members can be omitted on input ('migrate-set-parameters')
1040 # but most members will always be present on output
1041 # ('query-migrate-parameters'), with the exception of tls-creds and
1042 # tls-hostname.
1044 # @compress-level: compression level
1046 # @compress-threads: compression thread count
1048 # @decompress-threads: decompression thread count
1050 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1051 #                        throttledwhen migration auto-converge is activated.
1052 #                        The default value is 20. (Since 2.7)
1054 # @cpu-throttle-increment: throttle percentage increase each time
1055 #                          auto-converge detects that migration is not making
1056 #                          progress. The default value is 10. (Since 2.7)
1058 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1059 #             for establishing a TLS connection over the migration data
1060 #             channel. On the outgoing side of the migration, the credentials
1061 #             must be for a 'client' endpoint, while for the incoming side the
1062 #             credentials must be for a 'server' endpoint. Setting this
1063 #             will enable TLS for all migrations. The default is unset,
1064 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1065 #             An empty string means that QEMU will use plain text mode for
1066 #             migration, rather than TLS (Since 2.9)
1068 # @tls-hostname: hostname of the target host for the migration. This
1069 #                is required when using x509 based TLS credentials and the
1070 #                migration URI does not already include a hostname. For
1071 #                example if using fd: or exec: based migration, the
1072 #                hostname must be provided so that the server's x509
1073 #                certificate identity can be validated. (Since 2.7)
1074 #                An empty string means that QEMU will use the hostname
1075 #                associated with the migration URI, if any. (Since 2.9)
1077 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1078 #                 bytes per second. (Since 2.8)
1080 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1081 #                  downtime in milliseconds (Since 2.8)
1083 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1085 # Since: 2.4
1087 { 'struct': 'MigrationParameters',
1088   'data': { '*compress-level': 'int',
1089             '*compress-threads': 'int',
1090             '*decompress-threads': 'int',
1091             '*cpu-throttle-initial': 'int',
1092             '*cpu-throttle-increment': 'int',
1093             '*tls-creds': 'str',
1094             '*tls-hostname': 'str',
1095             '*max-bandwidth': 'int',
1096             '*downtime-limit': 'int',
1097             '*x-checkpoint-delay': 'int'} }
1100 # @query-migrate-parameters:
1102 # Returns information about the current migration parameters
1104 # Returns: @MigrationParameters
1106 # Since: 2.4
1108 # Example:
1110 # -> { "execute": "query-migrate-parameters" }
1111 # <- { "return": {
1112 #          "decompress-threads": 2,
1113 #          "cpu-throttle-increment": 10,
1114 #          "compress-threads": 8,
1115 #          "compress-level": 1,
1116 #          "cpu-throttle-initial": 20,
1117 #          "max-bandwidth": 33554432,
1118 #          "downtime-limit": 300
1119 #       }
1120 #    }
1123 { 'command': 'query-migrate-parameters',
1124   'returns': 'MigrationParameters' }
1127 # @client_migrate_info:
1129 # Set migration information for remote display.  This makes the server
1130 # ask the client to automatically reconnect using the new parameters
1131 # once migration finished successfully.  Only implemented for SPICE.
1133 # @protocol:     must be "spice"
1134 # @hostname:     migration target hostname
1135 # @port:         spice tcp port for plaintext channels
1136 # @tls-port:     spice tcp port for tls-secured channels
1137 # @cert-subject: server certificate subject
1139 # Since: 0.14.0
1141 # Example:
1143 # -> { "execute": "client_migrate_info",
1144 #      "arguments": { "protocol": "spice",
1145 #                     "hostname": "virt42.lab.kraxel.org",
1146 #                     "port": 1234 } }
1147 # <- { "return": {} }
1150 { 'command': 'client_migrate_info',
1151   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1152             '*tls-port': 'int', '*cert-subject': 'str' } }
1155 # @migrate-start-postcopy:
1157 # Followup to a migration command to switch the migration to postcopy mode.
1158 # The postcopy-ram capability must be set before the original migration
1159 # command.
1161 # Since: 2.5
1163 # Example:
1165 # -> { "execute": "migrate-start-postcopy" }
1166 # <- { "return": {} }
1169 { 'command': 'migrate-start-postcopy' }
1172 # @COLOMessage:
1174 # The message transmission between Primary side and Secondary side.
1176 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1178 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1180 # @checkpoint-reply: SVM gets PVM's checkpoint request
1182 # @vmstate-send: VM's state will be sent by PVM.
1184 # @vmstate-size: The total size of VMstate.
1186 # @vmstate-received: VM's state has been received by SVM.
1188 # @vmstate-loaded: VM's state has been loaded by SVM.
1190 # Since: 2.8
1192 { 'enum': 'COLOMessage',
1193   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1194             'vmstate-send', 'vmstate-size', 'vmstate-received',
1195             'vmstate-loaded' ] }
1198 # @COLOMode:
1200 # The colo mode
1202 # @unknown: unknown mode
1204 # @primary: master side
1206 # @secondary: slave side
1208 # Since: 2.8
1210 { 'enum': 'COLOMode',
1211   'data': [ 'unknown', 'primary', 'secondary'] }
1214 # @FailoverStatus:
1216 # An enumeration of COLO failover status
1218 # @none: no failover has ever happened
1220 # @require: got failover requirement but not handled
1222 # @active: in the process of doing failover
1224 # @completed: finish the process of failover
1226 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1228 # Since: 2.8
1230 { 'enum': 'FailoverStatus',
1231   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1234 # @x-colo-lost-heartbeat:
1236 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1237 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1238 # If sent to the Secondary, the Secondary side will run failover work,
1239 # then takes over server operation to become the service VM.
1241 # Since: 2.8
1243 # Example:
1245 # -> { "execute": "x-colo-lost-heartbeat" }
1246 # <- { "return": {} }
1249 { 'command': 'x-colo-lost-heartbeat' }
1252 # @MouseInfo:
1254 # Information about a mouse device.
1256 # @name: the name of the mouse device
1258 # @index: the index of the mouse device
1260 # @current: true if this device is currently receiving mouse events
1262 # @absolute: true if this device supports absolute coordinates as input
1264 # Since: 0.14.0
1266 { 'struct': 'MouseInfo',
1267   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1268            'absolute': 'bool'} }
1271 # @query-mice:
1273 # Returns information about each active mouse device
1275 # Returns: a list of @MouseInfo for each device
1277 # Since: 0.14.0
1279 # Example:
1281 # -> { "execute": "query-mice" }
1282 # <- { "return": [
1283 #          {
1284 #             "name":"QEMU Microsoft Mouse",
1285 #             "index":0,
1286 #             "current":false,
1287 #             "absolute":false
1288 #          },
1289 #          {
1290 #             "name":"QEMU PS/2 Mouse",
1291 #             "index":1,
1292 #             "current":true,
1293 #             "absolute":true
1294 #          }
1295 #       ]
1296 #    }
1299 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1302 # @CpuInfoArch:
1304 # An enumeration of cpu types that enable additional information during
1305 # @query-cpus.
1307 # Since: 2.6
1309 { 'enum': 'CpuInfoArch',
1310   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1313 # @CpuInfo:
1315 # Information about a virtual CPU
1317 # @CPU: the index of the virtual CPU
1319 # @current: this only exists for backwards compatibility and should be ignored
1321 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1322 #          to a processor specific low power mode.
1324 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1326 # @thread_id: ID of the underlying host thread
1328 # @props: properties describing to which node/socket/core/thread
1329 #         virtual CPU belongs to, provided if supported by board (since 2.10)
1331 # @arch: architecture of the cpu, which determines which additional fields
1332 #        will be listed (since 2.6)
1334 # Since: 0.14.0
1336 # Notes: @halted is a transient state that changes frequently.  By the time the
1337 #        data is sent to the client, the guest may no longer be halted.
1339 { 'union': 'CpuInfo',
1340   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1341            'qom_path': 'str', 'thread_id': 'int',
1342            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
1343   'discriminator': 'arch',
1344   'data': { 'x86': 'CpuInfoX86',
1345             'sparc': 'CpuInfoSPARC',
1346             'ppc': 'CpuInfoPPC',
1347             'mips': 'CpuInfoMIPS',
1348             'tricore': 'CpuInfoTricore',
1349             'other': 'CpuInfoOther' } }
1352 # @CpuInfoX86:
1354 # Additional information about a virtual i386 or x86_64 CPU
1356 # @pc: the 64-bit instruction pointer
1358 # Since: 2.6
1360 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1363 # @CpuInfoSPARC:
1365 # Additional information about a virtual SPARC CPU
1367 # @pc: the PC component of the instruction pointer
1369 # @npc: the NPC component of the instruction pointer
1371 # Since: 2.6
1373 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1376 # @CpuInfoPPC:
1378 # Additional information about a virtual PPC CPU
1380 # @nip: the instruction pointer
1382 # Since: 2.6
1384 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1387 # @CpuInfoMIPS:
1389 # Additional information about a virtual MIPS CPU
1391 # @PC: the instruction pointer
1393 # Since: 2.6
1395 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1398 # @CpuInfoTricore:
1400 # Additional information about a virtual Tricore CPU
1402 # @PC: the instruction pointer
1404 # Since: 2.6
1406 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1409 # @CpuInfoOther:
1411 # No additional information is available about the virtual CPU
1413 # Since: 2.6
1416 { 'struct': 'CpuInfoOther', 'data': { } }
1419 # @query-cpus:
1421 # Returns a list of information about each virtual CPU.
1423 # Returns: a list of @CpuInfo for each virtual CPU
1425 # Since: 0.14.0
1427 # Example:
1429 # -> { "execute": "query-cpus" }
1430 # <- { "return": [
1431 #          {
1432 #             "CPU":0,
1433 #             "current":true,
1434 #             "halted":false,
1435 #             "qom_path":"/machine/unattached/device[0]",
1436 #             "arch":"x86",
1437 #             "pc":3227107138,
1438 #             "thread_id":3134
1439 #          },
1440 #          {
1441 #             "CPU":1,
1442 #             "current":false,
1443 #             "halted":true,
1444 #             "qom_path":"/machine/unattached/device[2]",
1445 #             "arch":"x86",
1446 #             "pc":7108165,
1447 #             "thread_id":3135
1448 #          }
1449 #       ]
1450 #    }
1453 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1456 # @IOThreadInfo:
1458 # Information about an iothread
1460 # @id: the identifier of the iothread
1462 # @thread-id: ID of the underlying host thread
1464 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1465 #               (since 2.9)
1467 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1468 #             configured (since 2.9)
1470 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1471 #               it's not configured (since 2.9)
1473 # Since: 2.0
1475 { 'struct': 'IOThreadInfo',
1476   'data': {'id': 'str',
1477            'thread-id': 'int',
1478            'poll-max-ns': 'int',
1479            'poll-grow': 'int',
1480            'poll-shrink': 'int' } }
1483 # @query-iothreads:
1485 # Returns a list of information about each iothread.
1487 # Note: this list excludes the QEMU main loop thread, which is not declared
1488 # using the -object iothread command-line option.  It is always the main thread
1489 # of the process.
1491 # Returns: a list of @IOThreadInfo for each iothread
1493 # Since: 2.0
1495 # Example:
1497 # -> { "execute": "query-iothreads" }
1498 # <- { "return": [
1499 #          {
1500 #             "id":"iothread0",
1501 #             "thread-id":3134
1502 #          },
1503 #          {
1504 #             "id":"iothread1",
1505 #             "thread-id":3135
1506 #          }
1507 #       ]
1508 #    }
1511 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1514 # @NetworkAddressFamily:
1516 # The network address family
1518 # @ipv4: IPV4 family
1520 # @ipv6: IPV6 family
1522 # @unix: unix socket
1524 # @vsock: vsock family (since 2.8)
1526 # @unknown: otherwise
1528 # Since: 2.1
1530 { 'enum': 'NetworkAddressFamily',
1531   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1534 # @VncBasicInfo:
1536 # The basic information for vnc network connection
1538 # @host: IP address
1540 # @service: The service name of the vnc port. This may depend on the host
1541 #           system's service database so symbolic names should not be relied
1542 #           on.
1544 # @family: address family
1546 # @websocket: true in case the socket is a websocket (since 2.3).
1548 # Since: 2.1
1550 { 'struct': 'VncBasicInfo',
1551   'data': { 'host': 'str',
1552             'service': 'str',
1553             'family': 'NetworkAddressFamily',
1554             'websocket': 'bool' } }
1557 # @VncServerInfo:
1559 # The network connection information for server
1561 # @auth: authentication method used for
1562 #        the plain (non-websocket) VNC server
1564 # Since: 2.1
1566 { 'struct': 'VncServerInfo',
1567   'base': 'VncBasicInfo',
1568   'data': { '*auth': 'str' } }
1571 # @VncClientInfo:
1573 # Information about a connected VNC client.
1575 # @x509_dname: If x509 authentication is in use, the Distinguished
1576 #              Name of the client.
1578 # @sasl_username: If SASL authentication is in use, the SASL username
1579 #                 used for authentication.
1581 # Since: 0.14.0
1583 { 'struct': 'VncClientInfo',
1584   'base': 'VncBasicInfo',
1585   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1588 # @VncInfo:
1590 # Information about the VNC session.
1592 # @enabled: true if the VNC server is enabled, false otherwise
1594 # @host: The hostname the VNC server is bound to.  This depends on
1595 #        the name resolution on the host and may be an IP address.
1597 # @family: 'ipv6' if the host is listening for IPv6 connections
1598 #                    'ipv4' if the host is listening for IPv4 connections
1599 #                    'unix' if the host is listening on a unix domain socket
1600 #                    'unknown' otherwise
1602 # @service: The service name of the server's port.  This may depends
1603 #           on the host system's service database so symbolic names should not
1604 #           be relied on.
1606 # @auth: the current authentication type used by the server
1607 #        'none' if no authentication is being used
1608 #        'vnc' if VNC authentication is being used
1609 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1610 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1611 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1612 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1613 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1614 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1615 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1616 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1617 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1619 # @clients: a list of @VncClientInfo of all currently connected clients
1621 # Since: 0.14.0
1623 { 'struct': 'VncInfo',
1624   'data': {'enabled': 'bool', '*host': 'str',
1625            '*family': 'NetworkAddressFamily',
1626            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1629 # @VncPrimaryAuth:
1631 # vnc primary authentication method.
1633 # Since: 2.3
1635 { 'enum': 'VncPrimaryAuth',
1636   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1637             'tls', 'vencrypt', 'sasl' ] }
1640 # @VncVencryptSubAuth:
1642 # vnc sub authentication method with vencrypt.
1644 # Since: 2.3
1646 { 'enum': 'VncVencryptSubAuth',
1647   'data': [ 'plain',
1648             'tls-none',  'x509-none',
1649             'tls-vnc',   'x509-vnc',
1650             'tls-plain', 'x509-plain',
1651             'tls-sasl',  'x509-sasl' ] }
1655 # @VncServerInfo2:
1657 # The network connection information for server
1659 # @auth: The current authentication type used by the servers
1661 # @vencrypt: The vencrypt sub authentication type used by the
1662 #            servers, only specified in case auth == vencrypt.
1664 # Since: 2.9
1666 { 'struct': 'VncServerInfo2',
1667   'base': 'VncBasicInfo',
1668   'data': { 'auth'      : 'VncPrimaryAuth',
1669             '*vencrypt' : 'VncVencryptSubAuth' } }
1673 # @VncInfo2:
1675 # Information about a vnc server
1677 # @id: vnc server name.
1679 # @server: A list of @VncBasincInfo describing all listening sockets.
1680 #          The list can be empty (in case the vnc server is disabled).
1681 #          It also may have multiple entries: normal + websocket,
1682 #          possibly also ipv4 + ipv6 in the future.
1684 # @clients: A list of @VncClientInfo of all currently connected clients.
1685 #           The list can be empty, for obvious reasons.
1687 # @auth: The current authentication type used by the non-websockets servers
1689 # @vencrypt: The vencrypt authentication type used by the servers,
1690 #            only specified in case auth == vencrypt.
1692 # @display: The display device the vnc server is linked to.
1694 # Since: 2.3
1696 { 'struct': 'VncInfo2',
1697   'data': { 'id'        : 'str',
1698             'server'    : ['VncServerInfo2'],
1699             'clients'   : ['VncClientInfo'],
1700             'auth'      : 'VncPrimaryAuth',
1701             '*vencrypt' : 'VncVencryptSubAuth',
1702             '*display'  : 'str' } }
1705 # @query-vnc:
1707 # Returns information about the current VNC server
1709 # Returns: @VncInfo
1711 # Since: 0.14.0
1713 # Example:
1715 # -> { "execute": "query-vnc" }
1716 # <- { "return": {
1717 #          "enabled":true,
1718 #          "host":"0.0.0.0",
1719 #          "service":"50402",
1720 #          "auth":"vnc",
1721 #          "family":"ipv4",
1722 #          "clients":[
1723 #             {
1724 #                "host":"127.0.0.1",
1725 #                "service":"50401",
1726 #                "family":"ipv4"
1727 #             }
1728 #          ]
1729 #       }
1730 #    }
1733 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1736 # @query-vnc-servers:
1738 # Returns a list of vnc servers.  The list can be empty.
1740 # Returns: a list of @VncInfo2
1742 # Since: 2.3
1744 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1747 # @SpiceBasicInfo:
1749 # The basic information for SPICE network connection
1751 # @host: IP address
1753 # @port: port number
1755 # @family: address family
1757 # Since: 2.1
1759 { 'struct': 'SpiceBasicInfo',
1760   'data': { 'host': 'str',
1761             'port': 'str',
1762             'family': 'NetworkAddressFamily' } }
1765 # @SpiceServerInfo:
1767 # Information about a SPICE server
1769 # @auth: authentication method
1771 # Since: 2.1
1773 { 'struct': 'SpiceServerInfo',
1774   'base': 'SpiceBasicInfo',
1775   'data': { '*auth': 'str' } }
1778 # @SpiceChannel:
1780 # Information about a SPICE client channel.
1782 # @connection-id: SPICE connection id number.  All channels with the same id
1783 #                 belong to the same SPICE session.
1785 # @channel-type: SPICE channel type number.  "1" is the main control
1786 #                channel, filter for this one if you want to track spice
1787 #                sessions only
1789 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1790 #              multiple channels of the same type exist, such as multiple
1791 #              display channels in a multihead setup
1793 # @tls: true if the channel is encrypted, false otherwise.
1795 # Since: 0.14.0
1797 { 'struct': 'SpiceChannel',
1798   'base': 'SpiceBasicInfo',
1799   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1800            'tls': 'bool'} }
1803 # @SpiceQueryMouseMode:
1805 # An enumeration of Spice mouse states.
1807 # @client: Mouse cursor position is determined by the client.
1809 # @server: Mouse cursor position is determined by the server.
1811 # @unknown: No information is available about mouse mode used by
1812 #           the spice server.
1814 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1816 # Since: 1.1
1818 { 'enum': 'SpiceQueryMouseMode',
1819   'data': [ 'client', 'server', 'unknown' ] }
1822 # @SpiceInfo:
1824 # Information about the SPICE session.
1826 # @enabled: true if the SPICE server is enabled, false otherwise
1828 # @migrated: true if the last guest migration completed and spice
1829 #            migration had completed as well. false otherwise. (since 1.4)
1831 # @host: The hostname the SPICE server is bound to.  This depends on
1832 #        the name resolution on the host and may be an IP address.
1834 # @port: The SPICE server's port number.
1836 # @compiled-version: SPICE server version.
1838 # @tls-port: The SPICE server's TLS port number.
1840 # @auth: the current authentication type used by the server
1841 #        'none'  if no authentication is being used
1842 #        'spice' uses SASL or direct TLS authentication, depending on command
1843 #                line options
1845 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1846 #              be determined by the client or the server, or unknown if spice
1847 #              server doesn't provide this information. (since: 1.1)
1849 # @channels: a list of @SpiceChannel for each active spice channel
1851 # Since: 0.14.0
1853 { 'struct': 'SpiceInfo',
1854   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1855            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1856            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1859 # @query-spice:
1861 # Returns information about the current SPICE server
1863 # Returns: @SpiceInfo
1865 # Since: 0.14.0
1867 # Example:
1869 # -> { "execute": "query-spice" }
1870 # <- { "return": {
1871 #          "enabled": true,
1872 #          "auth": "spice",
1873 #          "port": 5920,
1874 #          "tls-port": 5921,
1875 #          "host": "0.0.0.0",
1876 #          "channels": [
1877 #             {
1878 #                "port": "54924",
1879 #                "family": "ipv4",
1880 #                "channel-type": 1,
1881 #                "connection-id": 1804289383,
1882 #                "host": "127.0.0.1",
1883 #                "channel-id": 0,
1884 #                "tls": true
1885 #             },
1886 #             {
1887 #                "port": "36710",
1888 #                "family": "ipv4",
1889 #                "channel-type": 4,
1890 #                "connection-id": 1804289383,
1891 #                "host": "127.0.0.1",
1892 #                "channel-id": 0,
1893 #                "tls": false
1894 #             },
1895 #             [ ... more channels follow ... ]
1896 #          ]
1897 #       }
1898 #    }
1901 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1904 # @BalloonInfo:
1906 # Information about the guest balloon device.
1908 # @actual: the number of bytes the balloon currently contains
1910 # Since: 0.14.0
1913 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1916 # @query-balloon:
1918 # Return information about the balloon device.
1920 # Returns: @BalloonInfo on success
1922 #          If the balloon driver is enabled but not functional because the KVM
1923 #          kernel module cannot support it, KvmMissingCap
1925 #          If no balloon device is present, DeviceNotActive
1927 # Since: 0.14.0
1929 # Example:
1931 # -> { "execute": "query-balloon" }
1932 # <- { "return": {
1933 #          "actual": 1073741824,
1934 #       }
1935 #    }
1938 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1941 # @PciMemoryRange:
1943 # A PCI device memory region
1945 # @base: the starting address (guest physical)
1947 # @limit: the ending address (guest physical)
1949 # Since: 0.14.0
1951 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1954 # @PciMemoryRegion:
1956 # Information about a PCI device I/O region.
1958 # @bar: the index of the Base Address Register for this region
1960 # @type: 'io' if the region is a PIO region
1961 #        'memory' if the region is a MMIO region
1963 # @size: memory size
1965 # @prefetch: if @type is 'memory', true if the memory is prefetchable
1967 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
1969 # Since: 0.14.0
1971 { 'struct': 'PciMemoryRegion',
1972   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1973            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1976 # @PciBusInfo:
1978 # Information about a bus of a PCI Bridge device
1980 # @number: primary bus interface number.  This should be the number of the
1981 #          bus the device resides on.
1983 # @secondary: secondary bus interface number.  This is the number of the
1984 #             main bus for the bridge
1986 # @subordinate: This is the highest number bus that resides below the
1987 #               bridge.
1989 # @io_range: The PIO range for all devices on this bridge
1991 # @memory_range: The MMIO range for all devices on this bridge
1993 # @prefetchable_range: The range of prefetchable MMIO for all devices on
1994 #                      this bridge
1996 # Since: 2.4
1998 { 'struct': 'PciBusInfo',
1999   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
2000            'io_range': 'PciMemoryRange',
2001            'memory_range': 'PciMemoryRange',
2002            'prefetchable_range': 'PciMemoryRange' } }
2005 # @PciBridgeInfo:
2007 # Information about a PCI Bridge device
2009 # @bus: information about the bus the device resides on
2011 # @devices: a list of @PciDeviceInfo for each device on this bridge
2013 # Since: 0.14.0
2015 { 'struct': 'PciBridgeInfo',
2016   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
2019 # @PciDeviceClass:
2021 # Information about the Class of a PCI device
2023 # @desc: a string description of the device's class
2025 # @class: the class code of the device
2027 # Since: 2.4
2029 { 'struct': 'PciDeviceClass',
2030   'data': {'*desc': 'str', 'class': 'int'} }
2033 # @PciDeviceId:
2035 # Information about the Id of a PCI device
2037 # @device: the PCI device id
2039 # @vendor: the PCI vendor id
2041 # Since: 2.4
2043 { 'struct': 'PciDeviceId',
2044   'data': {'device': 'int', 'vendor': 'int'} }
2047 # @PciDeviceInfo:
2049 # Information about a PCI device
2051 # @bus: the bus number of the device
2053 # @slot: the slot the device is located in
2055 # @function: the function of the slot used by the device
2057 # @class_info: the class of the device
2059 # @id: the PCI device id
2061 # @irq: if an IRQ is assigned to the device, the IRQ number
2063 # @qdev_id: the device name of the PCI device
2065 # @pci_bridge: if the device is a PCI bridge, the bridge information
2067 # @regions: a list of the PCI I/O regions associated with the device
2069 # Notes: the contents of @class_info.desc are not stable and should only be
2070 #        treated as informational.
2072 # Since: 0.14.0
2074 { 'struct': 'PciDeviceInfo',
2075   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
2076            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
2077            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2078            'regions': ['PciMemoryRegion']} }
2081 # @PciInfo:
2083 # Information about a PCI bus
2085 # @bus: the bus index
2087 # @devices: a list of devices on this bus
2089 # Since: 0.14.0
2091 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
2094 # @query-pci:
2096 # Return information about the PCI bus topology of the guest.
2098 # Returns: a list of @PciInfo for each PCI bus. Each bus is
2099 # represented by a json-object, which has a key with a json-array of
2100 # all PCI devices attached to it. Each device is represented by a
2101 # json-object.
2103 # Since: 0.14.0
2105 # Example:
2107 # -> { "execute": "query-pci" }
2108 # <- { "return": [
2109 #          {
2110 #             "bus": 0,
2111 #             "devices": [
2112 #                {
2113 #                   "bus": 0,
2114 #                   "qdev_id": "",
2115 #                   "slot": 0,
2116 #                   "class_info": {
2117 #                      "class": 1536,
2118 #                      "desc": "Host bridge"
2119 #                   },
2120 #                   "id": {
2121 #                      "device": 32902,
2122 #                      "vendor": 4663
2123 #                   },
2124 #                   "function": 0,
2125 #                   "regions": [
2126 #                   ]
2127 #                },
2128 #                {
2129 #                   "bus": 0,
2130 #                   "qdev_id": "",
2131 #                   "slot": 1,
2132 #                   "class_info": {
2133 #                      "class": 1537,
2134 #                      "desc": "ISA bridge"
2135 #                   },
2136 #                   "id": {
2137 #                      "device": 32902,
2138 #                      "vendor": 28672
2139 #                   },
2140 #                   "function": 0,
2141 #                   "regions": [
2142 #                   ]
2143 #                },
2144 #                {
2145 #                   "bus": 0,
2146 #                   "qdev_id": "",
2147 #                   "slot": 1,
2148 #                   "class_info": {
2149 #                      "class": 257,
2150 #                      "desc": "IDE controller"
2151 #                   },
2152 #                   "id": {
2153 #                      "device": 32902,
2154 #                      "vendor": 28688
2155 #                   },
2156 #                   "function": 1,
2157 #                   "regions": [
2158 #                      {
2159 #                         "bar": 4,
2160 #                         "size": 16,
2161 #                         "address": 49152,
2162 #                         "type": "io"
2163 #                      }
2164 #                   ]
2165 #                },
2166 #                {
2167 #                   "bus": 0,
2168 #                   "qdev_id": "",
2169 #                   "slot": 2,
2170 #                   "class_info": {
2171 #                      "class": 768,
2172 #                      "desc": "VGA controller"
2173 #                   },
2174 #                   "id": {
2175 #                      "device": 4115,
2176 #                      "vendor": 184
2177 #                   },
2178 #                   "function": 0,
2179 #                   "regions": [
2180 #                      {
2181 #                         "prefetch": true,
2182 #                         "mem_type_64": false,
2183 #                         "bar": 0,
2184 #                         "size": 33554432,
2185 #                         "address": 4026531840,
2186 #                         "type": "memory"
2187 #                      },
2188 #                      {
2189 #                         "prefetch": false,
2190 #                         "mem_type_64": false,
2191 #                         "bar": 1,
2192 #                         "size": 4096,
2193 #                         "address": 4060086272,
2194 #                         "type": "memory"
2195 #                      },
2196 #                      {
2197 #                         "prefetch": false,
2198 #                         "mem_type_64": false,
2199 #                         "bar": 6,
2200 #                         "size": 65536,
2201 #                         "address": -1,
2202 #                         "type": "memory"
2203 #                      }
2204 #                   ]
2205 #                },
2206 #                {
2207 #                   "bus": 0,
2208 #                   "qdev_id": "",
2209 #                   "irq": 11,
2210 #                   "slot": 4,
2211 #                   "class_info": {
2212 #                      "class": 1280,
2213 #                      "desc": "RAM controller"
2214 #                   },
2215 #                   "id": {
2216 #                      "device": 6900,
2217 #                      "vendor": 4098
2218 #                   },
2219 #                   "function": 0,
2220 #                   "regions": [
2221 #                      {
2222 #                         "bar": 0,
2223 #                         "size": 32,
2224 #                         "address": 49280,
2225 #                         "type": "io"
2226 #                      }
2227 #                   ]
2228 #                }
2229 #             ]
2230 #          }
2231 #       ]
2232 #    }
2234 # Note: This example has been shortened as the real response is too long.
2237 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2240 # @quit:
2242 # This command will cause the QEMU process to exit gracefully.  While every
2243 # attempt is made to send the QMP response before terminating, this is not
2244 # guaranteed.  When using this interface, a premature EOF would not be
2245 # unexpected.
2247 # Since: 0.14.0
2249 # Example:
2251 # -> { "execute": "quit" }
2252 # <- { "return": {} }
2254 { 'command': 'quit' }
2257 # @stop:
2259 # Stop all guest VCPU execution.
2261 # Since:  0.14.0
2263 # Notes:  This function will succeed even if the guest is already in the stopped
2264 #         state.  In "inmigrate" state, it will ensure that the guest
2265 #         remains paused once migration finishes, as if the -S option was
2266 #         passed on the command line.
2268 # Example:
2270 # -> { "execute": "stop" }
2271 # <- { "return": {} }
2274 { 'command': 'stop' }
2277 # @system_reset:
2279 # Performs a hard reset of a guest.
2281 # Since: 0.14.0
2283 # Example:
2285 # -> { "execute": "system_reset" }
2286 # <- { "return": {} }
2289 { 'command': 'system_reset' }
2292 # @system_powerdown:
2294 # Requests that a guest perform a powerdown operation.
2296 # Since: 0.14.0
2298 # Notes: A guest may or may not respond to this command.  This command
2299 #        returning does not indicate that a guest has accepted the request or
2300 #        that it has shut down.  Many guests will respond to this command by
2301 #        prompting the user in some way.
2302 # Example:
2304 # -> { "execute": "system_powerdown" }
2305 # <- { "return": {} }
2308 { 'command': 'system_powerdown' }
2311 # @cpu:
2313 # This command is a nop that is only provided for the purposes of compatibility.
2315 # Since: 0.14.0
2317 # Notes: Do not use this command.
2319 { 'command': 'cpu', 'data': {'index': 'int'} }
2322 # @cpu-add:
2324 # Adds CPU with specified ID
2326 # @id: ID of CPU to be created, valid values [0..max_cpus)
2328 # Returns: Nothing on success
2330 # Since: 1.5
2332 # Example:
2334 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2335 # <- { "return": {} }
2338 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2341 # @memsave:
2343 # Save a portion of guest memory to a file.
2345 # @val: the virtual address of the guest to start from
2347 # @size: the size of memory region to save
2349 # @filename: the file to save the memory to as binary data
2351 # @cpu-index: the index of the virtual CPU to use for translating the
2352 #                       virtual address (defaults to CPU 0)
2354 # Returns: Nothing on success
2356 # Since: 0.14.0
2358 # Notes: Errors were not reliably returned until 1.1
2360 # Example:
2362 # -> { "execute": "memsave",
2363 #      "arguments": { "val": 10,
2364 #                     "size": 100,
2365 #                     "filename": "/tmp/virtual-mem-dump" } }
2366 # <- { "return": {} }
2369 { 'command': 'memsave',
2370   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2373 # @pmemsave:
2375 # Save a portion of guest physical memory to a file.
2377 # @val: the physical address of the guest to start from
2379 # @size: the size of memory region to save
2381 # @filename: the file to save the memory to as binary data
2383 # Returns: Nothing on success
2385 # Since: 0.14.0
2387 # Notes: Errors were not reliably returned until 1.1
2389 # Example:
2391 # -> { "execute": "pmemsave",
2392 #      "arguments": { "val": 10,
2393 #                     "size": 100,
2394 #                     "filename": "/tmp/physical-mem-dump" } }
2395 # <- { "return": {} }
2398 { 'command': 'pmemsave',
2399   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2402 # @cont:
2404 # Resume guest VCPU execution.
2406 # Since:  0.14.0
2408 # Returns:  If successful, nothing
2409 #           If QEMU was started with an encrypted block device and a key has
2410 #              not yet been set, DeviceEncrypted.
2412 # Notes:  This command will succeed if the guest is currently running.  It
2413 #         will also succeed if the guest is in the "inmigrate" state; in
2414 #         this case, the effect of the command is to make sure the guest
2415 #         starts once migration finishes, removing the effect of the -S
2416 #         command line option if it was passed.
2418 # Example:
2420 # -> { "execute": "cont" }
2421 # <- { "return": {} }
2424 { 'command': 'cont' }
2427 # @system_wakeup:
2429 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2431 # Since:  1.1
2433 # Returns:  nothing.
2435 # Example:
2437 # -> { "execute": "system_wakeup" }
2438 # <- { "return": {} }
2441 { 'command': 'system_wakeup' }
2444 # @inject-nmi:
2446 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2447 # The command fails when the guest doesn't support injecting.
2449 # Returns:  If successful, nothing
2451 # Since:  0.14.0
2453 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2455 # Example:
2457 # -> { "execute": "inject-nmi" }
2458 # <- { "return": {} }
2461 { 'command': 'inject-nmi' }
2464 # @set_link:
2466 # Sets the link status of a virtual network adapter.
2468 # @name: the device name of the virtual network adapter
2470 # @up: true to set the link status to be up
2472 # Returns: Nothing on success
2473 #          If @name is not a valid network device, DeviceNotFound
2475 # Since: 0.14.0
2477 # Notes: Not all network adapters support setting link status.  This command
2478 #        will succeed even if the network adapter does not support link status
2479 #        notification.
2481 # Example:
2483 # -> { "execute": "set_link",
2484 #      "arguments": { "name": "e1000.0", "up": false } }
2485 # <- { "return": {} }
2488 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2491 # @balloon:
2493 # Request the balloon driver to change its balloon size.
2495 # @value: the target size of the balloon in bytes
2497 # Returns: Nothing on success
2498 #          If the balloon driver is enabled but not functional because the KVM
2499 #            kernel module cannot support it, KvmMissingCap
2500 #          If no balloon device is present, DeviceNotActive
2502 # Notes: This command just issues a request to the guest.  When it returns,
2503 #        the balloon size may not have changed.  A guest can change the balloon
2504 #        size independent of this command.
2506 # Since: 0.14.0
2508 # Example:
2510 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2511 # <- { "return": {} }
2514 { 'command': 'balloon', 'data': {'value': 'int'} }
2517 # @Abort:
2519 # This action can be used to test transaction failure.
2521 # Since: 1.6
2523 { 'struct': 'Abort',
2524   'data': { } }
2527 # @ActionCompletionMode:
2529 # An enumeration of Transactional completion modes.
2531 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2532 #              after the Transaction request succeeds. All Actions that
2533 #              can complete successfully will do so without waiting on others.
2534 #              This is the default.
2536 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2537 #           Actions. Actions do not complete until all Actions are ready to
2538 #           complete. May be rejected by Actions that do not support this
2539 #           completion mode.
2541 # Since: 2.5
2543 { 'enum': 'ActionCompletionMode',
2544   'data': [ 'individual', 'grouped' ] }
2547 # @TransactionAction:
2549 # A discriminated record of operations that can be performed with
2550 # @transaction. Action @type can be:
2552 # - @abort: since 1.6
2553 # - @block-dirty-bitmap-add: since 2.5
2554 # - @block-dirty-bitmap-clear: since 2.5
2555 # - @blockdev-backup: since 2.3
2556 # - @blockdev-snapshot: since 2.5
2557 # - @blockdev-snapshot-internal-sync: since 1.7
2558 # - @blockdev-snapshot-sync: since 1.1
2559 # - @drive-backup: since 1.6
2561 # Since: 1.1
2563 { 'union': 'TransactionAction',
2564   'data': {
2565        'abort': 'Abort',
2566        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2567        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2568        'blockdev-backup': 'BlockdevBackup',
2569        'blockdev-snapshot': 'BlockdevSnapshot',
2570        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2571        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2572        'drive-backup': 'DriveBackup'
2573    } }
2576 # @TransactionProperties:
2578 # Optional arguments to modify the behavior of a Transaction.
2580 # @completion-mode: Controls how jobs launched asynchronously by
2581 #                   Actions will complete or fail as a group.
2582 #                   See @ActionCompletionMode for details.
2584 # Since: 2.5
2586 { 'struct': 'TransactionProperties',
2587   'data': {
2588        '*completion-mode': 'ActionCompletionMode'
2589   }
2593 # @transaction:
2595 # Executes a number of transactionable QMP commands atomically. If any
2596 # operation fails, then the entire set of actions will be abandoned and the
2597 # appropriate error returned.
2599 # For external snapshots, the dictionary contains the device, the file to use for
2600 # the new snapshot, and the format.  The default format, if not specified, is
2601 # qcow2.
2603 # Each new snapshot defaults to being created by QEMU (wiping any
2604 # contents if the file already exists), but it is also possible to reuse
2605 # an externally-created file.  In the latter case, you should ensure that
2606 # the new image file has the same contents as the current one; QEMU cannot
2607 # perform any meaningful check.  Typically this is achieved by using the
2608 # current image file as the backing file for the new image.
2610 # On failure, the original disks pre-snapshot attempt will be used.
2612 # For internal snapshots, the dictionary contains the device and the snapshot's
2613 # name.  If an internal snapshot matching name already exists, the request will
2614 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2615 # and sheepdog.
2617 # On failure, qemu will try delete the newly created internal snapshot in the
2618 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2619 # it later with qemu-img or other command.
2621 # @actions: List of @TransactionAction;
2622 #           information needed for the respective operations.
2624 # @properties: structure of additional options to control the
2625 #              execution of the transaction. See @TransactionProperties
2626 #              for additional detail.
2628 # Returns: nothing on success
2630 #          Errors depend on the operations of the transaction
2632 # Note: The transaction aborts on the first failure.  Therefore, there will be
2633 # information on only one failed operation returned in an error condition, and
2634 # subsequent actions will not have been attempted.
2636 # Since: 1.1
2638 # Example:
2640 # -> { "execute": "transaction",
2641 #      "arguments": { "actions": [
2642 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2643 #                                      "snapshot-file": "/some/place/my-image",
2644 #                                      "format": "qcow2" } },
2645 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2646 #                                      "snapshot-file": "/some/place/my-image2",
2647 #                                      "snapshot-node-name": "node3432",
2648 #                                      "mode": "existing",
2649 #                                      "format": "qcow2" } },
2650 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2651 #                                      "snapshot-file": "/some/place/my-image2",
2652 #                                      "mode": "existing",
2653 #                                      "format": "qcow2" } },
2654 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2655 #                                      "device": "ide-hd2",
2656 #                                      "name": "snapshot0" } } ] } }
2657 # <- { "return": {} }
2660 { 'command': 'transaction',
2661   'data': { 'actions': [ 'TransactionAction' ],
2662             '*properties': 'TransactionProperties'
2663           }
2667 # @human-monitor-command:
2669 # Execute a command on the human monitor and return the output.
2671 # @command-line: the command to execute in the human monitor
2673 # @cpu-index: The CPU to use for commands that require an implicit CPU
2675 # Returns: the output of the command as a string
2677 # Since: 0.14.0
2679 # Notes: This command only exists as a stop-gap.  Its use is highly
2680 #        discouraged.  The semantics of this command are not
2681 #        guaranteed: this means that command names, arguments and
2682 #        responses can change or be removed at ANY time.  Applications
2683 #        that rely on long term stability guarantees should NOT
2684 #        use this command.
2686 #        Known limitations:
2688 #        * This command is stateless, this means that commands that depend
2689 #          on state information (such as getfd) might not work
2691 #        * Commands that prompt the user for data (eg. 'cont' when the block
2692 #          device is encrypted) don't currently work
2694 # Example:
2696 # -> { "execute": "human-monitor-command",
2697 #      "arguments": { "command-line": "info kvm" } }
2698 # <- { "return": "kvm support: enabled\r\n" }
2701 { 'command': 'human-monitor-command',
2702   'data': {'command-line': 'str', '*cpu-index': 'int'},
2703   'returns': 'str' }
2706 # @migrate_cancel:
2708 # Cancel the current executing migration process.
2710 # Returns: nothing on success
2712 # Notes: This command succeeds even if there is no migration process running.
2714 # Since: 0.14.0
2716 # Example:
2718 # -> { "execute": "migrate_cancel" }
2719 # <- { "return": {} }
2722 { 'command': 'migrate_cancel' }
2725 # @migrate_set_downtime:
2727 # Set maximum tolerated downtime for migration.
2729 # @value: maximum downtime in seconds
2731 # Returns: nothing on success
2733 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2735 # Since: 0.14.0
2737 # Example:
2739 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2740 # <- { "return": {} }
2743 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2746 # @migrate_set_speed:
2748 # Set maximum speed for migration.
2750 # @value: maximum speed in bytes per second.
2752 # Returns: nothing on success
2754 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2756 # Since: 0.14.0
2758 # Example:
2760 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2761 # <- { "return": {} }
2764 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2767 # @migrate-set-cache-size:
2769 # Set cache size to be used by XBZRLE migration
2771 # @value: cache size in bytes
2773 # The size will be rounded down to the nearest power of 2.
2774 # The cache size can be modified before and during ongoing migration
2776 # Returns: nothing on success
2778 # Since: 1.2
2780 # Example:
2782 # -> { "execute": "migrate-set-cache-size",
2783 #      "arguments": { "value": 536870912 } }
2784 # <- { "return": {} }
2787 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2790 # @query-migrate-cache-size:
2792 # Query migration XBZRLE cache size
2794 # Returns: XBZRLE cache size in bytes
2796 # Since: 1.2
2798 # Example:
2800 # -> { "execute": "query-migrate-cache-size" }
2801 # <- { "return": 67108864 }
2804 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2807 # @ObjectPropertyInfo:
2809 # @name: the name of the property
2811 # @type: the type of the property.  This will typically come in one of four
2812 #        forms:
2814 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2815 #           These types are mapped to the appropriate JSON type.
2817 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2818 #           device type name.  Child properties create the composition tree.
2820 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2821 #           device type name.  Link properties form the device model graph.
2823 # Since: 1.2
2825 { 'struct': 'ObjectPropertyInfo',
2826   'data': { 'name': 'str', 'type': 'str' } }
2829 # @qom-list:
2831 # This command will list any properties of a object given a path in the object
2832 # model.
2834 # @path: the path within the object model.  See @qom-get for a description of
2835 #        this parameter.
2837 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2838 #          object.
2840 # Since: 1.2
2842 { 'command': 'qom-list',
2843   'data': { 'path': 'str' },
2844   'returns': [ 'ObjectPropertyInfo' ] }
2847 # @qom-get:
2849 # This command will get a property from a object model path and return the
2850 # value.
2852 # @path: The path within the object model.  There are two forms of supported
2853 #        paths--absolute and partial paths.
2855 #        Absolute paths are derived from the root object and can follow child<>
2856 #        or link<> properties.  Since they can follow link<> properties, they
2857 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2858 #        and are prefixed  with a leading slash.
2860 #        Partial paths look like relative filenames.  They do not begin
2861 #        with a prefix.  The matching rules for partial paths are subtle but
2862 #        designed to make specifying objects easy.  At each level of the
2863 #        composition tree, the partial path is matched as an absolute path.
2864 #        The first match is not returned.  At least two matches are searched
2865 #        for.  A successful result is only returned if only one match is
2866 #        found.  If more than one match is found, a flag is return to
2867 #        indicate that the match was ambiguous.
2869 # @property: The property name to read
2871 # Returns: The property value.  The type depends on the property
2872 #          type. child<> and link<> properties are returned as #str
2873 #          pathnames.  All integer property types (u8, u16, etc) are
2874 #          returned as #int.
2876 # Since: 1.2
2878 { 'command': 'qom-get',
2879   'data': { 'path': 'str', 'property': 'str' },
2880   'returns': 'any' }
2883 # @qom-set:
2885 # This command will set a property from a object model path.
2887 # @path: see @qom-get for a description of this parameter
2889 # @property: the property name to set
2891 # @value: a value who's type is appropriate for the property type.  See @qom-get
2892 #         for a description of type mapping.
2894 # Since: 1.2
2896 { 'command': 'qom-set',
2897   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2900 # @set_password:
2902 # Sets the password of a remote display session.
2904 # @protocol: `vnc' to modify the VNC server password
2905 #            `spice' to modify the Spice server password
2907 # @password: the new password
2909 # @connected: how to handle existing clients when changing the
2910 #                       password.  If nothing is specified, defaults to `keep'
2911 #                       `fail' to fail the command if clients are connected
2912 #                       `disconnect' to disconnect existing clients
2913 #                       `keep' to maintain existing clients
2915 # Returns: Nothing on success
2916 #          If Spice is not enabled, DeviceNotFound
2918 # Since: 0.14.0
2920 # Example:
2922 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2923 #                                                "password": "secret" } }
2924 # <- { "return": {} }
2927 { 'command': 'set_password',
2928   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2931 # @expire_password:
2933 # Expire the password of a remote display server.
2935 # @protocol: the name of the remote display protocol `vnc' or `spice'
2937 # @time: when to expire the password.
2938 #        `now' to expire the password immediately
2939 #        `never' to cancel password expiration
2940 #        `+INT' where INT is the number of seconds from now (integer)
2941 #        `INT' where INT is the absolute time in seconds
2943 # Returns: Nothing on success
2944 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2946 # Since: 0.14.0
2948 # Notes: Time is relative to the server and currently there is no way to
2949 #        coordinate server time with client time.  It is not recommended to
2950 #        use the absolute time version of the @time parameter unless you're
2951 #        sure you are on the same machine as the QEMU instance.
2953 # Example:
2955 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2956 #                                                   "time": "+60" } }
2957 # <- { "return": {} }
2960 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2963 # @change-vnc-password:
2965 # Change the VNC server password.
2967 # @password:  the new password to use with VNC authentication
2969 # Since: 1.1
2971 # Notes:  An empty password in this command will set the password to the empty
2972 #         string.  Existing clients are unaffected by executing this command.
2974 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2977 # @change:
2979 # This command is multiple commands multiplexed together.
2981 # @device: This is normally the name of a block device but it may also be 'vnc'.
2982 #          when it's 'vnc', then sub command depends on @target
2984 # @target: If @device is a block device, then this is the new filename.
2985 #          If @device is 'vnc', then if the value 'password' selects the vnc
2986 #          change password command.   Otherwise, this specifies a new server URI
2987 #          address to listen to for VNC connections.
2989 # @arg:    If @device is a block device, then this is an optional format to open
2990 #          the device with.
2991 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2992 #          password to set.  If this argument is an empty string, then no future
2993 #          logins will be allowed.
2995 # Returns: Nothing on success.
2996 #          If @device is not a valid block device, DeviceNotFound
2997 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2998 #          if this error is returned, the device has been opened successfully
2999 #          and an additional call to @block_passwd is required to set the
3000 #          device's password.  The behavior of reads and writes to the block
3001 #          device between when these calls are executed is undefined.
3003 # Notes:  This interface is deprecated, and it is strongly recommended that you
3004 #         avoid using it.  For changing block devices, use
3005 #         blockdev-change-medium; for changing VNC parameters, use
3006 #         change-vnc-password.
3008 # Since: 0.14.0
3010 # Example:
3012 # 1. Change a removable medium
3014 # -> { "execute": "change",
3015 #      "arguments": { "device": "ide1-cd0",
3016 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
3017 # <- { "return": {} }
3019 # 2. Change VNC password
3021 # -> { "execute": "change",
3022 #      "arguments": { "device": "vnc", "target": "password",
3023 #                     "arg": "foobar1" } }
3024 # <- { "return": {} }
3027 { 'command': 'change',
3028   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
3031 # @ObjectTypeInfo:
3033 # This structure describes a search result from @qom-list-types
3035 # @name: the type name found in the search
3037 # Since: 1.1
3039 { 'struct': 'ObjectTypeInfo',
3040   'data': { 'name': 'str' } }
3043 # @qom-list-types:
3045 # This command will return a list of types given search parameters
3047 # @implements: if specified, only return types that implement this type name
3049 # @abstract: if true, include abstract types in the results
3051 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3053 # Since: 1.1
3055 { 'command': 'qom-list-types',
3056   'data': { '*implements': 'str', '*abstract': 'bool' },
3057   'returns': [ 'ObjectTypeInfo' ] }
3060 # @DevicePropertyInfo:
3062 # Information about device properties.
3064 # @name: the name of the property
3065 # @type: the typename of the property
3066 # @description: if specified, the description of the property.
3067 #               (since 2.2)
3069 # Since: 1.2
3071 { 'struct': 'DevicePropertyInfo',
3072   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
3075 # @device-list-properties:
3077 # List properties associated with a device.
3079 # @typename: the type name of a device
3081 # Returns: a list of DevicePropertyInfo describing a devices properties
3083 # Since: 1.2
3085 { 'command': 'device-list-properties',
3086   'data': { 'typename': 'str'},
3087   'returns': [ 'DevicePropertyInfo' ] }
3090 # @migrate:
3092 # Migrates the current running guest to another Virtual Machine.
3094 # @uri: the Uniform Resource Identifier of the destination VM
3096 # @blk: do block migration (full disk copy)
3098 # @inc: incremental disk copy migration
3100 # @detach: this argument exists only for compatibility reasons and
3101 #          is ignored by QEMU
3103 # Returns: nothing on success
3105 # Since: 0.14.0
3107 # Notes:
3109 # 1. The 'query-migrate' command should be used to check migration's progress
3110 #    and final result (this information is provided by the 'status' member)
3112 # 2. All boolean arguments default to false
3114 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
3115 #    be used
3117 # Example:
3119 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3120 # <- { "return": {} }
3123 { 'command': 'migrate',
3124   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
3127 # @migrate-incoming:
3129 # Start an incoming migration, the qemu must have been started
3130 # with -incoming defer
3132 # @uri: The Uniform Resource Identifier identifying the source or
3133 #       address to listen on
3135 # Returns: nothing on success
3137 # Since: 2.3
3139 # Notes:
3141 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3142 #    compatible with -incoming and the format of the uri is already exposed
3143 #    above libvirt.
3145 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3146 #    be used.
3148 # 3. The uri format is the same as for -incoming
3150 # Example:
3152 # -> { "execute": "migrate-incoming",
3153 #      "arguments": { "uri": "tcp::4446" } }
3154 # <- { "return": {} }
3157 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3160 # @xen-save-devices-state:
3162 # Save the state of all devices to file. The RAM and the block devices
3163 # of the VM are not saved by this command.
3165 # @filename: the file to save the state of the devices to as binary
3166 # data. See xen-save-devices-state.txt for a description of the binary
3167 # format.
3169 # Returns: Nothing on success
3171 # Since: 1.1
3173 # Example:
3175 # -> { "execute": "xen-save-devices-state",
3176 #      "arguments": { "filename": "/tmp/save" } }
3177 # <- { "return": {} }
3180 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3183 # @xen-set-global-dirty-log:
3185 # Enable or disable the global dirty log mode.
3187 # @enable: true to enable, false to disable.
3189 # Returns: nothing
3191 # Since: 1.3
3193 # Example:
3195 # -> { "execute": "xen-set-global-dirty-log",
3196 #      "arguments": { "enable": true } }
3197 # <- { "return": {} }
3200 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3203 # @device_add:
3205 # @driver: the name of the new device's driver
3207 # @bus: the device's parent bus (device tree path)
3209 # @id: the device's ID, must be unique
3211 # Additional arguments depend on the type.
3213 # Add a device.
3215 # Notes:
3216 # 1. For detailed information about this command, please refer to the
3217 #    'docs/qdev-device-use.txt' file.
3219 # 2. It's possible to list device properties by running QEMU with the
3220 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3221 #    device's name
3223 # Example:
3225 # -> { "execute": "device_add",
3226 #      "arguments": { "driver": "e1000", "id": "net1",
3227 #                     "bus": "pci.0",
3228 #                     "mac": "52:54:00:12:34:56" } }
3229 # <- { "return": {} }
3231 # TODO: This command effectively bypasses QAPI completely due to its
3232 # "additional arguments" business.  It shouldn't have been added to
3233 # the schema in this form.  It should be qapified properly, or
3234 # replaced by a properly qapified command.
3236 # Since: 0.13
3238 { 'command': 'device_add',
3239   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3240   'gen': false } # so we can get the additional arguments
3243 # @device_del:
3245 # Remove a device from a guest
3247 # @id: the device's ID or QOM path
3249 # Returns: Nothing on success
3250 #          If @id is not a valid device, DeviceNotFound
3252 # Notes: When this command completes, the device may not be removed from the
3253 #        guest.  Hot removal is an operation that requires guest cooperation.
3254 #        This command merely requests that the guest begin the hot removal
3255 #        process.  Completion of the device removal process is signaled with a
3256 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3257 #        for all devices.
3259 # Since: 0.14.0
3261 # Example:
3263 # -> { "execute": "device_del",
3264 #      "arguments": { "id": "net1" } }
3265 # <- { "return": {} }
3267 # -> { "execute": "device_del",
3268 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3269 # <- { "return": {} }
3272 { 'command': 'device_del', 'data': {'id': 'str'} }
3275 # @DumpGuestMemoryFormat:
3277 # An enumeration of guest-memory-dump's format.
3279 # @elf: elf format
3281 # @kdump-zlib: kdump-compressed format with zlib-compressed
3283 # @kdump-lzo: kdump-compressed format with lzo-compressed
3285 # @kdump-snappy: kdump-compressed format with snappy-compressed
3287 # Since: 2.0
3289 { 'enum': 'DumpGuestMemoryFormat',
3290   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3293 # @dump-guest-memory:
3295 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3296 # very long depending on the amount of guest memory.
3298 # @paging: if true, do paging to get guest's memory mapping. This allows
3299 #          using gdb to process the core file.
3301 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3302 #                     of RAM. This can happen for a large guest, or a
3303 #                     malicious guest pretending to be large.
3305 #          Also, paging=true has the following limitations:
3307 #             1. The guest may be in a catastrophic state or can have corrupted
3308 #                memory, which cannot be trusted
3309 #             2. The guest can be in real-mode even if paging is enabled. For
3310 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3311 #                goes in real-mode
3312 #             3. Currently only supported on i386 and x86_64.
3314 # @protocol: the filename or file descriptor of the vmcore. The supported
3315 #            protocols are:
3317 #            1. file: the protocol starts with "file:", and the following
3318 #               string is the file's path.
3319 #            2. fd: the protocol starts with "fd:", and the following string
3320 #               is the fd's name.
3322 # @detach: if true, QMP will return immediately rather than
3323 #          waiting for the dump to finish. The user can track progress
3324 #          using "query-dump". (since 2.6).
3326 # @begin: if specified, the starting physical address.
3328 # @length: if specified, the memory size, in bytes. If you don't
3329 #          want to dump all guest's memory, please specify the start @begin
3330 #          and @length
3332 # @format: if specified, the format of guest memory dump. But non-elf
3333 #          format is conflict with paging and filter, ie. @paging, @begin and
3334 #          @length is not allowed to be specified with non-elf @format at the
3335 #          same time (since 2.0)
3337 # Note: All boolean arguments default to false
3339 # Returns: nothing on success
3341 # Since: 1.2
3343 # Example:
3345 # -> { "execute": "dump-guest-memory",
3346 #      "arguments": { "protocol": "fd:dump" } }
3347 # <- { "return": {} }
3350 { 'command': 'dump-guest-memory',
3351   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3352             '*begin': 'int', '*length': 'int',
3353             '*format': 'DumpGuestMemoryFormat'} }
3356 # @DumpStatus:
3358 # Describe the status of a long-running background guest memory dump.
3360 # @none: no dump-guest-memory has started yet.
3362 # @active: there is one dump running in background.
3364 # @completed: the last dump has finished successfully.
3366 # @failed: the last dump has failed.
3368 # Since: 2.6
3370 { 'enum': 'DumpStatus',
3371   'data': [ 'none', 'active', 'completed', 'failed' ] }
3374 # @DumpQueryResult:
3376 # The result format for 'query-dump'.
3378 # @status: enum of @DumpStatus, which shows current dump status
3380 # @completed: bytes written in latest dump (uncompressed)
3382 # @total: total bytes to be written in latest dump (uncompressed)
3384 # Since: 2.6
3386 { 'struct': 'DumpQueryResult',
3387   'data': { 'status': 'DumpStatus',
3388             'completed': 'int',
3389             'total': 'int' } }
3392 # @query-dump:
3394 # Query latest dump status.
3396 # Returns: A @DumpStatus object showing the dump status.
3398 # Since: 2.6
3400 # Example:
3402 # -> { "execute": "query-dump" }
3403 # <- { "return": { "status": "active", "completed": 1024000,
3404 #                  "total": 2048000 } }
3407 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3410 # @DumpGuestMemoryCapability:
3412 # A list of the available formats for dump-guest-memory
3414 # Since: 2.0
3416 { 'struct': 'DumpGuestMemoryCapability',
3417   'data': {
3418       'formats': ['DumpGuestMemoryFormat'] } }
3421 # @query-dump-guest-memory-capability:
3423 # Returns the available formats for dump-guest-memory
3425 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3426 #           dump-guest-memory
3428 # Since: 2.0
3430 # Example:
3432 # -> { "execute": "query-dump-guest-memory-capability" }
3433 # <- { "return": { "formats":
3434 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3437 { 'command': 'query-dump-guest-memory-capability',
3438   'returns': 'DumpGuestMemoryCapability' }
3441 # @dump-skeys:
3443 # Dump guest's storage keys
3445 # @filename: the path to the file to dump to
3447 # This command is only supported on s390 architecture.
3449 # Since: 2.5
3451 # Example:
3453 # -> { "execute": "dump-skeys",
3454 #      "arguments": { "filename": "/tmp/skeys" } }
3455 # <- { "return": {} }
3458 { 'command': 'dump-skeys',
3459   'data': { 'filename': 'str' } }
3462 # @netdev_add:
3464 # Add a network backend.
3466 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3467 #        'vde', 'socket', 'dump' and 'bridge'
3469 # @id: the name of the new network backend
3471 # Additional arguments depend on the type.
3473 # TODO: This command effectively bypasses QAPI completely due to its
3474 # "additional arguments" business.  It shouldn't have been added to
3475 # the schema in this form.  It should be qapified properly, or
3476 # replaced by a properly qapified command.
3478 # Since: 0.14.0
3480 # Returns: Nothing on success
3481 #          If @type is not a valid network backend, DeviceNotFound
3483 # Example:
3485 # -> { "execute": "netdev_add",
3486 #      "arguments": { "type": "user", "id": "netdev1",
3487 #                     "dnssearch": "example.org" } }
3488 # <- { "return": {} }
3491 { 'command': 'netdev_add',
3492   'data': {'type': 'str', 'id': 'str'},
3493   'gen': false }                # so we can get the additional arguments
3496 # @netdev_del:
3498 # Remove a network backend.
3500 # @id: the name of the network backend to remove
3502 # Returns: Nothing on success
3503 #          If @id is not a valid network backend, DeviceNotFound
3505 # Since: 0.14.0
3507 # Example:
3509 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3510 # <- { "return": {} }
3513 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3516 # @object-add:
3518 # Create a QOM object.
3520 # @qom-type: the class name for the object to be created
3522 # @id: the name of the new object
3524 # @props: a dictionary of properties to be passed to the backend
3526 # Returns: Nothing on success
3527 #          Error if @qom-type is not a valid class name
3529 # Since: 2.0
3531 # Example:
3533 # -> { "execute": "object-add",
3534 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3535 #                     "props": { "filename": "/dev/hwrng" } } }
3536 # <- { "return": {} }
3539 { 'command': 'object-add',
3540   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3543 # @object-del:
3545 # Remove a QOM object.
3547 # @id: the name of the QOM object to remove
3549 # Returns: Nothing on success
3550 #          Error if @id is not a valid id for a QOM object
3552 # Since: 2.0
3554 # Example:
3556 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3557 # <- { "return": {} }
3560 { 'command': 'object-del', 'data': {'id': 'str'} }
3563 # @NetdevNoneOptions:
3565 # Use it alone to have zero network devices.
3567 # Since: 1.2
3569 { 'struct': 'NetdevNoneOptions',
3570   'data': { } }
3573 # @NetLegacyNicOptions:
3575 # Create a new Network Interface Card.
3577 # @netdev: id of -netdev to connect to
3579 # @macaddr: MAC address
3581 # @model: device model (e1000, rtl8139, virtio etc.)
3583 # @addr: PCI device address
3585 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
3587 # Since: 1.2
3589 { 'struct': 'NetLegacyNicOptions',
3590   'data': {
3591     '*netdev':  'str',
3592     '*macaddr': 'str',
3593     '*model':   'str',
3594     '*addr':    'str',
3595     '*vectors': 'uint32' } }
3598 # @String:
3600 # A fat type wrapping 'str', to be embedded in lists.
3602 # Since: 1.2
3604 { 'struct': 'String',
3605   'data': {
3606     'str': 'str' } }
3609 # @NetdevUserOptions:
3611 # Use the user mode network stack which requires no administrator privilege to
3612 # run.
3614 # @hostname: client hostname reported by the builtin DHCP server
3616 # @restrict: isolate the guest from the host
3618 # @ipv4: whether to support IPv4, default true for enabled
3619 #        (since 2.6)
3621 # @ipv6: whether to support IPv6, default true for enabled
3622 #        (since 2.6)
3624 # @ip: legacy parameter, use net= instead
3626 # @net: IP network address that the guest will see, in the
3627 #       form addr[/netmask] The netmask is optional, and can be
3628 #       either in the form a.b.c.d or as a number of valid top-most
3629 #       bits. Default is 10.0.2.0/24.
3631 # @host: guest-visible address of the host
3633 # @tftp: root directory of the built-in TFTP server
3635 # @bootfile: BOOTP filename, for use with tftp=
3637 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
3638 #             assign
3640 # @dns: guest-visible address of the virtual nameserver
3642 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
3643 #             to the guest
3645 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
3646 #               2.6). The network prefix is given in the usual
3647 #               hexadecimal IPv6 address notation.
3649 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
3650 #                  (since 2.6)
3652 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
3654 # @ipv6-dns: guest-visible IPv6 address of the virtual
3655 #            nameserver (since 2.6)
3657 # @smb: root directory of the built-in SMB server
3659 # @smbserver: IP address of the built-in SMB server
3661 # @hostfwd: redirect incoming TCP or UDP host connections to guest
3662 #           endpoints
3664 # @guestfwd: forward guest TCP connections
3666 # Since: 1.2
3668 { 'struct': 'NetdevUserOptions',
3669   'data': {
3670     '*hostname':  'str',
3671     '*restrict':  'bool',
3672     '*ipv4':      'bool',
3673     '*ipv6':      'bool',
3674     '*ip':        'str',
3675     '*net':       'str',
3676     '*host':      'str',
3677     '*tftp':      'str',
3678     '*bootfile':  'str',
3679     '*dhcpstart': 'str',
3680     '*dns':       'str',
3681     '*dnssearch': ['String'],
3682     '*ipv6-prefix':      'str',
3683     '*ipv6-prefixlen':   'int',
3684     '*ipv6-host':        'str',
3685     '*ipv6-dns':         'str',
3686     '*smb':       'str',
3687     '*smbserver': 'str',
3688     '*hostfwd':   ['String'],
3689     '*guestfwd':  ['String'] } }
3692 # @NetdevTapOptions:
3694 # Connect the host TAP network interface name to the VLAN.
3696 # @ifname: interface name
3698 # @fd: file descriptor of an already opened tap
3700 # @fds: multiple file descriptors of already opened multiqueue capable
3701 # tap
3703 # @script: script to initialize the interface
3705 # @downscript: script to shut down the interface
3707 # @br: bridge name (since 2.8)
3709 # @helper: command to execute to configure bridge
3711 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
3713 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
3715 # @vhost: enable vhost-net network accelerator
3717 # @vhostfd: file descriptor of an already opened vhost net device
3719 # @vhostfds: file descriptors of multiple already opened vhost net
3720 # devices
3722 # @vhostforce: vhost on for non-MSIX virtio guests
3724 # @queues: number of queues to be created for multiqueue capable tap
3726 # @poll-us: maximum number of microseconds that could
3727 # be spent on busy polling for tap (since 2.7)
3729 # Since: 1.2
3731 { 'struct': 'NetdevTapOptions',
3732   'data': {
3733     '*ifname':     'str',
3734     '*fd':         'str',
3735     '*fds':        'str',
3736     '*script':     'str',
3737     '*downscript': 'str',
3738     '*br':         'str',
3739     '*helper':     'str',
3740     '*sndbuf':     'size',
3741     '*vnet_hdr':   'bool',
3742     '*vhost':      'bool',
3743     '*vhostfd':    'str',
3744     '*vhostfds':   'str',
3745     '*vhostforce': 'bool',
3746     '*queues':     'uint32',
3747     '*poll-us':    'uint32'} }
3750 # @NetdevSocketOptions:
3752 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3753 # socket connection.
3755 # @fd: file descriptor of an already opened socket
3757 # @listen: port number, and optional hostname, to listen on
3759 # @connect: port number, and optional hostname, to connect to
3761 # @mcast: UDP multicast address and port number
3763 # @localaddr: source address and port for multicast and udp packets
3765 # @udp: UDP unicast address and port number
3767 # Since: 1.2
3769 { 'struct': 'NetdevSocketOptions',
3770   'data': {
3771     '*fd':        'str',
3772     '*listen':    'str',
3773     '*connect':   'str',
3774     '*mcast':     'str',
3775     '*localaddr': 'str',
3776     '*udp':       'str' } }
3779 # @NetdevL2TPv3Options:
3781 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3783 # @src: source address
3785 # @dst: destination address
3787 # @srcport: source port - mandatory for udp, optional for ip
3789 # @dstport: destination port - mandatory for udp, optional for ip
3791 # @ipv6: force the use of ipv6
3793 # @udp: use the udp version of l2tpv3 encapsulation
3795 # @cookie64: use 64 bit coookies
3797 # @counter: have sequence counter
3799 # @pincounter: pin sequence counter to zero -
3800 #              workaround for buggy implementations or
3801 #              networks with packet reorder
3803 # @txcookie: 32 or 64 bit transmit cookie
3805 # @rxcookie: 32 or 64 bit receive cookie
3807 # @txsession: 32 bit transmit session
3809 # @rxsession: 32 bit receive session - if not specified
3810 #             set to the same value as transmit
3812 # @offset: additional offset - allows the insertion of
3813 #          additional application-specific data before the packet payload
3815 # Since: 2.1
3817 { 'struct': 'NetdevL2TPv3Options',
3818   'data': {
3819     'src':          'str',
3820     'dst':          'str',
3821     '*srcport':     'str',
3822     '*dstport':     'str',
3823     '*ipv6':        'bool',
3824     '*udp':         'bool',
3825     '*cookie64':    'bool',
3826     '*counter':     'bool',
3827     '*pincounter':  'bool',
3828     '*txcookie':    'uint64',
3829     '*rxcookie':    'uint64',
3830     'txsession':    'uint32',
3831     '*rxsession':   'uint32',
3832     '*offset':      'uint32' } }
3835 # @NetdevVdeOptions:
3837 # Connect the VLAN to a vde switch running on the host.
3839 # @sock: socket path
3841 # @port: port number
3843 # @group: group owner of socket
3845 # @mode: permissions for socket
3847 # Since: 1.2
3849 { 'struct': 'NetdevVdeOptions',
3850   'data': {
3851     '*sock':  'str',
3852     '*port':  'uint16',
3853     '*group': 'str',
3854     '*mode':  'uint16' } }
3857 # @NetdevDumpOptions:
3859 # Dump VLAN network traffic to a file.
3861 # @len: per-packet size limit (64k default). Understands [TGMKkb]
3862 # suffixes.
3864 # @file: dump file path (default is qemu-vlan0.pcap)
3866 # Since: 1.2
3868 { 'struct': 'NetdevDumpOptions',
3869   'data': {
3870     '*len':  'size',
3871     '*file': 'str' } }
3874 # @NetdevBridgeOptions:
3876 # Connect a host TAP network interface to a host bridge device.
3878 # @br: bridge name
3880 # @helper: command to execute to configure bridge
3882 # Since: 1.2
3884 { 'struct': 'NetdevBridgeOptions',
3885   'data': {
3886     '*br':     'str',
3887     '*helper': 'str' } }
3890 # @NetdevHubPortOptions:
3892 # Connect two or more net clients through a software hub.
3894 # @hubid: hub identifier number
3896 # Since: 1.2
3898 { 'struct': 'NetdevHubPortOptions',
3899   'data': {
3900     'hubid':     'int32' } }
3903 # @NetdevNetmapOptions:
3905 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3907 # @ifname: Either the name of an existing network interface supported by
3908 #          netmap, or the name of a VALE port (created on the fly).
3909 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3910 #          YYY are non-negative integers. XXX identifies a switch and
3911 #          YYY identifies a port of the switch. VALE ports having the
3912 #          same XXX are therefore connected to the same switch.
3914 # @devname: path of the netmap device (default: '/dev/netmap').
3916 # Since: 2.0
3918 { 'struct': 'NetdevNetmapOptions',
3919   'data': {
3920     'ifname':     'str',
3921     '*devname':    'str' } }
3924 # @NetdevVhostUserOptions:
3926 # Vhost-user network backend
3928 # @chardev: name of a unix socket chardev
3930 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
3932 # @queues: number of queues to be created for multiqueue vhost-user
3933 #          (default: 1) (Since 2.5)
3935 # Since: 2.1
3937 { 'struct': 'NetdevVhostUserOptions',
3938   'data': {
3939     'chardev':        'str',
3940     '*vhostforce':    'bool',
3941     '*queues':        'int' } }
3944 # @NetClientDriver:
3946 # Available netdev drivers.
3948 # Since: 2.7
3950 { 'enum': 'NetClientDriver',
3951   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
3952             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
3955 # @Netdev:
3957 # Captures the configuration of a network device.
3959 # @id: identifier for monitor commands.
3961 # @type: Specify the driver used for interpreting remaining arguments.
3963 # Since: 1.2
3965 # 'l2tpv3' - since 2.1
3967 { 'union': 'Netdev',
3968   'base': { 'id': 'str', 'type': 'NetClientDriver' },
3969   'discriminator': 'type',
3970   'data': {
3971     'none':     'NetdevNoneOptions',
3972     'nic':      'NetLegacyNicOptions',
3973     'user':     'NetdevUserOptions',
3974     'tap':      'NetdevTapOptions',
3975     'l2tpv3':   'NetdevL2TPv3Options',
3976     'socket':   'NetdevSocketOptions',
3977     'vde':      'NetdevVdeOptions',
3978     'dump':     'NetdevDumpOptions',
3979     'bridge':   'NetdevBridgeOptions',
3980     'hubport':  'NetdevHubPortOptions',
3981     'netmap':   'NetdevNetmapOptions',
3982     'vhost-user': 'NetdevVhostUserOptions' } }
3985 # @NetLegacy:
3987 # Captures the configuration of a network device; legacy.
3989 # @vlan: vlan number
3991 # @id: identifier for monitor commands
3993 # @name: identifier for monitor commands, ignored if @id is present
3995 # @opts: device type specific properties (legacy)
3997 # Since: 1.2
3999 { 'struct': 'NetLegacy',
4000   'data': {
4001     '*vlan': 'int32',
4002     '*id':   'str',
4003     '*name': 'str',
4004     'opts':  'NetLegacyOptions' } }
4007 # @NetLegacyOptionsType:
4009 # Since: 1.2
4011 { 'enum': 'NetLegacyOptionsType',
4012   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
4013            'dump', 'bridge', 'netmap', 'vhost-user'] }
4016 # @NetLegacyOptions:
4018 # Like Netdev, but for use only by the legacy command line options
4020 # Since: 1.2
4022 { 'union': 'NetLegacyOptions',
4023   'base': { 'type': 'NetLegacyOptionsType' },
4024   'discriminator': 'type',
4025   'data': {
4026     'none':     'NetdevNoneOptions',
4027     'nic':      'NetLegacyNicOptions',
4028     'user':     'NetdevUserOptions',
4029     'tap':      'NetdevTapOptions',
4030     'l2tpv3':   'NetdevL2TPv3Options',
4031     'socket':   'NetdevSocketOptions',
4032     'vde':      'NetdevVdeOptions',
4033     'dump':     'NetdevDumpOptions',
4034     'bridge':   'NetdevBridgeOptions',
4035     'netmap':   'NetdevNetmapOptions',
4036     'vhost-user': 'NetdevVhostUserOptions' } }
4039 # @NetFilterDirection:
4041 # Indicates whether a netfilter is attached to a netdev's transmit queue or
4042 # receive queue or both.
4044 # @all: the filter is attached both to the receive and the transmit
4045 #       queue of the netdev (default).
4047 # @rx: the filter is attached to the receive queue of the netdev,
4048 #      where it will receive packets sent to the netdev.
4050 # @tx: the filter is attached to the transmit queue of the netdev,
4051 #      where it will receive packets sent by the netdev.
4053 # Since: 2.5
4055 { 'enum': 'NetFilterDirection',
4056   'data': [ 'all', 'rx', 'tx' ] }
4059 # @InetSocketAddressBase:
4061 # @host: host part of the address
4062 # @port: port part of the address
4064 { 'struct': 'InetSocketAddressBase',
4065   'data': {
4066     'host': 'str',
4067     'port': 'str' } }
4070 # @InetSocketAddress:
4072 # Captures a socket address or address range in the Internet namespace.
4074 # @numeric: true if the host/port are guaranteed to be numeric,
4075 #           false if name resolution should be attempted. Defaults to false.
4076 #           (Since 2.9)
4078 # @to: If present, this is range of possible addresses, with port
4079 #      between @port and @to.
4081 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4083 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4085 # Since: 1.3
4087 { 'struct': 'InetSocketAddress',
4088   'base': 'InetSocketAddressBase',
4089   'data': {
4090     '*numeric':  'bool',
4091     '*to': 'uint16',
4092     '*ipv4': 'bool',
4093     '*ipv6': 'bool' } }
4096 # @UnixSocketAddress:
4098 # Captures a socket address in the local ("Unix socket") namespace.
4100 # @path: filesystem path to use
4102 # Since: 1.3
4104 { 'struct': 'UnixSocketAddress',
4105   'data': {
4106     'path': 'str' } }
4109 # @VsockSocketAddress:
4111 # Captures a socket address in the vsock namespace.
4113 # @cid: unique host identifier
4114 # @port: port
4116 # Note: string types are used to allow for possible future hostname or
4117 # service resolution support.
4119 # Since: 2.8
4121 { 'struct': 'VsockSocketAddress',
4122   'data': {
4123     'cid': 'str',
4124     'port': 'str' } }
4127 # @SocketAddressLegacy:
4129 # Captures the address of a socket, which could also be a named file descriptor
4131 # Note: This type is deprecated in favor of SocketAddress.  The
4132 # difference between SocketAddressLegacy and SocketAddress is that the
4133 # latter is a flat union rather than a simple union. Flat is nicer
4134 # because it avoids nesting on the wire, i.e. that form has fewer {}.
4137 # Since: 1.3
4139 { 'union': 'SocketAddressLegacy',
4140   'data': {
4141     'inet': 'InetSocketAddress',
4142     'unix': 'UnixSocketAddress',
4143     'vsock': 'VsockSocketAddress',
4144     'fd': 'String' } }
4147 # @SocketAddressType:
4149 # Available SocketAddress types
4151 # @inet:  Internet address
4153 # @unix:  Unix domain socket
4155 # Since: 2.9
4157 { 'enum': 'SocketAddressType',
4158   'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
4161 # @SocketAddress:
4163 # Captures the address of a socket, which could also be a named file
4164 # descriptor
4166 # @type:       Transport type
4168 # Since: 2.9
4170 { 'union': 'SocketAddress',
4171   'base': { 'type': 'SocketAddressType' },
4172   'discriminator': 'type',
4173   'data': { 'inet': 'InetSocketAddress',
4174             'unix': 'UnixSocketAddress',
4175             'vsock': 'VsockSocketAddress',
4176             'fd': 'String' } }
4179 # @getfd:
4181 # Receive a file descriptor via SCM rights and assign it a name
4183 # @fdname: file descriptor name
4185 # Returns: Nothing on success
4187 # Since: 0.14.0
4189 # Notes: If @fdname already exists, the file descriptor assigned to
4190 #        it will be closed and replaced by the received file
4191 #        descriptor.
4193 #        The 'closefd' command can be used to explicitly close the
4194 #        file descriptor when it is no longer needed.
4196 # Example:
4198 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4199 # <- { "return": {} }
4202 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4205 # @closefd:
4207 # Close a file descriptor previously passed via SCM rights
4209 # @fdname: file descriptor name
4211 # Returns: Nothing on success
4213 # Since: 0.14.0
4215 # Example:
4217 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4218 # <- { "return": {} }
4221 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4224 # @MachineInfo:
4226 # Information describing a machine.
4228 # @name: the name of the machine
4230 # @alias: an alias for the machine name
4232 # @is-default: whether the machine is default
4234 # @cpu-max: maximum number of CPUs supported by the machine type
4235 #           (since 1.5.0)
4237 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4239 # Since: 1.2.0
4241 { 'struct': 'MachineInfo',
4242   'data': { 'name': 'str', '*alias': 'str',
4243             '*is-default': 'bool', 'cpu-max': 'int',
4244             'hotpluggable-cpus': 'bool'} }
4247 # @query-machines:
4249 # Return a list of supported machines
4251 # Returns: a list of MachineInfo
4253 # Since: 1.2.0
4255 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4258 # @CpuDefinitionInfo:
4260 # Virtual CPU definition.
4262 # @name: the name of the CPU definition
4264 # @migration-safe: whether a CPU definition can be safely used for
4265 #                  migration in combination with a QEMU compatibility machine
4266 #                  when migrating between different QMU versions and between
4267 #                  hosts with different sets of (hardware or software)
4268 #                  capabilities. If not provided, information is not available
4269 #                  and callers should not assume the CPU definition to be
4270 #                  migration-safe. (since 2.8)
4272 # @static: whether a CPU definition is static and will not change depending on
4273 #          QEMU version, machine type, machine options and accelerator options.
4274 #          A static model is always migration-safe. (since 2.8)
4276 # @unavailable-features: List of properties that prevent
4277 #                        the CPU model from running in the current
4278 #                        host. (since 2.8)
4279 # @typename: Type name that can be used as argument to @device-list-properties,
4280 #            to introspect properties configurable using -cpu or -global.
4281 #            (since 2.9)
4283 # @unavailable-features is a list of QOM property names that
4284 # represent CPU model attributes that prevent the CPU from running.
4285 # If the QOM property is read-only, that means there's no known
4286 # way to make the CPU model run in the current host. Implementations
4287 # that choose not to provide specific information return the
4288 # property name "type".
4289 # If the property is read-write, it means that it MAY be possible
4290 # to run the CPU model in the current host if that property is
4291 # changed. Management software can use it as hints to suggest or
4292 # choose an alternative for the user, or just to generate meaningful
4293 # error messages explaining why the CPU model can't be used.
4294 # If @unavailable-features is an empty list, the CPU model is
4295 # runnable using the current host and machine-type.
4296 # If @unavailable-features is not present, runnability
4297 # information for the CPU is not available.
4299 # Since: 1.2.0
4301 { 'struct': 'CpuDefinitionInfo',
4302   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4303             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4306 # @query-cpu-definitions:
4308 # Return a list of supported virtual CPU definitions
4310 # Returns: a list of CpuDefInfo
4312 # Since: 1.2.0
4314 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4317 # @CpuModelInfo:
4319 # Virtual CPU model.
4321 # A CPU model consists of the name of a CPU definition, to which
4322 # delta changes are applied (e.g. features added/removed). Most magic values
4323 # that an architecture might require should be hidden behind the name.
4324 # However, if required, architectures can expose relevant properties.
4326 # @name: the name of the CPU definition the model is based on
4327 # @props: a dictionary of QOM properties to be applied
4329 # Since: 2.8.0
4331 { 'struct': 'CpuModelInfo',
4332   'data': { 'name': 'str',
4333             '*props': 'any' } }
4336 # @CpuModelExpansionType:
4338 # An enumeration of CPU model expansion types.
4340 # @static: Expand to a static CPU model, a combination of a static base
4341 #          model name and property delta changes. As the static base model will
4342 #          never change, the expanded CPU model will be the same, independant of
4343 #          independent of QEMU version, machine type, machine options, and
4344 #          accelerator options. Therefore, the resulting model can be used by
4345 #          tooling without having to specify a compatibility machine - e.g. when
4346 #          displaying the "host" model. static CPU models are migration-safe.
4348 # @full: Expand all properties. The produced model is not guaranteed to be
4349 #        migration-safe, but allows tooling to get an insight and work with
4350 #        model details.
4352 # Note: When a non-migration-safe CPU model is expanded in static mode, some
4353 # features enabled by the CPU model may be omitted, because they can't be
4354 # implemented by a static CPU model definition (e.g. cache info passthrough and
4355 # PMU passthrough in x86). If you need an accurate representation of the
4356 # features enabled by a non-migration-safe CPU model, use @full. If you need a
4357 # static representation that will keep ABI compatibility even when changing QEMU
4358 # version or machine-type, use @static (but keep in mind that some features may
4359 # be omitted).
4361 # Since: 2.8.0
4363 { 'enum': 'CpuModelExpansionType',
4364   'data': [ 'static', 'full' ] }
4368 # @CpuModelExpansionInfo:
4370 # The result of a cpu model expansion.
4372 # @model: the expanded CpuModelInfo.
4374 # Since: 2.8.0
4376 { 'struct': 'CpuModelExpansionInfo',
4377   'data': { 'model': 'CpuModelInfo' } }
4381 # @query-cpu-model-expansion:
4383 # Expands a given CPU model (or a combination of CPU model + additional options)
4384 # to different granularities, allowing tooling to get an understanding what a
4385 # specific CPU model looks like in QEMU under a certain configuration.
4387 # This interface can be used to query the "host" CPU model.
4389 # The data returned by this command may be affected by:
4391 # * QEMU version: CPU models may look different depending on the QEMU version.
4392 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4393 # * machine-type: CPU model  may look different depending on the machine-type.
4394 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4395 # * machine options (including accelerator): in some architectures, CPU models
4396 #   may look different depending on machine and accelerator options. (Except for
4397 #   CPU models reported as "static" in query-cpu-definitions.)
4398 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4399 #   global properties may affect expansion of CPU models. Using
4400 #   query-cpu-model-expansion while using these is not advised.
4402 # Some architectures may not support all expansion types. s390x supports
4403 # "full" and "static".
4405 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4406 #          not supported, if the model cannot be expanded, if the model contains
4407 #          an unknown CPU definition name, unknown properties or properties
4408 #          with a wrong type. Also returns an error if an expansion type is
4409 #          not supported.
4411 # Since: 2.8.0
4413 { 'command': 'query-cpu-model-expansion',
4414   'data': { 'type': 'CpuModelExpansionType',
4415             'model': 'CpuModelInfo' },
4416   'returns': 'CpuModelExpansionInfo' }
4419 # @CpuModelCompareResult:
4421 # An enumeration of CPU model comparation results. The result is usually
4422 # calculated using e.g. CPU features or CPU generations.
4424 # @incompatible: If model A is incompatible to model B, model A is not
4425 #                guaranteed to run where model B runs and the other way around.
4427 # @identical: If model A is identical to model B, model A is guaranteed to run
4428 #             where model B runs and the other way around.
4430 # @superset: If model A is a superset of model B, model B is guaranteed to run
4431 #            where model A runs. There are no guarantees about the other way.
4433 # @subset: If model A is a subset of model B, model A is guaranteed to run
4434 #          where model B runs. There are no guarantees about the other way.
4436 # Since: 2.8.0
4438 { 'enum': 'CpuModelCompareResult',
4439   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4442 # @CpuModelCompareInfo:
4444 # The result of a CPU model comparison.
4446 # @result: The result of the compare operation.
4447 # @responsible-properties: List of properties that led to the comparison result
4448 #                          not being identical.
4450 # @responsible-properties is a list of QOM property names that led to
4451 # both CPUs not being detected as identical. For identical models, this
4452 # list is empty.
4453 # If a QOM property is read-only, that means there's no known way to make the
4454 # CPU models identical. If the special property name "type" is included, the
4455 # models are by definition not identical and cannot be made identical.
4457 # Since: 2.8.0
4459 { 'struct': 'CpuModelCompareInfo',
4460   'data': {'result': 'CpuModelCompareResult',
4461            'responsible-properties': ['str']
4462           }
4466 # @query-cpu-model-comparison:
4468 # Compares two CPU models, returning how they compare in a specific
4469 # configuration. The results indicates how both models compare regarding
4470 # runnability. This result can be used by tooling to make decisions if a
4471 # certain CPU model will run in a certain configuration or if a compatible
4472 # CPU model has to be created by baselining.
4474 # Usually, a CPU model is compared against the maximum possible CPU model
4475 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4476 # model is identical or a subset, it will run in that configuration.
4478 # The result returned by this command may be affected by:
4480 # * QEMU version: CPU models may look different depending on the QEMU version.
4481 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4482 # * machine-type: CPU model may look different depending on the machine-type.
4483 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4484 # * machine options (including accelerator): in some architectures, CPU models
4485 #   may look different depending on machine and accelerator options. (Except for
4486 #   CPU models reported as "static" in query-cpu-definitions.)
4487 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4488 #   global properties may affect expansion of CPU models. Using
4489 #   query-cpu-model-expansion while using these is not advised.
4491 # Some architectures may not support comparing CPU models. s390x supports
4492 # comparing CPU models.
4494 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4495 #          not supported, if a model cannot be used, if a model contains
4496 #          an unknown cpu definition name, unknown properties or properties
4497 #          with wrong types.
4499 # Since: 2.8.0
4501 { 'command': 'query-cpu-model-comparison',
4502   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4503   'returns': 'CpuModelCompareInfo' }
4506 # @CpuModelBaselineInfo:
4508 # The result of a CPU model baseline.
4510 # @model: the baselined CpuModelInfo.
4512 # Since: 2.8.0
4514 { 'struct': 'CpuModelBaselineInfo',
4515   'data': { 'model': 'CpuModelInfo' } }
4518 # @query-cpu-model-baseline:
4520 # Baseline two CPU models, creating a compatible third model. The created
4521 # model will always be a static, migration-safe CPU model (see "static"
4522 # CPU model expansion for details).
4524 # This interface can be used by tooling to create a compatible CPU model out
4525 # two CPU models. The created CPU model will be identical to or a subset of
4526 # both CPU models when comparing them. Therefore, the created CPU model is
4527 # guaranteed to run where the given CPU models run.
4529 # The result returned by this command may be affected by:
4531 # * QEMU version: CPU models may look different depending on the QEMU version.
4532 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4533 # * machine-type: CPU model may look different depending on the machine-type.
4534 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4535 # * machine options (including accelerator): in some architectures, CPU models
4536 #   may look different depending on machine and accelerator options. (Except for
4537 #   CPU models reported as "static" in query-cpu-definitions.)
4538 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4539 #   global properties may affect expansion of CPU models. Using
4540 #   query-cpu-model-expansion while using these is not advised.
4542 # Some architectures may not support baselining CPU models. s390x supports
4543 # baselining CPU models.
4545 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4546 #          not supported, if a model cannot be used, if a model contains
4547 #          an unknown cpu definition name, unknown properties or properties
4548 #          with wrong types.
4550 # Since: 2.8.0
4552 { 'command': 'query-cpu-model-baseline',
4553   'data': { 'modela': 'CpuModelInfo',
4554             'modelb': 'CpuModelInfo' },
4555   'returns': 'CpuModelBaselineInfo' }
4558 # @AddfdInfo:
4560 # Information about a file descriptor that was added to an fd set.
4562 # @fdset-id: The ID of the fd set that @fd was added to.
4564 # @fd: The file descriptor that was received via SCM rights and
4565 #      added to the fd set.
4567 # Since: 1.2.0
4569 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4572 # @add-fd:
4574 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4576 # @fdset-id: The ID of the fd set to add the file descriptor to.
4578 # @opaque: A free-form string that can be used to describe the fd.
4580 # Returns: @AddfdInfo on success
4582 #          If file descriptor was not received, FdNotSupplied
4584 #          If @fdset-id is a negative value, InvalidParameterValue
4586 # Notes: The list of fd sets is shared by all monitor connections.
4588 #        If @fdset-id is not specified, a new fd set will be created.
4590 # Since: 1.2.0
4592 # Example:
4594 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4595 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4598 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4599   'returns': 'AddfdInfo' }
4602 # @remove-fd:
4604 # Remove a file descriptor from an fd set.
4606 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4608 # @fd: The file descriptor that is to be removed.
4610 # Returns: Nothing on success
4611 #          If @fdset-id or @fd is not found, FdNotFound
4613 # Since: 1.2.0
4615 # Notes: The list of fd sets is shared by all monitor connections.
4617 #        If @fd is not specified, all file descriptors in @fdset-id
4618 #        will be removed.
4620 # Example:
4622 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4623 # <- { "return": {} }
4626 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4629 # @FdsetFdInfo:
4631 # Information about a file descriptor that belongs to an fd set.
4633 # @fd: The file descriptor value.
4635 # @opaque: A free-form string that can be used to describe the fd.
4637 # Since: 1.2.0
4639 { 'struct': 'FdsetFdInfo',
4640   'data': {'fd': 'int', '*opaque': 'str'} }
4643 # @FdsetInfo:
4645 # Information about an fd set.
4647 # @fdset-id: The ID of the fd set.
4649 # @fds: A list of file descriptors that belong to this fd set.
4651 # Since: 1.2.0
4653 { 'struct': 'FdsetInfo',
4654   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4657 # @query-fdsets:
4659 # Return information describing all fd sets.
4661 # Returns: A list of @FdsetInfo
4663 # Since: 1.2.0
4665 # Note: The list of fd sets is shared by all monitor connections.
4667 # Example:
4669 # -> { "execute": "query-fdsets" }
4670 # <- { "return": [
4671 #        {
4672 #          "fds": [
4673 #            {
4674 #              "fd": 30,
4675 #              "opaque": "rdonly:/path/to/file"
4676 #            },
4677 #            {
4678 #              "fd": 24,
4679 #              "opaque": "rdwr:/path/to/file"
4680 #            }
4681 #          ],
4682 #          "fdset-id": 1
4683 #        },
4684 #        {
4685 #          "fds": [
4686 #            {
4687 #              "fd": 28
4688 #            },
4689 #            {
4690 #              "fd": 29
4691 #            }
4692 #          ],
4693 #          "fdset-id": 0
4694 #        }
4695 #      ]
4696 #    }
4699 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4702 # @TargetInfo:
4704 # Information describing the QEMU target.
4706 # @arch: the target architecture (eg "x86_64", "i386", etc)
4708 # Since: 1.2.0
4710 { 'struct': 'TargetInfo',
4711   'data': { 'arch': 'str' } }
4714 # @query-target:
4716 # Return information about the target for this QEMU
4718 # Returns: TargetInfo
4720 # Since: 1.2.0
4722 { 'command': 'query-target', 'returns': 'TargetInfo' }
4725 # @QKeyCode:
4727 # An enumeration of key name.
4729 # This is used by the @send-key command.
4731 # @unmapped: since 2.0
4732 # @pause: since 2.0
4733 # @ro: since 2.4
4734 # @kp_comma: since 2.4
4735 # @kp_equals: since 2.6
4736 # @power: since 2.6
4737 # @hiragana: since 2.9
4738 # @henkan: since 2.9
4739 # @yen: since 2.9
4741 # Since: 1.3.0
4744 { 'enum': 'QKeyCode',
4745   'data': [ 'unmapped',
4746             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
4747             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4748             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4749             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4750             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4751             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4752             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4753             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4754             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4755             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4756             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4757             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4758             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4759             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4760             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4761             'ro', 'hiragana', 'henkan', 'yen',
4762             'kp_comma', 'kp_equals', 'power' ] }
4765 # @KeyValue:
4767 # Represents a keyboard key.
4769 # Since: 1.3.0
4771 { 'union': 'KeyValue',
4772   'data': {
4773     'number': 'int',
4774     'qcode': 'QKeyCode' } }
4777 # @send-key:
4779 # Send keys to guest.
4781 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4782 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4783 #        directly to the guest, while @KeyValue.qcode must be a valid
4784 #        @QKeyCode value
4786 # @hold-time: time to delay key up events, milliseconds. Defaults
4787 #             to 100
4789 # Returns: Nothing on success
4790 #          If key is unknown or redundant, InvalidParameter
4792 # Since: 1.3.0
4794 # Example:
4796 # -> { "execute": "send-key",
4797 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4798 #                               { "type": "qcode", "data": "alt" },
4799 #                               { "type": "qcode", "data": "delete" } ] } }
4800 # <- { "return": {} }
4803 { 'command': 'send-key',
4804   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4807 # @screendump:
4809 # Write a PPM of the VGA screen to a file.
4811 # @filename: the path of a new PPM file to store the image
4813 # Returns: Nothing on success
4815 # Since: 0.14.0
4817 # Example:
4819 # -> { "execute": "screendump",
4820 #      "arguments": { "filename": "/tmp/image" } }
4821 # <- { "return": {} }
4824 { 'command': 'screendump', 'data': {'filename': 'str'} }
4828 # @ChardevCommon:
4830 # Configuration shared across all chardev backends
4832 # @logfile: The name of a logfile to save output
4833 # @logappend: true to append instead of truncate
4834 #             (default to false to truncate)
4836 # Since: 2.6
4838 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4839                                        '*logappend': 'bool' } }
4842 # @ChardevFile:
4844 # Configuration info for file chardevs.
4846 # @in:  The name of the input file
4847 # @out: The name of the output file
4848 # @append: Open the file in append mode (default false to
4849 #          truncate) (Since 2.6)
4851 # Since: 1.4
4853 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4854                                    'out' : 'str',
4855                                    '*append': 'bool' },
4856   'base': 'ChardevCommon' }
4859 # @ChardevHostdev:
4861 # Configuration info for device and pipe chardevs.
4863 # @device: The name of the special file for the device,
4864 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4866 # Since: 1.4
4868 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4869   'base': 'ChardevCommon' }
4872 # @ChardevSocket:
4874 # Configuration info for (stream) socket chardevs.
4876 # @addr: socket address to listen on (server=true)
4877 #        or connect to (server=false)
4878 # @tls-creds: the ID of the TLS credentials object (since 2.6)
4879 # @server: create server socket (default: true)
4880 # @wait: wait for incoming connection on server
4881 #        sockets (default: false).
4882 # @nodelay: set TCP_NODELAY socket option (default: false)
4883 # @telnet: enable telnet protocol on server
4884 #          sockets (default: false)
4885 # @tn3270: enable tn3270 protocol on server
4886 #          sockets (default: false) (Since: 2.10)
4887 # @reconnect: For a client socket, if a socket is disconnected,
4888 #          then attempt a reconnect after the given number of seconds.
4889 #          Setting this to zero disables this function. (default: 0)
4890 #          (Since: 2.2)
4892 # Since: 1.4
4894 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddressLegacy',
4895                                      '*tls-creds'  : 'str',
4896                                      '*server'    : 'bool',
4897                                      '*wait'      : 'bool',
4898                                      '*nodelay'   : 'bool',
4899                                      '*telnet'    : 'bool',
4900                                      '*tn3270'    : 'bool',
4901                                      '*reconnect' : 'int' },
4902   'base': 'ChardevCommon' }
4905 # @ChardevUdp:
4907 # Configuration info for datagram socket chardevs.
4909 # @remote: remote address
4910 # @local: local address
4912 # Since: 1.5
4914 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
4915                                   '*local' : 'SocketAddressLegacy' },
4916   'base': 'ChardevCommon' }
4919 # @ChardevMux:
4921 # Configuration info for mux chardevs.
4923 # @chardev: name of the base chardev.
4925 # Since: 1.5
4927 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
4928   'base': 'ChardevCommon' }
4931 # @ChardevStdio:
4933 # Configuration info for stdio chardevs.
4935 # @signal: Allow signals (such as SIGINT triggered by ^C)
4936 #          be delivered to qemu.  Default: true in -nographic mode,
4937 #          false otherwise.
4939 # Since: 1.5
4941 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
4942   'base': 'ChardevCommon' }
4946 # @ChardevSpiceChannel:
4948 # Configuration info for spice vm channel chardevs.
4950 # @type: kind of channel (for example vdagent).
4952 # Since: 1.5
4954 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
4955   'base': 'ChardevCommon' }
4958 # @ChardevSpicePort:
4960 # Configuration info for spice port chardevs.
4962 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
4964 # Since: 1.5
4966 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
4967   'base': 'ChardevCommon' }
4970 # @ChardevVC:
4972 # Configuration info for virtual console chardevs.
4974 # @width:  console width,  in pixels
4975 # @height: console height, in pixels
4976 # @cols:   console width,  in chars
4977 # @rows:   console height, in chars
4979 # Since: 1.5
4981 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
4982                                  '*height' : 'int',
4983                                  '*cols'   : 'int',
4984                                  '*rows'   : 'int' },
4985   'base': 'ChardevCommon' }
4988 # @ChardevRingbuf:
4990 # Configuration info for ring buffer chardevs.
4992 # @size: ring buffer size, must be power of two, default is 65536
4994 # Since: 1.5
4996 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
4997   'base': 'ChardevCommon' }
5000 # @ChardevBackend:
5002 # Configuration info for the new chardev backend.
5004 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
5006 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
5007                                        'serial' : 'ChardevHostdev',
5008                                        'parallel': 'ChardevHostdev',
5009                                        'pipe'   : 'ChardevHostdev',
5010                                        'socket' : 'ChardevSocket',
5011                                        'udp'    : 'ChardevUdp',
5012                                        'pty'    : 'ChardevCommon',
5013                                        'null'   : 'ChardevCommon',
5014                                        'mux'    : 'ChardevMux',
5015                                        'msmouse': 'ChardevCommon',
5016                                        'wctablet' : 'ChardevCommon',
5017                                        'braille': 'ChardevCommon',
5018                                        'testdev': 'ChardevCommon',
5019                                        'stdio'  : 'ChardevStdio',
5020                                        'console': 'ChardevCommon',
5021                                        'spicevmc' : 'ChardevSpiceChannel',
5022                                        'spiceport' : 'ChardevSpicePort',
5023                                        'vc'     : 'ChardevVC',
5024                                        'ringbuf': 'ChardevRingbuf',
5025                                        # next one is just for compatibility
5026                                        'memory' : 'ChardevRingbuf' } }
5029 # @ChardevReturn:
5031 # Return info about the chardev backend just created.
5033 # @pty: name of the slave pseudoterminal device, present if
5034 #       and only if a chardev of type 'pty' was created
5036 # Since: 1.4
5038 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
5041 # @chardev-add:
5043 # Add a character device backend
5045 # @id: the chardev's ID, must be unique
5046 # @backend: backend type and parameters
5048 # Returns: ChardevReturn.
5050 # Since: 1.4
5052 # Example:
5054 # -> { "execute" : "chardev-add",
5055 #      "arguments" : { "id" : "foo",
5056 #                      "backend" : { "type" : "null", "data" : {} } } }
5057 # <- { "return": {} }
5059 # -> { "execute" : "chardev-add",
5060 #      "arguments" : { "id" : "bar",
5061 #                      "backend" : { "type" : "file",
5062 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
5063 # <- { "return": {} }
5065 # -> { "execute" : "chardev-add",
5066 #      "arguments" : { "id" : "baz",
5067 #                      "backend" : { "type" : "pty", "data" : {} } } }
5068 # <- { "return": { "pty" : "/dev/pty/42" } }
5071 { 'command': 'chardev-add', 'data': {'id'      : 'str',
5072                                      'backend' : 'ChardevBackend' },
5073   'returns': 'ChardevReturn' }
5076 # @chardev-remove:
5078 # Remove a character device backend
5080 # @id: the chardev's ID, must exist and not be in use
5082 # Returns: Nothing on success
5084 # Since: 1.4
5086 # Example:
5088 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
5089 # <- { "return": {} }
5092 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
5095 # @TpmModel:
5097 # An enumeration of TPM models
5099 # @tpm-tis: TPM TIS model
5101 # Since: 1.5
5103 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
5106 # @query-tpm-models:
5108 # Return a list of supported TPM models
5110 # Returns: a list of TpmModel
5112 # Since: 1.5
5114 # Example:
5116 # -> { "execute": "query-tpm-models" }
5117 # <- { "return": [ "tpm-tis" ] }
5120 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5123 # @TpmType:
5125 # An enumeration of TPM types
5127 # @passthrough: TPM passthrough type
5129 # Since: 1.5
5131 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5134 # @query-tpm-types:
5136 # Return a list of supported TPM types
5138 # Returns: a list of TpmType
5140 # Since: 1.5
5142 # Example:
5144 # -> { "execute": "query-tpm-types" }
5145 # <- { "return": [ "passthrough" ] }
5148 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5151 # @TPMPassthroughOptions:
5153 # Information about the TPM passthrough type
5155 # @path: string describing the path used for accessing the TPM device
5157 # @cancel-path: string showing the TPM's sysfs cancel file
5158 #               for cancellation of TPM commands while they are executing
5160 # Since: 1.5
5162 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
5163                                              '*cancel-path' : 'str'} }
5166 # @TpmTypeOptions:
5168 # A union referencing different TPM backend types' configuration options
5170 # @type: 'passthrough' The configuration options for the TPM passthrough type
5172 # Since: 1.5
5174 { 'union': 'TpmTypeOptions',
5175    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
5178 # @TPMInfo:
5180 # Information about the TPM
5182 # @id: The Id of the TPM
5184 # @model: The TPM frontend model
5186 # @options: The TPM (backend) type configuration options
5188 # Since: 1.5
5190 { 'struct': 'TPMInfo',
5191   'data': {'id': 'str',
5192            'model': 'TpmModel',
5193            'options': 'TpmTypeOptions' } }
5196 # @query-tpm:
5198 # Return information about the TPM device
5200 # Returns: @TPMInfo on success
5202 # Since: 1.5
5204 # Example:
5206 # -> { "execute": "query-tpm" }
5207 # <- { "return":
5208 #      [
5209 #        { "model": "tpm-tis",
5210 #          "options":
5211 #            { "type": "passthrough",
5212 #              "data":
5213 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5214 #                  "path": "/dev/tpm0"
5215 #                }
5216 #            },
5217 #          "id": "tpm0"
5218 #        }
5219 #      ]
5220 #    }
5223 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5226 # @AcpiTableOptions:
5228 # Specify an ACPI table on the command line to load.
5230 # At most one of @file and @data can be specified. The list of files specified
5231 # by any one of them is loaded and concatenated in order. If both are omitted,
5232 # @data is implied.
5234 # Other fields / optargs can be used to override fields of the generic ACPI
5235 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5236 # Description Table Header. If a header field is not overridden, then the
5237 # corresponding value from the concatenated blob is used (in case of @file), or
5238 # it is filled in with a hard-coded value (in case of @data).
5240 # String fields are copied into the matching ACPI member from lowest address
5241 # upwards, and silently truncated / NUL-padded to length.
5243 # @sig: table signature / identifier (4 bytes)
5245 # @rev: table revision number (dependent on signature, 1 byte)
5247 # @oem_id: OEM identifier (6 bytes)
5249 # @oem_table_id: OEM table identifier (8 bytes)
5251 # @oem_rev: OEM-supplied revision number (4 bytes)
5253 # @asl_compiler_id: identifier of the utility that created the table
5254 #                   (4 bytes)
5256 # @asl_compiler_rev: revision number of the utility that created the
5257 #                    table (4 bytes)
5259 # @file: colon (:) separated list of pathnames to load and
5260 #        concatenate as table data. The resultant binary blob is expected to
5261 #        have an ACPI table header. At least one file is required. This field
5262 #        excludes @data.
5264 # @data: colon (:) separated list of pathnames to load and
5265 #        concatenate as table data. The resultant binary blob must not have an
5266 #        ACPI table header. At least one file is required. This field excludes
5267 #        @file.
5269 # Since: 1.5
5271 { 'struct': 'AcpiTableOptions',
5272   'data': {
5273     '*sig':               'str',
5274     '*rev':               'uint8',
5275     '*oem_id':            'str',
5276     '*oem_table_id':      'str',
5277     '*oem_rev':           'uint32',
5278     '*asl_compiler_id':   'str',
5279     '*asl_compiler_rev':  'uint32',
5280     '*file':              'str',
5281     '*data':              'str' }}
5284 # @CommandLineParameterType:
5286 # Possible types for an option parameter.
5288 # @string: accepts a character string
5290 # @boolean: accepts "on" or "off"
5292 # @number: accepts a number
5294 # @size: accepts a number followed by an optional suffix (K)ilo,
5295 #        (M)ega, (G)iga, (T)era
5297 # Since: 1.5
5299 { 'enum': 'CommandLineParameterType',
5300   'data': ['string', 'boolean', 'number', 'size'] }
5303 # @CommandLineParameterInfo:
5305 # Details about a single parameter of a command line option.
5307 # @name: parameter name
5309 # @type: parameter @CommandLineParameterType
5311 # @help: human readable text string, not suitable for parsing.
5313 # @default: default value string (since 2.1)
5315 # Since: 1.5
5317 { 'struct': 'CommandLineParameterInfo',
5318   'data': { 'name': 'str',
5319             'type': 'CommandLineParameterType',
5320             '*help': 'str',
5321             '*default': 'str' } }
5324 # @CommandLineOptionInfo:
5326 # Details about a command line option, including its list of parameter details
5328 # @option: option name
5330 # @parameters: an array of @CommandLineParameterInfo
5332 # Since: 1.5
5334 { 'struct': 'CommandLineOptionInfo',
5335   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5338 # @query-command-line-options:
5340 # Query command line option schema.
5342 # @option: option name
5344 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5345 #          @option).  Returns an error if the given @option doesn't exist.
5347 # Since: 1.5
5349 # Example:
5351 # -> { "execute": "query-command-line-options",
5352 #      "arguments": { "option": "option-rom" } }
5353 # <- { "return": [
5354 #         {
5355 #             "parameters": [
5356 #                 {
5357 #                     "name": "romfile",
5358 #                     "type": "string"
5359 #                 },
5360 #                 {
5361 #                     "name": "bootindex",
5362 #                     "type": "number"
5363 #                 }
5364 #             ],
5365 #             "option": "option-rom"
5366 #         }
5367 #      ]
5368 #    }
5371 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5372  'returns': ['CommandLineOptionInfo'] }
5375 # @X86CPURegister32:
5377 # A X86 32-bit register
5379 # Since: 1.5
5381 { 'enum': 'X86CPURegister32',
5382   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5385 # @X86CPUFeatureWordInfo:
5387 # Information about a X86 CPU feature word
5389 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5391 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
5392 #                   feature word
5394 # @cpuid-register: Output register containing the feature bits
5396 # @features: value of output register, containing the feature bits
5398 # Since: 1.5
5400 { 'struct': 'X86CPUFeatureWordInfo',
5401   'data': { 'cpuid-input-eax': 'int',
5402             '*cpuid-input-ecx': 'int',
5403             'cpuid-register': 'X86CPURegister32',
5404             'features': 'int' } }
5407 # @DummyForceArrays:
5409 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5411 # Since: 2.5
5413 { 'struct': 'DummyForceArrays',
5414   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5418 # @RxState:
5420 # Packets receiving state
5422 # @normal: filter assigned packets according to the mac-table
5424 # @none: don't receive any assigned packet
5426 # @all: receive all assigned packets
5428 # Since: 1.6
5430 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5433 # @RxFilterInfo:
5435 # Rx-filter information for a NIC.
5437 # @name: net client name
5439 # @promiscuous: whether promiscuous mode is enabled
5441 # @multicast: multicast receive state
5443 # @unicast: unicast receive state
5445 # @vlan: vlan receive state (Since 2.0)
5447 # @broadcast-allowed: whether to receive broadcast
5449 # @multicast-overflow: multicast table is overflowed or not
5451 # @unicast-overflow: unicast table is overflowed or not
5453 # @main-mac: the main macaddr string
5455 # @vlan-table: a list of active vlan id
5457 # @unicast-table: a list of unicast macaddr string
5459 # @multicast-table: a list of multicast macaddr string
5461 # Since: 1.6
5463 { 'struct': 'RxFilterInfo',
5464   'data': {
5465     'name':               'str',
5466     'promiscuous':        'bool',
5467     'multicast':          'RxState',
5468     'unicast':            'RxState',
5469     'vlan':               'RxState',
5470     'broadcast-allowed':  'bool',
5471     'multicast-overflow': 'bool',
5472     'unicast-overflow':   'bool',
5473     'main-mac':           'str',
5474     'vlan-table':         ['int'],
5475     'unicast-table':      ['str'],
5476     'multicast-table':    ['str'] }}
5479 # @query-rx-filter:
5481 # Return rx-filter information for all NICs (or for the given NIC).
5483 # @name: net client name
5485 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5486 #          Returns an error if the given @name doesn't exist, or given
5487 #          NIC doesn't support rx-filter querying, or given net client
5488 #          isn't a NIC.
5490 # Since: 1.6
5492 # Example:
5494 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5495 # <- { "return": [
5496 #         {
5497 #             "promiscuous": true,
5498 #             "name": "vnet0",
5499 #             "main-mac": "52:54:00:12:34:56",
5500 #             "unicast": "normal",
5501 #             "vlan": "normal",
5502 #             "vlan-table": [
5503 #                 4,
5504 #                 0
5505 #             ],
5506 #             "unicast-table": [
5507 #             ],
5508 #             "multicast": "normal",
5509 #             "multicast-overflow": false,
5510 #             "unicast-overflow": false,
5511 #             "multicast-table": [
5512 #                 "01:00:5e:00:00:01",
5513 #                 "33:33:00:00:00:01",
5514 #                 "33:33:ff:12:34:56"
5515 #             ],
5516 #             "broadcast-allowed": false
5517 #         }
5518 #       ]
5519 #    }
5522 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5523   'returns': ['RxFilterInfo'] }
5526 # @InputButton:
5528 # Button of a pointer input device (mouse, tablet).
5530 # @side: front side button of a 5-button mouse (since 2.9)
5532 # @extra: rear side button of a 5-button mouse (since 2.9)
5534 # Since: 2.0
5536 { 'enum'  : 'InputButton',
5537   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5538   'extra' ] }
5541 # @InputAxis:
5543 # Position axis of a pointer input device (mouse, tablet).
5545 # Since: 2.0
5547 { 'enum'  : 'InputAxis',
5548   'data'  : [ 'x', 'y' ] }
5551 # @InputKeyEvent:
5553 # Keyboard input event.
5555 # @key:    Which key this event is for.
5556 # @down:   True for key-down and false for key-up events.
5558 # Since: 2.0
5560 { 'struct'  : 'InputKeyEvent',
5561   'data'  : { 'key'     : 'KeyValue',
5562               'down'    : 'bool' } }
5565 # @InputBtnEvent:
5567 # Pointer button input event.
5569 # @button: Which button this event is for.
5570 # @down:   True for key-down and false for key-up events.
5572 # Since: 2.0
5574 { 'struct'  : 'InputBtnEvent',
5575   'data'  : { 'button'  : 'InputButton',
5576               'down'    : 'bool' } }
5579 # @InputMoveEvent:
5581 # Pointer motion input event.
5583 # @axis:   Which axis is referenced by @value.
5584 # @value:  Pointer position.  For absolute coordinates the
5585 #          valid range is 0 -> 0x7ffff
5587 # Since: 2.0
5589 { 'struct'  : 'InputMoveEvent',
5590   'data'  : { 'axis'    : 'InputAxis',
5591               'value'   : 'int' } }
5594 # @InputEvent:
5596 # Input event union.
5598 # @type: the input type, one of:
5599 #  - 'key': Input event of Keyboard
5600 #  - 'btn': Input event of pointer buttons
5601 #  - 'rel': Input event of relative pointer motion
5602 #  - 'abs': Input event of absolute pointer motion
5604 # Since: 2.0
5606 { 'union' : 'InputEvent',
5607   'data'  : { 'key'     : 'InputKeyEvent',
5608               'btn'     : 'InputBtnEvent',
5609               'rel'     : 'InputMoveEvent',
5610               'abs'     : 'InputMoveEvent' } }
5613 # @input-send-event:
5615 # Send input event(s) to guest.
5617 # @device: display device to send event(s) to.
5618 # @head: head to send event(s) to, in case the
5619 #        display device supports multiple scanouts.
5620 # @events: List of InputEvent union.
5622 # Returns: Nothing on success.
5624 # The @device and @head parameters can be used to send the input event
5625 # to specific input devices in case (a) multiple input devices of the
5626 # same kind are added to the virtual machine and (b) you have
5627 # configured input routing (see docs/multiseat.txt) for those input
5628 # devices.  The parameters work exactly like the device and head
5629 # properties of input devices.  If @device is missing, only devices
5630 # that have no input routing config are admissible.  If @device is
5631 # specified, both input devices with and without input routing config
5632 # are admissible, but devices with input routing config take
5633 # precedence.
5635 # Since: 2.6
5637 # Note: The consoles are visible in the qom tree, under
5638 # /backend/console[$index]. They have a device link and head property,
5639 # so it is possible to map which console belongs to which device and
5640 # display.
5642 # Example:
5644 # 1. Press left mouse button.
5646 # -> { "execute": "input-send-event",
5647 #     "arguments": { "device": "video0",
5648 #                    "events": [ { "type": "btn",
5649 #                    "data" : { "down": true, "button": "left" } } ] } }
5650 # <- { "return": {} }
5652 # -> { "execute": "input-send-event",
5653 #     "arguments": { "device": "video0",
5654 #                    "events": [ { "type": "btn",
5655 #                    "data" : { "down": false, "button": "left" } } ] } }
5656 # <- { "return": {} }
5658 # 2. Press ctrl-alt-del.
5660 # -> { "execute": "input-send-event",
5661 #      "arguments": { "events": [
5662 #         { "type": "key", "data" : { "down": true,
5663 #           "key": {"type": "qcode", "data": "ctrl" } } },
5664 #         { "type": "key", "data" : { "down": true,
5665 #           "key": {"type": "qcode", "data": "alt" } } },
5666 #         { "type": "key", "data" : { "down": true,
5667 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5668 # <- { "return": {} }
5670 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5672 # -> { "execute": "input-send-event" ,
5673 #   "arguments": { "events": [
5674 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5675 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5676 # <- { "return": {} }
5679 { 'command': 'input-send-event',
5680   'data': { '*device': 'str',
5681             '*head'  : 'int',
5682             'events' : [ 'InputEvent' ] } }
5685 # @NumaOptionsType:
5687 # @node: NUMA nodes configuration
5689 # @dist: NUMA distance configuration (since 2.10)
5691 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
5693 # Since: 2.1
5695 { 'enum': 'NumaOptionsType',
5696   'data': [ 'node', 'dist', 'cpu' ] }
5699 # @NumaOptions:
5701 # A discriminated record of NUMA options. (for OptsVisitor)
5703 # Since: 2.1
5705 { 'union': 'NumaOptions',
5706   'base': { 'type': 'NumaOptionsType' },
5707   'discriminator': 'type',
5708   'data': {
5709     'node': 'NumaNodeOptions',
5710     'dist': 'NumaDistOptions',
5711     'cpu': 'NumaCpuOptions' }}
5714 # @NumaNodeOptions:
5716 # Create a guest NUMA node. (for OptsVisitor)
5718 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
5720 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
5721 #         if omitted)
5723 # @mem: memory size of this node; mutually exclusive with @memdev.
5724 #       Equally divide total memory among nodes if both @mem and @memdev are
5725 #       omitted.
5727 # @memdev: memory backend object.  If specified for one node,
5728 #          it must be specified for all nodes.
5730 # Since: 2.1
5732 { 'struct': 'NumaNodeOptions',
5733   'data': {
5734    '*nodeid': 'uint16',
5735    '*cpus':   ['uint16'],
5736    '*mem':    'size',
5737    '*memdev': 'str' }}
5740 # @NumaDistOptions:
5742 # Set the distance between 2 NUMA nodes.
5744 # @src: source NUMA node.
5746 # @dst: destination NUMA node.
5748 # @val: NUMA distance from source node to destination node.
5749 #       When a node is unreachable from another node, set the distance
5750 #       between them to 255.
5752 # Since: 2.10
5754 { 'struct': 'NumaDistOptions',
5755   'data': {
5756    'src': 'uint16',
5757    'dst': 'uint16',
5758    'val': 'uint8' }}
5761 # @NumaCpuOptions:
5763 # Option "-numa cpu" overrides default cpu to node mapping.
5764 # It accepts the same set of cpu properties as returned by
5765 # query-hotpluggable-cpus[].props, where node-id could be used to
5766 # override default node mapping.
5768 # Since: 2.10
5770 { 'struct': 'NumaCpuOptions',
5771    'base': 'CpuInstanceProperties',
5772    'data' : {} }
5775 # @HostMemPolicy:
5777 # Host memory policy types
5779 # @default: restore default policy, remove any nondefault policy
5781 # @preferred: set the preferred host nodes for allocation
5783 # @bind: a strict policy that restricts memory allocation to the
5784 #        host nodes specified
5786 # @interleave: memory allocations are interleaved across the set
5787 #              of host nodes specified
5789 # Since: 2.1
5791 { 'enum': 'HostMemPolicy',
5792   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5795 # @Memdev:
5797 # Information about memory backend
5799 # @id: backend's ID if backend has 'id' property (since 2.9)
5801 # @size: memory backend size
5803 # @merge: enables or disables memory merge support
5805 # @dump: includes memory backend's memory in a core dump or not
5807 # @prealloc: enables or disables memory preallocation
5809 # @host-nodes: host nodes for its memory policy
5811 # @policy: memory policy of memory backend
5813 # Since: 2.1
5815 { 'struct': 'Memdev',
5816   'data': {
5817     '*id':        'str',
5818     'size':       'size',
5819     'merge':      'bool',
5820     'dump':       'bool',
5821     'prealloc':   'bool',
5822     'host-nodes': ['uint16'],
5823     'policy':     'HostMemPolicy' }}
5826 # @query-memdev:
5828 # Returns information for all memory backends.
5830 # Returns: a list of @Memdev.
5832 # Since: 2.1
5834 # Example:
5836 # -> { "execute": "query-memdev" }
5837 # <- { "return": [
5838 #        {
5839 #          "id": "mem1",
5840 #          "size": 536870912,
5841 #          "merge": false,
5842 #          "dump": true,
5843 #          "prealloc": false,
5844 #          "host-nodes": [0, 1],
5845 #          "policy": "bind"
5846 #        },
5847 #        {
5848 #          "size": 536870912,
5849 #          "merge": false,
5850 #          "dump": true,
5851 #          "prealloc": true,
5852 #          "host-nodes": [2, 3],
5853 #          "policy": "preferred"
5854 #        }
5855 #      ]
5856 #    }
5859 { 'command': 'query-memdev', 'returns': ['Memdev'] }
5862 # @PCDIMMDeviceInfo:
5864 # PCDIMMDevice state information
5866 # @id: device's ID
5868 # @addr: physical address, where device is mapped
5870 # @size: size of memory that the device provides
5872 # @slot: slot number at which device is plugged in
5874 # @node: NUMA node number where device is plugged in
5876 # @memdev: memory backend linked with device
5878 # @hotplugged: true if device was hotplugged
5880 # @hotpluggable: true if device if could be added/removed while machine is running
5882 # Since: 2.1
5884 { 'struct': 'PCDIMMDeviceInfo',
5885   'data': { '*id': 'str',
5886             'addr': 'int',
5887             'size': 'int',
5888             'slot': 'int',
5889             'node': 'int',
5890             'memdev': 'str',
5891             'hotplugged': 'bool',
5892             'hotpluggable': 'bool'
5893           }
5897 # @MemoryDeviceInfo:
5899 # Union containing information about a memory device
5901 # Since: 2.1
5903 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
5906 # @query-memory-devices:
5908 # Lists available memory devices and their state
5910 # Since: 2.1
5912 # Example:
5914 # -> { "execute": "query-memory-devices" }
5915 # <- { "return": [ { "data":
5916 #                       { "addr": 5368709120,
5917 #                         "hotpluggable": true,
5918 #                         "hotplugged": true,
5919 #                         "id": "d1",
5920 #                         "memdev": "/objects/memX",
5921 #                         "node": 0,
5922 #                         "size": 1073741824,
5923 #                         "slot": 0},
5924 #                    "type": "dimm"
5925 #                  } ] }
5928 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
5931 # @ACPISlotType:
5933 # @DIMM: memory slot
5934 # @CPU: logical CPU slot (since 2.7)
5936 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
5939 # @ACPIOSTInfo:
5941 # OSPM Status Indication for a device
5942 # For description of possible values of @source and @status fields
5943 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
5945 # @device: device ID associated with slot
5947 # @slot: slot ID, unique per slot of a given @slot-type
5949 # @slot-type: type of the slot
5951 # @source: an integer containing the source event
5953 # @status: an integer containing the status code
5955 # Since: 2.1
5957 { 'struct': 'ACPIOSTInfo',
5958   'data'  : { '*device': 'str',
5959               'slot': 'str',
5960               'slot-type': 'ACPISlotType',
5961               'source': 'int',
5962               'status': 'int' } }
5965 # @query-acpi-ospm-status:
5967 # Return a list of ACPIOSTInfo for devices that support status
5968 # reporting via ACPI _OST method.
5970 # Since: 2.1
5972 # Example:
5974 # -> { "execute": "query-acpi-ospm-status" }
5975 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
5976 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
5977 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
5978 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
5979 #    ]}
5982 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
5985 # @WatchdogExpirationAction:
5987 # An enumeration of the actions taken when the watchdog device's timer is
5988 # expired
5990 # @reset: system resets
5992 # @shutdown: system shutdown, note that it is similar to @powerdown, which
5993 #            tries to set to system status and notify guest
5995 # @poweroff: system poweroff, the emulator program exits
5997 # @pause: system pauses, similar to @stop
5999 # @debug: system enters debug state
6001 # @none: nothing is done
6003 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
6004 #              VCPUS on x86) (since 2.4)
6006 # Since: 2.1
6008 { 'enum': 'WatchdogExpirationAction',
6009   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
6010             'inject-nmi' ] }
6013 # @IoOperationType:
6015 # An enumeration of the I/O operation types
6017 # @read: read operation
6019 # @write: write operation
6021 # Since: 2.1
6023 { 'enum': 'IoOperationType',
6024   'data': [ 'read', 'write' ] }
6027 # @GuestPanicAction:
6029 # An enumeration of the actions taken when guest OS panic is detected
6031 # @pause: system pauses
6033 # Since: 2.1 (poweroff since 2.8)
6035 { 'enum': 'GuestPanicAction',
6036   'data': [ 'pause', 'poweroff' ] }
6039 # @GuestPanicInformationType:
6041 # An enumeration of the guest panic information types
6043 # Since: 2.9
6045 { 'enum': 'GuestPanicInformationType',
6046   'data': [ 'hyper-v'] }
6049 # @GuestPanicInformation:
6051 # Information about a guest panic
6053 # Since: 2.9
6055 {'union': 'GuestPanicInformation',
6056  'base': {'type': 'GuestPanicInformationType'},
6057  'discriminator': 'type',
6058  'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
6061 # @GuestPanicInformationHyperV:
6063 # Hyper-V specific guest panic information (HV crash MSRs)
6065 # Since: 2.9
6067 {'struct': 'GuestPanicInformationHyperV',
6068  'data': { 'arg1': 'uint64',
6069            'arg2': 'uint64',
6070            'arg3': 'uint64',
6071            'arg4': 'uint64',
6072            'arg5': 'uint64' } }
6075 # @rtc-reset-reinjection:
6077 # This command will reset the RTC interrupt reinjection backlog.
6078 # Can be used if another mechanism to synchronize guest time
6079 # is in effect, for example QEMU guest agent's guest-set-time
6080 # command.
6082 # Since: 2.1
6084 # Example:
6086 # -> { "execute": "rtc-reset-reinjection" }
6087 # <- { "return": {} }
6090 { 'command': 'rtc-reset-reinjection' }
6092 # Rocker ethernet network switch
6093 { 'include': 'qapi/rocker.json' }
6096 # @ReplayMode:
6098 # Mode of the replay subsystem.
6100 # @none: normal execution mode. Replay or record are not enabled.
6102 # @record: record mode. All non-deterministic data is written into the
6103 #          replay log.
6105 # @play: replay mode. Non-deterministic data required for system execution
6106 #        is read from the log.
6108 # Since: 2.5
6110 { 'enum': 'ReplayMode',
6111   'data': [ 'none', 'record', 'play' ] }
6114 # @xen-load-devices-state:
6116 # Load the state of all devices from file. The RAM and the block devices
6117 # of the VM are not loaded by this command.
6119 # @filename: the file to load the state of the devices from as binary
6120 # data. See xen-save-devices-state.txt for a description of the binary
6121 # format.
6123 # Since: 2.7
6125 # Example:
6127 # -> { "execute": "xen-load-devices-state",
6128 #      "arguments": { "filename": "/tmp/resume" } }
6129 # <- { "return": {} }
6132 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
6135 # @xen-set-replication:
6137 # Enable or disable replication.
6139 # @enable: true to enable, false to disable.
6141 # @primary: true for primary or false for secondary.
6143 # @failover: true to do failover, false to stop. but cannot be
6144 #            specified if 'enable' is true. default value is false.
6146 # Returns: nothing.
6148 # Example:
6150 # -> { "execute": "xen-set-replication",
6151 #      "arguments": {"enable": true, "primary": false} }
6152 # <- { "return": {} }
6154 # Since: 2.9
6156 { 'command': 'xen-set-replication',
6157   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
6160 # @ReplicationStatus:
6162 # The result format for 'query-xen-replication-status'.
6164 # @error: true if an error happened, false if replication is normal.
6166 # @desc: the human readable error description string, when
6167 #        @error is 'true'.
6169 # Since: 2.9
6171 { 'struct': 'ReplicationStatus',
6172   'data': { 'error': 'bool', '*desc': 'str' } }
6175 # @query-xen-replication-status:
6177 # Query replication status while the vm is running.
6179 # Returns: A @ReplicationResult object showing the status.
6181 # Example:
6183 # -> { "execute": "query-xen-replication-status" }
6184 # <- { "return": { "error": false } }
6186 # Since: 2.9
6188 { 'command': 'query-xen-replication-status',
6189   'returns': 'ReplicationStatus' }
6192 # @xen-colo-do-checkpoint:
6194 # Xen uses this command to notify replication to trigger a checkpoint.
6196 # Returns: nothing.
6198 # Example:
6200 # -> { "execute": "xen-colo-do-checkpoint" }
6201 # <- { "return": {} }
6203 # Since: 2.9
6205 { 'command': 'xen-colo-do-checkpoint' }
6208 # @GICCapability:
6210 # The struct describes capability for a specific GIC (Generic
6211 # Interrupt Controller) version. These bits are not only decided by
6212 # QEMU/KVM software version, but also decided by the hardware that
6213 # the program is running upon.
6215 # @version:  version of GIC to be described. Currently, only 2 and 3
6216 #            are supported.
6218 # @emulated: whether current QEMU/hardware supports emulated GIC
6219 #            device in user space.
6221 # @kernel:   whether current QEMU/hardware supports hardware
6222 #            accelerated GIC device in kernel.
6224 # Since: 2.6
6226 { 'struct': 'GICCapability',
6227   'data': { 'version': 'int',
6228             'emulated': 'bool',
6229             'kernel': 'bool' } }
6232 # @query-gic-capabilities:
6234 # This command is ARM-only. It will return a list of GICCapability
6235 # objects that describe its capability bits.
6237 # Returns: a list of GICCapability objects.
6239 # Since: 2.6
6241 # Example:
6243 # -> { "execute": "query-gic-capabilities" }
6244 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
6245 #                 { "version": 3, "emulated": false, "kernel": true } ] }
6248 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
6251 # @CpuInstanceProperties:
6253 # List of properties to be used for hotplugging a CPU instance,
6254 # it should be passed by management with device_add command when
6255 # a CPU is being hotplugged.
6257 # @node-id: NUMA node ID the CPU belongs to
6258 # @socket-id: socket number within node/board the CPU belongs to
6259 # @core-id: core number within socket the CPU belongs to
6260 # @thread-id: thread number within core the CPU belongs to
6262 # Note: currently there are 4 properties that could be present
6263 # but management should be prepared to pass through other
6264 # properties with device_add command to allow for future
6265 # interface extension. This also requires the filed names to be kept in
6266 # sync with the properties passed to -device/device_add.
6268 # Since: 2.7
6270 { 'struct': 'CpuInstanceProperties',
6271   'data': { '*node-id': 'int',
6272             '*socket-id': 'int',
6273             '*core-id': 'int',
6274             '*thread-id': 'int'
6275   }
6279 # @HotpluggableCPU:
6281 # @type: CPU object type for usage with device_add command
6282 # @props: list of properties to be used for hotplugging CPU
6283 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6284 # @qom-path: link to existing CPU object if CPU is present or
6285 #            omitted if CPU is not present.
6287 # Since: 2.7
6289 { 'struct': 'HotpluggableCPU',
6290   'data': { 'type': 'str',
6291             'vcpus-count': 'int',
6292             'props': 'CpuInstanceProperties',
6293             '*qom-path': 'str'
6294           }
6298 # @query-hotpluggable-cpus:
6300 # Returns: a list of HotpluggableCPU objects.
6302 # Since: 2.7
6304 # Example:
6306 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6308 # -> { "execute": "query-hotpluggable-cpus" }
6309 # <- {"return": [
6310 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6311 #        "vcpus-count": 1 },
6312 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6313 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6314 #    ]}'
6316 # For pc machine type started with -smp 1,maxcpus=2:
6318 # -> { "execute": "query-hotpluggable-cpus" }
6319 # <- {"return": [
6320 #      {
6321 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6322 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6323 #      },
6324 #      {
6325 #         "qom-path": "/machine/unattached/device[0]",
6326 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6327 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6328 #      }
6329 #    ]}
6332 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
6335 # @GuidInfo:
6337 # GUID information.
6339 # @guid: the globally unique identifier
6341 # Since: 2.9
6343 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
6346 # @query-vm-generation-id:
6348 # Show Virtual Machine Generation ID
6350 # Since 2.9
6352 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }