Merge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-20170726.0' into staging
[qemu.git] / qapi-schema.json
blob9c6c3e1a536c83c122683a44bc2e490a1ea39668
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 # @StrOrNull:
121 # This is a string value or the explicit lack of a string (null
122 # pointer in C).  Intended for cases when 'optional absent' already
123 # has a different meaning.
125 # @s: the string value
126 # @n: no string value
128 # Since: 2.10
130 { 'alternate': 'StrOrNull',
131   'data': { 's': 'str',
132             'n': 'null' } }
135 # @LostTickPolicy:
137 # Policy for handling lost ticks in timer devices.
139 # @discard: throw away the missed tick(s) and continue with future injection
140 #           normally.  Guest time may be delayed, unless the OS has explicit
141 #           handling of lost ticks
143 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
144 #         delayed due to the late tick
146 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
147 #         may be delayed, depending on how the OS reacts to the merging
148 #         of ticks
150 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
151 #        guest time should not be delayed once catchup is complete.
153 # Since: 2.0
155 { 'enum': 'LostTickPolicy',
156   'data': ['discard', 'delay', 'merge', 'slew' ] }
159 # @add_client:
161 # Allow client connections for VNC, Spice and socket based
162 # character devices to be passed in to QEMU via SCM_RIGHTS.
164 # @protocol: protocol name. Valid names are "vnc", "spice" or the
165 #            name of a character device (eg. from -chardev id=XXXX)
167 # @fdname: file descriptor name previously passed via 'getfd' command
169 # @skipauth: whether to skip authentication. Only applies
170 #            to "vnc" and "spice" protocols
172 # @tls: whether to perform TLS. Only applies to the "spice"
173 #       protocol
175 # Returns: nothing on success.
177 # Since: 0.14.0
179 # Example:
181 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
182 #                                              "fdname": "myclient" } }
183 # <- { "return": {} }
186 { 'command': 'add_client',
187   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
188             '*tls': 'bool' } }
191 # @NameInfo:
193 # Guest name information.
195 # @name: The name of the guest
197 # Since: 0.14.0
199 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
202 # @query-name:
204 # Return the name information of a guest.
206 # Returns: @NameInfo of the guest
208 # Since: 0.14.0
210 # Example:
212 # -> { "execute": "query-name" }
213 # <- { "return": { "name": "qemu-name" } }
216 { 'command': 'query-name', 'returns': 'NameInfo' }
219 # @KvmInfo:
221 # Information about support for KVM acceleration
223 # @enabled: true if KVM acceleration is active
225 # @present: true if KVM acceleration is built into this executable
227 # Since: 0.14.0
229 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
232 # @query-kvm:
234 # Returns information about KVM acceleration
236 # Returns: @KvmInfo
238 # Since: 0.14.0
240 # Example:
242 # -> { "execute": "query-kvm" }
243 # <- { "return": { "enabled": true, "present": true } }
246 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
249 # @RunState:
251 # An enumeration of VM run states.
253 # @debug: QEMU is running on a debugger
255 # @finish-migrate: guest is paused to finish the migration process
257 # @inmigrate: guest is paused waiting for an incoming migration.  Note
258 # that this state does not tell whether the machine will start at the
259 # end of the migration.  This depends on the command-line -S option and
260 # any invocation of 'stop' or 'cont' that has happened since QEMU was
261 # started.
263 # @internal-error: An internal error that prevents further guest execution
264 # has occurred
266 # @io-error: the last IOP has failed and the device is configured to pause
267 # on I/O errors
269 # @paused: guest has been paused via the 'stop' command
271 # @postmigrate: guest is paused following a successful 'migrate'
273 # @prelaunch: QEMU was started with -S and guest has not started
275 # @restore-vm: guest is paused to restore VM state
277 # @running: guest is actively running
279 # @save-vm: guest is paused to save the VM state
281 # @shutdown: guest is shut down (and -no-shutdown is in use)
283 # @suspended: guest is suspended (ACPI S3)
285 # @watchdog: the watchdog action is configured to pause and has been triggered
287 # @guest-panicked: guest has been panicked as a result of guest OS panic
289 # @colo: guest is paused to save/restore VM state under colo checkpoint,
290 #        VM can not get into this state unless colo capability is enabled
291 #        for migration. (since 2.8)
293 { 'enum': 'RunState',
294   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
295             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
296             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
297             'guest-panicked', 'colo' ] }
300 # @StatusInfo:
302 # Information about VCPU run state
304 # @running: true if all VCPUs are runnable, false if not runnable
306 # @singlestep: true if VCPUs are in single-step mode
308 # @status: the virtual machine @RunState
310 # Since:  0.14.0
312 # Notes: @singlestep is enabled through the GDB stub
314 { 'struct': 'StatusInfo',
315   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
318 # @query-status:
320 # Query the run status of all VCPUs
322 # Returns: @StatusInfo reflecting all VCPUs
324 # Since:  0.14.0
326 # Example:
328 # -> { "execute": "query-status" }
329 # <- { "return": { "running": true,
330 #                  "singlestep": false,
331 #                  "status": "running" } }
334 { 'command': 'query-status', 'returns': 'StatusInfo' }
337 # @UuidInfo:
339 # Guest UUID information (Universally Unique Identifier).
341 # @UUID: the UUID of the guest
343 # Since: 0.14.0
345 # Notes: If no UUID was specified for the guest, a null UUID is returned.
347 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
350 # @query-uuid:
352 # Query the guest UUID information.
354 # Returns: The @UuidInfo for the guest
356 # Since: 0.14.0
358 # Example:
360 # -> { "execute": "query-uuid" }
361 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
364 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
367 # @ChardevInfo:
369 # Information about a character device.
371 # @label: the label of the character device
373 # @filename: the filename of the character device
375 # @frontend-open: shows whether the frontend device attached to this backend
376 #                 (eg. with the chardev=... option) is in open or closed state
377 #                 (since 2.1)
379 # Notes: @filename is encoded using the QEMU command line character device
380 #        encoding.  See the QEMU man page for details.
382 # Since: 0.14.0
384 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
385                                   'filename': 'str',
386                                   'frontend-open': 'bool'} }
389 # @query-chardev:
391 # Returns information about current character devices.
393 # Returns: a list of @ChardevInfo
395 # Since: 0.14.0
397 # Example:
399 # -> { "execute": "query-chardev" }
400 # <- {
401 #       "return": [
402 #          {
403 #             "label": "charchannel0",
404 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
405 #             "frontend-open": false
406 #          },
407 #          {
408 #             "label": "charmonitor",
409 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
410 #             "frontend-open": true
411 #          },
412 #          {
413 #             "label": "charserial0",
414 #             "filename": "pty:/dev/pts/2",
415 #             "frontend-open": true
416 #          }
417 #       ]
418 #    }
421 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
424 # @ChardevBackendInfo:
426 # Information about a character device backend
428 # @name: The backend name
430 # Since: 2.0
432 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
435 # @query-chardev-backends:
437 # Returns information about character device backends.
439 # Returns: a list of @ChardevBackendInfo
441 # Since: 2.0
443 # Example:
445 # -> { "execute": "query-chardev-backends" }
446 # <- {
447 #       "return":[
448 #          {
449 #             "name":"udp"
450 #          },
451 #          {
452 #             "name":"tcp"
453 #          },
454 #          {
455 #             "name":"unix"
456 #          },
457 #          {
458 #             "name":"spiceport"
459 #          }
460 #       ]
461 #    }
464 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
467 # @DataFormat:
469 # An enumeration of data format.
471 # @utf8: Data is a UTF-8 string (RFC 3629)
473 # @base64: Data is Base64 encoded binary (RFC 3548)
475 # Since: 1.4
477 { 'enum': 'DataFormat',
478   'data': [ 'utf8', 'base64' ] }
481 # @ringbuf-write:
483 # Write to a ring buffer character device.
485 # @device: the ring buffer character device name
487 # @data: data to write
489 # @format: data encoding (default 'utf8').
490 #          - base64: data must be base64 encoded text.  Its binary
491 #            decoding gets written.
492 #          - utf8: data's UTF-8 encoding is written
493 #          - data itself is always Unicode regardless of format, like
494 #            any other string.
496 # Returns: Nothing on success
498 # Since: 1.4
500 # Example:
502 # -> { "execute": "ringbuf-write",
503 #      "arguments": { "device": "foo",
504 #                     "data": "abcdefgh",
505 #                     "format": "utf8" } }
506 # <- { "return": {} }
509 { 'command': 'ringbuf-write',
510   'data': {'device': 'str', 'data': 'str',
511            '*format': 'DataFormat'} }
514 # @ringbuf-read:
516 # Read from a ring buffer character device.
518 # @device: the ring buffer character device name
520 # @size: how many bytes to read at most
522 # @format: data encoding (default 'utf8').
523 #          - base64: the data read is returned in base64 encoding.
524 #          - utf8: the data read is interpreted as UTF-8.
525 #            Bug: can screw up when the buffer contains invalid UTF-8
526 #            sequences, NUL characters, after the ring buffer lost
527 #            data, and when reading stops because the size limit is
528 #            reached.
529 #          - The return value is always Unicode regardless of format,
530 #            like any other string.
532 # Returns: data read from the device
534 # Since: 1.4
536 # Example:
538 # -> { "execute": "ringbuf-read",
539 #      "arguments": { "device": "foo",
540 #                     "size": 1000,
541 #                     "format": "utf8" } }
542 # <- { "return": "abcdefgh" }
545 { 'command': 'ringbuf-read',
546   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
547   'returns': 'str' }
550 # @EventInfo:
552 # Information about a QMP event
554 # @name: The event name
556 # Since: 1.2.0
558 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
561 # @query-events:
563 # Return a list of supported QMP events by this server
565 # Returns: A list of @EventInfo for all supported events
567 # Since: 1.2.0
569 # Example:
571 # -> { "execute": "query-events" }
572 # <- {
573 #      "return": [
574 #          {
575 #             "name":"SHUTDOWN"
576 #          },
577 #          {
578 #             "name":"RESET"
579 #          }
580 #       ]
581 #    }
583 # Note: This example has been shortened as the real response is too long.
586 { 'command': 'query-events', 'returns': ['EventInfo'] }
589 # @MigrationStats:
591 # Detailed migration status.
593 # @transferred: amount of bytes already transferred to the target VM
595 # @remaining: amount of bytes remaining to be transferred to the target VM
597 # @total: total amount of bytes involved in the migration process
599 # @duplicate: number of duplicate (zero) pages (since 1.2)
601 # @skipped: number of skipped zero pages (since 1.5)
603 # @normal: number of normal pages (since 1.2)
605 # @normal-bytes: number of normal bytes sent (since 1.2)
607 # @dirty-pages-rate: number of pages dirtied by second by the
608 #        guest (since 1.3)
610 # @mbps: throughput in megabits/sec. (since 1.6)
612 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
614 # @postcopy-requests: The number of page requests received from the destination
615 #        (since 2.7)
617 # @page-size: The number of bytes per page for the various page-based
618 #        statistics (since 2.10)
620 # Since: 0.14.0
622 { 'struct': 'MigrationStats',
623   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
624            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
625            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
626            'mbps' : 'number', 'dirty-sync-count' : 'int',
627            'postcopy-requests' : 'int', 'page-size' : 'int' } }
630 # @XBZRLECacheStats:
632 # Detailed XBZRLE migration cache statistics
634 # @cache-size: XBZRLE cache size
636 # @bytes: amount of bytes already transferred to the target VM
638 # @pages: amount of pages transferred to the target VM
640 # @cache-miss: number of cache miss
642 # @cache-miss-rate: rate of cache miss (since 2.1)
644 # @overflow: number of overflows
646 # Since: 1.2
648 { 'struct': 'XBZRLECacheStats',
649   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
650            'cache-miss': 'int', 'cache-miss-rate': 'number',
651            'overflow': 'int' } }
654 # @MigrationStatus:
656 # An enumeration of migration status.
658 # @none: no migration has ever happened.
660 # @setup: migration process has been initiated.
662 # @cancelling: in the process of cancelling migration.
664 # @cancelled: cancelling migration is finished.
666 # @active: in the process of doing migration.
668 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
670 # @completed: migration is finished.
672 # @failed: some error occurred during migration process.
674 # @colo: VM is in the process of fault tolerance, VM can not get into this
675 #        state unless colo capability is enabled for migration. (since 2.8)
677 # Since: 2.3
680 { 'enum': 'MigrationStatus',
681   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
682             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
685 # @MigrationInfo:
687 # Information about current migration process.
689 # @status: @MigrationStatus describing the current migration status.
690 #          If this field is not returned, no migration process
691 #          has been initiated
693 # @ram: @MigrationStats containing detailed migration
694 #       status, only returned if status is 'active' or
695 #       'completed'(since 1.2)
697 # @disk: @MigrationStats containing detailed disk migration
698 #        status, only returned if status is 'active' and it is a block
699 #        migration
701 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
702 #                migration statistics, only returned if XBZRLE feature is on and
703 #                status is 'active' or 'completed' (since 1.2)
705 # @total-time: total amount of milliseconds since migration started.
706 #        If migration has ended, it returns the total migration
707 #        time. (since 1.2)
709 # @downtime: only present when migration finishes correctly
710 #        total downtime in milliseconds for the guest.
711 #        (since 1.3)
713 # @expected-downtime: only present while migration is active
714 #        expected downtime in milliseconds for the guest in last walk
715 #        of the dirty bitmap. (since 1.3)
717 # @setup-time: amount of setup time in milliseconds _before_ the
718 #        iterations begin but _after_ the QMP command is issued. This is designed
719 #        to provide an accounting of any activities (such as RDMA pinning) which
720 #        may be expensive, but do not actually occur during the iterative
721 #        migration rounds themselves. (since 1.6)
723 # @cpu-throttle-percentage: percentage of time guest cpus are being
724 #        throttled during auto-converge. This is only present when auto-converge
725 #        has started throttling guest cpus. (Since 2.7)
727 # @error-desc: the human readable error description string, when
728 #              @status is 'failed'. Clients should not attempt to parse the
729 #              error strings. (Since 2.7)
731 # Since: 0.14.0
733 { 'struct': 'MigrationInfo',
734   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
735            '*disk': 'MigrationStats',
736            '*xbzrle-cache': 'XBZRLECacheStats',
737            '*total-time': 'int',
738            '*expected-downtime': 'int',
739            '*downtime': 'int',
740            '*setup-time': 'int',
741            '*cpu-throttle-percentage': 'int',
742            '*error-desc': 'str'} }
745 # @query-migrate:
747 # Returns information about current migration process. If migration
748 # is active there will be another json-object with RAM migration
749 # status and if block migration is active another one with block
750 # migration status.
752 # Returns: @MigrationInfo
754 # Since: 0.14.0
756 # Example:
758 # 1. Before the first migration
760 # -> { "execute": "query-migrate" }
761 # <- { "return": {} }
763 # 2. Migration is done and has succeeded
765 # -> { "execute": "query-migrate" }
766 # <- { "return": {
767 #         "status": "completed",
768 #         "ram":{
769 #           "transferred":123,
770 #           "remaining":123,
771 #           "total":246,
772 #           "total-time":12345,
773 #           "setup-time":12345,
774 #           "downtime":12345,
775 #           "duplicate":123,
776 #           "normal":123,
777 #           "normal-bytes":123456,
778 #           "dirty-sync-count":15
779 #         }
780 #      }
781 #    }
783 # 3. Migration is done and has failed
785 # -> { "execute": "query-migrate" }
786 # <- { "return": { "status": "failed" } }
788 # 4. Migration is being performed and is not a block migration:
790 # -> { "execute": "query-migrate" }
791 # <- {
792 #       "return":{
793 #          "status":"active",
794 #          "ram":{
795 #             "transferred":123,
796 #             "remaining":123,
797 #             "total":246,
798 #             "total-time":12345,
799 #             "setup-time":12345,
800 #             "expected-downtime":12345,
801 #             "duplicate":123,
802 #             "normal":123,
803 #             "normal-bytes":123456,
804 #             "dirty-sync-count":15
805 #          }
806 #       }
807 #    }
809 # 5. Migration is being performed and is a block migration:
811 # -> { "execute": "query-migrate" }
812 # <- {
813 #       "return":{
814 #          "status":"active",
815 #          "ram":{
816 #             "total":1057024,
817 #             "remaining":1053304,
818 #             "transferred":3720,
819 #             "total-time":12345,
820 #             "setup-time":12345,
821 #             "expected-downtime":12345,
822 #             "duplicate":123,
823 #             "normal":123,
824 #             "normal-bytes":123456,
825 #             "dirty-sync-count":15
826 #          },
827 #          "disk":{
828 #             "total":20971520,
829 #             "remaining":20880384,
830 #             "transferred":91136
831 #          }
832 #       }
833 #    }
835 # 6. Migration is being performed and XBZRLE is active:
837 # -> { "execute": "query-migrate" }
838 # <- {
839 #       "return":{
840 #          "status":"active",
841 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
842 #          "ram":{
843 #             "total":1057024,
844 #             "remaining":1053304,
845 #             "transferred":3720,
846 #             "total-time":12345,
847 #             "setup-time":12345,
848 #             "expected-downtime":12345,
849 #             "duplicate":10,
850 #             "normal":3333,
851 #             "normal-bytes":3412992,
852 #             "dirty-sync-count":15
853 #          },
854 #          "xbzrle-cache":{
855 #             "cache-size":67108864,
856 #             "bytes":20971520,
857 #             "pages":2444343,
858 #             "cache-miss":2244,
859 #             "cache-miss-rate":0.123,
860 #             "overflow":34434
861 #          }
862 #       }
863 #    }
866 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
869 # @MigrationCapability:
871 # Migration capabilities enumeration
873 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
874 #          This feature allows us to minimize migration traffic for certain work
875 #          loads, by sending compressed difference of the pages
877 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
878 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
879 #          Disabled by default. (since 2.0)
881 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
882 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
883 #          source and target VM to support this feature. To enable it is sufficient
884 #          to enable the capability on the source VM. The feature is disabled by
885 #          default. (since 1.6)
887 # @compress: Use multiple compression threads to accelerate live migration.
888 #          This feature can help to reduce the migration traffic, by sending
889 #          compressed pages. Please note that if compress and xbzrle are both
890 #          on, compress only takes effect in the ram bulk stage, after that,
891 #          it will be disabled and only xbzrle takes effect, this can help to
892 #          minimize migration traffic. The feature is disabled by default.
893 #          (since 2.4 )
895 # @events: generate events for each migration state change
896 #          (since 2.4 )
898 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
899 #          to speed up convergence of RAM migration. (since 1.6)
901 # @postcopy-ram: Start executing on the migration target before all of RAM has
902 #          been migrated, pulling the remaining pages along as needed. NOTE: If
903 #          the migration fails during postcopy the VM will fail.  (since 2.6)
905 # @x-colo: If enabled, migration will never end, and the state of the VM on the
906 #        primary side will be migrated continuously to the VM on secondary
907 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
908 #        Non-stop Service. (since 2.8)
910 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
911 #        during postcopy-ram migration. (since 2.9)
913 # @block: If enabled, QEMU will also migrate the contents of all block
914 #          devices.  Default is disabled.  A possible alternative uses
915 #          mirror jobs to a builtin NBD server on the destination, which
916 #          offers more flexibility.
917 #          (Since 2.10)
919 # @return-path: If enabled, migration will use the return path even
920 #               for precopy. (since 2.10)
922 # Since: 1.2
924 { 'enum': 'MigrationCapability',
925   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
926            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
927            'block', 'return-path' ] }
930 # @MigrationCapabilityStatus:
932 # Migration capability information
934 # @capability: capability enum
936 # @state: capability state bool
938 # Since: 1.2
940 { 'struct': 'MigrationCapabilityStatus',
941   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
944 # @migrate-set-capabilities:
946 # Enable/Disable the following migration capabilities (like xbzrle)
948 # @capabilities: json array of capability modifications to make
950 # Since: 1.2
952 # Example:
954 # -> { "execute": "migrate-set-capabilities" , "arguments":
955 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
958 { 'command': 'migrate-set-capabilities',
959   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
962 # @query-migrate-capabilities:
964 # Returns information about the current migration capabilities status
966 # Returns: @MigrationCapabilitiesStatus
968 # Since: 1.2
970 # Example:
972 # -> { "execute": "query-migrate-capabilities" }
973 # <- { "return": [
974 #       {"state": false, "capability": "xbzrle"},
975 #       {"state": false, "capability": "rdma-pin-all"},
976 #       {"state": false, "capability": "auto-converge"},
977 #       {"state": false, "capability": "zero-blocks"},
978 #       {"state": false, "capability": "compress"},
979 #       {"state": true, "capability": "events"},
980 #       {"state": false, "capability": "postcopy-ram"},
981 #       {"state": false, "capability": "x-colo"}
982 #    ]}
985 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
988 # @MigrationParameter:
990 # Migration parameters enumeration
992 # @compress-level: Set the compression level to be used in live migration,
993 #          the compression level is an integer between 0 and 9, where 0 means
994 #          no compression, 1 means the best compression speed, and 9 means best
995 #          compression ratio which will consume more CPU.
997 # @compress-threads: Set compression thread count to be used in live migration,
998 #          the compression thread count is an integer between 1 and 255.
1000 # @decompress-threads: Set decompression thread count to be used in live
1001 #          migration, the decompression thread count is an integer between 1
1002 #          and 255. Usually, decompression is at least 4 times as fast as
1003 #          compression, so set the decompress-threads to the number about 1/4
1004 #          of compress-threads is adequate.
1006 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
1007 #                        when migration auto-converge is activated. The
1008 #                        default value is 20. (Since 2.7)
1010 # @cpu-throttle-increment: throttle percentage increase each time
1011 #                          auto-converge detects that migration is not making
1012 #                          progress. The default value is 10. (Since 2.7)
1014 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
1015 #             establishing a TLS connection over the migration data channel.
1016 #             On the outgoing side of the migration, the credentials must
1017 #             be for a 'client' endpoint, while for the incoming side the
1018 #             credentials must be for a 'server' endpoint. Setting this
1019 #             will enable TLS for all migrations. The default is unset,
1020 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1022 # @tls-hostname: hostname of the target host for the migration. This is
1023 #                required when using x509 based TLS credentials and the
1024 #                migration URI does not already include a hostname. For
1025 #                example if using fd: or exec: based migration, the
1026 #                hostname must be provided so that the server's x509
1027 #                certificate identity can be validated. (Since 2.7)
1029 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1030 #                 bytes per second. (Since 2.8)
1032 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1033 #                  downtime in milliseconds (Since 2.8)
1035 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
1036 #          periodic mode. (Since 2.8)
1038 # @block-incremental: Affects how much storage is migrated when the
1039 #       block migration capability is enabled.  When false, the entire
1040 #       storage backing chain is migrated into a flattened image at
1041 #       the destination; when true, only the active qcow2 layer is
1042 #       migrated and the destination must already have access to the
1043 #       same backing chain as was used on the source.  (since 2.10)
1045 # Since: 2.4
1047 { 'enum': 'MigrationParameter',
1048   'data': ['compress-level', 'compress-threads', 'decompress-threads',
1049            'cpu-throttle-initial', 'cpu-throttle-increment',
1050            'tls-creds', 'tls-hostname', 'max-bandwidth',
1051            'downtime-limit', 'x-checkpoint-delay', 'block-incremental' ] }
1054 # @MigrateSetParameters:
1056 # @compress-level: compression level
1058 # @compress-threads: compression thread count
1060 # @decompress-threads: decompression thread count
1062 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1063 #                        throttled when migration auto-converge is activated.
1064 #                        The default value is 20. (Since 2.7)
1066 # @cpu-throttle-increment: throttle percentage increase each time
1067 #                          auto-converge detects that migration is not making
1068 #                          progress. The default value is 10. (Since 2.7)
1070 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1071 #             for establishing a TLS connection over the migration data
1072 #             channel. On the outgoing side of the migration, the credentials
1073 #             must be for a 'client' endpoint, while for the incoming side the
1074 #             credentials must be for a 'server' endpoint. Setting this
1075 #             to a non-empty string enables TLS for all migrations.
1076 #             An empty string means that QEMU will use plain text mode for
1077 #             migration, rather than TLS (Since 2.9)
1078 #             Previously (since 2.7), this was reported by omitting
1079 #             tls-creds instead.
1081 # @tls-hostname: hostname of the target host for the migration. This
1082 #                is required when using x509 based TLS credentials and the
1083 #                migration URI does not already include a hostname. For
1084 #                example if using fd: or exec: based migration, the
1085 #                hostname must be provided so that the server's x509
1086 #                certificate identity can be validated. (Since 2.7)
1087 #                An empty string means that QEMU will use the hostname
1088 #                associated with the migration URI, if any. (Since 2.9)
1089 #                Previously (since 2.7), this was reported by omitting
1090 #                tls-hostname instead.
1092 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1093 #                 bytes per second. (Since 2.8)
1095 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1096 #                  downtime in milliseconds (Since 2.8)
1098 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1100 # @block-incremental: Affects how much storage is migrated when the
1101 #       block migration capability is enabled.  When false, the entire
1102 #       storage backing chain is migrated into a flattened image at
1103 #       the destination; when true, only the active qcow2 layer is
1104 #       migrated and the destination must already have access to the
1105 #       same backing chain as was used on the source.  (since 2.10)
1107 # Since: 2.4
1109 # TODO either fuse back into MigrationParameters, or make
1110 # MigrationParameters members mandatory
1111 { 'struct': 'MigrateSetParameters',
1112   'data': { '*compress-level': 'int',
1113             '*compress-threads': 'int',
1114             '*decompress-threads': 'int',
1115             '*cpu-throttle-initial': 'int',
1116             '*cpu-throttle-increment': 'int',
1117             '*tls-creds': 'StrOrNull',
1118             '*tls-hostname': 'StrOrNull',
1119             '*max-bandwidth': 'int',
1120             '*downtime-limit': 'int',
1121             '*x-checkpoint-delay': 'int',
1122             '*block-incremental': 'bool' } }
1125 # @migrate-set-parameters:
1127 # Set various migration parameters.
1129 # Since: 2.4
1131 # Example:
1133 # -> { "execute": "migrate-set-parameters" ,
1134 #      "arguments": { "compress-level": 1 } }
1137 { 'command': 'migrate-set-parameters', 'boxed': true,
1138   'data': 'MigrateSetParameters' }
1141 # @MigrationParameters:
1143 # The optional members aren't actually optional.
1145 # @compress-level: compression level
1147 # @compress-threads: compression thread count
1149 # @decompress-threads: decompression thread count
1151 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1152 #                        throttled when migration auto-converge is activated.
1153 #                        (Since 2.7)
1155 # @cpu-throttle-increment: throttle percentage increase each time
1156 #                          auto-converge detects that migration is not making
1157 #                          progress. (Since 2.7)
1159 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1160 #             for establishing a TLS connection over the migration data
1161 #             channel. On the outgoing side of the migration, the credentials
1162 #             must be for a 'client' endpoint, while for the incoming side the
1163 #             credentials must be for a 'server' endpoint.
1164 #             An empty string means that QEMU will use plain text mode for
1165 #             migration, rather than TLS (Since 2.7)
1166 #             Note: 2.8 reports this by omitting tls-creds instead.
1168 # @tls-hostname: hostname of the target host for the migration. This
1169 #                is required when using x509 based TLS credentials and the
1170 #                migration URI does not already include a hostname. For
1171 #                example if using fd: or exec: based migration, the
1172 #                hostname must be provided so that the server's x509
1173 #                certificate identity can be validated. (Since 2.7)
1174 #                An empty string means that QEMU will use the hostname
1175 #                associated with the migration URI, if any. (Since 2.9)
1176 #                Note: 2.8 reports this by omitting tls-hostname instead.
1178 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1179 #                 bytes per second. (Since 2.8)
1181 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1182 #                  downtime in milliseconds (Since 2.8)
1184 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1186 # @block-incremental: Affects how much storage is migrated when the
1187 #       block migration capability is enabled.  When false, the entire
1188 #       storage backing chain is migrated into a flattened image at
1189 #       the destination; when true, only the active qcow2 layer is
1190 #       migrated and the destination must already have access to the
1191 #       same backing chain as was used on the source.  (since 2.10)
1193 # Since: 2.4
1195 { 'struct': 'MigrationParameters',
1196   'data': { '*compress-level': 'int',
1197             '*compress-threads': 'int',
1198             '*decompress-threads': 'int',
1199             '*cpu-throttle-initial': 'int',
1200             '*cpu-throttle-increment': 'int',
1201             '*tls-creds': 'str',
1202             '*tls-hostname': 'str',
1203             '*max-bandwidth': 'int',
1204             '*downtime-limit': 'int',
1205             '*x-checkpoint-delay': 'int',
1206             '*block-incremental': 'bool' } }
1209 # @query-migrate-parameters:
1211 # Returns information about the current migration parameters
1213 # Returns: @MigrationParameters
1215 # Since: 2.4
1217 # Example:
1219 # -> { "execute": "query-migrate-parameters" }
1220 # <- { "return": {
1221 #          "decompress-threads": 2,
1222 #          "cpu-throttle-increment": 10,
1223 #          "compress-threads": 8,
1224 #          "compress-level": 1,
1225 #          "cpu-throttle-initial": 20,
1226 #          "max-bandwidth": 33554432,
1227 #          "downtime-limit": 300
1228 #       }
1229 #    }
1232 { 'command': 'query-migrate-parameters',
1233   'returns': 'MigrationParameters' }
1236 # @client_migrate_info:
1238 # Set migration information for remote display.  This makes the server
1239 # ask the client to automatically reconnect using the new parameters
1240 # once migration finished successfully.  Only implemented for SPICE.
1242 # @protocol:     must be "spice"
1243 # @hostname:     migration target hostname
1244 # @port:         spice tcp port for plaintext channels
1245 # @tls-port:     spice tcp port for tls-secured channels
1246 # @cert-subject: server certificate subject
1248 # Since: 0.14.0
1250 # Example:
1252 # -> { "execute": "client_migrate_info",
1253 #      "arguments": { "protocol": "spice",
1254 #                     "hostname": "virt42.lab.kraxel.org",
1255 #                     "port": 1234 } }
1256 # <- { "return": {} }
1259 { 'command': 'client_migrate_info',
1260   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1261             '*tls-port': 'int', '*cert-subject': 'str' } }
1264 # @migrate-start-postcopy:
1266 # Followup to a migration command to switch the migration to postcopy mode.
1267 # The postcopy-ram capability must be set before the original migration
1268 # command.
1270 # Since: 2.5
1272 # Example:
1274 # -> { "execute": "migrate-start-postcopy" }
1275 # <- { "return": {} }
1278 { 'command': 'migrate-start-postcopy' }
1281 # @COLOMessage:
1283 # The message transmission between Primary side and Secondary side.
1285 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1287 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1289 # @checkpoint-reply: SVM gets PVM's checkpoint request
1291 # @vmstate-send: VM's state will be sent by PVM.
1293 # @vmstate-size: The total size of VMstate.
1295 # @vmstate-received: VM's state has been received by SVM.
1297 # @vmstate-loaded: VM's state has been loaded by SVM.
1299 # Since: 2.8
1301 { 'enum': 'COLOMessage',
1302   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1303             'vmstate-send', 'vmstate-size', 'vmstate-received',
1304             'vmstate-loaded' ] }
1307 # @COLOMode:
1309 # The colo mode
1311 # @unknown: unknown mode
1313 # @primary: master side
1315 # @secondary: slave side
1317 # Since: 2.8
1319 { 'enum': 'COLOMode',
1320   'data': [ 'unknown', 'primary', 'secondary'] }
1323 # @FailoverStatus:
1325 # An enumeration of COLO failover status
1327 # @none: no failover has ever happened
1329 # @require: got failover requirement but not handled
1331 # @active: in the process of doing failover
1333 # @completed: finish the process of failover
1335 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1337 # Since: 2.8
1339 { 'enum': 'FailoverStatus',
1340   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1343 # @x-colo-lost-heartbeat:
1345 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1346 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1347 # If sent to the Secondary, the Secondary side will run failover work,
1348 # then takes over server operation to become the service VM.
1350 # Since: 2.8
1352 # Example:
1354 # -> { "execute": "x-colo-lost-heartbeat" }
1355 # <- { "return": {} }
1358 { 'command': 'x-colo-lost-heartbeat' }
1361 # @MouseInfo:
1363 # Information about a mouse device.
1365 # @name: the name of the mouse device
1367 # @index: the index of the mouse device
1369 # @current: true if this device is currently receiving mouse events
1371 # @absolute: true if this device supports absolute coordinates as input
1373 # Since: 0.14.0
1375 { 'struct': 'MouseInfo',
1376   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1377            'absolute': 'bool'} }
1380 # @query-mice:
1382 # Returns information about each active mouse device
1384 # Returns: a list of @MouseInfo for each device
1386 # Since: 0.14.0
1388 # Example:
1390 # -> { "execute": "query-mice" }
1391 # <- { "return": [
1392 #          {
1393 #             "name":"QEMU Microsoft Mouse",
1394 #             "index":0,
1395 #             "current":false,
1396 #             "absolute":false
1397 #          },
1398 #          {
1399 #             "name":"QEMU PS/2 Mouse",
1400 #             "index":1,
1401 #             "current":true,
1402 #             "absolute":true
1403 #          }
1404 #       ]
1405 #    }
1408 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1411 # @CpuInfoArch:
1413 # An enumeration of cpu types that enable additional information during
1414 # @query-cpus.
1416 # Since: 2.6
1418 { 'enum': 'CpuInfoArch',
1419   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1422 # @CpuInfo:
1424 # Information about a virtual CPU
1426 # @CPU: the index of the virtual CPU
1428 # @current: this only exists for backwards compatibility and should be ignored
1430 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1431 #          to a processor specific low power mode.
1433 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1435 # @thread_id: ID of the underlying host thread
1437 # @props: properties describing to which node/socket/core/thread
1438 #         virtual CPU belongs to, provided if supported by board (since 2.10)
1440 # @arch: architecture of the cpu, which determines which additional fields
1441 #        will be listed (since 2.6)
1443 # Since: 0.14.0
1445 # Notes: @halted is a transient state that changes frequently.  By the time the
1446 #        data is sent to the client, the guest may no longer be halted.
1448 { 'union': 'CpuInfo',
1449   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1450            'qom_path': 'str', 'thread_id': 'int',
1451            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
1452   'discriminator': 'arch',
1453   'data': { 'x86': 'CpuInfoX86',
1454             'sparc': 'CpuInfoSPARC',
1455             'ppc': 'CpuInfoPPC',
1456             'mips': 'CpuInfoMIPS',
1457             'tricore': 'CpuInfoTricore',
1458             'other': 'CpuInfoOther' } }
1461 # @CpuInfoX86:
1463 # Additional information about a virtual i386 or x86_64 CPU
1465 # @pc: the 64-bit instruction pointer
1467 # Since: 2.6
1469 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1472 # @CpuInfoSPARC:
1474 # Additional information about a virtual SPARC CPU
1476 # @pc: the PC component of the instruction pointer
1478 # @npc: the NPC component of the instruction pointer
1480 # Since: 2.6
1482 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1485 # @CpuInfoPPC:
1487 # Additional information about a virtual PPC CPU
1489 # @nip: the instruction pointer
1491 # Since: 2.6
1493 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1496 # @CpuInfoMIPS:
1498 # Additional information about a virtual MIPS CPU
1500 # @PC: the instruction pointer
1502 # Since: 2.6
1504 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1507 # @CpuInfoTricore:
1509 # Additional information about a virtual Tricore CPU
1511 # @PC: the instruction pointer
1513 # Since: 2.6
1515 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1518 # @CpuInfoOther:
1520 # No additional information is available about the virtual CPU
1522 # Since: 2.6
1525 { 'struct': 'CpuInfoOther', 'data': { } }
1528 # @query-cpus:
1530 # Returns a list of information about each virtual CPU.
1532 # Returns: a list of @CpuInfo for each virtual CPU
1534 # Since: 0.14.0
1536 # Example:
1538 # -> { "execute": "query-cpus" }
1539 # <- { "return": [
1540 #          {
1541 #             "CPU":0,
1542 #             "current":true,
1543 #             "halted":false,
1544 #             "qom_path":"/machine/unattached/device[0]",
1545 #             "arch":"x86",
1546 #             "pc":3227107138,
1547 #             "thread_id":3134
1548 #          },
1549 #          {
1550 #             "CPU":1,
1551 #             "current":false,
1552 #             "halted":true,
1553 #             "qom_path":"/machine/unattached/device[2]",
1554 #             "arch":"x86",
1555 #             "pc":7108165,
1556 #             "thread_id":3135
1557 #          }
1558 #       ]
1559 #    }
1562 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1565 # @IOThreadInfo:
1567 # Information about an iothread
1569 # @id: the identifier of the iothread
1571 # @thread-id: ID of the underlying host thread
1573 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1574 #               (since 2.9)
1576 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1577 #             configured (since 2.9)
1579 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1580 #               it's not configured (since 2.9)
1582 # Since: 2.0
1584 { 'struct': 'IOThreadInfo',
1585   'data': {'id': 'str',
1586            'thread-id': 'int',
1587            'poll-max-ns': 'int',
1588            'poll-grow': 'int',
1589            'poll-shrink': 'int' } }
1592 # @query-iothreads:
1594 # Returns a list of information about each iothread.
1596 # Note: this list excludes the QEMU main loop thread, which is not declared
1597 # using the -object iothread command-line option.  It is always the main thread
1598 # of the process.
1600 # Returns: a list of @IOThreadInfo for each iothread
1602 # Since: 2.0
1604 # Example:
1606 # -> { "execute": "query-iothreads" }
1607 # <- { "return": [
1608 #          {
1609 #             "id":"iothread0",
1610 #             "thread-id":3134
1611 #          },
1612 #          {
1613 #             "id":"iothread1",
1614 #             "thread-id":3135
1615 #          }
1616 #       ]
1617 #    }
1620 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1623 # @NetworkAddressFamily:
1625 # The network address family
1627 # @ipv4: IPV4 family
1629 # @ipv6: IPV6 family
1631 # @unix: unix socket
1633 # @vsock: vsock family (since 2.8)
1635 # @unknown: otherwise
1637 # Since: 2.1
1639 { 'enum': 'NetworkAddressFamily',
1640   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1643 # @VncBasicInfo:
1645 # The basic information for vnc network connection
1647 # @host: IP address
1649 # @service: The service name of the vnc port. This may depend on the host
1650 #           system's service database so symbolic names should not be relied
1651 #           on.
1653 # @family: address family
1655 # @websocket: true in case the socket is a websocket (since 2.3).
1657 # Since: 2.1
1659 { 'struct': 'VncBasicInfo',
1660   'data': { 'host': 'str',
1661             'service': 'str',
1662             'family': 'NetworkAddressFamily',
1663             'websocket': 'bool' } }
1666 # @VncServerInfo:
1668 # The network connection information for server
1670 # @auth: authentication method used for
1671 #        the plain (non-websocket) VNC server
1673 # Since: 2.1
1675 { 'struct': 'VncServerInfo',
1676   'base': 'VncBasicInfo',
1677   'data': { '*auth': 'str' } }
1680 # @VncClientInfo:
1682 # Information about a connected VNC client.
1684 # @x509_dname: If x509 authentication is in use, the Distinguished
1685 #              Name of the client.
1687 # @sasl_username: If SASL authentication is in use, the SASL username
1688 #                 used for authentication.
1690 # Since: 0.14.0
1692 { 'struct': 'VncClientInfo',
1693   'base': 'VncBasicInfo',
1694   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1697 # @VncInfo:
1699 # Information about the VNC session.
1701 # @enabled: true if the VNC server is enabled, false otherwise
1703 # @host: The hostname the VNC server is bound to.  This depends on
1704 #        the name resolution on the host and may be an IP address.
1706 # @family: 'ipv6' if the host is listening for IPv6 connections
1707 #                    'ipv4' if the host is listening for IPv4 connections
1708 #                    'unix' if the host is listening on a unix domain socket
1709 #                    'unknown' otherwise
1711 # @service: The service name of the server's port.  This may depends
1712 #           on the host system's service database so symbolic names should not
1713 #           be relied on.
1715 # @auth: the current authentication type used by the server
1716 #        'none' if no authentication is being used
1717 #        'vnc' if VNC authentication is being used
1718 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1719 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1720 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1721 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1722 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1723 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1724 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1725 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1726 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1728 # @clients: a list of @VncClientInfo of all currently connected clients
1730 # Since: 0.14.0
1732 { 'struct': 'VncInfo',
1733   'data': {'enabled': 'bool', '*host': 'str',
1734            '*family': 'NetworkAddressFamily',
1735            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1738 # @VncPrimaryAuth:
1740 # vnc primary authentication method.
1742 # Since: 2.3
1744 { 'enum': 'VncPrimaryAuth',
1745   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1746             'tls', 'vencrypt', 'sasl' ] }
1749 # @VncVencryptSubAuth:
1751 # vnc sub authentication method with vencrypt.
1753 # Since: 2.3
1755 { 'enum': 'VncVencryptSubAuth',
1756   'data': [ 'plain',
1757             'tls-none',  'x509-none',
1758             'tls-vnc',   'x509-vnc',
1759             'tls-plain', 'x509-plain',
1760             'tls-sasl',  'x509-sasl' ] }
1764 # @VncServerInfo2:
1766 # The network connection information for server
1768 # @auth: The current authentication type used by the servers
1770 # @vencrypt: The vencrypt sub authentication type used by the
1771 #            servers, only specified in case auth == vencrypt.
1773 # Since: 2.9
1775 { 'struct': 'VncServerInfo2',
1776   'base': 'VncBasicInfo',
1777   'data': { 'auth'      : 'VncPrimaryAuth',
1778             '*vencrypt' : 'VncVencryptSubAuth' } }
1782 # @VncInfo2:
1784 # Information about a vnc server
1786 # @id: vnc server name.
1788 # @server: A list of @VncBasincInfo describing all listening sockets.
1789 #          The list can be empty (in case the vnc server is disabled).
1790 #          It also may have multiple entries: normal + websocket,
1791 #          possibly also ipv4 + ipv6 in the future.
1793 # @clients: A list of @VncClientInfo of all currently connected clients.
1794 #           The list can be empty, for obvious reasons.
1796 # @auth: The current authentication type used by the non-websockets servers
1798 # @vencrypt: The vencrypt authentication type used by the servers,
1799 #            only specified in case auth == vencrypt.
1801 # @display: The display device the vnc server is linked to.
1803 # Since: 2.3
1805 { 'struct': 'VncInfo2',
1806   'data': { 'id'        : 'str',
1807             'server'    : ['VncServerInfo2'],
1808             'clients'   : ['VncClientInfo'],
1809             'auth'      : 'VncPrimaryAuth',
1810             '*vencrypt' : 'VncVencryptSubAuth',
1811             '*display'  : 'str' } }
1814 # @query-vnc:
1816 # Returns information about the current VNC server
1818 # Returns: @VncInfo
1820 # Since: 0.14.0
1822 # Example:
1824 # -> { "execute": "query-vnc" }
1825 # <- { "return": {
1826 #          "enabled":true,
1827 #          "host":"0.0.0.0",
1828 #          "service":"50402",
1829 #          "auth":"vnc",
1830 #          "family":"ipv4",
1831 #          "clients":[
1832 #             {
1833 #                "host":"127.0.0.1",
1834 #                "service":"50401",
1835 #                "family":"ipv4"
1836 #             }
1837 #          ]
1838 #       }
1839 #    }
1842 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1845 # @query-vnc-servers:
1847 # Returns a list of vnc servers.  The list can be empty.
1849 # Returns: a list of @VncInfo2
1851 # Since: 2.3
1853 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1856 # @SpiceBasicInfo:
1858 # The basic information for SPICE network connection
1860 # @host: IP address
1862 # @port: port number
1864 # @family: address family
1866 # Since: 2.1
1868 { 'struct': 'SpiceBasicInfo',
1869   'data': { 'host': 'str',
1870             'port': 'str',
1871             'family': 'NetworkAddressFamily' } }
1874 # @SpiceServerInfo:
1876 # Information about a SPICE server
1878 # @auth: authentication method
1880 # Since: 2.1
1882 { 'struct': 'SpiceServerInfo',
1883   'base': 'SpiceBasicInfo',
1884   'data': { '*auth': 'str' } }
1887 # @SpiceChannel:
1889 # Information about a SPICE client channel.
1891 # @connection-id: SPICE connection id number.  All channels with the same id
1892 #                 belong to the same SPICE session.
1894 # @channel-type: SPICE channel type number.  "1" is the main control
1895 #                channel, filter for this one if you want to track spice
1896 #                sessions only
1898 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1899 #              multiple channels of the same type exist, such as multiple
1900 #              display channels in a multihead setup
1902 # @tls: true if the channel is encrypted, false otherwise.
1904 # Since: 0.14.0
1906 { 'struct': 'SpiceChannel',
1907   'base': 'SpiceBasicInfo',
1908   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1909            'tls': 'bool'} }
1912 # @SpiceQueryMouseMode:
1914 # An enumeration of Spice mouse states.
1916 # @client: Mouse cursor position is determined by the client.
1918 # @server: Mouse cursor position is determined by the server.
1920 # @unknown: No information is available about mouse mode used by
1921 #           the spice server.
1923 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1925 # Since: 1.1
1927 { 'enum': 'SpiceQueryMouseMode',
1928   'data': [ 'client', 'server', 'unknown' ] }
1931 # @SpiceInfo:
1933 # Information about the SPICE session.
1935 # @enabled: true if the SPICE server is enabled, false otherwise
1937 # @migrated: true if the last guest migration completed and spice
1938 #            migration had completed as well. false otherwise. (since 1.4)
1940 # @host: The hostname the SPICE server is bound to.  This depends on
1941 #        the name resolution on the host and may be an IP address.
1943 # @port: The SPICE server's port number.
1945 # @compiled-version: SPICE server version.
1947 # @tls-port: The SPICE server's TLS port number.
1949 # @auth: the current authentication type used by the server
1950 #        'none'  if no authentication is being used
1951 #        'spice' uses SASL or direct TLS authentication, depending on command
1952 #                line options
1954 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1955 #              be determined by the client or the server, or unknown if spice
1956 #              server doesn't provide this information. (since: 1.1)
1958 # @channels: a list of @SpiceChannel for each active spice channel
1960 # Since: 0.14.0
1962 { 'struct': 'SpiceInfo',
1963   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1964            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1965            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1968 # @query-spice:
1970 # Returns information about the current SPICE server
1972 # Returns: @SpiceInfo
1974 # Since: 0.14.0
1976 # Example:
1978 # -> { "execute": "query-spice" }
1979 # <- { "return": {
1980 #          "enabled": true,
1981 #          "auth": "spice",
1982 #          "port": 5920,
1983 #          "tls-port": 5921,
1984 #          "host": "0.0.0.0",
1985 #          "channels": [
1986 #             {
1987 #                "port": "54924",
1988 #                "family": "ipv4",
1989 #                "channel-type": 1,
1990 #                "connection-id": 1804289383,
1991 #                "host": "127.0.0.1",
1992 #                "channel-id": 0,
1993 #                "tls": true
1994 #             },
1995 #             {
1996 #                "port": "36710",
1997 #                "family": "ipv4",
1998 #                "channel-type": 4,
1999 #                "connection-id": 1804289383,
2000 #                "host": "127.0.0.1",
2001 #                "channel-id": 0,
2002 #                "tls": false
2003 #             },
2004 #             [ ... more channels follow ... ]
2005 #          ]
2006 #       }
2007 #    }
2010 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
2013 # @BalloonInfo:
2015 # Information about the guest balloon device.
2017 # @actual: the number of bytes the balloon currently contains
2019 # Since: 0.14.0
2022 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
2025 # @query-balloon:
2027 # Return information about the balloon device.
2029 # Returns: @BalloonInfo on success
2031 #          If the balloon driver is enabled but not functional because the KVM
2032 #          kernel module cannot support it, KvmMissingCap
2034 #          If no balloon device is present, DeviceNotActive
2036 # Since: 0.14.0
2038 # Example:
2040 # -> { "execute": "query-balloon" }
2041 # <- { "return": {
2042 #          "actual": 1073741824,
2043 #       }
2044 #    }
2047 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
2050 # @PciMemoryRange:
2052 # A PCI device memory region
2054 # @base: the starting address (guest physical)
2056 # @limit: the ending address (guest physical)
2058 # Since: 0.14.0
2060 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
2063 # @PciMemoryRegion:
2065 # Information about a PCI device I/O region.
2067 # @bar: the index of the Base Address Register for this region
2069 # @type: 'io' if the region is a PIO region
2070 #        'memory' if the region is a MMIO region
2072 # @size: memory size
2074 # @prefetch: if @type is 'memory', true if the memory is prefetchable
2076 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
2078 # Since: 0.14.0
2080 { 'struct': 'PciMemoryRegion',
2081   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
2082            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
2085 # @PciBusInfo:
2087 # Information about a bus of a PCI Bridge device
2089 # @number: primary bus interface number.  This should be the number of the
2090 #          bus the device resides on.
2092 # @secondary: secondary bus interface number.  This is the number of the
2093 #             main bus for the bridge
2095 # @subordinate: This is the highest number bus that resides below the
2096 #               bridge.
2098 # @io_range: The PIO range for all devices on this bridge
2100 # @memory_range: The MMIO range for all devices on this bridge
2102 # @prefetchable_range: The range of prefetchable MMIO for all devices on
2103 #                      this bridge
2105 # Since: 2.4
2107 { 'struct': 'PciBusInfo',
2108   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
2109            'io_range': 'PciMemoryRange',
2110            'memory_range': 'PciMemoryRange',
2111            'prefetchable_range': 'PciMemoryRange' } }
2114 # @PciBridgeInfo:
2116 # Information about a PCI Bridge device
2118 # @bus: information about the bus the device resides on
2120 # @devices: a list of @PciDeviceInfo for each device on this bridge
2122 # Since: 0.14.0
2124 { 'struct': 'PciBridgeInfo',
2125   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
2128 # @PciDeviceClass:
2130 # Information about the Class of a PCI device
2132 # @desc: a string description of the device's class
2134 # @class: the class code of the device
2136 # Since: 2.4
2138 { 'struct': 'PciDeviceClass',
2139   'data': {'*desc': 'str', 'class': 'int'} }
2142 # @PciDeviceId:
2144 # Information about the Id of a PCI device
2146 # @device: the PCI device id
2148 # @vendor: the PCI vendor id
2150 # Since: 2.4
2152 { 'struct': 'PciDeviceId',
2153   'data': {'device': 'int', 'vendor': 'int'} }
2156 # @PciDeviceInfo:
2158 # Information about a PCI device
2160 # @bus: the bus number of the device
2162 # @slot: the slot the device is located in
2164 # @function: the function of the slot used by the device
2166 # @class_info: the class of the device
2168 # @id: the PCI device id
2170 # @irq: if an IRQ is assigned to the device, the IRQ number
2172 # @qdev_id: the device name of the PCI device
2174 # @pci_bridge: if the device is a PCI bridge, the bridge information
2176 # @regions: a list of the PCI I/O regions associated with the device
2178 # Notes: the contents of @class_info.desc are not stable and should only be
2179 #        treated as informational.
2181 # Since: 0.14.0
2183 { 'struct': 'PciDeviceInfo',
2184   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
2185            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
2186            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2187            'regions': ['PciMemoryRegion']} }
2190 # @PciInfo:
2192 # Information about a PCI bus
2194 # @bus: the bus index
2196 # @devices: a list of devices on this bus
2198 # Since: 0.14.0
2200 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
2203 # @query-pci:
2205 # Return information about the PCI bus topology of the guest.
2207 # Returns: a list of @PciInfo for each PCI bus. Each bus is
2208 # represented by a json-object, which has a key with a json-array of
2209 # all PCI devices attached to it. Each device is represented by a
2210 # json-object.
2212 # Since: 0.14.0
2214 # Example:
2216 # -> { "execute": "query-pci" }
2217 # <- { "return": [
2218 #          {
2219 #             "bus": 0,
2220 #             "devices": [
2221 #                {
2222 #                   "bus": 0,
2223 #                   "qdev_id": "",
2224 #                   "slot": 0,
2225 #                   "class_info": {
2226 #                      "class": 1536,
2227 #                      "desc": "Host bridge"
2228 #                   },
2229 #                   "id": {
2230 #                      "device": 32902,
2231 #                      "vendor": 4663
2232 #                   },
2233 #                   "function": 0,
2234 #                   "regions": [
2235 #                   ]
2236 #                },
2237 #                {
2238 #                   "bus": 0,
2239 #                   "qdev_id": "",
2240 #                   "slot": 1,
2241 #                   "class_info": {
2242 #                      "class": 1537,
2243 #                      "desc": "ISA bridge"
2244 #                   },
2245 #                   "id": {
2246 #                      "device": 32902,
2247 #                      "vendor": 28672
2248 #                   },
2249 #                   "function": 0,
2250 #                   "regions": [
2251 #                   ]
2252 #                },
2253 #                {
2254 #                   "bus": 0,
2255 #                   "qdev_id": "",
2256 #                   "slot": 1,
2257 #                   "class_info": {
2258 #                      "class": 257,
2259 #                      "desc": "IDE controller"
2260 #                   },
2261 #                   "id": {
2262 #                      "device": 32902,
2263 #                      "vendor": 28688
2264 #                   },
2265 #                   "function": 1,
2266 #                   "regions": [
2267 #                      {
2268 #                         "bar": 4,
2269 #                         "size": 16,
2270 #                         "address": 49152,
2271 #                         "type": "io"
2272 #                      }
2273 #                   ]
2274 #                },
2275 #                {
2276 #                   "bus": 0,
2277 #                   "qdev_id": "",
2278 #                   "slot": 2,
2279 #                   "class_info": {
2280 #                      "class": 768,
2281 #                      "desc": "VGA controller"
2282 #                   },
2283 #                   "id": {
2284 #                      "device": 4115,
2285 #                      "vendor": 184
2286 #                   },
2287 #                   "function": 0,
2288 #                   "regions": [
2289 #                      {
2290 #                         "prefetch": true,
2291 #                         "mem_type_64": false,
2292 #                         "bar": 0,
2293 #                         "size": 33554432,
2294 #                         "address": 4026531840,
2295 #                         "type": "memory"
2296 #                      },
2297 #                      {
2298 #                         "prefetch": false,
2299 #                         "mem_type_64": false,
2300 #                         "bar": 1,
2301 #                         "size": 4096,
2302 #                         "address": 4060086272,
2303 #                         "type": "memory"
2304 #                      },
2305 #                      {
2306 #                         "prefetch": false,
2307 #                         "mem_type_64": false,
2308 #                         "bar": 6,
2309 #                         "size": 65536,
2310 #                         "address": -1,
2311 #                         "type": "memory"
2312 #                      }
2313 #                   ]
2314 #                },
2315 #                {
2316 #                   "bus": 0,
2317 #                   "qdev_id": "",
2318 #                   "irq": 11,
2319 #                   "slot": 4,
2320 #                   "class_info": {
2321 #                      "class": 1280,
2322 #                      "desc": "RAM controller"
2323 #                   },
2324 #                   "id": {
2325 #                      "device": 6900,
2326 #                      "vendor": 4098
2327 #                   },
2328 #                   "function": 0,
2329 #                   "regions": [
2330 #                      {
2331 #                         "bar": 0,
2332 #                         "size": 32,
2333 #                         "address": 49280,
2334 #                         "type": "io"
2335 #                      }
2336 #                   ]
2337 #                }
2338 #             ]
2339 #          }
2340 #       ]
2341 #    }
2343 # Note: This example has been shortened as the real response is too long.
2346 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2349 # @quit:
2351 # This command will cause the QEMU process to exit gracefully.  While every
2352 # attempt is made to send the QMP response before terminating, this is not
2353 # guaranteed.  When using this interface, a premature EOF would not be
2354 # unexpected.
2356 # Since: 0.14.0
2358 # Example:
2360 # -> { "execute": "quit" }
2361 # <- { "return": {} }
2363 { 'command': 'quit' }
2366 # @stop:
2368 # Stop all guest VCPU execution.
2370 # Since:  0.14.0
2372 # Notes:  This function will succeed even if the guest is already in the stopped
2373 #         state.  In "inmigrate" state, it will ensure that the guest
2374 #         remains paused once migration finishes, as if the -S option was
2375 #         passed on the command line.
2377 # Example:
2379 # -> { "execute": "stop" }
2380 # <- { "return": {} }
2383 { 'command': 'stop' }
2386 # @system_reset:
2388 # Performs a hard reset of a guest.
2390 # Since: 0.14.0
2392 # Example:
2394 # -> { "execute": "system_reset" }
2395 # <- { "return": {} }
2398 { 'command': 'system_reset' }
2401 # @system_powerdown:
2403 # Requests that a guest perform a powerdown operation.
2405 # Since: 0.14.0
2407 # Notes: A guest may or may not respond to this command.  This command
2408 #        returning does not indicate that a guest has accepted the request or
2409 #        that it has shut down.  Many guests will respond to this command by
2410 #        prompting the user in some way.
2411 # Example:
2413 # -> { "execute": "system_powerdown" }
2414 # <- { "return": {} }
2417 { 'command': 'system_powerdown' }
2420 # @cpu:
2422 # This command is a nop that is only provided for the purposes of compatibility.
2424 # Since: 0.14.0
2426 # Notes: Do not use this command.
2428 { 'command': 'cpu', 'data': {'index': 'int'} }
2431 # @cpu-add:
2433 # Adds CPU with specified ID
2435 # @id: ID of CPU to be created, valid values [0..max_cpus)
2437 # Returns: Nothing on success
2439 # Since: 1.5
2441 # Example:
2443 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2444 # <- { "return": {} }
2447 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2450 # @memsave:
2452 # Save a portion of guest memory to a file.
2454 # @val: the virtual address of the guest to start from
2456 # @size: the size of memory region to save
2458 # @filename: the file to save the memory to as binary data
2460 # @cpu-index: the index of the virtual CPU to use for translating the
2461 #                       virtual address (defaults to CPU 0)
2463 # Returns: Nothing on success
2465 # Since: 0.14.0
2467 # Notes: Errors were not reliably returned until 1.1
2469 # Example:
2471 # -> { "execute": "memsave",
2472 #      "arguments": { "val": 10,
2473 #                     "size": 100,
2474 #                     "filename": "/tmp/virtual-mem-dump" } }
2475 # <- { "return": {} }
2478 { 'command': 'memsave',
2479   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2482 # @pmemsave:
2484 # Save a portion of guest physical memory to a file.
2486 # @val: the physical address of the guest to start from
2488 # @size: the size of memory region to save
2490 # @filename: the file to save the memory to as binary data
2492 # Returns: Nothing on success
2494 # Since: 0.14.0
2496 # Notes: Errors were not reliably returned until 1.1
2498 # Example:
2500 # -> { "execute": "pmemsave",
2501 #      "arguments": { "val": 10,
2502 #                     "size": 100,
2503 #                     "filename": "/tmp/physical-mem-dump" } }
2504 # <- { "return": {} }
2507 { 'command': 'pmemsave',
2508   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2511 # @cont:
2513 # Resume guest VCPU execution.
2515 # Since:  0.14.0
2517 # Returns:  If successful, nothing
2519 # Notes:  This command will succeed if the guest is currently running.  It
2520 #         will also succeed if the guest is in the "inmigrate" state; in
2521 #         this case, the effect of the command is to make sure the guest
2522 #         starts once migration finishes, removing the effect of the -S
2523 #         command line option if it was passed.
2525 # Example:
2527 # -> { "execute": "cont" }
2528 # <- { "return": {} }
2531 { 'command': 'cont' }
2534 # @system_wakeup:
2536 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2538 # Since:  1.1
2540 # Returns:  nothing.
2542 # Example:
2544 # -> { "execute": "system_wakeup" }
2545 # <- { "return": {} }
2548 { 'command': 'system_wakeup' }
2551 # @inject-nmi:
2553 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2554 # The command fails when the guest doesn't support injecting.
2556 # Returns:  If successful, nothing
2558 # Since:  0.14.0
2560 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2562 # Example:
2564 # -> { "execute": "inject-nmi" }
2565 # <- { "return": {} }
2568 { 'command': 'inject-nmi' }
2571 # @set_link:
2573 # Sets the link status of a virtual network adapter.
2575 # @name: the device name of the virtual network adapter
2577 # @up: true to set the link status to be up
2579 # Returns: Nothing on success
2580 #          If @name is not a valid network device, DeviceNotFound
2582 # Since: 0.14.0
2584 # Notes: Not all network adapters support setting link status.  This command
2585 #        will succeed even if the network adapter does not support link status
2586 #        notification.
2588 # Example:
2590 # -> { "execute": "set_link",
2591 #      "arguments": { "name": "e1000.0", "up": false } }
2592 # <- { "return": {} }
2595 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2598 # @balloon:
2600 # Request the balloon driver to change its balloon size.
2602 # @value: the target size of the balloon in bytes
2604 # Returns: Nothing on success
2605 #          If the balloon driver is enabled but not functional because the KVM
2606 #            kernel module cannot support it, KvmMissingCap
2607 #          If no balloon device is present, DeviceNotActive
2609 # Notes: This command just issues a request to the guest.  When it returns,
2610 #        the balloon size may not have changed.  A guest can change the balloon
2611 #        size independent of this command.
2613 # Since: 0.14.0
2615 # Example:
2617 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2618 # <- { "return": {} }
2621 { 'command': 'balloon', 'data': {'value': 'int'} }
2624 # @Abort:
2626 # This action can be used to test transaction failure.
2628 # Since: 1.6
2630 { 'struct': 'Abort',
2631   'data': { } }
2634 # @ActionCompletionMode:
2636 # An enumeration of Transactional completion modes.
2638 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2639 #              after the Transaction request succeeds. All Actions that
2640 #              can complete successfully will do so without waiting on others.
2641 #              This is the default.
2643 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2644 #           Actions. Actions do not complete until all Actions are ready to
2645 #           complete. May be rejected by Actions that do not support this
2646 #           completion mode.
2648 # Since: 2.5
2650 { 'enum': 'ActionCompletionMode',
2651   'data': [ 'individual', 'grouped' ] }
2654 # @TransactionAction:
2656 # A discriminated record of operations that can be performed with
2657 # @transaction. Action @type can be:
2659 # - @abort: since 1.6
2660 # - @block-dirty-bitmap-add: since 2.5
2661 # - @block-dirty-bitmap-clear: since 2.5
2662 # - @blockdev-backup: since 2.3
2663 # - @blockdev-snapshot: since 2.5
2664 # - @blockdev-snapshot-internal-sync: since 1.7
2665 # - @blockdev-snapshot-sync: since 1.1
2666 # - @drive-backup: since 1.6
2668 # Since: 1.1
2670 { 'union': 'TransactionAction',
2671   'data': {
2672        'abort': 'Abort',
2673        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2674        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2675        'blockdev-backup': 'BlockdevBackup',
2676        'blockdev-snapshot': 'BlockdevSnapshot',
2677        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2678        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2679        'drive-backup': 'DriveBackup'
2680    } }
2683 # @TransactionProperties:
2685 # Optional arguments to modify the behavior of a Transaction.
2687 # @completion-mode: Controls how jobs launched asynchronously by
2688 #                   Actions will complete or fail as a group.
2689 #                   See @ActionCompletionMode for details.
2691 # Since: 2.5
2693 { 'struct': 'TransactionProperties',
2694   'data': {
2695        '*completion-mode': 'ActionCompletionMode'
2696   }
2700 # @transaction:
2702 # Executes a number of transactionable QMP commands atomically. If any
2703 # operation fails, then the entire set of actions will be abandoned and the
2704 # appropriate error returned.
2706 # For external snapshots, the dictionary contains the device, the file to use for
2707 # the new snapshot, and the format.  The default format, if not specified, is
2708 # qcow2.
2710 # Each new snapshot defaults to being created by QEMU (wiping any
2711 # contents if the file already exists), but it is also possible to reuse
2712 # an externally-created file.  In the latter case, you should ensure that
2713 # the new image file has the same contents as the current one; QEMU cannot
2714 # perform any meaningful check.  Typically this is achieved by using the
2715 # current image file as the backing file for the new image.
2717 # On failure, the original disks pre-snapshot attempt will be used.
2719 # For internal snapshots, the dictionary contains the device and the snapshot's
2720 # name.  If an internal snapshot matching name already exists, the request will
2721 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2722 # and sheepdog.
2724 # On failure, qemu will try delete the newly created internal snapshot in the
2725 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2726 # it later with qemu-img or other command.
2728 # @actions: List of @TransactionAction;
2729 #           information needed for the respective operations.
2731 # @properties: structure of additional options to control the
2732 #              execution of the transaction. See @TransactionProperties
2733 #              for additional detail.
2735 # Returns: nothing on success
2737 #          Errors depend on the operations of the transaction
2739 # Note: The transaction aborts on the first failure.  Therefore, there will be
2740 # information on only one failed operation returned in an error condition, and
2741 # subsequent actions will not have been attempted.
2743 # Since: 1.1
2745 # Example:
2747 # -> { "execute": "transaction",
2748 #      "arguments": { "actions": [
2749 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2750 #                                      "snapshot-file": "/some/place/my-image",
2751 #                                      "format": "qcow2" } },
2752 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2753 #                                      "snapshot-file": "/some/place/my-image2",
2754 #                                      "snapshot-node-name": "node3432",
2755 #                                      "mode": "existing",
2756 #                                      "format": "qcow2" } },
2757 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2758 #                                      "snapshot-file": "/some/place/my-image2",
2759 #                                      "mode": "existing",
2760 #                                      "format": "qcow2" } },
2761 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2762 #                                      "device": "ide-hd2",
2763 #                                      "name": "snapshot0" } } ] } }
2764 # <- { "return": {} }
2767 { 'command': 'transaction',
2768   'data': { 'actions': [ 'TransactionAction' ],
2769             '*properties': 'TransactionProperties'
2770           }
2774 # @human-monitor-command:
2776 # Execute a command on the human monitor and return the output.
2778 # @command-line: the command to execute in the human monitor
2780 # @cpu-index: The CPU to use for commands that require an implicit CPU
2782 # Returns: the output of the command as a string
2784 # Since: 0.14.0
2786 # Notes: This command only exists as a stop-gap.  Its use is highly
2787 #        discouraged.  The semantics of this command are not
2788 #        guaranteed: this means that command names, arguments and
2789 #        responses can change or be removed at ANY time.  Applications
2790 #        that rely on long term stability guarantees should NOT
2791 #        use this command.
2793 #        Known limitations:
2795 #        * This command is stateless, this means that commands that depend
2796 #          on state information (such as getfd) might not work
2798 #        * Commands that prompt the user for data don't currently work
2800 # Example:
2802 # -> { "execute": "human-monitor-command",
2803 #      "arguments": { "command-line": "info kvm" } }
2804 # <- { "return": "kvm support: enabled\r\n" }
2807 { 'command': 'human-monitor-command',
2808   'data': {'command-line': 'str', '*cpu-index': 'int'},
2809   'returns': 'str' }
2812 # @migrate_cancel:
2814 # Cancel the current executing migration process.
2816 # Returns: nothing on success
2818 # Notes: This command succeeds even if there is no migration process running.
2820 # Since: 0.14.0
2822 # Example:
2824 # -> { "execute": "migrate_cancel" }
2825 # <- { "return": {} }
2828 { 'command': 'migrate_cancel' }
2831 # @migrate_set_downtime:
2833 # Set maximum tolerated downtime for migration.
2835 # @value: maximum downtime in seconds
2837 # Returns: nothing on success
2839 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2841 # Since: 0.14.0
2843 # Example:
2845 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2846 # <- { "return": {} }
2849 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2852 # @migrate_set_speed:
2854 # Set maximum speed for migration.
2856 # @value: maximum speed in bytes per second.
2858 # Returns: nothing on success
2860 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2862 # Since: 0.14.0
2864 # Example:
2866 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2867 # <- { "return": {} }
2870 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2873 # @migrate-set-cache-size:
2875 # Set cache size to be used by XBZRLE migration
2877 # @value: cache size in bytes
2879 # The size will be rounded down to the nearest power of 2.
2880 # The cache size can be modified before and during ongoing migration
2882 # Returns: nothing on success
2884 # Since: 1.2
2886 # Example:
2888 # -> { "execute": "migrate-set-cache-size",
2889 #      "arguments": { "value": 536870912 } }
2890 # <- { "return": {} }
2893 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2896 # @query-migrate-cache-size:
2898 # Query migration XBZRLE cache size
2900 # Returns: XBZRLE cache size in bytes
2902 # Since: 1.2
2904 # Example:
2906 # -> { "execute": "query-migrate-cache-size" }
2907 # <- { "return": 67108864 }
2910 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2913 # @ObjectPropertyInfo:
2915 # @name: the name of the property
2917 # @type: the type of the property.  This will typically come in one of four
2918 #        forms:
2920 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2921 #           These types are mapped to the appropriate JSON type.
2923 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2924 #           device type name.  Child properties create the composition tree.
2926 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2927 #           device type name.  Link properties form the device model graph.
2929 # Since: 1.2
2931 { 'struct': 'ObjectPropertyInfo',
2932   'data': { 'name': 'str', 'type': 'str' } }
2935 # @qom-list:
2937 # This command will list any properties of a object given a path in the object
2938 # model.
2940 # @path: the path within the object model.  See @qom-get for a description of
2941 #        this parameter.
2943 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2944 #          object.
2946 # Since: 1.2
2948 { 'command': 'qom-list',
2949   'data': { 'path': 'str' },
2950   'returns': [ 'ObjectPropertyInfo' ] }
2953 # @qom-get:
2955 # This command will get a property from a object model path and return the
2956 # value.
2958 # @path: The path within the object model.  There are two forms of supported
2959 #        paths--absolute and partial paths.
2961 #        Absolute paths are derived from the root object and can follow child<>
2962 #        or link<> properties.  Since they can follow link<> properties, they
2963 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2964 #        and are prefixed  with a leading slash.
2966 #        Partial paths look like relative filenames.  They do not begin
2967 #        with a prefix.  The matching rules for partial paths are subtle but
2968 #        designed to make specifying objects easy.  At each level of the
2969 #        composition tree, the partial path is matched as an absolute path.
2970 #        The first match is not returned.  At least two matches are searched
2971 #        for.  A successful result is only returned if only one match is
2972 #        found.  If more than one match is found, a flag is return to
2973 #        indicate that the match was ambiguous.
2975 # @property: The property name to read
2977 # Returns: The property value.  The type depends on the property
2978 #          type. child<> and link<> properties are returned as #str
2979 #          pathnames.  All integer property types (u8, u16, etc) are
2980 #          returned as #int.
2982 # Since: 1.2
2984 { 'command': 'qom-get',
2985   'data': { 'path': 'str', 'property': 'str' },
2986   'returns': 'any' }
2989 # @qom-set:
2991 # This command will set a property from a object model path.
2993 # @path: see @qom-get for a description of this parameter
2995 # @property: the property name to set
2997 # @value: a value who's type is appropriate for the property type.  See @qom-get
2998 #         for a description of type mapping.
3000 # Since: 1.2
3002 { 'command': 'qom-set',
3003   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
3006 # @set_password:
3008 # Sets the password of a remote display session.
3010 # @protocol: `vnc' to modify the VNC server password
3011 #            `spice' to modify the Spice server password
3013 # @password: the new password
3015 # @connected: how to handle existing clients when changing the
3016 #                       password.  If nothing is specified, defaults to `keep'
3017 #                       `fail' to fail the command if clients are connected
3018 #                       `disconnect' to disconnect existing clients
3019 #                       `keep' to maintain existing clients
3021 # Returns: Nothing on success
3022 #          If Spice is not enabled, DeviceNotFound
3024 # Since: 0.14.0
3026 # Example:
3028 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
3029 #                                                "password": "secret" } }
3030 # <- { "return": {} }
3033 { 'command': 'set_password',
3034   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
3037 # @expire_password:
3039 # Expire the password of a remote display server.
3041 # @protocol: the name of the remote display protocol `vnc' or `spice'
3043 # @time: when to expire the password.
3044 #        `now' to expire the password immediately
3045 #        `never' to cancel password expiration
3046 #        `+INT' where INT is the number of seconds from now (integer)
3047 #        `INT' where INT is the absolute time in seconds
3049 # Returns: Nothing on success
3050 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
3052 # Since: 0.14.0
3054 # Notes: Time is relative to the server and currently there is no way to
3055 #        coordinate server time with client time.  It is not recommended to
3056 #        use the absolute time version of the @time parameter unless you're
3057 #        sure you are on the same machine as the QEMU instance.
3059 # Example:
3061 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
3062 #                                                   "time": "+60" } }
3063 # <- { "return": {} }
3066 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
3069 # @change-vnc-password:
3071 # Change the VNC server password.
3073 # @password:  the new password to use with VNC authentication
3075 # Since: 1.1
3077 # Notes:  An empty password in this command will set the password to the empty
3078 #         string.  Existing clients are unaffected by executing this command.
3080 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
3083 # @change:
3085 # This command is multiple commands multiplexed together.
3087 # @device: This is normally the name of a block device but it may also be 'vnc'.
3088 #          when it's 'vnc', then sub command depends on @target
3090 # @target: If @device is a block device, then this is the new filename.
3091 #          If @device is 'vnc', then if the value 'password' selects the vnc
3092 #          change password command.   Otherwise, this specifies a new server URI
3093 #          address to listen to for VNC connections.
3095 # @arg:    If @device is a block device, then this is an optional format to open
3096 #          the device with.
3097 #          If @device is 'vnc' and @target is 'password', this is the new VNC
3098 #          password to set.  See change-vnc-password for additional notes.
3100 # Returns: Nothing on success.
3101 #          If @device is not a valid block device, DeviceNotFound
3103 # Notes:  This interface is deprecated, and it is strongly recommended that you
3104 #         avoid using it.  For changing block devices, use
3105 #         blockdev-change-medium; for changing VNC parameters, use
3106 #         change-vnc-password.
3108 # Since: 0.14.0
3110 # Example:
3112 # 1. Change a removable medium
3114 # -> { "execute": "change",
3115 #      "arguments": { "device": "ide1-cd0",
3116 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
3117 # <- { "return": {} }
3119 # 2. Change VNC password
3121 # -> { "execute": "change",
3122 #      "arguments": { "device": "vnc", "target": "password",
3123 #                     "arg": "foobar1" } }
3124 # <- { "return": {} }
3127 { 'command': 'change',
3128   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
3131 # @ObjectTypeInfo:
3133 # This structure describes a search result from @qom-list-types
3135 # @name: the type name found in the search
3137 # @abstract: the type is abstract and can't be directly instantiated.
3138 #            Omitted if false. (since 2.10)
3140 # @parent: Name of parent type, if any (since 2.10)
3142 # Since: 1.1
3144 { 'struct': 'ObjectTypeInfo',
3145   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
3148 # @qom-list-types:
3150 # This command will return a list of types given search parameters
3152 # @implements: if specified, only return types that implement this type name
3154 # @abstract: if true, include abstract types in the results
3156 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3158 # Since: 1.1
3160 { 'command': 'qom-list-types',
3161   'data': { '*implements': 'str', '*abstract': 'bool' },
3162   'returns': [ 'ObjectTypeInfo' ] }
3165 # @DevicePropertyInfo:
3167 # Information about device properties.
3169 # @name: the name of the property
3170 # @type: the typename of the property
3171 # @description: if specified, the description of the property.
3172 #               (since 2.2)
3174 # Since: 1.2
3176 { 'struct': 'DevicePropertyInfo',
3177   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
3180 # @device-list-properties:
3182 # List properties associated with a device.
3184 # @typename: the type name of a device
3186 # Returns: a list of DevicePropertyInfo describing a devices properties
3188 # Since: 1.2
3190 { 'command': 'device-list-properties',
3191   'data': { 'typename': 'str'},
3192   'returns': [ 'DevicePropertyInfo' ] }
3195 # @migrate:
3197 # Migrates the current running guest to another Virtual Machine.
3199 # @uri: the Uniform Resource Identifier of the destination VM
3201 # @blk: do block migration (full disk copy)
3203 # @inc: incremental disk copy migration
3205 # @detach: this argument exists only for compatibility reasons and
3206 #          is ignored by QEMU
3208 # Returns: nothing on success
3210 # Since: 0.14.0
3212 # Notes:
3214 # 1. The 'query-migrate' command should be used to check migration's progress
3215 #    and final result (this information is provided by the 'status' member)
3217 # 2. All boolean arguments default to false
3219 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
3220 #    be used
3222 # Example:
3224 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3225 # <- { "return": {} }
3228 { 'command': 'migrate',
3229   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
3232 # @migrate-incoming:
3234 # Start an incoming migration, the qemu must have been started
3235 # with -incoming defer
3237 # @uri: The Uniform Resource Identifier identifying the source or
3238 #       address to listen on
3240 # Returns: nothing on success
3242 # Since: 2.3
3244 # Notes:
3246 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3247 #    compatible with -incoming and the format of the uri is already exposed
3248 #    above libvirt.
3250 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3251 #    be used.
3253 # 3. The uri format is the same as for -incoming
3255 # Example:
3257 # -> { "execute": "migrate-incoming",
3258 #      "arguments": { "uri": "tcp::4446" } }
3259 # <- { "return": {} }
3262 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3265 # @xen-save-devices-state:
3267 # Save the state of all devices to file. The RAM and the block devices
3268 # of the VM are not saved by this command.
3270 # @filename: the file to save the state of the devices to as binary
3271 # data. See xen-save-devices-state.txt for a description of the binary
3272 # format.
3274 # Returns: Nothing on success
3276 # Since: 1.1
3278 # Example:
3280 # -> { "execute": "xen-save-devices-state",
3281 #      "arguments": { "filename": "/tmp/save" } }
3282 # <- { "return": {} }
3285 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3288 # @xen-set-global-dirty-log:
3290 # Enable or disable the global dirty log mode.
3292 # @enable: true to enable, false to disable.
3294 # Returns: nothing
3296 # Since: 1.3
3298 # Example:
3300 # -> { "execute": "xen-set-global-dirty-log",
3301 #      "arguments": { "enable": true } }
3302 # <- { "return": {} }
3305 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3308 # @device_add:
3310 # @driver: the name of the new device's driver
3312 # @bus: the device's parent bus (device tree path)
3314 # @id: the device's ID, must be unique
3316 # Additional arguments depend on the type.
3318 # Add a device.
3320 # Notes:
3321 # 1. For detailed information about this command, please refer to the
3322 #    'docs/qdev-device-use.txt' file.
3324 # 2. It's possible to list device properties by running QEMU with the
3325 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3326 #    device's name
3328 # Example:
3330 # -> { "execute": "device_add",
3331 #      "arguments": { "driver": "e1000", "id": "net1",
3332 #                     "bus": "pci.0",
3333 #                     "mac": "52:54:00:12:34:56" } }
3334 # <- { "return": {} }
3336 # TODO: This command effectively bypasses QAPI completely due to its
3337 # "additional arguments" business.  It shouldn't have been added to
3338 # the schema in this form.  It should be qapified properly, or
3339 # replaced by a properly qapified command.
3341 # Since: 0.13
3343 { 'command': 'device_add',
3344   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3345   'gen': false } # so we can get the additional arguments
3348 # @device_del:
3350 # Remove a device from a guest
3352 # @id: the device's ID or QOM path
3354 # Returns: Nothing on success
3355 #          If @id is not a valid device, DeviceNotFound
3357 # Notes: When this command completes, the device may not be removed from the
3358 #        guest.  Hot removal is an operation that requires guest cooperation.
3359 #        This command merely requests that the guest begin the hot removal
3360 #        process.  Completion of the device removal process is signaled with a
3361 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3362 #        for all devices.
3364 # Since: 0.14.0
3366 # Example:
3368 # -> { "execute": "device_del",
3369 #      "arguments": { "id": "net1" } }
3370 # <- { "return": {} }
3372 # -> { "execute": "device_del",
3373 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3374 # <- { "return": {} }
3377 { 'command': 'device_del', 'data': {'id': 'str'} }
3380 # @DumpGuestMemoryFormat:
3382 # An enumeration of guest-memory-dump's format.
3384 # @elf: elf format
3386 # @kdump-zlib: kdump-compressed format with zlib-compressed
3388 # @kdump-lzo: kdump-compressed format with lzo-compressed
3390 # @kdump-snappy: kdump-compressed format with snappy-compressed
3392 # Since: 2.0
3394 { 'enum': 'DumpGuestMemoryFormat',
3395   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3398 # @dump-guest-memory:
3400 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3401 # very long depending on the amount of guest memory.
3403 # @paging: if true, do paging to get guest's memory mapping. This allows
3404 #          using gdb to process the core file.
3406 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3407 #                     of RAM. This can happen for a large guest, or a
3408 #                     malicious guest pretending to be large.
3410 #          Also, paging=true has the following limitations:
3412 #             1. The guest may be in a catastrophic state or can have corrupted
3413 #                memory, which cannot be trusted
3414 #             2. The guest can be in real-mode even if paging is enabled. For
3415 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3416 #                goes in real-mode
3417 #             3. Currently only supported on i386 and x86_64.
3419 # @protocol: the filename or file descriptor of the vmcore. The supported
3420 #            protocols are:
3422 #            1. file: the protocol starts with "file:", and the following
3423 #               string is the file's path.
3424 #            2. fd: the protocol starts with "fd:", and the following string
3425 #               is the fd's name.
3427 # @detach: if true, QMP will return immediately rather than
3428 #          waiting for the dump to finish. The user can track progress
3429 #          using "query-dump". (since 2.6).
3431 # @begin: if specified, the starting physical address.
3433 # @length: if specified, the memory size, in bytes. If you don't
3434 #          want to dump all guest's memory, please specify the start @begin
3435 #          and @length
3437 # @format: if specified, the format of guest memory dump. But non-elf
3438 #          format is conflict with paging and filter, ie. @paging, @begin and
3439 #          @length is not allowed to be specified with non-elf @format at the
3440 #          same time (since 2.0)
3442 # Note: All boolean arguments default to false
3444 # Returns: nothing on success
3446 # Since: 1.2
3448 # Example:
3450 # -> { "execute": "dump-guest-memory",
3451 #      "arguments": { "protocol": "fd:dump" } }
3452 # <- { "return": {} }
3455 { 'command': 'dump-guest-memory',
3456   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3457             '*begin': 'int', '*length': 'int',
3458             '*format': 'DumpGuestMemoryFormat'} }
3461 # @DumpStatus:
3463 # Describe the status of a long-running background guest memory dump.
3465 # @none: no dump-guest-memory has started yet.
3467 # @active: there is one dump running in background.
3469 # @completed: the last dump has finished successfully.
3471 # @failed: the last dump has failed.
3473 # Since: 2.6
3475 { 'enum': 'DumpStatus',
3476   'data': [ 'none', 'active', 'completed', 'failed' ] }
3479 # @DumpQueryResult:
3481 # The result format for 'query-dump'.
3483 # @status: enum of @DumpStatus, which shows current dump status
3485 # @completed: bytes written in latest dump (uncompressed)
3487 # @total: total bytes to be written in latest dump (uncompressed)
3489 # Since: 2.6
3491 { 'struct': 'DumpQueryResult',
3492   'data': { 'status': 'DumpStatus',
3493             'completed': 'int',
3494             'total': 'int' } }
3497 # @query-dump:
3499 # Query latest dump status.
3501 # Returns: A @DumpStatus object showing the dump status.
3503 # Since: 2.6
3505 # Example:
3507 # -> { "execute": "query-dump" }
3508 # <- { "return": { "status": "active", "completed": 1024000,
3509 #                  "total": 2048000 } }
3512 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3515 # @DumpGuestMemoryCapability:
3517 # A list of the available formats for dump-guest-memory
3519 # Since: 2.0
3521 { 'struct': 'DumpGuestMemoryCapability',
3522   'data': {
3523       'formats': ['DumpGuestMemoryFormat'] } }
3526 # @query-dump-guest-memory-capability:
3528 # Returns the available formats for dump-guest-memory
3530 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3531 #           dump-guest-memory
3533 # Since: 2.0
3535 # Example:
3537 # -> { "execute": "query-dump-guest-memory-capability" }
3538 # <- { "return": { "formats":
3539 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3542 { 'command': 'query-dump-guest-memory-capability',
3543   'returns': 'DumpGuestMemoryCapability' }
3546 # @dump-skeys:
3548 # Dump guest's storage keys
3550 # @filename: the path to the file to dump to
3552 # This command is only supported on s390 architecture.
3554 # Since: 2.5
3556 # Example:
3558 # -> { "execute": "dump-skeys",
3559 #      "arguments": { "filename": "/tmp/skeys" } }
3560 # <- { "return": {} }
3563 { 'command': 'dump-skeys',
3564   'data': { 'filename': 'str' } }
3567 # @netdev_add:
3569 # Add a network backend.
3571 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3572 #        'vde', 'socket', 'dump' and 'bridge'
3574 # @id: the name of the new network backend
3576 # Additional arguments depend on the type.
3578 # TODO: This command effectively bypasses QAPI completely due to its
3579 # "additional arguments" business.  It shouldn't have been added to
3580 # the schema in this form.  It should be qapified properly, or
3581 # replaced by a properly qapified command.
3583 # Since: 0.14.0
3585 # Returns: Nothing on success
3586 #          If @type is not a valid network backend, DeviceNotFound
3588 # Example:
3590 # -> { "execute": "netdev_add",
3591 #      "arguments": { "type": "user", "id": "netdev1",
3592 #                     "dnssearch": "example.org" } }
3593 # <- { "return": {} }
3596 { 'command': 'netdev_add',
3597   'data': {'type': 'str', 'id': 'str'},
3598   'gen': false }                # so we can get the additional arguments
3601 # @netdev_del:
3603 # Remove a network backend.
3605 # @id: the name of the network backend to remove
3607 # Returns: Nothing on success
3608 #          If @id is not a valid network backend, DeviceNotFound
3610 # Since: 0.14.0
3612 # Example:
3614 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3615 # <- { "return": {} }
3618 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3621 # @object-add:
3623 # Create a QOM object.
3625 # @qom-type: the class name for the object to be created
3627 # @id: the name of the new object
3629 # @props: a dictionary of properties to be passed to the backend
3631 # Returns: Nothing on success
3632 #          Error if @qom-type is not a valid class name
3634 # Since: 2.0
3636 # Example:
3638 # -> { "execute": "object-add",
3639 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3640 #                     "props": { "filename": "/dev/hwrng" } } }
3641 # <- { "return": {} }
3644 { 'command': 'object-add',
3645   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3648 # @object-del:
3650 # Remove a QOM object.
3652 # @id: the name of the QOM object to remove
3654 # Returns: Nothing on success
3655 #          Error if @id is not a valid id for a QOM object
3657 # Since: 2.0
3659 # Example:
3661 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3662 # <- { "return": {} }
3665 { 'command': 'object-del', 'data': {'id': 'str'} }
3668 # @NetdevNoneOptions:
3670 # Use it alone to have zero network devices.
3672 # Since: 1.2
3674 { 'struct': 'NetdevNoneOptions',
3675   'data': { } }
3678 # @NetLegacyNicOptions:
3680 # Create a new Network Interface Card.
3682 # @netdev: id of -netdev to connect to
3684 # @macaddr: MAC address
3686 # @model: device model (e1000, rtl8139, virtio etc.)
3688 # @addr: PCI device address
3690 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
3692 # Since: 1.2
3694 { 'struct': 'NetLegacyNicOptions',
3695   'data': {
3696     '*netdev':  'str',
3697     '*macaddr': 'str',
3698     '*model':   'str',
3699     '*addr':    'str',
3700     '*vectors': 'uint32' } }
3703 # @String:
3705 # A fat type wrapping 'str', to be embedded in lists.
3707 # Since: 1.2
3709 { 'struct': 'String',
3710   'data': {
3711     'str': 'str' } }
3714 # @NetdevUserOptions:
3716 # Use the user mode network stack which requires no administrator privilege to
3717 # run.
3719 # @hostname: client hostname reported by the builtin DHCP server
3721 # @restrict: isolate the guest from the host
3723 # @ipv4: whether to support IPv4, default true for enabled
3724 #        (since 2.6)
3726 # @ipv6: whether to support IPv6, default true for enabled
3727 #        (since 2.6)
3729 # @ip: legacy parameter, use net= instead
3731 # @net: IP network address that the guest will see, in the
3732 #       form addr[/netmask] The netmask is optional, and can be
3733 #       either in the form a.b.c.d or as a number of valid top-most
3734 #       bits. Default is 10.0.2.0/24.
3736 # @host: guest-visible address of the host
3738 # @tftp: root directory of the built-in TFTP server
3740 # @bootfile: BOOTP filename, for use with tftp=
3742 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
3743 #             assign
3745 # @dns: guest-visible address of the virtual nameserver
3747 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
3748 #             to the guest
3750 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
3751 #               2.6). The network prefix is given in the usual
3752 #               hexadecimal IPv6 address notation.
3754 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
3755 #                  (since 2.6)
3757 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
3759 # @ipv6-dns: guest-visible IPv6 address of the virtual
3760 #            nameserver (since 2.6)
3762 # @smb: root directory of the built-in SMB server
3764 # @smbserver: IP address of the built-in SMB server
3766 # @hostfwd: redirect incoming TCP or UDP host connections to guest
3767 #           endpoints
3769 # @guestfwd: forward guest TCP connections
3771 # Since: 1.2
3773 { 'struct': 'NetdevUserOptions',
3774   'data': {
3775     '*hostname':  'str',
3776     '*restrict':  'bool',
3777     '*ipv4':      'bool',
3778     '*ipv6':      'bool',
3779     '*ip':        'str',
3780     '*net':       'str',
3781     '*host':      'str',
3782     '*tftp':      'str',
3783     '*bootfile':  'str',
3784     '*dhcpstart': 'str',
3785     '*dns':       'str',
3786     '*dnssearch': ['String'],
3787     '*ipv6-prefix':      'str',
3788     '*ipv6-prefixlen':   'int',
3789     '*ipv6-host':        'str',
3790     '*ipv6-dns':         'str',
3791     '*smb':       'str',
3792     '*smbserver': 'str',
3793     '*hostfwd':   ['String'],
3794     '*guestfwd':  ['String'] } }
3797 # @NetdevTapOptions:
3799 # Connect the host TAP network interface name to the VLAN.
3801 # @ifname: interface name
3803 # @fd: file descriptor of an already opened tap
3805 # @fds: multiple file descriptors of already opened multiqueue capable
3806 # tap
3808 # @script: script to initialize the interface
3810 # @downscript: script to shut down the interface
3812 # @br: bridge name (since 2.8)
3814 # @helper: command to execute to configure bridge
3816 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
3818 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
3820 # @vhost: enable vhost-net network accelerator
3822 # @vhostfd: file descriptor of an already opened vhost net device
3824 # @vhostfds: file descriptors of multiple already opened vhost net
3825 # devices
3827 # @vhostforce: vhost on for non-MSIX virtio guests
3829 # @queues: number of queues to be created for multiqueue capable tap
3831 # @poll-us: maximum number of microseconds that could
3832 # be spent on busy polling for tap (since 2.7)
3834 # Since: 1.2
3836 { 'struct': 'NetdevTapOptions',
3837   'data': {
3838     '*ifname':     'str',
3839     '*fd':         'str',
3840     '*fds':        'str',
3841     '*script':     'str',
3842     '*downscript': 'str',
3843     '*br':         'str',
3844     '*helper':     'str',
3845     '*sndbuf':     'size',
3846     '*vnet_hdr':   'bool',
3847     '*vhost':      'bool',
3848     '*vhostfd':    'str',
3849     '*vhostfds':   'str',
3850     '*vhostforce': 'bool',
3851     '*queues':     'uint32',
3852     '*poll-us':    'uint32'} }
3855 # @NetdevSocketOptions:
3857 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3858 # socket connection.
3860 # @fd: file descriptor of an already opened socket
3862 # @listen: port number, and optional hostname, to listen on
3864 # @connect: port number, and optional hostname, to connect to
3866 # @mcast: UDP multicast address and port number
3868 # @localaddr: source address and port for multicast and udp packets
3870 # @udp: UDP unicast address and port number
3872 # Since: 1.2
3874 { 'struct': 'NetdevSocketOptions',
3875   'data': {
3876     '*fd':        'str',
3877     '*listen':    'str',
3878     '*connect':   'str',
3879     '*mcast':     'str',
3880     '*localaddr': 'str',
3881     '*udp':       'str' } }
3884 # @NetdevL2TPv3Options:
3886 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3888 # @src: source address
3890 # @dst: destination address
3892 # @srcport: source port - mandatory for udp, optional for ip
3894 # @dstport: destination port - mandatory for udp, optional for ip
3896 # @ipv6: force the use of ipv6
3898 # @udp: use the udp version of l2tpv3 encapsulation
3900 # @cookie64: use 64 bit coookies
3902 # @counter: have sequence counter
3904 # @pincounter: pin sequence counter to zero -
3905 #              workaround for buggy implementations or
3906 #              networks with packet reorder
3908 # @txcookie: 32 or 64 bit transmit cookie
3910 # @rxcookie: 32 or 64 bit receive cookie
3912 # @txsession: 32 bit transmit session
3914 # @rxsession: 32 bit receive session - if not specified
3915 #             set to the same value as transmit
3917 # @offset: additional offset - allows the insertion of
3918 #          additional application-specific data before the packet payload
3920 # Since: 2.1
3922 { 'struct': 'NetdevL2TPv3Options',
3923   'data': {
3924     'src':          'str',
3925     'dst':          'str',
3926     '*srcport':     'str',
3927     '*dstport':     'str',
3928     '*ipv6':        'bool',
3929     '*udp':         'bool',
3930     '*cookie64':    'bool',
3931     '*counter':     'bool',
3932     '*pincounter':  'bool',
3933     '*txcookie':    'uint64',
3934     '*rxcookie':    'uint64',
3935     'txsession':    'uint32',
3936     '*rxsession':   'uint32',
3937     '*offset':      'uint32' } }
3940 # @NetdevVdeOptions:
3942 # Connect the VLAN to a vde switch running on the host.
3944 # @sock: socket path
3946 # @port: port number
3948 # @group: group owner of socket
3950 # @mode: permissions for socket
3952 # Since: 1.2
3954 { 'struct': 'NetdevVdeOptions',
3955   'data': {
3956     '*sock':  'str',
3957     '*port':  'uint16',
3958     '*group': 'str',
3959     '*mode':  'uint16' } }
3962 # @NetdevDumpOptions:
3964 # Dump VLAN network traffic to a file.
3966 # @len: per-packet size limit (64k default). Understands [TGMKkb]
3967 # suffixes.
3969 # @file: dump file path (default is qemu-vlan0.pcap)
3971 # Since: 1.2
3973 { 'struct': 'NetdevDumpOptions',
3974   'data': {
3975     '*len':  'size',
3976     '*file': 'str' } }
3979 # @NetdevBridgeOptions:
3981 # Connect a host TAP network interface to a host bridge device.
3983 # @br: bridge name
3985 # @helper: command to execute to configure bridge
3987 # Since: 1.2
3989 { 'struct': 'NetdevBridgeOptions',
3990   'data': {
3991     '*br':     'str',
3992     '*helper': 'str' } }
3995 # @NetdevHubPortOptions:
3997 # Connect two or more net clients through a software hub.
3999 # @hubid: hub identifier number
4001 # Since: 1.2
4003 { 'struct': 'NetdevHubPortOptions',
4004   'data': {
4005     'hubid':     'int32' } }
4008 # @NetdevNetmapOptions:
4010 # Connect a client to a netmap-enabled NIC or to a VALE switch port
4012 # @ifname: Either the name of an existing network interface supported by
4013 #          netmap, or the name of a VALE port (created on the fly).
4014 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
4015 #          YYY are non-negative integers. XXX identifies a switch and
4016 #          YYY identifies a port of the switch. VALE ports having the
4017 #          same XXX are therefore connected to the same switch.
4019 # @devname: path of the netmap device (default: '/dev/netmap').
4021 # Since: 2.0
4023 { 'struct': 'NetdevNetmapOptions',
4024   'data': {
4025     'ifname':     'str',
4026     '*devname':    'str' } }
4029 # @NetdevVhostUserOptions:
4031 # Vhost-user network backend
4033 # @chardev: name of a unix socket chardev
4035 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
4037 # @queues: number of queues to be created for multiqueue vhost-user
4038 #          (default: 1) (Since 2.5)
4040 # Since: 2.1
4042 { 'struct': 'NetdevVhostUserOptions',
4043   'data': {
4044     'chardev':        'str',
4045     '*vhostforce':    'bool',
4046     '*queues':        'int' } }
4049 # @NetClientDriver:
4051 # Available netdev drivers.
4053 # Since: 2.7
4055 { 'enum': 'NetClientDriver',
4056   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
4057             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
4060 # @Netdev:
4062 # Captures the configuration of a network device.
4064 # @id: identifier for monitor commands.
4066 # @type: Specify the driver used for interpreting remaining arguments.
4068 # Since: 1.2
4070 # 'l2tpv3' - since 2.1
4072 { 'union': 'Netdev',
4073   'base': { 'id': 'str', 'type': 'NetClientDriver' },
4074   'discriminator': 'type',
4075   'data': {
4076     'none':     'NetdevNoneOptions',
4077     'nic':      'NetLegacyNicOptions',
4078     'user':     'NetdevUserOptions',
4079     'tap':      'NetdevTapOptions',
4080     'l2tpv3':   'NetdevL2TPv3Options',
4081     'socket':   'NetdevSocketOptions',
4082     'vde':      'NetdevVdeOptions',
4083     'dump':     'NetdevDumpOptions',
4084     'bridge':   'NetdevBridgeOptions',
4085     'hubport':  'NetdevHubPortOptions',
4086     'netmap':   'NetdevNetmapOptions',
4087     'vhost-user': 'NetdevVhostUserOptions' } }
4090 # @NetLegacy:
4092 # Captures the configuration of a network device; legacy.
4094 # @vlan: vlan number
4096 # @id: identifier for monitor commands
4098 # @name: identifier for monitor commands, ignored if @id is present
4100 # @opts: device type specific properties (legacy)
4102 # Since: 1.2
4104 { 'struct': 'NetLegacy',
4105   'data': {
4106     '*vlan': 'int32',
4107     '*id':   'str',
4108     '*name': 'str',
4109     'opts':  'NetLegacyOptions' } }
4112 # @NetLegacyOptionsType:
4114 # Since: 1.2
4116 { 'enum': 'NetLegacyOptionsType',
4117   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
4118            'dump', 'bridge', 'netmap', 'vhost-user'] }
4121 # @NetLegacyOptions:
4123 # Like Netdev, but for use only by the legacy command line options
4125 # Since: 1.2
4127 { 'union': 'NetLegacyOptions',
4128   'base': { 'type': 'NetLegacyOptionsType' },
4129   'discriminator': 'type',
4130   'data': {
4131     'none':     'NetdevNoneOptions',
4132     'nic':      'NetLegacyNicOptions',
4133     'user':     'NetdevUserOptions',
4134     'tap':      'NetdevTapOptions',
4135     'l2tpv3':   'NetdevL2TPv3Options',
4136     'socket':   'NetdevSocketOptions',
4137     'vde':      'NetdevVdeOptions',
4138     'dump':     'NetdevDumpOptions',
4139     'bridge':   'NetdevBridgeOptions',
4140     'netmap':   'NetdevNetmapOptions',
4141     'vhost-user': 'NetdevVhostUserOptions' } }
4144 # @NetFilterDirection:
4146 # Indicates whether a netfilter is attached to a netdev's transmit queue or
4147 # receive queue or both.
4149 # @all: the filter is attached both to the receive and the transmit
4150 #       queue of the netdev (default).
4152 # @rx: the filter is attached to the receive queue of the netdev,
4153 #      where it will receive packets sent to the netdev.
4155 # @tx: the filter is attached to the transmit queue of the netdev,
4156 #      where it will receive packets sent by the netdev.
4158 # Since: 2.5
4160 { 'enum': 'NetFilterDirection',
4161   'data': [ 'all', 'rx', 'tx' ] }
4164 # @InetSocketAddressBase:
4166 # @host: host part of the address
4167 # @port: port part of the address
4169 { 'struct': 'InetSocketAddressBase',
4170   'data': {
4171     'host': 'str',
4172     'port': 'str' } }
4175 # @InetSocketAddress:
4177 # Captures a socket address or address range in the Internet namespace.
4179 # @numeric: true if the host/port are guaranteed to be numeric,
4180 #           false if name resolution should be attempted. Defaults to false.
4181 #           (Since 2.9)
4183 # @to: If present, this is range of possible addresses, with port
4184 #      between @port and @to.
4186 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4188 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4190 # Since: 1.3
4192 { 'struct': 'InetSocketAddress',
4193   'base': 'InetSocketAddressBase',
4194   'data': {
4195     '*numeric':  'bool',
4196     '*to': 'uint16',
4197     '*ipv4': 'bool',
4198     '*ipv6': 'bool' } }
4201 # @UnixSocketAddress:
4203 # Captures a socket address in the local ("Unix socket") namespace.
4205 # @path: filesystem path to use
4207 # Since: 1.3
4209 { 'struct': 'UnixSocketAddress',
4210   'data': {
4211     'path': 'str' } }
4214 # @VsockSocketAddress:
4216 # Captures a socket address in the vsock namespace.
4218 # @cid: unique host identifier
4219 # @port: port
4221 # Note: string types are used to allow for possible future hostname or
4222 # service resolution support.
4224 # Since: 2.8
4226 { 'struct': 'VsockSocketAddress',
4227   'data': {
4228     'cid': 'str',
4229     'port': 'str' } }
4232 # @SocketAddressLegacy:
4234 # Captures the address of a socket, which could also be a named file descriptor
4236 # Note: This type is deprecated in favor of SocketAddress.  The
4237 # difference between SocketAddressLegacy and SocketAddress is that the
4238 # latter is a flat union rather than a simple union. Flat is nicer
4239 # because it avoids nesting on the wire, i.e. that form has fewer {}.
4242 # Since: 1.3
4244 { 'union': 'SocketAddressLegacy',
4245   'data': {
4246     'inet': 'InetSocketAddress',
4247     'unix': 'UnixSocketAddress',
4248     'vsock': 'VsockSocketAddress',
4249     'fd': 'String' } }
4252 # @SocketAddressType:
4254 # Available SocketAddress types
4256 # @inet:  Internet address
4258 # @unix:  Unix domain socket
4260 # Since: 2.9
4262 { 'enum': 'SocketAddressType',
4263   'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
4266 # @SocketAddress:
4268 # Captures the address of a socket, which could also be a named file
4269 # descriptor
4271 # @type:       Transport type
4273 # Since: 2.9
4275 { 'union': 'SocketAddress',
4276   'base': { 'type': 'SocketAddressType' },
4277   'discriminator': 'type',
4278   'data': { 'inet': 'InetSocketAddress',
4279             'unix': 'UnixSocketAddress',
4280             'vsock': 'VsockSocketAddress',
4281             'fd': 'String' } }
4284 # @getfd:
4286 # Receive a file descriptor via SCM rights and assign it a name
4288 # @fdname: file descriptor name
4290 # Returns: Nothing on success
4292 # Since: 0.14.0
4294 # Notes: If @fdname already exists, the file descriptor assigned to
4295 #        it will be closed and replaced by the received file
4296 #        descriptor.
4298 #        The 'closefd' command can be used to explicitly close the
4299 #        file descriptor when it is no longer needed.
4301 # Example:
4303 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4304 # <- { "return": {} }
4307 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4310 # @closefd:
4312 # Close a file descriptor previously passed via SCM rights
4314 # @fdname: file descriptor name
4316 # Returns: Nothing on success
4318 # Since: 0.14.0
4320 # Example:
4322 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4323 # <- { "return": {} }
4326 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4329 # @MachineInfo:
4331 # Information describing a machine.
4333 # @name: the name of the machine
4335 # @alias: an alias for the machine name
4337 # @is-default: whether the machine is default
4339 # @cpu-max: maximum number of CPUs supported by the machine type
4340 #           (since 1.5.0)
4342 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4344 # Since: 1.2.0
4346 { 'struct': 'MachineInfo',
4347   'data': { 'name': 'str', '*alias': 'str',
4348             '*is-default': 'bool', 'cpu-max': 'int',
4349             'hotpluggable-cpus': 'bool'} }
4352 # @query-machines:
4354 # Return a list of supported machines
4356 # Returns: a list of MachineInfo
4358 # Since: 1.2.0
4360 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4363 # @CpuDefinitionInfo:
4365 # Virtual CPU definition.
4367 # @name: the name of the CPU definition
4369 # @migration-safe: whether a CPU definition can be safely used for
4370 #                  migration in combination with a QEMU compatibility machine
4371 #                  when migrating between different QMU versions and between
4372 #                  hosts with different sets of (hardware or software)
4373 #                  capabilities. If not provided, information is not available
4374 #                  and callers should not assume the CPU definition to be
4375 #                  migration-safe. (since 2.8)
4377 # @static: whether a CPU definition is static and will not change depending on
4378 #          QEMU version, machine type, machine options and accelerator options.
4379 #          A static model is always migration-safe. (since 2.8)
4381 # @unavailable-features: List of properties that prevent
4382 #                        the CPU model from running in the current
4383 #                        host. (since 2.8)
4384 # @typename: Type name that can be used as argument to @device-list-properties,
4385 #            to introspect properties configurable using -cpu or -global.
4386 #            (since 2.9)
4388 # @unavailable-features is a list of QOM property names that
4389 # represent CPU model attributes that prevent the CPU from running.
4390 # If the QOM property is read-only, that means there's no known
4391 # way to make the CPU model run in the current host. Implementations
4392 # that choose not to provide specific information return the
4393 # property name "type".
4394 # If the property is read-write, it means that it MAY be possible
4395 # to run the CPU model in the current host if that property is
4396 # changed. Management software can use it as hints to suggest or
4397 # choose an alternative for the user, or just to generate meaningful
4398 # error messages explaining why the CPU model can't be used.
4399 # If @unavailable-features is an empty list, the CPU model is
4400 # runnable using the current host and machine-type.
4401 # If @unavailable-features is not present, runnability
4402 # information for the CPU is not available.
4404 # Since: 1.2.0
4406 { 'struct': 'CpuDefinitionInfo',
4407   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4408             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4411 # @query-cpu-definitions:
4413 # Return a list of supported virtual CPU definitions
4415 # Returns: a list of CpuDefInfo
4417 # Since: 1.2.0
4419 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4422 # @CpuModelInfo:
4424 # Virtual CPU model.
4426 # A CPU model consists of the name of a CPU definition, to which
4427 # delta changes are applied (e.g. features added/removed). Most magic values
4428 # that an architecture might require should be hidden behind the name.
4429 # However, if required, architectures can expose relevant properties.
4431 # @name: the name of the CPU definition the model is based on
4432 # @props: a dictionary of QOM properties to be applied
4434 # Since: 2.8.0
4436 { 'struct': 'CpuModelInfo',
4437   'data': { 'name': 'str',
4438             '*props': 'any' } }
4441 # @CpuModelExpansionType:
4443 # An enumeration of CPU model expansion types.
4445 # @static: Expand to a static CPU model, a combination of a static base
4446 #          model name and property delta changes. As the static base model will
4447 #          never change, the expanded CPU model will be the same, independant of
4448 #          independent of QEMU version, machine type, machine options, and
4449 #          accelerator options. Therefore, the resulting model can be used by
4450 #          tooling without having to specify a compatibility machine - e.g. when
4451 #          displaying the "host" model. static CPU models are migration-safe.
4453 # @full: Expand all properties. The produced model is not guaranteed to be
4454 #        migration-safe, but allows tooling to get an insight and work with
4455 #        model details.
4457 # Note: When a non-migration-safe CPU model is expanded in static mode, some
4458 # features enabled by the CPU model may be omitted, because they can't be
4459 # implemented by a static CPU model definition (e.g. cache info passthrough and
4460 # PMU passthrough in x86). If you need an accurate representation of the
4461 # features enabled by a non-migration-safe CPU model, use @full. If you need a
4462 # static representation that will keep ABI compatibility even when changing QEMU
4463 # version or machine-type, use @static (but keep in mind that some features may
4464 # be omitted).
4466 # Since: 2.8.0
4468 { 'enum': 'CpuModelExpansionType',
4469   'data': [ 'static', 'full' ] }
4473 # @CpuModelExpansionInfo:
4475 # The result of a cpu model expansion.
4477 # @model: the expanded CpuModelInfo.
4479 # Since: 2.8.0
4481 { 'struct': 'CpuModelExpansionInfo',
4482   'data': { 'model': 'CpuModelInfo' } }
4486 # @query-cpu-model-expansion:
4488 # Expands a given CPU model (or a combination of CPU model + additional options)
4489 # to different granularities, allowing tooling to get an understanding what a
4490 # specific CPU model looks like in QEMU under a certain configuration.
4492 # This interface can be used to query the "host" CPU model.
4494 # The data returned by this command may be affected by:
4496 # * QEMU version: CPU models may look different depending on the QEMU version.
4497 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4498 # * machine-type: CPU model  may look different depending on the machine-type.
4499 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4500 # * machine options (including accelerator): in some architectures, CPU models
4501 #   may look different depending on machine and accelerator options. (Except for
4502 #   CPU models reported as "static" in query-cpu-definitions.)
4503 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4504 #   global properties may affect expansion of CPU models. Using
4505 #   query-cpu-model-expansion while using these is not advised.
4507 # Some architectures may not support all expansion types. s390x supports
4508 # "full" and "static".
4510 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4511 #          not supported, if the model cannot be expanded, if the model contains
4512 #          an unknown CPU definition name, unknown properties or properties
4513 #          with a wrong type. Also returns an error if an expansion type is
4514 #          not supported.
4516 # Since: 2.8.0
4518 { 'command': 'query-cpu-model-expansion',
4519   'data': { 'type': 'CpuModelExpansionType',
4520             'model': 'CpuModelInfo' },
4521   'returns': 'CpuModelExpansionInfo' }
4524 # @CpuModelCompareResult:
4526 # An enumeration of CPU model comparation results. The result is usually
4527 # calculated using e.g. CPU features or CPU generations.
4529 # @incompatible: If model A is incompatible to model B, model A is not
4530 #                guaranteed to run where model B runs and the other way around.
4532 # @identical: If model A is identical to model B, model A is guaranteed to run
4533 #             where model B runs and the other way around.
4535 # @superset: If model A is a superset of model B, model B is guaranteed to run
4536 #            where model A runs. There are no guarantees about the other way.
4538 # @subset: If model A is a subset of model B, model A is guaranteed to run
4539 #          where model B runs. There are no guarantees about the other way.
4541 # Since: 2.8.0
4543 { 'enum': 'CpuModelCompareResult',
4544   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4547 # @CpuModelCompareInfo:
4549 # The result of a CPU model comparison.
4551 # @result: The result of the compare operation.
4552 # @responsible-properties: List of properties that led to the comparison result
4553 #                          not being identical.
4555 # @responsible-properties is a list of QOM property names that led to
4556 # both CPUs not being detected as identical. For identical models, this
4557 # list is empty.
4558 # If a QOM property is read-only, that means there's no known way to make the
4559 # CPU models identical. If the special property name "type" is included, the
4560 # models are by definition not identical and cannot be made identical.
4562 # Since: 2.8.0
4564 { 'struct': 'CpuModelCompareInfo',
4565   'data': {'result': 'CpuModelCompareResult',
4566            'responsible-properties': ['str']
4567           }
4571 # @query-cpu-model-comparison:
4573 # Compares two CPU models, returning how they compare in a specific
4574 # configuration. The results indicates how both models compare regarding
4575 # runnability. This result can be used by tooling to make decisions if a
4576 # certain CPU model will run in a certain configuration or if a compatible
4577 # CPU model has to be created by baselining.
4579 # Usually, a CPU model is compared against the maximum possible CPU model
4580 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4581 # model is identical or a subset, it will run in that configuration.
4583 # The result returned by this command may be affected by:
4585 # * QEMU version: CPU models may look different depending on the QEMU version.
4586 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4587 # * machine-type: CPU model may look different depending on the machine-type.
4588 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4589 # * machine options (including accelerator): in some architectures, CPU models
4590 #   may look different depending on machine and accelerator options. (Except for
4591 #   CPU models reported as "static" in query-cpu-definitions.)
4592 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4593 #   global properties may affect expansion of CPU models. Using
4594 #   query-cpu-model-expansion while using these is not advised.
4596 # Some architectures may not support comparing CPU models. s390x supports
4597 # comparing CPU models.
4599 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4600 #          not supported, if a model cannot be used, if a model contains
4601 #          an unknown cpu definition name, unknown properties or properties
4602 #          with wrong types.
4604 # Since: 2.8.0
4606 { 'command': 'query-cpu-model-comparison',
4607   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4608   'returns': 'CpuModelCompareInfo' }
4611 # @CpuModelBaselineInfo:
4613 # The result of a CPU model baseline.
4615 # @model: the baselined CpuModelInfo.
4617 # Since: 2.8.0
4619 { 'struct': 'CpuModelBaselineInfo',
4620   'data': { 'model': 'CpuModelInfo' } }
4623 # @query-cpu-model-baseline:
4625 # Baseline two CPU models, creating a compatible third model. The created
4626 # model will always be a static, migration-safe CPU model (see "static"
4627 # CPU model expansion for details).
4629 # This interface can be used by tooling to create a compatible CPU model out
4630 # two CPU models. The created CPU model will be identical to or a subset of
4631 # both CPU models when comparing them. Therefore, the created CPU model is
4632 # guaranteed to run where the given CPU models run.
4634 # The result returned by this command may be affected by:
4636 # * QEMU version: CPU models may look different depending on the QEMU version.
4637 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4638 # * machine-type: CPU model may look different depending on the machine-type.
4639 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4640 # * machine options (including accelerator): in some architectures, CPU models
4641 #   may look different depending on machine and accelerator options. (Except for
4642 #   CPU models reported as "static" in query-cpu-definitions.)
4643 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4644 #   global properties may affect expansion of CPU models. Using
4645 #   query-cpu-model-expansion while using these is not advised.
4647 # Some architectures may not support baselining CPU models. s390x supports
4648 # baselining CPU models.
4650 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4651 #          not supported, if a model cannot be used, if a model contains
4652 #          an unknown cpu definition name, unknown properties or properties
4653 #          with wrong types.
4655 # Since: 2.8.0
4657 { 'command': 'query-cpu-model-baseline',
4658   'data': { 'modela': 'CpuModelInfo',
4659             'modelb': 'CpuModelInfo' },
4660   'returns': 'CpuModelBaselineInfo' }
4663 # @AddfdInfo:
4665 # Information about a file descriptor that was added to an fd set.
4667 # @fdset-id: The ID of the fd set that @fd was added to.
4669 # @fd: The file descriptor that was received via SCM rights and
4670 #      added to the fd set.
4672 # Since: 1.2.0
4674 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4677 # @add-fd:
4679 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4681 # @fdset-id: The ID of the fd set to add the file descriptor to.
4683 # @opaque: A free-form string that can be used to describe the fd.
4685 # Returns: @AddfdInfo on success
4687 #          If file descriptor was not received, FdNotSupplied
4689 #          If @fdset-id is a negative value, InvalidParameterValue
4691 # Notes: The list of fd sets is shared by all monitor connections.
4693 #        If @fdset-id is not specified, a new fd set will be created.
4695 # Since: 1.2.0
4697 # Example:
4699 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4700 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4703 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4704   'returns': 'AddfdInfo' }
4707 # @remove-fd:
4709 # Remove a file descriptor from an fd set.
4711 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4713 # @fd: The file descriptor that is to be removed.
4715 # Returns: Nothing on success
4716 #          If @fdset-id or @fd is not found, FdNotFound
4718 # Since: 1.2.0
4720 # Notes: The list of fd sets is shared by all monitor connections.
4722 #        If @fd is not specified, all file descriptors in @fdset-id
4723 #        will be removed.
4725 # Example:
4727 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4728 # <- { "return": {} }
4731 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4734 # @FdsetFdInfo:
4736 # Information about a file descriptor that belongs to an fd set.
4738 # @fd: The file descriptor value.
4740 # @opaque: A free-form string that can be used to describe the fd.
4742 # Since: 1.2.0
4744 { 'struct': 'FdsetFdInfo',
4745   'data': {'fd': 'int', '*opaque': 'str'} }
4748 # @FdsetInfo:
4750 # Information about an fd set.
4752 # @fdset-id: The ID of the fd set.
4754 # @fds: A list of file descriptors that belong to this fd set.
4756 # Since: 1.2.0
4758 { 'struct': 'FdsetInfo',
4759   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4762 # @query-fdsets:
4764 # Return information describing all fd sets.
4766 # Returns: A list of @FdsetInfo
4768 # Since: 1.2.0
4770 # Note: The list of fd sets is shared by all monitor connections.
4772 # Example:
4774 # -> { "execute": "query-fdsets" }
4775 # <- { "return": [
4776 #        {
4777 #          "fds": [
4778 #            {
4779 #              "fd": 30,
4780 #              "opaque": "rdonly:/path/to/file"
4781 #            },
4782 #            {
4783 #              "fd": 24,
4784 #              "opaque": "rdwr:/path/to/file"
4785 #            }
4786 #          ],
4787 #          "fdset-id": 1
4788 #        },
4789 #        {
4790 #          "fds": [
4791 #            {
4792 #              "fd": 28
4793 #            },
4794 #            {
4795 #              "fd": 29
4796 #            }
4797 #          ],
4798 #          "fdset-id": 0
4799 #        }
4800 #      ]
4801 #    }
4804 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4807 # @TargetInfo:
4809 # Information describing the QEMU target.
4811 # @arch: the target architecture (eg "x86_64", "i386", etc)
4813 # Since: 1.2.0
4815 { 'struct': 'TargetInfo',
4816   'data': { 'arch': 'str' } }
4819 # @query-target:
4821 # Return information about the target for this QEMU
4823 # Returns: TargetInfo
4825 # Since: 1.2.0
4827 { 'command': 'query-target', 'returns': 'TargetInfo' }
4830 # @QKeyCode:
4832 # An enumeration of key name.
4834 # This is used by the @send-key command.
4836 # @unmapped: since 2.0
4837 # @pause: since 2.0
4838 # @ro: since 2.4
4839 # @kp_comma: since 2.4
4840 # @kp_equals: since 2.6
4841 # @power: since 2.6
4842 # @hiragana: since 2.9
4843 # @henkan: since 2.9
4844 # @yen: since 2.9
4846 # Since: 1.3.0
4849 { 'enum': 'QKeyCode',
4850   'data': [ 'unmapped',
4851             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
4852             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4853             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4854             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4855             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4856             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4857             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4858             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4859             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4860             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4861             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4862             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4863             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4864             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4865             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4866             'ro', 'hiragana', 'henkan', 'yen',
4867             'kp_comma', 'kp_equals', 'power' ] }
4870 # @KeyValue:
4872 # Represents a keyboard key.
4874 # Since: 1.3.0
4876 { 'union': 'KeyValue',
4877   'data': {
4878     'number': 'int',
4879     'qcode': 'QKeyCode' } }
4882 # @send-key:
4884 # Send keys to guest.
4886 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4887 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4888 #        directly to the guest, while @KeyValue.qcode must be a valid
4889 #        @QKeyCode value
4891 # @hold-time: time to delay key up events, milliseconds. Defaults
4892 #             to 100
4894 # Returns: Nothing on success
4895 #          If key is unknown or redundant, InvalidParameter
4897 # Since: 1.3.0
4899 # Example:
4901 # -> { "execute": "send-key",
4902 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4903 #                               { "type": "qcode", "data": "alt" },
4904 #                               { "type": "qcode", "data": "delete" } ] } }
4905 # <- { "return": {} }
4908 { 'command': 'send-key',
4909   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4912 # @screendump:
4914 # Write a PPM of the VGA screen to a file.
4916 # @filename: the path of a new PPM file to store the image
4918 # Returns: Nothing on success
4920 # Since: 0.14.0
4922 # Example:
4924 # -> { "execute": "screendump",
4925 #      "arguments": { "filename": "/tmp/image" } }
4926 # <- { "return": {} }
4929 { 'command': 'screendump', 'data': {'filename': 'str'} }
4933 # @ChardevCommon:
4935 # Configuration shared across all chardev backends
4937 # @logfile: The name of a logfile to save output
4938 # @logappend: true to append instead of truncate
4939 #             (default to false to truncate)
4941 # Since: 2.6
4943 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4944                                        '*logappend': 'bool' } }
4947 # @ChardevFile:
4949 # Configuration info for file chardevs.
4951 # @in:  The name of the input file
4952 # @out: The name of the output file
4953 # @append: Open the file in append mode (default false to
4954 #          truncate) (Since 2.6)
4956 # Since: 1.4
4958 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4959                                    'out' : 'str',
4960                                    '*append': 'bool' },
4961   'base': 'ChardevCommon' }
4964 # @ChardevHostdev:
4966 # Configuration info for device and pipe chardevs.
4968 # @device: The name of the special file for the device,
4969 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4971 # Since: 1.4
4973 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4974   'base': 'ChardevCommon' }
4977 # @ChardevSocket:
4979 # Configuration info for (stream) socket chardevs.
4981 # @addr: socket address to listen on (server=true)
4982 #        or connect to (server=false)
4983 # @tls-creds: the ID of the TLS credentials object (since 2.6)
4984 # @server: create server socket (default: true)
4985 # @wait: wait for incoming connection on server
4986 #        sockets (default: false).
4987 # @nodelay: set TCP_NODELAY socket option (default: false)
4988 # @telnet: enable telnet protocol on server
4989 #          sockets (default: false)
4990 # @tn3270: enable tn3270 protocol on server
4991 #          sockets (default: false) (Since: 2.10)
4992 # @reconnect: For a client socket, if a socket is disconnected,
4993 #          then attempt a reconnect after the given number of seconds.
4994 #          Setting this to zero disables this function. (default: 0)
4995 #          (Since: 2.2)
4997 # Since: 1.4
4999 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddressLegacy',
5000                                      '*tls-creds'  : 'str',
5001                                      '*server'    : 'bool',
5002                                      '*wait'      : 'bool',
5003                                      '*nodelay'   : 'bool',
5004                                      '*telnet'    : 'bool',
5005                                      '*tn3270'    : 'bool',
5006                                      '*reconnect' : 'int' },
5007   'base': 'ChardevCommon' }
5010 # @ChardevUdp:
5012 # Configuration info for datagram socket chardevs.
5014 # @remote: remote address
5015 # @local: local address
5017 # Since: 1.5
5019 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
5020                                   '*local' : 'SocketAddressLegacy' },
5021   'base': 'ChardevCommon' }
5024 # @ChardevMux:
5026 # Configuration info for mux chardevs.
5028 # @chardev: name of the base chardev.
5030 # Since: 1.5
5032 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
5033   'base': 'ChardevCommon' }
5036 # @ChardevStdio:
5038 # Configuration info for stdio chardevs.
5040 # @signal: Allow signals (such as SIGINT triggered by ^C)
5041 #          be delivered to qemu.  Default: true in -nographic mode,
5042 #          false otherwise.
5044 # Since: 1.5
5046 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
5047   'base': 'ChardevCommon' }
5051 # @ChardevSpiceChannel:
5053 # Configuration info for spice vm channel chardevs.
5055 # @type: kind of channel (for example vdagent).
5057 # Since: 1.5
5059 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
5060   'base': 'ChardevCommon' }
5063 # @ChardevSpicePort:
5065 # Configuration info for spice port chardevs.
5067 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
5069 # Since: 1.5
5071 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
5072   'base': 'ChardevCommon' }
5075 # @ChardevVC:
5077 # Configuration info for virtual console chardevs.
5079 # @width:  console width,  in pixels
5080 # @height: console height, in pixels
5081 # @cols:   console width,  in chars
5082 # @rows:   console height, in chars
5084 # Since: 1.5
5086 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
5087                                  '*height' : 'int',
5088                                  '*cols'   : 'int',
5089                                  '*rows'   : 'int' },
5090   'base': 'ChardevCommon' }
5093 # @ChardevRingbuf:
5095 # Configuration info for ring buffer chardevs.
5097 # @size: ring buffer size, must be power of two, default is 65536
5099 # Since: 1.5
5101 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
5102   'base': 'ChardevCommon' }
5105 # @ChardevBackend:
5107 # Configuration info for the new chardev backend.
5109 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
5111 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
5112                                        'serial' : 'ChardevHostdev',
5113                                        'parallel': 'ChardevHostdev',
5114                                        'pipe'   : 'ChardevHostdev',
5115                                        'socket' : 'ChardevSocket',
5116                                        'udp'    : 'ChardevUdp',
5117                                        'pty'    : 'ChardevCommon',
5118                                        'null'   : 'ChardevCommon',
5119                                        'mux'    : 'ChardevMux',
5120                                        'msmouse': 'ChardevCommon',
5121                                        'wctablet' : 'ChardevCommon',
5122                                        'braille': 'ChardevCommon',
5123                                        'testdev': 'ChardevCommon',
5124                                        'stdio'  : 'ChardevStdio',
5125                                        'console': 'ChardevCommon',
5126                                        'spicevmc' : 'ChardevSpiceChannel',
5127                                        'spiceport' : 'ChardevSpicePort',
5128                                        'vc'     : 'ChardevVC',
5129                                        'ringbuf': 'ChardevRingbuf',
5130                                        # next one is just for compatibility
5131                                        'memory' : 'ChardevRingbuf' } }
5134 # @ChardevReturn:
5136 # Return info about the chardev backend just created.
5138 # @pty: name of the slave pseudoterminal device, present if
5139 #       and only if a chardev of type 'pty' was created
5141 # Since: 1.4
5143 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
5146 # @chardev-add:
5148 # Add a character device backend
5150 # @id: the chardev's ID, must be unique
5151 # @backend: backend type and parameters
5153 # Returns: ChardevReturn.
5155 # Since: 1.4
5157 # Example:
5159 # -> { "execute" : "chardev-add",
5160 #      "arguments" : { "id" : "foo",
5161 #                      "backend" : { "type" : "null", "data" : {} } } }
5162 # <- { "return": {} }
5164 # -> { "execute" : "chardev-add",
5165 #      "arguments" : { "id" : "bar",
5166 #                      "backend" : { "type" : "file",
5167 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
5168 # <- { "return": {} }
5170 # -> { "execute" : "chardev-add",
5171 #      "arguments" : { "id" : "baz",
5172 #                      "backend" : { "type" : "pty", "data" : {} } } }
5173 # <- { "return": { "pty" : "/dev/pty/42" } }
5176 { 'command': 'chardev-add', 'data': {'id'      : 'str',
5177                                      'backend' : 'ChardevBackend' },
5178   'returns': 'ChardevReturn' }
5181 # @chardev-change:
5183 # Change a character device backend
5185 # @id: the chardev's ID, must exist
5186 # @backend: new backend type and parameters
5188 # Returns: ChardevReturn.
5190 # Since: 2.10
5192 # Example:
5194 # -> { "execute" : "chardev-change",
5195 #      "arguments" : { "id" : "baz",
5196 #                      "backend" : { "type" : "pty", "data" : {} } } }
5197 # <- { "return": { "pty" : "/dev/pty/42" } }
5199 # -> {"execute" : "chardev-change",
5200 #     "arguments" : {
5201 #         "id" : "charchannel2",
5202 #         "backend" : {
5203 #             "type" : "socket",
5204 #             "data" : {
5205 #                 "addr" : {
5206 #                     "type" : "unix" ,
5207 #                     "data" : {
5208 #                         "path" : "/tmp/charchannel2.socket"
5209 #                     }
5210 #                  },
5211 #                  "server" : true,
5212 #                  "wait" : false }}}}
5213 # <- {"return": {}}
5216 { 'command': 'chardev-change', 'data': {'id'      : 'str',
5217                                         'backend' : 'ChardevBackend' },
5218   'returns': 'ChardevReturn' }
5221 # @chardev-remove:
5223 # Remove a character device backend
5225 # @id: the chardev's ID, must exist and not be in use
5227 # Returns: Nothing on success
5229 # Since: 1.4
5231 # Example:
5233 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
5234 # <- { "return": {} }
5237 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
5240 # @chardev-send-break:
5242 # Send a break to a character device
5244 # @id: the chardev's ID, must exist
5246 # Returns: Nothing on success
5248 # Since: 2.10
5250 # Example:
5252 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
5253 # <- { "return": {} }
5256 { 'command': 'chardev-send-break', 'data': {'id': 'str'} }
5260 # @TpmModel:
5262 # An enumeration of TPM models
5264 # @tpm-tis: TPM TIS model
5266 # Since: 1.5
5268 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
5271 # @query-tpm-models:
5273 # Return a list of supported TPM models
5275 # Returns: a list of TpmModel
5277 # Since: 1.5
5279 # Example:
5281 # -> { "execute": "query-tpm-models" }
5282 # <- { "return": [ "tpm-tis" ] }
5285 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5288 # @TpmType:
5290 # An enumeration of TPM types
5292 # @passthrough: TPM passthrough type
5294 # Since: 1.5
5296 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5299 # @query-tpm-types:
5301 # Return a list of supported TPM types
5303 # Returns: a list of TpmType
5305 # Since: 1.5
5307 # Example:
5309 # -> { "execute": "query-tpm-types" }
5310 # <- { "return": [ "passthrough" ] }
5313 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5316 # @TPMPassthroughOptions:
5318 # Information about the TPM passthrough type
5320 # @path: string describing the path used for accessing the TPM device
5322 # @cancel-path: string showing the TPM's sysfs cancel file
5323 #               for cancellation of TPM commands while they are executing
5325 # Since: 1.5
5327 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
5328                                              '*cancel-path' : 'str'} }
5331 # @TpmTypeOptions:
5333 # A union referencing different TPM backend types' configuration options
5335 # @type: 'passthrough' The configuration options for the TPM passthrough type
5337 # Since: 1.5
5339 { 'union': 'TpmTypeOptions',
5340    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
5343 # @TPMInfo:
5345 # Information about the TPM
5347 # @id: The Id of the TPM
5349 # @model: The TPM frontend model
5351 # @options: The TPM (backend) type configuration options
5353 # Since: 1.5
5355 { 'struct': 'TPMInfo',
5356   'data': {'id': 'str',
5357            'model': 'TpmModel',
5358            'options': 'TpmTypeOptions' } }
5361 # @query-tpm:
5363 # Return information about the TPM device
5365 # Returns: @TPMInfo on success
5367 # Since: 1.5
5369 # Example:
5371 # -> { "execute": "query-tpm" }
5372 # <- { "return":
5373 #      [
5374 #        { "model": "tpm-tis",
5375 #          "options":
5376 #            { "type": "passthrough",
5377 #              "data":
5378 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5379 #                  "path": "/dev/tpm0"
5380 #                }
5381 #            },
5382 #          "id": "tpm0"
5383 #        }
5384 #      ]
5385 #    }
5388 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5391 # @AcpiTableOptions:
5393 # Specify an ACPI table on the command line to load.
5395 # At most one of @file and @data can be specified. The list of files specified
5396 # by any one of them is loaded and concatenated in order. If both are omitted,
5397 # @data is implied.
5399 # Other fields / optargs can be used to override fields of the generic ACPI
5400 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5401 # Description Table Header. If a header field is not overridden, then the
5402 # corresponding value from the concatenated blob is used (in case of @file), or
5403 # it is filled in with a hard-coded value (in case of @data).
5405 # String fields are copied into the matching ACPI member from lowest address
5406 # upwards, and silently truncated / NUL-padded to length.
5408 # @sig: table signature / identifier (4 bytes)
5410 # @rev: table revision number (dependent on signature, 1 byte)
5412 # @oem_id: OEM identifier (6 bytes)
5414 # @oem_table_id: OEM table identifier (8 bytes)
5416 # @oem_rev: OEM-supplied revision number (4 bytes)
5418 # @asl_compiler_id: identifier of the utility that created the table
5419 #                   (4 bytes)
5421 # @asl_compiler_rev: revision number of the utility that created the
5422 #                    table (4 bytes)
5424 # @file: colon (:) separated list of pathnames to load and
5425 #        concatenate as table data. The resultant binary blob is expected to
5426 #        have an ACPI table header. At least one file is required. This field
5427 #        excludes @data.
5429 # @data: colon (:) separated list of pathnames to load and
5430 #        concatenate as table data. The resultant binary blob must not have an
5431 #        ACPI table header. At least one file is required. This field excludes
5432 #        @file.
5434 # Since: 1.5
5436 { 'struct': 'AcpiTableOptions',
5437   'data': {
5438     '*sig':               'str',
5439     '*rev':               'uint8',
5440     '*oem_id':            'str',
5441     '*oem_table_id':      'str',
5442     '*oem_rev':           'uint32',
5443     '*asl_compiler_id':   'str',
5444     '*asl_compiler_rev':  'uint32',
5445     '*file':              'str',
5446     '*data':              'str' }}
5449 # @CommandLineParameterType:
5451 # Possible types for an option parameter.
5453 # @string: accepts a character string
5455 # @boolean: accepts "on" or "off"
5457 # @number: accepts a number
5459 # @size: accepts a number followed by an optional suffix (K)ilo,
5460 #        (M)ega, (G)iga, (T)era
5462 # Since: 1.5
5464 { 'enum': 'CommandLineParameterType',
5465   'data': ['string', 'boolean', 'number', 'size'] }
5468 # @CommandLineParameterInfo:
5470 # Details about a single parameter of a command line option.
5472 # @name: parameter name
5474 # @type: parameter @CommandLineParameterType
5476 # @help: human readable text string, not suitable for parsing.
5478 # @default: default value string (since 2.1)
5480 # Since: 1.5
5482 { 'struct': 'CommandLineParameterInfo',
5483   'data': { 'name': 'str',
5484             'type': 'CommandLineParameterType',
5485             '*help': 'str',
5486             '*default': 'str' } }
5489 # @CommandLineOptionInfo:
5491 # Details about a command line option, including its list of parameter details
5493 # @option: option name
5495 # @parameters: an array of @CommandLineParameterInfo
5497 # Since: 1.5
5499 { 'struct': 'CommandLineOptionInfo',
5500   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5503 # @query-command-line-options:
5505 # Query command line option schema.
5507 # @option: option name
5509 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5510 #          @option).  Returns an error if the given @option doesn't exist.
5512 # Since: 1.5
5514 # Example:
5516 # -> { "execute": "query-command-line-options",
5517 #      "arguments": { "option": "option-rom" } }
5518 # <- { "return": [
5519 #         {
5520 #             "parameters": [
5521 #                 {
5522 #                     "name": "romfile",
5523 #                     "type": "string"
5524 #                 },
5525 #                 {
5526 #                     "name": "bootindex",
5527 #                     "type": "number"
5528 #                 }
5529 #             ],
5530 #             "option": "option-rom"
5531 #         }
5532 #      ]
5533 #    }
5536 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5537  'returns': ['CommandLineOptionInfo'] }
5540 # @X86CPURegister32:
5542 # A X86 32-bit register
5544 # Since: 1.5
5546 { 'enum': 'X86CPURegister32',
5547   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5550 # @X86CPUFeatureWordInfo:
5552 # Information about a X86 CPU feature word
5554 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5556 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
5557 #                   feature word
5559 # @cpuid-register: Output register containing the feature bits
5561 # @features: value of output register, containing the feature bits
5563 # Since: 1.5
5565 { 'struct': 'X86CPUFeatureWordInfo',
5566   'data': { 'cpuid-input-eax': 'int',
5567             '*cpuid-input-ecx': 'int',
5568             'cpuid-register': 'X86CPURegister32',
5569             'features': 'int' } }
5572 # @DummyForceArrays:
5574 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5576 # Since: 2.5
5578 { 'struct': 'DummyForceArrays',
5579   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5583 # @RxState:
5585 # Packets receiving state
5587 # @normal: filter assigned packets according to the mac-table
5589 # @none: don't receive any assigned packet
5591 # @all: receive all assigned packets
5593 # Since: 1.6
5595 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5598 # @RxFilterInfo:
5600 # Rx-filter information for a NIC.
5602 # @name: net client name
5604 # @promiscuous: whether promiscuous mode is enabled
5606 # @multicast: multicast receive state
5608 # @unicast: unicast receive state
5610 # @vlan: vlan receive state (Since 2.0)
5612 # @broadcast-allowed: whether to receive broadcast
5614 # @multicast-overflow: multicast table is overflowed or not
5616 # @unicast-overflow: unicast table is overflowed or not
5618 # @main-mac: the main macaddr string
5620 # @vlan-table: a list of active vlan id
5622 # @unicast-table: a list of unicast macaddr string
5624 # @multicast-table: a list of multicast macaddr string
5626 # Since: 1.6
5628 { 'struct': 'RxFilterInfo',
5629   'data': {
5630     'name':               'str',
5631     'promiscuous':        'bool',
5632     'multicast':          'RxState',
5633     'unicast':            'RxState',
5634     'vlan':               'RxState',
5635     'broadcast-allowed':  'bool',
5636     'multicast-overflow': 'bool',
5637     'unicast-overflow':   'bool',
5638     'main-mac':           'str',
5639     'vlan-table':         ['int'],
5640     'unicast-table':      ['str'],
5641     'multicast-table':    ['str'] }}
5644 # @query-rx-filter:
5646 # Return rx-filter information for all NICs (or for the given NIC).
5648 # @name: net client name
5650 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5651 #          Returns an error if the given @name doesn't exist, or given
5652 #          NIC doesn't support rx-filter querying, or given net client
5653 #          isn't a NIC.
5655 # Since: 1.6
5657 # Example:
5659 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5660 # <- { "return": [
5661 #         {
5662 #             "promiscuous": true,
5663 #             "name": "vnet0",
5664 #             "main-mac": "52:54:00:12:34:56",
5665 #             "unicast": "normal",
5666 #             "vlan": "normal",
5667 #             "vlan-table": [
5668 #                 4,
5669 #                 0
5670 #             ],
5671 #             "unicast-table": [
5672 #             ],
5673 #             "multicast": "normal",
5674 #             "multicast-overflow": false,
5675 #             "unicast-overflow": false,
5676 #             "multicast-table": [
5677 #                 "01:00:5e:00:00:01",
5678 #                 "33:33:00:00:00:01",
5679 #                 "33:33:ff:12:34:56"
5680 #             ],
5681 #             "broadcast-allowed": false
5682 #         }
5683 #       ]
5684 #    }
5687 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5688   'returns': ['RxFilterInfo'] }
5691 # @InputButton:
5693 # Button of a pointer input device (mouse, tablet).
5695 # @side: front side button of a 5-button mouse (since 2.9)
5697 # @extra: rear side button of a 5-button mouse (since 2.9)
5699 # Since: 2.0
5701 { 'enum'  : 'InputButton',
5702   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5703   'extra' ] }
5706 # @InputAxis:
5708 # Position axis of a pointer input device (mouse, tablet).
5710 # Since: 2.0
5712 { 'enum'  : 'InputAxis',
5713   'data'  : [ 'x', 'y' ] }
5716 # @InputKeyEvent:
5718 # Keyboard input event.
5720 # @key:    Which key this event is for.
5721 # @down:   True for key-down and false for key-up events.
5723 # Since: 2.0
5725 { 'struct'  : 'InputKeyEvent',
5726   'data'  : { 'key'     : 'KeyValue',
5727               'down'    : 'bool' } }
5730 # @InputBtnEvent:
5732 # Pointer button input event.
5734 # @button: Which button this event is for.
5735 # @down:   True for key-down and false for key-up events.
5737 # Since: 2.0
5739 { 'struct'  : 'InputBtnEvent',
5740   'data'  : { 'button'  : 'InputButton',
5741               'down'    : 'bool' } }
5744 # @InputMoveEvent:
5746 # Pointer motion input event.
5748 # @axis:   Which axis is referenced by @value.
5749 # @value:  Pointer position.  For absolute coordinates the
5750 #          valid range is 0 -> 0x7ffff
5752 # Since: 2.0
5754 { 'struct'  : 'InputMoveEvent',
5755   'data'  : { 'axis'    : 'InputAxis',
5756               'value'   : 'int' } }
5759 # @InputEvent:
5761 # Input event union.
5763 # @type: the input type, one of:
5764 #  - 'key': Input event of Keyboard
5765 #  - 'btn': Input event of pointer buttons
5766 #  - 'rel': Input event of relative pointer motion
5767 #  - 'abs': Input event of absolute pointer motion
5769 # Since: 2.0
5771 { 'union' : 'InputEvent',
5772   'data'  : { 'key'     : 'InputKeyEvent',
5773               'btn'     : 'InputBtnEvent',
5774               'rel'     : 'InputMoveEvent',
5775               'abs'     : 'InputMoveEvent' } }
5778 # @input-send-event:
5780 # Send input event(s) to guest.
5782 # @device: display device to send event(s) to.
5783 # @head: head to send event(s) to, in case the
5784 #        display device supports multiple scanouts.
5785 # @events: List of InputEvent union.
5787 # Returns: Nothing on success.
5789 # The @device and @head parameters can be used to send the input event
5790 # to specific input devices in case (a) multiple input devices of the
5791 # same kind are added to the virtual machine and (b) you have
5792 # configured input routing (see docs/multiseat.txt) for those input
5793 # devices.  The parameters work exactly like the device and head
5794 # properties of input devices.  If @device is missing, only devices
5795 # that have no input routing config are admissible.  If @device is
5796 # specified, both input devices with and without input routing config
5797 # are admissible, but devices with input routing config take
5798 # precedence.
5800 # Since: 2.6
5802 # Note: The consoles are visible in the qom tree, under
5803 # /backend/console[$index]. They have a device link and head property,
5804 # so it is possible to map which console belongs to which device and
5805 # display.
5807 # Example:
5809 # 1. Press left mouse button.
5811 # -> { "execute": "input-send-event",
5812 #     "arguments": { "device": "video0",
5813 #                    "events": [ { "type": "btn",
5814 #                    "data" : { "down": true, "button": "left" } } ] } }
5815 # <- { "return": {} }
5817 # -> { "execute": "input-send-event",
5818 #     "arguments": { "device": "video0",
5819 #                    "events": [ { "type": "btn",
5820 #                    "data" : { "down": false, "button": "left" } } ] } }
5821 # <- { "return": {} }
5823 # 2. Press ctrl-alt-del.
5825 # -> { "execute": "input-send-event",
5826 #      "arguments": { "events": [
5827 #         { "type": "key", "data" : { "down": true,
5828 #           "key": {"type": "qcode", "data": "ctrl" } } },
5829 #         { "type": "key", "data" : { "down": true,
5830 #           "key": {"type": "qcode", "data": "alt" } } },
5831 #         { "type": "key", "data" : { "down": true,
5832 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5833 # <- { "return": {} }
5835 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5837 # -> { "execute": "input-send-event" ,
5838 #   "arguments": { "events": [
5839 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5840 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5841 # <- { "return": {} }
5844 { 'command': 'input-send-event',
5845   'data': { '*device': 'str',
5846             '*head'  : 'int',
5847             'events' : [ 'InputEvent' ] } }
5850 # @NumaOptionsType:
5852 # @node: NUMA nodes configuration
5854 # @dist: NUMA distance configuration (since 2.10)
5856 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
5858 # Since: 2.1
5860 { 'enum': 'NumaOptionsType',
5861   'data': [ 'node', 'dist', 'cpu' ] }
5864 # @NumaOptions:
5866 # A discriminated record of NUMA options. (for OptsVisitor)
5868 # Since: 2.1
5870 { 'union': 'NumaOptions',
5871   'base': { 'type': 'NumaOptionsType' },
5872   'discriminator': 'type',
5873   'data': {
5874     'node': 'NumaNodeOptions',
5875     'dist': 'NumaDistOptions',
5876     'cpu': 'NumaCpuOptions' }}
5879 # @NumaNodeOptions:
5881 # Create a guest NUMA node. (for OptsVisitor)
5883 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
5885 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
5886 #         if omitted)
5888 # @mem: memory size of this node; mutually exclusive with @memdev.
5889 #       Equally divide total memory among nodes if both @mem and @memdev are
5890 #       omitted.
5892 # @memdev: memory backend object.  If specified for one node,
5893 #          it must be specified for all nodes.
5895 # Since: 2.1
5897 { 'struct': 'NumaNodeOptions',
5898   'data': {
5899    '*nodeid': 'uint16',
5900    '*cpus':   ['uint16'],
5901    '*mem':    'size',
5902    '*memdev': 'str' }}
5905 # @NumaDistOptions:
5907 # Set the distance between 2 NUMA nodes.
5909 # @src: source NUMA node.
5911 # @dst: destination NUMA node.
5913 # @val: NUMA distance from source node to destination node.
5914 #       When a node is unreachable from another node, set the distance
5915 #       between them to 255.
5917 # Since: 2.10
5919 { 'struct': 'NumaDistOptions',
5920   'data': {
5921    'src': 'uint16',
5922    'dst': 'uint16',
5923    'val': 'uint8' }}
5926 # @NumaCpuOptions:
5928 # Option "-numa cpu" overrides default cpu to node mapping.
5929 # It accepts the same set of cpu properties as returned by
5930 # query-hotpluggable-cpus[].props, where node-id could be used to
5931 # override default node mapping.
5933 # Since: 2.10
5935 { 'struct': 'NumaCpuOptions',
5936    'base': 'CpuInstanceProperties',
5937    'data' : {} }
5940 # @HostMemPolicy:
5942 # Host memory policy types
5944 # @default: restore default policy, remove any nondefault policy
5946 # @preferred: set the preferred host nodes for allocation
5948 # @bind: a strict policy that restricts memory allocation to the
5949 #        host nodes specified
5951 # @interleave: memory allocations are interleaved across the set
5952 #              of host nodes specified
5954 # Since: 2.1
5956 { 'enum': 'HostMemPolicy',
5957   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5960 # @Memdev:
5962 # Information about memory backend
5964 # @id: backend's ID if backend has 'id' property (since 2.9)
5966 # @size: memory backend size
5968 # @merge: enables or disables memory merge support
5970 # @dump: includes memory backend's memory in a core dump or not
5972 # @prealloc: enables or disables memory preallocation
5974 # @host-nodes: host nodes for its memory policy
5976 # @policy: memory policy of memory backend
5978 # Since: 2.1
5980 { 'struct': 'Memdev',
5981   'data': {
5982     '*id':        'str',
5983     'size':       'size',
5984     'merge':      'bool',
5985     'dump':       'bool',
5986     'prealloc':   'bool',
5987     'host-nodes': ['uint16'],
5988     'policy':     'HostMemPolicy' }}
5991 # @query-memdev:
5993 # Returns information for all memory backends.
5995 # Returns: a list of @Memdev.
5997 # Since: 2.1
5999 # Example:
6001 # -> { "execute": "query-memdev" }
6002 # <- { "return": [
6003 #        {
6004 #          "id": "mem1",
6005 #          "size": 536870912,
6006 #          "merge": false,
6007 #          "dump": true,
6008 #          "prealloc": false,
6009 #          "host-nodes": [0, 1],
6010 #          "policy": "bind"
6011 #        },
6012 #        {
6013 #          "size": 536870912,
6014 #          "merge": false,
6015 #          "dump": true,
6016 #          "prealloc": true,
6017 #          "host-nodes": [2, 3],
6018 #          "policy": "preferred"
6019 #        }
6020 #      ]
6021 #    }
6024 { 'command': 'query-memdev', 'returns': ['Memdev'] }
6027 # @PCDIMMDeviceInfo:
6029 # PCDIMMDevice state information
6031 # @id: device's ID
6033 # @addr: physical address, where device is mapped
6035 # @size: size of memory that the device provides
6037 # @slot: slot number at which device is plugged in
6039 # @node: NUMA node number where device is plugged in
6041 # @memdev: memory backend linked with device
6043 # @hotplugged: true if device was hotplugged
6045 # @hotpluggable: true if device if could be added/removed while machine is running
6047 # Since: 2.1
6049 { 'struct': 'PCDIMMDeviceInfo',
6050   'data': { '*id': 'str',
6051             'addr': 'int',
6052             'size': 'int',
6053             'slot': 'int',
6054             'node': 'int',
6055             'memdev': 'str',
6056             'hotplugged': 'bool',
6057             'hotpluggable': 'bool'
6058           }
6062 # @MemoryDeviceInfo:
6064 # Union containing information about a memory device
6066 # Since: 2.1
6068 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
6071 # @query-memory-devices:
6073 # Lists available memory devices and their state
6075 # Since: 2.1
6077 # Example:
6079 # -> { "execute": "query-memory-devices" }
6080 # <- { "return": [ { "data":
6081 #                       { "addr": 5368709120,
6082 #                         "hotpluggable": true,
6083 #                         "hotplugged": true,
6084 #                         "id": "d1",
6085 #                         "memdev": "/objects/memX",
6086 #                         "node": 0,
6087 #                         "size": 1073741824,
6088 #                         "slot": 0},
6089 #                    "type": "dimm"
6090 #                  } ] }
6093 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
6096 # @ACPISlotType:
6098 # @DIMM: memory slot
6099 # @CPU: logical CPU slot (since 2.7)
6101 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
6104 # @ACPIOSTInfo:
6106 # OSPM Status Indication for a device
6107 # For description of possible values of @source and @status fields
6108 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
6110 # @device: device ID associated with slot
6112 # @slot: slot ID, unique per slot of a given @slot-type
6114 # @slot-type: type of the slot
6116 # @source: an integer containing the source event
6118 # @status: an integer containing the status code
6120 # Since: 2.1
6122 { 'struct': 'ACPIOSTInfo',
6123   'data'  : { '*device': 'str',
6124               'slot': 'str',
6125               'slot-type': 'ACPISlotType',
6126               'source': 'int',
6127               'status': 'int' } }
6130 # @query-acpi-ospm-status:
6132 # Return a list of ACPIOSTInfo for devices that support status
6133 # reporting via ACPI _OST method.
6135 # Since: 2.1
6137 # Example:
6139 # -> { "execute": "query-acpi-ospm-status" }
6140 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
6141 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
6142 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
6143 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
6144 #    ]}
6147 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
6150 # @WatchdogExpirationAction:
6152 # An enumeration of the actions taken when the watchdog device's timer is
6153 # expired
6155 # @reset: system resets
6157 # @shutdown: system shutdown, note that it is similar to @powerdown, which
6158 #            tries to set to system status and notify guest
6160 # @poweroff: system poweroff, the emulator program exits
6162 # @pause: system pauses, similar to @stop
6164 # @debug: system enters debug state
6166 # @none: nothing is done
6168 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
6169 #              VCPUS on x86) (since 2.4)
6171 # Since: 2.1
6173 { 'enum': 'WatchdogExpirationAction',
6174   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
6175             'inject-nmi' ] }
6178 # @IoOperationType:
6180 # An enumeration of the I/O operation types
6182 # @read: read operation
6184 # @write: write operation
6186 # Since: 2.1
6188 { 'enum': 'IoOperationType',
6189   'data': [ 'read', 'write' ] }
6192 # @GuestPanicAction:
6194 # An enumeration of the actions taken when guest OS panic is detected
6196 # @pause: system pauses
6198 # Since: 2.1 (poweroff since 2.8)
6200 { 'enum': 'GuestPanicAction',
6201   'data': [ 'pause', 'poweroff' ] }
6204 # @GuestPanicInformationType:
6206 # An enumeration of the guest panic information types
6208 # Since: 2.9
6210 { 'enum': 'GuestPanicInformationType',
6211   'data': [ 'hyper-v'] }
6214 # @GuestPanicInformation:
6216 # Information about a guest panic
6218 # Since: 2.9
6220 {'union': 'GuestPanicInformation',
6221  'base': {'type': 'GuestPanicInformationType'},
6222  'discriminator': 'type',
6223  'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
6226 # @GuestPanicInformationHyperV:
6228 # Hyper-V specific guest panic information (HV crash MSRs)
6230 # Since: 2.9
6232 {'struct': 'GuestPanicInformationHyperV',
6233  'data': { 'arg1': 'uint64',
6234            'arg2': 'uint64',
6235            'arg3': 'uint64',
6236            'arg4': 'uint64',
6237            'arg5': 'uint64' } }
6240 # @rtc-reset-reinjection:
6242 # This command will reset the RTC interrupt reinjection backlog.
6243 # Can be used if another mechanism to synchronize guest time
6244 # is in effect, for example QEMU guest agent's guest-set-time
6245 # command.
6247 # Since: 2.1
6249 # Example:
6251 # -> { "execute": "rtc-reset-reinjection" }
6252 # <- { "return": {} }
6255 { 'command': 'rtc-reset-reinjection' }
6257 # Rocker ethernet network switch
6258 { 'include': 'qapi/rocker.json' }
6261 # @ReplayMode:
6263 # Mode of the replay subsystem.
6265 # @none: normal execution mode. Replay or record are not enabled.
6267 # @record: record mode. All non-deterministic data is written into the
6268 #          replay log.
6270 # @play: replay mode. Non-deterministic data required for system execution
6271 #        is read from the log.
6273 # Since: 2.5
6275 { 'enum': 'ReplayMode',
6276   'data': [ 'none', 'record', 'play' ] }
6279 # @xen-load-devices-state:
6281 # Load the state of all devices from file. The RAM and the block devices
6282 # of the VM are not loaded by this command.
6284 # @filename: the file to load the state of the devices from as binary
6285 # data. See xen-save-devices-state.txt for a description of the binary
6286 # format.
6288 # Since: 2.7
6290 # Example:
6292 # -> { "execute": "xen-load-devices-state",
6293 #      "arguments": { "filename": "/tmp/resume" } }
6294 # <- { "return": {} }
6297 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
6300 # @xen-set-replication:
6302 # Enable or disable replication.
6304 # @enable: true to enable, false to disable.
6306 # @primary: true for primary or false for secondary.
6308 # @failover: true to do failover, false to stop. but cannot be
6309 #            specified if 'enable' is true. default value is false.
6311 # Returns: nothing.
6313 # Example:
6315 # -> { "execute": "xen-set-replication",
6316 #      "arguments": {"enable": true, "primary": false} }
6317 # <- { "return": {} }
6319 # Since: 2.9
6321 { 'command': 'xen-set-replication',
6322   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
6325 # @ReplicationStatus:
6327 # The result format for 'query-xen-replication-status'.
6329 # @error: true if an error happened, false if replication is normal.
6331 # @desc: the human readable error description string, when
6332 #        @error is 'true'.
6334 # Since: 2.9
6336 { 'struct': 'ReplicationStatus',
6337   'data': { 'error': 'bool', '*desc': 'str' } }
6340 # @query-xen-replication-status:
6342 # Query replication status while the vm is running.
6344 # Returns: A @ReplicationResult object showing the status.
6346 # Example:
6348 # -> { "execute": "query-xen-replication-status" }
6349 # <- { "return": { "error": false } }
6351 # Since: 2.9
6353 { 'command': 'query-xen-replication-status',
6354   'returns': 'ReplicationStatus' }
6357 # @xen-colo-do-checkpoint:
6359 # Xen uses this command to notify replication to trigger a checkpoint.
6361 # Returns: nothing.
6363 # Example:
6365 # -> { "execute": "xen-colo-do-checkpoint" }
6366 # <- { "return": {} }
6368 # Since: 2.9
6370 { 'command': 'xen-colo-do-checkpoint' }
6373 # @GICCapability:
6375 # The struct describes capability for a specific GIC (Generic
6376 # Interrupt Controller) version. These bits are not only decided by
6377 # QEMU/KVM software version, but also decided by the hardware that
6378 # the program is running upon.
6380 # @version:  version of GIC to be described. Currently, only 2 and 3
6381 #            are supported.
6383 # @emulated: whether current QEMU/hardware supports emulated GIC
6384 #            device in user space.
6386 # @kernel:   whether current QEMU/hardware supports hardware
6387 #            accelerated GIC device in kernel.
6389 # Since: 2.6
6391 { 'struct': 'GICCapability',
6392   'data': { 'version': 'int',
6393             'emulated': 'bool',
6394             'kernel': 'bool' } }
6397 # @query-gic-capabilities:
6399 # This command is ARM-only. It will return a list of GICCapability
6400 # objects that describe its capability bits.
6402 # Returns: a list of GICCapability objects.
6404 # Since: 2.6
6406 # Example:
6408 # -> { "execute": "query-gic-capabilities" }
6409 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
6410 #                 { "version": 3, "emulated": false, "kernel": true } ] }
6413 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
6416 # @CpuInstanceProperties:
6418 # List of properties to be used for hotplugging a CPU instance,
6419 # it should be passed by management with device_add command when
6420 # a CPU is being hotplugged.
6422 # @node-id: NUMA node ID the CPU belongs to
6423 # @socket-id: socket number within node/board the CPU belongs to
6424 # @core-id: core number within socket the CPU belongs to
6425 # @thread-id: thread number within core the CPU belongs to
6427 # Note: currently there are 4 properties that could be present
6428 # but management should be prepared to pass through other
6429 # properties with device_add command to allow for future
6430 # interface extension. This also requires the filed names to be kept in
6431 # sync with the properties passed to -device/device_add.
6433 # Since: 2.7
6435 { 'struct': 'CpuInstanceProperties',
6436   'data': { '*node-id': 'int',
6437             '*socket-id': 'int',
6438             '*core-id': 'int',
6439             '*thread-id': 'int'
6440   }
6444 # @HotpluggableCPU:
6446 # @type: CPU object type for usage with device_add command
6447 # @props: list of properties to be used for hotplugging CPU
6448 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6449 # @qom-path: link to existing CPU object if CPU is present or
6450 #            omitted if CPU is not present.
6452 # Since: 2.7
6454 { 'struct': 'HotpluggableCPU',
6455   'data': { 'type': 'str',
6456             'vcpus-count': 'int',
6457             'props': 'CpuInstanceProperties',
6458             '*qom-path': 'str'
6459           }
6463 # @query-hotpluggable-cpus:
6465 # Returns: a list of HotpluggableCPU objects.
6467 # Since: 2.7
6469 # Example:
6471 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6473 # -> { "execute": "query-hotpluggable-cpus" }
6474 # <- {"return": [
6475 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6476 #        "vcpus-count": 1 },
6477 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6478 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6479 #    ]}'
6481 # For pc machine type started with -smp 1,maxcpus=2:
6483 # -> { "execute": "query-hotpluggable-cpus" }
6484 # <- {"return": [
6485 #      {
6486 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6487 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6488 #      },
6489 #      {
6490 #         "qom-path": "/machine/unattached/device[0]",
6491 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6492 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6493 #      }
6494 #    ]}
6497 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
6500 # @GuidInfo:
6502 # GUID information.
6504 # @guid: the globally unique identifier
6506 # Since: 2.9
6508 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
6511 # @query-vm-generation-id:
6513 # Show Virtual Machine Generation ID
6515 # Since 2.9
6517 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }