exec: use qemu_ram_ptr_length to access guest ram
[qemu/ar7.git] / qapi-schema.json
blobab438ead70f20a88b49524bab66b06056a15b9fb
1 # -*- Mode: Python -*-
2 ##
3 # = Introduction
5 # This document describes all commands currently supported by QMP.
7 # Most of the time their usage is exactly the same as in the user Monitor, this
8 # means that any other document which also describe commands (the manpage,
9 # QEMU's manual, etc) can and should be consulted.
11 # QMP has two types of commands: regular and query commands. Regular commands
12 # usually change the Virtual Machine's state someway, while query commands just
13 # return information. The sections below are divided accordingly.
15 # It's important to observe that all communication examples are formatted in
16 # a reader-friendly way, so that they're easier to understand. However, in real
17 # protocol usage, they're emitted as a single line.
19 # Also, the following notation is used to denote data flow:
21 # Example:
23 # | -> data issued by the Client
24 # | <- Server data response
26 # Please, refer to the QMP specification (docs/qmp-spec.txt) for
27 # detailed information on the Server command and response formats.
29 # = Stability Considerations
31 # The current QMP command set (described in this file) may be useful for a
32 # number of use cases, however it's limited and several commands have bad
33 # defined semantics, specially with regard to command completion.
35 # These problems are going to be solved incrementally in the next QEMU releases
36 # and we're going to establish a deprecation policy for badly defined commands.
38 # If you're planning to adopt QMP, please observe the following:
40 #     1. The deprecation policy will take effect and be documented soon, please
41 #        check the documentation of each used command as soon as a new release of
42 #        QEMU is available
44 #     2. DO NOT rely on anything which is not explicit documented
46 #     3. Errors, in special, are not documented. Applications should NOT check
47 #        for specific errors classes or data (it's strongly recommended to only
48 #        check for the "error" key)
52 { 'pragma': { 'doc-required': true } }
54 # Whitelists to permit QAPI rule violations; think twice before you
55 # add to them!
56 { 'pragma': {
57     # Commands allowed to return a non-dictionary:
58     'returns-whitelist': [
59         'human-monitor-command',
60         'qom-get',
61         'query-migrate-cache-size',
62         'query-tpm-models',
63         'query-tpm-types',
64         'ringbuf-read' ],
65     'name-case-whitelist': [
66         'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
67         'CpuInfoMIPS',          # PC, visible through query-cpu
68         'CpuInfoTricore',       # PC, visible through query-cpu
69         'QapiErrorClass',       # all members, visible through errors
70         'UuidInfo',             # UUID, visible through query-uuid
71         'X86CPURegister32',     # all members, visible indirectly through qom-get
72         'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
73     ] } }
75 # QAPI common definitions
76 { 'include': 'qapi/common.json' }
78 # QAPI crypto definitions
79 { 'include': 'qapi/crypto.json' }
81 # QAPI block definitions
82 { 'include': 'qapi/block.json' }
84 # QAPI event definitions
85 { 'include': 'qapi/event.json' }
87 # Tracing commands
88 { 'include': 'qapi/trace.json' }
90 # QAPI introspection
91 { 'include': 'qapi/introspect.json' }
94 # = QMP commands
98 # @qmp_capabilities:
100 # Enable QMP capabilities.
102 # Arguments: None.
104 # Example:
106 # -> { "execute": "qmp_capabilities" }
107 # <- { "return": {} }
109 # Notes: This command is valid exactly when first connecting: it must be
110 # issued before any other command will be accepted, and will fail once the
111 # monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
113 # Since: 0.13
116 { 'command': 'qmp_capabilities' }
119 # @LostTickPolicy:
121 # Policy for handling lost ticks in timer devices.
123 # @discard: throw away the missed tick(s) and continue with future injection
124 #           normally.  Guest time may be delayed, unless the OS has explicit
125 #           handling of lost ticks
127 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
128 #         delayed due to the late tick
130 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
131 #         may be delayed, depending on how the OS reacts to the merging
132 #         of ticks
134 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
135 #        guest time should not be delayed once catchup is complete.
137 # Since: 2.0
139 { 'enum': 'LostTickPolicy',
140   'data': ['discard', 'delay', 'merge', 'slew' ] }
143 # @add_client:
145 # Allow client connections for VNC, Spice and socket based
146 # character devices to be passed in to QEMU via SCM_RIGHTS.
148 # @protocol: protocol name. Valid names are "vnc", "spice" or the
149 #            name of a character device (eg. from -chardev id=XXXX)
151 # @fdname: file descriptor name previously passed via 'getfd' command
153 # @skipauth: whether to skip authentication. Only applies
154 #            to "vnc" and "spice" protocols
156 # @tls: whether to perform TLS. Only applies to the "spice"
157 #       protocol
159 # Returns: nothing on success.
161 # Since: 0.14.0
163 # Example:
165 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
166 #                                              "fdname": "myclient" } }
167 # <- { "return": {} }
170 { 'command': 'add_client',
171   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
172             '*tls': 'bool' } }
175 # @NameInfo:
177 # Guest name information.
179 # @name: The name of the guest
181 # Since: 0.14.0
183 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
186 # @query-name:
188 # Return the name information of a guest.
190 # Returns: @NameInfo of the guest
192 # Since: 0.14.0
194 # Example:
196 # -> { "execute": "query-name" }
197 # <- { "return": { "name": "qemu-name" } }
200 { 'command': 'query-name', 'returns': 'NameInfo' }
203 # @KvmInfo:
205 # Information about support for KVM acceleration
207 # @enabled: true if KVM acceleration is active
209 # @present: true if KVM acceleration is built into this executable
211 # Since: 0.14.0
213 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
216 # @query-kvm:
218 # Returns information about KVM acceleration
220 # Returns: @KvmInfo
222 # Since: 0.14.0
224 # Example:
226 # -> { "execute": "query-kvm" }
227 # <- { "return": { "enabled": true, "present": true } }
230 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
233 # @RunState:
235 # An enumeration of VM run states.
237 # @debug: QEMU is running on a debugger
239 # @finish-migrate: guest is paused to finish the migration process
241 # @inmigrate: guest is paused waiting for an incoming migration.  Note
242 # that this state does not tell whether the machine will start at the
243 # end of the migration.  This depends on the command-line -S option and
244 # any invocation of 'stop' or 'cont' that has happened since QEMU was
245 # started.
247 # @internal-error: An internal error that prevents further guest execution
248 # has occurred
250 # @io-error: the last IOP has failed and the device is configured to pause
251 # on I/O errors
253 # @paused: guest has been paused via the 'stop' command
255 # @postmigrate: guest is paused following a successful 'migrate'
257 # @prelaunch: QEMU was started with -S and guest has not started
259 # @restore-vm: guest is paused to restore VM state
261 # @running: guest is actively running
263 # @save-vm: guest is paused to save the VM state
265 # @shutdown: guest is shut down (and -no-shutdown is in use)
267 # @suspended: guest is suspended (ACPI S3)
269 # @watchdog: the watchdog action is configured to pause and has been triggered
271 # @guest-panicked: guest has been panicked as a result of guest OS panic
273 # @colo: guest is paused to save/restore VM state under colo checkpoint,
274 #        VM can not get into this state unless colo capability is enabled
275 #        for migration. (since 2.8)
277 { 'enum': 'RunState',
278   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
279             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
280             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
281             'guest-panicked', 'colo' ] }
284 # @StatusInfo:
286 # Information about VCPU run state
288 # @running: true if all VCPUs are runnable, false if not runnable
290 # @singlestep: true if VCPUs are in single-step mode
292 # @status: the virtual machine @RunState
294 # Since:  0.14.0
296 # Notes: @singlestep is enabled through the GDB stub
298 { 'struct': 'StatusInfo',
299   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
302 # @query-status:
304 # Query the run status of all VCPUs
306 # Returns: @StatusInfo reflecting all VCPUs
308 # Since:  0.14.0
310 # Example:
312 # -> { "execute": "query-status" }
313 # <- { "return": { "running": true,
314 #                  "singlestep": false,
315 #                  "status": "running" } }
318 { 'command': 'query-status', 'returns': 'StatusInfo' }
321 # @UuidInfo:
323 # Guest UUID information (Universally Unique Identifier).
325 # @UUID: the UUID of the guest
327 # Since: 0.14.0
329 # Notes: If no UUID was specified for the guest, a null UUID is returned.
331 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
334 # @query-uuid:
336 # Query the guest UUID information.
338 # Returns: The @UuidInfo for the guest
340 # Since: 0.14.0
342 # Example:
344 # -> { "execute": "query-uuid" }
345 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
348 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
351 # @ChardevInfo:
353 # Information about a character device.
355 # @label: the label of the character device
357 # @filename: the filename of the character device
359 # @frontend-open: shows whether the frontend device attached to this backend
360 #                 (eg. with the chardev=... option) is in open or closed state
361 #                 (since 2.1)
363 # Notes: @filename is encoded using the QEMU command line character device
364 #        encoding.  See the QEMU man page for details.
366 # Since: 0.14.0
368 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
369                                   'filename': 'str',
370                                   'frontend-open': 'bool'} }
373 # @query-chardev:
375 # Returns information about current character devices.
377 # Returns: a list of @ChardevInfo
379 # Since: 0.14.0
381 # Example:
383 # -> { "execute": "query-chardev" }
384 # <- {
385 #       "return": [
386 #          {
387 #             "label": "charchannel0",
388 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
389 #             "frontend-open": false
390 #          },
391 #          {
392 #             "label": "charmonitor",
393 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
394 #             "frontend-open": true
395 #          },
396 #          {
397 #             "label": "charserial0",
398 #             "filename": "pty:/dev/pts/2",
399 #             "frontend-open": true
400 #          }
401 #       ]
402 #    }
405 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
408 # @ChardevBackendInfo:
410 # Information about a character device backend
412 # @name: The backend name
414 # Since: 2.0
416 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
419 # @query-chardev-backends:
421 # Returns information about character device backends.
423 # Returns: a list of @ChardevBackendInfo
425 # Since: 2.0
427 # Example:
429 # -> { "execute": "query-chardev-backends" }
430 # <- {
431 #       "return":[
432 #          {
433 #             "name":"udp"
434 #          },
435 #          {
436 #             "name":"tcp"
437 #          },
438 #          {
439 #             "name":"unix"
440 #          },
441 #          {
442 #             "name":"spiceport"
443 #          }
444 #       ]
445 #    }
448 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
451 # @DataFormat:
453 # An enumeration of data format.
455 # @utf8: Data is a UTF-8 string (RFC 3629)
457 # @base64: Data is Base64 encoded binary (RFC 3548)
459 # Since: 1.4
461 { 'enum': 'DataFormat',
462   'data': [ 'utf8', 'base64' ] }
465 # @ringbuf-write:
467 # Write to a ring buffer character device.
469 # @device: the ring buffer character device name
471 # @data: data to write
473 # @format: data encoding (default 'utf8').
474 #          - base64: data must be base64 encoded text.  Its binary
475 #            decoding gets written.
476 #          - utf8: data's UTF-8 encoding is written
477 #          - data itself is always Unicode regardless of format, like
478 #            any other string.
480 # Returns: Nothing on success
482 # Since: 1.4
484 # Example:
486 # -> { "execute": "ringbuf-write",
487 #      "arguments": { "device": "foo",
488 #                     "data": "abcdefgh",
489 #                     "format": "utf8" } }
490 # <- { "return": {} }
493 { 'command': 'ringbuf-write',
494   'data': {'device': 'str', 'data': 'str',
495            '*format': 'DataFormat'} }
498 # @ringbuf-read:
500 # Read from a ring buffer character device.
502 # @device: the ring buffer character device name
504 # @size: how many bytes to read at most
506 # @format: data encoding (default 'utf8').
507 #          - base64: the data read is returned in base64 encoding.
508 #          - utf8: the data read is interpreted as UTF-8.
509 #            Bug: can screw up when the buffer contains invalid UTF-8
510 #            sequences, NUL characters, after the ring buffer lost
511 #            data, and when reading stops because the size limit is
512 #            reached.
513 #          - The return value is always Unicode regardless of format,
514 #            like any other string.
516 # Returns: data read from the device
518 # Since: 1.4
520 # Example:
522 # -> { "execute": "ringbuf-read",
523 #      "arguments": { "device": "foo",
524 #                     "size": 1000,
525 #                     "format": "utf8" } }
526 # <- { "return": "abcdefgh" }
529 { 'command': 'ringbuf-read',
530   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
531   'returns': 'str' }
534 # @EventInfo:
536 # Information about a QMP event
538 # @name: The event name
540 # Since: 1.2.0
542 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
545 # @query-events:
547 # Return a list of supported QMP events by this server
549 # Returns: A list of @EventInfo for all supported events
551 # Since: 1.2.0
553 # Example:
555 # -> { "execute": "query-events" }
556 # <- {
557 #      "return": [
558 #          {
559 #             "name":"SHUTDOWN"
560 #          },
561 #          {
562 #             "name":"RESET"
563 #          }
564 #       ]
565 #    }
567 # Note: This example has been shortened as the real response is too long.
570 { 'command': 'query-events', 'returns': ['EventInfo'] }
573 # @MigrationStats:
575 # Detailed migration status.
577 # @transferred: amount of bytes already transferred to the target VM
579 # @remaining: amount of bytes remaining to be transferred to the target VM
581 # @total: total amount of bytes involved in the migration process
583 # @duplicate: number of duplicate (zero) pages (since 1.2)
585 # @skipped: number of skipped zero pages (since 1.5)
587 # @normal: number of normal pages (since 1.2)
589 # @normal-bytes: number of normal bytes sent (since 1.2)
591 # @dirty-pages-rate: number of pages dirtied by second by the
592 #        guest (since 1.3)
594 # @mbps: throughput in megabits/sec. (since 1.6)
596 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
598 # @postcopy-requests: The number of page requests received from the destination
599 #        (since 2.7)
601 # @page-size: The number of bytes per page for the various page-based
602 #        statistics (since 2.10)
604 # Since: 0.14.0
606 { 'struct': 'MigrationStats',
607   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
608            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
609            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
610            'mbps' : 'number', 'dirty-sync-count' : 'int',
611            'postcopy-requests' : 'int', 'page-size' : 'int' } }
614 # @XBZRLECacheStats:
616 # Detailed XBZRLE migration cache statistics
618 # @cache-size: XBZRLE cache size
620 # @bytes: amount of bytes already transferred to the target VM
622 # @pages: amount of pages transferred to the target VM
624 # @cache-miss: number of cache miss
626 # @cache-miss-rate: rate of cache miss (since 2.1)
628 # @overflow: number of overflows
630 # Since: 1.2
632 { 'struct': 'XBZRLECacheStats',
633   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
634            'cache-miss': 'int', 'cache-miss-rate': 'number',
635            'overflow': 'int' } }
638 # @MigrationStatus:
640 # An enumeration of migration status.
642 # @none: no migration has ever happened.
644 # @setup: migration process has been initiated.
646 # @cancelling: in the process of cancelling migration.
648 # @cancelled: cancelling migration is finished.
650 # @active: in the process of doing migration.
652 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
654 # @completed: migration is finished.
656 # @failed: some error occurred during migration process.
658 # @colo: VM is in the process of fault tolerance, VM can not get into this
659 #        state unless colo capability is enabled for migration. (since 2.8)
661 # Since: 2.3
664 { 'enum': 'MigrationStatus',
665   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
666             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
669 # @MigrationInfo:
671 # Information about current migration process.
673 # @status: @MigrationStatus describing the current migration status.
674 #          If this field is not returned, no migration process
675 #          has been initiated
677 # @ram: @MigrationStats containing detailed migration
678 #       status, only returned if status is 'active' or
679 #       'completed'(since 1.2)
681 # @disk: @MigrationStats containing detailed disk migration
682 #        status, only returned if status is 'active' and it is a block
683 #        migration
685 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
686 #                migration statistics, only returned if XBZRLE feature is on and
687 #                status is 'active' or 'completed' (since 1.2)
689 # @total-time: total amount of milliseconds since migration started.
690 #        If migration has ended, it returns the total migration
691 #        time. (since 1.2)
693 # @downtime: only present when migration finishes correctly
694 #        total downtime in milliseconds for the guest.
695 #        (since 1.3)
697 # @expected-downtime: only present while migration is active
698 #        expected downtime in milliseconds for the guest in last walk
699 #        of the dirty bitmap. (since 1.3)
701 # @setup-time: amount of setup time in milliseconds _before_ the
702 #        iterations begin but _after_ the QMP command is issued. This is designed
703 #        to provide an accounting of any activities (such as RDMA pinning) which
704 #        may be expensive, but do not actually occur during the iterative
705 #        migration rounds themselves. (since 1.6)
707 # @cpu-throttle-percentage: percentage of time guest cpus are being
708 #        throttled during auto-converge. This is only present when auto-converge
709 #        has started throttling guest cpus. (Since 2.7)
711 # @error-desc: the human readable error description string, when
712 #              @status is 'failed'. Clients should not attempt to parse the
713 #              error strings. (Since 2.7)
715 # Since: 0.14.0
717 { 'struct': 'MigrationInfo',
718   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
719            '*disk': 'MigrationStats',
720            '*xbzrle-cache': 'XBZRLECacheStats',
721            '*total-time': 'int',
722            '*expected-downtime': 'int',
723            '*downtime': 'int',
724            '*setup-time': 'int',
725            '*cpu-throttle-percentage': 'int',
726            '*error-desc': 'str'} }
729 # @query-migrate:
731 # Returns information about current migration process. If migration
732 # is active there will be another json-object with RAM migration
733 # status and if block migration is active another one with block
734 # migration status.
736 # Returns: @MigrationInfo
738 # Since: 0.14.0
740 # Example:
742 # 1. Before the first migration
744 # -> { "execute": "query-migrate" }
745 # <- { "return": {} }
747 # 2. Migration is done and has succeeded
749 # -> { "execute": "query-migrate" }
750 # <- { "return": {
751 #         "status": "completed",
752 #         "ram":{
753 #           "transferred":123,
754 #           "remaining":123,
755 #           "total":246,
756 #           "total-time":12345,
757 #           "setup-time":12345,
758 #           "downtime":12345,
759 #           "duplicate":123,
760 #           "normal":123,
761 #           "normal-bytes":123456,
762 #           "dirty-sync-count":15
763 #         }
764 #      }
765 #    }
767 # 3. Migration is done and has failed
769 # -> { "execute": "query-migrate" }
770 # <- { "return": { "status": "failed" } }
772 # 4. Migration is being performed and is not a block migration:
774 # -> { "execute": "query-migrate" }
775 # <- {
776 #       "return":{
777 #          "status":"active",
778 #          "ram":{
779 #             "transferred":123,
780 #             "remaining":123,
781 #             "total":246,
782 #             "total-time":12345,
783 #             "setup-time":12345,
784 #             "expected-downtime":12345,
785 #             "duplicate":123,
786 #             "normal":123,
787 #             "normal-bytes":123456,
788 #             "dirty-sync-count":15
789 #          }
790 #       }
791 #    }
793 # 5. Migration is being performed and is a block migration:
795 # -> { "execute": "query-migrate" }
796 # <- {
797 #       "return":{
798 #          "status":"active",
799 #          "ram":{
800 #             "total":1057024,
801 #             "remaining":1053304,
802 #             "transferred":3720,
803 #             "total-time":12345,
804 #             "setup-time":12345,
805 #             "expected-downtime":12345,
806 #             "duplicate":123,
807 #             "normal":123,
808 #             "normal-bytes":123456,
809 #             "dirty-sync-count":15
810 #          },
811 #          "disk":{
812 #             "total":20971520,
813 #             "remaining":20880384,
814 #             "transferred":91136
815 #          }
816 #       }
817 #    }
819 # 6. Migration is being performed and XBZRLE is active:
821 # -> { "execute": "query-migrate" }
822 # <- {
823 #       "return":{
824 #          "status":"active",
825 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
826 #          "ram":{
827 #             "total":1057024,
828 #             "remaining":1053304,
829 #             "transferred":3720,
830 #             "total-time":12345,
831 #             "setup-time":12345,
832 #             "expected-downtime":12345,
833 #             "duplicate":10,
834 #             "normal":3333,
835 #             "normal-bytes":3412992,
836 #             "dirty-sync-count":15
837 #          },
838 #          "xbzrle-cache":{
839 #             "cache-size":67108864,
840 #             "bytes":20971520,
841 #             "pages":2444343,
842 #             "cache-miss":2244,
843 #             "cache-miss-rate":0.123,
844 #             "overflow":34434
845 #          }
846 #       }
847 #    }
850 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
853 # @MigrationCapability:
855 # Migration capabilities enumeration
857 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
858 #          This feature allows us to minimize migration traffic for certain work
859 #          loads, by sending compressed difference of the pages
861 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
862 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
863 #          Disabled by default. (since 2.0)
865 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
866 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
867 #          source and target VM to support this feature. To enable it is sufficient
868 #          to enable the capability on the source VM. The feature is disabled by
869 #          default. (since 1.6)
871 # @compress: Use multiple compression threads to accelerate live migration.
872 #          This feature can help to reduce the migration traffic, by sending
873 #          compressed pages. Please note that if compress and xbzrle are both
874 #          on, compress only takes effect in the ram bulk stage, after that,
875 #          it will be disabled and only xbzrle takes effect, this can help to
876 #          minimize migration traffic. The feature is disabled by default.
877 #          (since 2.4 )
879 # @events: generate events for each migration state change
880 #          (since 2.4 )
882 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
883 #          to speed up convergence of RAM migration. (since 1.6)
885 # @postcopy-ram: Start executing on the migration target before all of RAM has
886 #          been migrated, pulling the remaining pages along as needed. NOTE: If
887 #          the migration fails during postcopy the VM will fail.  (since 2.6)
889 # @x-colo: If enabled, migration will never end, and the state of the VM on the
890 #        primary side will be migrated continuously to the VM on secondary
891 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
892 #        Non-stop Service. (since 2.8)
894 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
895 #        during postcopy-ram migration. (since 2.9)
897 # @block: If enabled, QEMU will also migrate the contents of all block
898 #          devices.  Default is disabled.  A possible alternative uses
899 #          mirror jobs to a builtin NBD server on the destination, which
900 #          offers more flexibility.
901 #          (Since 2.10)
903 # @return-path: If enabled, migration will use the return path even
904 #               for precopy. (since 2.10)
906 # Since: 1.2
908 { 'enum': 'MigrationCapability',
909   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
910            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
911            'block', 'return-path' ] }
914 # @MigrationCapabilityStatus:
916 # Migration capability information
918 # @capability: capability enum
920 # @state: capability state bool
922 # Since: 1.2
924 { 'struct': 'MigrationCapabilityStatus',
925   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
928 # @migrate-set-capabilities:
930 # Enable/Disable the following migration capabilities (like xbzrle)
932 # @capabilities: json array of capability modifications to make
934 # Since: 1.2
936 # Example:
938 # -> { "execute": "migrate-set-capabilities" , "arguments":
939 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
942 { 'command': 'migrate-set-capabilities',
943   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
946 # @query-migrate-capabilities:
948 # Returns information about the current migration capabilities status
950 # Returns: @MigrationCapabilitiesStatus
952 # Since: 1.2
954 # Example:
956 # -> { "execute": "query-migrate-capabilities" }
957 # <- { "return": [
958 #       {"state": false, "capability": "xbzrle"},
959 #       {"state": false, "capability": "rdma-pin-all"},
960 #       {"state": false, "capability": "auto-converge"},
961 #       {"state": false, "capability": "zero-blocks"},
962 #       {"state": false, "capability": "compress"},
963 #       {"state": true, "capability": "events"},
964 #       {"state": false, "capability": "postcopy-ram"},
965 #       {"state": false, "capability": "x-colo"}
966 #    ]}
969 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
972 # @MigrationParameter:
974 # Migration parameters enumeration
976 # @compress-level: Set the compression level to be used in live migration,
977 #          the compression level is an integer between 0 and 9, where 0 means
978 #          no compression, 1 means the best compression speed, and 9 means best
979 #          compression ratio which will consume more CPU.
981 # @compress-threads: Set compression thread count to be used in live migration,
982 #          the compression thread count is an integer between 1 and 255.
984 # @decompress-threads: Set decompression thread count to be used in live
985 #          migration, the decompression thread count is an integer between 1
986 #          and 255. Usually, decompression is at least 4 times as fast as
987 #          compression, so set the decompress-threads to the number about 1/4
988 #          of compress-threads is adequate.
990 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
991 #                        when migration auto-converge is activated. The
992 #                        default value is 20. (Since 2.7)
994 # @cpu-throttle-increment: throttle percentage increase each time
995 #                          auto-converge detects that migration is not making
996 #                          progress. The default value is 10. (Since 2.7)
998 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
999 #             establishing a TLS connection over the migration data channel.
1000 #             On the outgoing side of the migration, the credentials must
1001 #             be for a 'client' endpoint, while for the incoming side the
1002 #             credentials must be for a 'server' endpoint. Setting this
1003 #             will enable TLS for all migrations. The default is unset,
1004 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1006 # @tls-hostname: hostname of the target host for the migration. This is
1007 #                required when using x509 based TLS credentials and the
1008 #                migration URI does not already include a hostname. For
1009 #                example if using fd: or exec: based migration, the
1010 #                hostname must be provided so that the server's x509
1011 #                certificate identity can be validated. (Since 2.7)
1013 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1014 #                 bytes per second. (Since 2.8)
1016 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1017 #                  downtime in milliseconds (Since 2.8)
1019 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
1020 #          periodic mode. (Since 2.8)
1022 # @block-incremental: Affects how much storage is migrated when the
1023 #       block migration capability is enabled.  When false, the entire
1024 #       storage backing chain is migrated into a flattened image at
1025 #       the destination; when true, only the active qcow2 layer is
1026 #       migrated and the destination must already have access to the
1027 #       same backing chain as was used on the source.  (since 2.10)
1029 # Since: 2.4
1031 { 'enum': 'MigrationParameter',
1032   'data': ['compress-level', 'compress-threads', 'decompress-threads',
1033            'cpu-throttle-initial', 'cpu-throttle-increment',
1034            'tls-creds', 'tls-hostname', 'max-bandwidth',
1035            'downtime-limit', 'x-checkpoint-delay', 'block-incremental' ] }
1038 # @migrate-set-parameters:
1040 # Set various migration parameters.
1042 # Since: 2.4
1044 # Example:
1046 # -> { "execute": "migrate-set-parameters" ,
1047 #      "arguments": { "compress-level": 1 } }
1050 { 'command': 'migrate-set-parameters', 'boxed': true,
1051   'data': 'MigrationParameters' }
1054 # @MigrationParameters:
1056 # Optional members can be omitted on input ('migrate-set-parameters')
1057 # but most members will always be present on output
1058 # ('query-migrate-parameters'), with the exception of tls-creds and
1059 # tls-hostname.
1061 # @compress-level: compression level
1063 # @compress-threads: compression thread count
1065 # @decompress-threads: decompression thread count
1067 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1068 #                        throttledwhen migration auto-converge is activated.
1069 #                        The default value is 20. (Since 2.7)
1071 # @cpu-throttle-increment: throttle percentage increase each time
1072 #                          auto-converge detects that migration is not making
1073 #                          progress. The default value is 10. (Since 2.7)
1075 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1076 #             for establishing a TLS connection over the migration data
1077 #             channel. On the outgoing side of the migration, the credentials
1078 #             must be for a 'client' endpoint, while for the incoming side the
1079 #             credentials must be for a 'server' endpoint. Setting this
1080 #             will enable TLS for all migrations. The default is unset,
1081 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1082 #             An empty string means that QEMU will use plain text mode for
1083 #             migration, rather than TLS (Since 2.9)
1085 # @tls-hostname: hostname of the target host for the migration. This
1086 #                is required when using x509 based TLS credentials and the
1087 #                migration URI does not already include a hostname. For
1088 #                example if using fd: or exec: based migration, the
1089 #                hostname must be provided so that the server's x509
1090 #                certificate identity can be validated. (Since 2.7)
1091 #                An empty string means that QEMU will use the hostname
1092 #                associated with the migration URI, if any. (Since 2.9)
1094 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1095 #                 bytes per second. (Since 2.8)
1097 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1098 #                  downtime in milliseconds (Since 2.8)
1100 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1102 # @block-incremental: Affects how much storage is migrated when the
1103 #       block migration capability is enabled.  When false, the entire
1104 #       storage backing chain is migrated into a flattened image at
1105 #       the destination; when true, only the active qcow2 layer is
1106 #       migrated and the destination must already have access to the
1107 #       same backing chain as was used on the source.  (since 2.10)
1109 # Since: 2.4
1111 { 'struct': 'MigrationParameters',
1112   'data': { '*compress-level': 'int',
1113             '*compress-threads': 'int',
1114             '*decompress-threads': 'int',
1115             '*cpu-throttle-initial': 'int',
1116             '*cpu-throttle-increment': 'int',
1117             '*tls-creds': 'str',
1118             '*tls-hostname': 'str',
1119             '*max-bandwidth': 'int',
1120             '*downtime-limit': 'int',
1121             '*x-checkpoint-delay': 'int',
1122             '*block-incremental': 'bool' } }
1125 # @query-migrate-parameters:
1127 # Returns information about the current migration parameters
1129 # Returns: @MigrationParameters
1131 # Since: 2.4
1133 # Example:
1135 # -> { "execute": "query-migrate-parameters" }
1136 # <- { "return": {
1137 #          "decompress-threads": 2,
1138 #          "cpu-throttle-increment": 10,
1139 #          "compress-threads": 8,
1140 #          "compress-level": 1,
1141 #          "cpu-throttle-initial": 20,
1142 #          "max-bandwidth": 33554432,
1143 #          "downtime-limit": 300
1144 #       }
1145 #    }
1148 { 'command': 'query-migrate-parameters',
1149   'returns': 'MigrationParameters' }
1152 # @client_migrate_info:
1154 # Set migration information for remote display.  This makes the server
1155 # ask the client to automatically reconnect using the new parameters
1156 # once migration finished successfully.  Only implemented for SPICE.
1158 # @protocol:     must be "spice"
1159 # @hostname:     migration target hostname
1160 # @port:         spice tcp port for plaintext channels
1161 # @tls-port:     spice tcp port for tls-secured channels
1162 # @cert-subject: server certificate subject
1164 # Since: 0.14.0
1166 # Example:
1168 # -> { "execute": "client_migrate_info",
1169 #      "arguments": { "protocol": "spice",
1170 #                     "hostname": "virt42.lab.kraxel.org",
1171 #                     "port": 1234 } }
1172 # <- { "return": {} }
1175 { 'command': 'client_migrate_info',
1176   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1177             '*tls-port': 'int', '*cert-subject': 'str' } }
1180 # @migrate-start-postcopy:
1182 # Followup to a migration command to switch the migration to postcopy mode.
1183 # The postcopy-ram capability must be set before the original migration
1184 # command.
1186 # Since: 2.5
1188 # Example:
1190 # -> { "execute": "migrate-start-postcopy" }
1191 # <- { "return": {} }
1194 { 'command': 'migrate-start-postcopy' }
1197 # @COLOMessage:
1199 # The message transmission between Primary side and Secondary side.
1201 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1203 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1205 # @checkpoint-reply: SVM gets PVM's checkpoint request
1207 # @vmstate-send: VM's state will be sent by PVM.
1209 # @vmstate-size: The total size of VMstate.
1211 # @vmstate-received: VM's state has been received by SVM.
1213 # @vmstate-loaded: VM's state has been loaded by SVM.
1215 # Since: 2.8
1217 { 'enum': 'COLOMessage',
1218   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1219             'vmstate-send', 'vmstate-size', 'vmstate-received',
1220             'vmstate-loaded' ] }
1223 # @COLOMode:
1225 # The colo mode
1227 # @unknown: unknown mode
1229 # @primary: master side
1231 # @secondary: slave side
1233 # Since: 2.8
1235 { 'enum': 'COLOMode',
1236   'data': [ 'unknown', 'primary', 'secondary'] }
1239 # @FailoverStatus:
1241 # An enumeration of COLO failover status
1243 # @none: no failover has ever happened
1245 # @require: got failover requirement but not handled
1247 # @active: in the process of doing failover
1249 # @completed: finish the process of failover
1251 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1253 # Since: 2.8
1255 { 'enum': 'FailoverStatus',
1256   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1259 # @x-colo-lost-heartbeat:
1261 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1262 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1263 # If sent to the Secondary, the Secondary side will run failover work,
1264 # then takes over server operation to become the service VM.
1266 # Since: 2.8
1268 # Example:
1270 # -> { "execute": "x-colo-lost-heartbeat" }
1271 # <- { "return": {} }
1274 { 'command': 'x-colo-lost-heartbeat' }
1277 # @MouseInfo:
1279 # Information about a mouse device.
1281 # @name: the name of the mouse device
1283 # @index: the index of the mouse device
1285 # @current: true if this device is currently receiving mouse events
1287 # @absolute: true if this device supports absolute coordinates as input
1289 # Since: 0.14.0
1291 { 'struct': 'MouseInfo',
1292   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1293            'absolute': 'bool'} }
1296 # @query-mice:
1298 # Returns information about each active mouse device
1300 # Returns: a list of @MouseInfo for each device
1302 # Since: 0.14.0
1304 # Example:
1306 # -> { "execute": "query-mice" }
1307 # <- { "return": [
1308 #          {
1309 #             "name":"QEMU Microsoft Mouse",
1310 #             "index":0,
1311 #             "current":false,
1312 #             "absolute":false
1313 #          },
1314 #          {
1315 #             "name":"QEMU PS/2 Mouse",
1316 #             "index":1,
1317 #             "current":true,
1318 #             "absolute":true
1319 #          }
1320 #       ]
1321 #    }
1324 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1327 # @CpuInfoArch:
1329 # An enumeration of cpu types that enable additional information during
1330 # @query-cpus.
1332 # Since: 2.6
1334 { 'enum': 'CpuInfoArch',
1335   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1338 # @CpuInfo:
1340 # Information about a virtual CPU
1342 # @CPU: the index of the virtual CPU
1344 # @current: this only exists for backwards compatibility and should be ignored
1346 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1347 #          to a processor specific low power mode.
1349 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1351 # @thread_id: ID of the underlying host thread
1353 # @props: properties describing to which node/socket/core/thread
1354 #         virtual CPU belongs to, provided if supported by board (since 2.10)
1356 # @arch: architecture of the cpu, which determines which additional fields
1357 #        will be listed (since 2.6)
1359 # Since: 0.14.0
1361 # Notes: @halted is a transient state that changes frequently.  By the time the
1362 #        data is sent to the client, the guest may no longer be halted.
1364 { 'union': 'CpuInfo',
1365   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1366            'qom_path': 'str', 'thread_id': 'int',
1367            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
1368   'discriminator': 'arch',
1369   'data': { 'x86': 'CpuInfoX86',
1370             'sparc': 'CpuInfoSPARC',
1371             'ppc': 'CpuInfoPPC',
1372             'mips': 'CpuInfoMIPS',
1373             'tricore': 'CpuInfoTricore',
1374             'other': 'CpuInfoOther' } }
1377 # @CpuInfoX86:
1379 # Additional information about a virtual i386 or x86_64 CPU
1381 # @pc: the 64-bit instruction pointer
1383 # Since: 2.6
1385 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1388 # @CpuInfoSPARC:
1390 # Additional information about a virtual SPARC CPU
1392 # @pc: the PC component of the instruction pointer
1394 # @npc: the NPC component of the instruction pointer
1396 # Since: 2.6
1398 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1401 # @CpuInfoPPC:
1403 # Additional information about a virtual PPC CPU
1405 # @nip: the instruction pointer
1407 # Since: 2.6
1409 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1412 # @CpuInfoMIPS:
1414 # Additional information about a virtual MIPS CPU
1416 # @PC: the instruction pointer
1418 # Since: 2.6
1420 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1423 # @CpuInfoTricore:
1425 # Additional information about a virtual Tricore CPU
1427 # @PC: the instruction pointer
1429 # Since: 2.6
1431 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1434 # @CpuInfoOther:
1436 # No additional information is available about the virtual CPU
1438 # Since: 2.6
1441 { 'struct': 'CpuInfoOther', 'data': { } }
1444 # @query-cpus:
1446 # Returns a list of information about each virtual CPU.
1448 # Returns: a list of @CpuInfo for each virtual CPU
1450 # Since: 0.14.0
1452 # Example:
1454 # -> { "execute": "query-cpus" }
1455 # <- { "return": [
1456 #          {
1457 #             "CPU":0,
1458 #             "current":true,
1459 #             "halted":false,
1460 #             "qom_path":"/machine/unattached/device[0]",
1461 #             "arch":"x86",
1462 #             "pc":3227107138,
1463 #             "thread_id":3134
1464 #          },
1465 #          {
1466 #             "CPU":1,
1467 #             "current":false,
1468 #             "halted":true,
1469 #             "qom_path":"/machine/unattached/device[2]",
1470 #             "arch":"x86",
1471 #             "pc":7108165,
1472 #             "thread_id":3135
1473 #          }
1474 #       ]
1475 #    }
1478 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1481 # @IOThreadInfo:
1483 # Information about an iothread
1485 # @id: the identifier of the iothread
1487 # @thread-id: ID of the underlying host thread
1489 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1490 #               (since 2.9)
1492 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1493 #             configured (since 2.9)
1495 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1496 #               it's not configured (since 2.9)
1498 # Since: 2.0
1500 { 'struct': 'IOThreadInfo',
1501   'data': {'id': 'str',
1502            'thread-id': 'int',
1503            'poll-max-ns': 'int',
1504            'poll-grow': 'int',
1505            'poll-shrink': 'int' } }
1508 # @query-iothreads:
1510 # Returns a list of information about each iothread.
1512 # Note: this list excludes the QEMU main loop thread, which is not declared
1513 # using the -object iothread command-line option.  It is always the main thread
1514 # of the process.
1516 # Returns: a list of @IOThreadInfo for each iothread
1518 # Since: 2.0
1520 # Example:
1522 # -> { "execute": "query-iothreads" }
1523 # <- { "return": [
1524 #          {
1525 #             "id":"iothread0",
1526 #             "thread-id":3134
1527 #          },
1528 #          {
1529 #             "id":"iothread1",
1530 #             "thread-id":3135
1531 #          }
1532 #       ]
1533 #    }
1536 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1539 # @NetworkAddressFamily:
1541 # The network address family
1543 # @ipv4: IPV4 family
1545 # @ipv6: IPV6 family
1547 # @unix: unix socket
1549 # @vsock: vsock family (since 2.8)
1551 # @unknown: otherwise
1553 # Since: 2.1
1555 { 'enum': 'NetworkAddressFamily',
1556   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1559 # @VncBasicInfo:
1561 # The basic information for vnc network connection
1563 # @host: IP address
1565 # @service: The service name of the vnc port. This may depend on the host
1566 #           system's service database so symbolic names should not be relied
1567 #           on.
1569 # @family: address family
1571 # @websocket: true in case the socket is a websocket (since 2.3).
1573 # Since: 2.1
1575 { 'struct': 'VncBasicInfo',
1576   'data': { 'host': 'str',
1577             'service': 'str',
1578             'family': 'NetworkAddressFamily',
1579             'websocket': 'bool' } }
1582 # @VncServerInfo:
1584 # The network connection information for server
1586 # @auth: authentication method used for
1587 #        the plain (non-websocket) VNC server
1589 # Since: 2.1
1591 { 'struct': 'VncServerInfo',
1592   'base': 'VncBasicInfo',
1593   'data': { '*auth': 'str' } }
1596 # @VncClientInfo:
1598 # Information about a connected VNC client.
1600 # @x509_dname: If x509 authentication is in use, the Distinguished
1601 #              Name of the client.
1603 # @sasl_username: If SASL authentication is in use, the SASL username
1604 #                 used for authentication.
1606 # Since: 0.14.0
1608 { 'struct': 'VncClientInfo',
1609   'base': 'VncBasicInfo',
1610   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1613 # @VncInfo:
1615 # Information about the VNC session.
1617 # @enabled: true if the VNC server is enabled, false otherwise
1619 # @host: The hostname the VNC server is bound to.  This depends on
1620 #        the name resolution on the host and may be an IP address.
1622 # @family: 'ipv6' if the host is listening for IPv6 connections
1623 #                    'ipv4' if the host is listening for IPv4 connections
1624 #                    'unix' if the host is listening on a unix domain socket
1625 #                    'unknown' otherwise
1627 # @service: The service name of the server's port.  This may depends
1628 #           on the host system's service database so symbolic names should not
1629 #           be relied on.
1631 # @auth: the current authentication type used by the server
1632 #        'none' if no authentication is being used
1633 #        'vnc' if VNC authentication is being used
1634 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1635 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1636 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1637 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1638 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1639 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1640 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1641 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1642 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1644 # @clients: a list of @VncClientInfo of all currently connected clients
1646 # Since: 0.14.0
1648 { 'struct': 'VncInfo',
1649   'data': {'enabled': 'bool', '*host': 'str',
1650            '*family': 'NetworkAddressFamily',
1651            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1654 # @VncPrimaryAuth:
1656 # vnc primary authentication method.
1658 # Since: 2.3
1660 { 'enum': 'VncPrimaryAuth',
1661   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1662             'tls', 'vencrypt', 'sasl' ] }
1665 # @VncVencryptSubAuth:
1667 # vnc sub authentication method with vencrypt.
1669 # Since: 2.3
1671 { 'enum': 'VncVencryptSubAuth',
1672   'data': [ 'plain',
1673             'tls-none',  'x509-none',
1674             'tls-vnc',   'x509-vnc',
1675             'tls-plain', 'x509-plain',
1676             'tls-sasl',  'x509-sasl' ] }
1680 # @VncServerInfo2:
1682 # The network connection information for server
1684 # @auth: The current authentication type used by the servers
1686 # @vencrypt: The vencrypt sub authentication type used by the
1687 #            servers, only specified in case auth == vencrypt.
1689 # Since: 2.9
1691 { 'struct': 'VncServerInfo2',
1692   'base': 'VncBasicInfo',
1693   'data': { 'auth'      : 'VncPrimaryAuth',
1694             '*vencrypt' : 'VncVencryptSubAuth' } }
1698 # @VncInfo2:
1700 # Information about a vnc server
1702 # @id: vnc server name.
1704 # @server: A list of @VncBasincInfo describing all listening sockets.
1705 #          The list can be empty (in case the vnc server is disabled).
1706 #          It also may have multiple entries: normal + websocket,
1707 #          possibly also ipv4 + ipv6 in the future.
1709 # @clients: A list of @VncClientInfo of all currently connected clients.
1710 #           The list can be empty, for obvious reasons.
1712 # @auth: The current authentication type used by the non-websockets servers
1714 # @vencrypt: The vencrypt authentication type used by the servers,
1715 #            only specified in case auth == vencrypt.
1717 # @display: The display device the vnc server is linked to.
1719 # Since: 2.3
1721 { 'struct': 'VncInfo2',
1722   'data': { 'id'        : 'str',
1723             'server'    : ['VncServerInfo2'],
1724             'clients'   : ['VncClientInfo'],
1725             'auth'      : 'VncPrimaryAuth',
1726             '*vencrypt' : 'VncVencryptSubAuth',
1727             '*display'  : 'str' } }
1730 # @query-vnc:
1732 # Returns information about the current VNC server
1734 # Returns: @VncInfo
1736 # Since: 0.14.0
1738 # Example:
1740 # -> { "execute": "query-vnc" }
1741 # <- { "return": {
1742 #          "enabled":true,
1743 #          "host":"0.0.0.0",
1744 #          "service":"50402",
1745 #          "auth":"vnc",
1746 #          "family":"ipv4",
1747 #          "clients":[
1748 #             {
1749 #                "host":"127.0.0.1",
1750 #                "service":"50401",
1751 #                "family":"ipv4"
1752 #             }
1753 #          ]
1754 #       }
1755 #    }
1758 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1761 # @query-vnc-servers:
1763 # Returns a list of vnc servers.  The list can be empty.
1765 # Returns: a list of @VncInfo2
1767 # Since: 2.3
1769 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1772 # @SpiceBasicInfo:
1774 # The basic information for SPICE network connection
1776 # @host: IP address
1778 # @port: port number
1780 # @family: address family
1782 # Since: 2.1
1784 { 'struct': 'SpiceBasicInfo',
1785   'data': { 'host': 'str',
1786             'port': 'str',
1787             'family': 'NetworkAddressFamily' } }
1790 # @SpiceServerInfo:
1792 # Information about a SPICE server
1794 # @auth: authentication method
1796 # Since: 2.1
1798 { 'struct': 'SpiceServerInfo',
1799   'base': 'SpiceBasicInfo',
1800   'data': { '*auth': 'str' } }
1803 # @SpiceChannel:
1805 # Information about a SPICE client channel.
1807 # @connection-id: SPICE connection id number.  All channels with the same id
1808 #                 belong to the same SPICE session.
1810 # @channel-type: SPICE channel type number.  "1" is the main control
1811 #                channel, filter for this one if you want to track spice
1812 #                sessions only
1814 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1815 #              multiple channels of the same type exist, such as multiple
1816 #              display channels in a multihead setup
1818 # @tls: true if the channel is encrypted, false otherwise.
1820 # Since: 0.14.0
1822 { 'struct': 'SpiceChannel',
1823   'base': 'SpiceBasicInfo',
1824   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1825            'tls': 'bool'} }
1828 # @SpiceQueryMouseMode:
1830 # An enumeration of Spice mouse states.
1832 # @client: Mouse cursor position is determined by the client.
1834 # @server: Mouse cursor position is determined by the server.
1836 # @unknown: No information is available about mouse mode used by
1837 #           the spice server.
1839 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1841 # Since: 1.1
1843 { 'enum': 'SpiceQueryMouseMode',
1844   'data': [ 'client', 'server', 'unknown' ] }
1847 # @SpiceInfo:
1849 # Information about the SPICE session.
1851 # @enabled: true if the SPICE server is enabled, false otherwise
1853 # @migrated: true if the last guest migration completed and spice
1854 #            migration had completed as well. false otherwise. (since 1.4)
1856 # @host: The hostname the SPICE server is bound to.  This depends on
1857 #        the name resolution on the host and may be an IP address.
1859 # @port: The SPICE server's port number.
1861 # @compiled-version: SPICE server version.
1863 # @tls-port: The SPICE server's TLS port number.
1865 # @auth: the current authentication type used by the server
1866 #        'none'  if no authentication is being used
1867 #        'spice' uses SASL or direct TLS authentication, depending on command
1868 #                line options
1870 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1871 #              be determined by the client or the server, or unknown if spice
1872 #              server doesn't provide this information. (since: 1.1)
1874 # @channels: a list of @SpiceChannel for each active spice channel
1876 # Since: 0.14.0
1878 { 'struct': 'SpiceInfo',
1879   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1880            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1881            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1884 # @query-spice:
1886 # Returns information about the current SPICE server
1888 # Returns: @SpiceInfo
1890 # Since: 0.14.0
1892 # Example:
1894 # -> { "execute": "query-spice" }
1895 # <- { "return": {
1896 #          "enabled": true,
1897 #          "auth": "spice",
1898 #          "port": 5920,
1899 #          "tls-port": 5921,
1900 #          "host": "0.0.0.0",
1901 #          "channels": [
1902 #             {
1903 #                "port": "54924",
1904 #                "family": "ipv4",
1905 #                "channel-type": 1,
1906 #                "connection-id": 1804289383,
1907 #                "host": "127.0.0.1",
1908 #                "channel-id": 0,
1909 #                "tls": true
1910 #             },
1911 #             {
1912 #                "port": "36710",
1913 #                "family": "ipv4",
1914 #                "channel-type": 4,
1915 #                "connection-id": 1804289383,
1916 #                "host": "127.0.0.1",
1917 #                "channel-id": 0,
1918 #                "tls": false
1919 #             },
1920 #             [ ... more channels follow ... ]
1921 #          ]
1922 #       }
1923 #    }
1926 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1929 # @BalloonInfo:
1931 # Information about the guest balloon device.
1933 # @actual: the number of bytes the balloon currently contains
1935 # Since: 0.14.0
1938 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1941 # @query-balloon:
1943 # Return information about the balloon device.
1945 # Returns: @BalloonInfo on success
1947 #          If the balloon driver is enabled but not functional because the KVM
1948 #          kernel module cannot support it, KvmMissingCap
1950 #          If no balloon device is present, DeviceNotActive
1952 # Since: 0.14.0
1954 # Example:
1956 # -> { "execute": "query-balloon" }
1957 # <- { "return": {
1958 #          "actual": 1073741824,
1959 #       }
1960 #    }
1963 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1966 # @PciMemoryRange:
1968 # A PCI device memory region
1970 # @base: the starting address (guest physical)
1972 # @limit: the ending address (guest physical)
1974 # Since: 0.14.0
1976 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1979 # @PciMemoryRegion:
1981 # Information about a PCI device I/O region.
1983 # @bar: the index of the Base Address Register for this region
1985 # @type: 'io' if the region is a PIO region
1986 #        'memory' if the region is a MMIO region
1988 # @size: memory size
1990 # @prefetch: if @type is 'memory', true if the memory is prefetchable
1992 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
1994 # Since: 0.14.0
1996 { 'struct': 'PciMemoryRegion',
1997   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1998            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
2001 # @PciBusInfo:
2003 # Information about a bus of a PCI Bridge device
2005 # @number: primary bus interface number.  This should be the number of the
2006 #          bus the device resides on.
2008 # @secondary: secondary bus interface number.  This is the number of the
2009 #             main bus for the bridge
2011 # @subordinate: This is the highest number bus that resides below the
2012 #               bridge.
2014 # @io_range: The PIO range for all devices on this bridge
2016 # @memory_range: The MMIO range for all devices on this bridge
2018 # @prefetchable_range: The range of prefetchable MMIO for all devices on
2019 #                      this bridge
2021 # Since: 2.4
2023 { 'struct': 'PciBusInfo',
2024   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
2025            'io_range': 'PciMemoryRange',
2026            'memory_range': 'PciMemoryRange',
2027            'prefetchable_range': 'PciMemoryRange' } }
2030 # @PciBridgeInfo:
2032 # Information about a PCI Bridge device
2034 # @bus: information about the bus the device resides on
2036 # @devices: a list of @PciDeviceInfo for each device on this bridge
2038 # Since: 0.14.0
2040 { 'struct': 'PciBridgeInfo',
2041   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
2044 # @PciDeviceClass:
2046 # Information about the Class of a PCI device
2048 # @desc: a string description of the device's class
2050 # @class: the class code of the device
2052 # Since: 2.4
2054 { 'struct': 'PciDeviceClass',
2055   'data': {'*desc': 'str', 'class': 'int'} }
2058 # @PciDeviceId:
2060 # Information about the Id of a PCI device
2062 # @device: the PCI device id
2064 # @vendor: the PCI vendor id
2066 # Since: 2.4
2068 { 'struct': 'PciDeviceId',
2069   'data': {'device': 'int', 'vendor': 'int'} }
2072 # @PciDeviceInfo:
2074 # Information about a PCI device
2076 # @bus: the bus number of the device
2078 # @slot: the slot the device is located in
2080 # @function: the function of the slot used by the device
2082 # @class_info: the class of the device
2084 # @id: the PCI device id
2086 # @irq: if an IRQ is assigned to the device, the IRQ number
2088 # @qdev_id: the device name of the PCI device
2090 # @pci_bridge: if the device is a PCI bridge, the bridge information
2092 # @regions: a list of the PCI I/O regions associated with the device
2094 # Notes: the contents of @class_info.desc are not stable and should only be
2095 #        treated as informational.
2097 # Since: 0.14.0
2099 { 'struct': 'PciDeviceInfo',
2100   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
2101            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
2102            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2103            'regions': ['PciMemoryRegion']} }
2106 # @PciInfo:
2108 # Information about a PCI bus
2110 # @bus: the bus index
2112 # @devices: a list of devices on this bus
2114 # Since: 0.14.0
2116 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
2119 # @query-pci:
2121 # Return information about the PCI bus topology of the guest.
2123 # Returns: a list of @PciInfo for each PCI bus. Each bus is
2124 # represented by a json-object, which has a key with a json-array of
2125 # all PCI devices attached to it. Each device is represented by a
2126 # json-object.
2128 # Since: 0.14.0
2130 # Example:
2132 # -> { "execute": "query-pci" }
2133 # <- { "return": [
2134 #          {
2135 #             "bus": 0,
2136 #             "devices": [
2137 #                {
2138 #                   "bus": 0,
2139 #                   "qdev_id": "",
2140 #                   "slot": 0,
2141 #                   "class_info": {
2142 #                      "class": 1536,
2143 #                      "desc": "Host bridge"
2144 #                   },
2145 #                   "id": {
2146 #                      "device": 32902,
2147 #                      "vendor": 4663
2148 #                   },
2149 #                   "function": 0,
2150 #                   "regions": [
2151 #                   ]
2152 #                },
2153 #                {
2154 #                   "bus": 0,
2155 #                   "qdev_id": "",
2156 #                   "slot": 1,
2157 #                   "class_info": {
2158 #                      "class": 1537,
2159 #                      "desc": "ISA bridge"
2160 #                   },
2161 #                   "id": {
2162 #                      "device": 32902,
2163 #                      "vendor": 28672
2164 #                   },
2165 #                   "function": 0,
2166 #                   "regions": [
2167 #                   ]
2168 #                },
2169 #                {
2170 #                   "bus": 0,
2171 #                   "qdev_id": "",
2172 #                   "slot": 1,
2173 #                   "class_info": {
2174 #                      "class": 257,
2175 #                      "desc": "IDE controller"
2176 #                   },
2177 #                   "id": {
2178 #                      "device": 32902,
2179 #                      "vendor": 28688
2180 #                   },
2181 #                   "function": 1,
2182 #                   "regions": [
2183 #                      {
2184 #                         "bar": 4,
2185 #                         "size": 16,
2186 #                         "address": 49152,
2187 #                         "type": "io"
2188 #                      }
2189 #                   ]
2190 #                },
2191 #                {
2192 #                   "bus": 0,
2193 #                   "qdev_id": "",
2194 #                   "slot": 2,
2195 #                   "class_info": {
2196 #                      "class": 768,
2197 #                      "desc": "VGA controller"
2198 #                   },
2199 #                   "id": {
2200 #                      "device": 4115,
2201 #                      "vendor": 184
2202 #                   },
2203 #                   "function": 0,
2204 #                   "regions": [
2205 #                      {
2206 #                         "prefetch": true,
2207 #                         "mem_type_64": false,
2208 #                         "bar": 0,
2209 #                         "size": 33554432,
2210 #                         "address": 4026531840,
2211 #                         "type": "memory"
2212 #                      },
2213 #                      {
2214 #                         "prefetch": false,
2215 #                         "mem_type_64": false,
2216 #                         "bar": 1,
2217 #                         "size": 4096,
2218 #                         "address": 4060086272,
2219 #                         "type": "memory"
2220 #                      },
2221 #                      {
2222 #                         "prefetch": false,
2223 #                         "mem_type_64": false,
2224 #                         "bar": 6,
2225 #                         "size": 65536,
2226 #                         "address": -1,
2227 #                         "type": "memory"
2228 #                      }
2229 #                   ]
2230 #                },
2231 #                {
2232 #                   "bus": 0,
2233 #                   "qdev_id": "",
2234 #                   "irq": 11,
2235 #                   "slot": 4,
2236 #                   "class_info": {
2237 #                      "class": 1280,
2238 #                      "desc": "RAM controller"
2239 #                   },
2240 #                   "id": {
2241 #                      "device": 6900,
2242 #                      "vendor": 4098
2243 #                   },
2244 #                   "function": 0,
2245 #                   "regions": [
2246 #                      {
2247 #                         "bar": 0,
2248 #                         "size": 32,
2249 #                         "address": 49280,
2250 #                         "type": "io"
2251 #                      }
2252 #                   ]
2253 #                }
2254 #             ]
2255 #          }
2256 #       ]
2257 #    }
2259 # Note: This example has been shortened as the real response is too long.
2262 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2265 # @quit:
2267 # This command will cause the QEMU process to exit gracefully.  While every
2268 # attempt is made to send the QMP response before terminating, this is not
2269 # guaranteed.  When using this interface, a premature EOF would not be
2270 # unexpected.
2272 # Since: 0.14.0
2274 # Example:
2276 # -> { "execute": "quit" }
2277 # <- { "return": {} }
2279 { 'command': 'quit' }
2282 # @stop:
2284 # Stop all guest VCPU execution.
2286 # Since:  0.14.0
2288 # Notes:  This function will succeed even if the guest is already in the stopped
2289 #         state.  In "inmigrate" state, it will ensure that the guest
2290 #         remains paused once migration finishes, as if the -S option was
2291 #         passed on the command line.
2293 # Example:
2295 # -> { "execute": "stop" }
2296 # <- { "return": {} }
2299 { 'command': 'stop' }
2302 # @system_reset:
2304 # Performs a hard reset of a guest.
2306 # Since: 0.14.0
2308 # Example:
2310 # -> { "execute": "system_reset" }
2311 # <- { "return": {} }
2314 { 'command': 'system_reset' }
2317 # @system_powerdown:
2319 # Requests that a guest perform a powerdown operation.
2321 # Since: 0.14.0
2323 # Notes: A guest may or may not respond to this command.  This command
2324 #        returning does not indicate that a guest has accepted the request or
2325 #        that it has shut down.  Many guests will respond to this command by
2326 #        prompting the user in some way.
2327 # Example:
2329 # -> { "execute": "system_powerdown" }
2330 # <- { "return": {} }
2333 { 'command': 'system_powerdown' }
2336 # @cpu:
2338 # This command is a nop that is only provided for the purposes of compatibility.
2340 # Since: 0.14.0
2342 # Notes: Do not use this command.
2344 { 'command': 'cpu', 'data': {'index': 'int'} }
2347 # @cpu-add:
2349 # Adds CPU with specified ID
2351 # @id: ID of CPU to be created, valid values [0..max_cpus)
2353 # Returns: Nothing on success
2355 # Since: 1.5
2357 # Example:
2359 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2360 # <- { "return": {} }
2363 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2366 # @memsave:
2368 # Save a portion of guest memory to a file.
2370 # @val: the virtual address of the guest to start from
2372 # @size: the size of memory region to save
2374 # @filename: the file to save the memory to as binary data
2376 # @cpu-index: the index of the virtual CPU to use for translating the
2377 #                       virtual address (defaults to CPU 0)
2379 # Returns: Nothing on success
2381 # Since: 0.14.0
2383 # Notes: Errors were not reliably returned until 1.1
2385 # Example:
2387 # -> { "execute": "memsave",
2388 #      "arguments": { "val": 10,
2389 #                     "size": 100,
2390 #                     "filename": "/tmp/virtual-mem-dump" } }
2391 # <- { "return": {} }
2394 { 'command': 'memsave',
2395   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2398 # @pmemsave:
2400 # Save a portion of guest physical memory to a file.
2402 # @val: the physical address of the guest to start from
2404 # @size: the size of memory region to save
2406 # @filename: the file to save the memory to as binary data
2408 # Returns: Nothing on success
2410 # Since: 0.14.0
2412 # Notes: Errors were not reliably returned until 1.1
2414 # Example:
2416 # -> { "execute": "pmemsave",
2417 #      "arguments": { "val": 10,
2418 #                     "size": 100,
2419 #                     "filename": "/tmp/physical-mem-dump" } }
2420 # <- { "return": {} }
2423 { 'command': 'pmemsave',
2424   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2427 # @cont:
2429 # Resume guest VCPU execution.
2431 # Since:  0.14.0
2433 # Returns:  If successful, nothing
2435 # Notes:  This command will succeed if the guest is currently running.  It
2436 #         will also succeed if the guest is in the "inmigrate" state; in
2437 #         this case, the effect of the command is to make sure the guest
2438 #         starts once migration finishes, removing the effect of the -S
2439 #         command line option if it was passed.
2441 # Example:
2443 # -> { "execute": "cont" }
2444 # <- { "return": {} }
2447 { 'command': 'cont' }
2450 # @system_wakeup:
2452 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2454 # Since:  1.1
2456 # Returns:  nothing.
2458 # Example:
2460 # -> { "execute": "system_wakeup" }
2461 # <- { "return": {} }
2464 { 'command': 'system_wakeup' }
2467 # @inject-nmi:
2469 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2470 # The command fails when the guest doesn't support injecting.
2472 # Returns:  If successful, nothing
2474 # Since:  0.14.0
2476 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2478 # Example:
2480 # -> { "execute": "inject-nmi" }
2481 # <- { "return": {} }
2484 { 'command': 'inject-nmi' }
2487 # @set_link:
2489 # Sets the link status of a virtual network adapter.
2491 # @name: the device name of the virtual network adapter
2493 # @up: true to set the link status to be up
2495 # Returns: Nothing on success
2496 #          If @name is not a valid network device, DeviceNotFound
2498 # Since: 0.14.0
2500 # Notes: Not all network adapters support setting link status.  This command
2501 #        will succeed even if the network adapter does not support link status
2502 #        notification.
2504 # Example:
2506 # -> { "execute": "set_link",
2507 #      "arguments": { "name": "e1000.0", "up": false } }
2508 # <- { "return": {} }
2511 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2514 # @balloon:
2516 # Request the balloon driver to change its balloon size.
2518 # @value: the target size of the balloon in bytes
2520 # Returns: Nothing on success
2521 #          If the balloon driver is enabled but not functional because the KVM
2522 #            kernel module cannot support it, KvmMissingCap
2523 #          If no balloon device is present, DeviceNotActive
2525 # Notes: This command just issues a request to the guest.  When it returns,
2526 #        the balloon size may not have changed.  A guest can change the balloon
2527 #        size independent of this command.
2529 # Since: 0.14.0
2531 # Example:
2533 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2534 # <- { "return": {} }
2537 { 'command': 'balloon', 'data': {'value': 'int'} }
2540 # @Abort:
2542 # This action can be used to test transaction failure.
2544 # Since: 1.6
2546 { 'struct': 'Abort',
2547   'data': { } }
2550 # @ActionCompletionMode:
2552 # An enumeration of Transactional completion modes.
2554 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2555 #              after the Transaction request succeeds. All Actions that
2556 #              can complete successfully will do so without waiting on others.
2557 #              This is the default.
2559 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2560 #           Actions. Actions do not complete until all Actions are ready to
2561 #           complete. May be rejected by Actions that do not support this
2562 #           completion mode.
2564 # Since: 2.5
2566 { 'enum': 'ActionCompletionMode',
2567   'data': [ 'individual', 'grouped' ] }
2570 # @TransactionAction:
2572 # A discriminated record of operations that can be performed with
2573 # @transaction. Action @type can be:
2575 # - @abort: since 1.6
2576 # - @block-dirty-bitmap-add: since 2.5
2577 # - @block-dirty-bitmap-clear: since 2.5
2578 # - @blockdev-backup: since 2.3
2579 # - @blockdev-snapshot: since 2.5
2580 # - @blockdev-snapshot-internal-sync: since 1.7
2581 # - @blockdev-snapshot-sync: since 1.1
2582 # - @drive-backup: since 1.6
2584 # Since: 1.1
2586 { 'union': 'TransactionAction',
2587   'data': {
2588        'abort': 'Abort',
2589        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2590        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2591        'blockdev-backup': 'BlockdevBackup',
2592        'blockdev-snapshot': 'BlockdevSnapshot',
2593        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2594        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2595        'drive-backup': 'DriveBackup'
2596    } }
2599 # @TransactionProperties:
2601 # Optional arguments to modify the behavior of a Transaction.
2603 # @completion-mode: Controls how jobs launched asynchronously by
2604 #                   Actions will complete or fail as a group.
2605 #                   See @ActionCompletionMode for details.
2607 # Since: 2.5
2609 { 'struct': 'TransactionProperties',
2610   'data': {
2611        '*completion-mode': 'ActionCompletionMode'
2612   }
2616 # @transaction:
2618 # Executes a number of transactionable QMP commands atomically. If any
2619 # operation fails, then the entire set of actions will be abandoned and the
2620 # appropriate error returned.
2622 # For external snapshots, the dictionary contains the device, the file to use for
2623 # the new snapshot, and the format.  The default format, if not specified, is
2624 # qcow2.
2626 # Each new snapshot defaults to being created by QEMU (wiping any
2627 # contents if the file already exists), but it is also possible to reuse
2628 # an externally-created file.  In the latter case, you should ensure that
2629 # the new image file has the same contents as the current one; QEMU cannot
2630 # perform any meaningful check.  Typically this is achieved by using the
2631 # current image file as the backing file for the new image.
2633 # On failure, the original disks pre-snapshot attempt will be used.
2635 # For internal snapshots, the dictionary contains the device and the snapshot's
2636 # name.  If an internal snapshot matching name already exists, the request will
2637 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2638 # and sheepdog.
2640 # On failure, qemu will try delete the newly created internal snapshot in the
2641 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2642 # it later with qemu-img or other command.
2644 # @actions: List of @TransactionAction;
2645 #           information needed for the respective operations.
2647 # @properties: structure of additional options to control the
2648 #              execution of the transaction. See @TransactionProperties
2649 #              for additional detail.
2651 # Returns: nothing on success
2653 #          Errors depend on the operations of the transaction
2655 # Note: The transaction aborts on the first failure.  Therefore, there will be
2656 # information on only one failed operation returned in an error condition, and
2657 # subsequent actions will not have been attempted.
2659 # Since: 1.1
2661 # Example:
2663 # -> { "execute": "transaction",
2664 #      "arguments": { "actions": [
2665 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2666 #                                      "snapshot-file": "/some/place/my-image",
2667 #                                      "format": "qcow2" } },
2668 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2669 #                                      "snapshot-file": "/some/place/my-image2",
2670 #                                      "snapshot-node-name": "node3432",
2671 #                                      "mode": "existing",
2672 #                                      "format": "qcow2" } },
2673 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2674 #                                      "snapshot-file": "/some/place/my-image2",
2675 #                                      "mode": "existing",
2676 #                                      "format": "qcow2" } },
2677 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2678 #                                      "device": "ide-hd2",
2679 #                                      "name": "snapshot0" } } ] } }
2680 # <- { "return": {} }
2683 { 'command': 'transaction',
2684   'data': { 'actions': [ 'TransactionAction' ],
2685             '*properties': 'TransactionProperties'
2686           }
2690 # @human-monitor-command:
2692 # Execute a command on the human monitor and return the output.
2694 # @command-line: the command to execute in the human monitor
2696 # @cpu-index: The CPU to use for commands that require an implicit CPU
2698 # Returns: the output of the command as a string
2700 # Since: 0.14.0
2702 # Notes: This command only exists as a stop-gap.  Its use is highly
2703 #        discouraged.  The semantics of this command are not
2704 #        guaranteed: this means that command names, arguments and
2705 #        responses can change or be removed at ANY time.  Applications
2706 #        that rely on long term stability guarantees should NOT
2707 #        use this command.
2709 #        Known limitations:
2711 #        * This command is stateless, this means that commands that depend
2712 #          on state information (such as getfd) might not work
2714 #        * Commands that prompt the user for data don't currently work
2716 # Example:
2718 # -> { "execute": "human-monitor-command",
2719 #      "arguments": { "command-line": "info kvm" } }
2720 # <- { "return": "kvm support: enabled\r\n" }
2723 { 'command': 'human-monitor-command',
2724   'data': {'command-line': 'str', '*cpu-index': 'int'},
2725   'returns': 'str' }
2728 # @migrate_cancel:
2730 # Cancel the current executing migration process.
2732 # Returns: nothing on success
2734 # Notes: This command succeeds even if there is no migration process running.
2736 # Since: 0.14.0
2738 # Example:
2740 # -> { "execute": "migrate_cancel" }
2741 # <- { "return": {} }
2744 { 'command': 'migrate_cancel' }
2747 # @migrate_set_downtime:
2749 # Set maximum tolerated downtime for migration.
2751 # @value: maximum downtime in seconds
2753 # Returns: nothing on success
2755 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2757 # Since: 0.14.0
2759 # Example:
2761 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2762 # <- { "return": {} }
2765 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2768 # @migrate_set_speed:
2770 # Set maximum speed for migration.
2772 # @value: maximum speed in bytes per second.
2774 # Returns: nothing on success
2776 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2778 # Since: 0.14.0
2780 # Example:
2782 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2783 # <- { "return": {} }
2786 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2789 # @migrate-set-cache-size:
2791 # Set cache size to be used by XBZRLE migration
2793 # @value: cache size in bytes
2795 # The size will be rounded down to the nearest power of 2.
2796 # The cache size can be modified before and during ongoing migration
2798 # Returns: nothing on success
2800 # Since: 1.2
2802 # Example:
2804 # -> { "execute": "migrate-set-cache-size",
2805 #      "arguments": { "value": 536870912 } }
2806 # <- { "return": {} }
2809 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2812 # @query-migrate-cache-size:
2814 # Query migration XBZRLE cache size
2816 # Returns: XBZRLE cache size in bytes
2818 # Since: 1.2
2820 # Example:
2822 # -> { "execute": "query-migrate-cache-size" }
2823 # <- { "return": 67108864 }
2826 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2829 # @ObjectPropertyInfo:
2831 # @name: the name of the property
2833 # @type: the type of the property.  This will typically come in one of four
2834 #        forms:
2836 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2837 #           These types are mapped to the appropriate JSON type.
2839 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2840 #           device type name.  Child properties create the composition tree.
2842 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2843 #           device type name.  Link properties form the device model graph.
2845 # Since: 1.2
2847 { 'struct': 'ObjectPropertyInfo',
2848   'data': { 'name': 'str', 'type': 'str' } }
2851 # @qom-list:
2853 # This command will list any properties of a object given a path in the object
2854 # model.
2856 # @path: the path within the object model.  See @qom-get for a description of
2857 #        this parameter.
2859 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2860 #          object.
2862 # Since: 1.2
2864 { 'command': 'qom-list',
2865   'data': { 'path': 'str' },
2866   'returns': [ 'ObjectPropertyInfo' ] }
2869 # @qom-get:
2871 # This command will get a property from a object model path and return the
2872 # value.
2874 # @path: The path within the object model.  There are two forms of supported
2875 #        paths--absolute and partial paths.
2877 #        Absolute paths are derived from the root object and can follow child<>
2878 #        or link<> properties.  Since they can follow link<> properties, they
2879 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2880 #        and are prefixed  with a leading slash.
2882 #        Partial paths look like relative filenames.  They do not begin
2883 #        with a prefix.  The matching rules for partial paths are subtle but
2884 #        designed to make specifying objects easy.  At each level of the
2885 #        composition tree, the partial path is matched as an absolute path.
2886 #        The first match is not returned.  At least two matches are searched
2887 #        for.  A successful result is only returned if only one match is
2888 #        found.  If more than one match is found, a flag is return to
2889 #        indicate that the match was ambiguous.
2891 # @property: The property name to read
2893 # Returns: The property value.  The type depends on the property
2894 #          type. child<> and link<> properties are returned as #str
2895 #          pathnames.  All integer property types (u8, u16, etc) are
2896 #          returned as #int.
2898 # Since: 1.2
2900 { 'command': 'qom-get',
2901   'data': { 'path': 'str', 'property': 'str' },
2902   'returns': 'any' }
2905 # @qom-set:
2907 # This command will set a property from a object model path.
2909 # @path: see @qom-get for a description of this parameter
2911 # @property: the property name to set
2913 # @value: a value who's type is appropriate for the property type.  See @qom-get
2914 #         for a description of type mapping.
2916 # Since: 1.2
2918 { 'command': 'qom-set',
2919   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2922 # @set_password:
2924 # Sets the password of a remote display session.
2926 # @protocol: `vnc' to modify the VNC server password
2927 #            `spice' to modify the Spice server password
2929 # @password: the new password
2931 # @connected: how to handle existing clients when changing the
2932 #                       password.  If nothing is specified, defaults to `keep'
2933 #                       `fail' to fail the command if clients are connected
2934 #                       `disconnect' to disconnect existing clients
2935 #                       `keep' to maintain existing clients
2937 # Returns: Nothing on success
2938 #          If Spice is not enabled, DeviceNotFound
2940 # Since: 0.14.0
2942 # Example:
2944 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2945 #                                                "password": "secret" } }
2946 # <- { "return": {} }
2949 { 'command': 'set_password',
2950   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2953 # @expire_password:
2955 # Expire the password of a remote display server.
2957 # @protocol: the name of the remote display protocol `vnc' or `spice'
2959 # @time: when to expire the password.
2960 #        `now' to expire the password immediately
2961 #        `never' to cancel password expiration
2962 #        `+INT' where INT is the number of seconds from now (integer)
2963 #        `INT' where INT is the absolute time in seconds
2965 # Returns: Nothing on success
2966 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2968 # Since: 0.14.0
2970 # Notes: Time is relative to the server and currently there is no way to
2971 #        coordinate server time with client time.  It is not recommended to
2972 #        use the absolute time version of the @time parameter unless you're
2973 #        sure you are on the same machine as the QEMU instance.
2975 # Example:
2977 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2978 #                                                   "time": "+60" } }
2979 # <- { "return": {} }
2982 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2985 # @change-vnc-password:
2987 # Change the VNC server password.
2989 # @password:  the new password to use with VNC authentication
2991 # Since: 1.1
2993 # Notes:  An empty password in this command will set the password to the empty
2994 #         string.  Existing clients are unaffected by executing this command.
2996 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2999 # @change:
3001 # This command is multiple commands multiplexed together.
3003 # @device: This is normally the name of a block device but it may also be 'vnc'.
3004 #          when it's 'vnc', then sub command depends on @target
3006 # @target: If @device is a block device, then this is the new filename.
3007 #          If @device is 'vnc', then if the value 'password' selects the vnc
3008 #          change password command.   Otherwise, this specifies a new server URI
3009 #          address to listen to for VNC connections.
3011 # @arg:    If @device is a block device, then this is an optional format to open
3012 #          the device with.
3013 #          If @device is 'vnc' and @target is 'password', this is the new VNC
3014 #          password to set.  If this argument is an empty string, then no future
3015 #          logins will be allowed.
3017 # Returns: Nothing on success.
3018 #          If @device is not a valid block device, DeviceNotFound
3020 # Notes:  This interface is deprecated, and it is strongly recommended that you
3021 #         avoid using it.  For changing block devices, use
3022 #         blockdev-change-medium; for changing VNC parameters, use
3023 #         change-vnc-password.
3025 # Since: 0.14.0
3027 # Example:
3029 # 1. Change a removable medium
3031 # -> { "execute": "change",
3032 #      "arguments": { "device": "ide1-cd0",
3033 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
3034 # <- { "return": {} }
3036 # 2. Change VNC password
3038 # -> { "execute": "change",
3039 #      "arguments": { "device": "vnc", "target": "password",
3040 #                     "arg": "foobar1" } }
3041 # <- { "return": {} }
3044 { 'command': 'change',
3045   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
3048 # @ObjectTypeInfo:
3050 # This structure describes a search result from @qom-list-types
3052 # @name: the type name found in the search
3054 # Since: 1.1
3056 { 'struct': 'ObjectTypeInfo',
3057   'data': { 'name': 'str' } }
3060 # @qom-list-types:
3062 # This command will return a list of types given search parameters
3064 # @implements: if specified, only return types that implement this type name
3066 # @abstract: if true, include abstract types in the results
3068 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3070 # Since: 1.1
3072 { 'command': 'qom-list-types',
3073   'data': { '*implements': 'str', '*abstract': 'bool' },
3074   'returns': [ 'ObjectTypeInfo' ] }
3077 # @DevicePropertyInfo:
3079 # Information about device properties.
3081 # @name: the name of the property
3082 # @type: the typename of the property
3083 # @description: if specified, the description of the property.
3084 #               (since 2.2)
3086 # Since: 1.2
3088 { 'struct': 'DevicePropertyInfo',
3089   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
3092 # @device-list-properties:
3094 # List properties associated with a device.
3096 # @typename: the type name of a device
3098 # Returns: a list of DevicePropertyInfo describing a devices properties
3100 # Since: 1.2
3102 { 'command': 'device-list-properties',
3103   'data': { 'typename': 'str'},
3104   'returns': [ 'DevicePropertyInfo' ] }
3107 # @migrate:
3109 # Migrates the current running guest to another Virtual Machine.
3111 # @uri: the Uniform Resource Identifier of the destination VM
3113 # @blk: do block migration (full disk copy)
3115 # @inc: incremental disk copy migration
3117 # @detach: this argument exists only for compatibility reasons and
3118 #          is ignored by QEMU
3120 # Returns: nothing on success
3122 # Since: 0.14.0
3124 # Notes:
3126 # 1. The 'query-migrate' command should be used to check migration's progress
3127 #    and final result (this information is provided by the 'status' member)
3129 # 2. All boolean arguments default to false
3131 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
3132 #    be used
3134 # Example:
3136 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3137 # <- { "return": {} }
3140 { 'command': 'migrate',
3141   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
3144 # @migrate-incoming:
3146 # Start an incoming migration, the qemu must have been started
3147 # with -incoming defer
3149 # @uri: The Uniform Resource Identifier identifying the source or
3150 #       address to listen on
3152 # Returns: nothing on success
3154 # Since: 2.3
3156 # Notes:
3158 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3159 #    compatible with -incoming and the format of the uri is already exposed
3160 #    above libvirt.
3162 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3163 #    be used.
3165 # 3. The uri format is the same as for -incoming
3167 # Example:
3169 # -> { "execute": "migrate-incoming",
3170 #      "arguments": { "uri": "tcp::4446" } }
3171 # <- { "return": {} }
3174 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3177 # @xen-save-devices-state:
3179 # Save the state of all devices to file. The RAM and the block devices
3180 # of the VM are not saved by this command.
3182 # @filename: the file to save the state of the devices to as binary
3183 # data. See xen-save-devices-state.txt for a description of the binary
3184 # format.
3186 # Returns: Nothing on success
3188 # Since: 1.1
3190 # Example:
3192 # -> { "execute": "xen-save-devices-state",
3193 #      "arguments": { "filename": "/tmp/save" } }
3194 # <- { "return": {} }
3197 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3200 # @xen-set-global-dirty-log:
3202 # Enable or disable the global dirty log mode.
3204 # @enable: true to enable, false to disable.
3206 # Returns: nothing
3208 # Since: 1.3
3210 # Example:
3212 # -> { "execute": "xen-set-global-dirty-log",
3213 #      "arguments": { "enable": true } }
3214 # <- { "return": {} }
3217 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3220 # @device_add:
3222 # @driver: the name of the new device's driver
3224 # @bus: the device's parent bus (device tree path)
3226 # @id: the device's ID, must be unique
3228 # Additional arguments depend on the type.
3230 # Add a device.
3232 # Notes:
3233 # 1. For detailed information about this command, please refer to the
3234 #    'docs/qdev-device-use.txt' file.
3236 # 2. It's possible to list device properties by running QEMU with the
3237 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3238 #    device's name
3240 # Example:
3242 # -> { "execute": "device_add",
3243 #      "arguments": { "driver": "e1000", "id": "net1",
3244 #                     "bus": "pci.0",
3245 #                     "mac": "52:54:00:12:34:56" } }
3246 # <- { "return": {} }
3248 # TODO: This command effectively bypasses QAPI completely due to its
3249 # "additional arguments" business.  It shouldn't have been added to
3250 # the schema in this form.  It should be qapified properly, or
3251 # replaced by a properly qapified command.
3253 # Since: 0.13
3255 { 'command': 'device_add',
3256   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3257   'gen': false } # so we can get the additional arguments
3260 # @device_del:
3262 # Remove a device from a guest
3264 # @id: the device's ID or QOM path
3266 # Returns: Nothing on success
3267 #          If @id is not a valid device, DeviceNotFound
3269 # Notes: When this command completes, the device may not be removed from the
3270 #        guest.  Hot removal is an operation that requires guest cooperation.
3271 #        This command merely requests that the guest begin the hot removal
3272 #        process.  Completion of the device removal process is signaled with a
3273 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3274 #        for all devices.
3276 # Since: 0.14.0
3278 # Example:
3280 # -> { "execute": "device_del",
3281 #      "arguments": { "id": "net1" } }
3282 # <- { "return": {} }
3284 # -> { "execute": "device_del",
3285 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3286 # <- { "return": {} }
3289 { 'command': 'device_del', 'data': {'id': 'str'} }
3292 # @DumpGuestMemoryFormat:
3294 # An enumeration of guest-memory-dump's format.
3296 # @elf: elf format
3298 # @kdump-zlib: kdump-compressed format with zlib-compressed
3300 # @kdump-lzo: kdump-compressed format with lzo-compressed
3302 # @kdump-snappy: kdump-compressed format with snappy-compressed
3304 # Since: 2.0
3306 { 'enum': 'DumpGuestMemoryFormat',
3307   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3310 # @dump-guest-memory:
3312 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3313 # very long depending on the amount of guest memory.
3315 # @paging: if true, do paging to get guest's memory mapping. This allows
3316 #          using gdb to process the core file.
3318 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3319 #                     of RAM. This can happen for a large guest, or a
3320 #                     malicious guest pretending to be large.
3322 #          Also, paging=true has the following limitations:
3324 #             1. The guest may be in a catastrophic state or can have corrupted
3325 #                memory, which cannot be trusted
3326 #             2. The guest can be in real-mode even if paging is enabled. For
3327 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3328 #                goes in real-mode
3329 #             3. Currently only supported on i386 and x86_64.
3331 # @protocol: the filename or file descriptor of the vmcore. The supported
3332 #            protocols are:
3334 #            1. file: the protocol starts with "file:", and the following
3335 #               string is the file's path.
3336 #            2. fd: the protocol starts with "fd:", and the following string
3337 #               is the fd's name.
3339 # @detach: if true, QMP will return immediately rather than
3340 #          waiting for the dump to finish. The user can track progress
3341 #          using "query-dump". (since 2.6).
3343 # @begin: if specified, the starting physical address.
3345 # @length: if specified, the memory size, in bytes. If you don't
3346 #          want to dump all guest's memory, please specify the start @begin
3347 #          and @length
3349 # @format: if specified, the format of guest memory dump. But non-elf
3350 #          format is conflict with paging and filter, ie. @paging, @begin and
3351 #          @length is not allowed to be specified with non-elf @format at the
3352 #          same time (since 2.0)
3354 # Note: All boolean arguments default to false
3356 # Returns: nothing on success
3358 # Since: 1.2
3360 # Example:
3362 # -> { "execute": "dump-guest-memory",
3363 #      "arguments": { "protocol": "fd:dump" } }
3364 # <- { "return": {} }
3367 { 'command': 'dump-guest-memory',
3368   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3369             '*begin': 'int', '*length': 'int',
3370             '*format': 'DumpGuestMemoryFormat'} }
3373 # @DumpStatus:
3375 # Describe the status of a long-running background guest memory dump.
3377 # @none: no dump-guest-memory has started yet.
3379 # @active: there is one dump running in background.
3381 # @completed: the last dump has finished successfully.
3383 # @failed: the last dump has failed.
3385 # Since: 2.6
3387 { 'enum': 'DumpStatus',
3388   'data': [ 'none', 'active', 'completed', 'failed' ] }
3391 # @DumpQueryResult:
3393 # The result format for 'query-dump'.
3395 # @status: enum of @DumpStatus, which shows current dump status
3397 # @completed: bytes written in latest dump (uncompressed)
3399 # @total: total bytes to be written in latest dump (uncompressed)
3401 # Since: 2.6
3403 { 'struct': 'DumpQueryResult',
3404   'data': { 'status': 'DumpStatus',
3405             'completed': 'int',
3406             'total': 'int' } }
3409 # @query-dump:
3411 # Query latest dump status.
3413 # Returns: A @DumpStatus object showing the dump status.
3415 # Since: 2.6
3417 # Example:
3419 # -> { "execute": "query-dump" }
3420 # <- { "return": { "status": "active", "completed": 1024000,
3421 #                  "total": 2048000 } }
3424 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3427 # @DumpGuestMemoryCapability:
3429 # A list of the available formats for dump-guest-memory
3431 # Since: 2.0
3433 { 'struct': 'DumpGuestMemoryCapability',
3434   'data': {
3435       'formats': ['DumpGuestMemoryFormat'] } }
3438 # @query-dump-guest-memory-capability:
3440 # Returns the available formats for dump-guest-memory
3442 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3443 #           dump-guest-memory
3445 # Since: 2.0
3447 # Example:
3449 # -> { "execute": "query-dump-guest-memory-capability" }
3450 # <- { "return": { "formats":
3451 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3454 { 'command': 'query-dump-guest-memory-capability',
3455   'returns': 'DumpGuestMemoryCapability' }
3458 # @dump-skeys:
3460 # Dump guest's storage keys
3462 # @filename: the path to the file to dump to
3464 # This command is only supported on s390 architecture.
3466 # Since: 2.5
3468 # Example:
3470 # -> { "execute": "dump-skeys",
3471 #      "arguments": { "filename": "/tmp/skeys" } }
3472 # <- { "return": {} }
3475 { 'command': 'dump-skeys',
3476   'data': { 'filename': 'str' } }
3479 # @netdev_add:
3481 # Add a network backend.
3483 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3484 #        'vde', 'socket', 'dump' and 'bridge'
3486 # @id: the name of the new network backend
3488 # Additional arguments depend on the type.
3490 # TODO: This command effectively bypasses QAPI completely due to its
3491 # "additional arguments" business.  It shouldn't have been added to
3492 # the schema in this form.  It should be qapified properly, or
3493 # replaced by a properly qapified command.
3495 # Since: 0.14.0
3497 # Returns: Nothing on success
3498 #          If @type is not a valid network backend, DeviceNotFound
3500 # Example:
3502 # -> { "execute": "netdev_add",
3503 #      "arguments": { "type": "user", "id": "netdev1",
3504 #                     "dnssearch": "example.org" } }
3505 # <- { "return": {} }
3508 { 'command': 'netdev_add',
3509   'data': {'type': 'str', 'id': 'str'},
3510   'gen': false }                # so we can get the additional arguments
3513 # @netdev_del:
3515 # Remove a network backend.
3517 # @id: the name of the network backend to remove
3519 # Returns: Nothing on success
3520 #          If @id is not a valid network backend, DeviceNotFound
3522 # Since: 0.14.0
3524 # Example:
3526 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3527 # <- { "return": {} }
3530 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3533 # @object-add:
3535 # Create a QOM object.
3537 # @qom-type: the class name for the object to be created
3539 # @id: the name of the new object
3541 # @props: a dictionary of properties to be passed to the backend
3543 # Returns: Nothing on success
3544 #          Error if @qom-type is not a valid class name
3546 # Since: 2.0
3548 # Example:
3550 # -> { "execute": "object-add",
3551 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3552 #                     "props": { "filename": "/dev/hwrng" } } }
3553 # <- { "return": {} }
3556 { 'command': 'object-add',
3557   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3560 # @object-del:
3562 # Remove a QOM object.
3564 # @id: the name of the QOM object to remove
3566 # Returns: Nothing on success
3567 #          Error if @id is not a valid id for a QOM object
3569 # Since: 2.0
3571 # Example:
3573 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3574 # <- { "return": {} }
3577 { 'command': 'object-del', 'data': {'id': 'str'} }
3580 # @NetdevNoneOptions:
3582 # Use it alone to have zero network devices.
3584 # Since: 1.2
3586 { 'struct': 'NetdevNoneOptions',
3587   'data': { } }
3590 # @NetLegacyNicOptions:
3592 # Create a new Network Interface Card.
3594 # @netdev: id of -netdev to connect to
3596 # @macaddr: MAC address
3598 # @model: device model (e1000, rtl8139, virtio etc.)
3600 # @addr: PCI device address
3602 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
3604 # Since: 1.2
3606 { 'struct': 'NetLegacyNicOptions',
3607   'data': {
3608     '*netdev':  'str',
3609     '*macaddr': 'str',
3610     '*model':   'str',
3611     '*addr':    'str',
3612     '*vectors': 'uint32' } }
3615 # @String:
3617 # A fat type wrapping 'str', to be embedded in lists.
3619 # Since: 1.2
3621 { 'struct': 'String',
3622   'data': {
3623     'str': 'str' } }
3626 # @NetdevUserOptions:
3628 # Use the user mode network stack which requires no administrator privilege to
3629 # run.
3631 # @hostname: client hostname reported by the builtin DHCP server
3633 # @restrict: isolate the guest from the host
3635 # @ipv4: whether to support IPv4, default true for enabled
3636 #        (since 2.6)
3638 # @ipv6: whether to support IPv6, default true for enabled
3639 #        (since 2.6)
3641 # @ip: legacy parameter, use net= instead
3643 # @net: IP network address that the guest will see, in the
3644 #       form addr[/netmask] The netmask is optional, and can be
3645 #       either in the form a.b.c.d or as a number of valid top-most
3646 #       bits. Default is 10.0.2.0/24.
3648 # @host: guest-visible address of the host
3650 # @tftp: root directory of the built-in TFTP server
3652 # @bootfile: BOOTP filename, for use with tftp=
3654 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
3655 #             assign
3657 # @dns: guest-visible address of the virtual nameserver
3659 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
3660 #             to the guest
3662 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
3663 #               2.6). The network prefix is given in the usual
3664 #               hexadecimal IPv6 address notation.
3666 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
3667 #                  (since 2.6)
3669 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
3671 # @ipv6-dns: guest-visible IPv6 address of the virtual
3672 #            nameserver (since 2.6)
3674 # @smb: root directory of the built-in SMB server
3676 # @smbserver: IP address of the built-in SMB server
3678 # @hostfwd: redirect incoming TCP or UDP host connections to guest
3679 #           endpoints
3681 # @guestfwd: forward guest TCP connections
3683 # Since: 1.2
3685 { 'struct': 'NetdevUserOptions',
3686   'data': {
3687     '*hostname':  'str',
3688     '*restrict':  'bool',
3689     '*ipv4':      'bool',
3690     '*ipv6':      'bool',
3691     '*ip':        'str',
3692     '*net':       'str',
3693     '*host':      'str',
3694     '*tftp':      'str',
3695     '*bootfile':  'str',
3696     '*dhcpstart': 'str',
3697     '*dns':       'str',
3698     '*dnssearch': ['String'],
3699     '*ipv6-prefix':      'str',
3700     '*ipv6-prefixlen':   'int',
3701     '*ipv6-host':        'str',
3702     '*ipv6-dns':         'str',
3703     '*smb':       'str',
3704     '*smbserver': 'str',
3705     '*hostfwd':   ['String'],
3706     '*guestfwd':  ['String'] } }
3709 # @NetdevTapOptions:
3711 # Connect the host TAP network interface name to the VLAN.
3713 # @ifname: interface name
3715 # @fd: file descriptor of an already opened tap
3717 # @fds: multiple file descriptors of already opened multiqueue capable
3718 # tap
3720 # @script: script to initialize the interface
3722 # @downscript: script to shut down the interface
3724 # @br: bridge name (since 2.8)
3726 # @helper: command to execute to configure bridge
3728 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
3730 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
3732 # @vhost: enable vhost-net network accelerator
3734 # @vhostfd: file descriptor of an already opened vhost net device
3736 # @vhostfds: file descriptors of multiple already opened vhost net
3737 # devices
3739 # @vhostforce: vhost on for non-MSIX virtio guests
3741 # @queues: number of queues to be created for multiqueue capable tap
3743 # @poll-us: maximum number of microseconds that could
3744 # be spent on busy polling for tap (since 2.7)
3746 # Since: 1.2
3748 { 'struct': 'NetdevTapOptions',
3749   'data': {
3750     '*ifname':     'str',
3751     '*fd':         'str',
3752     '*fds':        'str',
3753     '*script':     'str',
3754     '*downscript': 'str',
3755     '*br':         'str',
3756     '*helper':     'str',
3757     '*sndbuf':     'size',
3758     '*vnet_hdr':   'bool',
3759     '*vhost':      'bool',
3760     '*vhostfd':    'str',
3761     '*vhostfds':   'str',
3762     '*vhostforce': 'bool',
3763     '*queues':     'uint32',
3764     '*poll-us':    'uint32'} }
3767 # @NetdevSocketOptions:
3769 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3770 # socket connection.
3772 # @fd: file descriptor of an already opened socket
3774 # @listen: port number, and optional hostname, to listen on
3776 # @connect: port number, and optional hostname, to connect to
3778 # @mcast: UDP multicast address and port number
3780 # @localaddr: source address and port for multicast and udp packets
3782 # @udp: UDP unicast address and port number
3784 # Since: 1.2
3786 { 'struct': 'NetdevSocketOptions',
3787   'data': {
3788     '*fd':        'str',
3789     '*listen':    'str',
3790     '*connect':   'str',
3791     '*mcast':     'str',
3792     '*localaddr': 'str',
3793     '*udp':       'str' } }
3796 # @NetdevL2TPv3Options:
3798 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3800 # @src: source address
3802 # @dst: destination address
3804 # @srcport: source port - mandatory for udp, optional for ip
3806 # @dstport: destination port - mandatory for udp, optional for ip
3808 # @ipv6: force the use of ipv6
3810 # @udp: use the udp version of l2tpv3 encapsulation
3812 # @cookie64: use 64 bit coookies
3814 # @counter: have sequence counter
3816 # @pincounter: pin sequence counter to zero -
3817 #              workaround for buggy implementations or
3818 #              networks with packet reorder
3820 # @txcookie: 32 or 64 bit transmit cookie
3822 # @rxcookie: 32 or 64 bit receive cookie
3824 # @txsession: 32 bit transmit session
3826 # @rxsession: 32 bit receive session - if not specified
3827 #             set to the same value as transmit
3829 # @offset: additional offset - allows the insertion of
3830 #          additional application-specific data before the packet payload
3832 # Since: 2.1
3834 { 'struct': 'NetdevL2TPv3Options',
3835   'data': {
3836     'src':          'str',
3837     'dst':          'str',
3838     '*srcport':     'str',
3839     '*dstport':     'str',
3840     '*ipv6':        'bool',
3841     '*udp':         'bool',
3842     '*cookie64':    'bool',
3843     '*counter':     'bool',
3844     '*pincounter':  'bool',
3845     '*txcookie':    'uint64',
3846     '*rxcookie':    'uint64',
3847     'txsession':    'uint32',
3848     '*rxsession':   'uint32',
3849     '*offset':      'uint32' } }
3852 # @NetdevVdeOptions:
3854 # Connect the VLAN to a vde switch running on the host.
3856 # @sock: socket path
3858 # @port: port number
3860 # @group: group owner of socket
3862 # @mode: permissions for socket
3864 # Since: 1.2
3866 { 'struct': 'NetdevVdeOptions',
3867   'data': {
3868     '*sock':  'str',
3869     '*port':  'uint16',
3870     '*group': 'str',
3871     '*mode':  'uint16' } }
3874 # @NetdevDumpOptions:
3876 # Dump VLAN network traffic to a file.
3878 # @len: per-packet size limit (64k default). Understands [TGMKkb]
3879 # suffixes.
3881 # @file: dump file path (default is qemu-vlan0.pcap)
3883 # Since: 1.2
3885 { 'struct': 'NetdevDumpOptions',
3886   'data': {
3887     '*len':  'size',
3888     '*file': 'str' } }
3891 # @NetdevBridgeOptions:
3893 # Connect a host TAP network interface to a host bridge device.
3895 # @br: bridge name
3897 # @helper: command to execute to configure bridge
3899 # Since: 1.2
3901 { 'struct': 'NetdevBridgeOptions',
3902   'data': {
3903     '*br':     'str',
3904     '*helper': 'str' } }
3907 # @NetdevHubPortOptions:
3909 # Connect two or more net clients through a software hub.
3911 # @hubid: hub identifier number
3913 # Since: 1.2
3915 { 'struct': 'NetdevHubPortOptions',
3916   'data': {
3917     'hubid':     'int32' } }
3920 # @NetdevNetmapOptions:
3922 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3924 # @ifname: Either the name of an existing network interface supported by
3925 #          netmap, or the name of a VALE port (created on the fly).
3926 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3927 #          YYY are non-negative integers. XXX identifies a switch and
3928 #          YYY identifies a port of the switch. VALE ports having the
3929 #          same XXX are therefore connected to the same switch.
3931 # @devname: path of the netmap device (default: '/dev/netmap').
3933 # Since: 2.0
3935 { 'struct': 'NetdevNetmapOptions',
3936   'data': {
3937     'ifname':     'str',
3938     '*devname':    'str' } }
3941 # @NetdevVhostUserOptions:
3943 # Vhost-user network backend
3945 # @chardev: name of a unix socket chardev
3947 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
3949 # @queues: number of queues to be created for multiqueue vhost-user
3950 #          (default: 1) (Since 2.5)
3952 # Since: 2.1
3954 { 'struct': 'NetdevVhostUserOptions',
3955   'data': {
3956     'chardev':        'str',
3957     '*vhostforce':    'bool',
3958     '*queues':        'int' } }
3961 # @NetClientDriver:
3963 # Available netdev drivers.
3965 # Since: 2.7
3967 { 'enum': 'NetClientDriver',
3968   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
3969             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
3972 # @Netdev:
3974 # Captures the configuration of a network device.
3976 # @id: identifier for monitor commands.
3978 # @type: Specify the driver used for interpreting remaining arguments.
3980 # Since: 1.2
3982 # 'l2tpv3' - since 2.1
3984 { 'union': 'Netdev',
3985   'base': { 'id': 'str', 'type': 'NetClientDriver' },
3986   'discriminator': 'type',
3987   'data': {
3988     'none':     'NetdevNoneOptions',
3989     'nic':      'NetLegacyNicOptions',
3990     'user':     'NetdevUserOptions',
3991     'tap':      'NetdevTapOptions',
3992     'l2tpv3':   'NetdevL2TPv3Options',
3993     'socket':   'NetdevSocketOptions',
3994     'vde':      'NetdevVdeOptions',
3995     'dump':     'NetdevDumpOptions',
3996     'bridge':   'NetdevBridgeOptions',
3997     'hubport':  'NetdevHubPortOptions',
3998     'netmap':   'NetdevNetmapOptions',
3999     'vhost-user': 'NetdevVhostUserOptions' } }
4002 # @NetLegacy:
4004 # Captures the configuration of a network device; legacy.
4006 # @vlan: vlan number
4008 # @id: identifier for monitor commands
4010 # @name: identifier for monitor commands, ignored if @id is present
4012 # @opts: device type specific properties (legacy)
4014 # Since: 1.2
4016 { 'struct': 'NetLegacy',
4017   'data': {
4018     '*vlan': 'int32',
4019     '*id':   'str',
4020     '*name': 'str',
4021     'opts':  'NetLegacyOptions' } }
4024 # @NetLegacyOptionsType:
4026 # Since: 1.2
4028 { 'enum': 'NetLegacyOptionsType',
4029   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
4030            'dump', 'bridge', 'netmap', 'vhost-user'] }
4033 # @NetLegacyOptions:
4035 # Like Netdev, but for use only by the legacy command line options
4037 # Since: 1.2
4039 { 'union': 'NetLegacyOptions',
4040   'base': { 'type': 'NetLegacyOptionsType' },
4041   'discriminator': 'type',
4042   'data': {
4043     'none':     'NetdevNoneOptions',
4044     'nic':      'NetLegacyNicOptions',
4045     'user':     'NetdevUserOptions',
4046     'tap':      'NetdevTapOptions',
4047     'l2tpv3':   'NetdevL2TPv3Options',
4048     'socket':   'NetdevSocketOptions',
4049     'vde':      'NetdevVdeOptions',
4050     'dump':     'NetdevDumpOptions',
4051     'bridge':   'NetdevBridgeOptions',
4052     'netmap':   'NetdevNetmapOptions',
4053     'vhost-user': 'NetdevVhostUserOptions' } }
4056 # @NetFilterDirection:
4058 # Indicates whether a netfilter is attached to a netdev's transmit queue or
4059 # receive queue or both.
4061 # @all: the filter is attached both to the receive and the transmit
4062 #       queue of the netdev (default).
4064 # @rx: the filter is attached to the receive queue of the netdev,
4065 #      where it will receive packets sent to the netdev.
4067 # @tx: the filter is attached to the transmit queue of the netdev,
4068 #      where it will receive packets sent by the netdev.
4070 # Since: 2.5
4072 { 'enum': 'NetFilterDirection',
4073   'data': [ 'all', 'rx', 'tx' ] }
4076 # @InetSocketAddressBase:
4078 # @host: host part of the address
4079 # @port: port part of the address
4081 { 'struct': 'InetSocketAddressBase',
4082   'data': {
4083     'host': 'str',
4084     'port': 'str' } }
4087 # @InetSocketAddress:
4089 # Captures a socket address or address range in the Internet namespace.
4091 # @numeric: true if the host/port are guaranteed to be numeric,
4092 #           false if name resolution should be attempted. Defaults to false.
4093 #           (Since 2.9)
4095 # @to: If present, this is range of possible addresses, with port
4096 #      between @port and @to.
4098 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4100 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4102 # Since: 1.3
4104 { 'struct': 'InetSocketAddress',
4105   'base': 'InetSocketAddressBase',
4106   'data': {
4107     '*numeric':  'bool',
4108     '*to': 'uint16',
4109     '*ipv4': 'bool',
4110     '*ipv6': 'bool' } }
4113 # @UnixSocketAddress:
4115 # Captures a socket address in the local ("Unix socket") namespace.
4117 # @path: filesystem path to use
4119 # Since: 1.3
4121 { 'struct': 'UnixSocketAddress',
4122   'data': {
4123     'path': 'str' } }
4126 # @VsockSocketAddress:
4128 # Captures a socket address in the vsock namespace.
4130 # @cid: unique host identifier
4131 # @port: port
4133 # Note: string types are used to allow for possible future hostname or
4134 # service resolution support.
4136 # Since: 2.8
4138 { 'struct': 'VsockSocketAddress',
4139   'data': {
4140     'cid': 'str',
4141     'port': 'str' } }
4144 # @SocketAddressLegacy:
4146 # Captures the address of a socket, which could also be a named file descriptor
4148 # Note: This type is deprecated in favor of SocketAddress.  The
4149 # difference between SocketAddressLegacy and SocketAddress is that the
4150 # latter is a flat union rather than a simple union. Flat is nicer
4151 # because it avoids nesting on the wire, i.e. that form has fewer {}.
4154 # Since: 1.3
4156 { 'union': 'SocketAddressLegacy',
4157   'data': {
4158     'inet': 'InetSocketAddress',
4159     'unix': 'UnixSocketAddress',
4160     'vsock': 'VsockSocketAddress',
4161     'fd': 'String' } }
4164 # @SocketAddressType:
4166 # Available SocketAddress types
4168 # @inet:  Internet address
4170 # @unix:  Unix domain socket
4172 # Since: 2.9
4174 { 'enum': 'SocketAddressType',
4175   'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
4178 # @SocketAddress:
4180 # Captures the address of a socket, which could also be a named file
4181 # descriptor
4183 # @type:       Transport type
4185 # Since: 2.9
4187 { 'union': 'SocketAddress',
4188   'base': { 'type': 'SocketAddressType' },
4189   'discriminator': 'type',
4190   'data': { 'inet': 'InetSocketAddress',
4191             'unix': 'UnixSocketAddress',
4192             'vsock': 'VsockSocketAddress',
4193             'fd': 'String' } }
4196 # @getfd:
4198 # Receive a file descriptor via SCM rights and assign it a name
4200 # @fdname: file descriptor name
4202 # Returns: Nothing on success
4204 # Since: 0.14.0
4206 # Notes: If @fdname already exists, the file descriptor assigned to
4207 #        it will be closed and replaced by the received file
4208 #        descriptor.
4210 #        The 'closefd' command can be used to explicitly close the
4211 #        file descriptor when it is no longer needed.
4213 # Example:
4215 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4216 # <- { "return": {} }
4219 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4222 # @closefd:
4224 # Close a file descriptor previously passed via SCM rights
4226 # @fdname: file descriptor name
4228 # Returns: Nothing on success
4230 # Since: 0.14.0
4232 # Example:
4234 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4235 # <- { "return": {} }
4238 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4241 # @MachineInfo:
4243 # Information describing a machine.
4245 # @name: the name of the machine
4247 # @alias: an alias for the machine name
4249 # @is-default: whether the machine is default
4251 # @cpu-max: maximum number of CPUs supported by the machine type
4252 #           (since 1.5.0)
4254 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4256 # Since: 1.2.0
4258 { 'struct': 'MachineInfo',
4259   'data': { 'name': 'str', '*alias': 'str',
4260             '*is-default': 'bool', 'cpu-max': 'int',
4261             'hotpluggable-cpus': 'bool'} }
4264 # @query-machines:
4266 # Return a list of supported machines
4268 # Returns: a list of MachineInfo
4270 # Since: 1.2.0
4272 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4275 # @CpuDefinitionInfo:
4277 # Virtual CPU definition.
4279 # @name: the name of the CPU definition
4281 # @migration-safe: whether a CPU definition can be safely used for
4282 #                  migration in combination with a QEMU compatibility machine
4283 #                  when migrating between different QMU versions and between
4284 #                  hosts with different sets of (hardware or software)
4285 #                  capabilities. If not provided, information is not available
4286 #                  and callers should not assume the CPU definition to be
4287 #                  migration-safe. (since 2.8)
4289 # @static: whether a CPU definition is static and will not change depending on
4290 #          QEMU version, machine type, machine options and accelerator options.
4291 #          A static model is always migration-safe. (since 2.8)
4293 # @unavailable-features: List of properties that prevent
4294 #                        the CPU model from running in the current
4295 #                        host. (since 2.8)
4296 # @typename: Type name that can be used as argument to @device-list-properties,
4297 #            to introspect properties configurable using -cpu or -global.
4298 #            (since 2.9)
4300 # @unavailable-features is a list of QOM property names that
4301 # represent CPU model attributes that prevent the CPU from running.
4302 # If the QOM property is read-only, that means there's no known
4303 # way to make the CPU model run in the current host. Implementations
4304 # that choose not to provide specific information return the
4305 # property name "type".
4306 # If the property is read-write, it means that it MAY be possible
4307 # to run the CPU model in the current host if that property is
4308 # changed. Management software can use it as hints to suggest or
4309 # choose an alternative for the user, or just to generate meaningful
4310 # error messages explaining why the CPU model can't be used.
4311 # If @unavailable-features is an empty list, the CPU model is
4312 # runnable using the current host and machine-type.
4313 # If @unavailable-features is not present, runnability
4314 # information for the CPU is not available.
4316 # Since: 1.2.0
4318 { 'struct': 'CpuDefinitionInfo',
4319   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4320             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4323 # @query-cpu-definitions:
4325 # Return a list of supported virtual CPU definitions
4327 # Returns: a list of CpuDefInfo
4329 # Since: 1.2.0
4331 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4334 # @CpuModelInfo:
4336 # Virtual CPU model.
4338 # A CPU model consists of the name of a CPU definition, to which
4339 # delta changes are applied (e.g. features added/removed). Most magic values
4340 # that an architecture might require should be hidden behind the name.
4341 # However, if required, architectures can expose relevant properties.
4343 # @name: the name of the CPU definition the model is based on
4344 # @props: a dictionary of QOM properties to be applied
4346 # Since: 2.8.0
4348 { 'struct': 'CpuModelInfo',
4349   'data': { 'name': 'str',
4350             '*props': 'any' } }
4353 # @CpuModelExpansionType:
4355 # An enumeration of CPU model expansion types.
4357 # @static: Expand to a static CPU model, a combination of a static base
4358 #          model name and property delta changes. As the static base model will
4359 #          never change, the expanded CPU model will be the same, independant of
4360 #          independent of QEMU version, machine type, machine options, and
4361 #          accelerator options. Therefore, the resulting model can be used by
4362 #          tooling without having to specify a compatibility machine - e.g. when
4363 #          displaying the "host" model. static CPU models are migration-safe.
4365 # @full: Expand all properties. The produced model is not guaranteed to be
4366 #        migration-safe, but allows tooling to get an insight and work with
4367 #        model details.
4369 # Note: When a non-migration-safe CPU model is expanded in static mode, some
4370 # features enabled by the CPU model may be omitted, because they can't be
4371 # implemented by a static CPU model definition (e.g. cache info passthrough and
4372 # PMU passthrough in x86). If you need an accurate representation of the
4373 # features enabled by a non-migration-safe CPU model, use @full. If you need a
4374 # static representation that will keep ABI compatibility even when changing QEMU
4375 # version or machine-type, use @static (but keep in mind that some features may
4376 # be omitted).
4378 # Since: 2.8.0
4380 { 'enum': 'CpuModelExpansionType',
4381   'data': [ 'static', 'full' ] }
4385 # @CpuModelExpansionInfo:
4387 # The result of a cpu model expansion.
4389 # @model: the expanded CpuModelInfo.
4391 # Since: 2.8.0
4393 { 'struct': 'CpuModelExpansionInfo',
4394   'data': { 'model': 'CpuModelInfo' } }
4398 # @query-cpu-model-expansion:
4400 # Expands a given CPU model (or a combination of CPU model + additional options)
4401 # to different granularities, allowing tooling to get an understanding what a
4402 # specific CPU model looks like in QEMU under a certain configuration.
4404 # This interface can be used to query the "host" CPU model.
4406 # The data returned by this command may be affected by:
4408 # * QEMU version: CPU models may look different depending on the QEMU version.
4409 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4410 # * machine-type: CPU model  may look different depending on the machine-type.
4411 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4412 # * machine options (including accelerator): in some architectures, CPU models
4413 #   may look different depending on machine and accelerator options. (Except for
4414 #   CPU models reported as "static" in query-cpu-definitions.)
4415 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4416 #   global properties may affect expansion of CPU models. Using
4417 #   query-cpu-model-expansion while using these is not advised.
4419 # Some architectures may not support all expansion types. s390x supports
4420 # "full" and "static".
4422 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4423 #          not supported, if the model cannot be expanded, if the model contains
4424 #          an unknown CPU definition name, unknown properties or properties
4425 #          with a wrong type. Also returns an error if an expansion type is
4426 #          not supported.
4428 # Since: 2.8.0
4430 { 'command': 'query-cpu-model-expansion',
4431   'data': { 'type': 'CpuModelExpansionType',
4432             'model': 'CpuModelInfo' },
4433   'returns': 'CpuModelExpansionInfo' }
4436 # @CpuModelCompareResult:
4438 # An enumeration of CPU model comparation results. The result is usually
4439 # calculated using e.g. CPU features or CPU generations.
4441 # @incompatible: If model A is incompatible to model B, model A is not
4442 #                guaranteed to run where model B runs and the other way around.
4444 # @identical: If model A is identical to model B, model A is guaranteed to run
4445 #             where model B runs and the other way around.
4447 # @superset: If model A is a superset of model B, model B is guaranteed to run
4448 #            where model A runs. There are no guarantees about the other way.
4450 # @subset: If model A is a subset of model B, model A is guaranteed to run
4451 #          where model B runs. There are no guarantees about the other way.
4453 # Since: 2.8.0
4455 { 'enum': 'CpuModelCompareResult',
4456   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4459 # @CpuModelCompareInfo:
4461 # The result of a CPU model comparison.
4463 # @result: The result of the compare operation.
4464 # @responsible-properties: List of properties that led to the comparison result
4465 #                          not being identical.
4467 # @responsible-properties is a list of QOM property names that led to
4468 # both CPUs not being detected as identical. For identical models, this
4469 # list is empty.
4470 # If a QOM property is read-only, that means there's no known way to make the
4471 # CPU models identical. If the special property name "type" is included, the
4472 # models are by definition not identical and cannot be made identical.
4474 # Since: 2.8.0
4476 { 'struct': 'CpuModelCompareInfo',
4477   'data': {'result': 'CpuModelCompareResult',
4478            'responsible-properties': ['str']
4479           }
4483 # @query-cpu-model-comparison:
4485 # Compares two CPU models, returning how they compare in a specific
4486 # configuration. The results indicates how both models compare regarding
4487 # runnability. This result can be used by tooling to make decisions if a
4488 # certain CPU model will run in a certain configuration or if a compatible
4489 # CPU model has to be created by baselining.
4491 # Usually, a CPU model is compared against the maximum possible CPU model
4492 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4493 # model is identical or a subset, it will run in that configuration.
4495 # The result returned by this command may be affected by:
4497 # * QEMU version: CPU models may look different depending on the QEMU version.
4498 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4499 # * machine-type: CPU model may look different depending on the machine-type.
4500 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4501 # * machine options (including accelerator): in some architectures, CPU models
4502 #   may look different depending on machine and accelerator options. (Except for
4503 #   CPU models reported as "static" in query-cpu-definitions.)
4504 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4505 #   global properties may affect expansion of CPU models. Using
4506 #   query-cpu-model-expansion while using these is not advised.
4508 # Some architectures may not support comparing CPU models. s390x supports
4509 # comparing CPU models.
4511 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4512 #          not supported, if a model cannot be used, if a model contains
4513 #          an unknown cpu definition name, unknown properties or properties
4514 #          with wrong types.
4516 # Since: 2.8.0
4518 { 'command': 'query-cpu-model-comparison',
4519   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4520   'returns': 'CpuModelCompareInfo' }
4523 # @CpuModelBaselineInfo:
4525 # The result of a CPU model baseline.
4527 # @model: the baselined CpuModelInfo.
4529 # Since: 2.8.0
4531 { 'struct': 'CpuModelBaselineInfo',
4532   'data': { 'model': 'CpuModelInfo' } }
4535 # @query-cpu-model-baseline:
4537 # Baseline two CPU models, creating a compatible third model. The created
4538 # model will always be a static, migration-safe CPU model (see "static"
4539 # CPU model expansion for details).
4541 # This interface can be used by tooling to create a compatible CPU model out
4542 # two CPU models. The created CPU model will be identical to or a subset of
4543 # both CPU models when comparing them. Therefore, the created CPU model is
4544 # guaranteed to run where the given CPU models run.
4546 # The result returned by this command may be affected by:
4548 # * QEMU version: CPU models may look different depending on the QEMU version.
4549 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4550 # * machine-type: CPU model may look different depending on the machine-type.
4551 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4552 # * machine options (including accelerator): in some architectures, CPU models
4553 #   may look different depending on machine and accelerator options. (Except for
4554 #   CPU models reported as "static" in query-cpu-definitions.)
4555 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4556 #   global properties may affect expansion of CPU models. Using
4557 #   query-cpu-model-expansion while using these is not advised.
4559 # Some architectures may not support baselining CPU models. s390x supports
4560 # baselining CPU models.
4562 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4563 #          not supported, if a model cannot be used, if a model contains
4564 #          an unknown cpu definition name, unknown properties or properties
4565 #          with wrong types.
4567 # Since: 2.8.0
4569 { 'command': 'query-cpu-model-baseline',
4570   'data': { 'modela': 'CpuModelInfo',
4571             'modelb': 'CpuModelInfo' },
4572   'returns': 'CpuModelBaselineInfo' }
4575 # @AddfdInfo:
4577 # Information about a file descriptor that was added to an fd set.
4579 # @fdset-id: The ID of the fd set that @fd was added to.
4581 # @fd: The file descriptor that was received via SCM rights and
4582 #      added to the fd set.
4584 # Since: 1.2.0
4586 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4589 # @add-fd:
4591 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4593 # @fdset-id: The ID of the fd set to add the file descriptor to.
4595 # @opaque: A free-form string that can be used to describe the fd.
4597 # Returns: @AddfdInfo on success
4599 #          If file descriptor was not received, FdNotSupplied
4601 #          If @fdset-id is a negative value, InvalidParameterValue
4603 # Notes: The list of fd sets is shared by all monitor connections.
4605 #        If @fdset-id is not specified, a new fd set will be created.
4607 # Since: 1.2.0
4609 # Example:
4611 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4612 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4615 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4616   'returns': 'AddfdInfo' }
4619 # @remove-fd:
4621 # Remove a file descriptor from an fd set.
4623 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4625 # @fd: The file descriptor that is to be removed.
4627 # Returns: Nothing on success
4628 #          If @fdset-id or @fd is not found, FdNotFound
4630 # Since: 1.2.0
4632 # Notes: The list of fd sets is shared by all monitor connections.
4634 #        If @fd is not specified, all file descriptors in @fdset-id
4635 #        will be removed.
4637 # Example:
4639 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4640 # <- { "return": {} }
4643 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4646 # @FdsetFdInfo:
4648 # Information about a file descriptor that belongs to an fd set.
4650 # @fd: The file descriptor value.
4652 # @opaque: A free-form string that can be used to describe the fd.
4654 # Since: 1.2.0
4656 { 'struct': 'FdsetFdInfo',
4657   'data': {'fd': 'int', '*opaque': 'str'} }
4660 # @FdsetInfo:
4662 # Information about an fd set.
4664 # @fdset-id: The ID of the fd set.
4666 # @fds: A list of file descriptors that belong to this fd set.
4668 # Since: 1.2.0
4670 { 'struct': 'FdsetInfo',
4671   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4674 # @query-fdsets:
4676 # Return information describing all fd sets.
4678 # Returns: A list of @FdsetInfo
4680 # Since: 1.2.0
4682 # Note: The list of fd sets is shared by all monitor connections.
4684 # Example:
4686 # -> { "execute": "query-fdsets" }
4687 # <- { "return": [
4688 #        {
4689 #          "fds": [
4690 #            {
4691 #              "fd": 30,
4692 #              "opaque": "rdonly:/path/to/file"
4693 #            },
4694 #            {
4695 #              "fd": 24,
4696 #              "opaque": "rdwr:/path/to/file"
4697 #            }
4698 #          ],
4699 #          "fdset-id": 1
4700 #        },
4701 #        {
4702 #          "fds": [
4703 #            {
4704 #              "fd": 28
4705 #            },
4706 #            {
4707 #              "fd": 29
4708 #            }
4709 #          ],
4710 #          "fdset-id": 0
4711 #        }
4712 #      ]
4713 #    }
4716 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4719 # @TargetInfo:
4721 # Information describing the QEMU target.
4723 # @arch: the target architecture (eg "x86_64", "i386", etc)
4725 # Since: 1.2.0
4727 { 'struct': 'TargetInfo',
4728   'data': { 'arch': 'str' } }
4731 # @query-target:
4733 # Return information about the target for this QEMU
4735 # Returns: TargetInfo
4737 # Since: 1.2.0
4739 { 'command': 'query-target', 'returns': 'TargetInfo' }
4742 # @QKeyCode:
4744 # An enumeration of key name.
4746 # This is used by the @send-key command.
4748 # @unmapped: since 2.0
4749 # @pause: since 2.0
4750 # @ro: since 2.4
4751 # @kp_comma: since 2.4
4752 # @kp_equals: since 2.6
4753 # @power: since 2.6
4754 # @hiragana: since 2.9
4755 # @henkan: since 2.9
4756 # @yen: since 2.9
4758 # Since: 1.3.0
4761 { 'enum': 'QKeyCode',
4762   'data': [ 'unmapped',
4763             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
4764             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4765             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4766             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4767             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4768             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4769             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4770             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4771             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4772             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4773             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4774             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4775             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4776             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4777             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4778             'ro', 'hiragana', 'henkan', 'yen',
4779             'kp_comma', 'kp_equals', 'power' ] }
4782 # @KeyValue:
4784 # Represents a keyboard key.
4786 # Since: 1.3.0
4788 { 'union': 'KeyValue',
4789   'data': {
4790     'number': 'int',
4791     'qcode': 'QKeyCode' } }
4794 # @send-key:
4796 # Send keys to guest.
4798 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4799 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4800 #        directly to the guest, while @KeyValue.qcode must be a valid
4801 #        @QKeyCode value
4803 # @hold-time: time to delay key up events, milliseconds. Defaults
4804 #             to 100
4806 # Returns: Nothing on success
4807 #          If key is unknown or redundant, InvalidParameter
4809 # Since: 1.3.0
4811 # Example:
4813 # -> { "execute": "send-key",
4814 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4815 #                               { "type": "qcode", "data": "alt" },
4816 #                               { "type": "qcode", "data": "delete" } ] } }
4817 # <- { "return": {} }
4820 { 'command': 'send-key',
4821   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4824 # @screendump:
4826 # Write a PPM of the VGA screen to a file.
4828 # @filename: the path of a new PPM file to store the image
4830 # Returns: Nothing on success
4832 # Since: 0.14.0
4834 # Example:
4836 # -> { "execute": "screendump",
4837 #      "arguments": { "filename": "/tmp/image" } }
4838 # <- { "return": {} }
4841 { 'command': 'screendump', 'data': {'filename': 'str'} }
4845 # @ChardevCommon:
4847 # Configuration shared across all chardev backends
4849 # @logfile: The name of a logfile to save output
4850 # @logappend: true to append instead of truncate
4851 #             (default to false to truncate)
4853 # Since: 2.6
4855 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4856                                        '*logappend': 'bool' } }
4859 # @ChardevFile:
4861 # Configuration info for file chardevs.
4863 # @in:  The name of the input file
4864 # @out: The name of the output file
4865 # @append: Open the file in append mode (default false to
4866 #          truncate) (Since 2.6)
4868 # Since: 1.4
4870 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4871                                    'out' : 'str',
4872                                    '*append': 'bool' },
4873   'base': 'ChardevCommon' }
4876 # @ChardevHostdev:
4878 # Configuration info for device and pipe chardevs.
4880 # @device: The name of the special file for the device,
4881 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4883 # Since: 1.4
4885 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4886   'base': 'ChardevCommon' }
4889 # @ChardevSocket:
4891 # Configuration info for (stream) socket chardevs.
4893 # @addr: socket address to listen on (server=true)
4894 #        or connect to (server=false)
4895 # @tls-creds: the ID of the TLS credentials object (since 2.6)
4896 # @server: create server socket (default: true)
4897 # @wait: wait for incoming connection on server
4898 #        sockets (default: false).
4899 # @nodelay: set TCP_NODELAY socket option (default: false)
4900 # @telnet: enable telnet protocol on server
4901 #          sockets (default: false)
4902 # @tn3270: enable tn3270 protocol on server
4903 #          sockets (default: false) (Since: 2.10)
4904 # @reconnect: For a client socket, if a socket is disconnected,
4905 #          then attempt a reconnect after the given number of seconds.
4906 #          Setting this to zero disables this function. (default: 0)
4907 #          (Since: 2.2)
4909 # Since: 1.4
4911 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddressLegacy',
4912                                      '*tls-creds'  : 'str',
4913                                      '*server'    : 'bool',
4914                                      '*wait'      : 'bool',
4915                                      '*nodelay'   : 'bool',
4916                                      '*telnet'    : 'bool',
4917                                      '*tn3270'    : 'bool',
4918                                      '*reconnect' : 'int' },
4919   'base': 'ChardevCommon' }
4922 # @ChardevUdp:
4924 # Configuration info for datagram socket chardevs.
4926 # @remote: remote address
4927 # @local: local address
4929 # Since: 1.5
4931 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
4932                                   '*local' : 'SocketAddressLegacy' },
4933   'base': 'ChardevCommon' }
4936 # @ChardevMux:
4938 # Configuration info for mux chardevs.
4940 # @chardev: name of the base chardev.
4942 # Since: 1.5
4944 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
4945   'base': 'ChardevCommon' }
4948 # @ChardevStdio:
4950 # Configuration info for stdio chardevs.
4952 # @signal: Allow signals (such as SIGINT triggered by ^C)
4953 #          be delivered to qemu.  Default: true in -nographic mode,
4954 #          false otherwise.
4956 # Since: 1.5
4958 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
4959   'base': 'ChardevCommon' }
4963 # @ChardevSpiceChannel:
4965 # Configuration info for spice vm channel chardevs.
4967 # @type: kind of channel (for example vdagent).
4969 # Since: 1.5
4971 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
4972   'base': 'ChardevCommon' }
4975 # @ChardevSpicePort:
4977 # Configuration info for spice port chardevs.
4979 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
4981 # Since: 1.5
4983 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
4984   'base': 'ChardevCommon' }
4987 # @ChardevVC:
4989 # Configuration info for virtual console chardevs.
4991 # @width:  console width,  in pixels
4992 # @height: console height, in pixels
4993 # @cols:   console width,  in chars
4994 # @rows:   console height, in chars
4996 # Since: 1.5
4998 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
4999                                  '*height' : 'int',
5000                                  '*cols'   : 'int',
5001                                  '*rows'   : 'int' },
5002   'base': 'ChardevCommon' }
5005 # @ChardevRingbuf:
5007 # Configuration info for ring buffer chardevs.
5009 # @size: ring buffer size, must be power of two, default is 65536
5011 # Since: 1.5
5013 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
5014   'base': 'ChardevCommon' }
5017 # @ChardevBackend:
5019 # Configuration info for the new chardev backend.
5021 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
5023 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
5024                                        'serial' : 'ChardevHostdev',
5025                                        'parallel': 'ChardevHostdev',
5026                                        'pipe'   : 'ChardevHostdev',
5027                                        'socket' : 'ChardevSocket',
5028                                        'udp'    : 'ChardevUdp',
5029                                        'pty'    : 'ChardevCommon',
5030                                        'null'   : 'ChardevCommon',
5031                                        'mux'    : 'ChardevMux',
5032                                        'msmouse': 'ChardevCommon',
5033                                        'wctablet' : 'ChardevCommon',
5034                                        'braille': 'ChardevCommon',
5035                                        'testdev': 'ChardevCommon',
5036                                        'stdio'  : 'ChardevStdio',
5037                                        'console': 'ChardevCommon',
5038                                        'spicevmc' : 'ChardevSpiceChannel',
5039                                        'spiceport' : 'ChardevSpicePort',
5040                                        'vc'     : 'ChardevVC',
5041                                        'ringbuf': 'ChardevRingbuf',
5042                                        # next one is just for compatibility
5043                                        'memory' : 'ChardevRingbuf' } }
5046 # @ChardevReturn:
5048 # Return info about the chardev backend just created.
5050 # @pty: name of the slave pseudoterminal device, present if
5051 #       and only if a chardev of type 'pty' was created
5053 # Since: 1.4
5055 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
5058 # @chardev-add:
5060 # Add a character device backend
5062 # @id: the chardev's ID, must be unique
5063 # @backend: backend type and parameters
5065 # Returns: ChardevReturn.
5067 # Since: 1.4
5069 # Example:
5071 # -> { "execute" : "chardev-add",
5072 #      "arguments" : { "id" : "foo",
5073 #                      "backend" : { "type" : "null", "data" : {} } } }
5074 # <- { "return": {} }
5076 # -> { "execute" : "chardev-add",
5077 #      "arguments" : { "id" : "bar",
5078 #                      "backend" : { "type" : "file",
5079 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
5080 # <- { "return": {} }
5082 # -> { "execute" : "chardev-add",
5083 #      "arguments" : { "id" : "baz",
5084 #                      "backend" : { "type" : "pty", "data" : {} } } }
5085 # <- { "return": { "pty" : "/dev/pty/42" } }
5088 { 'command': 'chardev-add', 'data': {'id'      : 'str',
5089                                      'backend' : 'ChardevBackend' },
5090   'returns': 'ChardevReturn' }
5093 # @chardev-change:
5095 # Change a character device backend
5097 # @id: the chardev's ID, must exist
5098 # @backend: new backend type and parameters
5100 # Returns: ChardevReturn.
5102 # Since: 2.10
5104 # Example:
5106 # -> { "execute" : "chardev-change",
5107 #      "arguments" : { "id" : "baz",
5108 #                      "backend" : { "type" : "pty", "data" : {} } } }
5109 # <- { "return": { "pty" : "/dev/pty/42" } }
5111 # -> {"execute" : "chardev-change",
5112 #     "arguments" : {
5113 #         "id" : "charchannel2",
5114 #         "backend" : {
5115 #             "type" : "socket",
5116 #             "data" : {
5117 #                 "addr" : {
5118 #                     "type" : "unix" ,
5119 #                     "data" : {
5120 #                         "path" : "/tmp/charchannel2.socket"
5121 #                     }
5122 #                  },
5123 #                  "server" : true,
5124 #                  "wait" : false }}}}
5125 # <- {"return": {}}
5128 { 'command': 'chardev-change', 'data': {'id'      : 'str',
5129                                         'backend' : 'ChardevBackend' },
5130   'returns': 'ChardevReturn' }
5133 # @chardev-remove:
5135 # Remove a character device backend
5137 # @id: the chardev's ID, must exist and not be in use
5139 # Returns: Nothing on success
5141 # Since: 1.4
5143 # Example:
5145 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
5146 # <- { "return": {} }
5149 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
5152 # @chardev-send-break:
5154 # Send a break to a character device
5156 # @id: the chardev's ID, must exist
5158 # Returns: Nothing on success
5160 # Since: 2.10
5162 # Example:
5164 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
5165 # <- { "return": {} }
5168 { 'command': 'chardev-send-break', 'data': {'id': 'str'} }
5172 # @TpmModel:
5174 # An enumeration of TPM models
5176 # @tpm-tis: TPM TIS model
5178 # Since: 1.5
5180 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
5183 # @query-tpm-models:
5185 # Return a list of supported TPM models
5187 # Returns: a list of TpmModel
5189 # Since: 1.5
5191 # Example:
5193 # -> { "execute": "query-tpm-models" }
5194 # <- { "return": [ "tpm-tis" ] }
5197 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5200 # @TpmType:
5202 # An enumeration of TPM types
5204 # @passthrough: TPM passthrough type
5206 # Since: 1.5
5208 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5211 # @query-tpm-types:
5213 # Return a list of supported TPM types
5215 # Returns: a list of TpmType
5217 # Since: 1.5
5219 # Example:
5221 # -> { "execute": "query-tpm-types" }
5222 # <- { "return": [ "passthrough" ] }
5225 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5228 # @TPMPassthroughOptions:
5230 # Information about the TPM passthrough type
5232 # @path: string describing the path used for accessing the TPM device
5234 # @cancel-path: string showing the TPM's sysfs cancel file
5235 #               for cancellation of TPM commands while they are executing
5237 # Since: 1.5
5239 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
5240                                              '*cancel-path' : 'str'} }
5243 # @TpmTypeOptions:
5245 # A union referencing different TPM backend types' configuration options
5247 # @type: 'passthrough' The configuration options for the TPM passthrough type
5249 # Since: 1.5
5251 { 'union': 'TpmTypeOptions',
5252    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
5255 # @TPMInfo:
5257 # Information about the TPM
5259 # @id: The Id of the TPM
5261 # @model: The TPM frontend model
5263 # @options: The TPM (backend) type configuration options
5265 # Since: 1.5
5267 { 'struct': 'TPMInfo',
5268   'data': {'id': 'str',
5269            'model': 'TpmModel',
5270            'options': 'TpmTypeOptions' } }
5273 # @query-tpm:
5275 # Return information about the TPM device
5277 # Returns: @TPMInfo on success
5279 # Since: 1.5
5281 # Example:
5283 # -> { "execute": "query-tpm" }
5284 # <- { "return":
5285 #      [
5286 #        { "model": "tpm-tis",
5287 #          "options":
5288 #            { "type": "passthrough",
5289 #              "data":
5290 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5291 #                  "path": "/dev/tpm0"
5292 #                }
5293 #            },
5294 #          "id": "tpm0"
5295 #        }
5296 #      ]
5297 #    }
5300 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5303 # @AcpiTableOptions:
5305 # Specify an ACPI table on the command line to load.
5307 # At most one of @file and @data can be specified. The list of files specified
5308 # by any one of them is loaded and concatenated in order. If both are omitted,
5309 # @data is implied.
5311 # Other fields / optargs can be used to override fields of the generic ACPI
5312 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5313 # Description Table Header. If a header field is not overridden, then the
5314 # corresponding value from the concatenated blob is used (in case of @file), or
5315 # it is filled in with a hard-coded value (in case of @data).
5317 # String fields are copied into the matching ACPI member from lowest address
5318 # upwards, and silently truncated / NUL-padded to length.
5320 # @sig: table signature / identifier (4 bytes)
5322 # @rev: table revision number (dependent on signature, 1 byte)
5324 # @oem_id: OEM identifier (6 bytes)
5326 # @oem_table_id: OEM table identifier (8 bytes)
5328 # @oem_rev: OEM-supplied revision number (4 bytes)
5330 # @asl_compiler_id: identifier of the utility that created the table
5331 #                   (4 bytes)
5333 # @asl_compiler_rev: revision number of the utility that created the
5334 #                    table (4 bytes)
5336 # @file: colon (:) separated list of pathnames to load and
5337 #        concatenate as table data. The resultant binary blob is expected to
5338 #        have an ACPI table header. At least one file is required. This field
5339 #        excludes @data.
5341 # @data: colon (:) separated list of pathnames to load and
5342 #        concatenate as table data. The resultant binary blob must not have an
5343 #        ACPI table header. At least one file is required. This field excludes
5344 #        @file.
5346 # Since: 1.5
5348 { 'struct': 'AcpiTableOptions',
5349   'data': {
5350     '*sig':               'str',
5351     '*rev':               'uint8',
5352     '*oem_id':            'str',
5353     '*oem_table_id':      'str',
5354     '*oem_rev':           'uint32',
5355     '*asl_compiler_id':   'str',
5356     '*asl_compiler_rev':  'uint32',
5357     '*file':              'str',
5358     '*data':              'str' }}
5361 # @CommandLineParameterType:
5363 # Possible types for an option parameter.
5365 # @string: accepts a character string
5367 # @boolean: accepts "on" or "off"
5369 # @number: accepts a number
5371 # @size: accepts a number followed by an optional suffix (K)ilo,
5372 #        (M)ega, (G)iga, (T)era
5374 # Since: 1.5
5376 { 'enum': 'CommandLineParameterType',
5377   'data': ['string', 'boolean', 'number', 'size'] }
5380 # @CommandLineParameterInfo:
5382 # Details about a single parameter of a command line option.
5384 # @name: parameter name
5386 # @type: parameter @CommandLineParameterType
5388 # @help: human readable text string, not suitable for parsing.
5390 # @default: default value string (since 2.1)
5392 # Since: 1.5
5394 { 'struct': 'CommandLineParameterInfo',
5395   'data': { 'name': 'str',
5396             'type': 'CommandLineParameterType',
5397             '*help': 'str',
5398             '*default': 'str' } }
5401 # @CommandLineOptionInfo:
5403 # Details about a command line option, including its list of parameter details
5405 # @option: option name
5407 # @parameters: an array of @CommandLineParameterInfo
5409 # Since: 1.5
5411 { 'struct': 'CommandLineOptionInfo',
5412   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5415 # @query-command-line-options:
5417 # Query command line option schema.
5419 # @option: option name
5421 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5422 #          @option).  Returns an error if the given @option doesn't exist.
5424 # Since: 1.5
5426 # Example:
5428 # -> { "execute": "query-command-line-options",
5429 #      "arguments": { "option": "option-rom" } }
5430 # <- { "return": [
5431 #         {
5432 #             "parameters": [
5433 #                 {
5434 #                     "name": "romfile",
5435 #                     "type": "string"
5436 #                 },
5437 #                 {
5438 #                     "name": "bootindex",
5439 #                     "type": "number"
5440 #                 }
5441 #             ],
5442 #             "option": "option-rom"
5443 #         }
5444 #      ]
5445 #    }
5448 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5449  'returns': ['CommandLineOptionInfo'] }
5452 # @X86CPURegister32:
5454 # A X86 32-bit register
5456 # Since: 1.5
5458 { 'enum': 'X86CPURegister32',
5459   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5462 # @X86CPUFeatureWordInfo:
5464 # Information about a X86 CPU feature word
5466 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5468 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
5469 #                   feature word
5471 # @cpuid-register: Output register containing the feature bits
5473 # @features: value of output register, containing the feature bits
5475 # Since: 1.5
5477 { 'struct': 'X86CPUFeatureWordInfo',
5478   'data': { 'cpuid-input-eax': 'int',
5479             '*cpuid-input-ecx': 'int',
5480             'cpuid-register': 'X86CPURegister32',
5481             'features': 'int' } }
5484 # @DummyForceArrays:
5486 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5488 # Since: 2.5
5490 { 'struct': 'DummyForceArrays',
5491   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5495 # @RxState:
5497 # Packets receiving state
5499 # @normal: filter assigned packets according to the mac-table
5501 # @none: don't receive any assigned packet
5503 # @all: receive all assigned packets
5505 # Since: 1.6
5507 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5510 # @RxFilterInfo:
5512 # Rx-filter information for a NIC.
5514 # @name: net client name
5516 # @promiscuous: whether promiscuous mode is enabled
5518 # @multicast: multicast receive state
5520 # @unicast: unicast receive state
5522 # @vlan: vlan receive state (Since 2.0)
5524 # @broadcast-allowed: whether to receive broadcast
5526 # @multicast-overflow: multicast table is overflowed or not
5528 # @unicast-overflow: unicast table is overflowed or not
5530 # @main-mac: the main macaddr string
5532 # @vlan-table: a list of active vlan id
5534 # @unicast-table: a list of unicast macaddr string
5536 # @multicast-table: a list of multicast macaddr string
5538 # Since: 1.6
5540 { 'struct': 'RxFilterInfo',
5541   'data': {
5542     'name':               'str',
5543     'promiscuous':        'bool',
5544     'multicast':          'RxState',
5545     'unicast':            'RxState',
5546     'vlan':               'RxState',
5547     'broadcast-allowed':  'bool',
5548     'multicast-overflow': 'bool',
5549     'unicast-overflow':   'bool',
5550     'main-mac':           'str',
5551     'vlan-table':         ['int'],
5552     'unicast-table':      ['str'],
5553     'multicast-table':    ['str'] }}
5556 # @query-rx-filter:
5558 # Return rx-filter information for all NICs (or for the given NIC).
5560 # @name: net client name
5562 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5563 #          Returns an error if the given @name doesn't exist, or given
5564 #          NIC doesn't support rx-filter querying, or given net client
5565 #          isn't a NIC.
5567 # Since: 1.6
5569 # Example:
5571 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5572 # <- { "return": [
5573 #         {
5574 #             "promiscuous": true,
5575 #             "name": "vnet0",
5576 #             "main-mac": "52:54:00:12:34:56",
5577 #             "unicast": "normal",
5578 #             "vlan": "normal",
5579 #             "vlan-table": [
5580 #                 4,
5581 #                 0
5582 #             ],
5583 #             "unicast-table": [
5584 #             ],
5585 #             "multicast": "normal",
5586 #             "multicast-overflow": false,
5587 #             "unicast-overflow": false,
5588 #             "multicast-table": [
5589 #                 "01:00:5e:00:00:01",
5590 #                 "33:33:00:00:00:01",
5591 #                 "33:33:ff:12:34:56"
5592 #             ],
5593 #             "broadcast-allowed": false
5594 #         }
5595 #       ]
5596 #    }
5599 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5600   'returns': ['RxFilterInfo'] }
5603 # @InputButton:
5605 # Button of a pointer input device (mouse, tablet).
5607 # @side: front side button of a 5-button mouse (since 2.9)
5609 # @extra: rear side button of a 5-button mouse (since 2.9)
5611 # Since: 2.0
5613 { 'enum'  : 'InputButton',
5614   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5615   'extra' ] }
5618 # @InputAxis:
5620 # Position axis of a pointer input device (mouse, tablet).
5622 # Since: 2.0
5624 { 'enum'  : 'InputAxis',
5625   'data'  : [ 'x', 'y' ] }
5628 # @InputKeyEvent:
5630 # Keyboard input event.
5632 # @key:    Which key this event is for.
5633 # @down:   True for key-down and false for key-up events.
5635 # Since: 2.0
5637 { 'struct'  : 'InputKeyEvent',
5638   'data'  : { 'key'     : 'KeyValue',
5639               'down'    : 'bool' } }
5642 # @InputBtnEvent:
5644 # Pointer button input event.
5646 # @button: Which button this event is for.
5647 # @down:   True for key-down and false for key-up events.
5649 # Since: 2.0
5651 { 'struct'  : 'InputBtnEvent',
5652   'data'  : { 'button'  : 'InputButton',
5653               'down'    : 'bool' } }
5656 # @InputMoveEvent:
5658 # Pointer motion input event.
5660 # @axis:   Which axis is referenced by @value.
5661 # @value:  Pointer position.  For absolute coordinates the
5662 #          valid range is 0 -> 0x7ffff
5664 # Since: 2.0
5666 { 'struct'  : 'InputMoveEvent',
5667   'data'  : { 'axis'    : 'InputAxis',
5668               'value'   : 'int' } }
5671 # @InputEvent:
5673 # Input event union.
5675 # @type: the input type, one of:
5676 #  - 'key': Input event of Keyboard
5677 #  - 'btn': Input event of pointer buttons
5678 #  - 'rel': Input event of relative pointer motion
5679 #  - 'abs': Input event of absolute pointer motion
5681 # Since: 2.0
5683 { 'union' : 'InputEvent',
5684   'data'  : { 'key'     : 'InputKeyEvent',
5685               'btn'     : 'InputBtnEvent',
5686               'rel'     : 'InputMoveEvent',
5687               'abs'     : 'InputMoveEvent' } }
5690 # @input-send-event:
5692 # Send input event(s) to guest.
5694 # @device: display device to send event(s) to.
5695 # @head: head to send event(s) to, in case the
5696 #        display device supports multiple scanouts.
5697 # @events: List of InputEvent union.
5699 # Returns: Nothing on success.
5701 # The @device and @head parameters can be used to send the input event
5702 # to specific input devices in case (a) multiple input devices of the
5703 # same kind are added to the virtual machine and (b) you have
5704 # configured input routing (see docs/multiseat.txt) for those input
5705 # devices.  The parameters work exactly like the device and head
5706 # properties of input devices.  If @device is missing, only devices
5707 # that have no input routing config are admissible.  If @device is
5708 # specified, both input devices with and without input routing config
5709 # are admissible, but devices with input routing config take
5710 # precedence.
5712 # Since: 2.6
5714 # Note: The consoles are visible in the qom tree, under
5715 # /backend/console[$index]. They have a device link and head property,
5716 # so it is possible to map which console belongs to which device and
5717 # display.
5719 # Example:
5721 # 1. Press left mouse button.
5723 # -> { "execute": "input-send-event",
5724 #     "arguments": { "device": "video0",
5725 #                    "events": [ { "type": "btn",
5726 #                    "data" : { "down": true, "button": "left" } } ] } }
5727 # <- { "return": {} }
5729 # -> { "execute": "input-send-event",
5730 #     "arguments": { "device": "video0",
5731 #                    "events": [ { "type": "btn",
5732 #                    "data" : { "down": false, "button": "left" } } ] } }
5733 # <- { "return": {} }
5735 # 2. Press ctrl-alt-del.
5737 # -> { "execute": "input-send-event",
5738 #      "arguments": { "events": [
5739 #         { "type": "key", "data" : { "down": true,
5740 #           "key": {"type": "qcode", "data": "ctrl" } } },
5741 #         { "type": "key", "data" : { "down": true,
5742 #           "key": {"type": "qcode", "data": "alt" } } },
5743 #         { "type": "key", "data" : { "down": true,
5744 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5745 # <- { "return": {} }
5747 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5749 # -> { "execute": "input-send-event" ,
5750 #   "arguments": { "events": [
5751 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5752 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5753 # <- { "return": {} }
5756 { 'command': 'input-send-event',
5757   'data': { '*device': 'str',
5758             '*head'  : 'int',
5759             'events' : [ 'InputEvent' ] } }
5762 # @NumaOptionsType:
5764 # @node: NUMA nodes configuration
5766 # @dist: NUMA distance configuration (since 2.10)
5768 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
5770 # Since: 2.1
5772 { 'enum': 'NumaOptionsType',
5773   'data': [ 'node', 'dist', 'cpu' ] }
5776 # @NumaOptions:
5778 # A discriminated record of NUMA options. (for OptsVisitor)
5780 # Since: 2.1
5782 { 'union': 'NumaOptions',
5783   'base': { 'type': 'NumaOptionsType' },
5784   'discriminator': 'type',
5785   'data': {
5786     'node': 'NumaNodeOptions',
5787     'dist': 'NumaDistOptions',
5788     'cpu': 'NumaCpuOptions' }}
5791 # @NumaNodeOptions:
5793 # Create a guest NUMA node. (for OptsVisitor)
5795 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
5797 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
5798 #         if omitted)
5800 # @mem: memory size of this node; mutually exclusive with @memdev.
5801 #       Equally divide total memory among nodes if both @mem and @memdev are
5802 #       omitted.
5804 # @memdev: memory backend object.  If specified for one node,
5805 #          it must be specified for all nodes.
5807 # Since: 2.1
5809 { 'struct': 'NumaNodeOptions',
5810   'data': {
5811    '*nodeid': 'uint16',
5812    '*cpus':   ['uint16'],
5813    '*mem':    'size',
5814    '*memdev': 'str' }}
5817 # @NumaDistOptions:
5819 # Set the distance between 2 NUMA nodes.
5821 # @src: source NUMA node.
5823 # @dst: destination NUMA node.
5825 # @val: NUMA distance from source node to destination node.
5826 #       When a node is unreachable from another node, set the distance
5827 #       between them to 255.
5829 # Since: 2.10
5831 { 'struct': 'NumaDistOptions',
5832   'data': {
5833    'src': 'uint16',
5834    'dst': 'uint16',
5835    'val': 'uint8' }}
5838 # @NumaCpuOptions:
5840 # Option "-numa cpu" overrides default cpu to node mapping.
5841 # It accepts the same set of cpu properties as returned by
5842 # query-hotpluggable-cpus[].props, where node-id could be used to
5843 # override default node mapping.
5845 # Since: 2.10
5847 { 'struct': 'NumaCpuOptions',
5848    'base': 'CpuInstanceProperties',
5849    'data' : {} }
5852 # @HostMemPolicy:
5854 # Host memory policy types
5856 # @default: restore default policy, remove any nondefault policy
5858 # @preferred: set the preferred host nodes for allocation
5860 # @bind: a strict policy that restricts memory allocation to the
5861 #        host nodes specified
5863 # @interleave: memory allocations are interleaved across the set
5864 #              of host nodes specified
5866 # Since: 2.1
5868 { 'enum': 'HostMemPolicy',
5869   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5872 # @Memdev:
5874 # Information about memory backend
5876 # @id: backend's ID if backend has 'id' property (since 2.9)
5878 # @size: memory backend size
5880 # @merge: enables or disables memory merge support
5882 # @dump: includes memory backend's memory in a core dump or not
5884 # @prealloc: enables or disables memory preallocation
5886 # @host-nodes: host nodes for its memory policy
5888 # @policy: memory policy of memory backend
5890 # Since: 2.1
5892 { 'struct': 'Memdev',
5893   'data': {
5894     '*id':        'str',
5895     'size':       'size',
5896     'merge':      'bool',
5897     'dump':       'bool',
5898     'prealloc':   'bool',
5899     'host-nodes': ['uint16'],
5900     'policy':     'HostMemPolicy' }}
5903 # @query-memdev:
5905 # Returns information for all memory backends.
5907 # Returns: a list of @Memdev.
5909 # Since: 2.1
5911 # Example:
5913 # -> { "execute": "query-memdev" }
5914 # <- { "return": [
5915 #        {
5916 #          "id": "mem1",
5917 #          "size": 536870912,
5918 #          "merge": false,
5919 #          "dump": true,
5920 #          "prealloc": false,
5921 #          "host-nodes": [0, 1],
5922 #          "policy": "bind"
5923 #        },
5924 #        {
5925 #          "size": 536870912,
5926 #          "merge": false,
5927 #          "dump": true,
5928 #          "prealloc": true,
5929 #          "host-nodes": [2, 3],
5930 #          "policy": "preferred"
5931 #        }
5932 #      ]
5933 #    }
5936 { 'command': 'query-memdev', 'returns': ['Memdev'] }
5939 # @PCDIMMDeviceInfo:
5941 # PCDIMMDevice state information
5943 # @id: device's ID
5945 # @addr: physical address, where device is mapped
5947 # @size: size of memory that the device provides
5949 # @slot: slot number at which device is plugged in
5951 # @node: NUMA node number where device is plugged in
5953 # @memdev: memory backend linked with device
5955 # @hotplugged: true if device was hotplugged
5957 # @hotpluggable: true if device if could be added/removed while machine is running
5959 # Since: 2.1
5961 { 'struct': 'PCDIMMDeviceInfo',
5962   'data': { '*id': 'str',
5963             'addr': 'int',
5964             'size': 'int',
5965             'slot': 'int',
5966             'node': 'int',
5967             'memdev': 'str',
5968             'hotplugged': 'bool',
5969             'hotpluggable': 'bool'
5970           }
5974 # @MemoryDeviceInfo:
5976 # Union containing information about a memory device
5978 # Since: 2.1
5980 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
5983 # @query-memory-devices:
5985 # Lists available memory devices and their state
5987 # Since: 2.1
5989 # Example:
5991 # -> { "execute": "query-memory-devices" }
5992 # <- { "return": [ { "data":
5993 #                       { "addr": 5368709120,
5994 #                         "hotpluggable": true,
5995 #                         "hotplugged": true,
5996 #                         "id": "d1",
5997 #                         "memdev": "/objects/memX",
5998 #                         "node": 0,
5999 #                         "size": 1073741824,
6000 #                         "slot": 0},
6001 #                    "type": "dimm"
6002 #                  } ] }
6005 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
6008 # @ACPISlotType:
6010 # @DIMM: memory slot
6011 # @CPU: logical CPU slot (since 2.7)
6013 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
6016 # @ACPIOSTInfo:
6018 # OSPM Status Indication for a device
6019 # For description of possible values of @source and @status fields
6020 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
6022 # @device: device ID associated with slot
6024 # @slot: slot ID, unique per slot of a given @slot-type
6026 # @slot-type: type of the slot
6028 # @source: an integer containing the source event
6030 # @status: an integer containing the status code
6032 # Since: 2.1
6034 { 'struct': 'ACPIOSTInfo',
6035   'data'  : { '*device': 'str',
6036               'slot': 'str',
6037               'slot-type': 'ACPISlotType',
6038               'source': 'int',
6039               'status': 'int' } }
6042 # @query-acpi-ospm-status:
6044 # Return a list of ACPIOSTInfo for devices that support status
6045 # reporting via ACPI _OST method.
6047 # Since: 2.1
6049 # Example:
6051 # -> { "execute": "query-acpi-ospm-status" }
6052 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
6053 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
6054 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
6055 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
6056 #    ]}
6059 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
6062 # @WatchdogExpirationAction:
6064 # An enumeration of the actions taken when the watchdog device's timer is
6065 # expired
6067 # @reset: system resets
6069 # @shutdown: system shutdown, note that it is similar to @powerdown, which
6070 #            tries to set to system status and notify guest
6072 # @poweroff: system poweroff, the emulator program exits
6074 # @pause: system pauses, similar to @stop
6076 # @debug: system enters debug state
6078 # @none: nothing is done
6080 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
6081 #              VCPUS on x86) (since 2.4)
6083 # Since: 2.1
6085 { 'enum': 'WatchdogExpirationAction',
6086   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
6087             'inject-nmi' ] }
6090 # @IoOperationType:
6092 # An enumeration of the I/O operation types
6094 # @read: read operation
6096 # @write: write operation
6098 # Since: 2.1
6100 { 'enum': 'IoOperationType',
6101   'data': [ 'read', 'write' ] }
6104 # @GuestPanicAction:
6106 # An enumeration of the actions taken when guest OS panic is detected
6108 # @pause: system pauses
6110 # Since: 2.1 (poweroff since 2.8)
6112 { 'enum': 'GuestPanicAction',
6113   'data': [ 'pause', 'poweroff' ] }
6116 # @GuestPanicInformationType:
6118 # An enumeration of the guest panic information types
6120 # Since: 2.9
6122 { 'enum': 'GuestPanicInformationType',
6123   'data': [ 'hyper-v'] }
6126 # @GuestPanicInformation:
6128 # Information about a guest panic
6130 # Since: 2.9
6132 {'union': 'GuestPanicInformation',
6133  'base': {'type': 'GuestPanicInformationType'},
6134  'discriminator': 'type',
6135  'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
6138 # @GuestPanicInformationHyperV:
6140 # Hyper-V specific guest panic information (HV crash MSRs)
6142 # Since: 2.9
6144 {'struct': 'GuestPanicInformationHyperV',
6145  'data': { 'arg1': 'uint64',
6146            'arg2': 'uint64',
6147            'arg3': 'uint64',
6148            'arg4': 'uint64',
6149            'arg5': 'uint64' } }
6152 # @rtc-reset-reinjection:
6154 # This command will reset the RTC interrupt reinjection backlog.
6155 # Can be used if another mechanism to synchronize guest time
6156 # is in effect, for example QEMU guest agent's guest-set-time
6157 # command.
6159 # Since: 2.1
6161 # Example:
6163 # -> { "execute": "rtc-reset-reinjection" }
6164 # <- { "return": {} }
6167 { 'command': 'rtc-reset-reinjection' }
6169 # Rocker ethernet network switch
6170 { 'include': 'qapi/rocker.json' }
6173 # @ReplayMode:
6175 # Mode of the replay subsystem.
6177 # @none: normal execution mode. Replay or record are not enabled.
6179 # @record: record mode. All non-deterministic data is written into the
6180 #          replay log.
6182 # @play: replay mode. Non-deterministic data required for system execution
6183 #        is read from the log.
6185 # Since: 2.5
6187 { 'enum': 'ReplayMode',
6188   'data': [ 'none', 'record', 'play' ] }
6191 # @xen-load-devices-state:
6193 # Load the state of all devices from file. The RAM and the block devices
6194 # of the VM are not loaded by this command.
6196 # @filename: the file to load the state of the devices from as binary
6197 # data. See xen-save-devices-state.txt for a description of the binary
6198 # format.
6200 # Since: 2.7
6202 # Example:
6204 # -> { "execute": "xen-load-devices-state",
6205 #      "arguments": { "filename": "/tmp/resume" } }
6206 # <- { "return": {} }
6209 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
6212 # @xen-set-replication:
6214 # Enable or disable replication.
6216 # @enable: true to enable, false to disable.
6218 # @primary: true for primary or false for secondary.
6220 # @failover: true to do failover, false to stop. but cannot be
6221 #            specified if 'enable' is true. default value is false.
6223 # Returns: nothing.
6225 # Example:
6227 # -> { "execute": "xen-set-replication",
6228 #      "arguments": {"enable": true, "primary": false} }
6229 # <- { "return": {} }
6231 # Since: 2.9
6233 { 'command': 'xen-set-replication',
6234   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
6237 # @ReplicationStatus:
6239 # The result format for 'query-xen-replication-status'.
6241 # @error: true if an error happened, false if replication is normal.
6243 # @desc: the human readable error description string, when
6244 #        @error is 'true'.
6246 # Since: 2.9
6248 { 'struct': 'ReplicationStatus',
6249   'data': { 'error': 'bool', '*desc': 'str' } }
6252 # @query-xen-replication-status:
6254 # Query replication status while the vm is running.
6256 # Returns: A @ReplicationResult object showing the status.
6258 # Example:
6260 # -> { "execute": "query-xen-replication-status" }
6261 # <- { "return": { "error": false } }
6263 # Since: 2.9
6265 { 'command': 'query-xen-replication-status',
6266   'returns': 'ReplicationStatus' }
6269 # @xen-colo-do-checkpoint:
6271 # Xen uses this command to notify replication to trigger a checkpoint.
6273 # Returns: nothing.
6275 # Example:
6277 # -> { "execute": "xen-colo-do-checkpoint" }
6278 # <- { "return": {} }
6280 # Since: 2.9
6282 { 'command': 'xen-colo-do-checkpoint' }
6285 # @GICCapability:
6287 # The struct describes capability for a specific GIC (Generic
6288 # Interrupt Controller) version. These bits are not only decided by
6289 # QEMU/KVM software version, but also decided by the hardware that
6290 # the program is running upon.
6292 # @version:  version of GIC to be described. Currently, only 2 and 3
6293 #            are supported.
6295 # @emulated: whether current QEMU/hardware supports emulated GIC
6296 #            device in user space.
6298 # @kernel:   whether current QEMU/hardware supports hardware
6299 #            accelerated GIC device in kernel.
6301 # Since: 2.6
6303 { 'struct': 'GICCapability',
6304   'data': { 'version': 'int',
6305             'emulated': 'bool',
6306             'kernel': 'bool' } }
6309 # @query-gic-capabilities:
6311 # This command is ARM-only. It will return a list of GICCapability
6312 # objects that describe its capability bits.
6314 # Returns: a list of GICCapability objects.
6316 # Since: 2.6
6318 # Example:
6320 # -> { "execute": "query-gic-capabilities" }
6321 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
6322 #                 { "version": 3, "emulated": false, "kernel": true } ] }
6325 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
6328 # @CpuInstanceProperties:
6330 # List of properties to be used for hotplugging a CPU instance,
6331 # it should be passed by management with device_add command when
6332 # a CPU is being hotplugged.
6334 # @node-id: NUMA node ID the CPU belongs to
6335 # @socket-id: socket number within node/board the CPU belongs to
6336 # @core-id: core number within socket the CPU belongs to
6337 # @thread-id: thread number within core the CPU belongs to
6339 # Note: currently there are 4 properties that could be present
6340 # but management should be prepared to pass through other
6341 # properties with device_add command to allow for future
6342 # interface extension. This also requires the filed names to be kept in
6343 # sync with the properties passed to -device/device_add.
6345 # Since: 2.7
6347 { 'struct': 'CpuInstanceProperties',
6348   'data': { '*node-id': 'int',
6349             '*socket-id': 'int',
6350             '*core-id': 'int',
6351             '*thread-id': 'int'
6352   }
6356 # @HotpluggableCPU:
6358 # @type: CPU object type for usage with device_add command
6359 # @props: list of properties to be used for hotplugging CPU
6360 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6361 # @qom-path: link to existing CPU object if CPU is present or
6362 #            omitted if CPU is not present.
6364 # Since: 2.7
6366 { 'struct': 'HotpluggableCPU',
6367   'data': { 'type': 'str',
6368             'vcpus-count': 'int',
6369             'props': 'CpuInstanceProperties',
6370             '*qom-path': 'str'
6371           }
6375 # @query-hotpluggable-cpus:
6377 # Returns: a list of HotpluggableCPU objects.
6379 # Since: 2.7
6381 # Example:
6383 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6385 # -> { "execute": "query-hotpluggable-cpus" }
6386 # <- {"return": [
6387 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6388 #        "vcpus-count": 1 },
6389 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6390 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6391 #    ]}'
6393 # For pc machine type started with -smp 1,maxcpus=2:
6395 # -> { "execute": "query-hotpluggable-cpus" }
6396 # <- {"return": [
6397 #      {
6398 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6399 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6400 #      },
6401 #      {
6402 #         "qom-path": "/machine/unattached/device[0]",
6403 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6404 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6405 #      }
6406 #    ]}
6409 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
6412 # @GuidInfo:
6414 # GUID information.
6416 # @guid: the globally unique identifier
6418 # Since: 2.9
6420 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
6423 # @query-vm-generation-id:
6425 # Show Virtual Machine Generation ID
6427 # Since 2.9
6429 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }