qmp-commands: move 'migrate-start-postcopy' doc to schema
[qemu/kevin.git] / qapi-schema.json
blob116b48be9ceab337a016f27256643b36c82ae7ff
1 # -*- Mode: Python -*-
3 # QAPI Schema
5 # QAPI common definitions
6 { 'include': 'qapi/common.json' }
8 # QAPI crypto definitions
9 { 'include': 'qapi/crypto.json' }
11 # QAPI block definitions
12 { 'include': 'qapi/block.json' }
14 # QAPI event definitions
15 { 'include': 'qapi/event.json' }
17 # Tracing commands
18 { 'include': 'qapi/trace.json' }
20 # QAPI introspection
21 { 'include': 'qapi/introspect.json' }
24 # = QMP commands
28 # @qmp_capabilities:
30 # Enable QMP capabilities.
32 # Arguments: None.
34 # Example:
36 # -> { "execute": "qmp_capabilities" }
37 # <- { "return": {} }
39 # Notes: This command is valid exactly when first connecting: it must be
40 # issued before any other command will be accepted, and will fail once the
41 # monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
43 # Since: 0.13
46 { 'command': 'qmp_capabilities' }
49 # @LostTickPolicy:
51 # Policy for handling lost ticks in timer devices.
53 # @discard: throw away the missed tick(s) and continue with future injection
54 #           normally.  Guest time may be delayed, unless the OS has explicit
55 #           handling of lost ticks
57 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
58 #         delayed due to the late tick
60 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
61 #         may be delayed, depending on how the OS reacts to the merging
62 #         of ticks
64 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
65 #        guest time should not be delayed once catchup is complete.
67 # Since: 2.0
69 { 'enum': 'LostTickPolicy',
70   'data': ['discard', 'delay', 'merge', 'slew' ] }
73 # @add_client:
75 # Allow client connections for VNC, Spice and socket based
76 # character devices to be passed in to QEMU via SCM_RIGHTS.
78 # @protocol: protocol name. Valid names are "vnc", "spice" or the
79 #            name of a character device (eg. from -chardev id=XXXX)
81 # @fdname: file descriptor name previously passed via 'getfd' command
83 # @skipauth: #optional whether to skip authentication. Only applies
84 #            to "vnc" and "spice" protocols
86 # @tls: #optional whether to perform TLS. Only applies to the "spice"
87 #       protocol
89 # Returns: nothing on success.
91 # Since: 0.14.0
93 # Example:
95 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
96 #                                              "fdname": "myclient" } }
97 # <- { "return": {} }
100 { 'command': 'add_client',
101   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
102             '*tls': 'bool' } }
105 # @NameInfo:
107 # Guest name information.
109 # @name: #optional The name of the guest
111 # Since: 0.14.0
113 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
116 # @query-name:
118 # Return the name information of a guest.
120 # Returns: @NameInfo of the guest
122 # Since: 0.14.0
124 # Example:
126 # -> { "execute": "query-name" }
127 # <- { "return": { "name": "qemu-name" } }
130 { 'command': 'query-name', 'returns': 'NameInfo' }
133 # @KvmInfo:
135 # Information about support for KVM acceleration
137 # @enabled: true if KVM acceleration is active
139 # @present: true if KVM acceleration is built into this executable
141 # Since: 0.14.0
143 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
146 # @query-kvm:
148 # Returns information about KVM acceleration
150 # Returns: @KvmInfo
152 # Since: 0.14.0
154 # Example:
156 # -> { "execute": "query-kvm" }
157 # <- { "return": { "enabled": true, "present": true } }
160 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
163 # @RunState:
165 # An enumeration of VM run states.
167 # @debug: QEMU is running on a debugger
169 # @finish-migrate: guest is paused to finish the migration process
171 # @inmigrate: guest is paused waiting for an incoming migration.  Note
172 # that this state does not tell whether the machine will start at the
173 # end of the migration.  This depends on the command-line -S option and
174 # any invocation of 'stop' or 'cont' that has happened since QEMU was
175 # started.
177 # @internal-error: An internal error that prevents further guest execution
178 # has occurred
180 # @io-error: the last IOP has failed and the device is configured to pause
181 # on I/O errors
183 # @paused: guest has been paused via the 'stop' command
185 # @postmigrate: guest is paused following a successful 'migrate'
187 # @prelaunch: QEMU was started with -S and guest has not started
189 # @restore-vm: guest is paused to restore VM state
191 # @running: guest is actively running
193 # @save-vm: guest is paused to save the VM state
195 # @shutdown: guest is shut down (and -no-shutdown is in use)
197 # @suspended: guest is suspended (ACPI S3)
199 # @watchdog: the watchdog action is configured to pause and has been triggered
201 # @guest-panicked: guest has been panicked as a result of guest OS panic
203 # @colo: guest is paused to save/restore VM state under colo checkpoint,
204 #        VM can not get into this state unless colo capability is enabled
205 #        for migration. (since 2.8)
207 { 'enum': 'RunState',
208   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
209             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
210             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
211             'guest-panicked', 'colo' ] }
214 # @StatusInfo:
216 # Information about VCPU run state
218 # @running: true if all VCPUs are runnable, false if not runnable
220 # @singlestep: true if VCPUs are in single-step mode
222 # @status: the virtual machine @RunState
224 # Since:  0.14.0
226 # Notes: @singlestep is enabled through the GDB stub
228 { 'struct': 'StatusInfo',
229   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
232 # @query-status:
234 # Query the run status of all VCPUs
236 # Returns: @StatusInfo reflecting all VCPUs
238 # Since:  0.14.0
240 # Example:
242 # -> { "execute": "query-status" }
243 # <- { "return": { "running": true,
244 #                  "singlestep": false,
245 #                  "status": "running" } }
248 { 'command': 'query-status', 'returns': 'StatusInfo' }
251 # @UuidInfo:
253 # Guest UUID information (Universally Unique Identifier).
255 # @UUID: the UUID of the guest
257 # Since: 0.14.0
259 # Notes: If no UUID was specified for the guest, a null UUID is returned.
261 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
264 # @query-uuid:
266 # Query the guest UUID information.
268 # Returns: The @UuidInfo for the guest
270 # Since: 0.14.0
272 # Example:
274 # -> { "execute": "query-uuid" }
275 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
278 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
281 # @ChardevInfo:
283 # Information about a character device.
285 # @label: the label of the character device
287 # @filename: the filename of the character device
289 # @frontend-open: shows whether the frontend device attached to this backend
290 #                 (eg. with the chardev=... option) is in open or closed state
291 #                 (since 2.1)
293 # Notes: @filename is encoded using the QEMU command line character device
294 #        encoding.  See the QEMU man page for details.
296 # Since: 0.14.0
298 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
299                                   'filename': 'str',
300                                   'frontend-open': 'bool'} }
303 # @query-chardev:
305 # Returns information about current character devices.
307 # Returns: a list of @ChardevInfo
309 # Since: 0.14.0
311 # Example:
313 # -> { "execute": "query-chardev" }
314 # <- {
315 #       "return": [
316 #          {
317 #             "label": "charchannel0",
318 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
319 #             "frontend-open": false
320 #          },
321 #          {
322 #             "label": "charmonitor",
323 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
324 #             "frontend-open": true
325 #          },
326 #          {
327 #             "label": "charserial0",
328 #             "filename": "pty:/dev/pts/2",
329 #             "frontend-open": true
330 #          }
331 #       ]
332 #    }
335 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
338 # @ChardevBackendInfo:
340 # Information about a character device backend
342 # @name: The backend name
344 # Since: 2.0
346 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
349 # @query-chardev-backends:
351 # Returns information about character device backends.
353 # Returns: a list of @ChardevBackendInfo
355 # Since: 2.0
357 # Example:
359 # -> { "execute": "query-chardev-backends" }
360 # <- {
361 #       "return":[
362 #          {
363 #             "name":"udp"
364 #          },
365 #          {
366 #             "name":"tcp"
367 #          },
368 #          {
369 #             "name":"unix"
370 #          },
371 #          {
372 #             "name":"spiceport"
373 #          }
374 #       ]
375 #    }
378 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
381 # @DataFormat:
383 # An enumeration of data format.
385 # @utf8: Data is a UTF-8 string (RFC 3629)
387 # @base64: Data is Base64 encoded binary (RFC 3548)
389 # Since: 1.4
391 { 'enum': 'DataFormat',
392   'data': [ 'utf8', 'base64' ] }
395 # @ringbuf-write:
397 # Write to a ring buffer character device.
399 # @device: the ring buffer character device name
401 # @data: data to write
403 # @format: #optional data encoding (default 'utf8').
404 #          - base64: data must be base64 encoded text.  Its binary
405 #            decoding gets written.
406 #          - utf8: data's UTF-8 encoding is written
407 #          - data itself is always Unicode regardless of format, like
408 #            any other string.
410 # Returns: Nothing on success
412 # Since: 1.4
414 # Example:
416 # -> { "execute": "ringbuf-write",
417 #      "arguments": { "device": "foo",
418 #                     "data": "abcdefgh",
419 #                     "format": "utf8" } }
420 # <- { "return": {} }
423 { 'command': 'ringbuf-write',
424   'data': {'device': 'str', 'data': 'str',
425            '*format': 'DataFormat'} }
428 # @ringbuf-read:
430 # Read from a ring buffer character device.
432 # @device: the ring buffer character device name
434 # @size: how many bytes to read at most
436 # @format: #optional data encoding (default 'utf8').
437 #          - base64: the data read is returned in base64 encoding.
438 #          - utf8: the data read is interpreted as UTF-8.
439 #            Bug: can screw up when the buffer contains invalid UTF-8
440 #            sequences, NUL characters, after the ring buffer lost
441 #            data, and when reading stops because the size limit is
442 #            reached.
443 #          - The return value is always Unicode regardless of format,
444 #            like any other string.
446 # Returns: data read from the device
448 # Since: 1.4
450 # Example:
452 # -> { "execute": "ringbuf-read",
453 #      "arguments": { "device": "foo",
454 #                     "size": 1000,
455 #                     "format": "utf8" } }
456 # <- { "return": "abcdefgh" }
459 { 'command': 'ringbuf-read',
460   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
461   'returns': 'str' }
464 # @EventInfo:
466 # Information about a QMP event
468 # @name: The event name
470 # Since: 1.2.0
472 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
475 # @query-events:
477 # Return a list of supported QMP events by this server
479 # Returns: A list of @EventInfo for all supported events
481 # Since: 1.2.0
483 # Example:
485 # -> { "execute": "query-events" }
486 # <- {
487 #      "return": [
488 #          {
489 #             "name":"SHUTDOWN"
490 #          },
491 #          {
492 #             "name":"RESET"
493 #          }
494 #       ]
495 #    }
497 # Note: This example has been shortened as the real response is too long.
500 { 'command': 'query-events', 'returns': ['EventInfo'] }
503 # @MigrationStats:
505 # Detailed migration status.
507 # @transferred: amount of bytes already transferred to the target VM
509 # @remaining: amount of bytes remaining to be transferred to the target VM
511 # @total: total amount of bytes involved in the migration process
513 # @duplicate: number of duplicate (zero) pages (since 1.2)
515 # @skipped: number of skipped zero pages (since 1.5)
517 # @normal: number of normal pages (since 1.2)
519 # @normal-bytes: number of normal bytes sent (since 1.2)
521 # @dirty-pages-rate: number of pages dirtied by second by the
522 #        guest (since 1.3)
524 # @mbps: throughput in megabits/sec. (since 1.6)
526 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
528 # @postcopy-requests: The number of page requests received from the destination
529 #        (since 2.7)
531 # Since: 0.14.0
533 { 'struct': 'MigrationStats',
534   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
535            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
536            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
537            'mbps' : 'number', 'dirty-sync-count' : 'int',
538            'postcopy-requests' : 'int' } }
541 # @XBZRLECacheStats:
543 # Detailed XBZRLE migration cache statistics
545 # @cache-size: XBZRLE cache size
547 # @bytes: amount of bytes already transferred to the target VM
549 # @pages: amount of pages transferred to the target VM
551 # @cache-miss: number of cache miss
553 # @cache-miss-rate: rate of cache miss (since 2.1)
555 # @overflow: number of overflows
557 # Since: 1.2
559 { 'struct': 'XBZRLECacheStats',
560   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
561            'cache-miss': 'int', 'cache-miss-rate': 'number',
562            'overflow': 'int' } }
565 # @MigrationStatus:
567 # An enumeration of migration status.
569 # @none: no migration has ever happened.
571 # @setup: migration process has been initiated.
573 # @cancelling: in the process of cancelling migration.
575 # @cancelled: cancelling migration is finished.
577 # @active: in the process of doing migration.
579 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
581 # @completed: migration is finished.
583 # @failed: some error occurred during migration process.
585 # @colo: VM is in the process of fault tolerance, VM can not get into this
586 #        state unless colo capability is enabled for migration. (since 2.8)
588 # Since: 2.3
591 { 'enum': 'MigrationStatus',
592   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
593             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
596 # @MigrationInfo:
598 # Information about current migration process.
600 # @status: #optional @MigrationStatus describing the current migration status.
601 #          If this field is not returned, no migration process
602 #          has been initiated
604 # @ram: #optional @MigrationStats containing detailed migration
605 #       status, only returned if status is 'active' or
606 #       'completed'(since 1.2)
608 # @disk: #optional @MigrationStats containing detailed disk migration
609 #        status, only returned if status is 'active' and it is a block
610 #        migration
612 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
613 #                migration statistics, only returned if XBZRLE feature is on and
614 #                status is 'active' or 'completed' (since 1.2)
616 # @total-time: #optional total amount of milliseconds since migration started.
617 #        If migration has ended, it returns the total migration
618 #        time. (since 1.2)
620 # @downtime: #optional only present when migration finishes correctly
621 #        total downtime in milliseconds for the guest.
622 #        (since 1.3)
624 # @expected-downtime: #optional only present while migration is active
625 #        expected downtime in milliseconds for the guest in last walk
626 #        of the dirty bitmap. (since 1.3)
628 # @setup-time: #optional amount of setup time in milliseconds _before_ the
629 #        iterations begin but _after_ the QMP command is issued. This is designed
630 #        to provide an accounting of any activities (such as RDMA pinning) which
631 #        may be expensive, but do not actually occur during the iterative
632 #        migration rounds themselves. (since 1.6)
634 # @cpu-throttle-percentage: #optional percentage of time guest cpus are being
635 #        throttled during auto-converge. This is only present when auto-converge
636 #        has started throttling guest cpus. (Since 2.7)
638 # @error-desc: #optional the human readable error description string, when
639 #              @status is 'failed'. Clients should not attempt to parse the
640 #              error strings. (Since 2.7)
642 # Since: 0.14.0
644 { 'struct': 'MigrationInfo',
645   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
646            '*disk': 'MigrationStats',
647            '*xbzrle-cache': 'XBZRLECacheStats',
648            '*total-time': 'int',
649            '*expected-downtime': 'int',
650            '*downtime': 'int',
651            '*setup-time': 'int',
652            '*cpu-throttle-percentage': 'int',
653            '*error-desc': 'str'} }
656 # @query-migrate:
658 # Returns information about current migration process. If migration
659 # is active there will be another json-object with RAM migration
660 # status and if block migration is active another one with block
661 # migration status.
663 # Returns: @MigrationInfo
665 # Since: 0.14.0
667 # Example:
669 # 1. Before the first migration
671 # -> { "execute": "query-migrate" }
672 # <- { "return": {} }
674 # 2. Migration is done and has succeeded
676 # -> { "execute": "query-migrate" }
677 # <- { "return": {
678 #         "status": "completed",
679 #         "ram":{
680 #           "transferred":123,
681 #           "remaining":123,
682 #           "total":246,
683 #           "total-time":12345,
684 #           "setup-time":12345,
685 #           "downtime":12345,
686 #           "duplicate":123,
687 #           "normal":123,
688 #           "normal-bytes":123456,
689 #           "dirty-sync-count":15
690 #         }
691 #      }
692 #    }
694 # 3. Migration is done and has failed
696 # -> { "execute": "query-migrate" }
697 # <- { "return": { "status": "failed" } }
699 # 4. Migration is being performed and is not a block migration:
701 # -> { "execute": "query-migrate" }
702 # <- {
703 #       "return":{
704 #          "status":"active",
705 #          "ram":{
706 #             "transferred":123,
707 #             "remaining":123,
708 #             "total":246,
709 #             "total-time":12345,
710 #             "setup-time":12345,
711 #             "expected-downtime":12345,
712 #             "duplicate":123,
713 #             "normal":123,
714 #             "normal-bytes":123456,
715 #             "dirty-sync-count":15
716 #          }
717 #       }
718 #    }
720 # 5. Migration is being performed and is a block migration:
722 # -> { "execute": "query-migrate" }
723 # <- {
724 #       "return":{
725 #          "status":"active",
726 #          "ram":{
727 #             "total":1057024,
728 #             "remaining":1053304,
729 #             "transferred":3720,
730 #             "total-time":12345,
731 #             "setup-time":12345,
732 #             "expected-downtime":12345,
733 #             "duplicate":123,
734 #             "normal":123,
735 #             "normal-bytes":123456,
736 #             "dirty-sync-count":15
737 #          },
738 #          "disk":{
739 #             "total":20971520,
740 #             "remaining":20880384,
741 #             "transferred":91136
742 #          }
743 #       }
744 #    }
746 # 6. Migration is being performed and XBZRLE is active:
748 # -> { "execute": "query-migrate" }
749 # <- {
750 #       "return":{
751 #          "status":"active",
752 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
753 #          "ram":{
754 #             "total":1057024,
755 #             "remaining":1053304,
756 #             "transferred":3720,
757 #             "total-time":12345,
758 #             "setup-time":12345,
759 #             "expected-downtime":12345,
760 #             "duplicate":10,
761 #             "normal":3333,
762 #             "normal-bytes":3412992,
763 #             "dirty-sync-count":15
764 #          },
765 #          "xbzrle-cache":{
766 #             "cache-size":67108864,
767 #             "bytes":20971520,
768 #             "pages":2444343,
769 #             "cache-miss":2244,
770 #             "cache-miss-rate":0.123,
771 #             "overflow":34434
772 #          }
773 #       }
774 #    }
777 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
780 # @MigrationCapability:
782 # Migration capabilities enumeration
784 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
785 #          This feature allows us to minimize migration traffic for certain work
786 #          loads, by sending compressed difference of the pages
788 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
789 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
790 #          Disabled by default. (since 2.0)
792 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
793 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
794 #          source and target VM to support this feature. To enable it is sufficient
795 #          to enable the capability on the source VM. The feature is disabled by
796 #          default. (since 1.6)
798 # @compress: Use multiple compression threads to accelerate live migration.
799 #          This feature can help to reduce the migration traffic, by sending
800 #          compressed pages. Please note that if compress and xbzrle are both
801 #          on, compress only takes effect in the ram bulk stage, after that,
802 #          it will be disabled and only xbzrle takes effect, this can help to
803 #          minimize migration traffic. The feature is disabled by default.
804 #          (since 2.4 )
806 # @events: generate events for each migration state change
807 #          (since 2.4 )
809 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
810 #          to speed up convergence of RAM migration. (since 1.6)
812 # @postcopy-ram: Start executing on the migration target before all of RAM has
813 #          been migrated, pulling the remaining pages along as needed. NOTE: If
814 #          the migration fails during postcopy the VM will fail.  (since 2.6)
816 # @x-colo: If enabled, migration will never end, and the state of the VM on the
817 #        primary side will be migrated continuously to the VM on secondary
818 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
819 #        Non-stop Service. (since 2.8)
821 # Since: 1.2
823 { 'enum': 'MigrationCapability',
824   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
825            'compress', 'events', 'postcopy-ram', 'x-colo'] }
828 # @MigrationCapabilityStatus:
830 # Migration capability information
832 # @capability: capability enum
834 # @state: capability state bool
836 # Since: 1.2
838 { 'struct': 'MigrationCapabilityStatus',
839   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
842 # @migrate-set-capabilities:
844 # Enable/Disable the following migration capabilities (like xbzrle)
846 # @capabilities: json array of capability modifications to make
848 # Since: 1.2
850 # Example:
852 # -> { "execute": "migrate-set-capabilities" , "arguments":
853 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
856 { 'command': 'migrate-set-capabilities',
857   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
860 # @query-migrate-capabilities:
862 # Returns information about the current migration capabilities status
864 # Returns: @MigrationCapabilitiesStatus
866 # Since: 1.2
868 # Example:
870 # -> { "execute": "query-migrate-capabilities" }
871 # <- { "return": [
872 #       {"state": false, "capability": "xbzrle"},
873 #       {"state": false, "capability": "rdma-pin-all"},
874 #       {"state": false, "capability": "auto-converge"},
875 #       {"state": false, "capability": "zero-blocks"},
876 #       {"state": false, "capability": "compress"},
877 #       {"state": true, "capability": "events"},
878 #       {"state": false, "capability": "postcopy-ram"},
879 #       {"state": false, "capability": "x-colo"}
880 #    ]}
883 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
886 # @MigrationParameter:
888 # Migration parameters enumeration
890 # @compress-level: Set the compression level to be used in live migration,
891 #          the compression level is an integer between 0 and 9, where 0 means
892 #          no compression, 1 means the best compression speed, and 9 means best
893 #          compression ratio which will consume more CPU.
895 # @compress-threads: Set compression thread count to be used in live migration,
896 #          the compression thread count is an integer between 1 and 255.
898 # @decompress-threads: Set decompression thread count to be used in live
899 #          migration, the decompression thread count is an integer between 1
900 #          and 255. Usually, decompression is at least 4 times as fast as
901 #          compression, so set the decompress-threads to the number about 1/4
902 #          of compress-threads is adequate.
904 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
905 #                        when migration auto-converge is activated. The
906 #                        default value is 20. (Since 2.7)
908 # @cpu-throttle-increment: throttle percentage increase each time
909 #                          auto-converge detects that migration is not making
910 #                          progress. The default value is 10. (Since 2.7)
912 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
913 #             establishing a TLS connection over the migration data channel.
914 #             On the outgoing side of the migration, the credentials must
915 #             be for a 'client' endpoint, while for the incoming side the
916 #             credentials must be for a 'server' endpoint. Setting this
917 #             will enable TLS for all migrations. The default is unset,
918 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
920 # @tls-hostname: hostname of the target host for the migration. This is
921 #                required when using x509 based TLS credentials and the
922 #                migration URI does not already include a hostname. For
923 #                example if using fd: or exec: based migration, the
924 #                hostname must be provided so that the server's x509
925 #                certificate identity can be validated. (Since 2.7)
927 # @max-bandwidth: to set maximum speed for migration. maximum speed in
928 #                 bytes per second. (Since 2.8)
930 # @downtime-limit: set maximum tolerated downtime for migration. maximum
931 #                  downtime in milliseconds (Since 2.8)
933 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
934 #          periodic mode. (Since 2.8)
936 # Since: 2.4
938 { 'enum': 'MigrationParameter',
939   'data': ['compress-level', 'compress-threads', 'decompress-threads',
940            'cpu-throttle-initial', 'cpu-throttle-increment',
941            'tls-creds', 'tls-hostname', 'max-bandwidth',
942            'downtime-limit', 'x-checkpoint-delay' ] }
945 # @migrate-set-parameters:
947 # Set various migration parameters.  See MigrationParameters for details.
949 # Since: 2.4
951 # Example:
953 # -> { "execute": "migrate-set-parameters" ,
954 #      "arguments": { "compress-level": 1 } }
957 { 'command': 'migrate-set-parameters', 'boxed': true,
958   'data': 'MigrationParameters' }
961 # @MigrationParameters:
963 # Optional members can be omitted on input ('migrate-set-parameters')
964 # but most members will always be present on output
965 # ('query-migrate-parameters'), with the exception of tls-creds and
966 # tls-hostname.
968 # @compress-level: #optional compression level
970 # @compress-threads: #optional compression thread count
972 # @decompress-threads: #optional decompression thread count
974 # @cpu-throttle-initial: #optional Initial percentage of time guest cpus are
975 #                        throttledwhen migration auto-converge is activated.
976 #                        The default value is 20. (Since 2.7)
978 # @cpu-throttle-increment: #optional throttle percentage increase each time
979 #                          auto-converge detects that migration is not making
980 #                          progress. The default value is 10. (Since 2.7)
982 # @tls-creds: #optional ID of the 'tls-creds' object that provides credentials
983 #             for establishing a TLS connection over the migration data
984 #             channel. On the outgoing side of the migration, the credentials
985 #             must be for a 'client' endpoint, while for the incoming side the
986 #             credentials must be for a 'server' endpoint. Setting this
987 #             will enable TLS for all migrations. The default is unset,
988 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
990 # @tls-hostname: #optional hostname of the target host for the migration. This
991 #                is required when using x509 based TLS credentials and the
992 #                migration URI does not already include a hostname. For
993 #                example if using fd: or exec: based migration, the
994 #                hostname must be provided so that the server's x509
995 #                certificate identity can be validated. (Since 2.7)
997 # @max-bandwidth: to set maximum speed for migration. maximum speed in
998 #                 bytes per second. (Since 2.8)
1000 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1001 #                  downtime in milliseconds (Since 2.8)
1003 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1005 # Since: 2.4
1007 { 'struct': 'MigrationParameters',
1008   'data': { '*compress-level': 'int',
1009             '*compress-threads': 'int',
1010             '*decompress-threads': 'int',
1011             '*cpu-throttle-initial': 'int',
1012             '*cpu-throttle-increment': 'int',
1013             '*tls-creds': 'str',
1014             '*tls-hostname': 'str',
1015             '*max-bandwidth': 'int',
1016             '*downtime-limit': 'int',
1017             '*x-checkpoint-delay': 'int'} }
1020 # @query-migrate-parameters:
1022 # Returns information about the current migration parameters
1024 # Returns: @MigrationParameters
1026 # Since: 2.4
1028 # Example:
1030 # -> { "execute": "query-migrate-parameters" }
1031 # <- { "return": {
1032 #          "decompress-threads": 2,
1033 #          "cpu-throttle-increment": 10,
1034 #          "compress-threads": 8,
1035 #          "compress-level": 1,
1036 #          "cpu-throttle-initial": 20,
1037 #          "max-bandwidth": 33554432,
1038 #          "downtime-limit": 300
1039 #       }
1040 #    }
1043 { 'command': 'query-migrate-parameters',
1044   'returns': 'MigrationParameters' }
1047 # @client_migrate_info:
1049 # Set migration information for remote display.  This makes the server
1050 # ask the client to automatically reconnect using the new parameters
1051 # once migration finished successfully.  Only implemented for SPICE.
1053 # @protocol:     must be "spice"
1054 # @hostname:     migration target hostname
1055 # @port:         #optional spice tcp port for plaintext channels
1056 # @tls-port:     #optional spice tcp port for tls-secured channels
1057 # @cert-subject: #optional server certificate subject
1059 # Since: 0.14.0
1061 # Example:
1063 # -> { "execute": "client_migrate_info",
1064 #      "arguments": { "protocol": "spice",
1065 #                     "hostname": "virt42.lab.kraxel.org",
1066 #                     "port": 1234 } }
1067 # <- { "return": {} }
1070 { 'command': 'client_migrate_info',
1071   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1072             '*tls-port': 'int', '*cert-subject': 'str' } }
1075 # @migrate-start-postcopy:
1077 # Followup to a migration command to switch the migration to postcopy mode.
1078 # The postcopy-ram capability must be set before the original migration
1079 # command.
1081 # Since: 2.5
1083 # Example:
1085 # -> { "execute": "migrate-start-postcopy" }
1086 # <- { "return": {} }
1089 { 'command': 'migrate-start-postcopy' }
1092 # @COLOMessage:
1094 # The message transmission between Primary side and Secondary side.
1096 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1098 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1100 # @checkpoint-reply: SVM gets PVM's checkpoint request
1102 # @vmstate-send: VM's state will be sent by PVM.
1104 # @vmstate-size: The total size of VMstate.
1106 # @vmstate-received: VM's state has been received by SVM.
1108 # @vmstate-loaded: VM's state has been loaded by SVM.
1110 # Since: 2.8
1112 { 'enum': 'COLOMessage',
1113   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1114             'vmstate-send', 'vmstate-size', 'vmstate-received',
1115             'vmstate-loaded' ] }
1118 # @COLOMode:
1120 # The colo mode
1122 # @unknown: unknown mode
1124 # @primary: master side
1126 # @secondary: slave side
1128 # Since: 2.8
1130 { 'enum': 'COLOMode',
1131   'data': [ 'unknown', 'primary', 'secondary'] }
1134 # @FailoverStatus:
1136 # An enumeration of COLO failover status
1138 # @none: no failover has ever happened
1140 # @require: got failover requirement but not handled
1142 # @active: in the process of doing failover
1144 # @completed: finish the process of failover
1146 # Since: 2.8
1148 { 'enum': 'FailoverStatus',
1149   'data': [ 'none', 'require', 'active', 'completed'] }
1152 # @x-colo-lost-heartbeat:
1154 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1155 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1156 # If sent to the Secondary, the Secondary side will run failover work,
1157 # then takes over server operation to become the service VM.
1159 # Since: 2.8
1161 { 'command': 'x-colo-lost-heartbeat' }
1164 # @MouseInfo:
1166 # Information about a mouse device.
1168 # @name: the name of the mouse device
1170 # @index: the index of the mouse device
1172 # @current: true if this device is currently receiving mouse events
1174 # @absolute: true if this device supports absolute coordinates as input
1176 # Since: 0.14.0
1178 { 'struct': 'MouseInfo',
1179   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1180            'absolute': 'bool'} }
1183 # @query-mice:
1185 # Returns information about each active mouse device
1187 # Returns: a list of @MouseInfo for each device
1189 # Since: 0.14.0
1191 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1194 # @CpuInfoArch:
1196 # An enumeration of cpu types that enable additional information during
1197 # @query-cpus.
1199 # Since: 2.6
1201 { 'enum': 'CpuInfoArch',
1202   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1205 # @CpuInfo:
1207 # Information about a virtual CPU
1209 # @CPU: the index of the virtual CPU
1211 # @current: this only exists for backwards compatibility and should be ignored
1213 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1214 #          to a processor specific low power mode.
1216 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1218 # @thread_id: ID of the underlying host thread
1220 # @arch: architecture of the cpu, which determines which additional fields
1221 #        will be listed (since 2.6)
1223 # Since: 0.14.0
1225 # Notes: @halted is a transient state that changes frequently.  By the time the
1226 #        data is sent to the client, the guest may no longer be halted.
1228 { 'union': 'CpuInfo',
1229   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1230            'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' },
1231   'discriminator': 'arch',
1232   'data': { 'x86': 'CpuInfoX86',
1233             'sparc': 'CpuInfoSPARC',
1234             'ppc': 'CpuInfoPPC',
1235             'mips': 'CpuInfoMIPS',
1236             'tricore': 'CpuInfoTricore',
1237             'other': 'CpuInfoOther' } }
1240 # @CpuInfoX86:
1242 # Additional information about a virtual i386 or x86_64 CPU
1244 # @pc: the 64-bit instruction pointer
1246 # Since: 2.6
1248 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1251 # @CpuInfoSPARC:
1253 # Additional information about a virtual SPARC CPU
1255 # @pc: the PC component of the instruction pointer
1257 # @npc: the NPC component of the instruction pointer
1259 # Since: 2.6
1261 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1264 # @CpuInfoPPC:
1266 # Additional information about a virtual PPC CPU
1268 # @nip: the instruction pointer
1270 # Since: 2.6
1272 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1275 # @CpuInfoMIPS:
1277 # Additional information about a virtual MIPS CPU
1279 # @PC: the instruction pointer
1281 # Since: 2.6
1283 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1286 # @CpuInfoTricore:
1288 # Additional information about a virtual Tricore CPU
1290 # @PC: the instruction pointer
1292 # Since: 2.6
1294 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1297 # @CpuInfoOther:
1299 # No additional information is available about the virtual CPU
1301 # Since: 2.6
1304 { 'struct': 'CpuInfoOther', 'data': { } }
1307 # @query-cpus:
1309 # Returns a list of information about each virtual CPU.
1311 # Returns: a list of @CpuInfo for each virtual CPU
1313 # Since: 0.14.0
1315 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1318 # @IOThreadInfo:
1320 # Information about an iothread
1322 # @id: the identifier of the iothread
1324 # @thread-id: ID of the underlying host thread
1326 # Since: 2.0
1328 { 'struct': 'IOThreadInfo',
1329   'data': {'id': 'str', 'thread-id': 'int'} }
1332 # @query-iothreads:
1334 # Returns a list of information about each iothread.
1336 # Note: this list excludes the QEMU main loop thread, which is not declared
1337 # using the -object iothread command-line option.  It is always the main thread
1338 # of the process.
1340 # Returns: a list of @IOThreadInfo for each iothread
1342 # Since: 2.0
1344 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1347 # @NetworkAddressFamily:
1349 # The network address family
1351 # @ipv4: IPV4 family
1353 # @ipv6: IPV6 family
1355 # @unix: unix socket
1357 # @vsock: vsock family (since 2.8)
1359 # @unknown: otherwise
1361 # Since: 2.1
1363 { 'enum': 'NetworkAddressFamily',
1364   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1367 # @VncBasicInfo:
1369 # The basic information for vnc network connection
1371 # @host: IP address
1373 # @service: The service name of the vnc port. This may depend on the host
1374 #           system's service database so symbolic names should not be relied
1375 #           on.
1377 # @family: address family
1379 # @websocket: true in case the socket is a websocket (since 2.3).
1381 # Since: 2.1
1383 { 'struct': 'VncBasicInfo',
1384   'data': { 'host': 'str',
1385             'service': 'str',
1386             'family': 'NetworkAddressFamily',
1387             'websocket': 'bool' } }
1390 # @VncServerInfo:
1392 # The network connection information for server
1394 # @auth: #optional, authentication method
1396 # Since: 2.1
1398 { 'struct': 'VncServerInfo',
1399   'base': 'VncBasicInfo',
1400   'data': { '*auth': 'str' } }
1403 # @VncClientInfo:
1405 # Information about a connected VNC client.
1407 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1408 #              Name of the client.
1410 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1411 #                 used for authentication.
1413 # Since: 0.14.0
1415 { 'struct': 'VncClientInfo',
1416   'base': 'VncBasicInfo',
1417   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1420 # @VncInfo:
1422 # Information about the VNC session.
1424 # @enabled: true if the VNC server is enabled, false otherwise
1426 # @host: #optional The hostname the VNC server is bound to.  This depends on
1427 #        the name resolution on the host and may be an IP address.
1429 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1430 #                    'ipv4' if the host is listening for IPv4 connections
1431 #                    'unix' if the host is listening on a unix domain socket
1432 #                    'unknown' otherwise
1434 # @service: #optional The service name of the server's port.  This may depends
1435 #           on the host system's service database so symbolic names should not
1436 #           be relied on.
1438 # @auth: #optional the current authentication type used by the server
1439 #        'none' if no authentication is being used
1440 #        'vnc' if VNC authentication is being used
1441 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1442 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1443 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1444 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1445 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1446 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1447 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1448 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1449 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1451 # @clients: a list of @VncClientInfo of all currently connected clients
1453 # Since: 0.14.0
1455 { 'struct': 'VncInfo',
1456   'data': {'enabled': 'bool', '*host': 'str',
1457            '*family': 'NetworkAddressFamily',
1458            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1461 # @VncPrimaryAuth:
1463 # vnc primary authentication method.
1465 # Since: 2.3
1467 { 'enum': 'VncPrimaryAuth',
1468   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1469             'tls', 'vencrypt', 'sasl' ] }
1472 # @VncVencryptSubAuth:
1474 # vnc sub authentication method with vencrypt.
1476 # Since: 2.3
1478 { 'enum': 'VncVencryptSubAuth',
1479   'data': [ 'plain',
1480             'tls-none',  'x509-none',
1481             'tls-vnc',   'x509-vnc',
1482             'tls-plain', 'x509-plain',
1483             'tls-sasl',  'x509-sasl' ] }
1486 # @VncInfo2:
1488 # Information about a vnc server
1490 # @id: vnc server name.
1492 # @server: A list of @VncBasincInfo describing all listening sockets.
1493 #          The list can be empty (in case the vnc server is disabled).
1494 #          It also may have multiple entries: normal + websocket,
1495 #          possibly also ipv4 + ipv6 in the future.
1497 # @clients: A list of @VncClientInfo of all currently connected clients.
1498 #           The list can be empty, for obvious reasons.
1500 # @auth: The current authentication type used by the server
1502 # @vencrypt: #optional The vencrypt sub authentication type used by the server,
1503 #            only specified in case auth == vencrypt.
1505 # @display: #optional The display device the vnc server is linked to.
1507 # Since: 2.3
1509 { 'struct': 'VncInfo2',
1510   'data': { 'id'        : 'str',
1511             'server'    : ['VncBasicInfo'],
1512             'clients'   : ['VncClientInfo'],
1513             'auth'      : 'VncPrimaryAuth',
1514             '*vencrypt' : 'VncVencryptSubAuth',
1515             '*display'  : 'str' } }
1518 # @query-vnc:
1520 # Returns information about the current VNC server
1522 # Returns: @VncInfo
1524 # Since: 0.14.0
1526 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1529 # @query-vnc-servers:
1531 # Returns a list of vnc servers.  The list can be empty.
1533 # Returns: a list of @VncInfo2
1535 # Since: 2.3
1537 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1540 # @SpiceBasicInfo:
1542 # The basic information for SPICE network connection
1544 # @host: IP address
1546 # @port: port number
1548 # @family: address family
1550 # Since: 2.1
1552 { 'struct': 'SpiceBasicInfo',
1553   'data': { 'host': 'str',
1554             'port': 'str',
1555             'family': 'NetworkAddressFamily' } }
1558 # @SpiceServerInfo:
1560 # Information about a SPICE server
1562 # @auth: #optional, authentication method
1564 # Since: 2.1
1566 { 'struct': 'SpiceServerInfo',
1567   'base': 'SpiceBasicInfo',
1568   'data': { '*auth': 'str' } }
1571 # @SpiceChannel:
1573 # Information about a SPICE client channel.
1575 # @connection-id: SPICE connection id number.  All channels with the same id
1576 #                 belong to the same SPICE session.
1578 # @channel-type: SPICE channel type number.  "1" is the main control
1579 #                channel, filter for this one if you want to track spice
1580 #                sessions only
1582 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1583 #              multiple channels of the same type exist, such as multiple
1584 #              display channels in a multihead setup
1586 # @tls: true if the channel is encrypted, false otherwise.
1588 # Since: 0.14.0
1590 { 'struct': 'SpiceChannel',
1591   'base': 'SpiceBasicInfo',
1592   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1593            'tls': 'bool'} }
1596 # @SpiceQueryMouseMode:
1598 # An enumeration of Spice mouse states.
1600 # @client: Mouse cursor position is determined by the client.
1602 # @server: Mouse cursor position is determined by the server.
1604 # @unknown: No information is available about mouse mode used by
1605 #           the spice server.
1607 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1609 # Since: 1.1
1611 { 'enum': 'SpiceQueryMouseMode',
1612   'data': [ 'client', 'server', 'unknown' ] }
1615 # @SpiceInfo:
1617 # Information about the SPICE session.
1619 # @enabled: true if the SPICE server is enabled, false otherwise
1621 # @migrated: true if the last guest migration completed and spice
1622 #            migration had completed as well. false otherwise.
1624 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1625 #        the name resolution on the host and may be an IP address.
1627 # @port: #optional The SPICE server's port number.
1629 # @compiled-version: #optional SPICE server version.
1631 # @tls-port: #optional The SPICE server's TLS port number.
1633 # @auth: #optional the current authentication type used by the server
1634 #        'none'  if no authentication is being used
1635 #        'spice' uses SASL or direct TLS authentication, depending on command
1636 #                line options
1638 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1639 #              be determined by the client or the server, or unknown if spice
1640 #              server doesn't provide this information.
1642 #              Since: 1.1
1644 # @channels: a list of @SpiceChannel for each active spice channel
1646 # Since: 0.14.0
1648 { 'struct': 'SpiceInfo',
1649   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1650            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1651            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1654 # @query-spice:
1656 # Returns information about the current SPICE server
1658 # Returns: @SpiceInfo
1660 # Since: 0.14.0
1662 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1665 # @BalloonInfo:
1667 # Information about the guest balloon device.
1669 # @actual: the number of bytes the balloon currently contains
1671 # Since: 0.14.0
1674 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1677 # @query-balloon:
1679 # Return information about the balloon device.
1681 # Returns: @BalloonInfo on success
1682 #          If the balloon driver is enabled but not functional because the KVM
1683 #          kernel module cannot support it, KvmMissingCap
1684 #          If no balloon device is present, DeviceNotActive
1686 # Since: 0.14.0
1688 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1691 # @PciMemoryRange:
1693 # A PCI device memory region
1695 # @base: the starting address (guest physical)
1697 # @limit: the ending address (guest physical)
1699 # Since: 0.14.0
1701 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1704 # @PciMemoryRegion:
1706 # Information about a PCI device I/O region.
1708 # @bar: the index of the Base Address Register for this region
1710 # @type: 'io' if the region is a PIO region
1711 #        'memory' if the region is a MMIO region
1713 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1715 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1717 # Since: 0.14.0
1719 { 'struct': 'PciMemoryRegion',
1720   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1721            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1724 # @PciBusInfo:
1726 # Information about a bus of a PCI Bridge device
1728 # @number: primary bus interface number.  This should be the number of the
1729 #          bus the device resides on.
1731 # @secondary: secondary bus interface number.  This is the number of the
1732 #             main bus for the bridge
1734 # @subordinate: This is the highest number bus that resides below the
1735 #               bridge.
1737 # @io_range: The PIO range for all devices on this bridge
1739 # @memory_range: The MMIO range for all devices on this bridge
1741 # @prefetchable_range: The range of prefetchable MMIO for all devices on
1742 #                      this bridge
1744 # Since: 2.4
1746 { 'struct': 'PciBusInfo',
1747   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1748            'io_range': 'PciMemoryRange',
1749            'memory_range': 'PciMemoryRange',
1750            'prefetchable_range': 'PciMemoryRange' } }
1753 # @PciBridgeInfo:
1755 # Information about a PCI Bridge device
1757 # @bus: information about the bus the device resides on
1759 # @devices: a list of @PciDeviceInfo for each device on this bridge
1761 # Since: 0.14.0
1763 { 'struct': 'PciBridgeInfo',
1764   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
1767 # @PciDeviceClass:
1769 # Information about the Class of a PCI device
1771 # @desc: #optional a string description of the device's class
1773 # @class: the class code of the device
1775 # Since: 2.4
1777 { 'struct': 'PciDeviceClass',
1778   'data': {'*desc': 'str', 'class': 'int'} }
1781 # @PciDeviceId:
1783 # Information about the Id of a PCI device
1785 # @device: the PCI device id
1787 # @vendor: the PCI vendor id
1789 # Since: 2.4
1791 { 'struct': 'PciDeviceId',
1792   'data': {'device': 'int', 'vendor': 'int'} }
1795 # @PciDeviceInfo:
1797 # Information about a PCI device
1799 # @bus: the bus number of the device
1801 # @slot: the slot the device is located in
1803 # @function: the function of the slot used by the device
1805 # @class_info: the class of the device
1807 # @id: the PCI device id
1809 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1811 # @qdev_id: the device name of the PCI device
1813 # @pci_bridge: if the device is a PCI bridge, the bridge information
1815 # @regions: a list of the PCI I/O regions associated with the device
1817 # Notes: the contents of @class_info.desc are not stable and should only be
1818 #        treated as informational.
1820 # Since: 0.14.0
1822 { 'struct': 'PciDeviceInfo',
1823   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1824            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
1825            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1826            'regions': ['PciMemoryRegion']} }
1829 # @PciInfo:
1831 # Information about a PCI bus
1833 # @bus: the bus index
1835 # @devices: a list of devices on this bus
1837 # Since: 0.14.0
1839 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1842 # @query-pci:
1844 # Return information about the PCI bus topology of the guest.
1846 # Returns: a list of @PciInfo for each PCI bus
1848 # Since: 0.14.0
1850 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1853 # @quit:
1855 # This command will cause the QEMU process to exit gracefully.  While every
1856 # attempt is made to send the QMP response before terminating, this is not
1857 # guaranteed.  When using this interface, a premature EOF would not be
1858 # unexpected.
1860 # Since: 0.14.0
1862 { 'command': 'quit' }
1865 # @stop:
1867 # Stop all guest VCPU execution.
1869 # Since:  0.14.0
1871 # Notes:  This function will succeed even if the guest is already in the stopped
1872 #         state.  In "inmigrate" state, it will ensure that the guest
1873 #         remains paused once migration finishes, as if the -S option was
1874 #         passed on the command line.
1876 { 'command': 'stop' }
1879 # @system_reset:
1881 # Performs a hard reset of a guest.
1883 # Since: 0.14.0
1885 { 'command': 'system_reset' }
1888 # @system_powerdown:
1890 # Requests that a guest perform a powerdown operation.
1892 # Since: 0.14.0
1894 # Notes: A guest may or may not respond to this command.  This command
1895 #        returning does not indicate that a guest has accepted the request or
1896 #        that it has shut down.  Many guests will respond to this command by
1897 #        prompting the user in some way.
1899 { 'command': 'system_powerdown' }
1902 # @cpu:
1904 # This command is a nop that is only provided for the purposes of compatibility.
1906 # Since: 0.14.0
1908 # Notes: Do not use this command.
1910 { 'command': 'cpu', 'data': {'index': 'int'} }
1913 # @cpu-add:
1915 # Adds CPU with specified ID
1917 # @id: ID of CPU to be created, valid values [0..max_cpus)
1919 # Returns: Nothing on success
1921 # Since: 1.5
1923 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1926 # @memsave:
1928 # Save a portion of guest memory to a file.
1930 # @val: the virtual address of the guest to start from
1932 # @size: the size of memory region to save
1934 # @filename: the file to save the memory to as binary data
1936 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1937 #                       virtual address (defaults to CPU 0)
1939 # Returns: Nothing on success
1941 # Since: 0.14.0
1943 # Notes: Errors were not reliably returned until 1.1
1945 { 'command': 'memsave',
1946   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1949 # @pmemsave:
1951 # Save a portion of guest physical memory to a file.
1953 # @val: the physical address of the guest to start from
1955 # @size: the size of memory region to save
1957 # @filename: the file to save the memory to as binary data
1959 # Returns: Nothing on success
1961 # Since: 0.14.0
1963 # Notes: Errors were not reliably returned until 1.1
1965 { 'command': 'pmemsave',
1966   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1969 # @cont:
1971 # Resume guest VCPU execution.
1973 # Since:  0.14.0
1975 # Returns:  If successful, nothing
1976 #           If QEMU was started with an encrypted block device and a key has
1977 #              not yet been set, DeviceEncrypted.
1979 # Notes:  This command will succeed if the guest is currently running.  It
1980 #         will also succeed if the guest is in the "inmigrate" state; in
1981 #         this case, the effect of the command is to make sure the guest
1982 #         starts once migration finishes, removing the effect of the -S
1983 #         command line option if it was passed.
1985 { 'command': 'cont' }
1988 # @system_wakeup:
1990 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1992 # Since:  1.1
1994 # Returns:  nothing.
1996 { 'command': 'system_wakeup' }
1999 # @inject-nmi:
2001 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2003 # Returns:  If successful, nothing
2005 # Since:  0.14.0
2007 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2009 { 'command': 'inject-nmi' }
2012 # @set_link:
2014 # Sets the link status of a virtual network adapter.
2016 # @name: the device name of the virtual network adapter
2018 # @up: true to set the link status to be up
2020 # Returns: Nothing on success
2021 #          If @name is not a valid network device, DeviceNotFound
2023 # Since: 0.14.0
2025 # Notes: Not all network adapters support setting link status.  This command
2026 #        will succeed even if the network adapter does not support link status
2027 #        notification.
2029 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2032 # @balloon:
2034 # Request the balloon driver to change its balloon size.
2036 # @value: the target size of the balloon in bytes
2038 # Returns: Nothing on success
2039 #          If the balloon driver is enabled but not functional because the KVM
2040 #            kernel module cannot support it, KvmMissingCap
2041 #          If no balloon device is present, DeviceNotActive
2043 # Notes: This command just issues a request to the guest.  When it returns,
2044 #        the balloon size may not have changed.  A guest can change the balloon
2045 #        size independent of this command.
2047 # Since: 0.14.0
2049 { 'command': 'balloon', 'data': {'value': 'int'} }
2052 # @Abort:
2054 # This action can be used to test transaction failure.
2056 # Since: 1.6
2058 { 'struct': 'Abort',
2059   'data': { } }
2062 # @ActionCompletionMode:
2064 # An enumeration of Transactional completion modes.
2066 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2067 #              after the Transaction request succeeds. All Actions that
2068 #              can complete successfully will do so without waiting on others.
2069 #              This is the default.
2071 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2072 #           Actions. Actions do not complete until all Actions are ready to
2073 #           complete. May be rejected by Actions that do not support this
2074 #           completion mode.
2076 # Since: 2.5
2078 { 'enum': 'ActionCompletionMode',
2079   'data': [ 'individual', 'grouped' ] }
2082 # @TransactionAction:
2084 # A discriminated record of operations that can be performed with
2085 # @transaction. Action @type can be:
2087 # - @abort: since 1.6
2088 # - @block-dirty-bitmap-add: since 2.5
2089 # - @block-dirty-bitmap-clear: since 2.5
2090 # - @blockdev-backup: since 2.3
2091 # - @blockdev-snapshot: since 2.5
2092 # - @blockdev-snapshot-internal-sync: since 1.7
2093 # - @blockdev-snapshot-sync: since 1.1
2094 # - @drive-backup: since 1.6
2096 # Since: 1.1
2098 { 'union': 'TransactionAction',
2099   'data': {
2100        'abort': 'Abort',
2101        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2102        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2103        'blockdev-backup': 'BlockdevBackup',
2104        'blockdev-snapshot': 'BlockdevSnapshot',
2105        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2106        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2107        'drive-backup': 'DriveBackup'
2108    } }
2111 # @TransactionProperties:
2113 # Optional arguments to modify the behavior of a Transaction.
2115 # @completion-mode: #optional Controls how jobs launched asynchronously by
2116 #                   Actions will complete or fail as a group.
2117 #                   See @ActionCompletionMode for details.
2119 # Since: 2.5
2121 { 'struct': 'TransactionProperties',
2122   'data': {
2123        '*completion-mode': 'ActionCompletionMode'
2124   }
2128 # @transaction:
2130 # Executes a number of transactionable QMP commands atomically. If any
2131 # operation fails, then the entire set of actions will be abandoned and the
2132 # appropriate error returned.
2134 # @actions: List of @TransactionAction;
2135 #           information needed for the respective operations.
2137 # @properties: #optional structure of additional options to control the
2138 #              execution of the transaction. See @TransactionProperties
2139 #              for additional detail.
2141 # Returns: nothing on success
2142 #          Errors depend on the operations of the transaction
2144 # Note: The transaction aborts on the first failure.  Therefore, there will be
2145 # information on only one failed operation returned in an error condition, and
2146 # subsequent actions will not have been attempted.
2148 # Since: 1.1
2150 { 'command': 'transaction',
2151   'data': { 'actions': [ 'TransactionAction' ],
2152             '*properties': 'TransactionProperties'
2153           }
2157 # @human-monitor-command:
2159 # Execute a command on the human monitor and return the output.
2161 # @command-line: the command to execute in the human monitor
2163 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2165 # Returns: the output of the command as a string
2167 # Since: 0.14.0
2169 # Notes: This command only exists as a stop-gap.  Its use is highly
2170 #        discouraged.  The semantics of this command are not guaranteed.
2172 #        Known limitations:
2174 #        * This command is stateless, this means that commands that depend
2175 #          on state information (such as getfd) might not work
2177 #        * Commands that prompt the user for data (eg. 'cont' when the block
2178 #          device is encrypted) don't currently work
2180 { 'command': 'human-monitor-command',
2181   'data': {'command-line': 'str', '*cpu-index': 'int'},
2182   'returns': 'str' }
2185 # @migrate_cancel:
2187 # Cancel the current executing migration process.
2189 # Returns: nothing on success
2191 # Notes: This command succeeds even if there is no migration process running.
2193 # Since: 0.14.0
2195 { 'command': 'migrate_cancel' }
2198 # @migrate_set_downtime:
2200 # Set maximum tolerated downtime for migration.
2202 # @value: maximum downtime in seconds
2204 # Returns: nothing on success
2206 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2208 # Since: 0.14.0
2210 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2213 # @migrate_set_speed:
2215 # Set maximum speed for migration.
2217 # @value: maximum speed in bytes.
2219 # Returns: nothing on success
2221 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2223 # Since: 0.14.0
2225 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2228 # @migrate-set-cache-size:
2230 # Set XBZRLE cache size
2232 # @value: cache size in bytes
2234 # The size will be rounded down to the nearest power of 2.
2235 # The cache size can be modified before and during ongoing migration
2237 # Returns: nothing on success
2239 # Since: 1.2
2241 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2244 # @query-migrate-cache-size:
2246 # query XBZRLE cache size
2248 # Returns: XBZRLE cache size in bytes
2250 # Since: 1.2
2252 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2255 # @ObjectPropertyInfo:
2257 # @name: the name of the property
2259 # @type: the type of the property.  This will typically come in one of four
2260 #        forms:
2262 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2263 #           These types are mapped to the appropriate JSON type.
2265 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2266 #           device type name.  Child properties create the composition tree.
2268 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2269 #           device type name.  Link properties form the device model graph.
2271 # Since: 1.2
2273 { 'struct': 'ObjectPropertyInfo',
2274   'data': { 'name': 'str', 'type': 'str' } }
2277 # @qom-list:
2279 # This command will list any properties of a object given a path in the object
2280 # model.
2282 # @path: the path within the object model.  See @qom-get for a description of
2283 #        this parameter.
2285 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2286 #          object.
2288 # Since: 1.2
2290 { 'command': 'qom-list',
2291   'data': { 'path': 'str' },
2292   'returns': [ 'ObjectPropertyInfo' ] }
2295 # @qom-get:
2297 # This command will get a property from a object model path and return the
2298 # value.
2300 # @path: The path within the object model.  There are two forms of supported
2301 #        paths--absolute and partial paths.
2303 #        Absolute paths are derived from the root object and can follow child<>
2304 #        or link<> properties.  Since they can follow link<> properties, they
2305 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2306 #        and are prefixed  with a leading slash.
2308 #        Partial paths look like relative filenames.  They do not begin
2309 #        with a prefix.  The matching rules for partial paths are subtle but
2310 #        designed to make specifying objects easy.  At each level of the
2311 #        composition tree, the partial path is matched as an absolute path.
2312 #        The first match is not returned.  At least two matches are searched
2313 #        for.  A successful result is only returned if only one match is
2314 #        found.  If more than one match is found, a flag is return to
2315 #        indicate that the match was ambiguous.
2317 # @property: The property name to read
2319 # Returns: The property value.  The type depends on the property
2320 #          type. child<> and link<> properties are returned as #str
2321 #          pathnames.  All integer property types (u8, u16, etc) are
2322 #          returned as #int.
2324 # Since: 1.2
2326 { 'command': 'qom-get',
2327   'data': { 'path': 'str', 'property': 'str' },
2328   'returns': 'any' }
2331 # @qom-set:
2333 # This command will set a property from a object model path.
2335 # @path: see @qom-get for a description of this parameter
2337 # @property: the property name to set
2339 # @value: a value who's type is appropriate for the property type.  See @qom-get
2340 #         for a description of type mapping.
2342 # Since: 1.2
2344 { 'command': 'qom-set',
2345   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2348 # @set_password:
2350 # Sets the password of a remote display session.
2352 # @protocol: `vnc' to modify the VNC server password
2353 #            `spice' to modify the Spice server password
2355 # @password: the new password
2357 # @connected: #optional how to handle existing clients when changing the
2358 #                       password.  If nothing is specified, defaults to `keep'
2359 #                       `fail' to fail the command if clients are connected
2360 #                       `disconnect' to disconnect existing clients
2361 #                       `keep' to maintain existing clients
2363 # Returns: Nothing on success
2364 #          If Spice is not enabled, DeviceNotFound
2366 # Since: 0.14.0
2368 { 'command': 'set_password',
2369   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2372 # @expire_password:
2374 # Expire the password of a remote display server.
2376 # @protocol: the name of the remote display protocol `vnc' or `spice'
2378 # @time: when to expire the password.
2379 #        `now' to expire the password immediately
2380 #        `never' to cancel password expiration
2381 #        `+INT' where INT is the number of seconds from now (integer)
2382 #        `INT' where INT is the absolute time in seconds
2384 # Returns: Nothing on success
2385 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2387 # Since: 0.14.0
2389 # Notes: Time is relative to the server and currently there is no way to
2390 #        coordinate server time with client time.  It is not recommended to
2391 #        use the absolute time version of the @time parameter unless you're
2392 #        sure you are on the same machine as the QEMU instance.
2394 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2397 # @change-vnc-password:
2399 # Change the VNC server password.
2401 # @password:  the new password to use with VNC authentication
2403 # Since: 1.1
2405 # Notes:  An empty password in this command will set the password to the empty
2406 #         string.  Existing clients are unaffected by executing this command.
2408 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2411 # @change:
2413 # This command is multiple commands multiplexed together.
2415 # @device: This is normally the name of a block device but it may also be 'vnc'.
2416 #          when it's 'vnc', then sub command depends on @target
2418 # @target: If @device is a block device, then this is the new filename.
2419 #          If @device is 'vnc', then if the value 'password' selects the vnc
2420 #          change password command.   Otherwise, this specifies a new server URI
2421 #          address to listen to for VNC connections.
2423 # @arg:    If @device is a block device, then this is an optional format to open
2424 #          the device with.
2425 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2426 #          password to set.  If this argument is an empty string, then no future
2427 #          logins will be allowed.
2429 # Returns: Nothing on success.
2430 #          If @device is not a valid block device, DeviceNotFound
2431 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2432 #          if this error is returned, the device has been opened successfully
2433 #          and an additional call to @block_passwd is required to set the
2434 #          device's password.  The behavior of reads and writes to the block
2435 #          device between when these calls are executed is undefined.
2437 # Notes:  This interface is deprecated, and it is strongly recommended that you
2438 #         avoid using it.  For changing block devices, use
2439 #         blockdev-change-medium; for changing VNC parameters, use
2440 #         change-vnc-password.
2442 # Since: 0.14.0
2444 { 'command': 'change',
2445   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2448 # @ObjectTypeInfo:
2450 # This structure describes a search result from @qom-list-types
2452 # @name: the type name found in the search
2454 # Since: 1.1
2456 # Notes: This command is experimental and may change syntax in future releases.
2458 { 'struct': 'ObjectTypeInfo',
2459   'data': { 'name': 'str' } }
2462 # @qom-list-types:
2464 # This command will return a list of types given search parameters
2466 # @implements: if specified, only return types that implement this type name
2468 # @abstract: if true, include abstract types in the results
2470 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2472 # Since: 1.1
2474 { 'command': 'qom-list-types',
2475   'data': { '*implements': 'str', '*abstract': 'bool' },
2476   'returns': [ 'ObjectTypeInfo' ] }
2479 # @DevicePropertyInfo:
2481 # Information about device properties.
2483 # @name: the name of the property
2484 # @type: the typename of the property
2485 # @description: #optional if specified, the description of the property.
2486 #               (since 2.2)
2488 # Since: 1.2
2490 { 'struct': 'DevicePropertyInfo',
2491   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
2494 # @device-list-properties:
2496 # List properties associated with a device.
2498 # @typename: the type name of a device
2500 # Returns: a list of DevicePropertyInfo describing a devices properties
2502 # Since: 1.2
2504 { 'command': 'device-list-properties',
2505   'data': { 'typename': 'str'},
2506   'returns': [ 'DevicePropertyInfo' ] }
2509 # @migrate:
2511 # Migrates the current running guest to another Virtual Machine.
2513 # @uri: the Uniform Resource Identifier of the destination VM
2515 # @blk: #optional do block migration (full disk copy)
2517 # @inc: #optional incremental disk copy migration
2519 # @detach: this argument exists only for compatibility reasons and
2520 #          is ignored by QEMU
2522 # Returns: nothing on success
2524 # Since: 0.14.0
2526 { 'command': 'migrate',
2527   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2530 # @migrate-incoming:
2532 # Start an incoming migration, the qemu must have been started
2533 # with -incoming defer
2535 # @uri: The Uniform Resource Identifier identifying the source or
2536 #       address to listen on
2538 # Returns: nothing on success
2540 # Since: 2.3
2541 # Note: It's a bad idea to use a string for the uri, but it needs to stay
2542 # compatible with -incoming and the format of the uri is already exposed
2543 # above libvirt
2545 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
2548 # @xen-save-devices-state:
2550 # Save the state of all devices to file. The RAM and the block devices
2551 # of the VM are not saved by this command.
2553 # @filename: the file to save the state of the devices to as binary
2554 # data. See xen-save-devices-state.txt for a description of the binary
2555 # format.
2557 # Returns: Nothing on success
2559 # Since: 1.1
2561 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2564 # @xen-set-global-dirty-log:
2566 # Enable or disable the global dirty log mode.
2568 # @enable: true to enable, false to disable.
2570 # Returns: nothing
2572 # Since: 1.3
2574 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2577 # @device_add:
2579 # @driver: the name of the new device's driver
2581 # @bus: #optional the device's parent bus (device tree path)
2583 # @id: #optional the device's ID, must be unique
2585 # Additional arguments depend on the type.
2587 # Add a device.
2589 # Notes:
2590 # 1. For detailed information about this command, please refer to the
2591 #    'docs/qdev-device-use.txt' file.
2593 # 2. It's possible to list device properties by running QEMU with the
2594 #    "-device DEVICE,help" command-line argument, where DEVICE is the
2595 #    device's name
2597 # Example:
2599 # -> { "execute": "device_add",
2600 #      "arguments": { "driver": "e1000", "id": "net1",
2601 #                     "bus": "pci.0",
2602 #                     "mac": "52:54:00:12:34:56" } }
2603 # <- { "return": {} }
2605 # TODO: This command effectively bypasses QAPI completely due to its
2606 # "additional arguments" business.  It shouldn't have been added to
2607 # the schema in this form.  It should be qapified properly, or
2608 # replaced by a properly qapified command.
2610 # Since: 0.13
2612 { 'command': 'device_add',
2613   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
2614   'gen': false } # so we can get the additional arguments
2617 # @device_del:
2619 # Remove a device from a guest
2621 # @id: the name or QOM path of the device
2623 # Returns: Nothing on success
2624 #          If @id is not a valid device, DeviceNotFound
2626 # Notes: When this command completes, the device may not be removed from the
2627 #        guest.  Hot removal is an operation that requires guest cooperation.
2628 #        This command merely requests that the guest begin the hot removal
2629 #        process.  Completion of the device removal process is signaled with a
2630 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2631 #        for all devices.
2633 # Since: 0.14.0
2635 { 'command': 'device_del', 'data': {'id': 'str'} }
2638 # @DumpGuestMemoryFormat:
2640 # An enumeration of guest-memory-dump's format.
2642 # @elf: elf format
2644 # @kdump-zlib: kdump-compressed format with zlib-compressed
2646 # @kdump-lzo: kdump-compressed format with lzo-compressed
2648 # @kdump-snappy: kdump-compressed format with snappy-compressed
2650 # Since: 2.0
2652 { 'enum': 'DumpGuestMemoryFormat',
2653   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
2656 # @dump-guest-memory:
2658 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2659 # very long depending on the amount of guest memory.
2661 # @paging: if true, do paging to get guest's memory mapping. This allows
2662 #          using gdb to process the core file.
2664 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2665 #                     of RAM. This can happen for a large guest, or a
2666 #                     malicious guest pretending to be large.
2668 #          Also, paging=true has the following limitations:
2670 #             1. The guest may be in a catastrophic state or can have corrupted
2671 #                memory, which cannot be trusted
2672 #             2. The guest can be in real-mode even if paging is enabled. For
2673 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2674 #                goes in real-mode
2675 #             3. Currently only supported on i386 and x86_64.
2677 # @protocol: the filename or file descriptor of the vmcore. The supported
2678 #            protocols are:
2680 #            1. file: the protocol starts with "file:", and the following
2681 #               string is the file's path.
2682 #            2. fd: the protocol starts with "fd:", and the following string
2683 #               is the fd's name.
2685 # @detach: #optional if true, QMP will return immediately rather than
2686 #          waiting for the dump to finish. The user can track progress
2687 #          using "query-dump". (since 2.6).
2689 # @begin: #optional if specified, the starting physical address.
2691 # @length: #optional if specified, the memory size, in bytes. If you don't
2692 #          want to dump all guest's memory, please specify the start @begin
2693 #          and @length
2695 # @format: #optional if specified, the format of guest memory dump. But non-elf
2696 #          format is conflict with paging and filter, ie. @paging, @begin and
2697 #          @length is not allowed to be specified with non-elf @format at the
2698 #          same time (since 2.0)
2700 # Returns: nothing on success
2702 # Since: 1.2
2704 { 'command': 'dump-guest-memory',
2705   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
2706             '*begin': 'int', '*length': 'int',
2707             '*format': 'DumpGuestMemoryFormat'} }
2710 # @DumpStatus:
2712 # Describe the status of a long-running background guest memory dump.
2714 # @none: no dump-guest-memory has started yet.
2716 # @active: there is one dump running in background.
2718 # @completed: the last dump has finished successfully.
2720 # @failed: the last dump has failed.
2722 # Since: 2.6
2724 { 'enum': 'DumpStatus',
2725   'data': [ 'none', 'active', 'completed', 'failed' ] }
2728 # @DumpQueryResult:
2730 # The result format for 'query-dump'.
2732 # @status: enum of @DumpStatus, which shows current dump status
2734 # @completed: bytes written in latest dump (uncompressed)
2736 # @total: total bytes to be written in latest dump (uncompressed)
2738 # Since: 2.6
2740 { 'struct': 'DumpQueryResult',
2741   'data': { 'status': 'DumpStatus',
2742             'completed': 'int',
2743             'total': 'int' } }
2746 # @query-dump:
2748 # Query latest dump status.
2750 # Returns: A @DumpStatus object showing the dump status.
2752 # Since: 2.6
2754 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
2757 # @DumpGuestMemoryCapability:
2759 # A list of the available formats for dump-guest-memory
2761 # Since: 2.0
2763 { 'struct': 'DumpGuestMemoryCapability',
2764   'data': {
2765       'formats': ['DumpGuestMemoryFormat'] } }
2768 # @query-dump-guest-memory-capability:
2770 # Returns the available formats for dump-guest-memory
2772 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
2773 #           dump-guest-memory
2775 # Since: 2.0
2777 { 'command': 'query-dump-guest-memory-capability',
2778   'returns': 'DumpGuestMemoryCapability' }
2781 # @dump-skeys:
2783 # Dump guest's storage keys
2785 # @filename: the path to the file to dump to
2787 # This command is only supported on s390 architecture.
2789 # Since: 2.5
2791 { 'command': 'dump-skeys',
2792   'data': { 'filename': 'str' } }
2795 # @netdev_add:
2797 # Add a network backend.
2799 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2800 #        'vde', 'socket', 'dump' and 'bridge'
2802 # @id: the name of the new network backend
2804 # Additional arguments depend on the type.
2806 # TODO: This command effectively bypasses QAPI completely due to its
2807 # "additional arguments" business.  It shouldn't have been added to
2808 # the schema in this form.  It should be qapified properly, or
2809 # replaced by a properly qapified command.
2811 # Since: 0.14.0
2813 # Returns: Nothing on success
2814 #          If @type is not a valid network backend, DeviceNotFound
2816 { 'command': 'netdev_add',
2817   'data': {'type': 'str', 'id': 'str'},
2818   'gen': false }                # so we can get the additional arguments
2821 # @netdev_del:
2823 # Remove a network backend.
2825 # @id: the name of the network backend to remove
2827 # Returns: Nothing on success
2828 #          If @id is not a valid network backend, DeviceNotFound
2830 # Since: 0.14.0
2832 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2835 # @object-add:
2837 # Create a QOM object.
2839 # @qom-type: the class name for the object to be created
2841 # @id: the name of the new object
2843 # @props: #optional a dictionary of properties to be passed to the backend
2845 # Returns: Nothing on success
2846 #          Error if @qom-type is not a valid class name
2848 # Since: 2.0
2850 { 'command': 'object-add',
2851   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
2854 # @object-del:
2856 # Remove a QOM object.
2858 # @id: the name of the QOM object to remove
2860 # Returns: Nothing on success
2861 #          Error if @id is not a valid id for a QOM object
2863 # Since: 2.0
2865 { 'command': 'object-del', 'data': {'id': 'str'} }
2868 # @NetdevNoneOptions:
2870 # Use it alone to have zero network devices.
2872 # Since: 1.2
2874 { 'struct': 'NetdevNoneOptions',
2875   'data': { } }
2878 # @NetLegacyNicOptions:
2880 # Create a new Network Interface Card.
2882 # @netdev: #optional id of -netdev to connect to
2884 # @macaddr: #optional MAC address
2886 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2888 # @addr: #optional PCI device address
2890 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2892 # Since: 1.2
2894 { 'struct': 'NetLegacyNicOptions',
2895   'data': {
2896     '*netdev':  'str',
2897     '*macaddr': 'str',
2898     '*model':   'str',
2899     '*addr':    'str',
2900     '*vectors': 'uint32' } }
2903 # @String:
2905 # A fat type wrapping 'str', to be embedded in lists.
2907 # Since: 1.2
2909 { 'struct': 'String',
2910   'data': {
2911     'str': 'str' } }
2914 # @NetdevUserOptions:
2916 # Use the user mode network stack which requires no administrator privilege to
2917 # run.
2919 # @hostname: #optional client hostname reported by the builtin DHCP server
2921 # @restrict: #optional isolate the guest from the host
2923 # @ipv4: #optional whether to support IPv4, default true for enabled
2924 #        (since 2.6)
2926 # @ipv6: #optional whether to support IPv6, default true for enabled
2927 #        (since 2.6)
2929 # @ip: #optional legacy parameter, use net= instead
2931 # @net: #optional IP network address that the guest will see, in the
2932 #       form addr[/netmask] The netmask is optional, and can be
2933 #       either in the form a.b.c.d or as a number of valid top-most
2934 #       bits. Default is 10.0.2.0/24.
2936 # @host: #optional guest-visible address of the host
2938 # @tftp: #optional root directory of the built-in TFTP server
2940 # @bootfile: #optional BOOTP filename, for use with tftp=
2942 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2943 #             assign
2945 # @dns: #optional guest-visible address of the virtual nameserver
2947 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2948 #             to the guest
2950 # @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since
2951 #               2.6). The network prefix is given in the usual
2952 #               hexadecimal IPv6 address notation.
2954 # @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64)
2955 #                  (since 2.6)
2957 # @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6)
2959 # @ipv6-dns: #optional guest-visible IPv6 address of the virtual
2960 #            nameserver (since 2.6)
2962 # @smb: #optional root directory of the built-in SMB server
2964 # @smbserver: #optional IP address of the built-in SMB server
2966 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2967 #           endpoints
2969 # @guestfwd: #optional forward guest TCP connections
2971 # Since: 1.2
2973 { 'struct': 'NetdevUserOptions',
2974   'data': {
2975     '*hostname':  'str',
2976     '*restrict':  'bool',
2977     '*ipv4':      'bool',
2978     '*ipv6':      'bool',
2979     '*ip':        'str',
2980     '*net':       'str',
2981     '*host':      'str',
2982     '*tftp':      'str',
2983     '*bootfile':  'str',
2984     '*dhcpstart': 'str',
2985     '*dns':       'str',
2986     '*dnssearch': ['String'],
2987     '*ipv6-prefix':      'str',
2988     '*ipv6-prefixlen':   'int',
2989     '*ipv6-host':        'str',
2990     '*ipv6-dns':         'str',
2991     '*smb':       'str',
2992     '*smbserver': 'str',
2993     '*hostfwd':   ['String'],
2994     '*guestfwd':  ['String'] } }
2997 # @NetdevTapOptions:
2999 # Connect the host TAP network interface name to the VLAN.
3001 # @ifname: #optional interface name
3003 # @fd: #optional file descriptor of an already opened tap
3005 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3006 # tap
3008 # @script: #optional script to initialize the interface
3010 # @downscript: #optional script to shut down the interface
3012 # @br: #optional bridge name (since 2.8)
3014 # @helper: #optional command to execute to configure bridge
3016 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3018 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3020 # @vhost: #optional enable vhost-net network accelerator
3022 # @vhostfd: #optional file descriptor of an already opened vhost net device
3024 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3025 # devices
3027 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3029 # @queues: #optional number of queues to be created for multiqueue capable tap
3031 # @poll-us: #optional maximum number of microseconds that could
3032 # be spent on busy polling for tap (since 2.7)
3034 # Since: 1.2
3036 { 'struct': 'NetdevTapOptions',
3037   'data': {
3038     '*ifname':     'str',
3039     '*fd':         'str',
3040     '*fds':        'str',
3041     '*script':     'str',
3042     '*downscript': 'str',
3043     '*br':         'str',
3044     '*helper':     'str',
3045     '*sndbuf':     'size',
3046     '*vnet_hdr':   'bool',
3047     '*vhost':      'bool',
3048     '*vhostfd':    'str',
3049     '*vhostfds':   'str',
3050     '*vhostforce': 'bool',
3051     '*queues':     'uint32',
3052     '*poll-us':    'uint32'} }
3055 # @NetdevSocketOptions:
3057 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3058 # socket connection.
3060 # @fd: #optional file descriptor of an already opened socket
3062 # @listen: #optional port number, and optional hostname, to listen on
3064 # @connect: #optional port number, and optional hostname, to connect to
3066 # @mcast: #optional UDP multicast address and port number
3068 # @localaddr: #optional source address and port for multicast and udp packets
3070 # @udp: #optional UDP unicast address and port number
3072 # Since: 1.2
3074 { 'struct': 'NetdevSocketOptions',
3075   'data': {
3076     '*fd':        'str',
3077     '*listen':    'str',
3078     '*connect':   'str',
3079     '*mcast':     'str',
3080     '*localaddr': 'str',
3081     '*udp':       'str' } }
3084 # @NetdevL2TPv3Options:
3086 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3088 # @src: source address
3090 # @dst: destination address
3092 # @srcport: #optional source port - mandatory for udp, optional for ip
3094 # @dstport: #optional destination port - mandatory for udp, optional for ip
3096 # @ipv6: #optional - force the use of ipv6
3098 # @udp: #optional - use the udp version of l2tpv3 encapsulation
3100 # @cookie64: #optional - use 64 bit coookies
3102 # @counter: #optional have sequence counter
3104 # @pincounter: #optional pin sequence counter to zero -
3105 #              workaround for buggy implementations or
3106 #              networks with packet reorder
3108 # @txcookie: #optional 32 or 64 bit transmit cookie
3110 # @rxcookie: #optional 32 or 64 bit receive cookie
3112 # @txsession: 32 bit transmit session
3114 # @rxsession: #optional 32 bit receive session - if not specified
3115 #             set to the same value as transmit
3117 # @offset: #optional additional offset - allows the insertion of
3118 #          additional application-specific data before the packet payload
3120 # Since: 2.1
3122 { 'struct': 'NetdevL2TPv3Options',
3123   'data': {
3124     'src':          'str',
3125     'dst':          'str',
3126     '*srcport':     'str',
3127     '*dstport':     'str',
3128     '*ipv6':        'bool',
3129     '*udp':         'bool',
3130     '*cookie64':    'bool',
3131     '*counter':     'bool',
3132     '*pincounter':  'bool',
3133     '*txcookie':    'uint64',
3134     '*rxcookie':    'uint64',
3135     'txsession':    'uint32',
3136     '*rxsession':   'uint32',
3137     '*offset':      'uint32' } }
3140 # @NetdevVdeOptions:
3142 # Connect the VLAN to a vde switch running on the host.
3144 # @sock: #optional socket path
3146 # @port: #optional port number
3148 # @group: #optional group owner of socket
3150 # @mode: #optional permissions for socket
3152 # Since: 1.2
3154 { 'struct': 'NetdevVdeOptions',
3155   'data': {
3156     '*sock':  'str',
3157     '*port':  'uint16',
3158     '*group': 'str',
3159     '*mode':  'uint16' } }
3162 # @NetdevDumpOptions:
3164 # Dump VLAN network traffic to a file.
3166 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3167 # suffixes.
3169 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3171 # Since: 1.2
3173 { 'struct': 'NetdevDumpOptions',
3174   'data': {
3175     '*len':  'size',
3176     '*file': 'str' } }
3179 # @NetdevBridgeOptions:
3181 # Connect a host TAP network interface to a host bridge device.
3183 # @br: #optional bridge name
3185 # @helper: #optional command to execute to configure bridge
3187 # Since: 1.2
3189 { 'struct': 'NetdevBridgeOptions',
3190   'data': {
3191     '*br':     'str',
3192     '*helper': 'str' } }
3195 # @NetdevHubPortOptions:
3197 # Connect two or more net clients through a software hub.
3199 # @hubid: hub identifier number
3201 # Since: 1.2
3203 { 'struct': 'NetdevHubPortOptions',
3204   'data': {
3205     'hubid':     'int32' } }
3208 # @NetdevNetmapOptions:
3210 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3212 # @ifname: Either the name of an existing network interface supported by
3213 #          netmap, or the name of a VALE port (created on the fly).
3214 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3215 #          YYY are non-negative integers. XXX identifies a switch and
3216 #          YYY identifies a port of the switch. VALE ports having the
3217 #          same XXX are therefore connected to the same switch.
3219 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3221 # Since: 2.0
3223 { 'struct': 'NetdevNetmapOptions',
3224   'data': {
3225     'ifname':     'str',
3226     '*devname':    'str' } }
3229 # @NetdevVhostUserOptions:
3231 # Vhost-user network backend
3233 # @chardev: name of a unix socket chardev
3235 # @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false).
3237 # @queues: #optional number of queues to be created for multiqueue vhost-user
3238 #          (default: 1) (Since 2.5)
3240 # Since: 2.1
3242 { 'struct': 'NetdevVhostUserOptions',
3243   'data': {
3244     'chardev':        'str',
3245     '*vhostforce':    'bool',
3246     '*queues':        'int' } }
3249 # @NetClientDriver:
3251 # Available netdev drivers.
3253 # Since: 2.7
3255 { 'enum': 'NetClientDriver',
3256   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
3257             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
3260 # @Netdev:
3262 # Captures the configuration of a network device.
3264 # @id: identifier for monitor commands.
3266 # @type: Specify the driver used for interpreting remaining arguments.
3268 # Since: 1.2
3270 # 'l2tpv3' - since 2.1
3272 { 'union': 'Netdev',
3273   'base': { 'id': 'str', 'type': 'NetClientDriver' },
3274   'discriminator': 'type',
3275   'data': {
3276     'none':     'NetdevNoneOptions',
3277     'nic':      'NetLegacyNicOptions',
3278     'user':     'NetdevUserOptions',
3279     'tap':      'NetdevTapOptions',
3280     'l2tpv3':   'NetdevL2TPv3Options',
3281     'socket':   'NetdevSocketOptions',
3282     'vde':      'NetdevVdeOptions',
3283     'dump':     'NetdevDumpOptions',
3284     'bridge':   'NetdevBridgeOptions',
3285     'hubport':  'NetdevHubPortOptions',
3286     'netmap':   'NetdevNetmapOptions',
3287     'vhost-user': 'NetdevVhostUserOptions' } }
3290 # @NetLegacy:
3292 # Captures the configuration of a network device; legacy.
3294 # @vlan: #optional vlan number
3296 # @id: #optional identifier for monitor commands
3298 # @name: #optional identifier for monitor commands, ignored if @id is present
3300 # @opts: device type specific properties (legacy)
3302 # Since: 1.2
3304 { 'struct': 'NetLegacy',
3305   'data': {
3306     '*vlan': 'int32',
3307     '*id':   'str',
3308     '*name': 'str',
3309     'opts':  'NetLegacyOptions' } }
3312 # @NetLegacyOptions:
3314 # Like Netdev, but for use only by the legacy command line options
3316 # Since: 1.2
3318 { 'union': 'NetLegacyOptions',
3319   'data': {
3320     'none':     'NetdevNoneOptions',
3321     'nic':      'NetLegacyNicOptions',
3322     'user':     'NetdevUserOptions',
3323     'tap':      'NetdevTapOptions',
3324     'l2tpv3':   'NetdevL2TPv3Options',
3325     'socket':   'NetdevSocketOptions',
3326     'vde':      'NetdevVdeOptions',
3327     'dump':     'NetdevDumpOptions',
3328     'bridge':   'NetdevBridgeOptions',
3329     'netmap':   'NetdevNetmapOptions',
3330     'vhost-user': 'NetdevVhostUserOptions' } }
3333 # @NetFilterDirection:
3335 # Indicates whether a netfilter is attached to a netdev's transmit queue or
3336 # receive queue or both.
3338 # @all: the filter is attached both to the receive and the transmit
3339 #       queue of the netdev (default).
3341 # @rx: the filter is attached to the receive queue of the netdev,
3342 #      where it will receive packets sent to the netdev.
3344 # @tx: the filter is attached to the transmit queue of the netdev,
3345 #      where it will receive packets sent by the netdev.
3347 # Since: 2.5
3349 { 'enum': 'NetFilterDirection',
3350   'data': [ 'all', 'rx', 'tx' ] }
3353 # @InetSocketAddress:
3355 # Captures a socket address or address range in the Internet namespace.
3357 # @host: host part of the address
3359 # @port: port part of the address, or lowest port if @to is present
3361 # @to: highest port to try
3363 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3364 #        #optional
3366 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3367 #        #optional
3369 # Since: 1.3
3371 { 'struct': 'InetSocketAddress',
3372   'data': {
3373     'host': 'str',
3374     'port': 'str',
3375     '*to': 'uint16',
3376     '*ipv4': 'bool',
3377     '*ipv6': 'bool' } }
3380 # @UnixSocketAddress:
3382 # Captures a socket address in the local ("Unix socket") namespace.
3384 # @path: filesystem path to use
3386 # Since: 1.3
3388 { 'struct': 'UnixSocketAddress',
3389   'data': {
3390     'path': 'str' } }
3393 # @VsockSocketAddress:
3395 # Captures a socket address in the vsock namespace.
3397 # @cid: unique host identifier
3398 # @port: port
3400 # Note: string types are used to allow for possible future hostname or
3401 # service resolution support.
3403 # Since: 2.8
3405 { 'struct': 'VsockSocketAddress',
3406   'data': {
3407     'cid': 'str',
3408     'port': 'str' } }
3411 # @SocketAddress:
3413 # Captures the address of a socket, which could also be a named file descriptor
3415 # Since: 1.3
3417 { 'union': 'SocketAddress',
3418   'data': {
3419     'inet': 'InetSocketAddress',
3420     'unix': 'UnixSocketAddress',
3421     'vsock': 'VsockSocketAddress',
3422     'fd': 'String' } }
3425 # @getfd:
3427 # Receive a file descriptor via SCM rights and assign it a name
3429 # @fdname: file descriptor name
3431 # Returns: Nothing on success
3433 # Since: 0.14.0
3435 # Notes: If @fdname already exists, the file descriptor assigned to
3436 #        it will be closed and replaced by the received file
3437 #        descriptor.
3438 #        The 'closefd' command can be used to explicitly close the
3439 #        file descriptor when it is no longer needed.
3441 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3444 # @closefd:
3446 # Close a file descriptor previously passed via SCM rights
3448 # @fdname: file descriptor name
3450 # Returns: Nothing on success
3452 # Since: 0.14.0
3454 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3457 # @MachineInfo:
3459 # Information describing a machine.
3461 # @name: the name of the machine
3463 # @alias: #optional an alias for the machine name
3465 # @is-default: #optional whether the machine is default
3467 # @cpu-max: maximum number of CPUs supported by the machine type
3468 #           (since 1.5.0)
3470 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
3472 # Since: 1.2.0
3474 { 'struct': 'MachineInfo',
3475   'data': { 'name': 'str', '*alias': 'str',
3476             '*is-default': 'bool', 'cpu-max': 'int',
3477             'hotpluggable-cpus': 'bool'} }
3480 # @query-machines:
3482 # Return a list of supported machines
3484 # Returns: a list of MachineInfo
3486 # Since: 1.2.0
3488 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3491 # @CpuDefinitionInfo:
3493 # Virtual CPU definition.
3495 # @name: the name of the CPU definition
3497 # @migration-safe: #optional whether a CPU definition can be safely used for
3498 #                  migration in combination with a QEMU compatibility machine
3499 #                  when migrating between different QMU versions and between
3500 #                  hosts with different sets of (hardware or software)
3501 #                  capabilities. If not provided, information is not available
3502 #                  and callers should not assume the CPU definition to be
3503 #                  migration-safe. (since 2.8)
3505 # @static: whether a CPU definition is static and will not change depending on
3506 #          QEMU version, machine type, machine options and accelerator options.
3507 #          A static model is always migration-safe. (since 2.8)
3509 # @unavailable-features: #optional List of properties that prevent
3510 #                        the CPU model from running in the current
3511 #                        host. (since 2.8)
3512 # @typename: Type name that can be used as argument to @device-list-properties,
3513 #            to introspect properties configurable using -cpu or -global.
3514 #            (since 2.9)
3516 # @unavailable-features is a list of QOM property names that
3517 # represent CPU model attributes that prevent the CPU from running.
3518 # If the QOM property is read-only, that means there's no known
3519 # way to make the CPU model run in the current host. Implementations
3520 # that choose not to provide specific information return the
3521 # property name "type".
3522 # If the property is read-write, it means that it MAY be possible
3523 # to run the CPU model in the current host if that property is
3524 # changed. Management software can use it as hints to suggest or
3525 # choose an alternative for the user, or just to generate meaningful
3526 # error messages explaining why the CPU model can't be used.
3527 # If @unavailable-features is an empty list, the CPU model is
3528 # runnable using the current host and machine-type.
3529 # If @unavailable-features is not present, runnability
3530 # information for the CPU is not available.
3532 # Since: 1.2.0
3534 { 'struct': 'CpuDefinitionInfo',
3535   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
3536             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
3539 # @query-cpu-definitions:
3541 # Return a list of supported virtual CPU definitions
3543 # Returns: a list of CpuDefInfo
3545 # Since: 1.2.0
3547 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3550 # @CpuModelInfo:
3552 # Virtual CPU model.
3554 # A CPU model consists of the name of a CPU definition, to which
3555 # delta changes are applied (e.g. features added/removed). Most magic values
3556 # that an architecture might require should be hidden behind the name.
3557 # However, if required, architectures can expose relevant properties.
3559 # @name: the name of the CPU definition the model is based on
3560 # @props: #optional a dictionary of QOM properties to be applied
3562 # Since: 2.8.0
3564 { 'struct': 'CpuModelInfo',
3565   'data': { 'name': 'str',
3566             '*props': 'any' } }
3569 # @CpuModelExpansionType:
3571 # An enumeration of CPU model expansion types.
3573 # @static: Expand to a static CPU model, a combination of a static base
3574 #          model name and property delta changes. As the static base model will
3575 #          never change, the expanded CPU model will be the same, independant of
3576 #          independent of QEMU version, machine type, machine options, and
3577 #          accelerator options. Therefore, the resulting model can be used by
3578 #          tooling without having to specify a compatibility machine - e.g. when
3579 #          displaying the "host" model. static CPU models are migration-safe.
3581 # @full: Expand all properties. The produced model is not guaranteed to be
3582 #        migration-safe, but allows tooling to get an insight and work with
3583 #        model details.
3585 # Since: 2.8.0
3587 { 'enum': 'CpuModelExpansionType',
3588   'data': [ 'static', 'full' ] }
3592 # @CpuModelExpansionInfo:
3594 # The result of a cpu model expansion.
3596 # @model: the expanded CpuModelInfo.
3598 # Since: 2.8.0
3600 { 'struct': 'CpuModelExpansionInfo',
3601   'data': { 'model': 'CpuModelInfo' } }
3605 # @query-cpu-model-expansion:
3607 # Expands a given CPU model (or a combination of CPU model + additional options)
3608 # to different granularities, allowing tooling to get an understanding what a
3609 # specific CPU model looks like in QEMU under a certain configuration.
3611 # This interface can be used to query the "host" CPU model.
3613 # The data returned by this command may be affected by:
3615 # * QEMU version: CPU models may look different depending on the QEMU version.
3616 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3617 # * machine-type: CPU model  may look different depending on the machine-type.
3618 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3619 # * machine options (including accelerator): in some architectures, CPU models
3620 #   may look different depending on machine and accelerator options. (Except for
3621 #   CPU models reported as "static" in query-cpu-definitions.)
3622 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3623 #   global properties may affect expansion of CPU models. Using
3624 #   query-cpu-model-expansion while using these is not advised.
3626 # Some architectures may not support all expansion types. s390x supports
3627 # "full" and "static".
3629 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
3630 #          not supported, if the model cannot be expanded, if the model contains
3631 #          an unknown CPU definition name, unknown properties or properties
3632 #          with a wrong type. Also returns an error if an expansion type is
3633 #          not supported.
3635 # Since: 2.8.0
3637 { 'command': 'query-cpu-model-expansion',
3638   'data': { 'type': 'CpuModelExpansionType',
3639             'model': 'CpuModelInfo' },
3640   'returns': 'CpuModelExpansionInfo' }
3643 # @CpuModelCompareResult:
3645 # An enumeration of CPU model comparation results. The result is usually
3646 # calculated using e.g. CPU features or CPU generations.
3648 # @incompatible: If model A is incompatible to model B, model A is not
3649 #                guaranteed to run where model B runs and the other way around.
3651 # @identical: If model A is identical to model B, model A is guaranteed to run
3652 #             where model B runs and the other way around.
3654 # @superset: If model A is a superset of model B, model B is guaranteed to run
3655 #            where model A runs. There are no guarantees about the other way.
3657 # @subset: If model A is a subset of model B, model A is guaranteed to run
3658 #          where model B runs. There are no guarantees about the other way.
3660 # Since: 2.8.0
3662 { 'enum': 'CpuModelCompareResult',
3663   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
3666 # @CpuModelCompareInfo:
3668 # The result of a CPU model comparison.
3670 # @result: The result of the compare operation.
3671 # @responsible-properties: List of properties that led to the comparison result
3672 #                          not being identical.
3674 # @responsible-properties is a list of QOM property names that led to
3675 # both CPUs not being detected as identical. For identical models, this
3676 # list is empty.
3677 # If a QOM property is read-only, that means there's no known way to make the
3678 # CPU models identical. If the special property name "type" is included, the
3679 # models are by definition not identical and cannot be made identical.
3681 # Since: 2.8.0
3683 { 'struct': 'CpuModelCompareInfo',
3684   'data': {'result': 'CpuModelCompareResult',
3685            'responsible-properties': ['str']
3686           }
3690 # @query-cpu-model-comparison:
3692 # Compares two CPU models, returning how they compare in a specific
3693 # configuration. The results indicates how both models compare regarding
3694 # runnability. This result can be used by tooling to make decisions if a
3695 # certain CPU model will run in a certain configuration or if a compatible
3696 # CPU model has to be created by baselining.
3698 # Usually, a CPU model is compared against the maximum possible CPU model
3699 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
3700 # model is identical or a subset, it will run in that configuration.
3702 # The result returned by this command may be affected by:
3704 # * QEMU version: CPU models may look different depending on the QEMU version.
3705 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3706 # * machine-type: CPU model may look different depending on the machine-type.
3707 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3708 # * machine options (including accelerator): in some architectures, CPU models
3709 #   may look different depending on machine and accelerator options. (Except for
3710 #   CPU models reported as "static" in query-cpu-definitions.)
3711 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3712 #   global properties may affect expansion of CPU models. Using
3713 #   query-cpu-model-expansion while using these is not advised.
3715 # Some architectures may not support comparing CPU models. s390x supports
3716 # comparing CPU models.
3718 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
3719 #          not supported, if a model cannot be used, if a model contains
3720 #          an unknown cpu definition name, unknown properties or properties
3721 #          with wrong types.
3723 # Since: 2.8.0
3725 { 'command': 'query-cpu-model-comparison',
3726   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
3727   'returns': 'CpuModelCompareInfo' }
3730 # @CpuModelBaselineInfo:
3732 # The result of a CPU model baseline.
3734 # @model: the baselined CpuModelInfo.
3736 # Since: 2.8.0
3738 { 'struct': 'CpuModelBaselineInfo',
3739   'data': { 'model': 'CpuModelInfo' } }
3742 # @query-cpu-model-baseline:
3744 # Baseline two CPU models, creating a compatible third model. The created
3745 # model will always be a static, migration-safe CPU model (see "static"
3746 # CPU model expansion for details).
3748 # This interface can be used by tooling to create a compatible CPU model out
3749 # two CPU models. The created CPU model will be identical to or a subset of
3750 # both CPU models when comparing them. Therefore, the created CPU model is
3751 # guaranteed to run where the given CPU models run.
3753 # The result returned by this command may be affected by:
3755 # * QEMU version: CPU models may look different depending on the QEMU version.
3756 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3757 # * machine-type: CPU model may look different depending on the machine-type.
3758 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3759 # * machine options (including accelerator): in some architectures, CPU models
3760 #   may look different depending on machine and accelerator options. (Except for
3761 #   CPU models reported as "static" in query-cpu-definitions.)
3762 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3763 #   global properties may affect expansion of CPU models. Using
3764 #   query-cpu-model-expansion while using these is not advised.
3766 # Some architectures may not support baselining CPU models. s390x supports
3767 # baselining CPU models.
3769 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
3770 #          not supported, if a model cannot be used, if a model contains
3771 #          an unknown cpu definition name, unknown properties or properties
3772 #          with wrong types.
3774 # Since: 2.8.0
3776 { 'command': 'query-cpu-model-baseline',
3777   'data': { 'modela': 'CpuModelInfo',
3778             'modelb': 'CpuModelInfo' },
3779   'returns': 'CpuModelBaselineInfo' }
3782 # @AddfdInfo:
3784 # Information about a file descriptor that was added to an fd set.
3786 # @fdset-id: The ID of the fd set that @fd was added to.
3788 # @fd: The file descriptor that was received via SCM rights and
3789 #      added to the fd set.
3791 # Since: 1.2.0
3793 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3796 # @add-fd:
3798 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3800 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3802 # @opaque: #optional A free-form string that can be used to describe the fd.
3804 # Returns: @AddfdInfo on success
3805 #          If file descriptor was not received, FdNotSupplied
3806 #          If @fdset-id is a negative value, InvalidParameterValue
3808 # Notes: The list of fd sets is shared by all monitor connections.
3810 #        If @fdset-id is not specified, a new fd set will be created.
3812 # Since: 1.2.0
3814 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3815   'returns': 'AddfdInfo' }
3818 # @remove-fd:
3820 # Remove a file descriptor from an fd set.
3822 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3824 # @fd: #optional The file descriptor that is to be removed.
3826 # Returns: Nothing on success
3827 #          If @fdset-id or @fd is not found, FdNotFound
3829 # Since: 1.2.0
3831 # Notes: The list of fd sets is shared by all monitor connections.
3833 #        If @fd is not specified, all file descriptors in @fdset-id
3834 #        will be removed.
3836 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3839 # @FdsetFdInfo:
3841 # Information about a file descriptor that belongs to an fd set.
3843 # @fd: The file descriptor value.
3845 # @opaque: #optional A free-form string that can be used to describe the fd.
3847 # Since: 1.2.0
3849 { 'struct': 'FdsetFdInfo',
3850   'data': {'fd': 'int', '*opaque': 'str'} }
3853 # @FdsetInfo:
3855 # Information about an fd set.
3857 # @fdset-id: The ID of the fd set.
3859 # @fds: A list of file descriptors that belong to this fd set.
3861 # Since: 1.2.0
3863 { 'struct': 'FdsetInfo',
3864   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3867 # @query-fdsets:
3869 # Return information describing all fd sets.
3871 # Returns: A list of @FdsetInfo
3873 # Since: 1.2.0
3875 # Note: The list of fd sets is shared by all monitor connections.
3878 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3881 # @TargetInfo:
3883 # Information describing the QEMU target.
3885 # @arch: the target architecture (eg "x86_64", "i386", etc)
3887 # Since: 1.2.0
3889 { 'struct': 'TargetInfo',
3890   'data': { 'arch': 'str' } }
3893 # @query-target:
3895 # Return information about the target for this QEMU
3897 # Returns: TargetInfo
3899 # Since: 1.2.0
3901 { 'command': 'query-target', 'returns': 'TargetInfo' }
3904 # @QKeyCode:
3906 # An enumeration of key name.
3908 # This is used by the @send-key command.
3910 # @unmapped: since 2.0
3911 # @pause: since 2.0
3912 # @ro: since 2.4
3913 # @kp_comma: since 2.4
3914 # @kp_equals: since 2.6
3915 # @power: since 2.6
3916 # @hiragana: since 2.9
3917 # @henkan: since 2.9
3918 # @yen: since 2.9
3920 # Since: 1.3.0
3923 { 'enum': 'QKeyCode',
3924   'data': [ 'unmapped',
3925             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3926             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3927             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3928             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3929             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3930             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3931             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3932             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3933             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3934             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3935             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3936             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3937             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3938             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3939             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
3940             'ro', 'hiragana', 'henkan', 'yen',
3941             'kp_comma', 'kp_equals', 'power' ] }
3944 # @KeyValue:
3946 # Represents a keyboard key.
3948 # Since: 1.3.0
3950 { 'union': 'KeyValue',
3951   'data': {
3952     'number': 'int',
3953     'qcode': 'QKeyCode' } }
3956 # @send-key:
3958 # Send keys to guest.
3960 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3961 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3962 #        directly to the guest, while @KeyValue.qcode must be a valid
3963 #        @QKeyCode value
3965 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3966 #             to 100
3968 # Returns: Nothing on success
3969 #          If key is unknown or redundant, InvalidParameter
3971 # Since: 1.3.0
3974 { 'command': 'send-key',
3975   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3978 # @screendump:
3980 # Write a PPM of the VGA screen to a file.
3982 # @filename: the path of a new PPM file to store the image
3984 # Returns: Nothing on success
3986 # Since: 0.14.0
3988 { 'command': 'screendump', 'data': {'filename': 'str'} }
3992 # @ChardevCommon:
3994 # Configuration shared across all chardev backends
3996 # @logfile: #optional The name of a logfile to save output
3997 # @logappend: #optional true to append instead of truncate
3998 #             (default to false to truncate)
4000 # Since: 2.6
4002 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4003                                        '*logappend': 'bool' } }
4006 # @ChardevFile:
4008 # Configuration info for file chardevs.
4010 # @in:  #optional The name of the input file
4011 # @out: The name of the output file
4012 # @append: #optional Open the file in append mode (default false to
4013 #          truncate) (Since 2.6)
4015 # Since: 1.4
4017 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4018                                    'out' : 'str',
4019                                    '*append': 'bool' },
4020   'base': 'ChardevCommon' }
4023 # @ChardevHostdev:
4025 # Configuration info for device and pipe chardevs.
4027 # @device: The name of the special file for the device,
4028 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4030 # Since: 1.4
4032 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4033   'base': 'ChardevCommon' }
4036 # @ChardevSocket:
4038 # Configuration info for (stream) socket chardevs.
4040 # @addr: socket address to listen on (server=true)
4041 #        or connect to (server=false)
4042 # @tls-creds: #optional the ID of the TLS credentials object (since 2.6)
4043 # @server: #optional create server socket (default: true)
4044 # @wait: #optional wait for incoming connection on server
4045 #        sockets (default: false).
4046 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
4047 # @telnet: #optional enable telnet protocol on server
4048 #          sockets (default: false)
4049 # @reconnect: #optional For a client socket, if a socket is disconnected,
4050 #          then attempt a reconnect after the given number of seconds.
4051 #          Setting this to zero disables this function. (default: 0)
4052 #          (Since: 2.2)
4054 # Since: 1.4
4056 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddress',
4057                                      '*tls-creds'  : 'str',
4058                                      '*server'    : 'bool',
4059                                      '*wait'      : 'bool',
4060                                      '*nodelay'   : 'bool',
4061                                      '*telnet'    : 'bool',
4062                                      '*reconnect' : 'int' },
4063   'base': 'ChardevCommon' }
4066 # @ChardevUdp:
4068 # Configuration info for datagram socket chardevs.
4070 # @remote: remote address
4071 # @local: #optional local address
4073 # Since: 1.5
4075 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
4076                                   '*local' : 'SocketAddress' },
4077   'base': 'ChardevCommon' }
4080 # @ChardevMux:
4082 # Configuration info for mux chardevs.
4084 # @chardev: name of the base chardev.
4086 # Since: 1.5
4088 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
4089   'base': 'ChardevCommon' }
4092 # @ChardevStdio:
4094 # Configuration info for stdio chardevs.
4096 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
4097 #          be delivered to qemu.  Default: true in -nographic mode,
4098 #          false otherwise.
4100 # Since: 1.5
4102 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
4103   'base': 'ChardevCommon' }
4107 # @ChardevSpiceChannel:
4109 # Configuration info for spice vm channel chardevs.
4111 # @type: kind of channel (for example vdagent).
4113 # Since: 1.5
4115 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
4116   'base': 'ChardevCommon' }
4119 # @ChardevSpicePort:
4121 # Configuration info for spice port chardevs.
4123 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
4125 # Since: 1.5
4127 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
4128   'base': 'ChardevCommon' }
4131 # @ChardevVC:
4133 # Configuration info for virtual console chardevs.
4135 # @width:  console width,  in pixels
4136 # @height: console height, in pixels
4137 # @cols:   console width,  in chars
4138 # @rows:   console height, in chars
4140 # Since: 1.5
4142 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
4143                                  '*height' : 'int',
4144                                  '*cols'   : 'int',
4145                                  '*rows'   : 'int' },
4146   'base': 'ChardevCommon' }
4149 # @ChardevRingbuf:
4151 # Configuration info for ring buffer chardevs.
4153 # @size: #optional ring buffer size, must be power of two, default is 65536
4155 # Since: 1.5
4157 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
4158   'base': 'ChardevCommon' }
4161 # @ChardevBackend:
4163 # Configuration info for the new chardev backend.
4165 # Since: 1.4 (testdev since 2.2)
4167 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
4168                                        'serial' : 'ChardevHostdev',
4169                                        'parallel': 'ChardevHostdev',
4170                                        'pipe'   : 'ChardevHostdev',
4171                                        'socket' : 'ChardevSocket',
4172                                        'udp'    : 'ChardevUdp',
4173                                        'pty'    : 'ChardevCommon',
4174                                        'null'   : 'ChardevCommon',
4175                                        'mux'    : 'ChardevMux',
4176                                        'msmouse': 'ChardevCommon',
4177                                        'braille': 'ChardevCommon',
4178                                        'testdev': 'ChardevCommon',
4179                                        'stdio'  : 'ChardevStdio',
4180                                        'console': 'ChardevCommon',
4181                                        'spicevmc' : 'ChardevSpiceChannel',
4182                                        'spiceport' : 'ChardevSpicePort',
4183                                        'vc'     : 'ChardevVC',
4184                                        'ringbuf': 'ChardevRingbuf',
4185                                        # next one is just for compatibility
4186                                        'memory' : 'ChardevRingbuf' } }
4189 # @ChardevReturn:
4191 # Return info about the chardev backend just created.
4193 # @pty: #optional name of the slave pseudoterminal device, present if
4194 #       and only if a chardev of type 'pty' was created
4196 # Since: 1.4
4198 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
4201 # @chardev-add:
4203 # Add a character device backend
4205 # @id: the chardev's ID, must be unique
4206 # @backend: backend type and parameters
4208 # Returns: ChardevReturn.
4210 # Since: 1.4
4212 { 'command': 'chardev-add', 'data': {'id'      : 'str',
4213                                      'backend' : 'ChardevBackend' },
4214   'returns': 'ChardevReturn' }
4217 # @chardev-remove:
4219 # Remove a character device backend
4221 # @id: the chardev's ID, must exist and not be in use
4223 # Returns: Nothing on success
4225 # Since: 1.4
4227 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
4230 # @TpmModel:
4232 # An enumeration of TPM models
4234 # @tpm-tis: TPM TIS model
4236 # Since: 1.5
4238 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
4241 # @query-tpm-models:
4243 # Return a list of supported TPM models
4245 # Returns: a list of TpmModel
4247 # Since: 1.5
4249 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
4252 # @TpmType:
4254 # An enumeration of TPM types
4256 # @passthrough: TPM passthrough type
4258 # Since: 1.5
4260 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
4263 # @query-tpm-types:
4265 # Return a list of supported TPM types
4267 # Returns: a list of TpmType
4269 # Since: 1.5
4271 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
4274 # @TPMPassthroughOptions:
4276 # Information about the TPM passthrough type
4278 # @path: #optional string describing the path used for accessing the TPM device
4280 # @cancel-path: #optional string showing the TPM's sysfs cancel file
4281 #               for cancellation of TPM commands while they are executing
4283 # Since: 1.5
4285 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
4286                                              '*cancel-path' : 'str'} }
4289 # @TpmTypeOptions:
4291 # A union referencing different TPM backend types' configuration options
4293 # @type: 'passthrough' The configuration options for the TPM passthrough type
4295 # Since: 1.5
4297 { 'union': 'TpmTypeOptions',
4298    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
4301 # @TPMInfo:
4303 # Information about the TPM
4305 # @id: The Id of the TPM
4307 # @model: The TPM frontend model
4309 # @options: The TPM (backend) type configuration options
4311 # Since: 1.5
4313 { 'struct': 'TPMInfo',
4314   'data': {'id': 'str',
4315            'model': 'TpmModel',
4316            'options': 'TpmTypeOptions' } }
4319 # @query-tpm:
4321 # Return information about the TPM device
4323 # Returns: @TPMInfo on success
4325 # Since: 1.5
4327 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
4330 # @AcpiTableOptions:
4332 # Specify an ACPI table on the command line to load.
4334 # At most one of @file and @data can be specified. The list of files specified
4335 # by any one of them is loaded and concatenated in order. If both are omitted,
4336 # @data is implied.
4338 # Other fields / optargs can be used to override fields of the generic ACPI
4339 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
4340 # Description Table Header. If a header field is not overridden, then the
4341 # corresponding value from the concatenated blob is used (in case of @file), or
4342 # it is filled in with a hard-coded value (in case of @data).
4344 # String fields are copied into the matching ACPI member from lowest address
4345 # upwards, and silently truncated / NUL-padded to length.
4347 # @sig: #optional table signature / identifier (4 bytes)
4349 # @rev: #optional table revision number (dependent on signature, 1 byte)
4351 # @oem_id: #optional OEM identifier (6 bytes)
4353 # @oem_table_id: #optional OEM table identifier (8 bytes)
4355 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
4357 # @asl_compiler_id: #optional identifier of the utility that created the table
4358 #                   (4 bytes)
4360 # @asl_compiler_rev: #optional revision number of the utility that created the
4361 #                    table (4 bytes)
4363 # @file: #optional colon (:) separated list of pathnames to load and
4364 #        concatenate as table data. The resultant binary blob is expected to
4365 #        have an ACPI table header. At least one file is required. This field
4366 #        excludes @data.
4368 # @data: #optional colon (:) separated list of pathnames to load and
4369 #        concatenate as table data. The resultant binary blob must not have an
4370 #        ACPI table header. At least one file is required. This field excludes
4371 #        @file.
4373 # Since: 1.5
4375 { 'struct': 'AcpiTableOptions',
4376   'data': {
4377     '*sig':               'str',
4378     '*rev':               'uint8',
4379     '*oem_id':            'str',
4380     '*oem_table_id':      'str',
4381     '*oem_rev':           'uint32',
4382     '*asl_compiler_id':   'str',
4383     '*asl_compiler_rev':  'uint32',
4384     '*file':              'str',
4385     '*data':              'str' }}
4388 # @CommandLineParameterType:
4390 # Possible types for an option parameter.
4392 # @string: accepts a character string
4394 # @boolean: accepts "on" or "off"
4396 # @number: accepts a number
4398 # @size: accepts a number followed by an optional suffix (K)ilo,
4399 #        (M)ega, (G)iga, (T)era
4401 # Since: 1.5
4403 { 'enum': 'CommandLineParameterType',
4404   'data': ['string', 'boolean', 'number', 'size'] }
4407 # @CommandLineParameterInfo:
4409 # Details about a single parameter of a command line option.
4411 # @name: parameter name
4413 # @type: parameter @CommandLineParameterType
4415 # @help: #optional human readable text string, not suitable for parsing.
4417 # @default: #optional default value string (since 2.1)
4419 # Since: 1.5
4421 { 'struct': 'CommandLineParameterInfo',
4422   'data': { 'name': 'str',
4423             'type': 'CommandLineParameterType',
4424             '*help': 'str',
4425             '*default': 'str' } }
4428 # @CommandLineOptionInfo:
4430 # Details about a command line option, including its list of parameter details
4432 # @option: option name
4434 # @parameters: an array of @CommandLineParameterInfo
4436 # Since: 1.5
4438 { 'struct': 'CommandLineOptionInfo',
4439   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4442 # @query-command-line-options:
4444 # Query command line option schema.
4446 # @option: #optional option name
4448 # Returns: list of @CommandLineOptionInfo for all options (or for the given
4449 #          @option).  Returns an error if the given @option doesn't exist.
4451 # Since: 1.5
4453 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
4454  'returns': ['CommandLineOptionInfo'] }
4457 # @X86CPURegister32:
4459 # A X86 32-bit register
4461 # Since: 1.5
4463 { 'enum': 'X86CPURegister32',
4464   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4467 # @X86CPUFeatureWordInfo:
4469 # Information about a X86 CPU feature word
4471 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4473 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4474 #                   feature word
4476 # @cpuid-register: Output register containing the feature bits
4478 # @features: value of output register, containing the feature bits
4480 # Since: 1.5
4482 { 'struct': 'X86CPUFeatureWordInfo',
4483   'data': { 'cpuid-input-eax': 'int',
4484             '*cpuid-input-ecx': 'int',
4485             'cpuid-register': 'X86CPURegister32',
4486             'features': 'int' } }
4489 # @DummyForceArrays:
4491 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
4493 # Since: 2.5
4495 { 'struct': 'DummyForceArrays',
4496   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
4500 # @RxState:
4502 # Packets receiving state
4504 # @normal: filter assigned packets according to the mac-table
4506 # @none: don't receive any assigned packet
4508 # @all: receive all assigned packets
4510 # Since: 1.6
4512 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4515 # @RxFilterInfo:
4517 # Rx-filter information for a NIC.
4519 # @name: net client name
4521 # @promiscuous: whether promiscuous mode is enabled
4523 # @multicast: multicast receive state
4525 # @unicast: unicast receive state
4527 # @vlan: vlan receive state (Since 2.0)
4529 # @broadcast-allowed: whether to receive broadcast
4531 # @multicast-overflow: multicast table is overflowed or not
4533 # @unicast-overflow: unicast table is overflowed or not
4535 # @main-mac: the main macaddr string
4537 # @vlan-table: a list of active vlan id
4539 # @unicast-table: a list of unicast macaddr string
4541 # @multicast-table: a list of multicast macaddr string
4543 # Since: 1.6
4545 { 'struct': 'RxFilterInfo',
4546   'data': {
4547     'name':               'str',
4548     'promiscuous':        'bool',
4549     'multicast':          'RxState',
4550     'unicast':            'RxState',
4551     'vlan':               'RxState',
4552     'broadcast-allowed':  'bool',
4553     'multicast-overflow': 'bool',
4554     'unicast-overflow':   'bool',
4555     'main-mac':           'str',
4556     'vlan-table':         ['int'],
4557     'unicast-table':      ['str'],
4558     'multicast-table':    ['str'] }}
4561 # @query-rx-filter:
4563 # Return rx-filter information for all NICs (or for the given NIC).
4565 # @name: #optional net client name
4567 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4568 #          Returns an error if the given @name doesn't exist, or given
4569 #          NIC doesn't support rx-filter querying, or given net client
4570 #          isn't a NIC.
4572 # Since: 1.6
4574 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4575   'returns': ['RxFilterInfo'] }
4578 # @InputButton:
4580 # Button of a pointer input device (mouse, tablet).
4582 # Since: 2.0
4584 { 'enum'  : 'InputButton',
4585   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down' ] }
4588 # @InputAxis:
4590 # Position axis of a pointer input device (mouse, tablet).
4592 # Since: 2.0
4594 { 'enum'  : 'InputAxis',
4595   'data'  : [ 'x', 'y' ] }
4598 # @InputKeyEvent:
4600 # Keyboard input event.
4602 # @key:    Which key this event is for.
4603 # @down:   True for key-down and false for key-up events.
4605 # Since: 2.0
4607 { 'struct'  : 'InputKeyEvent',
4608   'data'  : { 'key'     : 'KeyValue',
4609               'down'    : 'bool' } }
4612 # @InputBtnEvent:
4614 # Pointer button input event.
4616 # @button: Which button this event is for.
4617 # @down:   True for key-down and false for key-up events.
4619 # Since: 2.0
4621 { 'struct'  : 'InputBtnEvent',
4622   'data'  : { 'button'  : 'InputButton',
4623               'down'    : 'bool' } }
4626 # @InputMoveEvent:
4628 # Pointer motion input event.
4630 # @axis:   Which axis is referenced by @value.
4631 # @value:  Pointer position.  For absolute coordinates the
4632 #          valid range is 0 -> 0x7ffff
4634 # Since: 2.0
4636 { 'struct'  : 'InputMoveEvent',
4637   'data'  : { 'axis'    : 'InputAxis',
4638               'value'   : 'int' } }
4641 # @InputEvent:
4643 # Input event union.
4645 # @type: the input type, one of:
4646 #  - 'key': Input event of Keyboard
4647 #  - 'btn': Input event of pointer buttons
4648 #  - 'rel': Input event of relative pointer motion
4649 #  - 'abs': Input event of absolute pointer motion
4651 # Since: 2.0
4653 { 'union' : 'InputEvent',
4654   'data'  : { 'key'     : 'InputKeyEvent',
4655               'btn'     : 'InputBtnEvent',
4656               'rel'     : 'InputMoveEvent',
4657               'abs'     : 'InputMoveEvent' } }
4660 # @input-send-event:
4662 # Send input event(s) to guest.
4664 # @device: #optional display device to send event(s) to.
4665 # @head: #optional head to send event(s) to, in case the
4666 #        display device supports multiple scanouts.
4667 # @events: List of InputEvent union.
4669 # Returns: Nothing on success.
4671 # The @display and @head parameters can be used to send the input
4672 # event to specific input devices in case (a) multiple input devices
4673 # of the same kind are added to the virtual machine and (b) you have
4674 # configured input routing (see docs/multiseat.txt) for those input
4675 # devices.  The parameters work exactly like the device and head
4676 # properties of input devices.  If @device is missing, only devices
4677 # that have no input routing config are admissible.  If @device is
4678 # specified, both input devices with and without input routing config
4679 # are admissible, but devices with input routing config take
4680 # precedence.
4682 # Since: 2.6
4684 { 'command': 'input-send-event',
4685   'data': { '*device': 'str',
4686             '*head'  : 'int',
4687             'events' : [ 'InputEvent' ] } }
4690 # @NumaOptions:
4692 # A discriminated record of NUMA options. (for OptsVisitor)
4694 # Since: 2.1
4696 { 'union': 'NumaOptions',
4697   'data': {
4698     'node': 'NumaNodeOptions' }}
4701 # @NumaNodeOptions:
4703 # Create a guest NUMA node. (for OptsVisitor)
4705 # @nodeid: #optional NUMA node ID (increase by 1 from 0 if omitted)
4707 # @cpus: #optional VCPUs belonging to this node (assign VCPUS round-robin
4708 #         if omitted)
4710 # @mem: #optional memory size of this node; mutually exclusive with @memdev.
4711 #       Equally divide total memory among nodes if both @mem and @memdev are
4712 #       omitted.
4714 # @memdev: #optional memory backend object.  If specified for one node,
4715 #          it must be specified for all nodes.
4717 # Since: 2.1
4719 { 'struct': 'NumaNodeOptions',
4720   'data': {
4721    '*nodeid': 'uint16',
4722    '*cpus':   ['uint16'],
4723    '*mem':    'size',
4724    '*memdev': 'str' }}
4727 # @HostMemPolicy:
4729 # Host memory policy types
4731 # @default: restore default policy, remove any nondefault policy
4733 # @preferred: set the preferred host nodes for allocation
4735 # @bind: a strict policy that restricts memory allocation to the
4736 #        host nodes specified
4738 # @interleave: memory allocations are interleaved across the set
4739 #              of host nodes specified
4741 # Since: 2.1
4743 { 'enum': 'HostMemPolicy',
4744   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
4747 # @Memdev:
4749 # Information about memory backend
4751 # @id: #optional backend's ID if backend has 'id' property (since 2.9)
4753 # @size: memory backend size
4755 # @merge: enables or disables memory merge support
4757 # @dump: includes memory backend's memory in a core dump or not
4759 # @prealloc: enables or disables memory preallocation
4761 # @host-nodes: host nodes for its memory policy
4763 # @policy: memory policy of memory backend
4765 # Since: 2.1
4767 { 'struct': 'Memdev',
4768   'data': {
4769     '*id':        'str',
4770     'size':       'size',
4771     'merge':      'bool',
4772     'dump':       'bool',
4773     'prealloc':   'bool',
4774     'host-nodes': ['uint16'],
4775     'policy':     'HostMemPolicy' }}
4778 # @query-memdev:
4780 # Returns information for all memory backends.
4782 # Returns: a list of @Memdev.
4784 # Since: 2.1
4786 { 'command': 'query-memdev', 'returns': ['Memdev'] }
4789 # @PCDIMMDeviceInfo:
4791 # PCDIMMDevice state information
4793 # @id: #optional device's ID
4795 # @addr: physical address, where device is mapped
4797 # @size: size of memory that the device provides
4799 # @slot: slot number at which device is plugged in
4801 # @node: NUMA node number where device is plugged in
4803 # @memdev: memory backend linked with device
4805 # @hotplugged: true if device was hotplugged
4807 # @hotpluggable: true if device if could be added/removed while machine is running
4809 # Since: 2.1
4811 { 'struct': 'PCDIMMDeviceInfo',
4812   'data': { '*id': 'str',
4813             'addr': 'int',
4814             'size': 'int',
4815             'slot': 'int',
4816             'node': 'int',
4817             'memdev': 'str',
4818             'hotplugged': 'bool',
4819             'hotpluggable': 'bool'
4820           }
4824 # @MemoryDeviceInfo:
4826 # Union containing information about a memory device
4828 # Since: 2.1
4830 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
4833 # @query-memory-devices:
4835 # Lists available memory devices and their state
4837 # Since: 2.1
4839 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
4842 # @ACPISlotType:
4844 # @DIMM: memory slot
4845 # @CPU: logical CPU slot (since 2.7)
4847 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
4850 # @ACPIOSTInfo:
4852 # OSPM Status Indication for a device
4853 # For description of possible values of @source and @status fields
4854 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
4856 # @device: #optional device ID associated with slot
4858 # @slot: slot ID, unique per slot of a given @slot-type
4860 # @slot-type: type of the slot
4862 # @source: an integer containing the source event
4864 # @status: an integer containing the status code
4866 # Since: 2.1
4868 { 'struct': 'ACPIOSTInfo',
4869   'data'  : { '*device': 'str',
4870               'slot': 'str',
4871               'slot-type': 'ACPISlotType',
4872               'source': 'int',
4873               'status': 'int' } }
4876 # @query-acpi-ospm-status:
4878 # Lists ACPI OSPM status of ACPI device objects,
4879 # which might be reported via _OST method
4881 # Since: 2.1
4883 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
4886 # @WatchdogExpirationAction:
4888 # An enumeration of the actions taken when the watchdog device's timer is
4889 # expired
4891 # @reset: system resets
4893 # @shutdown: system shutdown, note that it is similar to @powerdown, which
4894 #            tries to set to system status and notify guest
4896 # @poweroff: system poweroff, the emulator program exits
4898 # @pause: system pauses, similar to @stop
4900 # @debug: system enters debug state
4902 # @none: nothing is done
4904 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
4905 #              VCPUS on x86) (since 2.4)
4907 # Since: 2.1
4909 { 'enum': 'WatchdogExpirationAction',
4910   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
4911             'inject-nmi' ] }
4914 # @IoOperationType:
4916 # An enumeration of the I/O operation types
4918 # @read: read operation
4920 # @write: write operation
4922 # Since: 2.1
4924 { 'enum': 'IoOperationType',
4925   'data': [ 'read', 'write' ] }
4928 # @GuestPanicAction:
4930 # An enumeration of the actions taken when guest OS panic is detected
4932 # @pause: system pauses
4934 # Since: 2.1 (poweroff since 2.8)
4936 { 'enum': 'GuestPanicAction',
4937   'data': [ 'pause', 'poweroff' ] }
4940 # @rtc-reset-reinjection:
4942 # This command will reset the RTC interrupt reinjection backlog.
4943 # Can be used if another mechanism to synchronize guest time
4944 # is in effect, for example QEMU guest agent's guest-set-time
4945 # command.
4947 # Since: 2.1
4949 { 'command': 'rtc-reset-reinjection' }
4951 # Rocker ethernet network switch
4952 { 'include': 'qapi/rocker.json' }
4955 # @ReplayMode:
4957 # Mode of the replay subsystem.
4959 # @none: normal execution mode. Replay or record are not enabled.
4961 # @record: record mode. All non-deterministic data is written into the
4962 #          replay log.
4964 # @play: replay mode. Non-deterministic data required for system execution
4965 #        is read from the log.
4967 # Since: 2.5
4969 { 'enum': 'ReplayMode',
4970   'data': [ 'none', 'record', 'play' ] }
4973 # @xen-load-devices-state:
4975 # Load the state of all devices from file. The RAM and the block devices
4976 # of the VM are not loaded by this command.
4978 # @filename: the file to load the state of the devices from as binary
4979 # data. See xen-save-devices-state.txt for a description of the binary
4980 # format.
4982 # Since: 2.7
4984 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
4987 # @GICCapability:
4989 # The struct describes capability for a specific GIC (Generic
4990 # Interrupt Controller) version. These bits are not only decided by
4991 # QEMU/KVM software version, but also decided by the hardware that
4992 # the program is running upon.
4994 # @version:  version of GIC to be described. Currently, only 2 and 3
4995 #            are supported.
4997 # @emulated: whether current QEMU/hardware supports emulated GIC
4998 #            device in user space.
5000 # @kernel:   whether current QEMU/hardware supports hardware
5001 #            accelerated GIC device in kernel.
5003 # Since: 2.6
5005 { 'struct': 'GICCapability',
5006   'data': { 'version': 'int',
5007             'emulated': 'bool',
5008             'kernel': 'bool' } }
5011 # @query-gic-capabilities:
5013 # This command is ARM-only. It will return a list of GICCapability
5014 # objects that describe its capability bits.
5016 # Returns: a list of GICCapability objects.
5018 # Since: 2.6
5020 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
5023 # @CpuInstanceProperties:
5025 # List of properties to be used for hotplugging a CPU instance,
5026 # it should be passed by management with device_add command when
5027 # a CPU is being hotplugged.
5029 # @node-id: #optional NUMA node ID the CPU belongs to
5030 # @socket-id: #optional socket number within node/board the CPU belongs to
5031 # @core-id: #optional core number within socket the CPU belongs to
5032 # @thread-id: #optional thread number within core the CPU belongs to
5034 # Note: currently there are 4 properties that could be present
5035 # but management should be prepared to pass through other
5036 # properties with device_add command to allow for future
5037 # interface extension. This also requires the filed names to be kept in
5038 # sync with the properties passed to -device/device_add.
5040 # Since: 2.7
5042 { 'struct': 'CpuInstanceProperties',
5043   'data': { '*node-id': 'int',
5044             '*socket-id': 'int',
5045             '*core-id': 'int',
5046             '*thread-id': 'int'
5047   }
5051 # @HotpluggableCPU:
5053 # @type: CPU object type for usage with device_add command
5054 # @props: list of properties to be used for hotplugging CPU
5055 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
5056 # @qom-path: #optional link to existing CPU object if CPU is present or
5057 #            omitted if CPU is not present.
5059 # Since: 2.7
5061 { 'struct': 'HotpluggableCPU',
5062   'data': { 'type': 'str',
5063             'vcpus-count': 'int',
5064             'props': 'CpuInstanceProperties',
5065             '*qom-path': 'str'
5066           }
5070 # @query-hotpluggable-cpus:
5072 # Returns: a list of HotpluggableCPU objects.
5074 # Since: 2.7
5076 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }