qapi: Have each QAPI schema declare its returns white-list
[qemu/ar7.git] / qapi-schema.json
blob93e9e98b0b62ef0fe3969eaa6eec95eb3f9ddebd
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' ] } }
66 # QAPI common definitions
67 { 'include': 'qapi/common.json' }
69 # QAPI crypto definitions
70 { 'include': 'qapi/crypto.json' }
72 # QAPI block definitions
73 { 'include': 'qapi/block.json' }
75 # QAPI event definitions
76 { 'include': 'qapi/event.json' }
78 # Tracing commands
79 { 'include': 'qapi/trace.json' }
81 # QAPI introspection
82 { 'include': 'qapi/introspect.json' }
85 # = QMP commands
89 # @qmp_capabilities:
91 # Enable QMP capabilities.
93 # Arguments: None.
95 # Example:
97 # -> { "execute": "qmp_capabilities" }
98 # <- { "return": {} }
100 # Notes: This command is valid exactly when first connecting: it must be
101 # issued before any other command will be accepted, and will fail once the
102 # monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
104 # Since: 0.13
107 { 'command': 'qmp_capabilities' }
110 # @LostTickPolicy:
112 # Policy for handling lost ticks in timer devices.
114 # @discard: throw away the missed tick(s) and continue with future injection
115 #           normally.  Guest time may be delayed, unless the OS has explicit
116 #           handling of lost ticks
118 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
119 #         delayed due to the late tick
121 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
122 #         may be delayed, depending on how the OS reacts to the merging
123 #         of ticks
125 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
126 #        guest time should not be delayed once catchup is complete.
128 # Since: 2.0
130 { 'enum': 'LostTickPolicy',
131   'data': ['discard', 'delay', 'merge', 'slew' ] }
134 # @add_client:
136 # Allow client connections for VNC, Spice and socket based
137 # character devices to be passed in to QEMU via SCM_RIGHTS.
139 # @protocol: protocol name. Valid names are "vnc", "spice" or the
140 #            name of a character device (eg. from -chardev id=XXXX)
142 # @fdname: file descriptor name previously passed via 'getfd' command
144 # @skipauth: #optional whether to skip authentication. Only applies
145 #            to "vnc" and "spice" protocols
147 # @tls: #optional whether to perform TLS. Only applies to the "spice"
148 #       protocol
150 # Returns: nothing on success.
152 # Since: 0.14.0
154 # Example:
156 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
157 #                                              "fdname": "myclient" } }
158 # <- { "return": {} }
161 { 'command': 'add_client',
162   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
163             '*tls': 'bool' } }
166 # @NameInfo:
168 # Guest name information.
170 # @name: #optional The name of the guest
172 # Since: 0.14.0
174 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
177 # @query-name:
179 # Return the name information of a guest.
181 # Returns: @NameInfo of the guest
183 # Since: 0.14.0
185 # Example:
187 # -> { "execute": "query-name" }
188 # <- { "return": { "name": "qemu-name" } }
191 { 'command': 'query-name', 'returns': 'NameInfo' }
194 # @KvmInfo:
196 # Information about support for KVM acceleration
198 # @enabled: true if KVM acceleration is active
200 # @present: true if KVM acceleration is built into this executable
202 # Since: 0.14.0
204 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
207 # @query-kvm:
209 # Returns information about KVM acceleration
211 # Returns: @KvmInfo
213 # Since: 0.14.0
215 # Example:
217 # -> { "execute": "query-kvm" }
218 # <- { "return": { "enabled": true, "present": true } }
221 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
224 # @RunState:
226 # An enumeration of VM run states.
228 # @debug: QEMU is running on a debugger
230 # @finish-migrate: guest is paused to finish the migration process
232 # @inmigrate: guest is paused waiting for an incoming migration.  Note
233 # that this state does not tell whether the machine will start at the
234 # end of the migration.  This depends on the command-line -S option and
235 # any invocation of 'stop' or 'cont' that has happened since QEMU was
236 # started.
238 # @internal-error: An internal error that prevents further guest execution
239 # has occurred
241 # @io-error: the last IOP has failed and the device is configured to pause
242 # on I/O errors
244 # @paused: guest has been paused via the 'stop' command
246 # @postmigrate: guest is paused following a successful 'migrate'
248 # @prelaunch: QEMU was started with -S and guest has not started
250 # @restore-vm: guest is paused to restore VM state
252 # @running: guest is actively running
254 # @save-vm: guest is paused to save the VM state
256 # @shutdown: guest is shut down (and -no-shutdown is in use)
258 # @suspended: guest is suspended (ACPI S3)
260 # @watchdog: the watchdog action is configured to pause and has been triggered
262 # @guest-panicked: guest has been panicked as a result of guest OS panic
264 # @colo: guest is paused to save/restore VM state under colo checkpoint,
265 #        VM can not get into this state unless colo capability is enabled
266 #        for migration. (since 2.8)
268 { 'enum': 'RunState',
269   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
270             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
271             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
272             'guest-panicked', 'colo' ] }
275 # @StatusInfo:
277 # Information about VCPU run state
279 # @running: true if all VCPUs are runnable, false if not runnable
281 # @singlestep: true if VCPUs are in single-step mode
283 # @status: the virtual machine @RunState
285 # Since:  0.14.0
287 # Notes: @singlestep is enabled through the GDB stub
289 { 'struct': 'StatusInfo',
290   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
293 # @query-status:
295 # Query the run status of all VCPUs
297 # Returns: @StatusInfo reflecting all VCPUs
299 # Since:  0.14.0
301 # Example:
303 # -> { "execute": "query-status" }
304 # <- { "return": { "running": true,
305 #                  "singlestep": false,
306 #                  "status": "running" } }
309 { 'command': 'query-status', 'returns': 'StatusInfo' }
312 # @UuidInfo:
314 # Guest UUID information (Universally Unique Identifier).
316 # @UUID: the UUID of the guest
318 # Since: 0.14.0
320 # Notes: If no UUID was specified for the guest, a null UUID is returned.
322 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
325 # @query-uuid:
327 # Query the guest UUID information.
329 # Returns: The @UuidInfo for the guest
331 # Since: 0.14.0
333 # Example:
335 # -> { "execute": "query-uuid" }
336 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
339 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
342 # @ChardevInfo:
344 # Information about a character device.
346 # @label: the label of the character device
348 # @filename: the filename of the character device
350 # @frontend-open: shows whether the frontend device attached to this backend
351 #                 (eg. with the chardev=... option) is in open or closed state
352 #                 (since 2.1)
354 # Notes: @filename is encoded using the QEMU command line character device
355 #        encoding.  See the QEMU man page for details.
357 # Since: 0.14.0
359 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
360                                   'filename': 'str',
361                                   'frontend-open': 'bool'} }
364 # @query-chardev:
366 # Returns information about current character devices.
368 # Returns: a list of @ChardevInfo
370 # Since: 0.14.0
372 # Example:
374 # -> { "execute": "query-chardev" }
375 # <- {
376 #       "return": [
377 #          {
378 #             "label": "charchannel0",
379 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
380 #             "frontend-open": false
381 #          },
382 #          {
383 #             "label": "charmonitor",
384 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
385 #             "frontend-open": true
386 #          },
387 #          {
388 #             "label": "charserial0",
389 #             "filename": "pty:/dev/pts/2",
390 #             "frontend-open": true
391 #          }
392 #       ]
393 #    }
396 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
399 # @ChardevBackendInfo:
401 # Information about a character device backend
403 # @name: The backend name
405 # Since: 2.0
407 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
410 # @query-chardev-backends:
412 # Returns information about character device backends.
414 # Returns: a list of @ChardevBackendInfo
416 # Since: 2.0
418 # Example:
420 # -> { "execute": "query-chardev-backends" }
421 # <- {
422 #       "return":[
423 #          {
424 #             "name":"udp"
425 #          },
426 #          {
427 #             "name":"tcp"
428 #          },
429 #          {
430 #             "name":"unix"
431 #          },
432 #          {
433 #             "name":"spiceport"
434 #          }
435 #       ]
436 #    }
439 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
442 # @DataFormat:
444 # An enumeration of data format.
446 # @utf8: Data is a UTF-8 string (RFC 3629)
448 # @base64: Data is Base64 encoded binary (RFC 3548)
450 # Since: 1.4
452 { 'enum': 'DataFormat',
453   'data': [ 'utf8', 'base64' ] }
456 # @ringbuf-write:
458 # Write to a ring buffer character device.
460 # @device: the ring buffer character device name
462 # @data: data to write
464 # @format: #optional data encoding (default 'utf8').
465 #          - base64: data must be base64 encoded text.  Its binary
466 #            decoding gets written.
467 #          - utf8: data's UTF-8 encoding is written
468 #          - data itself is always Unicode regardless of format, like
469 #            any other string.
471 # Returns: Nothing on success
473 # Since: 1.4
475 # Example:
477 # -> { "execute": "ringbuf-write",
478 #      "arguments": { "device": "foo",
479 #                     "data": "abcdefgh",
480 #                     "format": "utf8" } }
481 # <- { "return": {} }
484 { 'command': 'ringbuf-write',
485   'data': {'device': 'str', 'data': 'str',
486            '*format': 'DataFormat'} }
489 # @ringbuf-read:
491 # Read from a ring buffer character device.
493 # @device: the ring buffer character device name
495 # @size: how many bytes to read at most
497 # @format: #optional data encoding (default 'utf8').
498 #          - base64: the data read is returned in base64 encoding.
499 #          - utf8: the data read is interpreted as UTF-8.
500 #            Bug: can screw up when the buffer contains invalid UTF-8
501 #            sequences, NUL characters, after the ring buffer lost
502 #            data, and when reading stops because the size limit is
503 #            reached.
504 #          - The return value is always Unicode regardless of format,
505 #            like any other string.
507 # Returns: data read from the device
509 # Since: 1.4
511 # Example:
513 # -> { "execute": "ringbuf-read",
514 #      "arguments": { "device": "foo",
515 #                     "size": 1000,
516 #                     "format": "utf8" } }
517 # <- { "return": "abcdefgh" }
520 { 'command': 'ringbuf-read',
521   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
522   'returns': 'str' }
525 # @EventInfo:
527 # Information about a QMP event
529 # @name: The event name
531 # Since: 1.2.0
533 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
536 # @query-events:
538 # Return a list of supported QMP events by this server
540 # Returns: A list of @EventInfo for all supported events
542 # Since: 1.2.0
544 # Example:
546 # -> { "execute": "query-events" }
547 # <- {
548 #      "return": [
549 #          {
550 #             "name":"SHUTDOWN"
551 #          },
552 #          {
553 #             "name":"RESET"
554 #          }
555 #       ]
556 #    }
558 # Note: This example has been shortened as the real response is too long.
561 { 'command': 'query-events', 'returns': ['EventInfo'] }
564 # @MigrationStats:
566 # Detailed migration status.
568 # @transferred: amount of bytes already transferred to the target VM
570 # @remaining: amount of bytes remaining to be transferred to the target VM
572 # @total: total amount of bytes involved in the migration process
574 # @duplicate: number of duplicate (zero) pages (since 1.2)
576 # @skipped: number of skipped zero pages (since 1.5)
578 # @normal: number of normal pages (since 1.2)
580 # @normal-bytes: number of normal bytes sent (since 1.2)
582 # @dirty-pages-rate: number of pages dirtied by second by the
583 #        guest (since 1.3)
585 # @mbps: throughput in megabits/sec. (since 1.6)
587 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
589 # @postcopy-requests: The number of page requests received from the destination
590 #        (since 2.7)
592 # Since: 0.14.0
594 { 'struct': 'MigrationStats',
595   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
596            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
597            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
598            'mbps' : 'number', 'dirty-sync-count' : 'int',
599            'postcopy-requests' : 'int' } }
602 # @XBZRLECacheStats:
604 # Detailed XBZRLE migration cache statistics
606 # @cache-size: XBZRLE cache size
608 # @bytes: amount of bytes already transferred to the target VM
610 # @pages: amount of pages transferred to the target VM
612 # @cache-miss: number of cache miss
614 # @cache-miss-rate: rate of cache miss (since 2.1)
616 # @overflow: number of overflows
618 # Since: 1.2
620 { 'struct': 'XBZRLECacheStats',
621   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
622            'cache-miss': 'int', 'cache-miss-rate': 'number',
623            'overflow': 'int' } }
626 # @MigrationStatus:
628 # An enumeration of migration status.
630 # @none: no migration has ever happened.
632 # @setup: migration process has been initiated.
634 # @cancelling: in the process of cancelling migration.
636 # @cancelled: cancelling migration is finished.
638 # @active: in the process of doing migration.
640 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
642 # @completed: migration is finished.
644 # @failed: some error occurred during migration process.
646 # @colo: VM is in the process of fault tolerance, VM can not get into this
647 #        state unless colo capability is enabled for migration. (since 2.8)
649 # Since: 2.3
652 { 'enum': 'MigrationStatus',
653   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
654             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
657 # @MigrationInfo:
659 # Information about current migration process.
661 # @status: #optional @MigrationStatus describing the current migration status.
662 #          If this field is not returned, no migration process
663 #          has been initiated
665 # @ram: #optional @MigrationStats containing detailed migration
666 #       status, only returned if status is 'active' or
667 #       'completed'(since 1.2)
669 # @disk: #optional @MigrationStats containing detailed disk migration
670 #        status, only returned if status is 'active' and it is a block
671 #        migration
673 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
674 #                migration statistics, only returned if XBZRLE feature is on and
675 #                status is 'active' or 'completed' (since 1.2)
677 # @total-time: #optional total amount of milliseconds since migration started.
678 #        If migration has ended, it returns the total migration
679 #        time. (since 1.2)
681 # @downtime: #optional only present when migration finishes correctly
682 #        total downtime in milliseconds for the guest.
683 #        (since 1.3)
685 # @expected-downtime: #optional only present while migration is active
686 #        expected downtime in milliseconds for the guest in last walk
687 #        of the dirty bitmap. (since 1.3)
689 # @setup-time: #optional amount of setup time in milliseconds _before_ the
690 #        iterations begin but _after_ the QMP command is issued. This is designed
691 #        to provide an accounting of any activities (such as RDMA pinning) which
692 #        may be expensive, but do not actually occur during the iterative
693 #        migration rounds themselves. (since 1.6)
695 # @cpu-throttle-percentage: #optional percentage of time guest cpus are being
696 #        throttled during auto-converge. This is only present when auto-converge
697 #        has started throttling guest cpus. (Since 2.7)
699 # @error-desc: #optional the human readable error description string, when
700 #              @status is 'failed'. Clients should not attempt to parse the
701 #              error strings. (Since 2.7)
703 # Since: 0.14.0
705 { 'struct': 'MigrationInfo',
706   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
707            '*disk': 'MigrationStats',
708            '*xbzrle-cache': 'XBZRLECacheStats',
709            '*total-time': 'int',
710            '*expected-downtime': 'int',
711            '*downtime': 'int',
712            '*setup-time': 'int',
713            '*cpu-throttle-percentage': 'int',
714            '*error-desc': 'str'} }
717 # @query-migrate:
719 # Returns information about current migration process. If migration
720 # is active there will be another json-object with RAM migration
721 # status and if block migration is active another one with block
722 # migration status.
724 # Returns: @MigrationInfo
726 # Since: 0.14.0
728 # Example:
730 # 1. Before the first migration
732 # -> { "execute": "query-migrate" }
733 # <- { "return": {} }
735 # 2. Migration is done and has succeeded
737 # -> { "execute": "query-migrate" }
738 # <- { "return": {
739 #         "status": "completed",
740 #         "ram":{
741 #           "transferred":123,
742 #           "remaining":123,
743 #           "total":246,
744 #           "total-time":12345,
745 #           "setup-time":12345,
746 #           "downtime":12345,
747 #           "duplicate":123,
748 #           "normal":123,
749 #           "normal-bytes":123456,
750 #           "dirty-sync-count":15
751 #         }
752 #      }
753 #    }
755 # 3. Migration is done and has failed
757 # -> { "execute": "query-migrate" }
758 # <- { "return": { "status": "failed" } }
760 # 4. Migration is being performed and is not a block migration:
762 # -> { "execute": "query-migrate" }
763 # <- {
764 #       "return":{
765 #          "status":"active",
766 #          "ram":{
767 #             "transferred":123,
768 #             "remaining":123,
769 #             "total":246,
770 #             "total-time":12345,
771 #             "setup-time":12345,
772 #             "expected-downtime":12345,
773 #             "duplicate":123,
774 #             "normal":123,
775 #             "normal-bytes":123456,
776 #             "dirty-sync-count":15
777 #          }
778 #       }
779 #    }
781 # 5. Migration is being performed and is a block migration:
783 # -> { "execute": "query-migrate" }
784 # <- {
785 #       "return":{
786 #          "status":"active",
787 #          "ram":{
788 #             "total":1057024,
789 #             "remaining":1053304,
790 #             "transferred":3720,
791 #             "total-time":12345,
792 #             "setup-time":12345,
793 #             "expected-downtime":12345,
794 #             "duplicate":123,
795 #             "normal":123,
796 #             "normal-bytes":123456,
797 #             "dirty-sync-count":15
798 #          },
799 #          "disk":{
800 #             "total":20971520,
801 #             "remaining":20880384,
802 #             "transferred":91136
803 #          }
804 #       }
805 #    }
807 # 6. Migration is being performed and XBZRLE is active:
809 # -> { "execute": "query-migrate" }
810 # <- {
811 #       "return":{
812 #          "status":"active",
813 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
814 #          "ram":{
815 #             "total":1057024,
816 #             "remaining":1053304,
817 #             "transferred":3720,
818 #             "total-time":12345,
819 #             "setup-time":12345,
820 #             "expected-downtime":12345,
821 #             "duplicate":10,
822 #             "normal":3333,
823 #             "normal-bytes":3412992,
824 #             "dirty-sync-count":15
825 #          },
826 #          "xbzrle-cache":{
827 #             "cache-size":67108864,
828 #             "bytes":20971520,
829 #             "pages":2444343,
830 #             "cache-miss":2244,
831 #             "cache-miss-rate":0.123,
832 #             "overflow":34434
833 #          }
834 #       }
835 #    }
838 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
841 # @MigrationCapability:
843 # Migration capabilities enumeration
845 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
846 #          This feature allows us to minimize migration traffic for certain work
847 #          loads, by sending compressed difference of the pages
849 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
850 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
851 #          Disabled by default. (since 2.0)
853 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
854 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
855 #          source and target VM to support this feature. To enable it is sufficient
856 #          to enable the capability on the source VM. The feature is disabled by
857 #          default. (since 1.6)
859 # @compress: Use multiple compression threads to accelerate live migration.
860 #          This feature can help to reduce the migration traffic, by sending
861 #          compressed pages. Please note that if compress and xbzrle are both
862 #          on, compress only takes effect in the ram bulk stage, after that,
863 #          it will be disabled and only xbzrle takes effect, this can help to
864 #          minimize migration traffic. The feature is disabled by default.
865 #          (since 2.4 )
867 # @events: generate events for each migration state change
868 #          (since 2.4 )
870 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
871 #          to speed up convergence of RAM migration. (since 1.6)
873 # @postcopy-ram: Start executing on the migration target before all of RAM has
874 #          been migrated, pulling the remaining pages along as needed. NOTE: If
875 #          the migration fails during postcopy the VM will fail.  (since 2.6)
877 # @x-colo: If enabled, migration will never end, and the state of the VM on the
878 #        primary side will be migrated continuously to the VM on secondary
879 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
880 #        Non-stop Service. (since 2.8)
882 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
883 #        during postcopy-ram migration. (since 2.9)
885 # Since: 1.2
887 { 'enum': 'MigrationCapability',
888   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
889            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] }
892 # @MigrationCapabilityStatus:
894 # Migration capability information
896 # @capability: capability enum
898 # @state: capability state bool
900 # Since: 1.2
902 { 'struct': 'MigrationCapabilityStatus',
903   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
906 # @migrate-set-capabilities:
908 # Enable/Disable the following migration capabilities (like xbzrle)
910 # @capabilities: json array of capability modifications to make
912 # Since: 1.2
914 # Example:
916 # -> { "execute": "migrate-set-capabilities" , "arguments":
917 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
920 { 'command': 'migrate-set-capabilities',
921   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
924 # @query-migrate-capabilities:
926 # Returns information about the current migration capabilities status
928 # Returns: @MigrationCapabilitiesStatus
930 # Since: 1.2
932 # Example:
934 # -> { "execute": "query-migrate-capabilities" }
935 # <- { "return": [
936 #       {"state": false, "capability": "xbzrle"},
937 #       {"state": false, "capability": "rdma-pin-all"},
938 #       {"state": false, "capability": "auto-converge"},
939 #       {"state": false, "capability": "zero-blocks"},
940 #       {"state": false, "capability": "compress"},
941 #       {"state": true, "capability": "events"},
942 #       {"state": false, "capability": "postcopy-ram"},
943 #       {"state": false, "capability": "x-colo"}
944 #    ]}
947 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
950 # @MigrationParameter:
952 # Migration parameters enumeration
954 # @compress-level: Set the compression level to be used in live migration,
955 #          the compression level is an integer between 0 and 9, where 0 means
956 #          no compression, 1 means the best compression speed, and 9 means best
957 #          compression ratio which will consume more CPU.
959 # @compress-threads: Set compression thread count to be used in live migration,
960 #          the compression thread count is an integer between 1 and 255.
962 # @decompress-threads: Set decompression thread count to be used in live
963 #          migration, the decompression thread count is an integer between 1
964 #          and 255. Usually, decompression is at least 4 times as fast as
965 #          compression, so set the decompress-threads to the number about 1/4
966 #          of compress-threads is adequate.
968 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
969 #                        when migration auto-converge is activated. The
970 #                        default value is 20. (Since 2.7)
972 # @cpu-throttle-increment: throttle percentage increase each time
973 #                          auto-converge detects that migration is not making
974 #                          progress. The default value is 10. (Since 2.7)
976 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
977 #             establishing a TLS connection over the migration data channel.
978 #             On the outgoing side of the migration, the credentials must
979 #             be for a 'client' endpoint, while for the incoming side the
980 #             credentials must be for a 'server' endpoint. Setting this
981 #             will enable TLS for all migrations. The default is unset,
982 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
984 # @tls-hostname: hostname of the target host for the migration. This is
985 #                required when using x509 based TLS credentials and the
986 #                migration URI does not already include a hostname. For
987 #                example if using fd: or exec: based migration, the
988 #                hostname must be provided so that the server's x509
989 #                certificate identity can be validated. (Since 2.7)
991 # @max-bandwidth: to set maximum speed for migration. maximum speed in
992 #                 bytes per second. (Since 2.8)
994 # @downtime-limit: set maximum tolerated downtime for migration. maximum
995 #                  downtime in milliseconds (Since 2.8)
997 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
998 #          periodic mode. (Since 2.8)
1000 # Since: 2.4
1002 { 'enum': 'MigrationParameter',
1003   'data': ['compress-level', 'compress-threads', 'decompress-threads',
1004            'cpu-throttle-initial', 'cpu-throttle-increment',
1005            'tls-creds', 'tls-hostname', 'max-bandwidth',
1006            'downtime-limit', 'x-checkpoint-delay' ] }
1009 # @migrate-set-parameters:
1011 # Set various migration parameters.  See MigrationParameters for details.
1013 # Since: 2.4
1015 # Example:
1017 # -> { "execute": "migrate-set-parameters" ,
1018 #      "arguments": { "compress-level": 1 } }
1021 { 'command': 'migrate-set-parameters', 'boxed': true,
1022   'data': 'MigrationParameters' }
1025 # @MigrationParameters:
1027 # Optional members can be omitted on input ('migrate-set-parameters')
1028 # but most members will always be present on output
1029 # ('query-migrate-parameters'), with the exception of tls-creds and
1030 # tls-hostname.
1032 # @compress-level: #optional compression level
1034 # @compress-threads: #optional compression thread count
1036 # @decompress-threads: #optional decompression thread count
1038 # @cpu-throttle-initial: #optional Initial percentage of time guest cpus are
1039 #                        throttledwhen migration auto-converge is activated.
1040 #                        The default value is 20. (Since 2.7)
1042 # @cpu-throttle-increment: #optional throttle percentage increase each time
1043 #                          auto-converge detects that migration is not making
1044 #                          progress. The default value is 10. (Since 2.7)
1046 # @tls-creds: #optional ID of the 'tls-creds' object that provides credentials
1047 #             for establishing a TLS connection over the migration data
1048 #             channel. On the outgoing side of the migration, the credentials
1049 #             must be for a 'client' endpoint, while for the incoming side the
1050 #             credentials must be for a 'server' endpoint. Setting this
1051 #             will enable TLS for all migrations. The default is unset,
1052 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1054 # @tls-hostname: #optional hostname of the target host for the migration. This
1055 #                is required when using x509 based TLS credentials and the
1056 #                migration URI does not already include a hostname. For
1057 #                example if using fd: or exec: based migration, the
1058 #                hostname must be provided so that the server's x509
1059 #                certificate identity can be validated. (Since 2.7)
1061 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1062 #                 bytes per second. (Since 2.8)
1064 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1065 #                  downtime in milliseconds (Since 2.8)
1067 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1069 # Since: 2.4
1071 { 'struct': 'MigrationParameters',
1072   'data': { '*compress-level': 'int',
1073             '*compress-threads': 'int',
1074             '*decompress-threads': 'int',
1075             '*cpu-throttle-initial': 'int',
1076             '*cpu-throttle-increment': 'int',
1077             '*tls-creds': 'str',
1078             '*tls-hostname': 'str',
1079             '*max-bandwidth': 'int',
1080             '*downtime-limit': 'int',
1081             '*x-checkpoint-delay': 'int'} }
1084 # @query-migrate-parameters:
1086 # Returns information about the current migration parameters
1088 # Returns: @MigrationParameters
1090 # Since: 2.4
1092 # Example:
1094 # -> { "execute": "query-migrate-parameters" }
1095 # <- { "return": {
1096 #          "decompress-threads": 2,
1097 #          "cpu-throttle-increment": 10,
1098 #          "compress-threads": 8,
1099 #          "compress-level": 1,
1100 #          "cpu-throttle-initial": 20,
1101 #          "max-bandwidth": 33554432,
1102 #          "downtime-limit": 300
1103 #       }
1104 #    }
1107 { 'command': 'query-migrate-parameters',
1108   'returns': 'MigrationParameters' }
1111 # @client_migrate_info:
1113 # Set migration information for remote display.  This makes the server
1114 # ask the client to automatically reconnect using the new parameters
1115 # once migration finished successfully.  Only implemented for SPICE.
1117 # @protocol:     must be "spice"
1118 # @hostname:     migration target hostname
1119 # @port:         #optional spice tcp port for plaintext channels
1120 # @tls-port:     #optional spice tcp port for tls-secured channels
1121 # @cert-subject: #optional server certificate subject
1123 # Since: 0.14.0
1125 # Example:
1127 # -> { "execute": "client_migrate_info",
1128 #      "arguments": { "protocol": "spice",
1129 #                     "hostname": "virt42.lab.kraxel.org",
1130 #                     "port": 1234 } }
1131 # <- { "return": {} }
1134 { 'command': 'client_migrate_info',
1135   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1136             '*tls-port': 'int', '*cert-subject': 'str' } }
1139 # @migrate-start-postcopy:
1141 # Followup to a migration command to switch the migration to postcopy mode.
1142 # The postcopy-ram capability must be set before the original migration
1143 # command.
1145 # Since: 2.5
1147 # Example:
1149 # -> { "execute": "migrate-start-postcopy" }
1150 # <- { "return": {} }
1153 { 'command': 'migrate-start-postcopy' }
1156 # @COLOMessage:
1158 # The message transmission between Primary side and Secondary side.
1160 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1162 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1164 # @checkpoint-reply: SVM gets PVM's checkpoint request
1166 # @vmstate-send: VM's state will be sent by PVM.
1168 # @vmstate-size: The total size of VMstate.
1170 # @vmstate-received: VM's state has been received by SVM.
1172 # @vmstate-loaded: VM's state has been loaded by SVM.
1174 # Since: 2.8
1176 { 'enum': 'COLOMessage',
1177   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1178             'vmstate-send', 'vmstate-size', 'vmstate-received',
1179             'vmstate-loaded' ] }
1182 # @COLOMode:
1184 # The colo mode
1186 # @unknown: unknown mode
1188 # @primary: master side
1190 # @secondary: slave side
1192 # Since: 2.8
1194 { 'enum': 'COLOMode',
1195   'data': [ 'unknown', 'primary', 'secondary'] }
1198 # @FailoverStatus:
1200 # An enumeration of COLO failover status
1202 # @none: no failover has ever happened
1204 # @require: got failover requirement but not handled
1206 # @active: in the process of doing failover
1208 # @completed: finish the process of failover
1210 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1212 # Since: 2.8
1214 { 'enum': 'FailoverStatus',
1215   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1218 # @x-colo-lost-heartbeat:
1220 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1221 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1222 # If sent to the Secondary, the Secondary side will run failover work,
1223 # then takes over server operation to become the service VM.
1225 # Since: 2.8
1227 # Example:
1229 # -> { "execute": "x-colo-lost-heartbeat" }
1230 # <- { "return": {} }
1233 { 'command': 'x-colo-lost-heartbeat' }
1236 # @MouseInfo:
1238 # Information about a mouse device.
1240 # @name: the name of the mouse device
1242 # @index: the index of the mouse device
1244 # @current: true if this device is currently receiving mouse events
1246 # @absolute: true if this device supports absolute coordinates as input
1248 # Since: 0.14.0
1250 { 'struct': 'MouseInfo',
1251   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1252            'absolute': 'bool'} }
1255 # @query-mice:
1257 # Returns information about each active mouse device
1259 # Returns: a list of @MouseInfo for each device
1261 # Since: 0.14.0
1263 # Example:
1265 # -> { "execute": "query-mice" }
1266 # <- { "return": [
1267 #          {
1268 #             "name":"QEMU Microsoft Mouse",
1269 #             "index":0,
1270 #             "current":false,
1271 #             "absolute":false
1272 #          },
1273 #          {
1274 #             "name":"QEMU PS/2 Mouse",
1275 #             "index":1,
1276 #             "current":true,
1277 #             "absolute":true
1278 #          }
1279 #       ]
1280 #    }
1283 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1286 # @CpuInfoArch:
1288 # An enumeration of cpu types that enable additional information during
1289 # @query-cpus.
1291 # Since: 2.6
1293 { 'enum': 'CpuInfoArch',
1294   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1297 # @CpuInfo:
1299 # Information about a virtual CPU
1301 # @CPU: the index of the virtual CPU
1303 # @current: this only exists for backwards compatibility and should be ignored
1305 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1306 #          to a processor specific low power mode.
1308 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1310 # @thread_id: ID of the underlying host thread
1312 # @arch: architecture of the cpu, which determines which additional fields
1313 #        will be listed (since 2.6)
1315 # Since: 0.14.0
1317 # Notes: @halted is a transient state that changes frequently.  By the time the
1318 #        data is sent to the client, the guest may no longer be halted.
1320 { 'union': 'CpuInfo',
1321   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1322            'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' },
1323   'discriminator': 'arch',
1324   'data': { 'x86': 'CpuInfoX86',
1325             'sparc': 'CpuInfoSPARC',
1326             'ppc': 'CpuInfoPPC',
1327             'mips': 'CpuInfoMIPS',
1328             'tricore': 'CpuInfoTricore',
1329             'other': 'CpuInfoOther' } }
1332 # @CpuInfoX86:
1334 # Additional information about a virtual i386 or x86_64 CPU
1336 # @pc: the 64-bit instruction pointer
1338 # Since: 2.6
1340 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1343 # @CpuInfoSPARC:
1345 # Additional information about a virtual SPARC CPU
1347 # @pc: the PC component of the instruction pointer
1349 # @npc: the NPC component of the instruction pointer
1351 # Since: 2.6
1353 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1356 # @CpuInfoPPC:
1358 # Additional information about a virtual PPC CPU
1360 # @nip: the instruction pointer
1362 # Since: 2.6
1364 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1367 # @CpuInfoMIPS:
1369 # Additional information about a virtual MIPS CPU
1371 # @PC: the instruction pointer
1373 # Since: 2.6
1375 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1378 # @CpuInfoTricore:
1380 # Additional information about a virtual Tricore CPU
1382 # @PC: the instruction pointer
1384 # Since: 2.6
1386 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1389 # @CpuInfoOther:
1391 # No additional information is available about the virtual CPU
1393 # Since: 2.6
1396 { 'struct': 'CpuInfoOther', 'data': { } }
1399 # @query-cpus:
1401 # Returns a list of information about each virtual CPU.
1403 # Returns: a list of @CpuInfo for each virtual CPU
1405 # Since: 0.14.0
1407 # Example:
1409 # -> { "execute": "query-cpus" }
1410 # <- { "return": [
1411 #          {
1412 #             "CPU":0,
1413 #             "current":true,
1414 #             "halted":false,
1415 #             "qom_path":"/machine/unattached/device[0]",
1416 #             "arch":"x86",
1417 #             "pc":3227107138,
1418 #             "thread_id":3134
1419 #          },
1420 #          {
1421 #             "CPU":1,
1422 #             "current":false,
1423 #             "halted":true,
1424 #             "qom_path":"/machine/unattached/device[2]",
1425 #             "arch":"x86",
1426 #             "pc":7108165,
1427 #             "thread_id":3135
1428 #          }
1429 #       ]
1430 #    }
1433 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1436 # @IOThreadInfo:
1438 # Information about an iothread
1440 # @id: the identifier of the iothread
1442 # @thread-id: ID of the underlying host thread
1444 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1445 #               (since 2.9)
1447 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1448 #             configured (since 2.9)
1450 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1451 #               it's not configured (since 2.9)
1453 # Since: 2.0
1455 { 'struct': 'IOThreadInfo',
1456   'data': {'id': 'str',
1457            'thread-id': 'int',
1458            'poll-max-ns': 'int',
1459            'poll-grow': 'int',
1460            'poll-shrink': 'int' } }
1463 # @query-iothreads:
1465 # Returns a list of information about each iothread.
1467 # Note: this list excludes the QEMU main loop thread, which is not declared
1468 # using the -object iothread command-line option.  It is always the main thread
1469 # of the process.
1471 # Returns: a list of @IOThreadInfo for each iothread
1473 # Since: 2.0
1475 # Example:
1477 # -> { "execute": "query-iothreads" }
1478 # <- { "return": [
1479 #          {
1480 #             "id":"iothread0",
1481 #             "thread-id":3134
1482 #          },
1483 #          {
1484 #             "id":"iothread1",
1485 #             "thread-id":3135
1486 #          }
1487 #       ]
1488 #    }
1491 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1494 # @NetworkAddressFamily:
1496 # The network address family
1498 # @ipv4: IPV4 family
1500 # @ipv6: IPV6 family
1502 # @unix: unix socket
1504 # @vsock: vsock family (since 2.8)
1506 # @unknown: otherwise
1508 # Since: 2.1
1510 { 'enum': 'NetworkAddressFamily',
1511   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1514 # @VncBasicInfo:
1516 # The basic information for vnc network connection
1518 # @host: IP address
1520 # @service: The service name of the vnc port. This may depend on the host
1521 #           system's service database so symbolic names should not be relied
1522 #           on.
1524 # @family: address family
1526 # @websocket: true in case the socket is a websocket (since 2.3).
1528 # Since: 2.1
1530 { 'struct': 'VncBasicInfo',
1531   'data': { 'host': 'str',
1532             'service': 'str',
1533             'family': 'NetworkAddressFamily',
1534             'websocket': 'bool' } }
1537 # @VncServerInfo:
1539 # The network connection information for server
1541 # @auth: #optional authentication method used for
1542 #        the plain (non-websocket) VNC server
1544 # Since: 2.1
1546 { 'struct': 'VncServerInfo',
1547   'base': 'VncBasicInfo',
1548   'data': { '*auth': 'str' } }
1551 # @VncClientInfo:
1553 # Information about a connected VNC client.
1555 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1556 #              Name of the client.
1558 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1559 #                 used for authentication.
1561 # Since: 0.14.0
1563 { 'struct': 'VncClientInfo',
1564   'base': 'VncBasicInfo',
1565   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1568 # @VncInfo:
1570 # Information about the VNC session.
1572 # @enabled: true if the VNC server is enabled, false otherwise
1574 # @host: #optional The hostname the VNC server is bound to.  This depends on
1575 #        the name resolution on the host and may be an IP address.
1577 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1578 #                    'ipv4' if the host is listening for IPv4 connections
1579 #                    'unix' if the host is listening on a unix domain socket
1580 #                    'unknown' otherwise
1582 # @service: #optional The service name of the server's port.  This may depends
1583 #           on the host system's service database so symbolic names should not
1584 #           be relied on.
1586 # @auth: #optional the current authentication type used by the server
1587 #        'none' if no authentication is being used
1588 #        'vnc' if VNC authentication is being used
1589 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1590 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1591 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1592 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1593 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1594 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1595 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1596 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1597 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1599 # @clients: a list of @VncClientInfo of all currently connected clients
1601 # Since: 0.14.0
1603 { 'struct': 'VncInfo',
1604   'data': {'enabled': 'bool', '*host': 'str',
1605            '*family': 'NetworkAddressFamily',
1606            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1609 # @VncPrimaryAuth:
1611 # vnc primary authentication method.
1613 # Since: 2.3
1615 { 'enum': 'VncPrimaryAuth',
1616   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1617             'tls', 'vencrypt', 'sasl' ] }
1620 # @VncVencryptSubAuth:
1622 # vnc sub authentication method with vencrypt.
1624 # Since: 2.3
1626 { 'enum': 'VncVencryptSubAuth',
1627   'data': [ 'plain',
1628             'tls-none',  'x509-none',
1629             'tls-vnc',   'x509-vnc',
1630             'tls-plain', 'x509-plain',
1631             'tls-sasl',  'x509-sasl' ] }
1635 # @VncServerInfo2:
1637 # The network connection information for server
1639 # @auth: The current authentication type used by the servers
1641 # @vencrypt: #optional The vencrypt sub authentication type used by the
1642 #            servers, only specified in case auth == vencrypt.
1644 # Since: 2.9
1646 { 'struct': 'VncServerInfo2',
1647   'base': 'VncBasicInfo',
1648   'data': { 'auth'      : 'VncPrimaryAuth',
1649             '*vencrypt' : 'VncVencryptSubAuth' } }
1653 # @VncInfo2:
1655 # Information about a vnc server
1657 # @id: vnc server name.
1659 # @server: A list of @VncBasincInfo describing all listening sockets.
1660 #          The list can be empty (in case the vnc server is disabled).
1661 #          It also may have multiple entries: normal + websocket,
1662 #          possibly also ipv4 + ipv6 in the future.
1664 # @clients: A list of @VncClientInfo of all currently connected clients.
1665 #           The list can be empty, for obvious reasons.
1667 # @auth: The current authentication type used by the non-websockets servers
1669 # @vencrypt: #optional The vencrypt authentication type used by the servers,
1670 #            only specified in case auth == vencrypt.
1672 # @display: #optional The display device the vnc server is linked to.
1674 # Since: 2.3
1676 { 'struct': 'VncInfo2',
1677   'data': { 'id'        : 'str',
1678             'server'    : ['VncServerInfo2'],
1679             'clients'   : ['VncClientInfo'],
1680             'auth'      : 'VncPrimaryAuth',
1681             '*vencrypt' : 'VncVencryptSubAuth',
1682             '*display'  : 'str' } }
1685 # @query-vnc:
1687 # Returns information about the current VNC server
1689 # Returns: @VncInfo
1691 # Since: 0.14.0
1693 # Example:
1695 # -> { "execute": "query-vnc" }
1696 # <- { "return": {
1697 #          "enabled":true,
1698 #          "host":"0.0.0.0",
1699 #          "service":"50402",
1700 #          "auth":"vnc",
1701 #          "family":"ipv4",
1702 #          "clients":[
1703 #             {
1704 #                "host":"127.0.0.1",
1705 #                "service":"50401",
1706 #                "family":"ipv4"
1707 #             }
1708 #          ]
1709 #       }
1710 #    }
1713 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1716 # @query-vnc-servers:
1718 # Returns a list of vnc servers.  The list can be empty.
1720 # Returns: a list of @VncInfo2
1722 # Since: 2.3
1724 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1727 # @SpiceBasicInfo:
1729 # The basic information for SPICE network connection
1731 # @host: IP address
1733 # @port: port number
1735 # @family: address family
1737 # Since: 2.1
1739 { 'struct': 'SpiceBasicInfo',
1740   'data': { 'host': 'str',
1741             'port': 'str',
1742             'family': 'NetworkAddressFamily' } }
1745 # @SpiceServerInfo:
1747 # Information about a SPICE server
1749 # @auth: #optional authentication method
1751 # Since: 2.1
1753 { 'struct': 'SpiceServerInfo',
1754   'base': 'SpiceBasicInfo',
1755   'data': { '*auth': 'str' } }
1758 # @SpiceChannel:
1760 # Information about a SPICE client channel.
1762 # @connection-id: SPICE connection id number.  All channels with the same id
1763 #                 belong to the same SPICE session.
1765 # @channel-type: SPICE channel type number.  "1" is the main control
1766 #                channel, filter for this one if you want to track spice
1767 #                sessions only
1769 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1770 #              multiple channels of the same type exist, such as multiple
1771 #              display channels in a multihead setup
1773 # @tls: true if the channel is encrypted, false otherwise.
1775 # Since: 0.14.0
1777 { 'struct': 'SpiceChannel',
1778   'base': 'SpiceBasicInfo',
1779   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1780            'tls': 'bool'} }
1783 # @SpiceQueryMouseMode:
1785 # An enumeration of Spice mouse states.
1787 # @client: Mouse cursor position is determined by the client.
1789 # @server: Mouse cursor position is determined by the server.
1791 # @unknown: No information is available about mouse mode used by
1792 #           the spice server.
1794 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1796 # Since: 1.1
1798 { 'enum': 'SpiceQueryMouseMode',
1799   'data': [ 'client', 'server', 'unknown' ] }
1802 # @SpiceInfo:
1804 # Information about the SPICE session.
1806 # @enabled: true if the SPICE server is enabled, false otherwise
1808 # @migrated: true if the last guest migration completed and spice
1809 #            migration had completed as well. false otherwise. (since 1.4)
1811 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1812 #        the name resolution on the host and may be an IP address.
1814 # @port: #optional The SPICE server's port number.
1816 # @compiled-version: #optional SPICE server version.
1818 # @tls-port: #optional The SPICE server's TLS port number.
1820 # @auth: #optional the current authentication type used by the server
1821 #        'none'  if no authentication is being used
1822 #        'spice' uses SASL or direct TLS authentication, depending on command
1823 #                line options
1825 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1826 #              be determined by the client or the server, or unknown if spice
1827 #              server doesn't provide this information. (since: 1.1)
1829 # @channels: a list of @SpiceChannel for each active spice channel
1831 # Since: 0.14.0
1833 { 'struct': 'SpiceInfo',
1834   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1835            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1836            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1839 # @query-spice:
1841 # Returns information about the current SPICE server
1843 # Returns: @SpiceInfo
1845 # Since: 0.14.0
1847 # Example:
1849 # -> { "execute": "query-spice" }
1850 # <- { "return": {
1851 #          "enabled": true,
1852 #          "auth": "spice",
1853 #          "port": 5920,
1854 #          "tls-port": 5921,
1855 #          "host": "0.0.0.0",
1856 #          "channels": [
1857 #             {
1858 #                "port": "54924",
1859 #                "family": "ipv4",
1860 #                "channel-type": 1,
1861 #                "connection-id": 1804289383,
1862 #                "host": "127.0.0.1",
1863 #                "channel-id": 0,
1864 #                "tls": true
1865 #             },
1866 #             {
1867 #                "port": "36710",
1868 #                "family": "ipv4",
1869 #                "channel-type": 4,
1870 #                "connection-id": 1804289383,
1871 #                "host": "127.0.0.1",
1872 #                "channel-id": 0,
1873 #                "tls": false
1874 #             },
1875 #             [ ... more channels follow ... ]
1876 #          ]
1877 #       }
1878 #    }
1881 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1884 # @BalloonInfo:
1886 # Information about the guest balloon device.
1888 # @actual: the number of bytes the balloon currently contains
1890 # Since: 0.14.0
1893 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1896 # @query-balloon:
1898 # Return information about the balloon device.
1900 # Returns: @BalloonInfo on success
1902 #          If the balloon driver is enabled but not functional because the KVM
1903 #          kernel module cannot support it, KvmMissingCap
1905 #          If no balloon device is present, DeviceNotActive
1907 # Since: 0.14.0
1909 # Example:
1911 # -> { "execute": "query-balloon" }
1912 # <- { "return": {
1913 #          "actual": 1073741824,
1914 #       }
1915 #    }
1918 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1921 # @PciMemoryRange:
1923 # A PCI device memory region
1925 # @base: the starting address (guest physical)
1927 # @limit: the ending address (guest physical)
1929 # Since: 0.14.0
1931 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1934 # @PciMemoryRegion:
1936 # Information about a PCI device I/O region.
1938 # @bar: the index of the Base Address Register for this region
1940 # @type: 'io' if the region is a PIO region
1941 #        'memory' if the region is a MMIO region
1943 # @size: memory size
1945 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1947 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1949 # Since: 0.14.0
1951 { 'struct': 'PciMemoryRegion',
1952   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1953            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1956 # @PciBusInfo:
1958 # Information about a bus of a PCI Bridge device
1960 # @number: primary bus interface number.  This should be the number of the
1961 #          bus the device resides on.
1963 # @secondary: secondary bus interface number.  This is the number of the
1964 #             main bus for the bridge
1966 # @subordinate: This is the highest number bus that resides below the
1967 #               bridge.
1969 # @io_range: The PIO range for all devices on this bridge
1971 # @memory_range: The MMIO range for all devices on this bridge
1973 # @prefetchable_range: The range of prefetchable MMIO for all devices on
1974 #                      this bridge
1976 # Since: 2.4
1978 { 'struct': 'PciBusInfo',
1979   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1980            'io_range': 'PciMemoryRange',
1981            'memory_range': 'PciMemoryRange',
1982            'prefetchable_range': 'PciMemoryRange' } }
1985 # @PciBridgeInfo:
1987 # Information about a PCI Bridge device
1989 # @bus: information about the bus the device resides on
1991 # @devices: a list of @PciDeviceInfo for each device on this bridge
1993 # Since: 0.14.0
1995 { 'struct': 'PciBridgeInfo',
1996   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
1999 # @PciDeviceClass:
2001 # Information about the Class of a PCI device
2003 # @desc: #optional a string description of the device's class
2005 # @class: the class code of the device
2007 # Since: 2.4
2009 { 'struct': 'PciDeviceClass',
2010   'data': {'*desc': 'str', 'class': 'int'} }
2013 # @PciDeviceId:
2015 # Information about the Id of a PCI device
2017 # @device: the PCI device id
2019 # @vendor: the PCI vendor id
2021 # Since: 2.4
2023 { 'struct': 'PciDeviceId',
2024   'data': {'device': 'int', 'vendor': 'int'} }
2027 # @PciDeviceInfo:
2029 # Information about a PCI device
2031 # @bus: the bus number of the device
2033 # @slot: the slot the device is located in
2035 # @function: the function of the slot used by the device
2037 # @class_info: the class of the device
2039 # @id: the PCI device id
2041 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
2043 # @qdev_id: the device name of the PCI device
2045 # @pci_bridge: if the device is a PCI bridge, the bridge information
2047 # @regions: a list of the PCI I/O regions associated with the device
2049 # Notes: the contents of @class_info.desc are not stable and should only be
2050 #        treated as informational.
2052 # Since: 0.14.0
2054 { 'struct': 'PciDeviceInfo',
2055   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
2056            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
2057            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2058            'regions': ['PciMemoryRegion']} }
2061 # @PciInfo:
2063 # Information about a PCI bus
2065 # @bus: the bus index
2067 # @devices: a list of devices on this bus
2069 # Since: 0.14.0
2071 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
2074 # @query-pci:
2076 # Return information about the PCI bus topology of the guest.
2078 # Returns: a list of @PciInfo for each PCI bus. Each bus is
2079 # represented by a json-object, which has a key with a json-array of
2080 # all PCI devices attached to it. Each device is represented by a
2081 # json-object.
2083 # Since: 0.14.0
2085 # Example:
2087 # -> { "execute": "query-pci" }
2088 # <- { "return": [
2089 #          {
2090 #             "bus": 0,
2091 #             "devices": [
2092 #                {
2093 #                   "bus": 0,
2094 #                   "qdev_id": "",
2095 #                   "slot": 0,
2096 #                   "class_info": {
2097 #                      "class": 1536,
2098 #                      "desc": "Host bridge"
2099 #                   },
2100 #                   "id": {
2101 #                      "device": 32902,
2102 #                      "vendor": 4663
2103 #                   },
2104 #                   "function": 0,
2105 #                   "regions": [
2106 #                   ]
2107 #                },
2108 #                {
2109 #                   "bus": 0,
2110 #                   "qdev_id": "",
2111 #                   "slot": 1,
2112 #                   "class_info": {
2113 #                      "class": 1537,
2114 #                      "desc": "ISA bridge"
2115 #                   },
2116 #                   "id": {
2117 #                      "device": 32902,
2118 #                      "vendor": 28672
2119 #                   },
2120 #                   "function": 0,
2121 #                   "regions": [
2122 #                   ]
2123 #                },
2124 #                {
2125 #                   "bus": 0,
2126 #                   "qdev_id": "",
2127 #                   "slot": 1,
2128 #                   "class_info": {
2129 #                      "class": 257,
2130 #                      "desc": "IDE controller"
2131 #                   },
2132 #                   "id": {
2133 #                      "device": 32902,
2134 #                      "vendor": 28688
2135 #                   },
2136 #                   "function": 1,
2137 #                   "regions": [
2138 #                      {
2139 #                         "bar": 4,
2140 #                         "size": 16,
2141 #                         "address": 49152,
2142 #                         "type": "io"
2143 #                      }
2144 #                   ]
2145 #                },
2146 #                {
2147 #                   "bus": 0,
2148 #                   "qdev_id": "",
2149 #                   "slot": 2,
2150 #                   "class_info": {
2151 #                      "class": 768,
2152 #                      "desc": "VGA controller"
2153 #                   },
2154 #                   "id": {
2155 #                      "device": 4115,
2156 #                      "vendor": 184
2157 #                   },
2158 #                   "function": 0,
2159 #                   "regions": [
2160 #                      {
2161 #                         "prefetch": true,
2162 #                         "mem_type_64": false,
2163 #                         "bar": 0,
2164 #                         "size": 33554432,
2165 #                         "address": 4026531840,
2166 #                         "type": "memory"
2167 #                      },
2168 #                      {
2169 #                         "prefetch": false,
2170 #                         "mem_type_64": false,
2171 #                         "bar": 1,
2172 #                         "size": 4096,
2173 #                         "address": 4060086272,
2174 #                         "type": "memory"
2175 #                      },
2176 #                      {
2177 #                         "prefetch": false,
2178 #                         "mem_type_64": false,
2179 #                         "bar": 6,
2180 #                         "size": 65536,
2181 #                         "address": -1,
2182 #                         "type": "memory"
2183 #                      }
2184 #                   ]
2185 #                },
2186 #                {
2187 #                   "bus": 0,
2188 #                   "qdev_id": "",
2189 #                   "irq": 11,
2190 #                   "slot": 4,
2191 #                   "class_info": {
2192 #                      "class": 1280,
2193 #                      "desc": "RAM controller"
2194 #                   },
2195 #                   "id": {
2196 #                      "device": 6900,
2197 #                      "vendor": 4098
2198 #                   },
2199 #                   "function": 0,
2200 #                   "regions": [
2201 #                      {
2202 #                         "bar": 0,
2203 #                         "size": 32,
2204 #                         "address": 49280,
2205 #                         "type": "io"
2206 #                      }
2207 #                   ]
2208 #                }
2209 #             ]
2210 #          }
2211 #       ]
2212 #    }
2214 # Note: This example has been shortened as the real response is too long.
2217 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2220 # @quit:
2222 # This command will cause the QEMU process to exit gracefully.  While every
2223 # attempt is made to send the QMP response before terminating, this is not
2224 # guaranteed.  When using this interface, a premature EOF would not be
2225 # unexpected.
2227 # Since: 0.14.0
2229 # Example:
2231 # -> { "execute": "quit" }
2232 # <- { "return": {} }
2234 { 'command': 'quit' }
2237 # @stop:
2239 # Stop all guest VCPU execution.
2241 # Since:  0.14.0
2243 # Notes:  This function will succeed even if the guest is already in the stopped
2244 #         state.  In "inmigrate" state, it will ensure that the guest
2245 #         remains paused once migration finishes, as if the -S option was
2246 #         passed on the command line.
2248 # Example:
2250 # -> { "execute": "stop" }
2251 # <- { "return": {} }
2254 { 'command': 'stop' }
2257 # @system_reset:
2259 # Performs a hard reset of a guest.
2261 # Since: 0.14.0
2263 # Example:
2265 # -> { "execute": "system_reset" }
2266 # <- { "return": {} }
2269 { 'command': 'system_reset' }
2272 # @system_powerdown:
2274 # Requests that a guest perform a powerdown operation.
2276 # Since: 0.14.0
2278 # Notes: A guest may or may not respond to this command.  This command
2279 #        returning does not indicate that a guest has accepted the request or
2280 #        that it has shut down.  Many guests will respond to this command by
2281 #        prompting the user in some way.
2282 # Example:
2284 # -> { "execute": "system_powerdown" }
2285 # <- { "return": {} }
2288 { 'command': 'system_powerdown' }
2291 # @cpu:
2293 # This command is a nop that is only provided for the purposes of compatibility.
2295 # Since: 0.14.0
2297 # Notes: Do not use this command.
2299 { 'command': 'cpu', 'data': {'index': 'int'} }
2302 # @cpu-add:
2304 # Adds CPU with specified ID
2306 # @id: ID of CPU to be created, valid values [0..max_cpus)
2308 # Returns: Nothing on success
2310 # Since: 1.5
2312 # Example:
2314 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2315 # <- { "return": {} }
2318 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2321 # @memsave:
2323 # Save a portion of guest memory to a file.
2325 # @val: the virtual address of the guest to start from
2327 # @size: the size of memory region to save
2329 # @filename: the file to save the memory to as binary data
2331 # @cpu-index: #optional the index of the virtual CPU to use for translating the
2332 #                       virtual address (defaults to CPU 0)
2334 # Returns: Nothing on success
2336 # Since: 0.14.0
2338 # Notes: Errors were not reliably returned until 1.1
2340 # Example:
2342 # -> { "execute": "memsave",
2343 #      "arguments": { "val": 10,
2344 #                     "size": 100,
2345 #                     "filename": "/tmp/virtual-mem-dump" } }
2346 # <- { "return": {} }
2349 { 'command': 'memsave',
2350   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2353 # @pmemsave:
2355 # Save a portion of guest physical memory to a file.
2357 # @val: the physical address of the guest to start from
2359 # @size: the size of memory region to save
2361 # @filename: the file to save the memory to as binary data
2363 # Returns: Nothing on success
2365 # Since: 0.14.0
2367 # Notes: Errors were not reliably returned until 1.1
2369 # Example:
2371 # -> { "execute": "pmemsave",
2372 #      "arguments": { "val": 10,
2373 #                     "size": 100,
2374 #                     "filename": "/tmp/physical-mem-dump" } }
2375 # <- { "return": {} }
2378 { 'command': 'pmemsave',
2379   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2382 # @cont:
2384 # Resume guest VCPU execution.
2386 # Since:  0.14.0
2388 # Returns:  If successful, nothing
2389 #           If QEMU was started with an encrypted block device and a key has
2390 #              not yet been set, DeviceEncrypted.
2392 # Notes:  This command will succeed if the guest is currently running.  It
2393 #         will also succeed if the guest is in the "inmigrate" state; in
2394 #         this case, the effect of the command is to make sure the guest
2395 #         starts once migration finishes, removing the effect of the -S
2396 #         command line option if it was passed.
2398 # Example:
2400 # -> { "execute": "cont" }
2401 # <- { "return": {} }
2404 { 'command': 'cont' }
2407 # @system_wakeup:
2409 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2411 # Since:  1.1
2413 # Returns:  nothing.
2415 # Example:
2417 # -> { "execute": "system_wakeup" }
2418 # <- { "return": {} }
2421 { 'command': 'system_wakeup' }
2424 # @inject-nmi:
2426 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2427 # The command fails when the guest doesn't support injecting.
2429 # Returns:  If successful, nothing
2431 # Since:  0.14.0
2433 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2435 # Example:
2437 # -> { "execute": "inject-nmi" }
2438 # <- { "return": {} }
2441 { 'command': 'inject-nmi' }
2444 # @set_link:
2446 # Sets the link status of a virtual network adapter.
2448 # @name: the device name of the virtual network adapter
2450 # @up: true to set the link status to be up
2452 # Returns: Nothing on success
2453 #          If @name is not a valid network device, DeviceNotFound
2455 # Since: 0.14.0
2457 # Notes: Not all network adapters support setting link status.  This command
2458 #        will succeed even if the network adapter does not support link status
2459 #        notification.
2461 # Example:
2463 # -> { "execute": "set_link",
2464 #      "arguments": { "name": "e1000.0", "up": false } }
2465 # <- { "return": {} }
2468 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2471 # @balloon:
2473 # Request the balloon driver to change its balloon size.
2475 # @value: the target size of the balloon in bytes
2477 # Returns: Nothing on success
2478 #          If the balloon driver is enabled but not functional because the KVM
2479 #            kernel module cannot support it, KvmMissingCap
2480 #          If no balloon device is present, DeviceNotActive
2482 # Notes: This command just issues a request to the guest.  When it returns,
2483 #        the balloon size may not have changed.  A guest can change the balloon
2484 #        size independent of this command.
2486 # Since: 0.14.0
2488 # Example:
2490 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2491 # <- { "return": {} }
2494 { 'command': 'balloon', 'data': {'value': 'int'} }
2497 # @Abort:
2499 # This action can be used to test transaction failure.
2501 # Since: 1.6
2503 { 'struct': 'Abort',
2504   'data': { } }
2507 # @ActionCompletionMode:
2509 # An enumeration of Transactional completion modes.
2511 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2512 #              after the Transaction request succeeds. All Actions that
2513 #              can complete successfully will do so without waiting on others.
2514 #              This is the default.
2516 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2517 #           Actions. Actions do not complete until all Actions are ready to
2518 #           complete. May be rejected by Actions that do not support this
2519 #           completion mode.
2521 # Since: 2.5
2523 { 'enum': 'ActionCompletionMode',
2524   'data': [ 'individual', 'grouped' ] }
2527 # @TransactionAction:
2529 # A discriminated record of operations that can be performed with
2530 # @transaction. Action @type can be:
2532 # - @abort: since 1.6
2533 # - @block-dirty-bitmap-add: since 2.5
2534 # - @block-dirty-bitmap-clear: since 2.5
2535 # - @blockdev-backup: since 2.3
2536 # - @blockdev-snapshot: since 2.5
2537 # - @blockdev-snapshot-internal-sync: since 1.7
2538 # - @blockdev-snapshot-sync: since 1.1
2539 # - @drive-backup: since 1.6
2541 # Since: 1.1
2543 { 'union': 'TransactionAction',
2544   'data': {
2545        'abort': 'Abort',
2546        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2547        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2548        'blockdev-backup': 'BlockdevBackup',
2549        'blockdev-snapshot': 'BlockdevSnapshot',
2550        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2551        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2552        'drive-backup': 'DriveBackup'
2553    } }
2556 # @TransactionProperties:
2558 # Optional arguments to modify the behavior of a Transaction.
2560 # @completion-mode: #optional Controls how jobs launched asynchronously by
2561 #                   Actions will complete or fail as a group.
2562 #                   See @ActionCompletionMode for details.
2564 # Since: 2.5
2566 { 'struct': 'TransactionProperties',
2567   'data': {
2568        '*completion-mode': 'ActionCompletionMode'
2569   }
2573 # @transaction:
2575 # Executes a number of transactionable QMP commands atomically. If any
2576 # operation fails, then the entire set of actions will be abandoned and the
2577 # appropriate error returned.
2579 # For external snapshots, the dictionary contains the device, the file to use for
2580 # the new snapshot, and the format.  The default format, if not specified, is
2581 # qcow2.
2583 # Each new snapshot defaults to being created by QEMU (wiping any
2584 # contents if the file already exists), but it is also possible to reuse
2585 # an externally-created file.  In the latter case, you should ensure that
2586 # the new image file has the same contents as the current one; QEMU cannot
2587 # perform any meaningful check.  Typically this is achieved by using the
2588 # current image file as the backing file for the new image.
2590 # On failure, the original disks pre-snapshot attempt will be used.
2592 # For internal snapshots, the dictionary contains the device and the snapshot's
2593 # name.  If an internal snapshot matching name already exists, the request will
2594 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2595 # and sheepdog.
2597 # On failure, qemu will try delete the newly created internal snapshot in the
2598 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2599 # it later with qemu-img or other command.
2601 # @actions: List of @TransactionAction;
2602 #           information needed for the respective operations.
2604 # @properties: #optional structure of additional options to control the
2605 #              execution of the transaction. See @TransactionProperties
2606 #              for additional detail.
2608 # Returns: nothing on success
2610 #          Errors depend on the operations of the transaction
2612 # Note: The transaction aborts on the first failure.  Therefore, there will be
2613 # information on only one failed operation returned in an error condition, and
2614 # subsequent actions will not have been attempted.
2616 # Since: 1.1
2618 # Example:
2620 # -> { "execute": "transaction",
2621 #      "arguments": { "actions": [
2622 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2623 #                                      "snapshot-file": "/some/place/my-image",
2624 #                                      "format": "qcow2" } },
2625 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2626 #                                      "snapshot-file": "/some/place/my-image2",
2627 #                                      "snapshot-node-name": "node3432",
2628 #                                      "mode": "existing",
2629 #                                      "format": "qcow2" } },
2630 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2631 #                                      "snapshot-file": "/some/place/my-image2",
2632 #                                      "mode": "existing",
2633 #                                      "format": "qcow2" } },
2634 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2635 #                                      "device": "ide-hd2",
2636 #                                      "name": "snapshot0" } } ] } }
2637 # <- { "return": {} }
2640 { 'command': 'transaction',
2641   'data': { 'actions': [ 'TransactionAction' ],
2642             '*properties': 'TransactionProperties'
2643           }
2647 # @human-monitor-command:
2649 # Execute a command on the human monitor and return the output.
2651 # @command-line: the command to execute in the human monitor
2653 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2655 # Returns: the output of the command as a string
2657 # Since: 0.14.0
2659 # Notes: This command only exists as a stop-gap.  Its use is highly
2660 #        discouraged.  The semantics of this command are not
2661 #        guaranteed: this means that command names, arguments and
2662 #        responses can change or be removed at ANY time.  Applications
2663 #        that rely on long term stability guarantees should NOT
2664 #        use this command.
2666 #        Known limitations:
2668 #        * This command is stateless, this means that commands that depend
2669 #          on state information (such as getfd) might not work
2671 #        * Commands that prompt the user for data (eg. 'cont' when the block
2672 #          device is encrypted) don't currently work
2674 # Example:
2676 # -> { "execute": "human-monitor-command",
2677 #      "arguments": { "command-line": "info kvm" } }
2678 # <- { "return": "kvm support: enabled\r\n" }
2681 { 'command': 'human-monitor-command',
2682   'data': {'command-line': 'str', '*cpu-index': 'int'},
2683   'returns': 'str' }
2686 # @migrate_cancel:
2688 # Cancel the current executing migration process.
2690 # Returns: nothing on success
2692 # Notes: This command succeeds even if there is no migration process running.
2694 # Since: 0.14.0
2696 # Example:
2698 # -> { "execute": "migrate_cancel" }
2699 # <- { "return": {} }
2702 { 'command': 'migrate_cancel' }
2705 # @migrate_set_downtime:
2707 # Set maximum tolerated downtime for migration.
2709 # @value: maximum downtime in seconds
2711 # Returns: nothing on success
2713 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2715 # Since: 0.14.0
2717 # Example:
2719 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2720 # <- { "return": {} }
2723 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2726 # @migrate_set_speed:
2728 # Set maximum speed for migration.
2730 # @value: maximum speed in bytes per second.
2732 # Returns: nothing on success
2734 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2736 # Since: 0.14.0
2738 # Example:
2740 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2741 # <- { "return": {} }
2744 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2747 # @migrate-set-cache-size:
2749 # Set cache size to be used by XBZRLE migration
2751 # @value: cache size in bytes
2753 # The size will be rounded down to the nearest power of 2.
2754 # The cache size can be modified before and during ongoing migration
2756 # Returns: nothing on success
2758 # Since: 1.2
2760 # Example:
2762 # -> { "execute": "migrate-set-cache-size",
2763 #      "arguments": { "value": 536870912 } }
2764 # <- { "return": {} }
2767 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2770 # @query-migrate-cache-size:
2772 # Query migration XBZRLE cache size
2774 # Returns: XBZRLE cache size in bytes
2776 # Since: 1.2
2778 # Example:
2780 # -> { "execute": "query-migrate-cache-size" }
2781 # <- { "return": 67108864 }
2784 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2787 # @ObjectPropertyInfo:
2789 # @name: the name of the property
2791 # @type: the type of the property.  This will typically come in one of four
2792 #        forms:
2794 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2795 #           These types are mapped to the appropriate JSON type.
2797 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2798 #           device type name.  Child properties create the composition tree.
2800 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2801 #           device type name.  Link properties form the device model graph.
2803 # Since: 1.2
2805 { 'struct': 'ObjectPropertyInfo',
2806   'data': { 'name': 'str', 'type': 'str' } }
2809 # @qom-list:
2811 # This command will list any properties of a object given a path in the object
2812 # model.
2814 # @path: the path within the object model.  See @qom-get for a description of
2815 #        this parameter.
2817 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2818 #          object.
2820 # Since: 1.2
2822 { 'command': 'qom-list',
2823   'data': { 'path': 'str' },
2824   'returns': [ 'ObjectPropertyInfo' ] }
2827 # @qom-get:
2829 # This command will get a property from a object model path and return the
2830 # value.
2832 # @path: The path within the object model.  There are two forms of supported
2833 #        paths--absolute and partial paths.
2835 #        Absolute paths are derived from the root object and can follow child<>
2836 #        or link<> properties.  Since they can follow link<> properties, they
2837 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2838 #        and are prefixed  with a leading slash.
2840 #        Partial paths look like relative filenames.  They do not begin
2841 #        with a prefix.  The matching rules for partial paths are subtle but
2842 #        designed to make specifying objects easy.  At each level of the
2843 #        composition tree, the partial path is matched as an absolute path.
2844 #        The first match is not returned.  At least two matches are searched
2845 #        for.  A successful result is only returned if only one match is
2846 #        found.  If more than one match is found, a flag is return to
2847 #        indicate that the match was ambiguous.
2849 # @property: The property name to read
2851 # Returns: The property value.  The type depends on the property
2852 #          type. child<> and link<> properties are returned as #str
2853 #          pathnames.  All integer property types (u8, u16, etc) are
2854 #          returned as #int.
2856 # Since: 1.2
2858 { 'command': 'qom-get',
2859   'data': { 'path': 'str', 'property': 'str' },
2860   'returns': 'any' }
2863 # @qom-set:
2865 # This command will set a property from a object model path.
2867 # @path: see @qom-get for a description of this parameter
2869 # @property: the property name to set
2871 # @value: a value who's type is appropriate for the property type.  See @qom-get
2872 #         for a description of type mapping.
2874 # Since: 1.2
2876 { 'command': 'qom-set',
2877   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2880 # @set_password:
2882 # Sets the password of a remote display session.
2884 # @protocol: `vnc' to modify the VNC server password
2885 #            `spice' to modify the Spice server password
2887 # @password: the new password
2889 # @connected: #optional how to handle existing clients when changing the
2890 #                       password.  If nothing is specified, defaults to `keep'
2891 #                       `fail' to fail the command if clients are connected
2892 #                       `disconnect' to disconnect existing clients
2893 #                       `keep' to maintain existing clients
2895 # Returns: Nothing on success
2896 #          If Spice is not enabled, DeviceNotFound
2898 # Since: 0.14.0
2900 # Example:
2902 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2903 #                                                "password": "secret" } }
2904 # <- { "return": {} }
2907 { 'command': 'set_password',
2908   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2911 # @expire_password:
2913 # Expire the password of a remote display server.
2915 # @protocol: the name of the remote display protocol `vnc' or `spice'
2917 # @time: when to expire the password.
2918 #        `now' to expire the password immediately
2919 #        `never' to cancel password expiration
2920 #        `+INT' where INT is the number of seconds from now (integer)
2921 #        `INT' where INT is the absolute time in seconds
2923 # Returns: Nothing on success
2924 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2926 # Since: 0.14.0
2928 # Notes: Time is relative to the server and currently there is no way to
2929 #        coordinate server time with client time.  It is not recommended to
2930 #        use the absolute time version of the @time parameter unless you're
2931 #        sure you are on the same machine as the QEMU instance.
2933 # Example:
2935 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2936 #                                                   "time": "+60" } }
2937 # <- { "return": {} }
2940 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2943 # @change-vnc-password:
2945 # Change the VNC server password.
2947 # @password:  the new password to use with VNC authentication
2949 # Since: 1.1
2951 # Notes:  An empty password in this command will set the password to the empty
2952 #         string.  Existing clients are unaffected by executing this command.
2954 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2957 # @change:
2959 # This command is multiple commands multiplexed together.
2961 # @device: This is normally the name of a block device but it may also be 'vnc'.
2962 #          when it's 'vnc', then sub command depends on @target
2964 # @target: If @device is a block device, then this is the new filename.
2965 #          If @device is 'vnc', then if the value 'password' selects the vnc
2966 #          change password command.   Otherwise, this specifies a new server URI
2967 #          address to listen to for VNC connections.
2969 # @arg:    If @device is a block device, then this is an optional format to open
2970 #          the device with.
2971 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2972 #          password to set.  If this argument is an empty string, then no future
2973 #          logins will be allowed.
2975 # Returns: Nothing on success.
2976 #          If @device is not a valid block device, DeviceNotFound
2977 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2978 #          if this error is returned, the device has been opened successfully
2979 #          and an additional call to @block_passwd is required to set the
2980 #          device's password.  The behavior of reads and writes to the block
2981 #          device between when these calls are executed is undefined.
2983 # Notes:  This interface is deprecated, and it is strongly recommended that you
2984 #         avoid using it.  For changing block devices, use
2985 #         blockdev-change-medium; for changing VNC parameters, use
2986 #         change-vnc-password.
2988 # Since: 0.14.0
2990 # Example:
2992 # 1. Change a removable medium
2994 # -> { "execute": "change",
2995 #      "arguments": { "device": "ide1-cd0",
2996 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
2997 # <- { "return": {} }
2999 # 2. Change VNC password
3001 # -> { "execute": "change",
3002 #      "arguments": { "device": "vnc", "target": "password",
3003 #                     "arg": "foobar1" } }
3004 # <- { "return": {} }
3007 { 'command': 'change',
3008   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
3011 # @ObjectTypeInfo:
3013 # This structure describes a search result from @qom-list-types
3015 # @name: the type name found in the search
3017 # Since: 1.1
3019 # Notes: This command is experimental and may change syntax in future releases.
3021 { 'struct': 'ObjectTypeInfo',
3022   'data': { 'name': 'str' } }
3025 # @qom-list-types:
3027 # This command will return a list of types given search parameters
3029 # @implements: if specified, only return types that implement this type name
3031 # @abstract: if true, include abstract types in the results
3033 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3035 # Since: 1.1
3037 { 'command': 'qom-list-types',
3038   'data': { '*implements': 'str', '*abstract': 'bool' },
3039   'returns': [ 'ObjectTypeInfo' ] }
3042 # @DevicePropertyInfo:
3044 # Information about device properties.
3046 # @name: the name of the property
3047 # @type: the typename of the property
3048 # @description: #optional if specified, the description of the property.
3049 #               (since 2.2)
3051 # Since: 1.2
3053 { 'struct': 'DevicePropertyInfo',
3054   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
3057 # @device-list-properties:
3059 # List properties associated with a device.
3061 # @typename: the type name of a device
3063 # Returns: a list of DevicePropertyInfo describing a devices properties
3065 # Since: 1.2
3067 { 'command': 'device-list-properties',
3068   'data': { 'typename': 'str'},
3069   'returns': [ 'DevicePropertyInfo' ] }
3072 # @migrate:
3074 # Migrates the current running guest to another Virtual Machine.
3076 # @uri: the Uniform Resource Identifier of the destination VM
3078 # @blk: #optional do block migration (full disk copy)
3080 # @inc: #optional incremental disk copy migration
3082 # @detach: this argument exists only for compatibility reasons and
3083 #          is ignored by QEMU
3085 # Returns: nothing on success
3087 # Since: 0.14.0
3089 # Notes:
3091 # 1. The 'query-migrate' command should be used to check migration's progress
3092 #    and final result (this information is provided by the 'status' member)
3094 # 2. All boolean arguments default to false
3096 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
3097 #    be used
3099 # Example:
3101 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3102 # <- { "return": {} }
3105 { 'command': 'migrate',
3106   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
3109 # @migrate-incoming:
3111 # Start an incoming migration, the qemu must have been started
3112 # with -incoming defer
3114 # @uri: The Uniform Resource Identifier identifying the source or
3115 #       address to listen on
3117 # Returns: nothing on success
3119 # Since: 2.3
3121 # Notes:
3123 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3124 #    compatible with -incoming and the format of the uri is already exposed
3125 #    above libvirt.
3127 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3128 #    be used.
3130 # 3. The uri format is the same as for -incoming
3132 # Example:
3134 # -> { "execute": "migrate-incoming",
3135 #      "arguments": { "uri": "tcp::4446" } }
3136 # <- { "return": {} }
3139 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3142 # @xen-save-devices-state:
3144 # Save the state of all devices to file. The RAM and the block devices
3145 # of the VM are not saved by this command.
3147 # @filename: the file to save the state of the devices to as binary
3148 # data. See xen-save-devices-state.txt for a description of the binary
3149 # format.
3151 # Returns: Nothing on success
3153 # Since: 1.1
3155 # Example:
3157 # -> { "execute": "xen-save-devices-state",
3158 #      "arguments": { "filename": "/tmp/save" } }
3159 # <- { "return": {} }
3162 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3165 # @xen-set-global-dirty-log:
3167 # Enable or disable the global dirty log mode.
3169 # @enable: true to enable, false to disable.
3171 # Returns: nothing
3173 # Since: 1.3
3175 # Example:
3177 # -> { "execute": "xen-set-global-dirty-log",
3178 #      "arguments": { "enable": true } }
3179 # <- { "return": {} }
3182 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3185 # @device_add:
3187 # @driver: the name of the new device's driver
3189 # @bus: #optional the device's parent bus (device tree path)
3191 # @id: #optional the device's ID, must be unique
3193 # Additional arguments depend on the type.
3195 # Add a device.
3197 # Notes:
3198 # 1. For detailed information about this command, please refer to the
3199 #    'docs/qdev-device-use.txt' file.
3201 # 2. It's possible to list device properties by running QEMU with the
3202 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3203 #    device's name
3205 # Example:
3207 # -> { "execute": "device_add",
3208 #      "arguments": { "driver": "e1000", "id": "net1",
3209 #                     "bus": "pci.0",
3210 #                     "mac": "52:54:00:12:34:56" } }
3211 # <- { "return": {} }
3213 # TODO: This command effectively bypasses QAPI completely due to its
3214 # "additional arguments" business.  It shouldn't have been added to
3215 # the schema in this form.  It should be qapified properly, or
3216 # replaced by a properly qapified command.
3218 # Since: 0.13
3220 { 'command': 'device_add',
3221   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3222   'gen': false } # so we can get the additional arguments
3225 # @device_del:
3227 # Remove a device from a guest
3229 # @id: the device's ID or QOM path
3231 # Returns: Nothing on success
3232 #          If @id is not a valid device, DeviceNotFound
3234 # Notes: When this command completes, the device may not be removed from the
3235 #        guest.  Hot removal is an operation that requires guest cooperation.
3236 #        This command merely requests that the guest begin the hot removal
3237 #        process.  Completion of the device removal process is signaled with a
3238 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3239 #        for all devices.
3241 # Since: 0.14.0
3243 # Example:
3245 # -> { "execute": "device_del",
3246 #      "arguments": { "id": "net1" } }
3247 # <- { "return": {} }
3249 # -> { "execute": "device_del",
3250 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3251 # <- { "return": {} }
3254 { 'command': 'device_del', 'data': {'id': 'str'} }
3257 # @DumpGuestMemoryFormat:
3259 # An enumeration of guest-memory-dump's format.
3261 # @elf: elf format
3263 # @kdump-zlib: kdump-compressed format with zlib-compressed
3265 # @kdump-lzo: kdump-compressed format with lzo-compressed
3267 # @kdump-snappy: kdump-compressed format with snappy-compressed
3269 # Since: 2.0
3271 { 'enum': 'DumpGuestMemoryFormat',
3272   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3275 # @dump-guest-memory:
3277 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3278 # very long depending on the amount of guest memory.
3280 # @paging: if true, do paging to get guest's memory mapping. This allows
3281 #          using gdb to process the core file.
3283 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3284 #                     of RAM. This can happen for a large guest, or a
3285 #                     malicious guest pretending to be large.
3287 #          Also, paging=true has the following limitations:
3289 #             1. The guest may be in a catastrophic state or can have corrupted
3290 #                memory, which cannot be trusted
3291 #             2. The guest can be in real-mode even if paging is enabled. For
3292 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3293 #                goes in real-mode
3294 #             3. Currently only supported on i386 and x86_64.
3296 # @protocol: the filename or file descriptor of the vmcore. The supported
3297 #            protocols are:
3299 #            1. file: the protocol starts with "file:", and the following
3300 #               string is the file's path.
3301 #            2. fd: the protocol starts with "fd:", and the following string
3302 #               is the fd's name.
3304 # @detach: #optional if true, QMP will return immediately rather than
3305 #          waiting for the dump to finish. The user can track progress
3306 #          using "query-dump". (since 2.6).
3308 # @begin: #optional if specified, the starting physical address.
3310 # @length: #optional if specified, the memory size, in bytes. If you don't
3311 #          want to dump all guest's memory, please specify the start @begin
3312 #          and @length
3314 # @format: #optional if specified, the format of guest memory dump. But non-elf
3315 #          format is conflict with paging and filter, ie. @paging, @begin and
3316 #          @length is not allowed to be specified with non-elf @format at the
3317 #          same time (since 2.0)
3319 # Note: All boolean arguments default to false
3321 # Returns: nothing on success
3323 # Since: 1.2
3325 # Example:
3327 # -> { "execute": "dump-guest-memory",
3328 #      "arguments": { "protocol": "fd:dump" } }
3329 # <- { "return": {} }
3332 { 'command': 'dump-guest-memory',
3333   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3334             '*begin': 'int', '*length': 'int',
3335             '*format': 'DumpGuestMemoryFormat'} }
3338 # @DumpStatus:
3340 # Describe the status of a long-running background guest memory dump.
3342 # @none: no dump-guest-memory has started yet.
3344 # @active: there is one dump running in background.
3346 # @completed: the last dump has finished successfully.
3348 # @failed: the last dump has failed.
3350 # Since: 2.6
3352 { 'enum': 'DumpStatus',
3353   'data': [ 'none', 'active', 'completed', 'failed' ] }
3356 # @DumpQueryResult:
3358 # The result format for 'query-dump'.
3360 # @status: enum of @DumpStatus, which shows current dump status
3362 # @completed: bytes written in latest dump (uncompressed)
3364 # @total: total bytes to be written in latest dump (uncompressed)
3366 # Since: 2.6
3368 { 'struct': 'DumpQueryResult',
3369   'data': { 'status': 'DumpStatus',
3370             'completed': 'int',
3371             'total': 'int' } }
3374 # @query-dump:
3376 # Query latest dump status.
3378 # Returns: A @DumpStatus object showing the dump status.
3380 # Since: 2.6
3382 # Example:
3384 # -> { "execute": "query-dump" }
3385 # <- { "return": { "status": "active", "completed": 1024000,
3386 #                  "total": 2048000 } }
3389 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3392 # @DumpGuestMemoryCapability:
3394 # A list of the available formats for dump-guest-memory
3396 # Since: 2.0
3398 { 'struct': 'DumpGuestMemoryCapability',
3399   'data': {
3400       'formats': ['DumpGuestMemoryFormat'] } }
3403 # @query-dump-guest-memory-capability:
3405 # Returns the available formats for dump-guest-memory
3407 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3408 #           dump-guest-memory
3410 # Since: 2.0
3412 # Example:
3414 # -> { "execute": "query-dump-guest-memory-capability" }
3415 # <- { "return": { "formats":
3416 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3419 { 'command': 'query-dump-guest-memory-capability',
3420   'returns': 'DumpGuestMemoryCapability' }
3423 # @dump-skeys:
3425 # Dump guest's storage keys
3427 # @filename: the path to the file to dump to
3429 # This command is only supported on s390 architecture.
3431 # Since: 2.5
3433 # Example:
3435 # -> { "execute": "dump-skeys",
3436 #      "arguments": { "filename": "/tmp/skeys" } }
3437 # <- { "return": {} }
3440 { 'command': 'dump-skeys',
3441   'data': { 'filename': 'str' } }
3444 # @netdev_add:
3446 # Add a network backend.
3448 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3449 #        'vde', 'socket', 'dump' and 'bridge'
3451 # @id: the name of the new network backend
3453 # Additional arguments depend on the type.
3455 # TODO: This command effectively bypasses QAPI completely due to its
3456 # "additional arguments" business.  It shouldn't have been added to
3457 # the schema in this form.  It should be qapified properly, or
3458 # replaced by a properly qapified command.
3460 # Since: 0.14.0
3462 # Returns: Nothing on success
3463 #          If @type is not a valid network backend, DeviceNotFound
3465 # Example:
3467 # -> { "execute": "netdev_add",
3468 #      "arguments": { "type": "user", "id": "netdev1",
3469 #                     "dnssearch": "example.org" } }
3470 # <- { "return": {} }
3473 { 'command': 'netdev_add',
3474   'data': {'type': 'str', 'id': 'str'},
3475   'gen': false }                # so we can get the additional arguments
3478 # @netdev_del:
3480 # Remove a network backend.
3482 # @id: the name of the network backend to remove
3484 # Returns: Nothing on success
3485 #          If @id is not a valid network backend, DeviceNotFound
3487 # Since: 0.14.0
3489 # Example:
3491 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3492 # <- { "return": {} }
3495 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3498 # @object-add:
3500 # Create a QOM object.
3502 # @qom-type: the class name for the object to be created
3504 # @id: the name of the new object
3506 # @props: #optional a dictionary of properties to be passed to the backend
3508 # Returns: Nothing on success
3509 #          Error if @qom-type is not a valid class name
3511 # Since: 2.0
3513 # Example:
3515 # -> { "execute": "object-add",
3516 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3517 #                     "props": { "filename": "/dev/hwrng" } } }
3518 # <- { "return": {} }
3521 { 'command': 'object-add',
3522   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3525 # @object-del:
3527 # Remove a QOM object.
3529 # @id: the name of the QOM object to remove
3531 # Returns: Nothing on success
3532 #          Error if @id is not a valid id for a QOM object
3534 # Since: 2.0
3536 # Example:
3538 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3539 # <- { "return": {} }
3542 { 'command': 'object-del', 'data': {'id': 'str'} }
3545 # @NetdevNoneOptions:
3547 # Use it alone to have zero network devices.
3549 # Since: 1.2
3551 { 'struct': 'NetdevNoneOptions',
3552   'data': { } }
3555 # @NetLegacyNicOptions:
3557 # Create a new Network Interface Card.
3559 # @netdev: #optional id of -netdev to connect to
3561 # @macaddr: #optional MAC address
3563 # @model: #optional device model (e1000, rtl8139, virtio etc.)
3565 # @addr: #optional PCI device address
3567 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
3569 # Since: 1.2
3571 { 'struct': 'NetLegacyNicOptions',
3572   'data': {
3573     '*netdev':  'str',
3574     '*macaddr': 'str',
3575     '*model':   'str',
3576     '*addr':    'str',
3577     '*vectors': 'uint32' } }
3580 # @String:
3582 # A fat type wrapping 'str', to be embedded in lists.
3584 # Since: 1.2
3586 { 'struct': 'String',
3587   'data': {
3588     'str': 'str' } }
3591 # @NetdevUserOptions:
3593 # Use the user mode network stack which requires no administrator privilege to
3594 # run.
3596 # @hostname: #optional client hostname reported by the builtin DHCP server
3598 # @restrict: #optional isolate the guest from the host
3600 # @ipv4: #optional whether to support IPv4, default true for enabled
3601 #        (since 2.6)
3603 # @ipv6: #optional whether to support IPv6, default true for enabled
3604 #        (since 2.6)
3606 # @ip: #optional legacy parameter, use net= instead
3608 # @net: #optional IP network address that the guest will see, in the
3609 #       form addr[/netmask] The netmask is optional, and can be
3610 #       either in the form a.b.c.d or as a number of valid top-most
3611 #       bits. Default is 10.0.2.0/24.
3613 # @host: #optional guest-visible address of the host
3615 # @tftp: #optional root directory of the built-in TFTP server
3617 # @bootfile: #optional BOOTP filename, for use with tftp=
3619 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
3620 #             assign
3622 # @dns: #optional guest-visible address of the virtual nameserver
3624 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
3625 #             to the guest
3627 # @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since
3628 #               2.6). The network prefix is given in the usual
3629 #               hexadecimal IPv6 address notation.
3631 # @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64)
3632 #                  (since 2.6)
3634 # @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6)
3636 # @ipv6-dns: #optional guest-visible IPv6 address of the virtual
3637 #            nameserver (since 2.6)
3639 # @smb: #optional root directory of the built-in SMB server
3641 # @smbserver: #optional IP address of the built-in SMB server
3643 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
3644 #           endpoints
3646 # @guestfwd: #optional forward guest TCP connections
3648 # Since: 1.2
3650 { 'struct': 'NetdevUserOptions',
3651   'data': {
3652     '*hostname':  'str',
3653     '*restrict':  'bool',
3654     '*ipv4':      'bool',
3655     '*ipv6':      'bool',
3656     '*ip':        'str',
3657     '*net':       'str',
3658     '*host':      'str',
3659     '*tftp':      'str',
3660     '*bootfile':  'str',
3661     '*dhcpstart': 'str',
3662     '*dns':       'str',
3663     '*dnssearch': ['String'],
3664     '*ipv6-prefix':      'str',
3665     '*ipv6-prefixlen':   'int',
3666     '*ipv6-host':        'str',
3667     '*ipv6-dns':         'str',
3668     '*smb':       'str',
3669     '*smbserver': 'str',
3670     '*hostfwd':   ['String'],
3671     '*guestfwd':  ['String'] } }
3674 # @NetdevTapOptions:
3676 # Connect the host TAP network interface name to the VLAN.
3678 # @ifname: #optional interface name
3680 # @fd: #optional file descriptor of an already opened tap
3682 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3683 # tap
3685 # @script: #optional script to initialize the interface
3687 # @downscript: #optional script to shut down the interface
3689 # @br: #optional bridge name (since 2.8)
3691 # @helper: #optional command to execute to configure bridge
3693 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3695 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3697 # @vhost: #optional enable vhost-net network accelerator
3699 # @vhostfd: #optional file descriptor of an already opened vhost net device
3701 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3702 # devices
3704 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3706 # @queues: #optional number of queues to be created for multiqueue capable tap
3708 # @poll-us: #optional maximum number of microseconds that could
3709 # be spent on busy polling for tap (since 2.7)
3711 # Since: 1.2
3713 { 'struct': 'NetdevTapOptions',
3714   'data': {
3715     '*ifname':     'str',
3716     '*fd':         'str',
3717     '*fds':        'str',
3718     '*script':     'str',
3719     '*downscript': 'str',
3720     '*br':         'str',
3721     '*helper':     'str',
3722     '*sndbuf':     'size',
3723     '*vnet_hdr':   'bool',
3724     '*vhost':      'bool',
3725     '*vhostfd':    'str',
3726     '*vhostfds':   'str',
3727     '*vhostforce': 'bool',
3728     '*queues':     'uint32',
3729     '*poll-us':    'uint32'} }
3732 # @NetdevSocketOptions:
3734 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3735 # socket connection.
3737 # @fd: #optional file descriptor of an already opened socket
3739 # @listen: #optional port number, and optional hostname, to listen on
3741 # @connect: #optional port number, and optional hostname, to connect to
3743 # @mcast: #optional UDP multicast address and port number
3745 # @localaddr: #optional source address and port for multicast and udp packets
3747 # @udp: #optional UDP unicast address and port number
3749 # Since: 1.2
3751 { 'struct': 'NetdevSocketOptions',
3752   'data': {
3753     '*fd':        'str',
3754     '*listen':    'str',
3755     '*connect':   'str',
3756     '*mcast':     'str',
3757     '*localaddr': 'str',
3758     '*udp':       'str' } }
3761 # @NetdevL2TPv3Options:
3763 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3765 # @src: source address
3767 # @dst: destination address
3769 # @srcport: #optional source port - mandatory for udp, optional for ip
3771 # @dstport: #optional destination port - mandatory for udp, optional for ip
3773 # @ipv6: #optional - force the use of ipv6
3775 # @udp: #optional - use the udp version of l2tpv3 encapsulation
3777 # @cookie64: #optional - use 64 bit coookies
3779 # @counter: #optional have sequence counter
3781 # @pincounter: #optional pin sequence counter to zero -
3782 #              workaround for buggy implementations or
3783 #              networks with packet reorder
3785 # @txcookie: #optional 32 or 64 bit transmit cookie
3787 # @rxcookie: #optional 32 or 64 bit receive cookie
3789 # @txsession: 32 bit transmit session
3791 # @rxsession: #optional 32 bit receive session - if not specified
3792 #             set to the same value as transmit
3794 # @offset: #optional additional offset - allows the insertion of
3795 #          additional application-specific data before the packet payload
3797 # Since: 2.1
3799 { 'struct': 'NetdevL2TPv3Options',
3800   'data': {
3801     'src':          'str',
3802     'dst':          'str',
3803     '*srcport':     'str',
3804     '*dstport':     'str',
3805     '*ipv6':        'bool',
3806     '*udp':         'bool',
3807     '*cookie64':    'bool',
3808     '*counter':     'bool',
3809     '*pincounter':  'bool',
3810     '*txcookie':    'uint64',
3811     '*rxcookie':    'uint64',
3812     'txsession':    'uint32',
3813     '*rxsession':   'uint32',
3814     '*offset':      'uint32' } }
3817 # @NetdevVdeOptions:
3819 # Connect the VLAN to a vde switch running on the host.
3821 # @sock: #optional socket path
3823 # @port: #optional port number
3825 # @group: #optional group owner of socket
3827 # @mode: #optional permissions for socket
3829 # Since: 1.2
3831 { 'struct': 'NetdevVdeOptions',
3832   'data': {
3833     '*sock':  'str',
3834     '*port':  'uint16',
3835     '*group': 'str',
3836     '*mode':  'uint16' } }
3839 # @NetdevDumpOptions:
3841 # Dump VLAN network traffic to a file.
3843 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3844 # suffixes.
3846 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3848 # Since: 1.2
3850 { 'struct': 'NetdevDumpOptions',
3851   'data': {
3852     '*len':  'size',
3853     '*file': 'str' } }
3856 # @NetdevBridgeOptions:
3858 # Connect a host TAP network interface to a host bridge device.
3860 # @br: #optional bridge name
3862 # @helper: #optional command to execute to configure bridge
3864 # Since: 1.2
3866 { 'struct': 'NetdevBridgeOptions',
3867   'data': {
3868     '*br':     'str',
3869     '*helper': 'str' } }
3872 # @NetdevHubPortOptions:
3874 # Connect two or more net clients through a software hub.
3876 # @hubid: hub identifier number
3878 # Since: 1.2
3880 { 'struct': 'NetdevHubPortOptions',
3881   'data': {
3882     'hubid':     'int32' } }
3885 # @NetdevNetmapOptions:
3887 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3889 # @ifname: Either the name of an existing network interface supported by
3890 #          netmap, or the name of a VALE port (created on the fly).
3891 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3892 #          YYY are non-negative integers. XXX identifies a switch and
3893 #          YYY identifies a port of the switch. VALE ports having the
3894 #          same XXX are therefore connected to the same switch.
3896 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3898 # Since: 2.0
3900 { 'struct': 'NetdevNetmapOptions',
3901   'data': {
3902     'ifname':     'str',
3903     '*devname':    'str' } }
3906 # @NetdevVhostUserOptions:
3908 # Vhost-user network backend
3910 # @chardev: name of a unix socket chardev
3912 # @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false).
3914 # @queues: #optional number of queues to be created for multiqueue vhost-user
3915 #          (default: 1) (Since 2.5)
3917 # Since: 2.1
3919 { 'struct': 'NetdevVhostUserOptions',
3920   'data': {
3921     'chardev':        'str',
3922     '*vhostforce':    'bool',
3923     '*queues':        'int' } }
3926 # @NetClientDriver:
3928 # Available netdev drivers.
3930 # Since: 2.7
3932 { 'enum': 'NetClientDriver',
3933   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
3934             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
3937 # @Netdev:
3939 # Captures the configuration of a network device.
3941 # @id: identifier for monitor commands.
3943 # @type: Specify the driver used for interpreting remaining arguments.
3945 # Since: 1.2
3947 # 'l2tpv3' - since 2.1
3949 { 'union': 'Netdev',
3950   'base': { 'id': 'str', 'type': 'NetClientDriver' },
3951   'discriminator': 'type',
3952   'data': {
3953     'none':     'NetdevNoneOptions',
3954     'nic':      'NetLegacyNicOptions',
3955     'user':     'NetdevUserOptions',
3956     'tap':      'NetdevTapOptions',
3957     'l2tpv3':   'NetdevL2TPv3Options',
3958     'socket':   'NetdevSocketOptions',
3959     'vde':      'NetdevVdeOptions',
3960     'dump':     'NetdevDumpOptions',
3961     'bridge':   'NetdevBridgeOptions',
3962     'hubport':  'NetdevHubPortOptions',
3963     'netmap':   'NetdevNetmapOptions',
3964     'vhost-user': 'NetdevVhostUserOptions' } }
3967 # @NetLegacy:
3969 # Captures the configuration of a network device; legacy.
3971 # @vlan: #optional vlan number
3973 # @id: #optional identifier for monitor commands
3975 # @name: #optional identifier for monitor commands, ignored if @id is present
3977 # @opts: device type specific properties (legacy)
3979 # Since: 1.2
3981 { 'struct': 'NetLegacy',
3982   'data': {
3983     '*vlan': 'int32',
3984     '*id':   'str',
3985     '*name': 'str',
3986     'opts':  'NetLegacyOptions' } }
3989 # @NetLegacyOptionsType:
3991 # Since: 1.2
3993 { 'enum': 'NetLegacyOptionsType',
3994   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
3995            'dump', 'bridge', 'netmap', 'vhost-user'] }
3998 # @NetLegacyOptions:
4000 # Like Netdev, but for use only by the legacy command line options
4002 # Since: 1.2
4004 { 'union': 'NetLegacyOptions',
4005   'base': { 'type': 'NetLegacyOptionsType' },
4006   'discriminator': 'type',
4007   'data': {
4008     'none':     'NetdevNoneOptions',
4009     'nic':      'NetLegacyNicOptions',
4010     'user':     'NetdevUserOptions',
4011     'tap':      'NetdevTapOptions',
4012     'l2tpv3':   'NetdevL2TPv3Options',
4013     'socket':   'NetdevSocketOptions',
4014     'vde':      'NetdevVdeOptions',
4015     'dump':     'NetdevDumpOptions',
4016     'bridge':   'NetdevBridgeOptions',
4017     'netmap':   'NetdevNetmapOptions',
4018     'vhost-user': 'NetdevVhostUserOptions' } }
4021 # @NetFilterDirection:
4023 # Indicates whether a netfilter is attached to a netdev's transmit queue or
4024 # receive queue or both.
4026 # @all: the filter is attached both to the receive and the transmit
4027 #       queue of the netdev (default).
4029 # @rx: the filter is attached to the receive queue of the netdev,
4030 #      where it will receive packets sent to the netdev.
4032 # @tx: the filter is attached to the transmit queue of the netdev,
4033 #      where it will receive packets sent by the netdev.
4035 # Since: 2.5
4037 { 'enum': 'NetFilterDirection',
4038   'data': [ 'all', 'rx', 'tx' ] }
4041 # @InetSocketAddress:
4043 # Captures a socket address or address range in the Internet namespace.
4045 # @host: host part of the address
4047 # @port: port part of the address, or lowest port if @to is present
4049 # @numeric: #optional true if the host/port are guaranteed to be numeric,
4050 #           false if name resolution should be attempted. Defaults to false.
4051 #           (Since 2.9)
4053 # @to: highest port to try
4055 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4056 #        #optional
4058 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4059 #        #optional
4061 # Since: 1.3
4063 { 'struct': 'InetSocketAddress',
4064   'data': {
4065     'host': 'str',
4066     'port': 'str',
4067     '*numeric':  'bool',
4068     '*to': 'uint16',
4069     '*ipv4': 'bool',
4070     '*ipv6': 'bool' } }
4073 # @UnixSocketAddress:
4075 # Captures a socket address in the local ("Unix socket") namespace.
4077 # @path: filesystem path to use
4079 # Since: 1.3
4081 { 'struct': 'UnixSocketAddress',
4082   'data': {
4083     'path': 'str' } }
4086 # @VsockSocketAddress:
4088 # Captures a socket address in the vsock namespace.
4090 # @cid: unique host identifier
4091 # @port: port
4093 # Note: string types are used to allow for possible future hostname or
4094 # service resolution support.
4096 # Since: 2.8
4098 { 'struct': 'VsockSocketAddress',
4099   'data': {
4100     'cid': 'str',
4101     'port': 'str' } }
4104 # @SocketAddress:
4106 # Captures the address of a socket, which could also be a named file descriptor
4108 # Since: 1.3
4110 { 'union': 'SocketAddress',
4111   'data': {
4112     'inet': 'InetSocketAddress',
4113     'unix': 'UnixSocketAddress',
4114     'vsock': 'VsockSocketAddress',
4115     'fd': 'String' } }
4118 # @SocketAddressFlatType:
4120 # Available SocketAddressFlat types
4122 # @inet:  Internet address
4124 # @unix:  Unix domain socket
4126 # Since: 2.9
4128 { 'enum': 'SocketAddressFlatType',
4129   'data': [ 'unix', 'inet' ] }
4132 # @SocketAddressFlat:
4134 # Captures the address of a socket
4136 # @type:       Transport type
4138 # This is similar to SocketAddress, only distinction:
4140 # 1. SocketAddressFlat is a flat union, SocketAddress is a simple union.
4141 #    A flat union is nicer than simple because it avoids nesting
4142 #    (i.e. more {}) on the wire.
4144 # 2. SocketAddressFlat supports only types 'unix' and 'inet', because
4145 #    that's what its current users need.
4147 # Since: 2.9
4149 { 'union': 'SocketAddressFlat',
4150   'base': { 'type': 'SocketAddressFlatType' },
4151   'discriminator': 'type',
4152   'data': { 'unix': 'UnixSocketAddress',
4153             'inet': 'InetSocketAddress' } }
4156 # @getfd:
4158 # Receive a file descriptor via SCM rights and assign it a name
4160 # @fdname: file descriptor name
4162 # Returns: Nothing on success
4164 # Since: 0.14.0
4166 # Notes: If @fdname already exists, the file descriptor assigned to
4167 #        it will be closed and replaced by the received file
4168 #        descriptor.
4170 #        The 'closefd' command can be used to explicitly close the
4171 #        file descriptor when it is no longer needed.
4173 # Example:
4175 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4176 # <- { "return": {} }
4179 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4182 # @closefd:
4184 # Close a file descriptor previously passed via SCM rights
4186 # @fdname: file descriptor name
4188 # Returns: Nothing on success
4190 # Since: 0.14.0
4192 # Example:
4194 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4195 # <- { "return": {} }
4198 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4201 # @MachineInfo:
4203 # Information describing a machine.
4205 # @name: the name of the machine
4207 # @alias: #optional an alias for the machine name
4209 # @is-default: #optional whether the machine is default
4211 # @cpu-max: maximum number of CPUs supported by the machine type
4212 #           (since 1.5.0)
4214 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4216 # Since: 1.2.0
4218 { 'struct': 'MachineInfo',
4219   'data': { 'name': 'str', '*alias': 'str',
4220             '*is-default': 'bool', 'cpu-max': 'int',
4221             'hotpluggable-cpus': 'bool'} }
4224 # @query-machines:
4226 # Return a list of supported machines
4228 # Returns: a list of MachineInfo
4230 # Since: 1.2.0
4232 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4235 # @CpuDefinitionInfo:
4237 # Virtual CPU definition.
4239 # @name: the name of the CPU definition
4241 # @migration-safe: #optional whether a CPU definition can be safely used for
4242 #                  migration in combination with a QEMU compatibility machine
4243 #                  when migrating between different QMU versions and between
4244 #                  hosts with different sets of (hardware or software)
4245 #                  capabilities. If not provided, information is not available
4246 #                  and callers should not assume the CPU definition to be
4247 #                  migration-safe. (since 2.8)
4249 # @static: whether a CPU definition is static and will not change depending on
4250 #          QEMU version, machine type, machine options and accelerator options.
4251 #          A static model is always migration-safe. (since 2.8)
4253 # @unavailable-features: #optional List of properties that prevent
4254 #                        the CPU model from running in the current
4255 #                        host. (since 2.8)
4256 # @typename: Type name that can be used as argument to @device-list-properties,
4257 #            to introspect properties configurable using -cpu or -global.
4258 #            (since 2.9)
4260 # @unavailable-features is a list of QOM property names that
4261 # represent CPU model attributes that prevent the CPU from running.
4262 # If the QOM property is read-only, that means there's no known
4263 # way to make the CPU model run in the current host. Implementations
4264 # that choose not to provide specific information return the
4265 # property name "type".
4266 # If the property is read-write, it means that it MAY be possible
4267 # to run the CPU model in the current host if that property is
4268 # changed. Management software can use it as hints to suggest or
4269 # choose an alternative for the user, or just to generate meaningful
4270 # error messages explaining why the CPU model can't be used.
4271 # If @unavailable-features is an empty list, the CPU model is
4272 # runnable using the current host and machine-type.
4273 # If @unavailable-features is not present, runnability
4274 # information for the CPU is not available.
4276 # Since: 1.2.0
4278 { 'struct': 'CpuDefinitionInfo',
4279   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4280             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4283 # @query-cpu-definitions:
4285 # Return a list of supported virtual CPU definitions
4287 # Returns: a list of CpuDefInfo
4289 # Since: 1.2.0
4291 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4294 # @CpuModelInfo:
4296 # Virtual CPU model.
4298 # A CPU model consists of the name of a CPU definition, to which
4299 # delta changes are applied (e.g. features added/removed). Most magic values
4300 # that an architecture might require should be hidden behind the name.
4301 # However, if required, architectures can expose relevant properties.
4303 # @name: the name of the CPU definition the model is based on
4304 # @props: #optional a dictionary of QOM properties to be applied
4306 # Since: 2.8.0
4308 { 'struct': 'CpuModelInfo',
4309   'data': { 'name': 'str',
4310             '*props': 'any' } }
4313 # @CpuModelExpansionType:
4315 # An enumeration of CPU model expansion types.
4317 # @static: Expand to a static CPU model, a combination of a static base
4318 #          model name and property delta changes. As the static base model will
4319 #          never change, the expanded CPU model will be the same, independant of
4320 #          independent of QEMU version, machine type, machine options, and
4321 #          accelerator options. Therefore, the resulting model can be used by
4322 #          tooling without having to specify a compatibility machine - e.g. when
4323 #          displaying the "host" model. static CPU models are migration-safe.
4325 # @full: Expand all properties. The produced model is not guaranteed to be
4326 #        migration-safe, but allows tooling to get an insight and work with
4327 #        model details.
4329 # Note: When a non-migration-safe CPU model is expanded in static mode, some
4330 # features enabled by the CPU model may be omitted, because they can't be
4331 # implemented by a static CPU model definition (e.g. cache info passthrough and
4332 # PMU passthrough in x86). If you need an accurate representation of the
4333 # features enabled by a non-migration-safe CPU model, use @full. If you need a
4334 # static representation that will keep ABI compatibility even when changing QEMU
4335 # version or machine-type, use @static (but keep in mind that some features may
4336 # be omitted).
4338 # Since: 2.8.0
4340 { 'enum': 'CpuModelExpansionType',
4341   'data': [ 'static', 'full' ] }
4345 # @CpuModelExpansionInfo:
4347 # The result of a cpu model expansion.
4349 # @model: the expanded CpuModelInfo.
4351 # Since: 2.8.0
4353 { 'struct': 'CpuModelExpansionInfo',
4354   'data': { 'model': 'CpuModelInfo' } }
4358 # @query-cpu-model-expansion:
4360 # Expands a given CPU model (or a combination of CPU model + additional options)
4361 # to different granularities, allowing tooling to get an understanding what a
4362 # specific CPU model looks like in QEMU under a certain configuration.
4364 # This interface can be used to query the "host" CPU model.
4366 # The data returned by this command may be affected by:
4368 # * QEMU version: CPU models may look different depending on the QEMU version.
4369 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4370 # * machine-type: CPU model  may look different depending on the machine-type.
4371 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4372 # * machine options (including accelerator): in some architectures, CPU models
4373 #   may look different depending on machine and accelerator options. (Except for
4374 #   CPU models reported as "static" in query-cpu-definitions.)
4375 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4376 #   global properties may affect expansion of CPU models. Using
4377 #   query-cpu-model-expansion while using these is not advised.
4379 # Some architectures may not support all expansion types. s390x supports
4380 # "full" and "static".
4382 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4383 #          not supported, if the model cannot be expanded, if the model contains
4384 #          an unknown CPU definition name, unknown properties or properties
4385 #          with a wrong type. Also returns an error if an expansion type is
4386 #          not supported.
4388 # Since: 2.8.0
4390 { 'command': 'query-cpu-model-expansion',
4391   'data': { 'type': 'CpuModelExpansionType',
4392             'model': 'CpuModelInfo' },
4393   'returns': 'CpuModelExpansionInfo' }
4396 # @CpuModelCompareResult:
4398 # An enumeration of CPU model comparation results. The result is usually
4399 # calculated using e.g. CPU features or CPU generations.
4401 # @incompatible: If model A is incompatible to model B, model A is not
4402 #                guaranteed to run where model B runs and the other way around.
4404 # @identical: If model A is identical to model B, model A is guaranteed to run
4405 #             where model B runs and the other way around.
4407 # @superset: If model A is a superset of model B, model B is guaranteed to run
4408 #            where model A runs. There are no guarantees about the other way.
4410 # @subset: If model A is a subset of model B, model A is guaranteed to run
4411 #          where model B runs. There are no guarantees about the other way.
4413 # Since: 2.8.0
4415 { 'enum': 'CpuModelCompareResult',
4416   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4419 # @CpuModelCompareInfo:
4421 # The result of a CPU model comparison.
4423 # @result: The result of the compare operation.
4424 # @responsible-properties: List of properties that led to the comparison result
4425 #                          not being identical.
4427 # @responsible-properties is a list of QOM property names that led to
4428 # both CPUs not being detected as identical. For identical models, this
4429 # list is empty.
4430 # If a QOM property is read-only, that means there's no known way to make the
4431 # CPU models identical. If the special property name "type" is included, the
4432 # models are by definition not identical and cannot be made identical.
4434 # Since: 2.8.0
4436 { 'struct': 'CpuModelCompareInfo',
4437   'data': {'result': 'CpuModelCompareResult',
4438            'responsible-properties': ['str']
4439           }
4443 # @query-cpu-model-comparison:
4445 # Compares two CPU models, returning how they compare in a specific
4446 # configuration. The results indicates how both models compare regarding
4447 # runnability. This result can be used by tooling to make decisions if a
4448 # certain CPU model will run in a certain configuration or if a compatible
4449 # CPU model has to be created by baselining.
4451 # Usually, a CPU model is compared against the maximum possible CPU model
4452 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4453 # model is identical or a subset, it will run in that configuration.
4455 # The result returned by this command may be affected by:
4457 # * QEMU version: CPU models may look different depending on the QEMU version.
4458 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4459 # * machine-type: CPU model may look different depending on the machine-type.
4460 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4461 # * machine options (including accelerator): in some architectures, CPU models
4462 #   may look different depending on machine and accelerator options. (Except for
4463 #   CPU models reported as "static" in query-cpu-definitions.)
4464 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4465 #   global properties may affect expansion of CPU models. Using
4466 #   query-cpu-model-expansion while using these is not advised.
4468 # Some architectures may not support comparing CPU models. s390x supports
4469 # comparing CPU models.
4471 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4472 #          not supported, if a model cannot be used, if a model contains
4473 #          an unknown cpu definition name, unknown properties or properties
4474 #          with wrong types.
4476 # Since: 2.8.0
4478 { 'command': 'query-cpu-model-comparison',
4479   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4480   'returns': 'CpuModelCompareInfo' }
4483 # @CpuModelBaselineInfo:
4485 # The result of a CPU model baseline.
4487 # @model: the baselined CpuModelInfo.
4489 # Since: 2.8.0
4491 { 'struct': 'CpuModelBaselineInfo',
4492   'data': { 'model': 'CpuModelInfo' } }
4495 # @query-cpu-model-baseline:
4497 # Baseline two CPU models, creating a compatible third model. The created
4498 # model will always be a static, migration-safe CPU model (see "static"
4499 # CPU model expansion for details).
4501 # This interface can be used by tooling to create a compatible CPU model out
4502 # two CPU models. The created CPU model will be identical to or a subset of
4503 # both CPU models when comparing them. Therefore, the created CPU model is
4504 # guaranteed to run where the given CPU models run.
4506 # The result returned by this command may be affected by:
4508 # * QEMU version: CPU models may look different depending on the QEMU version.
4509 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4510 # * machine-type: CPU model may look different depending on the machine-type.
4511 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4512 # * machine options (including accelerator): in some architectures, CPU models
4513 #   may look different depending on machine and accelerator options. (Except for
4514 #   CPU models reported as "static" in query-cpu-definitions.)
4515 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4516 #   global properties may affect expansion of CPU models. Using
4517 #   query-cpu-model-expansion while using these is not advised.
4519 # Some architectures may not support baselining CPU models. s390x supports
4520 # baselining CPU models.
4522 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4523 #          not supported, if a model cannot be used, if a model contains
4524 #          an unknown cpu definition name, unknown properties or properties
4525 #          with wrong types.
4527 # Since: 2.8.0
4529 { 'command': 'query-cpu-model-baseline',
4530   'data': { 'modela': 'CpuModelInfo',
4531             'modelb': 'CpuModelInfo' },
4532   'returns': 'CpuModelBaselineInfo' }
4535 # @AddfdInfo:
4537 # Information about a file descriptor that was added to an fd set.
4539 # @fdset-id: The ID of the fd set that @fd was added to.
4541 # @fd: The file descriptor that was received via SCM rights and
4542 #      added to the fd set.
4544 # Since: 1.2.0
4546 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4549 # @add-fd:
4551 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4553 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
4555 # @opaque: #optional A free-form string that can be used to describe the fd.
4557 # Returns: @AddfdInfo on success
4559 #          If file descriptor was not received, FdNotSupplied
4561 #          If @fdset-id is a negative value, InvalidParameterValue
4563 # Notes: The list of fd sets is shared by all monitor connections.
4565 #        If @fdset-id is not specified, a new fd set will be created.
4567 # Since: 1.2.0
4569 # Example:
4571 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4572 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4575 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4576   'returns': 'AddfdInfo' }
4579 # @remove-fd:
4581 # Remove a file descriptor from an fd set.
4583 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4585 # @fd: #optional The file descriptor that is to be removed.
4587 # Returns: Nothing on success
4588 #          If @fdset-id or @fd is not found, FdNotFound
4590 # Since: 1.2.0
4592 # Notes: The list of fd sets is shared by all monitor connections.
4594 #        If @fd is not specified, all file descriptors in @fdset-id
4595 #        will be removed.
4597 # Example:
4599 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4600 # <- { "return": {} }
4603 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4606 # @FdsetFdInfo:
4608 # Information about a file descriptor that belongs to an fd set.
4610 # @fd: The file descriptor value.
4612 # @opaque: #optional A free-form string that can be used to describe the fd.
4614 # Since: 1.2.0
4616 { 'struct': 'FdsetFdInfo',
4617   'data': {'fd': 'int', '*opaque': 'str'} }
4620 # @FdsetInfo:
4622 # Information about an fd set.
4624 # @fdset-id: The ID of the fd set.
4626 # @fds: A list of file descriptors that belong to this fd set.
4628 # Since: 1.2.0
4630 { 'struct': 'FdsetInfo',
4631   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4634 # @query-fdsets:
4636 # Return information describing all fd sets.
4638 # Returns: A list of @FdsetInfo
4640 # Since: 1.2.0
4642 # Note: The list of fd sets is shared by all monitor connections.
4644 # Example:
4646 # -> { "execute": "query-fdsets" }
4647 # <- { "return": [
4648 #        {
4649 #          "fds": [
4650 #            {
4651 #              "fd": 30,
4652 #              "opaque": "rdonly:/path/to/file"
4653 #            },
4654 #            {
4655 #              "fd": 24,
4656 #              "opaque": "rdwr:/path/to/file"
4657 #            }
4658 #          ],
4659 #          "fdset-id": 1
4660 #        },
4661 #        {
4662 #          "fds": [
4663 #            {
4664 #              "fd": 28
4665 #            },
4666 #            {
4667 #              "fd": 29
4668 #            }
4669 #          ],
4670 #          "fdset-id": 0
4671 #        }
4672 #      ]
4673 #    }
4676 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4679 # @TargetInfo:
4681 # Information describing the QEMU target.
4683 # @arch: the target architecture (eg "x86_64", "i386", etc)
4685 # Since: 1.2.0
4687 { 'struct': 'TargetInfo',
4688   'data': { 'arch': 'str' } }
4691 # @query-target:
4693 # Return information about the target for this QEMU
4695 # Returns: TargetInfo
4697 # Since: 1.2.0
4699 { 'command': 'query-target', 'returns': 'TargetInfo' }
4702 # @QKeyCode:
4704 # An enumeration of key name.
4706 # This is used by the @send-key command.
4708 # @unmapped: since 2.0
4709 # @pause: since 2.0
4710 # @ro: since 2.4
4711 # @kp_comma: since 2.4
4712 # @kp_equals: since 2.6
4713 # @power: since 2.6
4714 # @hiragana: since 2.9
4715 # @henkan: since 2.9
4716 # @yen: since 2.9
4718 # Since: 1.3.0
4721 { 'enum': 'QKeyCode',
4722   'data': [ 'unmapped',
4723             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
4724             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4725             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4726             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4727             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4728             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4729             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4730             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4731             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4732             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4733             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4734             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4735             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4736             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4737             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4738             'ro', 'hiragana', 'henkan', 'yen',
4739             'kp_comma', 'kp_equals', 'power' ] }
4742 # @KeyValue:
4744 # Represents a keyboard key.
4746 # Since: 1.3.0
4748 { 'union': 'KeyValue',
4749   'data': {
4750     'number': 'int',
4751     'qcode': 'QKeyCode' } }
4754 # @send-key:
4756 # Send keys to guest.
4758 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4759 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4760 #        directly to the guest, while @KeyValue.qcode must be a valid
4761 #        @QKeyCode value
4763 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
4764 #             to 100
4766 # Returns: Nothing on success
4767 #          If key is unknown or redundant, InvalidParameter
4769 # Since: 1.3.0
4771 # Example:
4773 # -> { "execute": "send-key",
4774 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4775 #                               { "type": "qcode", "data": "alt" },
4776 #                               { "type": "qcode", "data": "delete" } ] } }
4777 # <- { "return": {} }
4780 { 'command': 'send-key',
4781   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4784 # @screendump:
4786 # Write a PPM of the VGA screen to a file.
4788 # @filename: the path of a new PPM file to store the image
4790 # Returns: Nothing on success
4792 # Since: 0.14.0
4794 # Example:
4796 # -> { "execute": "screendump",
4797 #      "arguments": { "filename": "/tmp/image" } }
4798 # <- { "return": {} }
4801 { 'command': 'screendump', 'data': {'filename': 'str'} }
4805 # @ChardevCommon:
4807 # Configuration shared across all chardev backends
4809 # @logfile: #optional The name of a logfile to save output
4810 # @logappend: #optional true to append instead of truncate
4811 #             (default to false to truncate)
4813 # Since: 2.6
4815 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4816                                        '*logappend': 'bool' } }
4819 # @ChardevFile:
4821 # Configuration info for file chardevs.
4823 # @in:  #optional The name of the input file
4824 # @out: The name of the output file
4825 # @append: #optional Open the file in append mode (default false to
4826 #          truncate) (Since 2.6)
4828 # Since: 1.4
4830 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4831                                    'out' : 'str',
4832                                    '*append': 'bool' },
4833   'base': 'ChardevCommon' }
4836 # @ChardevHostdev:
4838 # Configuration info for device and pipe chardevs.
4840 # @device: The name of the special file for the device,
4841 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4843 # Since: 1.4
4845 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4846   'base': 'ChardevCommon' }
4849 # @ChardevSocket:
4851 # Configuration info for (stream) socket chardevs.
4853 # @addr: socket address to listen on (server=true)
4854 #        or connect to (server=false)
4855 # @tls-creds: #optional the ID of the TLS credentials object (since 2.6)
4856 # @server: #optional create server socket (default: true)
4857 # @wait: #optional wait for incoming connection on server
4858 #        sockets (default: false).
4859 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
4860 # @telnet: #optional enable telnet protocol on server
4861 #          sockets (default: false)
4862 # @reconnect: #optional For a client socket, if a socket is disconnected,
4863 #          then attempt a reconnect after the given number of seconds.
4864 #          Setting this to zero disables this function. (default: 0)
4865 #          (Since: 2.2)
4867 # Since: 1.4
4869 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddress',
4870                                      '*tls-creds'  : 'str',
4871                                      '*server'    : 'bool',
4872                                      '*wait'      : 'bool',
4873                                      '*nodelay'   : 'bool',
4874                                      '*telnet'    : 'bool',
4875                                      '*reconnect' : 'int' },
4876   'base': 'ChardevCommon' }
4879 # @ChardevUdp:
4881 # Configuration info for datagram socket chardevs.
4883 # @remote: remote address
4884 # @local: #optional local address
4886 # Since: 1.5
4888 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
4889                                   '*local' : 'SocketAddress' },
4890   'base': 'ChardevCommon' }
4893 # @ChardevMux:
4895 # Configuration info for mux chardevs.
4897 # @chardev: name of the base chardev.
4899 # Since: 1.5
4901 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
4902   'base': 'ChardevCommon' }
4905 # @ChardevStdio:
4907 # Configuration info for stdio chardevs.
4909 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
4910 #          be delivered to qemu.  Default: true in -nographic mode,
4911 #          false otherwise.
4913 # Since: 1.5
4915 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
4916   'base': 'ChardevCommon' }
4920 # @ChardevSpiceChannel:
4922 # Configuration info for spice vm channel chardevs.
4924 # @type: kind of channel (for example vdagent).
4926 # Since: 1.5
4928 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
4929   'base': 'ChardevCommon' }
4932 # @ChardevSpicePort:
4934 # Configuration info for spice port chardevs.
4936 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
4938 # Since: 1.5
4940 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
4941   'base': 'ChardevCommon' }
4944 # @ChardevVC:
4946 # Configuration info for virtual console chardevs.
4948 # @width:  console width,  in pixels
4949 # @height: console height, in pixels
4950 # @cols:   console width,  in chars
4951 # @rows:   console height, in chars
4953 # Since: 1.5
4955 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
4956                                  '*height' : 'int',
4957                                  '*cols'   : 'int',
4958                                  '*rows'   : 'int' },
4959   'base': 'ChardevCommon' }
4962 # @ChardevRingbuf:
4964 # Configuration info for ring buffer chardevs.
4966 # @size: #optional ring buffer size, must be power of two, default is 65536
4968 # Since: 1.5
4970 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
4971   'base': 'ChardevCommon' }
4974 # @ChardevBackend:
4976 # Configuration info for the new chardev backend.
4978 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
4980 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
4981                                        'serial' : 'ChardevHostdev',
4982                                        'parallel': 'ChardevHostdev',
4983                                        'pipe'   : 'ChardevHostdev',
4984                                        'socket' : 'ChardevSocket',
4985                                        'udp'    : 'ChardevUdp',
4986                                        'pty'    : 'ChardevCommon',
4987                                        'null'   : 'ChardevCommon',
4988                                        'mux'    : 'ChardevMux',
4989                                        'msmouse': 'ChardevCommon',
4990                                        'wctablet' : 'ChardevCommon',
4991                                        'braille': 'ChardevCommon',
4992                                        'testdev': 'ChardevCommon',
4993                                        'stdio'  : 'ChardevStdio',
4994                                        'console': 'ChardevCommon',
4995                                        'spicevmc' : 'ChardevSpiceChannel',
4996                                        'spiceport' : 'ChardevSpicePort',
4997                                        'vc'     : 'ChardevVC',
4998                                        'ringbuf': 'ChardevRingbuf',
4999                                        # next one is just for compatibility
5000                                        'memory' : 'ChardevRingbuf' } }
5003 # @ChardevReturn:
5005 # Return info about the chardev backend just created.
5007 # @pty: #optional name of the slave pseudoterminal device, present if
5008 #       and only if a chardev of type 'pty' was created
5010 # Since: 1.4
5012 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
5015 # @chardev-add:
5017 # Add a character device backend
5019 # @id: the chardev's ID, must be unique
5020 # @backend: backend type and parameters
5022 # Returns: ChardevReturn.
5024 # Since: 1.4
5026 # Example:
5028 # -> { "execute" : "chardev-add",
5029 #      "arguments" : { "id" : "foo",
5030 #                      "backend" : { "type" : "null", "data" : {} } } }
5031 # <- { "return": {} }
5033 # -> { "execute" : "chardev-add",
5034 #      "arguments" : { "id" : "bar",
5035 #                      "backend" : { "type" : "file",
5036 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
5037 # <- { "return": {} }
5039 # -> { "execute" : "chardev-add",
5040 #      "arguments" : { "id" : "baz",
5041 #                      "backend" : { "type" : "pty", "data" : {} } } }
5042 # <- { "return": { "pty" : "/dev/pty/42" } }
5045 { 'command': 'chardev-add', 'data': {'id'      : 'str',
5046                                      'backend' : 'ChardevBackend' },
5047   'returns': 'ChardevReturn' }
5050 # @chardev-remove:
5052 # Remove a character device backend
5054 # @id: the chardev's ID, must exist and not be in use
5056 # Returns: Nothing on success
5058 # Since: 1.4
5060 # Example:
5062 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
5063 # <- { "return": {} }
5066 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
5069 # @TpmModel:
5071 # An enumeration of TPM models
5073 # @tpm-tis: TPM TIS model
5075 # Since: 1.5
5077 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
5080 # @query-tpm-models:
5082 # Return a list of supported TPM models
5084 # Returns: a list of TpmModel
5086 # Since: 1.5
5088 # Example:
5090 # -> { "execute": "query-tpm-models" }
5091 # <- { "return": [ "tpm-tis" ] }
5094 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5097 # @TpmType:
5099 # An enumeration of TPM types
5101 # @passthrough: TPM passthrough type
5103 # Since: 1.5
5105 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5108 # @query-tpm-types:
5110 # Return a list of supported TPM types
5112 # Returns: a list of TpmType
5114 # Since: 1.5
5116 # Example:
5118 # -> { "execute": "query-tpm-types" }
5119 # <- { "return": [ "passthrough" ] }
5122 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5125 # @TPMPassthroughOptions:
5127 # Information about the TPM passthrough type
5129 # @path: #optional string describing the path used for accessing the TPM device
5131 # @cancel-path: #optional string showing the TPM's sysfs cancel file
5132 #               for cancellation of TPM commands while they are executing
5134 # Since: 1.5
5136 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
5137                                              '*cancel-path' : 'str'} }
5140 # @TpmTypeOptions:
5142 # A union referencing different TPM backend types' configuration options
5144 # @type: 'passthrough' The configuration options for the TPM passthrough type
5146 # Since: 1.5
5148 { 'union': 'TpmTypeOptions',
5149    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
5152 # @TPMInfo:
5154 # Information about the TPM
5156 # @id: The Id of the TPM
5158 # @model: The TPM frontend model
5160 # @options: The TPM (backend) type configuration options
5162 # Since: 1.5
5164 { 'struct': 'TPMInfo',
5165   'data': {'id': 'str',
5166            'model': 'TpmModel',
5167            'options': 'TpmTypeOptions' } }
5170 # @query-tpm:
5172 # Return information about the TPM device
5174 # Returns: @TPMInfo on success
5176 # Since: 1.5
5178 # Example:
5180 # -> { "execute": "query-tpm" }
5181 # <- { "return":
5182 #      [
5183 #        { "model": "tpm-tis",
5184 #          "options":
5185 #            { "type": "passthrough",
5186 #              "data":
5187 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5188 #                  "path": "/dev/tpm0"
5189 #                }
5190 #            },
5191 #          "id": "tpm0"
5192 #        }
5193 #      ]
5194 #    }
5197 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5200 # @AcpiTableOptions:
5202 # Specify an ACPI table on the command line to load.
5204 # At most one of @file and @data can be specified. The list of files specified
5205 # by any one of them is loaded and concatenated in order. If both are omitted,
5206 # @data is implied.
5208 # Other fields / optargs can be used to override fields of the generic ACPI
5209 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5210 # Description Table Header. If a header field is not overridden, then the
5211 # corresponding value from the concatenated blob is used (in case of @file), or
5212 # it is filled in with a hard-coded value (in case of @data).
5214 # String fields are copied into the matching ACPI member from lowest address
5215 # upwards, and silently truncated / NUL-padded to length.
5217 # @sig: #optional table signature / identifier (4 bytes)
5219 # @rev: #optional table revision number (dependent on signature, 1 byte)
5221 # @oem_id: #optional OEM identifier (6 bytes)
5223 # @oem_table_id: #optional OEM table identifier (8 bytes)
5225 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
5227 # @asl_compiler_id: #optional identifier of the utility that created the table
5228 #                   (4 bytes)
5230 # @asl_compiler_rev: #optional revision number of the utility that created the
5231 #                    table (4 bytes)
5233 # @file: #optional colon (:) separated list of pathnames to load and
5234 #        concatenate as table data. The resultant binary blob is expected to
5235 #        have an ACPI table header. At least one file is required. This field
5236 #        excludes @data.
5238 # @data: #optional colon (:) separated list of pathnames to load and
5239 #        concatenate as table data. The resultant binary blob must not have an
5240 #        ACPI table header. At least one file is required. This field excludes
5241 #        @file.
5243 # Since: 1.5
5245 { 'struct': 'AcpiTableOptions',
5246   'data': {
5247     '*sig':               'str',
5248     '*rev':               'uint8',
5249     '*oem_id':            'str',
5250     '*oem_table_id':      'str',
5251     '*oem_rev':           'uint32',
5252     '*asl_compiler_id':   'str',
5253     '*asl_compiler_rev':  'uint32',
5254     '*file':              'str',
5255     '*data':              'str' }}
5258 # @CommandLineParameterType:
5260 # Possible types for an option parameter.
5262 # @string: accepts a character string
5264 # @boolean: accepts "on" or "off"
5266 # @number: accepts a number
5268 # @size: accepts a number followed by an optional suffix (K)ilo,
5269 #        (M)ega, (G)iga, (T)era
5271 # Since: 1.5
5273 { 'enum': 'CommandLineParameterType',
5274   'data': ['string', 'boolean', 'number', 'size'] }
5277 # @CommandLineParameterInfo:
5279 # Details about a single parameter of a command line option.
5281 # @name: parameter name
5283 # @type: parameter @CommandLineParameterType
5285 # @help: #optional human readable text string, not suitable for parsing.
5287 # @default: #optional default value string (since 2.1)
5289 # Since: 1.5
5291 { 'struct': 'CommandLineParameterInfo',
5292   'data': { 'name': 'str',
5293             'type': 'CommandLineParameterType',
5294             '*help': 'str',
5295             '*default': 'str' } }
5298 # @CommandLineOptionInfo:
5300 # Details about a command line option, including its list of parameter details
5302 # @option: option name
5304 # @parameters: an array of @CommandLineParameterInfo
5306 # Since: 1.5
5308 { 'struct': 'CommandLineOptionInfo',
5309   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5312 # @query-command-line-options:
5314 # Query command line option schema.
5316 # @option: #optional option name
5318 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5319 #          @option).  Returns an error if the given @option doesn't exist.
5321 # Since: 1.5
5323 # Example:
5325 # -> { "execute": "query-command-line-options",
5326 #      "arguments": { "option": "option-rom" } }
5327 # <- { "return": [
5328 #         {
5329 #             "parameters": [
5330 #                 {
5331 #                     "name": "romfile",
5332 #                     "type": "string"
5333 #                 },
5334 #                 {
5335 #                     "name": "bootindex",
5336 #                     "type": "number"
5337 #                 }
5338 #             ],
5339 #             "option": "option-rom"
5340 #         }
5341 #      ]
5342 #    }
5345 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5346  'returns': ['CommandLineOptionInfo'] }
5349 # @X86CPURegister32:
5351 # A X86 32-bit register
5353 # Since: 1.5
5355 { 'enum': 'X86CPURegister32',
5356   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5359 # @X86CPUFeatureWordInfo:
5361 # Information about a X86 CPU feature word
5363 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5365 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
5366 #                   feature word
5368 # @cpuid-register: Output register containing the feature bits
5370 # @features: value of output register, containing the feature bits
5372 # Since: 1.5
5374 { 'struct': 'X86CPUFeatureWordInfo',
5375   'data': { 'cpuid-input-eax': 'int',
5376             '*cpuid-input-ecx': 'int',
5377             'cpuid-register': 'X86CPURegister32',
5378             'features': 'int' } }
5381 # @DummyForceArrays:
5383 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5385 # Since: 2.5
5387 { 'struct': 'DummyForceArrays',
5388   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5392 # @RxState:
5394 # Packets receiving state
5396 # @normal: filter assigned packets according to the mac-table
5398 # @none: don't receive any assigned packet
5400 # @all: receive all assigned packets
5402 # Since: 1.6
5404 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5407 # @RxFilterInfo:
5409 # Rx-filter information for a NIC.
5411 # @name: net client name
5413 # @promiscuous: whether promiscuous mode is enabled
5415 # @multicast: multicast receive state
5417 # @unicast: unicast receive state
5419 # @vlan: vlan receive state (Since 2.0)
5421 # @broadcast-allowed: whether to receive broadcast
5423 # @multicast-overflow: multicast table is overflowed or not
5425 # @unicast-overflow: unicast table is overflowed or not
5427 # @main-mac: the main macaddr string
5429 # @vlan-table: a list of active vlan id
5431 # @unicast-table: a list of unicast macaddr string
5433 # @multicast-table: a list of multicast macaddr string
5435 # Since: 1.6
5437 { 'struct': 'RxFilterInfo',
5438   'data': {
5439     'name':               'str',
5440     'promiscuous':        'bool',
5441     'multicast':          'RxState',
5442     'unicast':            'RxState',
5443     'vlan':               'RxState',
5444     'broadcast-allowed':  'bool',
5445     'multicast-overflow': 'bool',
5446     'unicast-overflow':   'bool',
5447     'main-mac':           'str',
5448     'vlan-table':         ['int'],
5449     'unicast-table':      ['str'],
5450     'multicast-table':    ['str'] }}
5453 # @query-rx-filter:
5455 # Return rx-filter information for all NICs (or for the given NIC).
5457 # @name: #optional net client name
5459 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5460 #          Returns an error if the given @name doesn't exist, or given
5461 #          NIC doesn't support rx-filter querying, or given net client
5462 #          isn't a NIC.
5464 # Since: 1.6
5466 # Example:
5468 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5469 # <- { "return": [
5470 #         {
5471 #             "promiscuous": true,
5472 #             "name": "vnet0",
5473 #             "main-mac": "52:54:00:12:34:56",
5474 #             "unicast": "normal",
5475 #             "vlan": "normal",
5476 #             "vlan-table": [
5477 #                 4,
5478 #                 0
5479 #             ],
5480 #             "unicast-table": [
5481 #             ],
5482 #             "multicast": "normal",
5483 #             "multicast-overflow": false,
5484 #             "unicast-overflow": false,
5485 #             "multicast-table": [
5486 #                 "01:00:5e:00:00:01",
5487 #                 "33:33:00:00:00:01",
5488 #                 "33:33:ff:12:34:56"
5489 #             ],
5490 #             "broadcast-allowed": false
5491 #         }
5492 #       ]
5493 #    }
5496 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5497   'returns': ['RxFilterInfo'] }
5500 # @InputButton:
5502 # Button of a pointer input device (mouse, tablet).
5504 # @side: front side button of a 5-button mouse (since 2.9)
5506 # @extra: rear side button of a 5-button mouse (since 2.9)
5508 # Since: 2.0
5510 { 'enum'  : 'InputButton',
5511   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5512   'extra' ] }
5515 # @InputAxis:
5517 # Position axis of a pointer input device (mouse, tablet).
5519 # Since: 2.0
5521 { 'enum'  : 'InputAxis',
5522   'data'  : [ 'x', 'y' ] }
5525 # @InputKeyEvent:
5527 # Keyboard input event.
5529 # @key:    Which key this event is for.
5530 # @down:   True for key-down and false for key-up events.
5532 # Since: 2.0
5534 { 'struct'  : 'InputKeyEvent',
5535   'data'  : { 'key'     : 'KeyValue',
5536               'down'    : 'bool' } }
5539 # @InputBtnEvent:
5541 # Pointer button input event.
5543 # @button: Which button this event is for.
5544 # @down:   True for key-down and false for key-up events.
5546 # Since: 2.0
5548 { 'struct'  : 'InputBtnEvent',
5549   'data'  : { 'button'  : 'InputButton',
5550               'down'    : 'bool' } }
5553 # @InputMoveEvent:
5555 # Pointer motion input event.
5557 # @axis:   Which axis is referenced by @value.
5558 # @value:  Pointer position.  For absolute coordinates the
5559 #          valid range is 0 -> 0x7ffff
5561 # Since: 2.0
5563 { 'struct'  : 'InputMoveEvent',
5564   'data'  : { 'axis'    : 'InputAxis',
5565               'value'   : 'int' } }
5568 # @InputEvent:
5570 # Input event union.
5572 # @type: the input type, one of:
5573 #  - 'key': Input event of Keyboard
5574 #  - 'btn': Input event of pointer buttons
5575 #  - 'rel': Input event of relative pointer motion
5576 #  - 'abs': Input event of absolute pointer motion
5578 # Since: 2.0
5580 { 'union' : 'InputEvent',
5581   'data'  : { 'key'     : 'InputKeyEvent',
5582               'btn'     : 'InputBtnEvent',
5583               'rel'     : 'InputMoveEvent',
5584               'abs'     : 'InputMoveEvent' } }
5587 # @input-send-event:
5589 # Send input event(s) to guest.
5591 # @device: #optional display device to send event(s) to.
5592 # @head: #optional head to send event(s) to, in case the
5593 #        display device supports multiple scanouts.
5594 # @events: List of InputEvent union.
5596 # Returns: Nothing on success.
5598 # The @device and @head parameters can be used to send the input event
5599 # to specific input devices in case (a) multiple input devices of the
5600 # same kind are added to the virtual machine and (b) you have
5601 # configured input routing (see docs/multiseat.txt) for those input
5602 # devices.  The parameters work exactly like the device and head
5603 # properties of input devices.  If @device is missing, only devices
5604 # that have no input routing config are admissible.  If @device is
5605 # specified, both input devices with and without input routing config
5606 # are admissible, but devices with input routing config take
5607 # precedence.
5609 # Since: 2.6
5611 # Note: The consoles are visible in the qom tree, under
5612 # /backend/console[$index]. They have a device link and head property,
5613 # so it is possible to map which console belongs to which device and
5614 # display.
5616 # Example:
5618 # 1. Press left mouse button.
5620 # -> { "execute": "input-send-event",
5621 #     "arguments": { "device": "video0",
5622 #                    "events": [ { "type": "btn",
5623 #                    "data" : { "down": true, "button": "left" } } ] } }
5624 # <- { "return": {} }
5626 # -> { "execute": "input-send-event",
5627 #     "arguments": { "device": "video0",
5628 #                    "events": [ { "type": "btn",
5629 #                    "data" : { "down": false, "button": "left" } } ] } }
5630 # <- { "return": {} }
5632 # 2. Press ctrl-alt-del.
5634 # -> { "execute": "input-send-event",
5635 #      "arguments": { "events": [
5636 #         { "type": "key", "data" : { "down": true,
5637 #           "key": {"type": "qcode", "data": "ctrl" } } },
5638 #         { "type": "key", "data" : { "down": true,
5639 #           "key": {"type": "qcode", "data": "alt" } } },
5640 #         { "type": "key", "data" : { "down": true,
5641 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5642 # <- { "return": {} }
5644 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5646 # -> { "execute": "input-send-event" ,
5647 #   "arguments": { "events": [
5648 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5649 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5650 # <- { "return": {} }
5653 { 'command': 'input-send-event',
5654   'data': { '*device': 'str',
5655             '*head'  : 'int',
5656             'events' : [ 'InputEvent' ] } }
5659 # @NumaOptionsType:
5661 # Since: 2.1
5663 { 'enum': 'NumaOptionsType',
5664   'data': [ 'node' ] }
5667 # @NumaOptions:
5669 # A discriminated record of NUMA options. (for OptsVisitor)
5671 # Since: 2.1
5673 { 'union': 'NumaOptions',
5674   'base': { 'type': 'NumaOptionsType' },
5675   'discriminator': 'type',
5676   'data': {
5677     'node': 'NumaNodeOptions' }}
5680 # @NumaNodeOptions:
5682 # Create a guest NUMA node. (for OptsVisitor)
5684 # @nodeid: #optional NUMA node ID (increase by 1 from 0 if omitted)
5686 # @cpus: #optional VCPUs belonging to this node (assign VCPUS round-robin
5687 #         if omitted)
5689 # @mem: #optional memory size of this node; mutually exclusive with @memdev.
5690 #       Equally divide total memory among nodes if both @mem and @memdev are
5691 #       omitted.
5693 # @memdev: #optional memory backend object.  If specified for one node,
5694 #          it must be specified for all nodes.
5696 # Since: 2.1
5698 { 'struct': 'NumaNodeOptions',
5699   'data': {
5700    '*nodeid': 'uint16',
5701    '*cpus':   ['uint16'],
5702    '*mem':    'size',
5703    '*memdev': 'str' }}
5706 # @HostMemPolicy:
5708 # Host memory policy types
5710 # @default: restore default policy, remove any nondefault policy
5712 # @preferred: set the preferred host nodes for allocation
5714 # @bind: a strict policy that restricts memory allocation to the
5715 #        host nodes specified
5717 # @interleave: memory allocations are interleaved across the set
5718 #              of host nodes specified
5720 # Since: 2.1
5722 { 'enum': 'HostMemPolicy',
5723   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5726 # @Memdev:
5728 # Information about memory backend
5730 # @id: #optional backend's ID if backend has 'id' property (since 2.9)
5732 # @size: memory backend size
5734 # @merge: enables or disables memory merge support
5736 # @dump: includes memory backend's memory in a core dump or not
5738 # @prealloc: enables or disables memory preallocation
5740 # @host-nodes: host nodes for its memory policy
5742 # @policy: memory policy of memory backend
5744 # Since: 2.1
5746 { 'struct': 'Memdev',
5747   'data': {
5748     '*id':        'str',
5749     'size':       'size',
5750     'merge':      'bool',
5751     'dump':       'bool',
5752     'prealloc':   'bool',
5753     'host-nodes': ['uint16'],
5754     'policy':     'HostMemPolicy' }}
5757 # @query-memdev:
5759 # Returns information for all memory backends.
5761 # Returns: a list of @Memdev.
5763 # Since: 2.1
5765 # Example:
5767 # -> { "execute": "query-memdev" }
5768 # <- { "return": [
5769 #        {
5770 #          "id": "mem1",
5771 #          "size": 536870912,
5772 #          "merge": false,
5773 #          "dump": true,
5774 #          "prealloc": false,
5775 #          "host-nodes": [0, 1],
5776 #          "policy": "bind"
5777 #        },
5778 #        {
5779 #          "size": 536870912,
5780 #          "merge": false,
5781 #          "dump": true,
5782 #          "prealloc": true,
5783 #          "host-nodes": [2, 3],
5784 #          "policy": "preferred"
5785 #        }
5786 #      ]
5787 #    }
5790 { 'command': 'query-memdev', 'returns': ['Memdev'] }
5793 # @PCDIMMDeviceInfo:
5795 # PCDIMMDevice state information
5797 # @id: #optional device's ID
5799 # @addr: physical address, where device is mapped
5801 # @size: size of memory that the device provides
5803 # @slot: slot number at which device is plugged in
5805 # @node: NUMA node number where device is plugged in
5807 # @memdev: memory backend linked with device
5809 # @hotplugged: true if device was hotplugged
5811 # @hotpluggable: true if device if could be added/removed while machine is running
5813 # Since: 2.1
5815 { 'struct': 'PCDIMMDeviceInfo',
5816   'data': { '*id': 'str',
5817             'addr': 'int',
5818             'size': 'int',
5819             'slot': 'int',
5820             'node': 'int',
5821             'memdev': 'str',
5822             'hotplugged': 'bool',
5823             'hotpluggable': 'bool'
5824           }
5828 # @MemoryDeviceInfo:
5830 # Union containing information about a memory device
5832 # Since: 2.1
5834 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
5837 # @query-memory-devices:
5839 # Lists available memory devices and their state
5841 # Since: 2.1
5843 # Example:
5845 # -> { "execute": "query-memory-devices" }
5846 # <- { "return": [ { "data":
5847 #                       { "addr": 5368709120,
5848 #                         "hotpluggable": true,
5849 #                         "hotplugged": true,
5850 #                         "id": "d1",
5851 #                         "memdev": "/objects/memX",
5852 #                         "node": 0,
5853 #                         "size": 1073741824,
5854 #                         "slot": 0},
5855 #                    "type": "dimm"
5856 #                  } ] }
5859 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
5862 # @ACPISlotType:
5864 # @DIMM: memory slot
5865 # @CPU: logical CPU slot (since 2.7)
5867 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
5870 # @ACPIOSTInfo:
5872 # OSPM Status Indication for a device
5873 # For description of possible values of @source and @status fields
5874 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
5876 # @device: #optional device ID associated with slot
5878 # @slot: slot ID, unique per slot of a given @slot-type
5880 # @slot-type: type of the slot
5882 # @source: an integer containing the source event
5884 # @status: an integer containing the status code
5886 # Since: 2.1
5888 { 'struct': 'ACPIOSTInfo',
5889   'data'  : { '*device': 'str',
5890               'slot': 'str',
5891               'slot-type': 'ACPISlotType',
5892               'source': 'int',
5893               'status': 'int' } }
5896 # @query-acpi-ospm-status:
5898 # Return a list of ACPIOSTInfo for devices that support status
5899 # reporting via ACPI _OST method.
5901 # Since: 2.1
5903 # Example:
5905 # -> { "execute": "query-acpi-ospm-status" }
5906 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
5907 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
5908 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
5909 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
5910 #    ]}
5913 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
5916 # @WatchdogExpirationAction:
5918 # An enumeration of the actions taken when the watchdog device's timer is
5919 # expired
5921 # @reset: system resets
5923 # @shutdown: system shutdown, note that it is similar to @powerdown, which
5924 #            tries to set to system status and notify guest
5926 # @poweroff: system poweroff, the emulator program exits
5928 # @pause: system pauses, similar to @stop
5930 # @debug: system enters debug state
5932 # @none: nothing is done
5934 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
5935 #              VCPUS on x86) (since 2.4)
5937 # Since: 2.1
5939 { 'enum': 'WatchdogExpirationAction',
5940   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
5941             'inject-nmi' ] }
5944 # @IoOperationType:
5946 # An enumeration of the I/O operation types
5948 # @read: read operation
5950 # @write: write operation
5952 # Since: 2.1
5954 { 'enum': 'IoOperationType',
5955   'data': [ 'read', 'write' ] }
5958 # @GuestPanicAction:
5960 # An enumeration of the actions taken when guest OS panic is detected
5962 # @pause: system pauses
5964 # Since: 2.1 (poweroff since 2.8)
5966 { 'enum': 'GuestPanicAction',
5967   'data': [ 'pause', 'poweroff' ] }
5970 # @GuestPanicInformationType:
5972 # An enumeration of the guest panic information types
5974 # Since: 2.9
5976 { 'enum': 'GuestPanicInformationType',
5977   'data': [ 'hyper-v'] }
5980 # @GuestPanicInformation:
5982 # Information about a guest panic
5984 # Since: 2.9
5986 {'union': 'GuestPanicInformation',
5987  'base': {'type': 'GuestPanicInformationType'},
5988  'discriminator': 'type',
5989  'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
5992 # @GuestPanicInformationHyperV:
5994 # Hyper-V specific guest panic information (HV crash MSRs)
5996 # Since: 2.9
5998 {'struct': 'GuestPanicInformationHyperV',
5999  'data': { 'arg1': 'uint64',
6000            'arg2': 'uint64',
6001            'arg3': 'uint64',
6002            'arg4': 'uint64',
6003            'arg5': 'uint64' } }
6006 # @rtc-reset-reinjection:
6008 # This command will reset the RTC interrupt reinjection backlog.
6009 # Can be used if another mechanism to synchronize guest time
6010 # is in effect, for example QEMU guest agent's guest-set-time
6011 # command.
6013 # Since: 2.1
6015 # Example:
6017 # -> { "execute": "rtc-reset-reinjection" }
6018 # <- { "return": {} }
6021 { 'command': 'rtc-reset-reinjection' }
6023 # Rocker ethernet network switch
6024 { 'include': 'qapi/rocker.json' }
6027 # @ReplayMode:
6029 # Mode of the replay subsystem.
6031 # @none: normal execution mode. Replay or record are not enabled.
6033 # @record: record mode. All non-deterministic data is written into the
6034 #          replay log.
6036 # @play: replay mode. Non-deterministic data required for system execution
6037 #        is read from the log.
6039 # Since: 2.5
6041 { 'enum': 'ReplayMode',
6042   'data': [ 'none', 'record', 'play' ] }
6045 # @xen-load-devices-state:
6047 # Load the state of all devices from file. The RAM and the block devices
6048 # of the VM are not loaded by this command.
6050 # @filename: the file to load the state of the devices from as binary
6051 # data. See xen-save-devices-state.txt for a description of the binary
6052 # format.
6054 # Since: 2.7
6056 # Example:
6058 # -> { "execute": "xen-load-devices-state",
6059 #      "arguments": { "filename": "/tmp/resume" } }
6060 # <- { "return": {} }
6063 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
6066 # @xen-set-replication:
6068 # Enable or disable replication.
6070 # @enable: true to enable, false to disable.
6072 # @primary: true for primary or false for secondary.
6074 # @failover: #optional true to do failover, false to stop. but cannot be
6075 #            specified if 'enable' is true. default value is false.
6077 # Returns: nothing.
6079 # Example:
6081 # -> { "execute": "xen-set-replication",
6082 #      "arguments": {"enable": true, "primary": false} }
6083 # <- { "return": {} }
6085 # Since: 2.9
6087 { 'command': 'xen-set-replication',
6088   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
6091 # @ReplicationStatus:
6093 # The result format for 'query-xen-replication-status'.
6095 # @error: true if an error happened, false if replication is normal.
6097 # @desc: #optional the human readable error description string, when
6098 #        @error is 'true'.
6100 # Since: 2.9
6102 { 'struct': 'ReplicationStatus',
6103   'data': { 'error': 'bool', '*desc': 'str' } }
6106 # @query-xen-replication-status:
6108 # Query replication status while the vm is running.
6110 # Returns: A @ReplicationResult object showing the status.
6112 # Example:
6114 # -> { "execute": "query-xen-replication-status" }
6115 # <- { "return": { "error": false } }
6117 # Since: 2.9
6119 { 'command': 'query-xen-replication-status',
6120   'returns': 'ReplicationStatus' }
6123 # @xen-colo-do-checkpoint:
6125 # Xen uses this command to notify replication to trigger a checkpoint.
6127 # Returns: nothing.
6129 # Example:
6131 # -> { "execute": "xen-colo-do-checkpoint" }
6132 # <- { "return": {} }
6134 # Since: 2.9
6136 { 'command': 'xen-colo-do-checkpoint' }
6139 # @GICCapability:
6141 # The struct describes capability for a specific GIC (Generic
6142 # Interrupt Controller) version. These bits are not only decided by
6143 # QEMU/KVM software version, but also decided by the hardware that
6144 # the program is running upon.
6146 # @version:  version of GIC to be described. Currently, only 2 and 3
6147 #            are supported.
6149 # @emulated: whether current QEMU/hardware supports emulated GIC
6150 #            device in user space.
6152 # @kernel:   whether current QEMU/hardware supports hardware
6153 #            accelerated GIC device in kernel.
6155 # Since: 2.6
6157 { 'struct': 'GICCapability',
6158   'data': { 'version': 'int',
6159             'emulated': 'bool',
6160             'kernel': 'bool' } }
6163 # @query-gic-capabilities:
6165 # This command is ARM-only. It will return a list of GICCapability
6166 # objects that describe its capability bits.
6168 # Returns: a list of GICCapability objects.
6170 # Since: 2.6
6172 # Example:
6174 # -> { "execute": "query-gic-capabilities" }
6175 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
6176 #                 { "version": 3, "emulated": false, "kernel": true } ] }
6179 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
6182 # @CpuInstanceProperties:
6184 # List of properties to be used for hotplugging a CPU instance,
6185 # it should be passed by management with device_add command when
6186 # a CPU is being hotplugged.
6188 # @node-id: #optional NUMA node ID the CPU belongs to
6189 # @socket-id: #optional socket number within node/board the CPU belongs to
6190 # @core-id: #optional core number within socket the CPU belongs to
6191 # @thread-id: #optional thread number within core the CPU belongs to
6193 # Note: currently there are 4 properties that could be present
6194 # but management should be prepared to pass through other
6195 # properties with device_add command to allow for future
6196 # interface extension. This also requires the filed names to be kept in
6197 # sync with the properties passed to -device/device_add.
6199 # Since: 2.7
6201 { 'struct': 'CpuInstanceProperties',
6202   'data': { '*node-id': 'int',
6203             '*socket-id': 'int',
6204             '*core-id': 'int',
6205             '*thread-id': 'int'
6206   }
6210 # @HotpluggableCPU:
6212 # @type: CPU object type for usage with device_add command
6213 # @props: list of properties to be used for hotplugging CPU
6214 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6215 # @qom-path: #optional link to existing CPU object if CPU is present or
6216 #            omitted if CPU is not present.
6218 # Since: 2.7
6220 { 'struct': 'HotpluggableCPU',
6221   'data': { 'type': 'str',
6222             'vcpus-count': 'int',
6223             'props': 'CpuInstanceProperties',
6224             '*qom-path': 'str'
6225           }
6229 # @query-hotpluggable-cpus:
6231 # Returns: a list of HotpluggableCPU objects.
6233 # Since: 2.7
6235 # Example:
6237 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6239 # -> { "execute": "query-hotpluggable-cpus" }
6240 # <- {"return": [
6241 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6242 #        "vcpus-count": 1 },
6243 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6244 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6245 #    ]}'
6247 # For pc machine type started with -smp 1,maxcpus=2:
6249 # -> { "execute": "query-hotpluggable-cpus" }
6250 # <- {"return": [
6251 #      {
6252 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6253 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6254 #      },
6255 #      {
6256 #         "qom-path": "/machine/unattached/device[0]",
6257 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6258 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6259 #      }
6260 #    ]}
6263 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
6266 # @GuidInfo:
6268 # GUID information.
6270 # @guid: the globally unique identifier
6272 # Since: 2.9
6274 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
6277 # @query-vm-generation-id:
6279 # Show Virtual Machine Generation ID
6281 # Since 2.9
6283 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }