qapi-schema: Rocker doc section contains unrelated stuff, fix
[qemu/ar7.git] / qapi-schema.json
blobadd4777e9a4b17c430ff0ac97560decce1c9167f
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/interop/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 # Documentation generated with qapi2texi.py is in source order, with
76 # included sub-schemas inserted at the first include directive
77 # (subsequent include directives have no effect).  To get a sane and
78 # stable order, it's best to include each sub-schema just once, or
79 # include it first in qapi-schema.json.
81 { 'include': 'qapi/common.json' }
82 { 'include': 'qapi/crypto.json' }
83 { 'include': 'qapi/block.json' }
84 { 'include': 'qapi/rocker.json' }
85 { 'include': 'qapi/event.json' }
86 { 'include': 'qapi/trace.json' }
87 { 'include': 'qapi/introspect.json' }
90 # = QMP commands
94 # @qmp_capabilities:
96 # Enable QMP capabilities.
98 # Arguments: None.
100 # Example:
102 # -> { "execute": "qmp_capabilities" }
103 # <- { "return": {} }
105 # Notes: This command is valid exactly when first connecting: it must be
106 # issued before any other command will be accepted, and will fail once the
107 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
109 # Since: 0.13
112 { 'command': 'qmp_capabilities' }
115 # @StrOrNull:
117 # This is a string value or the explicit lack of a string (null
118 # pointer in C).  Intended for cases when 'optional absent' already
119 # has a different meaning.
121 # @s: the string value
122 # @n: no string value
124 # Since: 2.10
126 { 'alternate': 'StrOrNull',
127   'data': { 's': 'str',
128             'n': 'null' } }
131 # @LostTickPolicy:
133 # Policy for handling lost ticks in timer devices.
135 # @discard: throw away the missed tick(s) and continue with future injection
136 #           normally.  Guest time may be delayed, unless the OS has explicit
137 #           handling of lost ticks
139 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
140 #         delayed due to the late tick
142 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
143 #         may be delayed, depending on how the OS reacts to the merging
144 #         of ticks
146 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
147 #        guest time should not be delayed once catchup is complete.
149 # Since: 2.0
151 { 'enum': 'LostTickPolicy',
152   'data': ['discard', 'delay', 'merge', 'slew' ] }
155 # @add_client:
157 # Allow client connections for VNC, Spice and socket based
158 # character devices to be passed in to QEMU via SCM_RIGHTS.
160 # @protocol: protocol name. Valid names are "vnc", "spice" or the
161 #            name of a character device (eg. from -chardev id=XXXX)
163 # @fdname: file descriptor name previously passed via 'getfd' command
165 # @skipauth: whether to skip authentication. Only applies
166 #            to "vnc" and "spice" protocols
168 # @tls: whether to perform TLS. Only applies to the "spice"
169 #       protocol
171 # Returns: nothing on success.
173 # Since: 0.14.0
175 # Example:
177 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
178 #                                              "fdname": "myclient" } }
179 # <- { "return": {} }
182 { 'command': 'add_client',
183   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
184             '*tls': 'bool' } }
187 # @NameInfo:
189 # Guest name information.
191 # @name: The name of the guest
193 # Since: 0.14.0
195 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
198 # @query-name:
200 # Return the name information of a guest.
202 # Returns: @NameInfo of the guest
204 # Since: 0.14.0
206 # Example:
208 # -> { "execute": "query-name" }
209 # <- { "return": { "name": "qemu-name" } }
212 { 'command': 'query-name', 'returns': 'NameInfo' }
215 # @KvmInfo:
217 # Information about support for KVM acceleration
219 # @enabled: true if KVM acceleration is active
221 # @present: true if KVM acceleration is built into this executable
223 # Since: 0.14.0
225 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
228 # @query-kvm:
230 # Returns information about KVM acceleration
232 # Returns: @KvmInfo
234 # Since: 0.14.0
236 # Example:
238 # -> { "execute": "query-kvm" }
239 # <- { "return": { "enabled": true, "present": true } }
242 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
245 # @RunState:
247 # An enumeration of VM run states.
249 # @debug: QEMU is running on a debugger
251 # @finish-migrate: guest is paused to finish the migration process
253 # @inmigrate: guest is paused waiting for an incoming migration.  Note
254 # that this state does not tell whether the machine will start at the
255 # end of the migration.  This depends on the command-line -S option and
256 # any invocation of 'stop' or 'cont' that has happened since QEMU was
257 # started.
259 # @internal-error: An internal error that prevents further guest execution
260 # has occurred
262 # @io-error: the last IOP has failed and the device is configured to pause
263 # on I/O errors
265 # @paused: guest has been paused via the 'stop' command
267 # @postmigrate: guest is paused following a successful 'migrate'
269 # @prelaunch: QEMU was started with -S and guest has not started
271 # @restore-vm: guest is paused to restore VM state
273 # @running: guest is actively running
275 # @save-vm: guest is paused to save the VM state
277 # @shutdown: guest is shut down (and -no-shutdown is in use)
279 # @suspended: guest is suspended (ACPI S3)
281 # @watchdog: the watchdog action is configured to pause and has been triggered
283 # @guest-panicked: guest has been panicked as a result of guest OS panic
285 # @colo: guest is paused to save/restore VM state under colo checkpoint,
286 #        VM can not get into this state unless colo capability is enabled
287 #        for migration. (since 2.8)
289 { 'enum': 'RunState',
290   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
291             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
292             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
293             'guest-panicked', 'colo' ] }
296 # @StatusInfo:
298 # Information about VCPU run state
300 # @running: true if all VCPUs are runnable, false if not runnable
302 # @singlestep: true if VCPUs are in single-step mode
304 # @status: the virtual machine @RunState
306 # Since:  0.14.0
308 # Notes: @singlestep is enabled through the GDB stub
310 { 'struct': 'StatusInfo',
311   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
314 # @query-status:
316 # Query the run status of all VCPUs
318 # Returns: @StatusInfo reflecting all VCPUs
320 # Since:  0.14.0
322 # Example:
324 # -> { "execute": "query-status" }
325 # <- { "return": { "running": true,
326 #                  "singlestep": false,
327 #                  "status": "running" } }
330 { 'command': 'query-status', 'returns': 'StatusInfo' }
333 # @UuidInfo:
335 # Guest UUID information (Universally Unique Identifier).
337 # @UUID: the UUID of the guest
339 # Since: 0.14.0
341 # Notes: If no UUID was specified for the guest, a null UUID is returned.
343 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
346 # @query-uuid:
348 # Query the guest UUID information.
350 # Returns: The @UuidInfo for the guest
352 # Since: 0.14.0
354 # Example:
356 # -> { "execute": "query-uuid" }
357 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
360 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
363 # @ChardevInfo:
365 # Information about a character device.
367 # @label: the label of the character device
369 # @filename: the filename of the character device
371 # @frontend-open: shows whether the frontend device attached to this backend
372 #                 (eg. with the chardev=... option) is in open or closed state
373 #                 (since 2.1)
375 # Notes: @filename is encoded using the QEMU command line character device
376 #        encoding.  See the QEMU man page for details.
378 # Since: 0.14.0
380 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
381                                   'filename': 'str',
382                                   'frontend-open': 'bool'} }
385 # @query-chardev:
387 # Returns information about current character devices.
389 # Returns: a list of @ChardevInfo
391 # Since: 0.14.0
393 # Example:
395 # -> { "execute": "query-chardev" }
396 # <- {
397 #       "return": [
398 #          {
399 #             "label": "charchannel0",
400 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
401 #             "frontend-open": false
402 #          },
403 #          {
404 #             "label": "charmonitor",
405 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
406 #             "frontend-open": true
407 #          },
408 #          {
409 #             "label": "charserial0",
410 #             "filename": "pty:/dev/pts/2",
411 #             "frontend-open": true
412 #          }
413 #       ]
414 #    }
417 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
420 # @ChardevBackendInfo:
422 # Information about a character device backend
424 # @name: The backend name
426 # Since: 2.0
428 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
431 # @query-chardev-backends:
433 # Returns information about character device backends.
435 # Returns: a list of @ChardevBackendInfo
437 # Since: 2.0
439 # Example:
441 # -> { "execute": "query-chardev-backends" }
442 # <- {
443 #       "return":[
444 #          {
445 #             "name":"udp"
446 #          },
447 #          {
448 #             "name":"tcp"
449 #          },
450 #          {
451 #             "name":"unix"
452 #          },
453 #          {
454 #             "name":"spiceport"
455 #          }
456 #       ]
457 #    }
460 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
463 # @DataFormat:
465 # An enumeration of data format.
467 # @utf8: Data is a UTF-8 string (RFC 3629)
469 # @base64: Data is Base64 encoded binary (RFC 3548)
471 # Since: 1.4
473 { 'enum': 'DataFormat',
474   'data': [ 'utf8', 'base64' ] }
477 # @ringbuf-write:
479 # Write to a ring buffer character device.
481 # @device: the ring buffer character device name
483 # @data: data to write
485 # @format: data encoding (default 'utf8').
486 #          - base64: data must be base64 encoded text.  Its binary
487 #            decoding gets written.
488 #          - utf8: data's UTF-8 encoding is written
489 #          - data itself is always Unicode regardless of format, like
490 #            any other string.
492 # Returns: Nothing on success
494 # Since: 1.4
496 # Example:
498 # -> { "execute": "ringbuf-write",
499 #      "arguments": { "device": "foo",
500 #                     "data": "abcdefgh",
501 #                     "format": "utf8" } }
502 # <- { "return": {} }
505 { 'command': 'ringbuf-write',
506   'data': {'device': 'str', 'data': 'str',
507            '*format': 'DataFormat'} }
510 # @ringbuf-read:
512 # Read from a ring buffer character device.
514 # @device: the ring buffer character device name
516 # @size: how many bytes to read at most
518 # @format: data encoding (default 'utf8').
519 #          - base64: the data read is returned in base64 encoding.
520 #          - utf8: the data read is interpreted as UTF-8.
521 #            Bug: can screw up when the buffer contains invalid UTF-8
522 #            sequences, NUL characters, after the ring buffer lost
523 #            data, and when reading stops because the size limit is
524 #            reached.
525 #          - The return value is always Unicode regardless of format,
526 #            like any other string.
528 # Returns: data read from the device
530 # Since: 1.4
532 # Example:
534 # -> { "execute": "ringbuf-read",
535 #      "arguments": { "device": "foo",
536 #                     "size": 1000,
537 #                     "format": "utf8" } }
538 # <- { "return": "abcdefgh" }
541 { 'command': 'ringbuf-read',
542   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
543   'returns': 'str' }
546 # @EventInfo:
548 # Information about a QMP event
550 # @name: The event name
552 # Since: 1.2.0
554 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
557 # @query-events:
559 # Return a list of supported QMP events by this server
561 # Returns: A list of @EventInfo for all supported events
563 # Since: 1.2.0
565 # Example:
567 # -> { "execute": "query-events" }
568 # <- {
569 #      "return": [
570 #          {
571 #             "name":"SHUTDOWN"
572 #          },
573 #          {
574 #             "name":"RESET"
575 #          }
576 #       ]
577 #    }
579 # Note: This example has been shortened as the real response is too long.
582 { 'command': 'query-events', 'returns': ['EventInfo'] }
585 # @MigrationStats:
587 # Detailed migration status.
589 # @transferred: amount of bytes already transferred to the target VM
591 # @remaining: amount of bytes remaining to be transferred to the target VM
593 # @total: total amount of bytes involved in the migration process
595 # @duplicate: number of duplicate (zero) pages (since 1.2)
597 # @skipped: number of skipped zero pages (since 1.5)
599 # @normal: number of normal pages (since 1.2)
601 # @normal-bytes: number of normal bytes sent (since 1.2)
603 # @dirty-pages-rate: number of pages dirtied by second by the
604 #        guest (since 1.3)
606 # @mbps: throughput in megabits/sec. (since 1.6)
608 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
610 # @postcopy-requests: The number of page requests received from the destination
611 #        (since 2.7)
613 # @page-size: The number of bytes per page for the various page-based
614 #        statistics (since 2.10)
616 # Since: 0.14.0
618 { 'struct': 'MigrationStats',
619   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
620            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
621            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
622            'mbps' : 'number', 'dirty-sync-count' : 'int',
623            'postcopy-requests' : 'int', 'page-size' : 'int' } }
626 # @XBZRLECacheStats:
628 # Detailed XBZRLE migration cache statistics
630 # @cache-size: XBZRLE cache size
632 # @bytes: amount of bytes already transferred to the target VM
634 # @pages: amount of pages transferred to the target VM
636 # @cache-miss: number of cache miss
638 # @cache-miss-rate: rate of cache miss (since 2.1)
640 # @overflow: number of overflows
642 # Since: 1.2
644 { 'struct': 'XBZRLECacheStats',
645   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
646            'cache-miss': 'int', 'cache-miss-rate': 'number',
647            'overflow': 'int' } }
650 # @MigrationStatus:
652 # An enumeration of migration status.
654 # @none: no migration has ever happened.
656 # @setup: migration process has been initiated.
658 # @cancelling: in the process of cancelling migration.
660 # @cancelled: cancelling migration is finished.
662 # @active: in the process of doing migration.
664 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
666 # @completed: migration is finished.
668 # @failed: some error occurred during migration process.
670 # @colo: VM is in the process of fault tolerance, VM can not get into this
671 #        state unless colo capability is enabled for migration. (since 2.8)
673 # Since: 2.3
676 { 'enum': 'MigrationStatus',
677   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
678             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
681 # @MigrationInfo:
683 # Information about current migration process.
685 # @status: @MigrationStatus describing the current migration status.
686 #          If this field is not returned, no migration process
687 #          has been initiated
689 # @ram: @MigrationStats containing detailed migration
690 #       status, only returned if status is 'active' or
691 #       'completed'(since 1.2)
693 # @disk: @MigrationStats containing detailed disk migration
694 #        status, only returned if status is 'active' and it is a block
695 #        migration
697 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
698 #                migration statistics, only returned if XBZRLE feature is on and
699 #                status is 'active' or 'completed' (since 1.2)
701 # @total-time: total amount of milliseconds since migration started.
702 #        If migration has ended, it returns the total migration
703 #        time. (since 1.2)
705 # @downtime: only present when migration finishes correctly
706 #        total downtime in milliseconds for the guest.
707 #        (since 1.3)
709 # @expected-downtime: only present while migration is active
710 #        expected downtime in milliseconds for the guest in last walk
711 #        of the dirty bitmap. (since 1.3)
713 # @setup-time: amount of setup time in milliseconds _before_ the
714 #        iterations begin but _after_ the QMP command is issued. This is designed
715 #        to provide an accounting of any activities (such as RDMA pinning) which
716 #        may be expensive, but do not actually occur during the iterative
717 #        migration rounds themselves. (since 1.6)
719 # @cpu-throttle-percentage: percentage of time guest cpus are being
720 #        throttled during auto-converge. This is only present when auto-converge
721 #        has started throttling guest cpus. (Since 2.7)
723 # @error-desc: the human readable error description string, when
724 #              @status is 'failed'. Clients should not attempt to parse the
725 #              error strings. (Since 2.7)
727 # Since: 0.14.0
729 { 'struct': 'MigrationInfo',
730   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
731            '*disk': 'MigrationStats',
732            '*xbzrle-cache': 'XBZRLECacheStats',
733            '*total-time': 'int',
734            '*expected-downtime': 'int',
735            '*downtime': 'int',
736            '*setup-time': 'int',
737            '*cpu-throttle-percentage': 'int',
738            '*error-desc': 'str'} }
741 # @query-migrate:
743 # Returns information about current migration process. If migration
744 # is active there will be another json-object with RAM migration
745 # status and if block migration is active another one with block
746 # migration status.
748 # Returns: @MigrationInfo
750 # Since: 0.14.0
752 # Example:
754 # 1. Before the first migration
756 # -> { "execute": "query-migrate" }
757 # <- { "return": {} }
759 # 2. Migration is done and has succeeded
761 # -> { "execute": "query-migrate" }
762 # <- { "return": {
763 #         "status": "completed",
764 #         "ram":{
765 #           "transferred":123,
766 #           "remaining":123,
767 #           "total":246,
768 #           "total-time":12345,
769 #           "setup-time":12345,
770 #           "downtime":12345,
771 #           "duplicate":123,
772 #           "normal":123,
773 #           "normal-bytes":123456,
774 #           "dirty-sync-count":15
775 #         }
776 #      }
777 #    }
779 # 3. Migration is done and has failed
781 # -> { "execute": "query-migrate" }
782 # <- { "return": { "status": "failed" } }
784 # 4. Migration is being performed and is not a block migration:
786 # -> { "execute": "query-migrate" }
787 # <- {
788 #       "return":{
789 #          "status":"active",
790 #          "ram":{
791 #             "transferred":123,
792 #             "remaining":123,
793 #             "total":246,
794 #             "total-time":12345,
795 #             "setup-time":12345,
796 #             "expected-downtime":12345,
797 #             "duplicate":123,
798 #             "normal":123,
799 #             "normal-bytes":123456,
800 #             "dirty-sync-count":15
801 #          }
802 #       }
803 #    }
805 # 5. Migration is being performed and is a block migration:
807 # -> { "execute": "query-migrate" }
808 # <- {
809 #       "return":{
810 #          "status":"active",
811 #          "ram":{
812 #             "total":1057024,
813 #             "remaining":1053304,
814 #             "transferred":3720,
815 #             "total-time":12345,
816 #             "setup-time":12345,
817 #             "expected-downtime":12345,
818 #             "duplicate":123,
819 #             "normal":123,
820 #             "normal-bytes":123456,
821 #             "dirty-sync-count":15
822 #          },
823 #          "disk":{
824 #             "total":20971520,
825 #             "remaining":20880384,
826 #             "transferred":91136
827 #          }
828 #       }
829 #    }
831 # 6. Migration is being performed and XBZRLE is active:
833 # -> { "execute": "query-migrate" }
834 # <- {
835 #       "return":{
836 #          "status":"active",
837 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
838 #          "ram":{
839 #             "total":1057024,
840 #             "remaining":1053304,
841 #             "transferred":3720,
842 #             "total-time":12345,
843 #             "setup-time":12345,
844 #             "expected-downtime":12345,
845 #             "duplicate":10,
846 #             "normal":3333,
847 #             "normal-bytes":3412992,
848 #             "dirty-sync-count":15
849 #          },
850 #          "xbzrle-cache":{
851 #             "cache-size":67108864,
852 #             "bytes":20971520,
853 #             "pages":2444343,
854 #             "cache-miss":2244,
855 #             "cache-miss-rate":0.123,
856 #             "overflow":34434
857 #          }
858 #       }
859 #    }
862 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
865 # @MigrationCapability:
867 # Migration capabilities enumeration
869 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
870 #          This feature allows us to minimize migration traffic for certain work
871 #          loads, by sending compressed difference of the pages
873 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
874 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
875 #          Disabled by default. (since 2.0)
877 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
878 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
879 #          source and target VM to support this feature. To enable it is sufficient
880 #          to enable the capability on the source VM. The feature is disabled by
881 #          default. (since 1.6)
883 # @compress: Use multiple compression threads to accelerate live migration.
884 #          This feature can help to reduce the migration traffic, by sending
885 #          compressed pages. Please note that if compress and xbzrle are both
886 #          on, compress only takes effect in the ram bulk stage, after that,
887 #          it will be disabled and only xbzrle takes effect, this can help to
888 #          minimize migration traffic. The feature is disabled by default.
889 #          (since 2.4 )
891 # @events: generate events for each migration state change
892 #          (since 2.4 )
894 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
895 #          to speed up convergence of RAM migration. (since 1.6)
897 # @postcopy-ram: Start executing on the migration target before all of RAM has
898 #          been migrated, pulling the remaining pages along as needed. NOTE: If
899 #          the migration fails during postcopy the VM will fail.  (since 2.6)
901 # @x-colo: If enabled, migration will never end, and the state of the VM on the
902 #        primary side will be migrated continuously to the VM on secondary
903 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
904 #        Non-stop Service. (since 2.8)
906 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
907 #        during postcopy-ram migration. (since 2.9)
909 # @block: If enabled, QEMU will also migrate the contents of all block
910 #          devices.  Default is disabled.  A possible alternative uses
911 #          mirror jobs to a builtin NBD server on the destination, which
912 #          offers more flexibility.
913 #          (Since 2.10)
915 # @return-path: If enabled, migration will use the return path even
916 #               for precopy. (since 2.10)
918 # Since: 1.2
920 { 'enum': 'MigrationCapability',
921   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
922            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
923            'block', 'return-path' ] }
926 # @MigrationCapabilityStatus:
928 # Migration capability information
930 # @capability: capability enum
932 # @state: capability state bool
934 # Since: 1.2
936 { 'struct': 'MigrationCapabilityStatus',
937   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
940 # @migrate-set-capabilities:
942 # Enable/Disable the following migration capabilities (like xbzrle)
944 # @capabilities: json array of capability modifications to make
946 # Since: 1.2
948 # Example:
950 # -> { "execute": "migrate-set-capabilities" , "arguments":
951 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
954 { 'command': 'migrate-set-capabilities',
955   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
958 # @query-migrate-capabilities:
960 # Returns information about the current migration capabilities status
962 # Returns: @MigrationCapabilitiesStatus
964 # Since: 1.2
966 # Example:
968 # -> { "execute": "query-migrate-capabilities" }
969 # <- { "return": [
970 #       {"state": false, "capability": "xbzrle"},
971 #       {"state": false, "capability": "rdma-pin-all"},
972 #       {"state": false, "capability": "auto-converge"},
973 #       {"state": false, "capability": "zero-blocks"},
974 #       {"state": false, "capability": "compress"},
975 #       {"state": true, "capability": "events"},
976 #       {"state": false, "capability": "postcopy-ram"},
977 #       {"state": false, "capability": "x-colo"}
978 #    ]}
981 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
984 # @MigrationParameter:
986 # Migration parameters enumeration
988 # @compress-level: Set the compression level to be used in live migration,
989 #          the compression level is an integer between 0 and 9, where 0 means
990 #          no compression, 1 means the best compression speed, and 9 means best
991 #          compression ratio which will consume more CPU.
993 # @compress-threads: Set compression thread count to be used in live migration,
994 #          the compression thread count is an integer between 1 and 255.
996 # @decompress-threads: Set decompression thread count to be used in live
997 #          migration, the decompression thread count is an integer between 1
998 #          and 255. Usually, decompression is at least 4 times as fast as
999 #          compression, so set the decompress-threads to the number about 1/4
1000 #          of compress-threads is adequate.
1002 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
1003 #                        when migration auto-converge is activated. The
1004 #                        default value is 20. (Since 2.7)
1006 # @cpu-throttle-increment: throttle percentage increase each time
1007 #                          auto-converge detects that migration is not making
1008 #                          progress. The default value is 10. (Since 2.7)
1010 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
1011 #             establishing a TLS connection over the migration data channel.
1012 #             On the outgoing side of the migration, the credentials must
1013 #             be for a 'client' endpoint, while for the incoming side the
1014 #             credentials must be for a 'server' endpoint. Setting this
1015 #             will enable TLS for all migrations. The default is unset,
1016 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1018 # @tls-hostname: hostname of the target host for the migration. This is
1019 #                required when using x509 based TLS credentials and the
1020 #                migration URI does not already include a hostname. For
1021 #                example if using fd: or exec: based migration, the
1022 #                hostname must be provided so that the server's x509
1023 #                certificate identity can be validated. (Since 2.7)
1025 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1026 #                 bytes per second. (Since 2.8)
1028 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1029 #                  downtime in milliseconds (Since 2.8)
1031 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
1032 #          periodic mode. (Since 2.8)
1034 # @block-incremental: Affects how much storage is migrated when the
1035 #       block migration capability is enabled.  When false, the entire
1036 #       storage backing chain is migrated into a flattened image at
1037 #       the destination; when true, only the active qcow2 layer is
1038 #       migrated and the destination must already have access to the
1039 #       same backing chain as was used on the source.  (since 2.10)
1041 # Since: 2.4
1043 { 'enum': 'MigrationParameter',
1044   'data': ['compress-level', 'compress-threads', 'decompress-threads',
1045            'cpu-throttle-initial', 'cpu-throttle-increment',
1046            'tls-creds', 'tls-hostname', 'max-bandwidth',
1047            'downtime-limit', 'x-checkpoint-delay', 'block-incremental' ] }
1050 # @MigrateSetParameters:
1052 # @compress-level: compression level
1054 # @compress-threads: compression thread count
1056 # @decompress-threads: decompression thread count
1058 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1059 #                        throttled when migration auto-converge is activated.
1060 #                        The default value is 20. (Since 2.7)
1062 # @cpu-throttle-increment: throttle percentage increase each time
1063 #                          auto-converge detects that migration is not making
1064 #                          progress. The default value is 10. (Since 2.7)
1066 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1067 #             for establishing a TLS connection over the migration data
1068 #             channel. On the outgoing side of the migration, the credentials
1069 #             must be for a 'client' endpoint, while for the incoming side the
1070 #             credentials must be for a 'server' endpoint. Setting this
1071 #             to a non-empty string enables TLS for all migrations.
1072 #             An empty string means that QEMU will use plain text mode for
1073 #             migration, rather than TLS (Since 2.9)
1074 #             Previously (since 2.7), this was reported by omitting
1075 #             tls-creds instead.
1077 # @tls-hostname: hostname of the target host for the migration. This
1078 #                is required when using x509 based TLS credentials and the
1079 #                migration URI does not already include a hostname. For
1080 #                example if using fd: or exec: based migration, the
1081 #                hostname must be provided so that the server's x509
1082 #                certificate identity can be validated. (Since 2.7)
1083 #                An empty string means that QEMU will use the hostname
1084 #                associated with the migration URI, if any. (Since 2.9)
1085 #                Previously (since 2.7), this was reported by omitting
1086 #                tls-hostname instead.
1088 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1089 #                 bytes per second. (Since 2.8)
1091 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1092 #                  downtime in milliseconds (Since 2.8)
1094 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1096 # @block-incremental: Affects how much storage is migrated when the
1097 #       block migration capability is enabled.  When false, the entire
1098 #       storage backing chain is migrated into a flattened image at
1099 #       the destination; when true, only the active qcow2 layer is
1100 #       migrated and the destination must already have access to the
1101 #       same backing chain as was used on the source.  (since 2.10)
1103 # Since: 2.4
1105 # TODO either fuse back into MigrationParameters, or make
1106 # MigrationParameters members mandatory
1107 { 'struct': 'MigrateSetParameters',
1108   'data': { '*compress-level': 'int',
1109             '*compress-threads': 'int',
1110             '*decompress-threads': 'int',
1111             '*cpu-throttle-initial': 'int',
1112             '*cpu-throttle-increment': 'int',
1113             '*tls-creds': 'StrOrNull',
1114             '*tls-hostname': 'StrOrNull',
1115             '*max-bandwidth': 'int',
1116             '*downtime-limit': 'int',
1117             '*x-checkpoint-delay': 'int',
1118             '*block-incremental': 'bool' } }
1121 # @migrate-set-parameters:
1123 # Set various migration parameters.
1125 # Since: 2.4
1127 # Example:
1129 # -> { "execute": "migrate-set-parameters" ,
1130 #      "arguments": { "compress-level": 1 } }
1133 { 'command': 'migrate-set-parameters', 'boxed': true,
1134   'data': 'MigrateSetParameters' }
1137 # @MigrationParameters:
1139 # The optional members aren't actually optional.
1141 # @compress-level: compression level
1143 # @compress-threads: compression thread count
1145 # @decompress-threads: decompression thread count
1147 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1148 #                        throttled when migration auto-converge is activated.
1149 #                        (Since 2.7)
1151 # @cpu-throttle-increment: throttle percentage increase each time
1152 #                          auto-converge detects that migration is not making
1153 #                          progress. (Since 2.7)
1155 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1156 #             for establishing a TLS connection over the migration data
1157 #             channel. On the outgoing side of the migration, the credentials
1158 #             must be for a 'client' endpoint, while for the incoming side the
1159 #             credentials must be for a 'server' endpoint.
1160 #             An empty string means that QEMU will use plain text mode for
1161 #             migration, rather than TLS (Since 2.7)
1162 #             Note: 2.8 reports this by omitting tls-creds instead.
1164 # @tls-hostname: hostname of the target host for the migration. This
1165 #                is required when using x509 based TLS credentials and the
1166 #                migration URI does not already include a hostname. For
1167 #                example if using fd: or exec: based migration, the
1168 #                hostname must be provided so that the server's x509
1169 #                certificate identity can be validated. (Since 2.7)
1170 #                An empty string means that QEMU will use the hostname
1171 #                associated with the migration URI, if any. (Since 2.9)
1172 #                Note: 2.8 reports this by omitting tls-hostname instead.
1174 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1175 #                 bytes per second. (Since 2.8)
1177 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1178 #                  downtime in milliseconds (Since 2.8)
1180 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1182 # @block-incremental: Affects how much storage is migrated when the
1183 #       block migration capability is enabled.  When false, the entire
1184 #       storage backing chain is migrated into a flattened image at
1185 #       the destination; when true, only the active qcow2 layer is
1186 #       migrated and the destination must already have access to the
1187 #       same backing chain as was used on the source.  (since 2.10)
1189 # Since: 2.4
1191 { 'struct': 'MigrationParameters',
1192   'data': { '*compress-level': 'int',
1193             '*compress-threads': 'int',
1194             '*decompress-threads': 'int',
1195             '*cpu-throttle-initial': 'int',
1196             '*cpu-throttle-increment': 'int',
1197             '*tls-creds': 'str',
1198             '*tls-hostname': 'str',
1199             '*max-bandwidth': 'int',
1200             '*downtime-limit': 'int',
1201             '*x-checkpoint-delay': 'int',
1202             '*block-incremental': 'bool' } }
1205 # @query-migrate-parameters:
1207 # Returns information about the current migration parameters
1209 # Returns: @MigrationParameters
1211 # Since: 2.4
1213 # Example:
1215 # -> { "execute": "query-migrate-parameters" }
1216 # <- { "return": {
1217 #          "decompress-threads": 2,
1218 #          "cpu-throttle-increment": 10,
1219 #          "compress-threads": 8,
1220 #          "compress-level": 1,
1221 #          "cpu-throttle-initial": 20,
1222 #          "max-bandwidth": 33554432,
1223 #          "downtime-limit": 300
1224 #       }
1225 #    }
1228 { 'command': 'query-migrate-parameters',
1229   'returns': 'MigrationParameters' }
1232 # @client_migrate_info:
1234 # Set migration information for remote display.  This makes the server
1235 # ask the client to automatically reconnect using the new parameters
1236 # once migration finished successfully.  Only implemented for SPICE.
1238 # @protocol:     must be "spice"
1239 # @hostname:     migration target hostname
1240 # @port:         spice tcp port for plaintext channels
1241 # @tls-port:     spice tcp port for tls-secured channels
1242 # @cert-subject: server certificate subject
1244 # Since: 0.14.0
1246 # Example:
1248 # -> { "execute": "client_migrate_info",
1249 #      "arguments": { "protocol": "spice",
1250 #                     "hostname": "virt42.lab.kraxel.org",
1251 #                     "port": 1234 } }
1252 # <- { "return": {} }
1255 { 'command': 'client_migrate_info',
1256   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1257             '*tls-port': 'int', '*cert-subject': 'str' } }
1260 # @migrate-start-postcopy:
1262 # Followup to a migration command to switch the migration to postcopy mode.
1263 # The postcopy-ram capability must be set before the original migration
1264 # command.
1266 # Since: 2.5
1268 # Example:
1270 # -> { "execute": "migrate-start-postcopy" }
1271 # <- { "return": {} }
1274 { 'command': 'migrate-start-postcopy' }
1277 # @COLOMessage:
1279 # The message transmission between Primary side and Secondary side.
1281 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1283 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1285 # @checkpoint-reply: SVM gets PVM's checkpoint request
1287 # @vmstate-send: VM's state will be sent by PVM.
1289 # @vmstate-size: The total size of VMstate.
1291 # @vmstate-received: VM's state has been received by SVM.
1293 # @vmstate-loaded: VM's state has been loaded by SVM.
1295 # Since: 2.8
1297 { 'enum': 'COLOMessage',
1298   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1299             'vmstate-send', 'vmstate-size', 'vmstate-received',
1300             'vmstate-loaded' ] }
1303 # @COLOMode:
1305 # The colo mode
1307 # @unknown: unknown mode
1309 # @primary: master side
1311 # @secondary: slave side
1313 # Since: 2.8
1315 { 'enum': 'COLOMode',
1316   'data': [ 'unknown', 'primary', 'secondary'] }
1319 # @FailoverStatus:
1321 # An enumeration of COLO failover status
1323 # @none: no failover has ever happened
1325 # @require: got failover requirement but not handled
1327 # @active: in the process of doing failover
1329 # @completed: finish the process of failover
1331 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1333 # Since: 2.8
1335 { 'enum': 'FailoverStatus',
1336   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1339 # @x-colo-lost-heartbeat:
1341 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1342 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1343 # If sent to the Secondary, the Secondary side will run failover work,
1344 # then takes over server operation to become the service VM.
1346 # Since: 2.8
1348 # Example:
1350 # -> { "execute": "x-colo-lost-heartbeat" }
1351 # <- { "return": {} }
1354 { 'command': 'x-colo-lost-heartbeat' }
1357 # @MouseInfo:
1359 # Information about a mouse device.
1361 # @name: the name of the mouse device
1363 # @index: the index of the mouse device
1365 # @current: true if this device is currently receiving mouse events
1367 # @absolute: true if this device supports absolute coordinates as input
1369 # Since: 0.14.0
1371 { 'struct': 'MouseInfo',
1372   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1373            'absolute': 'bool'} }
1376 # @query-mice:
1378 # Returns information about each active mouse device
1380 # Returns: a list of @MouseInfo for each device
1382 # Since: 0.14.0
1384 # Example:
1386 # -> { "execute": "query-mice" }
1387 # <- { "return": [
1388 #          {
1389 #             "name":"QEMU Microsoft Mouse",
1390 #             "index":0,
1391 #             "current":false,
1392 #             "absolute":false
1393 #          },
1394 #          {
1395 #             "name":"QEMU PS/2 Mouse",
1396 #             "index":1,
1397 #             "current":true,
1398 #             "absolute":true
1399 #          }
1400 #       ]
1401 #    }
1404 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1407 # @CpuInfoArch:
1409 # An enumeration of cpu types that enable additional information during
1410 # @query-cpus.
1412 # Since: 2.6
1414 { 'enum': 'CpuInfoArch',
1415   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1418 # @CpuInfo:
1420 # Information about a virtual CPU
1422 # @CPU: the index of the virtual CPU
1424 # @current: this only exists for backwards compatibility and should be ignored
1426 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1427 #          to a processor specific low power mode.
1429 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1431 # @thread_id: ID of the underlying host thread
1433 # @props: properties describing to which node/socket/core/thread
1434 #         virtual CPU belongs to, provided if supported by board (since 2.10)
1436 # @arch: architecture of the cpu, which determines which additional fields
1437 #        will be listed (since 2.6)
1439 # Since: 0.14.0
1441 # Notes: @halted is a transient state that changes frequently.  By the time the
1442 #        data is sent to the client, the guest may no longer be halted.
1444 { 'union': 'CpuInfo',
1445   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1446            'qom_path': 'str', 'thread_id': 'int',
1447            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
1448   'discriminator': 'arch',
1449   'data': { 'x86': 'CpuInfoX86',
1450             'sparc': 'CpuInfoSPARC',
1451             'ppc': 'CpuInfoPPC',
1452             'mips': 'CpuInfoMIPS',
1453             'tricore': 'CpuInfoTricore',
1454             'other': 'CpuInfoOther' } }
1457 # @CpuInfoX86:
1459 # Additional information about a virtual i386 or x86_64 CPU
1461 # @pc: the 64-bit instruction pointer
1463 # Since: 2.6
1465 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1468 # @CpuInfoSPARC:
1470 # Additional information about a virtual SPARC CPU
1472 # @pc: the PC component of the instruction pointer
1474 # @npc: the NPC component of the instruction pointer
1476 # Since: 2.6
1478 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1481 # @CpuInfoPPC:
1483 # Additional information about a virtual PPC CPU
1485 # @nip: the instruction pointer
1487 # Since: 2.6
1489 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1492 # @CpuInfoMIPS:
1494 # Additional information about a virtual MIPS CPU
1496 # @PC: the instruction pointer
1498 # Since: 2.6
1500 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1503 # @CpuInfoTricore:
1505 # Additional information about a virtual Tricore CPU
1507 # @PC: the instruction pointer
1509 # Since: 2.6
1511 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1514 # @CpuInfoOther:
1516 # No additional information is available about the virtual CPU
1518 # Since: 2.6
1521 { 'struct': 'CpuInfoOther', 'data': { } }
1524 # @query-cpus:
1526 # Returns a list of information about each virtual CPU.
1528 # Returns: a list of @CpuInfo for each virtual CPU
1530 # Since: 0.14.0
1532 # Example:
1534 # -> { "execute": "query-cpus" }
1535 # <- { "return": [
1536 #          {
1537 #             "CPU":0,
1538 #             "current":true,
1539 #             "halted":false,
1540 #             "qom_path":"/machine/unattached/device[0]",
1541 #             "arch":"x86",
1542 #             "pc":3227107138,
1543 #             "thread_id":3134
1544 #          },
1545 #          {
1546 #             "CPU":1,
1547 #             "current":false,
1548 #             "halted":true,
1549 #             "qom_path":"/machine/unattached/device[2]",
1550 #             "arch":"x86",
1551 #             "pc":7108165,
1552 #             "thread_id":3135
1553 #          }
1554 #       ]
1555 #    }
1558 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1561 # @IOThreadInfo:
1563 # Information about an iothread
1565 # @id: the identifier of the iothread
1567 # @thread-id: ID of the underlying host thread
1569 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1570 #               (since 2.9)
1572 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1573 #             configured (since 2.9)
1575 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1576 #               it's not configured (since 2.9)
1578 # Since: 2.0
1580 { 'struct': 'IOThreadInfo',
1581   'data': {'id': 'str',
1582            'thread-id': 'int',
1583            'poll-max-ns': 'int',
1584            'poll-grow': 'int',
1585            'poll-shrink': 'int' } }
1588 # @query-iothreads:
1590 # Returns a list of information about each iothread.
1592 # Note: this list excludes the QEMU main loop thread, which is not declared
1593 # using the -object iothread command-line option.  It is always the main thread
1594 # of the process.
1596 # Returns: a list of @IOThreadInfo for each iothread
1598 # Since: 2.0
1600 # Example:
1602 # -> { "execute": "query-iothreads" }
1603 # <- { "return": [
1604 #          {
1605 #             "id":"iothread0",
1606 #             "thread-id":3134
1607 #          },
1608 #          {
1609 #             "id":"iothread1",
1610 #             "thread-id":3135
1611 #          }
1612 #       ]
1613 #    }
1616 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1619 # @NetworkAddressFamily:
1621 # The network address family
1623 # @ipv4: IPV4 family
1625 # @ipv6: IPV6 family
1627 # @unix: unix socket
1629 # @vsock: vsock family (since 2.8)
1631 # @unknown: otherwise
1633 # Since: 2.1
1635 { 'enum': 'NetworkAddressFamily',
1636   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1639 # @VncBasicInfo:
1641 # The basic information for vnc network connection
1643 # @host: IP address
1645 # @service: The service name of the vnc port. This may depend on the host
1646 #           system's service database so symbolic names should not be relied
1647 #           on.
1649 # @family: address family
1651 # @websocket: true in case the socket is a websocket (since 2.3).
1653 # Since: 2.1
1655 { 'struct': 'VncBasicInfo',
1656   'data': { 'host': 'str',
1657             'service': 'str',
1658             'family': 'NetworkAddressFamily',
1659             'websocket': 'bool' } }
1662 # @VncServerInfo:
1664 # The network connection information for server
1666 # @auth: authentication method used for
1667 #        the plain (non-websocket) VNC server
1669 # Since: 2.1
1671 { 'struct': 'VncServerInfo',
1672   'base': 'VncBasicInfo',
1673   'data': { '*auth': 'str' } }
1676 # @VncClientInfo:
1678 # Information about a connected VNC client.
1680 # @x509_dname: If x509 authentication is in use, the Distinguished
1681 #              Name of the client.
1683 # @sasl_username: If SASL authentication is in use, the SASL username
1684 #                 used for authentication.
1686 # Since: 0.14.0
1688 { 'struct': 'VncClientInfo',
1689   'base': 'VncBasicInfo',
1690   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1693 # @VncInfo:
1695 # Information about the VNC session.
1697 # @enabled: true if the VNC server is enabled, false otherwise
1699 # @host: The hostname the VNC server is bound to.  This depends on
1700 #        the name resolution on the host and may be an IP address.
1702 # @family: 'ipv6' if the host is listening for IPv6 connections
1703 #                    'ipv4' if the host is listening for IPv4 connections
1704 #                    'unix' if the host is listening on a unix domain socket
1705 #                    'unknown' otherwise
1707 # @service: The service name of the server's port.  This may depends
1708 #           on the host system's service database so symbolic names should not
1709 #           be relied on.
1711 # @auth: the current authentication type used by the server
1712 #        'none' if no authentication is being used
1713 #        'vnc' if VNC authentication is being used
1714 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1715 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1716 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1717 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1718 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1719 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1720 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1721 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1722 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1724 # @clients: a list of @VncClientInfo of all currently connected clients
1726 # Since: 0.14.0
1728 { 'struct': 'VncInfo',
1729   'data': {'enabled': 'bool', '*host': 'str',
1730            '*family': 'NetworkAddressFamily',
1731            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1734 # @VncPrimaryAuth:
1736 # vnc primary authentication method.
1738 # Since: 2.3
1740 { 'enum': 'VncPrimaryAuth',
1741   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1742             'tls', 'vencrypt', 'sasl' ] }
1745 # @VncVencryptSubAuth:
1747 # vnc sub authentication method with vencrypt.
1749 # Since: 2.3
1751 { 'enum': 'VncVencryptSubAuth',
1752   'data': [ 'plain',
1753             'tls-none',  'x509-none',
1754             'tls-vnc',   'x509-vnc',
1755             'tls-plain', 'x509-plain',
1756             'tls-sasl',  'x509-sasl' ] }
1760 # @VncServerInfo2:
1762 # The network connection information for server
1764 # @auth: The current authentication type used by the servers
1766 # @vencrypt: The vencrypt sub authentication type used by the
1767 #            servers, only specified in case auth == vencrypt.
1769 # Since: 2.9
1771 { 'struct': 'VncServerInfo2',
1772   'base': 'VncBasicInfo',
1773   'data': { 'auth'      : 'VncPrimaryAuth',
1774             '*vencrypt' : 'VncVencryptSubAuth' } }
1778 # @VncInfo2:
1780 # Information about a vnc server
1782 # @id: vnc server name.
1784 # @server: A list of @VncBasincInfo describing all listening sockets.
1785 #          The list can be empty (in case the vnc server is disabled).
1786 #          It also may have multiple entries: normal + websocket,
1787 #          possibly also ipv4 + ipv6 in the future.
1789 # @clients: A list of @VncClientInfo of all currently connected clients.
1790 #           The list can be empty, for obvious reasons.
1792 # @auth: The current authentication type used by the non-websockets servers
1794 # @vencrypt: The vencrypt authentication type used by the servers,
1795 #            only specified in case auth == vencrypt.
1797 # @display: The display device the vnc server is linked to.
1799 # Since: 2.3
1801 { 'struct': 'VncInfo2',
1802   'data': { 'id'        : 'str',
1803             'server'    : ['VncServerInfo2'],
1804             'clients'   : ['VncClientInfo'],
1805             'auth'      : 'VncPrimaryAuth',
1806             '*vencrypt' : 'VncVencryptSubAuth',
1807             '*display'  : 'str' } }
1810 # @query-vnc:
1812 # Returns information about the current VNC server
1814 # Returns: @VncInfo
1816 # Since: 0.14.0
1818 # Example:
1820 # -> { "execute": "query-vnc" }
1821 # <- { "return": {
1822 #          "enabled":true,
1823 #          "host":"0.0.0.0",
1824 #          "service":"50402",
1825 #          "auth":"vnc",
1826 #          "family":"ipv4",
1827 #          "clients":[
1828 #             {
1829 #                "host":"127.0.0.1",
1830 #                "service":"50401",
1831 #                "family":"ipv4"
1832 #             }
1833 #          ]
1834 #       }
1835 #    }
1838 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1841 # @query-vnc-servers:
1843 # Returns a list of vnc servers.  The list can be empty.
1845 # Returns: a list of @VncInfo2
1847 # Since: 2.3
1849 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1852 # @SpiceBasicInfo:
1854 # The basic information for SPICE network connection
1856 # @host: IP address
1858 # @port: port number
1860 # @family: address family
1862 # Since: 2.1
1864 { 'struct': 'SpiceBasicInfo',
1865   'data': { 'host': 'str',
1866             'port': 'str',
1867             'family': 'NetworkAddressFamily' } }
1870 # @SpiceServerInfo:
1872 # Information about a SPICE server
1874 # @auth: authentication method
1876 # Since: 2.1
1878 { 'struct': 'SpiceServerInfo',
1879   'base': 'SpiceBasicInfo',
1880   'data': { '*auth': 'str' } }
1883 # @SpiceChannel:
1885 # Information about a SPICE client channel.
1887 # @connection-id: SPICE connection id number.  All channels with the same id
1888 #                 belong to the same SPICE session.
1890 # @channel-type: SPICE channel type number.  "1" is the main control
1891 #                channel, filter for this one if you want to track spice
1892 #                sessions only
1894 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1895 #              multiple channels of the same type exist, such as multiple
1896 #              display channels in a multihead setup
1898 # @tls: true if the channel is encrypted, false otherwise.
1900 # Since: 0.14.0
1902 { 'struct': 'SpiceChannel',
1903   'base': 'SpiceBasicInfo',
1904   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1905            'tls': 'bool'} }
1908 # @SpiceQueryMouseMode:
1910 # An enumeration of Spice mouse states.
1912 # @client: Mouse cursor position is determined by the client.
1914 # @server: Mouse cursor position is determined by the server.
1916 # @unknown: No information is available about mouse mode used by
1917 #           the spice server.
1919 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1921 # Since: 1.1
1923 { 'enum': 'SpiceQueryMouseMode',
1924   'data': [ 'client', 'server', 'unknown' ] }
1927 # @SpiceInfo:
1929 # Information about the SPICE session.
1931 # @enabled: true if the SPICE server is enabled, false otherwise
1933 # @migrated: true if the last guest migration completed and spice
1934 #            migration had completed as well. false otherwise. (since 1.4)
1936 # @host: The hostname the SPICE server is bound to.  This depends on
1937 #        the name resolution on the host and may be an IP address.
1939 # @port: The SPICE server's port number.
1941 # @compiled-version: SPICE server version.
1943 # @tls-port: The SPICE server's TLS port number.
1945 # @auth: the current authentication type used by the server
1946 #        'none'  if no authentication is being used
1947 #        'spice' uses SASL or direct TLS authentication, depending on command
1948 #                line options
1950 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1951 #              be determined by the client or the server, or unknown if spice
1952 #              server doesn't provide this information. (since: 1.1)
1954 # @channels: a list of @SpiceChannel for each active spice channel
1956 # Since: 0.14.0
1958 { 'struct': 'SpiceInfo',
1959   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1960            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1961            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1964 # @query-spice:
1966 # Returns information about the current SPICE server
1968 # Returns: @SpiceInfo
1970 # Since: 0.14.0
1972 # Example:
1974 # -> { "execute": "query-spice" }
1975 # <- { "return": {
1976 #          "enabled": true,
1977 #          "auth": "spice",
1978 #          "port": 5920,
1979 #          "tls-port": 5921,
1980 #          "host": "0.0.0.0",
1981 #          "channels": [
1982 #             {
1983 #                "port": "54924",
1984 #                "family": "ipv4",
1985 #                "channel-type": 1,
1986 #                "connection-id": 1804289383,
1987 #                "host": "127.0.0.1",
1988 #                "channel-id": 0,
1989 #                "tls": true
1990 #             },
1991 #             {
1992 #                "port": "36710",
1993 #                "family": "ipv4",
1994 #                "channel-type": 4,
1995 #                "connection-id": 1804289383,
1996 #                "host": "127.0.0.1",
1997 #                "channel-id": 0,
1998 #                "tls": false
1999 #             },
2000 #             [ ... more channels follow ... ]
2001 #          ]
2002 #       }
2003 #    }
2006 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
2009 # @BalloonInfo:
2011 # Information about the guest balloon device.
2013 # @actual: the number of bytes the balloon currently contains
2015 # Since: 0.14.0
2018 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
2021 # @query-balloon:
2023 # Return information about the balloon device.
2025 # Returns: @BalloonInfo on success
2027 #          If the balloon driver is enabled but not functional because the KVM
2028 #          kernel module cannot support it, KvmMissingCap
2030 #          If no balloon device is present, DeviceNotActive
2032 # Since: 0.14.0
2034 # Example:
2036 # -> { "execute": "query-balloon" }
2037 # <- { "return": {
2038 #          "actual": 1073741824,
2039 #       }
2040 #    }
2043 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
2046 # @PciMemoryRange:
2048 # A PCI device memory region
2050 # @base: the starting address (guest physical)
2052 # @limit: the ending address (guest physical)
2054 # Since: 0.14.0
2056 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
2059 # @PciMemoryRegion:
2061 # Information about a PCI device I/O region.
2063 # @bar: the index of the Base Address Register for this region
2065 # @type: 'io' if the region is a PIO region
2066 #        'memory' if the region is a MMIO region
2068 # @size: memory size
2070 # @prefetch: if @type is 'memory', true if the memory is prefetchable
2072 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
2074 # Since: 0.14.0
2076 { 'struct': 'PciMemoryRegion',
2077   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
2078            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
2081 # @PciBusInfo:
2083 # Information about a bus of a PCI Bridge device
2085 # @number: primary bus interface number.  This should be the number of the
2086 #          bus the device resides on.
2088 # @secondary: secondary bus interface number.  This is the number of the
2089 #             main bus for the bridge
2091 # @subordinate: This is the highest number bus that resides below the
2092 #               bridge.
2094 # @io_range: The PIO range for all devices on this bridge
2096 # @memory_range: The MMIO range for all devices on this bridge
2098 # @prefetchable_range: The range of prefetchable MMIO for all devices on
2099 #                      this bridge
2101 # Since: 2.4
2103 { 'struct': 'PciBusInfo',
2104   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
2105            'io_range': 'PciMemoryRange',
2106            'memory_range': 'PciMemoryRange',
2107            'prefetchable_range': 'PciMemoryRange' } }
2110 # @PciBridgeInfo:
2112 # Information about a PCI Bridge device
2114 # @bus: information about the bus the device resides on
2116 # @devices: a list of @PciDeviceInfo for each device on this bridge
2118 # Since: 0.14.0
2120 { 'struct': 'PciBridgeInfo',
2121   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
2124 # @PciDeviceClass:
2126 # Information about the Class of a PCI device
2128 # @desc: a string description of the device's class
2130 # @class: the class code of the device
2132 # Since: 2.4
2134 { 'struct': 'PciDeviceClass',
2135   'data': {'*desc': 'str', 'class': 'int'} }
2138 # @PciDeviceId:
2140 # Information about the Id of a PCI device
2142 # @device: the PCI device id
2144 # @vendor: the PCI vendor id
2146 # Since: 2.4
2148 { 'struct': 'PciDeviceId',
2149   'data': {'device': 'int', 'vendor': 'int'} }
2152 # @PciDeviceInfo:
2154 # Information about a PCI device
2156 # @bus: the bus number of the device
2158 # @slot: the slot the device is located in
2160 # @function: the function of the slot used by the device
2162 # @class_info: the class of the device
2164 # @id: the PCI device id
2166 # @irq: if an IRQ is assigned to the device, the IRQ number
2168 # @qdev_id: the device name of the PCI device
2170 # @pci_bridge: if the device is a PCI bridge, the bridge information
2172 # @regions: a list of the PCI I/O regions associated with the device
2174 # Notes: the contents of @class_info.desc are not stable and should only be
2175 #        treated as informational.
2177 # Since: 0.14.0
2179 { 'struct': 'PciDeviceInfo',
2180   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
2181            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
2182            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2183            'regions': ['PciMemoryRegion']} }
2186 # @PciInfo:
2188 # Information about a PCI bus
2190 # @bus: the bus index
2192 # @devices: a list of devices on this bus
2194 # Since: 0.14.0
2196 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
2199 # @query-pci:
2201 # Return information about the PCI bus topology of the guest.
2203 # Returns: a list of @PciInfo for each PCI bus. Each bus is
2204 # represented by a json-object, which has a key with a json-array of
2205 # all PCI devices attached to it. Each device is represented by a
2206 # json-object.
2208 # Since: 0.14.0
2210 # Example:
2212 # -> { "execute": "query-pci" }
2213 # <- { "return": [
2214 #          {
2215 #             "bus": 0,
2216 #             "devices": [
2217 #                {
2218 #                   "bus": 0,
2219 #                   "qdev_id": "",
2220 #                   "slot": 0,
2221 #                   "class_info": {
2222 #                      "class": 1536,
2223 #                      "desc": "Host bridge"
2224 #                   },
2225 #                   "id": {
2226 #                      "device": 32902,
2227 #                      "vendor": 4663
2228 #                   },
2229 #                   "function": 0,
2230 #                   "regions": [
2231 #                   ]
2232 #                },
2233 #                {
2234 #                   "bus": 0,
2235 #                   "qdev_id": "",
2236 #                   "slot": 1,
2237 #                   "class_info": {
2238 #                      "class": 1537,
2239 #                      "desc": "ISA bridge"
2240 #                   },
2241 #                   "id": {
2242 #                      "device": 32902,
2243 #                      "vendor": 28672
2244 #                   },
2245 #                   "function": 0,
2246 #                   "regions": [
2247 #                   ]
2248 #                },
2249 #                {
2250 #                   "bus": 0,
2251 #                   "qdev_id": "",
2252 #                   "slot": 1,
2253 #                   "class_info": {
2254 #                      "class": 257,
2255 #                      "desc": "IDE controller"
2256 #                   },
2257 #                   "id": {
2258 #                      "device": 32902,
2259 #                      "vendor": 28688
2260 #                   },
2261 #                   "function": 1,
2262 #                   "regions": [
2263 #                      {
2264 #                         "bar": 4,
2265 #                         "size": 16,
2266 #                         "address": 49152,
2267 #                         "type": "io"
2268 #                      }
2269 #                   ]
2270 #                },
2271 #                {
2272 #                   "bus": 0,
2273 #                   "qdev_id": "",
2274 #                   "slot": 2,
2275 #                   "class_info": {
2276 #                      "class": 768,
2277 #                      "desc": "VGA controller"
2278 #                   },
2279 #                   "id": {
2280 #                      "device": 4115,
2281 #                      "vendor": 184
2282 #                   },
2283 #                   "function": 0,
2284 #                   "regions": [
2285 #                      {
2286 #                         "prefetch": true,
2287 #                         "mem_type_64": false,
2288 #                         "bar": 0,
2289 #                         "size": 33554432,
2290 #                         "address": 4026531840,
2291 #                         "type": "memory"
2292 #                      },
2293 #                      {
2294 #                         "prefetch": false,
2295 #                         "mem_type_64": false,
2296 #                         "bar": 1,
2297 #                         "size": 4096,
2298 #                         "address": 4060086272,
2299 #                         "type": "memory"
2300 #                      },
2301 #                      {
2302 #                         "prefetch": false,
2303 #                         "mem_type_64": false,
2304 #                         "bar": 6,
2305 #                         "size": 65536,
2306 #                         "address": -1,
2307 #                         "type": "memory"
2308 #                      }
2309 #                   ]
2310 #                },
2311 #                {
2312 #                   "bus": 0,
2313 #                   "qdev_id": "",
2314 #                   "irq": 11,
2315 #                   "slot": 4,
2316 #                   "class_info": {
2317 #                      "class": 1280,
2318 #                      "desc": "RAM controller"
2319 #                   },
2320 #                   "id": {
2321 #                      "device": 6900,
2322 #                      "vendor": 4098
2323 #                   },
2324 #                   "function": 0,
2325 #                   "regions": [
2326 #                      {
2327 #                         "bar": 0,
2328 #                         "size": 32,
2329 #                         "address": 49280,
2330 #                         "type": "io"
2331 #                      }
2332 #                   ]
2333 #                }
2334 #             ]
2335 #          }
2336 #       ]
2337 #    }
2339 # Note: This example has been shortened as the real response is too long.
2342 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2345 # @quit:
2347 # This command will cause the QEMU process to exit gracefully.  While every
2348 # attempt is made to send the QMP response before terminating, this is not
2349 # guaranteed.  When using this interface, a premature EOF would not be
2350 # unexpected.
2352 # Since: 0.14.0
2354 # Example:
2356 # -> { "execute": "quit" }
2357 # <- { "return": {} }
2359 { 'command': 'quit' }
2362 # @stop:
2364 # Stop all guest VCPU execution.
2366 # Since:  0.14.0
2368 # Notes:  This function will succeed even if the guest is already in the stopped
2369 #         state.  In "inmigrate" state, it will ensure that the guest
2370 #         remains paused once migration finishes, as if the -S option was
2371 #         passed on the command line.
2373 # Example:
2375 # -> { "execute": "stop" }
2376 # <- { "return": {} }
2379 { 'command': 'stop' }
2382 # @system_reset:
2384 # Performs a hard reset of a guest.
2386 # Since: 0.14.0
2388 # Example:
2390 # -> { "execute": "system_reset" }
2391 # <- { "return": {} }
2394 { 'command': 'system_reset' }
2397 # @system_powerdown:
2399 # Requests that a guest perform a powerdown operation.
2401 # Since: 0.14.0
2403 # Notes: A guest may or may not respond to this command.  This command
2404 #        returning does not indicate that a guest has accepted the request or
2405 #        that it has shut down.  Many guests will respond to this command by
2406 #        prompting the user in some way.
2407 # Example:
2409 # -> { "execute": "system_powerdown" }
2410 # <- { "return": {} }
2413 { 'command': 'system_powerdown' }
2416 # @cpu:
2418 # This command is a nop that is only provided for the purposes of compatibility.
2420 # Since: 0.14.0
2422 # Notes: Do not use this command.
2424 { 'command': 'cpu', 'data': {'index': 'int'} }
2427 # @cpu-add:
2429 # Adds CPU with specified ID
2431 # @id: ID of CPU to be created, valid values [0..max_cpus)
2433 # Returns: Nothing on success
2435 # Since: 1.5
2437 # Example:
2439 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2440 # <- { "return": {} }
2443 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2446 # @memsave:
2448 # Save a portion of guest memory to a file.
2450 # @val: the virtual address of the guest to start from
2452 # @size: the size of memory region to save
2454 # @filename: the file to save the memory to as binary data
2456 # @cpu-index: the index of the virtual CPU to use for translating the
2457 #                       virtual address (defaults to CPU 0)
2459 # Returns: Nothing on success
2461 # Since: 0.14.0
2463 # Notes: Errors were not reliably returned until 1.1
2465 # Example:
2467 # -> { "execute": "memsave",
2468 #      "arguments": { "val": 10,
2469 #                     "size": 100,
2470 #                     "filename": "/tmp/virtual-mem-dump" } }
2471 # <- { "return": {} }
2474 { 'command': 'memsave',
2475   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2478 # @pmemsave:
2480 # Save a portion of guest physical memory to a file.
2482 # @val: the physical address of the guest to start from
2484 # @size: the size of memory region to save
2486 # @filename: the file to save the memory to as binary data
2488 # Returns: Nothing on success
2490 # Since: 0.14.0
2492 # Notes: Errors were not reliably returned until 1.1
2494 # Example:
2496 # -> { "execute": "pmemsave",
2497 #      "arguments": { "val": 10,
2498 #                     "size": 100,
2499 #                     "filename": "/tmp/physical-mem-dump" } }
2500 # <- { "return": {} }
2503 { 'command': 'pmemsave',
2504   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2507 # @cont:
2509 # Resume guest VCPU execution.
2511 # Since:  0.14.0
2513 # Returns:  If successful, nothing
2515 # Notes:  This command will succeed if the guest is currently running.  It
2516 #         will also succeed if the guest is in the "inmigrate" state; in
2517 #         this case, the effect of the command is to make sure the guest
2518 #         starts once migration finishes, removing the effect of the -S
2519 #         command line option if it was passed.
2521 # Example:
2523 # -> { "execute": "cont" }
2524 # <- { "return": {} }
2527 { 'command': 'cont' }
2530 # @system_wakeup:
2532 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2534 # Since:  1.1
2536 # Returns:  nothing.
2538 # Example:
2540 # -> { "execute": "system_wakeup" }
2541 # <- { "return": {} }
2544 { 'command': 'system_wakeup' }
2547 # @inject-nmi:
2549 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2550 # The command fails when the guest doesn't support injecting.
2552 # Returns:  If successful, nothing
2554 # Since:  0.14.0
2556 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2558 # Example:
2560 # -> { "execute": "inject-nmi" }
2561 # <- { "return": {} }
2564 { 'command': 'inject-nmi' }
2567 # @set_link:
2569 # Sets the link status of a virtual network adapter.
2571 # @name: the device name of the virtual network adapter
2573 # @up: true to set the link status to be up
2575 # Returns: Nothing on success
2576 #          If @name is not a valid network device, DeviceNotFound
2578 # Since: 0.14.0
2580 # Notes: Not all network adapters support setting link status.  This command
2581 #        will succeed even if the network adapter does not support link status
2582 #        notification.
2584 # Example:
2586 # -> { "execute": "set_link",
2587 #      "arguments": { "name": "e1000.0", "up": false } }
2588 # <- { "return": {} }
2591 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2594 # @balloon:
2596 # Request the balloon driver to change its balloon size.
2598 # @value: the target size of the balloon in bytes
2600 # Returns: Nothing on success
2601 #          If the balloon driver is enabled but not functional because the KVM
2602 #            kernel module cannot support it, KvmMissingCap
2603 #          If no balloon device is present, DeviceNotActive
2605 # Notes: This command just issues a request to the guest.  When it returns,
2606 #        the balloon size may not have changed.  A guest can change the balloon
2607 #        size independent of this command.
2609 # Since: 0.14.0
2611 # Example:
2613 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2614 # <- { "return": {} }
2617 { 'command': 'balloon', 'data': {'value': 'int'} }
2620 # @Abort:
2622 # This action can be used to test transaction failure.
2624 # Since: 1.6
2626 { 'struct': 'Abort',
2627   'data': { } }
2630 # @ActionCompletionMode:
2632 # An enumeration of Transactional completion modes.
2634 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2635 #              after the Transaction request succeeds. All Actions that
2636 #              can complete successfully will do so without waiting on others.
2637 #              This is the default.
2639 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2640 #           Actions. Actions do not complete until all Actions are ready to
2641 #           complete. May be rejected by Actions that do not support this
2642 #           completion mode.
2644 # Since: 2.5
2646 { 'enum': 'ActionCompletionMode',
2647   'data': [ 'individual', 'grouped' ] }
2650 # @TransactionAction:
2652 # A discriminated record of operations that can be performed with
2653 # @transaction. Action @type can be:
2655 # - @abort: since 1.6
2656 # - @block-dirty-bitmap-add: since 2.5
2657 # - @block-dirty-bitmap-clear: since 2.5
2658 # - @blockdev-backup: since 2.3
2659 # - @blockdev-snapshot: since 2.5
2660 # - @blockdev-snapshot-internal-sync: since 1.7
2661 # - @blockdev-snapshot-sync: since 1.1
2662 # - @drive-backup: since 1.6
2664 # Since: 1.1
2666 { 'union': 'TransactionAction',
2667   'data': {
2668        'abort': 'Abort',
2669        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2670        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2671        'blockdev-backup': 'BlockdevBackup',
2672        'blockdev-snapshot': 'BlockdevSnapshot',
2673        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2674        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2675        'drive-backup': 'DriveBackup'
2676    } }
2679 # @TransactionProperties:
2681 # Optional arguments to modify the behavior of a Transaction.
2683 # @completion-mode: Controls how jobs launched asynchronously by
2684 #                   Actions will complete or fail as a group.
2685 #                   See @ActionCompletionMode for details.
2687 # Since: 2.5
2689 { 'struct': 'TransactionProperties',
2690   'data': {
2691        '*completion-mode': 'ActionCompletionMode'
2692   }
2696 # @transaction:
2698 # Executes a number of transactionable QMP commands atomically. If any
2699 # operation fails, then the entire set of actions will be abandoned and the
2700 # appropriate error returned.
2702 # For external snapshots, the dictionary contains the device, the file to use for
2703 # the new snapshot, and the format.  The default format, if not specified, is
2704 # qcow2.
2706 # Each new snapshot defaults to being created by QEMU (wiping any
2707 # contents if the file already exists), but it is also possible to reuse
2708 # an externally-created file.  In the latter case, you should ensure that
2709 # the new image file has the same contents as the current one; QEMU cannot
2710 # perform any meaningful check.  Typically this is achieved by using the
2711 # current image file as the backing file for the new image.
2713 # On failure, the original disks pre-snapshot attempt will be used.
2715 # For internal snapshots, the dictionary contains the device and the snapshot's
2716 # name.  If an internal snapshot matching name already exists, the request will
2717 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2718 # and sheepdog.
2720 # On failure, qemu will try delete the newly created internal snapshot in the
2721 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2722 # it later with qemu-img or other command.
2724 # @actions: List of @TransactionAction;
2725 #           information needed for the respective operations.
2727 # @properties: structure of additional options to control the
2728 #              execution of the transaction. See @TransactionProperties
2729 #              for additional detail.
2731 # Returns: nothing on success
2733 #          Errors depend on the operations of the transaction
2735 # Note: The transaction aborts on the first failure.  Therefore, there will be
2736 # information on only one failed operation returned in an error condition, and
2737 # subsequent actions will not have been attempted.
2739 # Since: 1.1
2741 # Example:
2743 # -> { "execute": "transaction",
2744 #      "arguments": { "actions": [
2745 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2746 #                                      "snapshot-file": "/some/place/my-image",
2747 #                                      "format": "qcow2" } },
2748 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2749 #                                      "snapshot-file": "/some/place/my-image2",
2750 #                                      "snapshot-node-name": "node3432",
2751 #                                      "mode": "existing",
2752 #                                      "format": "qcow2" } },
2753 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2754 #                                      "snapshot-file": "/some/place/my-image2",
2755 #                                      "mode": "existing",
2756 #                                      "format": "qcow2" } },
2757 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2758 #                                      "device": "ide-hd2",
2759 #                                      "name": "snapshot0" } } ] } }
2760 # <- { "return": {} }
2763 { 'command': 'transaction',
2764   'data': { 'actions': [ 'TransactionAction' ],
2765             '*properties': 'TransactionProperties'
2766           }
2770 # @human-monitor-command:
2772 # Execute a command on the human monitor and return the output.
2774 # @command-line: the command to execute in the human monitor
2776 # @cpu-index: The CPU to use for commands that require an implicit CPU
2778 # Returns: the output of the command as a string
2780 # Since: 0.14.0
2782 # Notes: This command only exists as a stop-gap.  Its use is highly
2783 #        discouraged.  The semantics of this command are not
2784 #        guaranteed: this means that command names, arguments and
2785 #        responses can change or be removed at ANY time.  Applications
2786 #        that rely on long term stability guarantees should NOT
2787 #        use this command.
2789 #        Known limitations:
2791 #        * This command is stateless, this means that commands that depend
2792 #          on state information (such as getfd) might not work
2794 #        * Commands that prompt the user for data don't currently work
2796 # Example:
2798 # -> { "execute": "human-monitor-command",
2799 #      "arguments": { "command-line": "info kvm" } }
2800 # <- { "return": "kvm support: enabled\r\n" }
2803 { 'command': 'human-monitor-command',
2804   'data': {'command-line': 'str', '*cpu-index': 'int'},
2805   'returns': 'str' }
2808 # @migrate_cancel:
2810 # Cancel the current executing migration process.
2812 # Returns: nothing on success
2814 # Notes: This command succeeds even if there is no migration process running.
2816 # Since: 0.14.0
2818 # Example:
2820 # -> { "execute": "migrate_cancel" }
2821 # <- { "return": {} }
2824 { 'command': 'migrate_cancel' }
2827 # @migrate_set_downtime:
2829 # Set maximum tolerated downtime for migration.
2831 # @value: maximum downtime in seconds
2833 # Returns: nothing on success
2835 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2837 # Since: 0.14.0
2839 # Example:
2841 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2842 # <- { "return": {} }
2845 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2848 # @migrate_set_speed:
2850 # Set maximum speed for migration.
2852 # @value: maximum speed in bytes per second.
2854 # Returns: nothing on success
2856 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2858 # Since: 0.14.0
2860 # Example:
2862 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2863 # <- { "return": {} }
2866 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2869 # @migrate-set-cache-size:
2871 # Set cache size to be used by XBZRLE migration
2873 # @value: cache size in bytes
2875 # The size will be rounded down to the nearest power of 2.
2876 # The cache size can be modified before and during ongoing migration
2878 # Returns: nothing on success
2880 # Since: 1.2
2882 # Example:
2884 # -> { "execute": "migrate-set-cache-size",
2885 #      "arguments": { "value": 536870912 } }
2886 # <- { "return": {} }
2889 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2892 # @query-migrate-cache-size:
2894 # Query migration XBZRLE cache size
2896 # Returns: XBZRLE cache size in bytes
2898 # Since: 1.2
2900 # Example:
2902 # -> { "execute": "query-migrate-cache-size" }
2903 # <- { "return": 67108864 }
2906 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2909 # @ObjectPropertyInfo:
2911 # @name: the name of the property
2913 # @type: the type of the property.  This will typically come in one of four
2914 #        forms:
2916 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2917 #           These types are mapped to the appropriate JSON type.
2919 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2920 #           device type name.  Child properties create the composition tree.
2922 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2923 #           device type name.  Link properties form the device model graph.
2925 # Since: 1.2
2927 { 'struct': 'ObjectPropertyInfo',
2928   'data': { 'name': 'str', 'type': 'str' } }
2931 # @qom-list:
2933 # This command will list any properties of a object given a path in the object
2934 # model.
2936 # @path: the path within the object model.  See @qom-get for a description of
2937 #        this parameter.
2939 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2940 #          object.
2942 # Since: 1.2
2944 { 'command': 'qom-list',
2945   'data': { 'path': 'str' },
2946   'returns': [ 'ObjectPropertyInfo' ] }
2949 # @qom-get:
2951 # This command will get a property from a object model path and return the
2952 # value.
2954 # @path: The path within the object model.  There are two forms of supported
2955 #        paths--absolute and partial paths.
2957 #        Absolute paths are derived from the root object and can follow child<>
2958 #        or link<> properties.  Since they can follow link<> properties, they
2959 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2960 #        and are prefixed  with a leading slash.
2962 #        Partial paths look like relative filenames.  They do not begin
2963 #        with a prefix.  The matching rules for partial paths are subtle but
2964 #        designed to make specifying objects easy.  At each level of the
2965 #        composition tree, the partial path is matched as an absolute path.
2966 #        The first match is not returned.  At least two matches are searched
2967 #        for.  A successful result is only returned if only one match is
2968 #        found.  If more than one match is found, a flag is return to
2969 #        indicate that the match was ambiguous.
2971 # @property: The property name to read
2973 # Returns: The property value.  The type depends on the property
2974 #          type. child<> and link<> properties are returned as #str
2975 #          pathnames.  All integer property types (u8, u16, etc) are
2976 #          returned as #int.
2978 # Since: 1.2
2980 { 'command': 'qom-get',
2981   'data': { 'path': 'str', 'property': 'str' },
2982   'returns': 'any' }
2985 # @qom-set:
2987 # This command will set a property from a object model path.
2989 # @path: see @qom-get for a description of this parameter
2991 # @property: the property name to set
2993 # @value: a value who's type is appropriate for the property type.  See @qom-get
2994 #         for a description of type mapping.
2996 # Since: 1.2
2998 { 'command': 'qom-set',
2999   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
3002 # @set_password:
3004 # Sets the password of a remote display session.
3006 # @protocol: `vnc' to modify the VNC server password
3007 #            `spice' to modify the Spice server password
3009 # @password: the new password
3011 # @connected: how to handle existing clients when changing the
3012 #                       password.  If nothing is specified, defaults to `keep'
3013 #                       `fail' to fail the command if clients are connected
3014 #                       `disconnect' to disconnect existing clients
3015 #                       `keep' to maintain existing clients
3017 # Returns: Nothing on success
3018 #          If Spice is not enabled, DeviceNotFound
3020 # Since: 0.14.0
3022 # Example:
3024 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
3025 #                                                "password": "secret" } }
3026 # <- { "return": {} }
3029 { 'command': 'set_password',
3030   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
3033 # @expire_password:
3035 # Expire the password of a remote display server.
3037 # @protocol: the name of the remote display protocol `vnc' or `spice'
3039 # @time: when to expire the password.
3040 #        `now' to expire the password immediately
3041 #        `never' to cancel password expiration
3042 #        `+INT' where INT is the number of seconds from now (integer)
3043 #        `INT' where INT is the absolute time in seconds
3045 # Returns: Nothing on success
3046 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
3048 # Since: 0.14.0
3050 # Notes: Time is relative to the server and currently there is no way to
3051 #        coordinate server time with client time.  It is not recommended to
3052 #        use the absolute time version of the @time parameter unless you're
3053 #        sure you are on the same machine as the QEMU instance.
3055 # Example:
3057 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
3058 #                                                   "time": "+60" } }
3059 # <- { "return": {} }
3062 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
3065 # @change-vnc-password:
3067 # Change the VNC server password.
3069 # @password:  the new password to use with VNC authentication
3071 # Since: 1.1
3073 # Notes:  An empty password in this command will set the password to the empty
3074 #         string.  Existing clients are unaffected by executing this command.
3076 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
3079 # @change:
3081 # This command is multiple commands multiplexed together.
3083 # @device: This is normally the name of a block device but it may also be 'vnc'.
3084 #          when it's 'vnc', then sub command depends on @target
3086 # @target: If @device is a block device, then this is the new filename.
3087 #          If @device is 'vnc', then if the value 'password' selects the vnc
3088 #          change password command.   Otherwise, this specifies a new server URI
3089 #          address to listen to for VNC connections.
3091 # @arg:    If @device is a block device, then this is an optional format to open
3092 #          the device with.
3093 #          If @device is 'vnc' and @target is 'password', this is the new VNC
3094 #          password to set.  See change-vnc-password for additional notes.
3096 # Returns: Nothing on success.
3097 #          If @device is not a valid block device, DeviceNotFound
3099 # Notes:  This interface is deprecated, and it is strongly recommended that you
3100 #         avoid using it.  For changing block devices, use
3101 #         blockdev-change-medium; for changing VNC parameters, use
3102 #         change-vnc-password.
3104 # Since: 0.14.0
3106 # Example:
3108 # 1. Change a removable medium
3110 # -> { "execute": "change",
3111 #      "arguments": { "device": "ide1-cd0",
3112 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
3113 # <- { "return": {} }
3115 # 2. Change VNC password
3117 # -> { "execute": "change",
3118 #      "arguments": { "device": "vnc", "target": "password",
3119 #                     "arg": "foobar1" } }
3120 # <- { "return": {} }
3123 { 'command': 'change',
3124   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
3127 # @ObjectTypeInfo:
3129 # This structure describes a search result from @qom-list-types
3131 # @name: the type name found in the search
3133 # @abstract: the type is abstract and can't be directly instantiated.
3134 #            Omitted if false. (since 2.10)
3136 # @parent: Name of parent type, if any (since 2.10)
3138 # Since: 1.1
3140 { 'struct': 'ObjectTypeInfo',
3141   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
3144 # @qom-list-types:
3146 # This command will return a list of types given search parameters
3148 # @implements: if specified, only return types that implement this type name
3150 # @abstract: if true, include abstract types in the results
3152 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3154 # Since: 1.1
3156 { 'command': 'qom-list-types',
3157   'data': { '*implements': 'str', '*abstract': 'bool' },
3158   'returns': [ 'ObjectTypeInfo' ] }
3161 # @DevicePropertyInfo:
3163 # Information about device properties.
3165 # @name: the name of the property
3166 # @type: the typename of the property
3167 # @description: if specified, the description of the property.
3168 #               (since 2.2)
3170 # Since: 1.2
3172 { 'struct': 'DevicePropertyInfo',
3173   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
3176 # @device-list-properties:
3178 # List properties associated with a device.
3180 # @typename: the type name of a device
3182 # Returns: a list of DevicePropertyInfo describing a devices properties
3184 # Since: 1.2
3186 { 'command': 'device-list-properties',
3187   'data': { 'typename': 'str'},
3188   'returns': [ 'DevicePropertyInfo' ] }
3191 # @migrate:
3193 # Migrates the current running guest to another Virtual Machine.
3195 # @uri: the Uniform Resource Identifier of the destination VM
3197 # @blk: do block migration (full disk copy)
3199 # @inc: incremental disk copy migration
3201 # @detach: this argument exists only for compatibility reasons and
3202 #          is ignored by QEMU
3204 # Returns: nothing on success
3206 # Since: 0.14.0
3208 # Notes:
3210 # 1. The 'query-migrate' command should be used to check migration's progress
3211 #    and final result (this information is provided by the 'status' member)
3213 # 2. All boolean arguments default to false
3215 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
3216 #    be used
3218 # Example:
3220 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3221 # <- { "return": {} }
3224 { 'command': 'migrate',
3225   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
3228 # @migrate-incoming:
3230 # Start an incoming migration, the qemu must have been started
3231 # with -incoming defer
3233 # @uri: The Uniform Resource Identifier identifying the source or
3234 #       address to listen on
3236 # Returns: nothing on success
3238 # Since: 2.3
3240 # Notes:
3242 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3243 #    compatible with -incoming and the format of the uri is already exposed
3244 #    above libvirt.
3246 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3247 #    be used.
3249 # 3. The uri format is the same as for -incoming
3251 # Example:
3253 # -> { "execute": "migrate-incoming",
3254 #      "arguments": { "uri": "tcp::4446" } }
3255 # <- { "return": {} }
3258 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3261 # @xen-save-devices-state:
3263 # Save the state of all devices to file. The RAM and the block devices
3264 # of the VM are not saved by this command.
3266 # @filename: the file to save the state of the devices to as binary
3267 # data. See xen-save-devices-state.txt for a description of the binary
3268 # format.
3270 # Returns: Nothing on success
3272 # Since: 1.1
3274 # Example:
3276 # -> { "execute": "xen-save-devices-state",
3277 #      "arguments": { "filename": "/tmp/save" } }
3278 # <- { "return": {} }
3281 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3284 # @xen-set-global-dirty-log:
3286 # Enable or disable the global dirty log mode.
3288 # @enable: true to enable, false to disable.
3290 # Returns: nothing
3292 # Since: 1.3
3294 # Example:
3296 # -> { "execute": "xen-set-global-dirty-log",
3297 #      "arguments": { "enable": true } }
3298 # <- { "return": {} }
3301 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3304 # @device_add:
3306 # @driver: the name of the new device's driver
3308 # @bus: the device's parent bus (device tree path)
3310 # @id: the device's ID, must be unique
3312 # Additional arguments depend on the type.
3314 # Add a device.
3316 # Notes:
3317 # 1. For detailed information about this command, please refer to the
3318 #    'docs/qdev-device-use.txt' file.
3320 # 2. It's possible to list device properties by running QEMU with the
3321 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3322 #    device's name
3324 # Example:
3326 # -> { "execute": "device_add",
3327 #      "arguments": { "driver": "e1000", "id": "net1",
3328 #                     "bus": "pci.0",
3329 #                     "mac": "52:54:00:12:34:56" } }
3330 # <- { "return": {} }
3332 # TODO: This command effectively bypasses QAPI completely due to its
3333 # "additional arguments" business.  It shouldn't have been added to
3334 # the schema in this form.  It should be qapified properly, or
3335 # replaced by a properly qapified command.
3337 # Since: 0.13
3339 { 'command': 'device_add',
3340   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3341   'gen': false } # so we can get the additional arguments
3344 # @device_del:
3346 # Remove a device from a guest
3348 # @id: the device's ID or QOM path
3350 # Returns: Nothing on success
3351 #          If @id is not a valid device, DeviceNotFound
3353 # Notes: When this command completes, the device may not be removed from the
3354 #        guest.  Hot removal is an operation that requires guest cooperation.
3355 #        This command merely requests that the guest begin the hot removal
3356 #        process.  Completion of the device removal process is signaled with a
3357 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3358 #        for all devices.
3360 # Since: 0.14.0
3362 # Example:
3364 # -> { "execute": "device_del",
3365 #      "arguments": { "id": "net1" } }
3366 # <- { "return": {} }
3368 # -> { "execute": "device_del",
3369 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3370 # <- { "return": {} }
3373 { 'command': 'device_del', 'data': {'id': 'str'} }
3376 # @DumpGuestMemoryFormat:
3378 # An enumeration of guest-memory-dump's format.
3380 # @elf: elf format
3382 # @kdump-zlib: kdump-compressed format with zlib-compressed
3384 # @kdump-lzo: kdump-compressed format with lzo-compressed
3386 # @kdump-snappy: kdump-compressed format with snappy-compressed
3388 # Since: 2.0
3390 { 'enum': 'DumpGuestMemoryFormat',
3391   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3394 # @dump-guest-memory:
3396 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3397 # very long depending on the amount of guest memory.
3399 # @paging: if true, do paging to get guest's memory mapping. This allows
3400 #          using gdb to process the core file.
3402 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3403 #                     of RAM. This can happen for a large guest, or a
3404 #                     malicious guest pretending to be large.
3406 #          Also, paging=true has the following limitations:
3408 #             1. The guest may be in a catastrophic state or can have corrupted
3409 #                memory, which cannot be trusted
3410 #             2. The guest can be in real-mode even if paging is enabled. For
3411 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3412 #                goes in real-mode
3413 #             3. Currently only supported on i386 and x86_64.
3415 # @protocol: the filename or file descriptor of the vmcore. The supported
3416 #            protocols are:
3418 #            1. file: the protocol starts with "file:", and the following
3419 #               string is the file's path.
3420 #            2. fd: the protocol starts with "fd:", and the following string
3421 #               is the fd's name.
3423 # @detach: if true, QMP will return immediately rather than
3424 #          waiting for the dump to finish. The user can track progress
3425 #          using "query-dump". (since 2.6).
3427 # @begin: if specified, the starting physical address.
3429 # @length: if specified, the memory size, in bytes. If you don't
3430 #          want to dump all guest's memory, please specify the start @begin
3431 #          and @length
3433 # @format: if specified, the format of guest memory dump. But non-elf
3434 #          format is conflict with paging and filter, ie. @paging, @begin and
3435 #          @length is not allowed to be specified with non-elf @format at the
3436 #          same time (since 2.0)
3438 # Note: All boolean arguments default to false
3440 # Returns: nothing on success
3442 # Since: 1.2
3444 # Example:
3446 # -> { "execute": "dump-guest-memory",
3447 #      "arguments": { "protocol": "fd:dump" } }
3448 # <- { "return": {} }
3451 { 'command': 'dump-guest-memory',
3452   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3453             '*begin': 'int', '*length': 'int',
3454             '*format': 'DumpGuestMemoryFormat'} }
3457 # @DumpStatus:
3459 # Describe the status of a long-running background guest memory dump.
3461 # @none: no dump-guest-memory has started yet.
3463 # @active: there is one dump running in background.
3465 # @completed: the last dump has finished successfully.
3467 # @failed: the last dump has failed.
3469 # Since: 2.6
3471 { 'enum': 'DumpStatus',
3472   'data': [ 'none', 'active', 'completed', 'failed' ] }
3475 # @DumpQueryResult:
3477 # The result format for 'query-dump'.
3479 # @status: enum of @DumpStatus, which shows current dump status
3481 # @completed: bytes written in latest dump (uncompressed)
3483 # @total: total bytes to be written in latest dump (uncompressed)
3485 # Since: 2.6
3487 { 'struct': 'DumpQueryResult',
3488   'data': { 'status': 'DumpStatus',
3489             'completed': 'int',
3490             'total': 'int' } }
3493 # @query-dump:
3495 # Query latest dump status.
3497 # Returns: A @DumpStatus object showing the dump status.
3499 # Since: 2.6
3501 # Example:
3503 # -> { "execute": "query-dump" }
3504 # <- { "return": { "status": "active", "completed": 1024000,
3505 #                  "total": 2048000 } }
3508 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3511 # @DumpGuestMemoryCapability:
3513 # A list of the available formats for dump-guest-memory
3515 # Since: 2.0
3517 { 'struct': 'DumpGuestMemoryCapability',
3518   'data': {
3519       'formats': ['DumpGuestMemoryFormat'] } }
3522 # @query-dump-guest-memory-capability:
3524 # Returns the available formats for dump-guest-memory
3526 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3527 #           dump-guest-memory
3529 # Since: 2.0
3531 # Example:
3533 # -> { "execute": "query-dump-guest-memory-capability" }
3534 # <- { "return": { "formats":
3535 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3538 { 'command': 'query-dump-guest-memory-capability',
3539   'returns': 'DumpGuestMemoryCapability' }
3542 # @dump-skeys:
3544 # Dump guest's storage keys
3546 # @filename: the path to the file to dump to
3548 # This command is only supported on s390 architecture.
3550 # Since: 2.5
3552 # Example:
3554 # -> { "execute": "dump-skeys",
3555 #      "arguments": { "filename": "/tmp/skeys" } }
3556 # <- { "return": {} }
3559 { 'command': 'dump-skeys',
3560   'data': { 'filename': 'str' } }
3563 # @netdev_add:
3565 # Add a network backend.
3567 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3568 #        'vde', 'socket', 'dump' and 'bridge'
3570 # @id: the name of the new network backend
3572 # Additional arguments depend on the type.
3574 # TODO: This command effectively bypasses QAPI completely due to its
3575 # "additional arguments" business.  It shouldn't have been added to
3576 # the schema in this form.  It should be qapified properly, or
3577 # replaced by a properly qapified command.
3579 # Since: 0.14.0
3581 # Returns: Nothing on success
3582 #          If @type is not a valid network backend, DeviceNotFound
3584 # Example:
3586 # -> { "execute": "netdev_add",
3587 #      "arguments": { "type": "user", "id": "netdev1",
3588 #                     "dnssearch": "example.org" } }
3589 # <- { "return": {} }
3592 { 'command': 'netdev_add',
3593   'data': {'type': 'str', 'id': 'str'},
3594   'gen': false }                # so we can get the additional arguments
3597 # @netdev_del:
3599 # Remove a network backend.
3601 # @id: the name of the network backend to remove
3603 # Returns: Nothing on success
3604 #          If @id is not a valid network backend, DeviceNotFound
3606 # Since: 0.14.0
3608 # Example:
3610 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3611 # <- { "return": {} }
3614 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3617 # @object-add:
3619 # Create a QOM object.
3621 # @qom-type: the class name for the object to be created
3623 # @id: the name of the new object
3625 # @props: a dictionary of properties to be passed to the backend
3627 # Returns: Nothing on success
3628 #          Error if @qom-type is not a valid class name
3630 # Since: 2.0
3632 # Example:
3634 # -> { "execute": "object-add",
3635 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3636 #                     "props": { "filename": "/dev/hwrng" } } }
3637 # <- { "return": {} }
3640 { 'command': 'object-add',
3641   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3644 # @object-del:
3646 # Remove a QOM object.
3648 # @id: the name of the QOM object to remove
3650 # Returns: Nothing on success
3651 #          Error if @id is not a valid id for a QOM object
3653 # Since: 2.0
3655 # Example:
3657 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3658 # <- { "return": {} }
3661 { 'command': 'object-del', 'data': {'id': 'str'} }
3664 # @NetdevNoneOptions:
3666 # Use it alone to have zero network devices.
3668 # Since: 1.2
3670 { 'struct': 'NetdevNoneOptions',
3671   'data': { } }
3674 # @NetLegacyNicOptions:
3676 # Create a new Network Interface Card.
3678 # @netdev: id of -netdev to connect to
3680 # @macaddr: MAC address
3682 # @model: device model (e1000, rtl8139, virtio etc.)
3684 # @addr: PCI device address
3686 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
3688 # Since: 1.2
3690 { 'struct': 'NetLegacyNicOptions',
3691   'data': {
3692     '*netdev':  'str',
3693     '*macaddr': 'str',
3694     '*model':   'str',
3695     '*addr':    'str',
3696     '*vectors': 'uint32' } }
3699 # @String:
3701 # A fat type wrapping 'str', to be embedded in lists.
3703 # Since: 1.2
3705 { 'struct': 'String',
3706   'data': {
3707     'str': 'str' } }
3710 # @NetdevUserOptions:
3712 # Use the user mode network stack which requires no administrator privilege to
3713 # run.
3715 # @hostname: client hostname reported by the builtin DHCP server
3717 # @restrict: isolate the guest from the host
3719 # @ipv4: whether to support IPv4, default true for enabled
3720 #        (since 2.6)
3722 # @ipv6: whether to support IPv6, default true for enabled
3723 #        (since 2.6)
3725 # @ip: legacy parameter, use net= instead
3727 # @net: IP network address that the guest will see, in the
3728 #       form addr[/netmask] The netmask is optional, and can be
3729 #       either in the form a.b.c.d or as a number of valid top-most
3730 #       bits. Default is 10.0.2.0/24.
3732 # @host: guest-visible address of the host
3734 # @tftp: root directory of the built-in TFTP server
3736 # @bootfile: BOOTP filename, for use with tftp=
3738 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
3739 #             assign
3741 # @dns: guest-visible address of the virtual nameserver
3743 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
3744 #             to the guest
3746 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
3747 #               2.6). The network prefix is given in the usual
3748 #               hexadecimal IPv6 address notation.
3750 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
3751 #                  (since 2.6)
3753 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
3755 # @ipv6-dns: guest-visible IPv6 address of the virtual
3756 #            nameserver (since 2.6)
3758 # @smb: root directory of the built-in SMB server
3760 # @smbserver: IP address of the built-in SMB server
3762 # @hostfwd: redirect incoming TCP or UDP host connections to guest
3763 #           endpoints
3765 # @guestfwd: forward guest TCP connections
3767 # Since: 1.2
3769 { 'struct': 'NetdevUserOptions',
3770   'data': {
3771     '*hostname':  'str',
3772     '*restrict':  'bool',
3773     '*ipv4':      'bool',
3774     '*ipv6':      'bool',
3775     '*ip':        'str',
3776     '*net':       'str',
3777     '*host':      'str',
3778     '*tftp':      'str',
3779     '*bootfile':  'str',
3780     '*dhcpstart': 'str',
3781     '*dns':       'str',
3782     '*dnssearch': ['String'],
3783     '*ipv6-prefix':      'str',
3784     '*ipv6-prefixlen':   'int',
3785     '*ipv6-host':        'str',
3786     '*ipv6-dns':         'str',
3787     '*smb':       'str',
3788     '*smbserver': 'str',
3789     '*hostfwd':   ['String'],
3790     '*guestfwd':  ['String'] } }
3793 # @NetdevTapOptions:
3795 # Connect the host TAP network interface name to the VLAN.
3797 # @ifname: interface name
3799 # @fd: file descriptor of an already opened tap
3801 # @fds: multiple file descriptors of already opened multiqueue capable
3802 # tap
3804 # @script: script to initialize the interface
3806 # @downscript: script to shut down the interface
3808 # @br: bridge name (since 2.8)
3810 # @helper: command to execute to configure bridge
3812 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
3814 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
3816 # @vhost: enable vhost-net network accelerator
3818 # @vhostfd: file descriptor of an already opened vhost net device
3820 # @vhostfds: file descriptors of multiple already opened vhost net
3821 # devices
3823 # @vhostforce: vhost on for non-MSIX virtio guests
3825 # @queues: number of queues to be created for multiqueue capable tap
3827 # @poll-us: maximum number of microseconds that could
3828 # be spent on busy polling for tap (since 2.7)
3830 # Since: 1.2
3832 { 'struct': 'NetdevTapOptions',
3833   'data': {
3834     '*ifname':     'str',
3835     '*fd':         'str',
3836     '*fds':        'str',
3837     '*script':     'str',
3838     '*downscript': 'str',
3839     '*br':         'str',
3840     '*helper':     'str',
3841     '*sndbuf':     'size',
3842     '*vnet_hdr':   'bool',
3843     '*vhost':      'bool',
3844     '*vhostfd':    'str',
3845     '*vhostfds':   'str',
3846     '*vhostforce': 'bool',
3847     '*queues':     'uint32',
3848     '*poll-us':    'uint32'} }
3851 # @NetdevSocketOptions:
3853 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3854 # socket connection.
3856 # @fd: file descriptor of an already opened socket
3858 # @listen: port number, and optional hostname, to listen on
3860 # @connect: port number, and optional hostname, to connect to
3862 # @mcast: UDP multicast address and port number
3864 # @localaddr: source address and port for multicast and udp packets
3866 # @udp: UDP unicast address and port number
3868 # Since: 1.2
3870 { 'struct': 'NetdevSocketOptions',
3871   'data': {
3872     '*fd':        'str',
3873     '*listen':    'str',
3874     '*connect':   'str',
3875     '*mcast':     'str',
3876     '*localaddr': 'str',
3877     '*udp':       'str' } }
3880 # @NetdevL2TPv3Options:
3882 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3884 # @src: source address
3886 # @dst: destination address
3888 # @srcport: source port - mandatory for udp, optional for ip
3890 # @dstport: destination port - mandatory for udp, optional for ip
3892 # @ipv6: force the use of ipv6
3894 # @udp: use the udp version of l2tpv3 encapsulation
3896 # @cookie64: use 64 bit coookies
3898 # @counter: have sequence counter
3900 # @pincounter: pin sequence counter to zero -
3901 #              workaround for buggy implementations or
3902 #              networks with packet reorder
3904 # @txcookie: 32 or 64 bit transmit cookie
3906 # @rxcookie: 32 or 64 bit receive cookie
3908 # @txsession: 32 bit transmit session
3910 # @rxsession: 32 bit receive session - if not specified
3911 #             set to the same value as transmit
3913 # @offset: additional offset - allows the insertion of
3914 #          additional application-specific data before the packet payload
3916 # Since: 2.1
3918 { 'struct': 'NetdevL2TPv3Options',
3919   'data': {
3920     'src':          'str',
3921     'dst':          'str',
3922     '*srcport':     'str',
3923     '*dstport':     'str',
3924     '*ipv6':        'bool',
3925     '*udp':         'bool',
3926     '*cookie64':    'bool',
3927     '*counter':     'bool',
3928     '*pincounter':  'bool',
3929     '*txcookie':    'uint64',
3930     '*rxcookie':    'uint64',
3931     'txsession':    'uint32',
3932     '*rxsession':   'uint32',
3933     '*offset':      'uint32' } }
3936 # @NetdevVdeOptions:
3938 # Connect the VLAN to a vde switch running on the host.
3940 # @sock: socket path
3942 # @port: port number
3944 # @group: group owner of socket
3946 # @mode: permissions for socket
3948 # Since: 1.2
3950 { 'struct': 'NetdevVdeOptions',
3951   'data': {
3952     '*sock':  'str',
3953     '*port':  'uint16',
3954     '*group': 'str',
3955     '*mode':  'uint16' } }
3958 # @NetdevDumpOptions:
3960 # Dump VLAN network traffic to a file.
3962 # @len: per-packet size limit (64k default). Understands [TGMKkb]
3963 # suffixes.
3965 # @file: dump file path (default is qemu-vlan0.pcap)
3967 # Since: 1.2
3969 { 'struct': 'NetdevDumpOptions',
3970   'data': {
3971     '*len':  'size',
3972     '*file': 'str' } }
3975 # @NetdevBridgeOptions:
3977 # Connect a host TAP network interface to a host bridge device.
3979 # @br: bridge name
3981 # @helper: command to execute to configure bridge
3983 # Since: 1.2
3985 { 'struct': 'NetdevBridgeOptions',
3986   'data': {
3987     '*br':     'str',
3988     '*helper': 'str' } }
3991 # @NetdevHubPortOptions:
3993 # Connect two or more net clients through a software hub.
3995 # @hubid: hub identifier number
3997 # Since: 1.2
3999 { 'struct': 'NetdevHubPortOptions',
4000   'data': {
4001     'hubid':     'int32' } }
4004 # @NetdevNetmapOptions:
4006 # Connect a client to a netmap-enabled NIC or to a VALE switch port
4008 # @ifname: Either the name of an existing network interface supported by
4009 #          netmap, or the name of a VALE port (created on the fly).
4010 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
4011 #          YYY are non-negative integers. XXX identifies a switch and
4012 #          YYY identifies a port of the switch. VALE ports having the
4013 #          same XXX are therefore connected to the same switch.
4015 # @devname: path of the netmap device (default: '/dev/netmap').
4017 # Since: 2.0
4019 { 'struct': 'NetdevNetmapOptions',
4020   'data': {
4021     'ifname':     'str',
4022     '*devname':    'str' } }
4025 # @NetdevVhostUserOptions:
4027 # Vhost-user network backend
4029 # @chardev: name of a unix socket chardev
4031 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
4033 # @queues: number of queues to be created for multiqueue vhost-user
4034 #          (default: 1) (Since 2.5)
4036 # Since: 2.1
4038 { 'struct': 'NetdevVhostUserOptions',
4039   'data': {
4040     'chardev':        'str',
4041     '*vhostforce':    'bool',
4042     '*queues':        'int' } }
4045 # @NetClientDriver:
4047 # Available netdev drivers.
4049 # Since: 2.7
4051 { 'enum': 'NetClientDriver',
4052   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
4053             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
4056 # @Netdev:
4058 # Captures the configuration of a network device.
4060 # @id: identifier for monitor commands.
4062 # @type: Specify the driver used for interpreting remaining arguments.
4064 # Since: 1.2
4066 # 'l2tpv3' - since 2.1
4068 { 'union': 'Netdev',
4069   'base': { 'id': 'str', 'type': 'NetClientDriver' },
4070   'discriminator': 'type',
4071   'data': {
4072     'none':     'NetdevNoneOptions',
4073     'nic':      'NetLegacyNicOptions',
4074     'user':     'NetdevUserOptions',
4075     'tap':      'NetdevTapOptions',
4076     'l2tpv3':   'NetdevL2TPv3Options',
4077     'socket':   'NetdevSocketOptions',
4078     'vde':      'NetdevVdeOptions',
4079     'dump':     'NetdevDumpOptions',
4080     'bridge':   'NetdevBridgeOptions',
4081     'hubport':  'NetdevHubPortOptions',
4082     'netmap':   'NetdevNetmapOptions',
4083     'vhost-user': 'NetdevVhostUserOptions' } }
4086 # @NetLegacy:
4088 # Captures the configuration of a network device; legacy.
4090 # @vlan: vlan number
4092 # @id: identifier for monitor commands
4094 # @name: identifier for monitor commands, ignored if @id is present
4096 # @opts: device type specific properties (legacy)
4098 # Since: 1.2
4100 { 'struct': 'NetLegacy',
4101   'data': {
4102     '*vlan': 'int32',
4103     '*id':   'str',
4104     '*name': 'str',
4105     'opts':  'NetLegacyOptions' } }
4108 # @NetLegacyOptionsType:
4110 # Since: 1.2
4112 { 'enum': 'NetLegacyOptionsType',
4113   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
4114            'dump', 'bridge', 'netmap', 'vhost-user'] }
4117 # @NetLegacyOptions:
4119 # Like Netdev, but for use only by the legacy command line options
4121 # Since: 1.2
4123 { 'union': 'NetLegacyOptions',
4124   'base': { 'type': 'NetLegacyOptionsType' },
4125   'discriminator': 'type',
4126   'data': {
4127     'none':     'NetdevNoneOptions',
4128     'nic':      'NetLegacyNicOptions',
4129     'user':     'NetdevUserOptions',
4130     'tap':      'NetdevTapOptions',
4131     'l2tpv3':   'NetdevL2TPv3Options',
4132     'socket':   'NetdevSocketOptions',
4133     'vde':      'NetdevVdeOptions',
4134     'dump':     'NetdevDumpOptions',
4135     'bridge':   'NetdevBridgeOptions',
4136     'netmap':   'NetdevNetmapOptions',
4137     'vhost-user': 'NetdevVhostUserOptions' } }
4140 # @NetFilterDirection:
4142 # Indicates whether a netfilter is attached to a netdev's transmit queue or
4143 # receive queue or both.
4145 # @all: the filter is attached both to the receive and the transmit
4146 #       queue of the netdev (default).
4148 # @rx: the filter is attached to the receive queue of the netdev,
4149 #      where it will receive packets sent to the netdev.
4151 # @tx: the filter is attached to the transmit queue of the netdev,
4152 #      where it will receive packets sent by the netdev.
4154 # Since: 2.5
4156 { 'enum': 'NetFilterDirection',
4157   'data': [ 'all', 'rx', 'tx' ] }
4160 # @InetSocketAddressBase:
4162 # @host: host part of the address
4163 # @port: port part of the address
4165 { 'struct': 'InetSocketAddressBase',
4166   'data': {
4167     'host': 'str',
4168     'port': 'str' } }
4171 # @InetSocketAddress:
4173 # Captures a socket address or address range in the Internet namespace.
4175 # @numeric: true if the host/port are guaranteed to be numeric,
4176 #           false if name resolution should be attempted. Defaults to false.
4177 #           (Since 2.9)
4179 # @to: If present, this is range of possible addresses, with port
4180 #      between @port and @to.
4182 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4184 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4186 # Since: 1.3
4188 { 'struct': 'InetSocketAddress',
4189   'base': 'InetSocketAddressBase',
4190   'data': {
4191     '*numeric':  'bool',
4192     '*to': 'uint16',
4193     '*ipv4': 'bool',
4194     '*ipv6': 'bool' } }
4197 # @UnixSocketAddress:
4199 # Captures a socket address in the local ("Unix socket") namespace.
4201 # @path: filesystem path to use
4203 # Since: 1.3
4205 { 'struct': 'UnixSocketAddress',
4206   'data': {
4207     'path': 'str' } }
4210 # @VsockSocketAddress:
4212 # Captures a socket address in the vsock namespace.
4214 # @cid: unique host identifier
4215 # @port: port
4217 # Note: string types are used to allow for possible future hostname or
4218 # service resolution support.
4220 # Since: 2.8
4222 { 'struct': 'VsockSocketAddress',
4223   'data': {
4224     'cid': 'str',
4225     'port': 'str' } }
4228 # @SocketAddressLegacy:
4230 # Captures the address of a socket, which could also be a named file descriptor
4232 # Note: This type is deprecated in favor of SocketAddress.  The
4233 # difference between SocketAddressLegacy and SocketAddress is that the
4234 # latter is a flat union rather than a simple union. Flat is nicer
4235 # because it avoids nesting on the wire, i.e. that form has fewer {}.
4238 # Since: 1.3
4240 { 'union': 'SocketAddressLegacy',
4241   'data': {
4242     'inet': 'InetSocketAddress',
4243     'unix': 'UnixSocketAddress',
4244     'vsock': 'VsockSocketAddress',
4245     'fd': 'String' } }
4248 # @SocketAddressType:
4250 # Available SocketAddress types
4252 # @inet:  Internet address
4254 # @unix:  Unix domain socket
4256 # Since: 2.9
4258 { 'enum': 'SocketAddressType',
4259   'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
4262 # @SocketAddress:
4264 # Captures the address of a socket, which could also be a named file
4265 # descriptor
4267 # @type:       Transport type
4269 # Since: 2.9
4271 { 'union': 'SocketAddress',
4272   'base': { 'type': 'SocketAddressType' },
4273   'discriminator': 'type',
4274   'data': { 'inet': 'InetSocketAddress',
4275             'unix': 'UnixSocketAddress',
4276             'vsock': 'VsockSocketAddress',
4277             'fd': 'String' } }
4280 # @getfd:
4282 # Receive a file descriptor via SCM rights and assign it a name
4284 # @fdname: file descriptor name
4286 # Returns: Nothing on success
4288 # Since: 0.14.0
4290 # Notes: If @fdname already exists, the file descriptor assigned to
4291 #        it will be closed and replaced by the received file
4292 #        descriptor.
4294 #        The 'closefd' command can be used to explicitly close the
4295 #        file descriptor when it is no longer needed.
4297 # Example:
4299 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4300 # <- { "return": {} }
4303 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4306 # @closefd:
4308 # Close a file descriptor previously passed via SCM rights
4310 # @fdname: file descriptor name
4312 # Returns: Nothing on success
4314 # Since: 0.14.0
4316 # Example:
4318 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4319 # <- { "return": {} }
4322 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4325 # @MachineInfo:
4327 # Information describing a machine.
4329 # @name: the name of the machine
4331 # @alias: an alias for the machine name
4333 # @is-default: whether the machine is default
4335 # @cpu-max: maximum number of CPUs supported by the machine type
4336 #           (since 1.5.0)
4338 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4340 # Since: 1.2.0
4342 { 'struct': 'MachineInfo',
4343   'data': { 'name': 'str', '*alias': 'str',
4344             '*is-default': 'bool', 'cpu-max': 'int',
4345             'hotpluggable-cpus': 'bool'} }
4348 # @query-machines:
4350 # Return a list of supported machines
4352 # Returns: a list of MachineInfo
4354 # Since: 1.2.0
4356 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4359 # @CpuDefinitionInfo:
4361 # Virtual CPU definition.
4363 # @name: the name of the CPU definition
4365 # @migration-safe: whether a CPU definition can be safely used for
4366 #                  migration in combination with a QEMU compatibility machine
4367 #                  when migrating between different QMU versions and between
4368 #                  hosts with different sets of (hardware or software)
4369 #                  capabilities. If not provided, information is not available
4370 #                  and callers should not assume the CPU definition to be
4371 #                  migration-safe. (since 2.8)
4373 # @static: whether a CPU definition is static and will not change depending on
4374 #          QEMU version, machine type, machine options and accelerator options.
4375 #          A static model is always migration-safe. (since 2.8)
4377 # @unavailable-features: List of properties that prevent
4378 #                        the CPU model from running in the current
4379 #                        host. (since 2.8)
4380 # @typename: Type name that can be used as argument to @device-list-properties,
4381 #            to introspect properties configurable using -cpu or -global.
4382 #            (since 2.9)
4384 # @unavailable-features is a list of QOM property names that
4385 # represent CPU model attributes that prevent the CPU from running.
4386 # If the QOM property is read-only, that means there's no known
4387 # way to make the CPU model run in the current host. Implementations
4388 # that choose not to provide specific information return the
4389 # property name "type".
4390 # If the property is read-write, it means that it MAY be possible
4391 # to run the CPU model in the current host if that property is
4392 # changed. Management software can use it as hints to suggest or
4393 # choose an alternative for the user, or just to generate meaningful
4394 # error messages explaining why the CPU model can't be used.
4395 # If @unavailable-features is an empty list, the CPU model is
4396 # runnable using the current host and machine-type.
4397 # If @unavailable-features is not present, runnability
4398 # information for the CPU is not available.
4400 # Since: 1.2.0
4402 { 'struct': 'CpuDefinitionInfo',
4403   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4404             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4407 # @query-cpu-definitions:
4409 # Return a list of supported virtual CPU definitions
4411 # Returns: a list of CpuDefInfo
4413 # Since: 1.2.0
4415 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4418 # @CpuModelInfo:
4420 # Virtual CPU model.
4422 # A CPU model consists of the name of a CPU definition, to which
4423 # delta changes are applied (e.g. features added/removed). Most magic values
4424 # that an architecture might require should be hidden behind the name.
4425 # However, if required, architectures can expose relevant properties.
4427 # @name: the name of the CPU definition the model is based on
4428 # @props: a dictionary of QOM properties to be applied
4430 # Since: 2.8.0
4432 { 'struct': 'CpuModelInfo',
4433   'data': { 'name': 'str',
4434             '*props': 'any' } }
4437 # @CpuModelExpansionType:
4439 # An enumeration of CPU model expansion types.
4441 # @static: Expand to a static CPU model, a combination of a static base
4442 #          model name and property delta changes. As the static base model will
4443 #          never change, the expanded CPU model will be the same, independant of
4444 #          independent of QEMU version, machine type, machine options, and
4445 #          accelerator options. Therefore, the resulting model can be used by
4446 #          tooling without having to specify a compatibility machine - e.g. when
4447 #          displaying the "host" model. static CPU models are migration-safe.
4449 # @full: Expand all properties. The produced model is not guaranteed to be
4450 #        migration-safe, but allows tooling to get an insight and work with
4451 #        model details.
4453 # Note: When a non-migration-safe CPU model is expanded in static mode, some
4454 # features enabled by the CPU model may be omitted, because they can't be
4455 # implemented by a static CPU model definition (e.g. cache info passthrough and
4456 # PMU passthrough in x86). If you need an accurate representation of the
4457 # features enabled by a non-migration-safe CPU model, use @full. If you need a
4458 # static representation that will keep ABI compatibility even when changing QEMU
4459 # version or machine-type, use @static (but keep in mind that some features may
4460 # be omitted).
4462 # Since: 2.8.0
4464 { 'enum': 'CpuModelExpansionType',
4465   'data': [ 'static', 'full' ] }
4469 # @CpuModelExpansionInfo:
4471 # The result of a cpu model expansion.
4473 # @model: the expanded CpuModelInfo.
4475 # Since: 2.8.0
4477 { 'struct': 'CpuModelExpansionInfo',
4478   'data': { 'model': 'CpuModelInfo' } }
4482 # @query-cpu-model-expansion:
4484 # Expands a given CPU model (or a combination of CPU model + additional options)
4485 # to different granularities, allowing tooling to get an understanding what a
4486 # specific CPU model looks like in QEMU under a certain configuration.
4488 # This interface can be used to query the "host" CPU model.
4490 # The data returned by this command may be affected by:
4492 # * QEMU version: CPU models may look different depending on the QEMU version.
4493 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4494 # * machine-type: CPU model  may look different depending on the machine-type.
4495 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4496 # * machine options (including accelerator): in some architectures, CPU models
4497 #   may look different depending on machine and accelerator options. (Except for
4498 #   CPU models reported as "static" in query-cpu-definitions.)
4499 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4500 #   global properties may affect expansion of CPU models. Using
4501 #   query-cpu-model-expansion while using these is not advised.
4503 # Some architectures may not support all expansion types. s390x supports
4504 # "full" and "static".
4506 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4507 #          not supported, if the model cannot be expanded, if the model contains
4508 #          an unknown CPU definition name, unknown properties or properties
4509 #          with a wrong type. Also returns an error if an expansion type is
4510 #          not supported.
4512 # Since: 2.8.0
4514 { 'command': 'query-cpu-model-expansion',
4515   'data': { 'type': 'CpuModelExpansionType',
4516             'model': 'CpuModelInfo' },
4517   'returns': 'CpuModelExpansionInfo' }
4520 # @CpuModelCompareResult:
4522 # An enumeration of CPU model comparation results. The result is usually
4523 # calculated using e.g. CPU features or CPU generations.
4525 # @incompatible: If model A is incompatible to model B, model A is not
4526 #                guaranteed to run where model B runs and the other way around.
4528 # @identical: If model A is identical to model B, model A is guaranteed to run
4529 #             where model B runs and the other way around.
4531 # @superset: If model A is a superset of model B, model B is guaranteed to run
4532 #            where model A runs. There are no guarantees about the other way.
4534 # @subset: If model A is a subset of model B, model A is guaranteed to run
4535 #          where model B runs. There are no guarantees about the other way.
4537 # Since: 2.8.0
4539 { 'enum': 'CpuModelCompareResult',
4540   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4543 # @CpuModelCompareInfo:
4545 # The result of a CPU model comparison.
4547 # @result: The result of the compare operation.
4548 # @responsible-properties: List of properties that led to the comparison result
4549 #                          not being identical.
4551 # @responsible-properties is a list of QOM property names that led to
4552 # both CPUs not being detected as identical. For identical models, this
4553 # list is empty.
4554 # If a QOM property is read-only, that means there's no known way to make the
4555 # CPU models identical. If the special property name "type" is included, the
4556 # models are by definition not identical and cannot be made identical.
4558 # Since: 2.8.0
4560 { 'struct': 'CpuModelCompareInfo',
4561   'data': {'result': 'CpuModelCompareResult',
4562            'responsible-properties': ['str']
4563           }
4567 # @query-cpu-model-comparison:
4569 # Compares two CPU models, returning how they compare in a specific
4570 # configuration. The results indicates how both models compare regarding
4571 # runnability. This result can be used by tooling to make decisions if a
4572 # certain CPU model will run in a certain configuration or if a compatible
4573 # CPU model has to be created by baselining.
4575 # Usually, a CPU model is compared against the maximum possible CPU model
4576 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4577 # model is identical or a subset, it will run in that configuration.
4579 # The result returned by this command may be affected by:
4581 # * QEMU version: CPU models may look different depending on the QEMU version.
4582 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4583 # * machine-type: CPU model may look different depending on the machine-type.
4584 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4585 # * machine options (including accelerator): in some architectures, CPU models
4586 #   may look different depending on machine and accelerator options. (Except for
4587 #   CPU models reported as "static" in query-cpu-definitions.)
4588 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4589 #   global properties may affect expansion of CPU models. Using
4590 #   query-cpu-model-expansion while using these is not advised.
4592 # Some architectures may not support comparing CPU models. s390x supports
4593 # comparing CPU models.
4595 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4596 #          not supported, if a model cannot be used, if a model contains
4597 #          an unknown cpu definition name, unknown properties or properties
4598 #          with wrong types.
4600 # Since: 2.8.0
4602 { 'command': 'query-cpu-model-comparison',
4603   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4604   'returns': 'CpuModelCompareInfo' }
4607 # @CpuModelBaselineInfo:
4609 # The result of a CPU model baseline.
4611 # @model: the baselined CpuModelInfo.
4613 # Since: 2.8.0
4615 { 'struct': 'CpuModelBaselineInfo',
4616   'data': { 'model': 'CpuModelInfo' } }
4619 # @query-cpu-model-baseline:
4621 # Baseline two CPU models, creating a compatible third model. The created
4622 # model will always be a static, migration-safe CPU model (see "static"
4623 # CPU model expansion for details).
4625 # This interface can be used by tooling to create a compatible CPU model out
4626 # two CPU models. The created CPU model will be identical to or a subset of
4627 # both CPU models when comparing them. Therefore, the created CPU model is
4628 # guaranteed to run where the given CPU models run.
4630 # The result returned by this command may be affected by:
4632 # * QEMU version: CPU models may look different depending on the QEMU version.
4633 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4634 # * machine-type: CPU model may look different depending on the machine-type.
4635 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4636 # * machine options (including accelerator): in some architectures, CPU models
4637 #   may look different depending on machine and accelerator options. (Except for
4638 #   CPU models reported as "static" in query-cpu-definitions.)
4639 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4640 #   global properties may affect expansion of CPU models. Using
4641 #   query-cpu-model-expansion while using these is not advised.
4643 # Some architectures may not support baselining CPU models. s390x supports
4644 # baselining CPU models.
4646 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4647 #          not supported, if a model cannot be used, if a model contains
4648 #          an unknown cpu definition name, unknown properties or properties
4649 #          with wrong types.
4651 # Since: 2.8.0
4653 { 'command': 'query-cpu-model-baseline',
4654   'data': { 'modela': 'CpuModelInfo',
4655             'modelb': 'CpuModelInfo' },
4656   'returns': 'CpuModelBaselineInfo' }
4659 # @AddfdInfo:
4661 # Information about a file descriptor that was added to an fd set.
4663 # @fdset-id: The ID of the fd set that @fd was added to.
4665 # @fd: The file descriptor that was received via SCM rights and
4666 #      added to the fd set.
4668 # Since: 1.2.0
4670 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4673 # @add-fd:
4675 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4677 # @fdset-id: The ID of the fd set to add the file descriptor to.
4679 # @opaque: A free-form string that can be used to describe the fd.
4681 # Returns: @AddfdInfo on success
4683 #          If file descriptor was not received, FdNotSupplied
4685 #          If @fdset-id is a negative value, InvalidParameterValue
4687 # Notes: The list of fd sets is shared by all monitor connections.
4689 #        If @fdset-id is not specified, a new fd set will be created.
4691 # Since: 1.2.0
4693 # Example:
4695 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4696 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4699 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4700   'returns': 'AddfdInfo' }
4703 # @remove-fd:
4705 # Remove a file descriptor from an fd set.
4707 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4709 # @fd: The file descriptor that is to be removed.
4711 # Returns: Nothing on success
4712 #          If @fdset-id or @fd is not found, FdNotFound
4714 # Since: 1.2.0
4716 # Notes: The list of fd sets is shared by all monitor connections.
4718 #        If @fd is not specified, all file descriptors in @fdset-id
4719 #        will be removed.
4721 # Example:
4723 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4724 # <- { "return": {} }
4727 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4730 # @FdsetFdInfo:
4732 # Information about a file descriptor that belongs to an fd set.
4734 # @fd: The file descriptor value.
4736 # @opaque: A free-form string that can be used to describe the fd.
4738 # Since: 1.2.0
4740 { 'struct': 'FdsetFdInfo',
4741   'data': {'fd': 'int', '*opaque': 'str'} }
4744 # @FdsetInfo:
4746 # Information about an fd set.
4748 # @fdset-id: The ID of the fd set.
4750 # @fds: A list of file descriptors that belong to this fd set.
4752 # Since: 1.2.0
4754 { 'struct': 'FdsetInfo',
4755   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4758 # @query-fdsets:
4760 # Return information describing all fd sets.
4762 # Returns: A list of @FdsetInfo
4764 # Since: 1.2.0
4766 # Note: The list of fd sets is shared by all monitor connections.
4768 # Example:
4770 # -> { "execute": "query-fdsets" }
4771 # <- { "return": [
4772 #        {
4773 #          "fds": [
4774 #            {
4775 #              "fd": 30,
4776 #              "opaque": "rdonly:/path/to/file"
4777 #            },
4778 #            {
4779 #              "fd": 24,
4780 #              "opaque": "rdwr:/path/to/file"
4781 #            }
4782 #          ],
4783 #          "fdset-id": 1
4784 #        },
4785 #        {
4786 #          "fds": [
4787 #            {
4788 #              "fd": 28
4789 #            },
4790 #            {
4791 #              "fd": 29
4792 #            }
4793 #          ],
4794 #          "fdset-id": 0
4795 #        }
4796 #      ]
4797 #    }
4800 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4803 # @TargetInfo:
4805 # Information describing the QEMU target.
4807 # @arch: the target architecture (eg "x86_64", "i386", etc)
4809 # Since: 1.2.0
4811 { 'struct': 'TargetInfo',
4812   'data': { 'arch': 'str' } }
4815 # @query-target:
4817 # Return information about the target for this QEMU
4819 # Returns: TargetInfo
4821 # Since: 1.2.0
4823 { 'command': 'query-target', 'returns': 'TargetInfo' }
4826 # @QKeyCode:
4828 # An enumeration of key name.
4830 # This is used by the @send-key command.
4832 # @unmapped: since 2.0
4833 # @pause: since 2.0
4834 # @ro: since 2.4
4835 # @kp_comma: since 2.4
4836 # @kp_equals: since 2.6
4837 # @power: since 2.6
4838 # @hiragana: since 2.9
4839 # @henkan: since 2.9
4840 # @yen: since 2.9
4842 # @sleep: since 2.10
4843 # @wake: since 2.10
4844 # @audionext: since 2.10
4845 # @audioprev: since 2.10
4846 # @audiostop: since 2.10
4847 # @audioplay: since 2.10
4848 # @audiomute: since 2.10
4849 # @volumeup: since 2.10
4850 # @volumedown: since 2.10
4851 # @mediaselect: since 2.10
4852 # @mail: since 2.10
4853 # @calculator: since 2.10
4854 # @computer: since 2.10
4855 # @ac_home: since 2.10
4856 # @ac_back: since 2.10
4857 # @ac_forward: since 2.10
4858 # @ac_refresh: since 2.10
4859 # @ac_bookmarks: since 2.10
4860 # altgr, altgr_r: dropped in 2.10
4862 # Since: 1.3.0
4865 { 'enum': 'QKeyCode',
4866   'data': [ 'unmapped',
4867             'shift', 'shift_r', 'alt', 'alt_r', 'ctrl',
4868             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4869             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4870             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4871             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4872             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4873             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4874             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4875             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4876             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4877             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4878             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4879             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4880             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4881             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4882             'ro', 'hiragana', 'henkan', 'yen',
4883             'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
4884             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
4885             'volumeup', 'volumedown', 'mediaselect',
4886             'mail', 'calculator', 'computer',
4887             'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
4890 # @KeyValue:
4892 # Represents a keyboard key.
4894 # Since: 1.3.0
4896 { 'union': 'KeyValue',
4897   'data': {
4898     'number': 'int',
4899     'qcode': 'QKeyCode' } }
4902 # @send-key:
4904 # Send keys to guest.
4906 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4907 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4908 #        directly to the guest, while @KeyValue.qcode must be a valid
4909 #        @QKeyCode value
4911 # @hold-time: time to delay key up events, milliseconds. Defaults
4912 #             to 100
4914 # Returns: Nothing on success
4915 #          If key is unknown or redundant, InvalidParameter
4917 # Since: 1.3.0
4919 # Example:
4921 # -> { "execute": "send-key",
4922 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4923 #                               { "type": "qcode", "data": "alt" },
4924 #                               { "type": "qcode", "data": "delete" } ] } }
4925 # <- { "return": {} }
4928 { 'command': 'send-key',
4929   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4932 # @screendump:
4934 # Write a PPM of the VGA screen to a file.
4936 # @filename: the path of a new PPM file to store the image
4938 # Returns: Nothing on success
4940 # Since: 0.14.0
4942 # Example:
4944 # -> { "execute": "screendump",
4945 #      "arguments": { "filename": "/tmp/image" } }
4946 # <- { "return": {} }
4949 { 'command': 'screendump', 'data': {'filename': 'str'} }
4953 # @ChardevCommon:
4955 # Configuration shared across all chardev backends
4957 # @logfile: The name of a logfile to save output
4958 # @logappend: true to append instead of truncate
4959 #             (default to false to truncate)
4961 # Since: 2.6
4963 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4964                                        '*logappend': 'bool' } }
4967 # @ChardevFile:
4969 # Configuration info for file chardevs.
4971 # @in:  The name of the input file
4972 # @out: The name of the output file
4973 # @append: Open the file in append mode (default false to
4974 #          truncate) (Since 2.6)
4976 # Since: 1.4
4978 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4979                                    'out' : 'str',
4980                                    '*append': 'bool' },
4981   'base': 'ChardevCommon' }
4984 # @ChardevHostdev:
4986 # Configuration info for device and pipe chardevs.
4988 # @device: The name of the special file for the device,
4989 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4991 # Since: 1.4
4993 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4994   'base': 'ChardevCommon' }
4997 # @ChardevSocket:
4999 # Configuration info for (stream) socket chardevs.
5001 # @addr: socket address to listen on (server=true)
5002 #        or connect to (server=false)
5003 # @tls-creds: the ID of the TLS credentials object (since 2.6)
5004 # @server: create server socket (default: true)
5005 # @wait: wait for incoming connection on server
5006 #        sockets (default: false).
5007 # @nodelay: set TCP_NODELAY socket option (default: false)
5008 # @telnet: enable telnet protocol on server
5009 #          sockets (default: false)
5010 # @tn3270: enable tn3270 protocol on server
5011 #          sockets (default: false) (Since: 2.10)
5012 # @reconnect: For a client socket, if a socket is disconnected,
5013 #          then attempt a reconnect after the given number of seconds.
5014 #          Setting this to zero disables this function. (default: 0)
5015 #          (Since: 2.2)
5017 # Since: 1.4
5019 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddressLegacy',
5020                                      '*tls-creds'  : 'str',
5021                                      '*server'    : 'bool',
5022                                      '*wait'      : 'bool',
5023                                      '*nodelay'   : 'bool',
5024                                      '*telnet'    : 'bool',
5025                                      '*tn3270'    : 'bool',
5026                                      '*reconnect' : 'int' },
5027   'base': 'ChardevCommon' }
5030 # @ChardevUdp:
5032 # Configuration info for datagram socket chardevs.
5034 # @remote: remote address
5035 # @local: local address
5037 # Since: 1.5
5039 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
5040                                   '*local' : 'SocketAddressLegacy' },
5041   'base': 'ChardevCommon' }
5044 # @ChardevMux:
5046 # Configuration info for mux chardevs.
5048 # @chardev: name of the base chardev.
5050 # Since: 1.5
5052 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
5053   'base': 'ChardevCommon' }
5056 # @ChardevStdio:
5058 # Configuration info for stdio chardevs.
5060 # @signal: Allow signals (such as SIGINT triggered by ^C)
5061 #          be delivered to qemu.  Default: true in -nographic mode,
5062 #          false otherwise.
5064 # Since: 1.5
5066 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
5067   'base': 'ChardevCommon' }
5071 # @ChardevSpiceChannel:
5073 # Configuration info for spice vm channel chardevs.
5075 # @type: kind of channel (for example vdagent).
5077 # Since: 1.5
5079 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
5080   'base': 'ChardevCommon' }
5083 # @ChardevSpicePort:
5085 # Configuration info for spice port chardevs.
5087 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
5089 # Since: 1.5
5091 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
5092   'base': 'ChardevCommon' }
5095 # @ChardevVC:
5097 # Configuration info for virtual console chardevs.
5099 # @width:  console width,  in pixels
5100 # @height: console height, in pixels
5101 # @cols:   console width,  in chars
5102 # @rows:   console height, in chars
5104 # Since: 1.5
5106 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
5107                                  '*height' : 'int',
5108                                  '*cols'   : 'int',
5109                                  '*rows'   : 'int' },
5110   'base': 'ChardevCommon' }
5113 # @ChardevRingbuf:
5115 # Configuration info for ring buffer chardevs.
5117 # @size: ring buffer size, must be power of two, default is 65536
5119 # Since: 1.5
5121 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
5122   'base': 'ChardevCommon' }
5125 # @ChardevBackend:
5127 # Configuration info for the new chardev backend.
5129 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
5131 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
5132                                        'serial' : 'ChardevHostdev',
5133                                        'parallel': 'ChardevHostdev',
5134                                        'pipe'   : 'ChardevHostdev',
5135                                        'socket' : 'ChardevSocket',
5136                                        'udp'    : 'ChardevUdp',
5137                                        'pty'    : 'ChardevCommon',
5138                                        'null'   : 'ChardevCommon',
5139                                        'mux'    : 'ChardevMux',
5140                                        'msmouse': 'ChardevCommon',
5141                                        'wctablet' : 'ChardevCommon',
5142                                        'braille': 'ChardevCommon',
5143                                        'testdev': 'ChardevCommon',
5144                                        'stdio'  : 'ChardevStdio',
5145                                        'console': 'ChardevCommon',
5146                                        'spicevmc' : 'ChardevSpiceChannel',
5147                                        'spiceport' : 'ChardevSpicePort',
5148                                        'vc'     : 'ChardevVC',
5149                                        'ringbuf': 'ChardevRingbuf',
5150                                        # next one is just for compatibility
5151                                        'memory' : 'ChardevRingbuf' } }
5154 # @ChardevReturn:
5156 # Return info about the chardev backend just created.
5158 # @pty: name of the slave pseudoterminal device, present if
5159 #       and only if a chardev of type 'pty' was created
5161 # Since: 1.4
5163 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
5166 # @chardev-add:
5168 # Add a character device backend
5170 # @id: the chardev's ID, must be unique
5171 # @backend: backend type and parameters
5173 # Returns: ChardevReturn.
5175 # Since: 1.4
5177 # Example:
5179 # -> { "execute" : "chardev-add",
5180 #      "arguments" : { "id" : "foo",
5181 #                      "backend" : { "type" : "null", "data" : {} } } }
5182 # <- { "return": {} }
5184 # -> { "execute" : "chardev-add",
5185 #      "arguments" : { "id" : "bar",
5186 #                      "backend" : { "type" : "file",
5187 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
5188 # <- { "return": {} }
5190 # -> { "execute" : "chardev-add",
5191 #      "arguments" : { "id" : "baz",
5192 #                      "backend" : { "type" : "pty", "data" : {} } } }
5193 # <- { "return": { "pty" : "/dev/pty/42" } }
5196 { 'command': 'chardev-add', 'data': {'id'      : 'str',
5197                                      'backend' : 'ChardevBackend' },
5198   'returns': 'ChardevReturn' }
5201 # @chardev-change:
5203 # Change a character device backend
5205 # @id: the chardev's ID, must exist
5206 # @backend: new backend type and parameters
5208 # Returns: ChardevReturn.
5210 # Since: 2.10
5212 # Example:
5214 # -> { "execute" : "chardev-change",
5215 #      "arguments" : { "id" : "baz",
5216 #                      "backend" : { "type" : "pty", "data" : {} } } }
5217 # <- { "return": { "pty" : "/dev/pty/42" } }
5219 # -> {"execute" : "chardev-change",
5220 #     "arguments" : {
5221 #         "id" : "charchannel2",
5222 #         "backend" : {
5223 #             "type" : "socket",
5224 #             "data" : {
5225 #                 "addr" : {
5226 #                     "type" : "unix" ,
5227 #                     "data" : {
5228 #                         "path" : "/tmp/charchannel2.socket"
5229 #                     }
5230 #                  },
5231 #                  "server" : true,
5232 #                  "wait" : false }}}}
5233 # <- {"return": {}}
5236 { 'command': 'chardev-change', 'data': {'id'      : 'str',
5237                                         'backend' : 'ChardevBackend' },
5238   'returns': 'ChardevReturn' }
5241 # @chardev-remove:
5243 # Remove a character device backend
5245 # @id: the chardev's ID, must exist and not be in use
5247 # Returns: Nothing on success
5249 # Since: 1.4
5251 # Example:
5253 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
5254 # <- { "return": {} }
5257 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
5260 # @chardev-send-break:
5262 # Send a break to a character device
5264 # @id: the chardev's ID, must exist
5266 # Returns: Nothing on success
5268 # Since: 2.10
5270 # Example:
5272 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
5273 # <- { "return": {} }
5276 { 'command': 'chardev-send-break', 'data': {'id': 'str'} }
5280 # @TpmModel:
5282 # An enumeration of TPM models
5284 # @tpm-tis: TPM TIS model
5286 # Since: 1.5
5288 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
5291 # @query-tpm-models:
5293 # Return a list of supported TPM models
5295 # Returns: a list of TpmModel
5297 # Since: 1.5
5299 # Example:
5301 # -> { "execute": "query-tpm-models" }
5302 # <- { "return": [ "tpm-tis" ] }
5305 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5308 # @TpmType:
5310 # An enumeration of TPM types
5312 # @passthrough: TPM passthrough type
5314 # Since: 1.5
5316 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5319 # @query-tpm-types:
5321 # Return a list of supported TPM types
5323 # Returns: a list of TpmType
5325 # Since: 1.5
5327 # Example:
5329 # -> { "execute": "query-tpm-types" }
5330 # <- { "return": [ "passthrough" ] }
5333 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5336 # @TPMPassthroughOptions:
5338 # Information about the TPM passthrough type
5340 # @path: string describing the path used for accessing the TPM device
5342 # @cancel-path: string showing the TPM's sysfs cancel file
5343 #               for cancellation of TPM commands while they are executing
5345 # Since: 1.5
5347 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
5348                                              '*cancel-path' : 'str'} }
5351 # @TpmTypeOptions:
5353 # A union referencing different TPM backend types' configuration options
5355 # @type: 'passthrough' The configuration options for the TPM passthrough type
5357 # Since: 1.5
5359 { 'union': 'TpmTypeOptions',
5360    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
5363 # @TPMInfo:
5365 # Information about the TPM
5367 # @id: The Id of the TPM
5369 # @model: The TPM frontend model
5371 # @options: The TPM (backend) type configuration options
5373 # Since: 1.5
5375 { 'struct': 'TPMInfo',
5376   'data': {'id': 'str',
5377            'model': 'TpmModel',
5378            'options': 'TpmTypeOptions' } }
5381 # @query-tpm:
5383 # Return information about the TPM device
5385 # Returns: @TPMInfo on success
5387 # Since: 1.5
5389 # Example:
5391 # -> { "execute": "query-tpm" }
5392 # <- { "return":
5393 #      [
5394 #        { "model": "tpm-tis",
5395 #          "options":
5396 #            { "type": "passthrough",
5397 #              "data":
5398 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5399 #                  "path": "/dev/tpm0"
5400 #                }
5401 #            },
5402 #          "id": "tpm0"
5403 #        }
5404 #      ]
5405 #    }
5408 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5411 # @AcpiTableOptions:
5413 # Specify an ACPI table on the command line to load.
5415 # At most one of @file and @data can be specified. The list of files specified
5416 # by any one of them is loaded and concatenated in order. If both are omitted,
5417 # @data is implied.
5419 # Other fields / optargs can be used to override fields of the generic ACPI
5420 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5421 # Description Table Header. If a header field is not overridden, then the
5422 # corresponding value from the concatenated blob is used (in case of @file), or
5423 # it is filled in with a hard-coded value (in case of @data).
5425 # String fields are copied into the matching ACPI member from lowest address
5426 # upwards, and silently truncated / NUL-padded to length.
5428 # @sig: table signature / identifier (4 bytes)
5430 # @rev: table revision number (dependent on signature, 1 byte)
5432 # @oem_id: OEM identifier (6 bytes)
5434 # @oem_table_id: OEM table identifier (8 bytes)
5436 # @oem_rev: OEM-supplied revision number (4 bytes)
5438 # @asl_compiler_id: identifier of the utility that created the table
5439 #                   (4 bytes)
5441 # @asl_compiler_rev: revision number of the utility that created the
5442 #                    table (4 bytes)
5444 # @file: colon (:) separated list of pathnames to load and
5445 #        concatenate as table data. The resultant binary blob is expected to
5446 #        have an ACPI table header. At least one file is required. This field
5447 #        excludes @data.
5449 # @data: colon (:) separated list of pathnames to load and
5450 #        concatenate as table data. The resultant binary blob must not have an
5451 #        ACPI table header. At least one file is required. This field excludes
5452 #        @file.
5454 # Since: 1.5
5456 { 'struct': 'AcpiTableOptions',
5457   'data': {
5458     '*sig':               'str',
5459     '*rev':               'uint8',
5460     '*oem_id':            'str',
5461     '*oem_table_id':      'str',
5462     '*oem_rev':           'uint32',
5463     '*asl_compiler_id':   'str',
5464     '*asl_compiler_rev':  'uint32',
5465     '*file':              'str',
5466     '*data':              'str' }}
5469 # @CommandLineParameterType:
5471 # Possible types for an option parameter.
5473 # @string: accepts a character string
5475 # @boolean: accepts "on" or "off"
5477 # @number: accepts a number
5479 # @size: accepts a number followed by an optional suffix (K)ilo,
5480 #        (M)ega, (G)iga, (T)era
5482 # Since: 1.5
5484 { 'enum': 'CommandLineParameterType',
5485   'data': ['string', 'boolean', 'number', 'size'] }
5488 # @CommandLineParameterInfo:
5490 # Details about a single parameter of a command line option.
5492 # @name: parameter name
5494 # @type: parameter @CommandLineParameterType
5496 # @help: human readable text string, not suitable for parsing.
5498 # @default: default value string (since 2.1)
5500 # Since: 1.5
5502 { 'struct': 'CommandLineParameterInfo',
5503   'data': { 'name': 'str',
5504             'type': 'CommandLineParameterType',
5505             '*help': 'str',
5506             '*default': 'str' } }
5509 # @CommandLineOptionInfo:
5511 # Details about a command line option, including its list of parameter details
5513 # @option: option name
5515 # @parameters: an array of @CommandLineParameterInfo
5517 # Since: 1.5
5519 { 'struct': 'CommandLineOptionInfo',
5520   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5523 # @query-command-line-options:
5525 # Query command line option schema.
5527 # @option: option name
5529 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5530 #          @option).  Returns an error if the given @option doesn't exist.
5532 # Since: 1.5
5534 # Example:
5536 # -> { "execute": "query-command-line-options",
5537 #      "arguments": { "option": "option-rom" } }
5538 # <- { "return": [
5539 #         {
5540 #             "parameters": [
5541 #                 {
5542 #                     "name": "romfile",
5543 #                     "type": "string"
5544 #                 },
5545 #                 {
5546 #                     "name": "bootindex",
5547 #                     "type": "number"
5548 #                 }
5549 #             ],
5550 #             "option": "option-rom"
5551 #         }
5552 #      ]
5553 #    }
5556 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5557  'returns': ['CommandLineOptionInfo'] }
5560 # @X86CPURegister32:
5562 # A X86 32-bit register
5564 # Since: 1.5
5566 { 'enum': 'X86CPURegister32',
5567   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5570 # @X86CPUFeatureWordInfo:
5572 # Information about a X86 CPU feature word
5574 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5576 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
5577 #                   feature word
5579 # @cpuid-register: Output register containing the feature bits
5581 # @features: value of output register, containing the feature bits
5583 # Since: 1.5
5585 { 'struct': 'X86CPUFeatureWordInfo',
5586   'data': { 'cpuid-input-eax': 'int',
5587             '*cpuid-input-ecx': 'int',
5588             'cpuid-register': 'X86CPURegister32',
5589             'features': 'int' } }
5592 # @DummyForceArrays:
5594 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5596 # Since: 2.5
5598 { 'struct': 'DummyForceArrays',
5599   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5603 # @RxState:
5605 # Packets receiving state
5607 # @normal: filter assigned packets according to the mac-table
5609 # @none: don't receive any assigned packet
5611 # @all: receive all assigned packets
5613 # Since: 1.6
5615 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5618 # @RxFilterInfo:
5620 # Rx-filter information for a NIC.
5622 # @name: net client name
5624 # @promiscuous: whether promiscuous mode is enabled
5626 # @multicast: multicast receive state
5628 # @unicast: unicast receive state
5630 # @vlan: vlan receive state (Since 2.0)
5632 # @broadcast-allowed: whether to receive broadcast
5634 # @multicast-overflow: multicast table is overflowed or not
5636 # @unicast-overflow: unicast table is overflowed or not
5638 # @main-mac: the main macaddr string
5640 # @vlan-table: a list of active vlan id
5642 # @unicast-table: a list of unicast macaddr string
5644 # @multicast-table: a list of multicast macaddr string
5646 # Since: 1.6
5648 { 'struct': 'RxFilterInfo',
5649   'data': {
5650     'name':               'str',
5651     'promiscuous':        'bool',
5652     'multicast':          'RxState',
5653     'unicast':            'RxState',
5654     'vlan':               'RxState',
5655     'broadcast-allowed':  'bool',
5656     'multicast-overflow': 'bool',
5657     'unicast-overflow':   'bool',
5658     'main-mac':           'str',
5659     'vlan-table':         ['int'],
5660     'unicast-table':      ['str'],
5661     'multicast-table':    ['str'] }}
5664 # @query-rx-filter:
5666 # Return rx-filter information for all NICs (or for the given NIC).
5668 # @name: net client name
5670 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5671 #          Returns an error if the given @name doesn't exist, or given
5672 #          NIC doesn't support rx-filter querying, or given net client
5673 #          isn't a NIC.
5675 # Since: 1.6
5677 # Example:
5679 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5680 # <- { "return": [
5681 #         {
5682 #             "promiscuous": true,
5683 #             "name": "vnet0",
5684 #             "main-mac": "52:54:00:12:34:56",
5685 #             "unicast": "normal",
5686 #             "vlan": "normal",
5687 #             "vlan-table": [
5688 #                 4,
5689 #                 0
5690 #             ],
5691 #             "unicast-table": [
5692 #             ],
5693 #             "multicast": "normal",
5694 #             "multicast-overflow": false,
5695 #             "unicast-overflow": false,
5696 #             "multicast-table": [
5697 #                 "01:00:5e:00:00:01",
5698 #                 "33:33:00:00:00:01",
5699 #                 "33:33:ff:12:34:56"
5700 #             ],
5701 #             "broadcast-allowed": false
5702 #         }
5703 #       ]
5704 #    }
5707 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5708   'returns': ['RxFilterInfo'] }
5711 # @InputButton:
5713 # Button of a pointer input device (mouse, tablet).
5715 # @side: front side button of a 5-button mouse (since 2.9)
5717 # @extra: rear side button of a 5-button mouse (since 2.9)
5719 # Since: 2.0
5721 { 'enum'  : 'InputButton',
5722   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5723   'extra' ] }
5726 # @InputAxis:
5728 # Position axis of a pointer input device (mouse, tablet).
5730 # Since: 2.0
5732 { 'enum'  : 'InputAxis',
5733   'data'  : [ 'x', 'y' ] }
5736 # @InputKeyEvent:
5738 # Keyboard input event.
5740 # @key:    Which key this event is for.
5741 # @down:   True for key-down and false for key-up events.
5743 # Since: 2.0
5745 { 'struct'  : 'InputKeyEvent',
5746   'data'  : { 'key'     : 'KeyValue',
5747               'down'    : 'bool' } }
5750 # @InputBtnEvent:
5752 # Pointer button input event.
5754 # @button: Which button this event is for.
5755 # @down:   True for key-down and false for key-up events.
5757 # Since: 2.0
5759 { 'struct'  : 'InputBtnEvent',
5760   'data'  : { 'button'  : 'InputButton',
5761               'down'    : 'bool' } }
5764 # @InputMoveEvent:
5766 # Pointer motion input event.
5768 # @axis:   Which axis is referenced by @value.
5769 # @value:  Pointer position.  For absolute coordinates the
5770 #          valid range is 0 -> 0x7ffff
5772 # Since: 2.0
5774 { 'struct'  : 'InputMoveEvent',
5775   'data'  : { 'axis'    : 'InputAxis',
5776               'value'   : 'int' } }
5779 # @InputEvent:
5781 # Input event union.
5783 # @type: the input type, one of:
5784 #  - 'key': Input event of Keyboard
5785 #  - 'btn': Input event of pointer buttons
5786 #  - 'rel': Input event of relative pointer motion
5787 #  - 'abs': Input event of absolute pointer motion
5789 # Since: 2.0
5791 { 'union' : 'InputEvent',
5792   'data'  : { 'key'     : 'InputKeyEvent',
5793               'btn'     : 'InputBtnEvent',
5794               'rel'     : 'InputMoveEvent',
5795               'abs'     : 'InputMoveEvent' } }
5798 # @input-send-event:
5800 # Send input event(s) to guest.
5802 # @device: display device to send event(s) to.
5803 # @head: head to send event(s) to, in case the
5804 #        display device supports multiple scanouts.
5805 # @events: List of InputEvent union.
5807 # Returns: Nothing on success.
5809 # The @device and @head parameters can be used to send the input event
5810 # to specific input devices in case (a) multiple input devices of the
5811 # same kind are added to the virtual machine and (b) you have
5812 # configured input routing (see docs/multiseat.txt) for those input
5813 # devices.  The parameters work exactly like the device and head
5814 # properties of input devices.  If @device is missing, only devices
5815 # that have no input routing config are admissible.  If @device is
5816 # specified, both input devices with and without input routing config
5817 # are admissible, but devices with input routing config take
5818 # precedence.
5820 # Since: 2.6
5822 # Note: The consoles are visible in the qom tree, under
5823 # /backend/console[$index]. They have a device link and head property,
5824 # so it is possible to map which console belongs to which device and
5825 # display.
5827 # Example:
5829 # 1. Press left mouse button.
5831 # -> { "execute": "input-send-event",
5832 #     "arguments": { "device": "video0",
5833 #                    "events": [ { "type": "btn",
5834 #                    "data" : { "down": true, "button": "left" } } ] } }
5835 # <- { "return": {} }
5837 # -> { "execute": "input-send-event",
5838 #     "arguments": { "device": "video0",
5839 #                    "events": [ { "type": "btn",
5840 #                    "data" : { "down": false, "button": "left" } } ] } }
5841 # <- { "return": {} }
5843 # 2. Press ctrl-alt-del.
5845 # -> { "execute": "input-send-event",
5846 #      "arguments": { "events": [
5847 #         { "type": "key", "data" : { "down": true,
5848 #           "key": {"type": "qcode", "data": "ctrl" } } },
5849 #         { "type": "key", "data" : { "down": true,
5850 #           "key": {"type": "qcode", "data": "alt" } } },
5851 #         { "type": "key", "data" : { "down": true,
5852 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5853 # <- { "return": {} }
5855 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5857 # -> { "execute": "input-send-event" ,
5858 #   "arguments": { "events": [
5859 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5860 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5861 # <- { "return": {} }
5864 { 'command': 'input-send-event',
5865   'data': { '*device': 'str',
5866             '*head'  : 'int',
5867             'events' : [ 'InputEvent' ] } }
5870 # @NumaOptionsType:
5872 # @node: NUMA nodes configuration
5874 # @dist: NUMA distance configuration (since 2.10)
5876 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
5878 # Since: 2.1
5880 { 'enum': 'NumaOptionsType',
5881   'data': [ 'node', 'dist', 'cpu' ] }
5884 # @NumaOptions:
5886 # A discriminated record of NUMA options. (for OptsVisitor)
5888 # Since: 2.1
5890 { 'union': 'NumaOptions',
5891   'base': { 'type': 'NumaOptionsType' },
5892   'discriminator': 'type',
5893   'data': {
5894     'node': 'NumaNodeOptions',
5895     'dist': 'NumaDistOptions',
5896     'cpu': 'NumaCpuOptions' }}
5899 # @NumaNodeOptions:
5901 # Create a guest NUMA node. (for OptsVisitor)
5903 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
5905 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
5906 #         if omitted)
5908 # @mem: memory size of this node; mutually exclusive with @memdev.
5909 #       Equally divide total memory among nodes if both @mem and @memdev are
5910 #       omitted.
5912 # @memdev: memory backend object.  If specified for one node,
5913 #          it must be specified for all nodes.
5915 # Since: 2.1
5917 { 'struct': 'NumaNodeOptions',
5918   'data': {
5919    '*nodeid': 'uint16',
5920    '*cpus':   ['uint16'],
5921    '*mem':    'size',
5922    '*memdev': 'str' }}
5925 # @NumaDistOptions:
5927 # Set the distance between 2 NUMA nodes.
5929 # @src: source NUMA node.
5931 # @dst: destination NUMA node.
5933 # @val: NUMA distance from source node to destination node.
5934 #       When a node is unreachable from another node, set the distance
5935 #       between them to 255.
5937 # Since: 2.10
5939 { 'struct': 'NumaDistOptions',
5940   'data': {
5941    'src': 'uint16',
5942    'dst': 'uint16',
5943    'val': 'uint8' }}
5946 # @NumaCpuOptions:
5948 # Option "-numa cpu" overrides default cpu to node mapping.
5949 # It accepts the same set of cpu properties as returned by
5950 # query-hotpluggable-cpus[].props, where node-id could be used to
5951 # override default node mapping.
5953 # Since: 2.10
5955 { 'struct': 'NumaCpuOptions',
5956    'base': 'CpuInstanceProperties',
5957    'data' : {} }
5960 # @HostMemPolicy:
5962 # Host memory policy types
5964 # @default: restore default policy, remove any nondefault policy
5966 # @preferred: set the preferred host nodes for allocation
5968 # @bind: a strict policy that restricts memory allocation to the
5969 #        host nodes specified
5971 # @interleave: memory allocations are interleaved across the set
5972 #              of host nodes specified
5974 # Since: 2.1
5976 { 'enum': 'HostMemPolicy',
5977   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5980 # @Memdev:
5982 # Information about memory backend
5984 # @id: backend's ID if backend has 'id' property (since 2.9)
5986 # @size: memory backend size
5988 # @merge: enables or disables memory merge support
5990 # @dump: includes memory backend's memory in a core dump or not
5992 # @prealloc: enables or disables memory preallocation
5994 # @host-nodes: host nodes for its memory policy
5996 # @policy: memory policy of memory backend
5998 # Since: 2.1
6000 { 'struct': 'Memdev',
6001   'data': {
6002     '*id':        'str',
6003     'size':       'size',
6004     'merge':      'bool',
6005     'dump':       'bool',
6006     'prealloc':   'bool',
6007     'host-nodes': ['uint16'],
6008     'policy':     'HostMemPolicy' }}
6011 # @query-memdev:
6013 # Returns information for all memory backends.
6015 # Returns: a list of @Memdev.
6017 # Since: 2.1
6019 # Example:
6021 # -> { "execute": "query-memdev" }
6022 # <- { "return": [
6023 #        {
6024 #          "id": "mem1",
6025 #          "size": 536870912,
6026 #          "merge": false,
6027 #          "dump": true,
6028 #          "prealloc": false,
6029 #          "host-nodes": [0, 1],
6030 #          "policy": "bind"
6031 #        },
6032 #        {
6033 #          "size": 536870912,
6034 #          "merge": false,
6035 #          "dump": true,
6036 #          "prealloc": true,
6037 #          "host-nodes": [2, 3],
6038 #          "policy": "preferred"
6039 #        }
6040 #      ]
6041 #    }
6044 { 'command': 'query-memdev', 'returns': ['Memdev'] }
6047 # @PCDIMMDeviceInfo:
6049 # PCDIMMDevice state information
6051 # @id: device's ID
6053 # @addr: physical address, where device is mapped
6055 # @size: size of memory that the device provides
6057 # @slot: slot number at which device is plugged in
6059 # @node: NUMA node number where device is plugged in
6061 # @memdev: memory backend linked with device
6063 # @hotplugged: true if device was hotplugged
6065 # @hotpluggable: true if device if could be added/removed while machine is running
6067 # Since: 2.1
6069 { 'struct': 'PCDIMMDeviceInfo',
6070   'data': { '*id': 'str',
6071             'addr': 'int',
6072             'size': 'int',
6073             'slot': 'int',
6074             'node': 'int',
6075             'memdev': 'str',
6076             'hotplugged': 'bool',
6077             'hotpluggable': 'bool'
6078           }
6082 # @MemoryDeviceInfo:
6084 # Union containing information about a memory device
6086 # Since: 2.1
6088 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
6091 # @query-memory-devices:
6093 # Lists available memory devices and their state
6095 # Since: 2.1
6097 # Example:
6099 # -> { "execute": "query-memory-devices" }
6100 # <- { "return": [ { "data":
6101 #                       { "addr": 5368709120,
6102 #                         "hotpluggable": true,
6103 #                         "hotplugged": true,
6104 #                         "id": "d1",
6105 #                         "memdev": "/objects/memX",
6106 #                         "node": 0,
6107 #                         "size": 1073741824,
6108 #                         "slot": 0},
6109 #                    "type": "dimm"
6110 #                  } ] }
6113 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
6116 # @ACPISlotType:
6118 # @DIMM: memory slot
6119 # @CPU: logical CPU slot (since 2.7)
6121 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
6124 # @ACPIOSTInfo:
6126 # OSPM Status Indication for a device
6127 # For description of possible values of @source and @status fields
6128 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
6130 # @device: device ID associated with slot
6132 # @slot: slot ID, unique per slot of a given @slot-type
6134 # @slot-type: type of the slot
6136 # @source: an integer containing the source event
6138 # @status: an integer containing the status code
6140 # Since: 2.1
6142 { 'struct': 'ACPIOSTInfo',
6143   'data'  : { '*device': 'str',
6144               'slot': 'str',
6145               'slot-type': 'ACPISlotType',
6146               'source': 'int',
6147               'status': 'int' } }
6150 # @query-acpi-ospm-status:
6152 # Return a list of ACPIOSTInfo for devices that support status
6153 # reporting via ACPI _OST method.
6155 # Since: 2.1
6157 # Example:
6159 # -> { "execute": "query-acpi-ospm-status" }
6160 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
6161 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
6162 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
6163 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
6164 #    ]}
6167 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
6170 # @WatchdogExpirationAction:
6172 # An enumeration of the actions taken when the watchdog device's timer is
6173 # expired
6175 # @reset: system resets
6177 # @shutdown: system shutdown, note that it is similar to @powerdown, which
6178 #            tries to set to system status and notify guest
6180 # @poweroff: system poweroff, the emulator program exits
6182 # @pause: system pauses, similar to @stop
6184 # @debug: system enters debug state
6186 # @none: nothing is done
6188 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
6189 #              VCPUS on x86) (since 2.4)
6191 # Since: 2.1
6193 { 'enum': 'WatchdogExpirationAction',
6194   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
6195             'inject-nmi' ] }
6198 # @IoOperationType:
6200 # An enumeration of the I/O operation types
6202 # @read: read operation
6204 # @write: write operation
6206 # Since: 2.1
6208 { 'enum': 'IoOperationType',
6209   'data': [ 'read', 'write' ] }
6212 # @GuestPanicAction:
6214 # An enumeration of the actions taken when guest OS panic is detected
6216 # @pause: system pauses
6218 # Since: 2.1 (poweroff since 2.8)
6220 { 'enum': 'GuestPanicAction',
6221   'data': [ 'pause', 'poweroff' ] }
6224 # @GuestPanicInformationType:
6226 # An enumeration of the guest panic information types
6228 # Since: 2.9
6230 { 'enum': 'GuestPanicInformationType',
6231   'data': [ 'hyper-v'] }
6234 # @GuestPanicInformation:
6236 # Information about a guest panic
6238 # Since: 2.9
6240 {'union': 'GuestPanicInformation',
6241  'base': {'type': 'GuestPanicInformationType'},
6242  'discriminator': 'type',
6243  'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
6246 # @GuestPanicInformationHyperV:
6248 # Hyper-V specific guest panic information (HV crash MSRs)
6250 # Since: 2.9
6252 {'struct': 'GuestPanicInformationHyperV',
6253  'data': { 'arg1': 'uint64',
6254            'arg2': 'uint64',
6255            'arg3': 'uint64',
6256            'arg4': 'uint64',
6257            'arg5': 'uint64' } }
6260 # @rtc-reset-reinjection:
6262 # This command will reset the RTC interrupt reinjection backlog.
6263 # Can be used if another mechanism to synchronize guest time
6264 # is in effect, for example QEMU guest agent's guest-set-time
6265 # command.
6267 # Since: 2.1
6269 # Example:
6271 # -> { "execute": "rtc-reset-reinjection" }
6272 # <- { "return": {} }
6275 { 'command': 'rtc-reset-reinjection' }
6278 # @ReplayMode:
6280 # Mode of the replay subsystem.
6282 # @none: normal execution mode. Replay or record are not enabled.
6284 # @record: record mode. All non-deterministic data is written into the
6285 #          replay log.
6287 # @play: replay mode. Non-deterministic data required for system execution
6288 #        is read from the log.
6290 # Since: 2.5
6292 { 'enum': 'ReplayMode',
6293   'data': [ 'none', 'record', 'play' ] }
6296 # @xen-load-devices-state:
6298 # Load the state of all devices from file. The RAM and the block devices
6299 # of the VM are not loaded by this command.
6301 # @filename: the file to load the state of the devices from as binary
6302 # data. See xen-save-devices-state.txt for a description of the binary
6303 # format.
6305 # Since: 2.7
6307 # Example:
6309 # -> { "execute": "xen-load-devices-state",
6310 #      "arguments": { "filename": "/tmp/resume" } }
6311 # <- { "return": {} }
6314 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
6317 # @xen-set-replication:
6319 # Enable or disable replication.
6321 # @enable: true to enable, false to disable.
6323 # @primary: true for primary or false for secondary.
6325 # @failover: true to do failover, false to stop. but cannot be
6326 #            specified if 'enable' is true. default value is false.
6328 # Returns: nothing.
6330 # Example:
6332 # -> { "execute": "xen-set-replication",
6333 #      "arguments": {"enable": true, "primary": false} }
6334 # <- { "return": {} }
6336 # Since: 2.9
6338 { 'command': 'xen-set-replication',
6339   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
6342 # @ReplicationStatus:
6344 # The result format for 'query-xen-replication-status'.
6346 # @error: true if an error happened, false if replication is normal.
6348 # @desc: the human readable error description string, when
6349 #        @error is 'true'.
6351 # Since: 2.9
6353 { 'struct': 'ReplicationStatus',
6354   'data': { 'error': 'bool', '*desc': 'str' } }
6357 # @query-xen-replication-status:
6359 # Query replication status while the vm is running.
6361 # Returns: A @ReplicationResult object showing the status.
6363 # Example:
6365 # -> { "execute": "query-xen-replication-status" }
6366 # <- { "return": { "error": false } }
6368 # Since: 2.9
6370 { 'command': 'query-xen-replication-status',
6371   'returns': 'ReplicationStatus' }
6374 # @xen-colo-do-checkpoint:
6376 # Xen uses this command to notify replication to trigger a checkpoint.
6378 # Returns: nothing.
6380 # Example:
6382 # -> { "execute": "xen-colo-do-checkpoint" }
6383 # <- { "return": {} }
6385 # Since: 2.9
6387 { 'command': 'xen-colo-do-checkpoint' }
6390 # @GICCapability:
6392 # The struct describes capability for a specific GIC (Generic
6393 # Interrupt Controller) version. These bits are not only decided by
6394 # QEMU/KVM software version, but also decided by the hardware that
6395 # the program is running upon.
6397 # @version:  version of GIC to be described. Currently, only 2 and 3
6398 #            are supported.
6400 # @emulated: whether current QEMU/hardware supports emulated GIC
6401 #            device in user space.
6403 # @kernel:   whether current QEMU/hardware supports hardware
6404 #            accelerated GIC device in kernel.
6406 # Since: 2.6
6408 { 'struct': 'GICCapability',
6409   'data': { 'version': 'int',
6410             'emulated': 'bool',
6411             'kernel': 'bool' } }
6414 # @query-gic-capabilities:
6416 # This command is ARM-only. It will return a list of GICCapability
6417 # objects that describe its capability bits.
6419 # Returns: a list of GICCapability objects.
6421 # Since: 2.6
6423 # Example:
6425 # -> { "execute": "query-gic-capabilities" }
6426 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
6427 #                 { "version": 3, "emulated": false, "kernel": true } ] }
6430 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
6433 # @CpuInstanceProperties:
6435 # List of properties to be used for hotplugging a CPU instance,
6436 # it should be passed by management with device_add command when
6437 # a CPU is being hotplugged.
6439 # @node-id: NUMA node ID the CPU belongs to
6440 # @socket-id: socket number within node/board the CPU belongs to
6441 # @core-id: core number within socket the CPU belongs to
6442 # @thread-id: thread number within core the CPU belongs to
6444 # Note: currently there are 4 properties that could be present
6445 # but management should be prepared to pass through other
6446 # properties with device_add command to allow for future
6447 # interface extension. This also requires the filed names to be kept in
6448 # sync with the properties passed to -device/device_add.
6450 # Since: 2.7
6452 { 'struct': 'CpuInstanceProperties',
6453   'data': { '*node-id': 'int',
6454             '*socket-id': 'int',
6455             '*core-id': 'int',
6456             '*thread-id': 'int'
6457   }
6461 # @HotpluggableCPU:
6463 # @type: CPU object type for usage with device_add command
6464 # @props: list of properties to be used for hotplugging CPU
6465 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6466 # @qom-path: link to existing CPU object if CPU is present or
6467 #            omitted if CPU is not present.
6469 # Since: 2.7
6471 { 'struct': 'HotpluggableCPU',
6472   'data': { 'type': 'str',
6473             'vcpus-count': 'int',
6474             'props': 'CpuInstanceProperties',
6475             '*qom-path': 'str'
6476           }
6480 # @query-hotpluggable-cpus:
6482 # Returns: a list of HotpluggableCPU objects.
6484 # Since: 2.7
6486 # Example:
6488 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6490 # -> { "execute": "query-hotpluggable-cpus" }
6491 # <- {"return": [
6492 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6493 #        "vcpus-count": 1 },
6494 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6495 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6496 #    ]}'
6498 # For pc machine type started with -smp 1,maxcpus=2:
6500 # -> { "execute": "query-hotpluggable-cpus" }
6501 # <- {"return": [
6502 #      {
6503 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6504 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6505 #      },
6506 #      {
6507 #         "qom-path": "/machine/unattached/device[0]",
6508 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6509 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6510 #      }
6511 #    ]}
6514 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
6517 # @GuidInfo:
6519 # GUID information.
6521 # @guid: the globally unique identifier
6523 # Since: 2.9
6525 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
6528 # @query-vm-generation-id:
6530 # Show Virtual Machine Generation ID
6532 # Since 2.9
6534 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }