qmp-commands: move 'query-hotpluggable-cpus' doc to schema
[qemu/kevin.git] / qapi-schema.json
blob15dd07b85ed3e74bc79dec001c406a0dd3ee46e0
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 # Example:
1193 # -> { "execute": "query-mice" }
1194 # <- { "return": [
1195 #          {
1196 #             "name":"QEMU Microsoft Mouse",
1197 #             "index":0,
1198 #             "current":false,
1199 #             "absolute":false
1200 #          },
1201 #          {
1202 #             "name":"QEMU PS/2 Mouse",
1203 #             "index":1,
1204 #             "current":true,
1205 #             "absolute":true
1206 #          }
1207 #       ]
1208 #    }
1211 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1214 # @CpuInfoArch:
1216 # An enumeration of cpu types that enable additional information during
1217 # @query-cpus.
1219 # Since: 2.6
1221 { 'enum': 'CpuInfoArch',
1222   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1225 # @CpuInfo:
1227 # Information about a virtual CPU
1229 # @CPU: the index of the virtual CPU
1231 # @current: this only exists for backwards compatibility and should be ignored
1233 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1234 #          to a processor specific low power mode.
1236 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1238 # @thread_id: ID of the underlying host thread
1240 # @arch: architecture of the cpu, which determines which additional fields
1241 #        will be listed (since 2.6)
1243 # Since: 0.14.0
1245 # Notes: @halted is a transient state that changes frequently.  By the time the
1246 #        data is sent to the client, the guest may no longer be halted.
1248 { 'union': 'CpuInfo',
1249   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1250            'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' },
1251   'discriminator': 'arch',
1252   'data': { 'x86': 'CpuInfoX86',
1253             'sparc': 'CpuInfoSPARC',
1254             'ppc': 'CpuInfoPPC',
1255             'mips': 'CpuInfoMIPS',
1256             'tricore': 'CpuInfoTricore',
1257             'other': 'CpuInfoOther' } }
1260 # @CpuInfoX86:
1262 # Additional information about a virtual i386 or x86_64 CPU
1264 # @pc: the 64-bit instruction pointer
1266 # Since: 2.6
1268 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1271 # @CpuInfoSPARC:
1273 # Additional information about a virtual SPARC CPU
1275 # @pc: the PC component of the instruction pointer
1277 # @npc: the NPC component of the instruction pointer
1279 # Since: 2.6
1281 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1284 # @CpuInfoPPC:
1286 # Additional information about a virtual PPC CPU
1288 # @nip: the instruction pointer
1290 # Since: 2.6
1292 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1295 # @CpuInfoMIPS:
1297 # Additional information about a virtual MIPS CPU
1299 # @PC: the instruction pointer
1301 # Since: 2.6
1303 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1306 # @CpuInfoTricore:
1308 # Additional information about a virtual Tricore CPU
1310 # @PC: the instruction pointer
1312 # Since: 2.6
1314 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1317 # @CpuInfoOther:
1319 # No additional information is available about the virtual CPU
1321 # Since: 2.6
1324 { 'struct': 'CpuInfoOther', 'data': { } }
1327 # @query-cpus:
1329 # Returns a list of information about each virtual CPU.
1331 # Returns: a list of @CpuInfo for each virtual CPU
1333 # Since: 0.14.0
1335 # Example:
1337 # -> { "execute": "query-cpus" }
1338 # <- { "return": [
1339 #          {
1340 #             "CPU":0,
1341 #             "current":true,
1342 #             "halted":false,
1343 #             "qom_path":"/machine/unattached/device[0]",
1344 #             "arch":"x86",
1345 #             "pc":3227107138,
1346 #             "thread_id":3134
1347 #          },
1348 #          {
1349 #             "CPU":1,
1350 #             "current":false,
1351 #             "halted":true,
1352 #             "qom_path":"/machine/unattached/device[2]",
1353 #             "arch":"x86",
1354 #             "pc":7108165,
1355 #             "thread_id":3135
1356 #          }
1357 #       ]
1358 #    }
1361 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1364 # @IOThreadInfo:
1366 # Information about an iothread
1368 # @id: the identifier of the iothread
1370 # @thread-id: ID of the underlying host thread
1372 # Since: 2.0
1374 { 'struct': 'IOThreadInfo',
1375   'data': {'id': 'str', 'thread-id': 'int'} }
1378 # @query-iothreads:
1380 # Returns a list of information about each iothread.
1382 # Note: this list excludes the QEMU main loop thread, which is not declared
1383 # using the -object iothread command-line option.  It is always the main thread
1384 # of the process.
1386 # Returns: a list of @IOThreadInfo for each iothread
1388 # Since: 2.0
1390 # Example:
1392 # -> { "execute": "query-iothreads" }
1393 # <- { "return": [
1394 #          {
1395 #             "id":"iothread0",
1396 #             "thread-id":3134
1397 #          },
1398 #          {
1399 #             "id":"iothread1",
1400 #             "thread-id":3135
1401 #          }
1402 #       ]
1403 #    }
1406 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1409 # @NetworkAddressFamily:
1411 # The network address family
1413 # @ipv4: IPV4 family
1415 # @ipv6: IPV6 family
1417 # @unix: unix socket
1419 # @vsock: vsock family (since 2.8)
1421 # @unknown: otherwise
1423 # Since: 2.1
1425 { 'enum': 'NetworkAddressFamily',
1426   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1429 # @VncBasicInfo:
1431 # The basic information for vnc network connection
1433 # @host: IP address
1435 # @service: The service name of the vnc port. This may depend on the host
1436 #           system's service database so symbolic names should not be relied
1437 #           on.
1439 # @family: address family
1441 # @websocket: true in case the socket is a websocket (since 2.3).
1443 # Since: 2.1
1445 { 'struct': 'VncBasicInfo',
1446   'data': { 'host': 'str',
1447             'service': 'str',
1448             'family': 'NetworkAddressFamily',
1449             'websocket': 'bool' } }
1452 # @VncServerInfo:
1454 # The network connection information for server
1456 # @auth: #optional, authentication method
1458 # Since: 2.1
1460 { 'struct': 'VncServerInfo',
1461   'base': 'VncBasicInfo',
1462   'data': { '*auth': 'str' } }
1465 # @VncClientInfo:
1467 # Information about a connected VNC client.
1469 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1470 #              Name of the client.
1472 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1473 #                 used for authentication.
1475 # Since: 0.14.0
1477 { 'struct': 'VncClientInfo',
1478   'base': 'VncBasicInfo',
1479   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1482 # @VncInfo:
1484 # Information about the VNC session.
1486 # @enabled: true if the VNC server is enabled, false otherwise
1488 # @host: #optional The hostname the VNC server is bound to.  This depends on
1489 #        the name resolution on the host and may be an IP address.
1491 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1492 #                    'ipv4' if the host is listening for IPv4 connections
1493 #                    'unix' if the host is listening on a unix domain socket
1494 #                    'unknown' otherwise
1496 # @service: #optional The service name of the server's port.  This may depends
1497 #           on the host system's service database so symbolic names should not
1498 #           be relied on.
1500 # @auth: #optional the current authentication type used by the server
1501 #        'none' if no authentication is being used
1502 #        'vnc' if VNC authentication is being used
1503 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1504 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1505 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1506 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1507 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1508 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1509 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1510 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1511 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1513 # @clients: a list of @VncClientInfo of all currently connected clients
1515 # Since: 0.14.0
1517 { 'struct': 'VncInfo',
1518   'data': {'enabled': 'bool', '*host': 'str',
1519            '*family': 'NetworkAddressFamily',
1520            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1523 # @VncPrimaryAuth:
1525 # vnc primary authentication method.
1527 # Since: 2.3
1529 { 'enum': 'VncPrimaryAuth',
1530   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1531             'tls', 'vencrypt', 'sasl' ] }
1534 # @VncVencryptSubAuth:
1536 # vnc sub authentication method with vencrypt.
1538 # Since: 2.3
1540 { 'enum': 'VncVencryptSubAuth',
1541   'data': [ 'plain',
1542             'tls-none',  'x509-none',
1543             'tls-vnc',   'x509-vnc',
1544             'tls-plain', 'x509-plain',
1545             'tls-sasl',  'x509-sasl' ] }
1548 # @VncInfo2:
1550 # Information about a vnc server
1552 # @id: vnc server name.
1554 # @server: A list of @VncBasincInfo describing all listening sockets.
1555 #          The list can be empty (in case the vnc server is disabled).
1556 #          It also may have multiple entries: normal + websocket,
1557 #          possibly also ipv4 + ipv6 in the future.
1559 # @clients: A list of @VncClientInfo of all currently connected clients.
1560 #           The list can be empty, for obvious reasons.
1562 # @auth: The current authentication type used by the server
1564 # @vencrypt: #optional The vencrypt sub authentication type used by the server,
1565 #            only specified in case auth == vencrypt.
1567 # @display: #optional The display device the vnc server is linked to.
1569 # Since: 2.3
1571 { 'struct': 'VncInfo2',
1572   'data': { 'id'        : 'str',
1573             'server'    : ['VncBasicInfo'],
1574             'clients'   : ['VncClientInfo'],
1575             'auth'      : 'VncPrimaryAuth',
1576             '*vencrypt' : 'VncVencryptSubAuth',
1577             '*display'  : 'str' } }
1580 # @query-vnc:
1582 # Returns information about the current VNC server
1584 # Returns: @VncInfo
1586 # Since: 0.14.0
1588 # Example:
1590 # -> { "execute": "query-vnc" }
1591 # <- { "return": {
1592 #          "enabled":true,
1593 #          "host":"0.0.0.0",
1594 #          "service":"50402",
1595 #          "auth":"vnc",
1596 #          "family":"ipv4",
1597 #          "clients":[
1598 #             {
1599 #                "host":"127.0.0.1",
1600 #                "service":"50401",
1601 #                "family":"ipv4"
1602 #             }
1603 #          ]
1604 #       }
1605 #    }
1608 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1611 # @query-vnc-servers:
1613 # Returns a list of vnc servers.  The list can be empty.
1615 # Returns: a list of @VncInfo2
1617 # Since: 2.3
1619 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1622 # @SpiceBasicInfo:
1624 # The basic information for SPICE network connection
1626 # @host: IP address
1628 # @port: port number
1630 # @family: address family
1632 # Since: 2.1
1634 { 'struct': 'SpiceBasicInfo',
1635   'data': { 'host': 'str',
1636             'port': 'str',
1637             'family': 'NetworkAddressFamily' } }
1640 # @SpiceServerInfo:
1642 # Information about a SPICE server
1644 # @auth: #optional, authentication method
1646 # Since: 2.1
1648 { 'struct': 'SpiceServerInfo',
1649   'base': 'SpiceBasicInfo',
1650   'data': { '*auth': 'str' } }
1653 # @SpiceChannel:
1655 # Information about a SPICE client channel.
1657 # @connection-id: SPICE connection id number.  All channels with the same id
1658 #                 belong to the same SPICE session.
1660 # @channel-type: SPICE channel type number.  "1" is the main control
1661 #                channel, filter for this one if you want to track spice
1662 #                sessions only
1664 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1665 #              multiple channels of the same type exist, such as multiple
1666 #              display channels in a multihead setup
1668 # @tls: true if the channel is encrypted, false otherwise.
1670 # Since: 0.14.0
1672 { 'struct': 'SpiceChannel',
1673   'base': 'SpiceBasicInfo',
1674   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1675            'tls': 'bool'} }
1678 # @SpiceQueryMouseMode:
1680 # An enumeration of Spice mouse states.
1682 # @client: Mouse cursor position is determined by the client.
1684 # @server: Mouse cursor position is determined by the server.
1686 # @unknown: No information is available about mouse mode used by
1687 #           the spice server.
1689 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1691 # Since: 1.1
1693 { 'enum': 'SpiceQueryMouseMode',
1694   'data': [ 'client', 'server', 'unknown' ] }
1697 # @SpiceInfo:
1699 # Information about the SPICE session.
1701 # @enabled: true if the SPICE server is enabled, false otherwise
1703 # @migrated: true if the last guest migration completed and spice
1704 #            migration had completed as well. false otherwise. (since 1.4)
1706 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1707 #        the name resolution on the host and may be an IP address.
1709 # @port: #optional The SPICE server's port number.
1711 # @compiled-version: #optional SPICE server version.
1713 # @tls-port: #optional The SPICE server's TLS port number.
1715 # @auth: #optional the current authentication type used by the server
1716 #        'none'  if no authentication is being used
1717 #        'spice' uses SASL or direct TLS authentication, depending on command
1718 #                line options
1720 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1721 #              be determined by the client or the server, or unknown if spice
1722 #              server doesn't provide this information. (since: 1.1)
1724 # @channels: a list of @SpiceChannel for each active spice channel
1726 # Since: 0.14.0
1728 { 'struct': 'SpiceInfo',
1729   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1730            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1731            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1734 # @query-spice:
1736 # Returns information about the current SPICE server
1738 # Returns: @SpiceInfo
1740 # Since: 0.14.0
1742 # Example:
1744 # -> { "execute": "query-spice" }
1745 # <- { "return": {
1746 #          "enabled": true,
1747 #          "auth": "spice",
1748 #          "port": 5920,
1749 #          "tls-port": 5921,
1750 #          "host": "0.0.0.0",
1751 #          "channels": [
1752 #             {
1753 #                "port": "54924",
1754 #                "family": "ipv4",
1755 #                "channel-type": 1,
1756 #                "connection-id": 1804289383,
1757 #                "host": "127.0.0.1",
1758 #                "channel-id": 0,
1759 #                "tls": true
1760 #             },
1761 #             {
1762 #                "port": "36710",
1763 #                "family": "ipv4",
1764 #                "channel-type": 4,
1765 #                "connection-id": 1804289383,
1766 #                "host": "127.0.0.1",
1767 #                "channel-id": 0,
1768 #                "tls": false
1769 #             },
1770 #             [ ... more channels follow ... ]
1771 #          ]
1772 #       }
1773 #    }
1776 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1779 # @BalloonInfo:
1781 # Information about the guest balloon device.
1783 # @actual: the number of bytes the balloon currently contains
1785 # Since: 0.14.0
1788 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1791 # @query-balloon:
1793 # Return information about the balloon device.
1795 # Returns: @BalloonInfo on success
1797 #          If the balloon driver is enabled but not functional because the KVM
1798 #          kernel module cannot support it, KvmMissingCap
1800 #          If no balloon device is present, DeviceNotActive
1802 # Since: 0.14.0
1804 # Example:
1806 # -> { "execute": "query-balloon" }
1807 # <- { "return": {
1808 #          "actual": 1073741824,
1809 #       }
1810 #    }
1813 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1816 # @PciMemoryRange:
1818 # A PCI device memory region
1820 # @base: the starting address (guest physical)
1822 # @limit: the ending address (guest physical)
1824 # Since: 0.14.0
1826 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1829 # @PciMemoryRegion:
1831 # Information about a PCI device I/O region.
1833 # @bar: the index of the Base Address Register for this region
1835 # @type: 'io' if the region is a PIO region
1836 #        'memory' if the region is a MMIO region
1838 # @size: memory size
1840 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1842 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1844 # Since: 0.14.0
1846 { 'struct': 'PciMemoryRegion',
1847   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1848            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1851 # @PciBusInfo:
1853 # Information about a bus of a PCI Bridge device
1855 # @number: primary bus interface number.  This should be the number of the
1856 #          bus the device resides on.
1858 # @secondary: secondary bus interface number.  This is the number of the
1859 #             main bus for the bridge
1861 # @subordinate: This is the highest number bus that resides below the
1862 #               bridge.
1864 # @io_range: The PIO range for all devices on this bridge
1866 # @memory_range: The MMIO range for all devices on this bridge
1868 # @prefetchable_range: The range of prefetchable MMIO for all devices on
1869 #                      this bridge
1871 # Since: 2.4
1873 { 'struct': 'PciBusInfo',
1874   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1875            'io_range': 'PciMemoryRange',
1876            'memory_range': 'PciMemoryRange',
1877            'prefetchable_range': 'PciMemoryRange' } }
1880 # @PciBridgeInfo:
1882 # Information about a PCI Bridge device
1884 # @bus: information about the bus the device resides on
1886 # @devices: a list of @PciDeviceInfo for each device on this bridge
1888 # Since: 0.14.0
1890 { 'struct': 'PciBridgeInfo',
1891   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
1894 # @PciDeviceClass:
1896 # Information about the Class of a PCI device
1898 # @desc: #optional a string description of the device's class
1900 # @class: the class code of the device
1902 # Since: 2.4
1904 { 'struct': 'PciDeviceClass',
1905   'data': {'*desc': 'str', 'class': 'int'} }
1908 # @PciDeviceId:
1910 # Information about the Id of a PCI device
1912 # @device: the PCI device id
1914 # @vendor: the PCI vendor id
1916 # Since: 2.4
1918 { 'struct': 'PciDeviceId',
1919   'data': {'device': 'int', 'vendor': 'int'} }
1922 # @PciDeviceInfo:
1924 # Information about a PCI device
1926 # @bus: the bus number of the device
1928 # @slot: the slot the device is located in
1930 # @function: the function of the slot used by the device
1932 # @class_info: the class of the device
1934 # @id: the PCI device id
1936 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1938 # @qdev_id: the device name of the PCI device
1940 # @pci_bridge: if the device is a PCI bridge, the bridge information
1942 # @regions: a list of the PCI I/O regions associated with the device
1944 # Notes: the contents of @class_info.desc are not stable and should only be
1945 #        treated as informational.
1947 # Since: 0.14.0
1949 { 'struct': 'PciDeviceInfo',
1950   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1951            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
1952            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1953            'regions': ['PciMemoryRegion']} }
1956 # @PciInfo:
1958 # Information about a PCI bus
1960 # @bus: the bus index
1962 # @devices: a list of devices on this bus
1964 # Since: 0.14.0
1966 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1969 # @query-pci:
1971 # Return information about the PCI bus topology of the guest.
1973 # Returns: a list of @PciInfo for each PCI bus. Each bus is
1974 # represented by a json-object, which has a key with a json-array of
1975 # all PCI devices attached to it. Each device is represented by a
1976 # json-object.
1978 # Since: 0.14.0
1980 # Example:
1982 # -> { "execute": "query-pci" }
1983 # <- { "return": [
1984 #          {
1985 #             "bus": 0,
1986 #             "devices": [
1987 #                {
1988 #                   "bus": 0,
1989 #                   "qdev_id": "",
1990 #                   "slot": 0,
1991 #                   "class_info": {
1992 #                      "class": 1536,
1993 #                      "desc": "Host bridge"
1994 #                   },
1995 #                   "id": {
1996 #                      "device": 32902,
1997 #                      "vendor": 4663
1998 #                   },
1999 #                   "function": 0,
2000 #                   "regions": [
2001 #                   ]
2002 #                },
2003 #                {
2004 #                   "bus": 0,
2005 #                   "qdev_id": "",
2006 #                   "slot": 1,
2007 #                   "class_info": {
2008 #                      "class": 1537,
2009 #                      "desc": "ISA bridge"
2010 #                   },
2011 #                   "id": {
2012 #                      "device": 32902,
2013 #                      "vendor": 28672
2014 #                   },
2015 #                   "function": 0,
2016 #                   "regions": [
2017 #                   ]
2018 #                },
2019 #                {
2020 #                   "bus": 0,
2021 #                   "qdev_id": "",
2022 #                   "slot": 1,
2023 #                   "class_info": {
2024 #                      "class": 257,
2025 #                      "desc": "IDE controller"
2026 #                   },
2027 #                   "id": {
2028 #                      "device": 32902,
2029 #                      "vendor": 28688
2030 #                   },
2031 #                   "function": 1,
2032 #                   "regions": [
2033 #                      {
2034 #                         "bar": 4,
2035 #                         "size": 16,
2036 #                         "address": 49152,
2037 #                         "type": "io"
2038 #                      }
2039 #                   ]
2040 #                },
2041 #                {
2042 #                   "bus": 0,
2043 #                   "qdev_id": "",
2044 #                   "slot": 2,
2045 #                   "class_info": {
2046 #                      "class": 768,
2047 #                      "desc": "VGA controller"
2048 #                   },
2049 #                   "id": {
2050 #                      "device": 4115,
2051 #                      "vendor": 184
2052 #                   },
2053 #                   "function": 0,
2054 #                   "regions": [
2055 #                      {
2056 #                         "prefetch": true,
2057 #                         "mem_type_64": false,
2058 #                         "bar": 0,
2059 #                         "size": 33554432,
2060 #                         "address": 4026531840,
2061 #                         "type": "memory"
2062 #                      },
2063 #                      {
2064 #                         "prefetch": false,
2065 #                         "mem_type_64": false,
2066 #                         "bar": 1,
2067 #                         "size": 4096,
2068 #                         "address": 4060086272,
2069 #                         "type": "memory"
2070 #                      },
2071 #                      {
2072 #                         "prefetch": false,
2073 #                         "mem_type_64": false,
2074 #                         "bar": 6,
2075 #                         "size": 65536,
2076 #                         "address": -1,
2077 #                         "type": "memory"
2078 #                      }
2079 #                   ]
2080 #                },
2081 #                {
2082 #                   "bus": 0,
2083 #                   "qdev_id": "",
2084 #                   "irq": 11,
2085 #                   "slot": 4,
2086 #                   "class_info": {
2087 #                      "class": 1280,
2088 #                      "desc": "RAM controller"
2089 #                   },
2090 #                   "id": {
2091 #                      "device": 6900,
2092 #                      "vendor": 4098
2093 #                   },
2094 #                   "function": 0,
2095 #                   "regions": [
2096 #                      {
2097 #                         "bar": 0,
2098 #                         "size": 32,
2099 #                         "address": 49280,
2100 #                         "type": "io"
2101 #                      }
2102 #                   ]
2103 #                }
2104 #             ]
2105 #          }
2106 #       ]
2107 #    }
2109 # Note: This example has been shortened as the real response is too long.
2112 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2115 # @quit:
2117 # This command will cause the QEMU process to exit gracefully.  While every
2118 # attempt is made to send the QMP response before terminating, this is not
2119 # guaranteed.  When using this interface, a premature EOF would not be
2120 # unexpected.
2122 # Since: 0.14.0
2124 # Example:
2126 # -> { "execute": "quit" }
2127 # <- { "return": {} }
2129 { 'command': 'quit' }
2132 # @stop:
2134 # Stop all guest VCPU execution.
2136 # Since:  0.14.0
2138 # Notes:  This function will succeed even if the guest is already in the stopped
2139 #         state.  In "inmigrate" state, it will ensure that the guest
2140 #         remains paused once migration finishes, as if the -S option was
2141 #         passed on the command line.
2143 # Example:
2145 # -> { "execute": "stop" }
2146 # <- { "return": {} }
2149 { 'command': 'stop' }
2152 # @system_reset:
2154 # Performs a hard reset of a guest.
2156 # Since: 0.14.0
2158 # Example:
2160 # -> { "execute": "system_reset" }
2161 # <- { "return": {} }
2164 { 'command': 'system_reset' }
2167 # @system_powerdown:
2169 # Requests that a guest perform a powerdown operation.
2171 # Since: 0.14.0
2173 # Notes: A guest may or may not respond to this command.  This command
2174 #        returning does not indicate that a guest has accepted the request or
2175 #        that it has shut down.  Many guests will respond to this command by
2176 #        prompting the user in some way.
2177 # Example:
2179 # -> { "execute": "system_powerdown" }
2180 # <- { "return": {} }
2183 { 'command': 'system_powerdown' }
2186 # @cpu:
2188 # This command is a nop that is only provided for the purposes of compatibility.
2190 # Since: 0.14.0
2192 # Notes: Do not use this command.
2194 { 'command': 'cpu', 'data': {'index': 'int'} }
2197 # @cpu-add:
2199 # Adds CPU with specified ID
2201 # @id: ID of CPU to be created, valid values [0..max_cpus)
2203 # Returns: Nothing on success
2205 # Since: 1.5
2207 # Example:
2209 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2210 # <- { "return": {} }
2213 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2216 # @memsave:
2218 # Save a portion of guest memory to a file.
2220 # @val: the virtual address of the guest to start from
2222 # @size: the size of memory region to save
2224 # @filename: the file to save the memory to as binary data
2226 # @cpu-index: #optional the index of the virtual CPU to use for translating the
2227 #                       virtual address (defaults to CPU 0)
2229 # Returns: Nothing on success
2231 # Since: 0.14.0
2233 # Notes: Errors were not reliably returned until 1.1
2235 # Example:
2237 # -> { "execute": "memsave",
2238 #      "arguments": { "val": 10,
2239 #                     "size": 100,
2240 #                     "filename": "/tmp/virtual-mem-dump" } }
2241 # <- { "return": {} }
2244 { 'command': 'memsave',
2245   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2248 # @pmemsave:
2250 # Save a portion of guest physical memory to a file.
2252 # @val: the physical address of the guest to start from
2254 # @size: the size of memory region to save
2256 # @filename: the file to save the memory to as binary data
2258 # Returns: Nothing on success
2260 # Since: 0.14.0
2262 # Notes: Errors were not reliably returned until 1.1
2264 # Example:
2266 # -> { "execute": "pmemsave",
2267 #      "arguments": { "val": 10,
2268 #                     "size": 100,
2269 #                     "filename": "/tmp/physical-mem-dump" } }
2270 # <- { "return": {} }
2273 { 'command': 'pmemsave',
2274   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2277 # @cont:
2279 # Resume guest VCPU execution.
2281 # Since:  0.14.0
2283 # Returns:  If successful, nothing
2284 #           If QEMU was started with an encrypted block device and a key has
2285 #              not yet been set, DeviceEncrypted.
2287 # Notes:  This command will succeed if the guest is currently running.  It
2288 #         will also succeed if the guest is in the "inmigrate" state; in
2289 #         this case, the effect of the command is to make sure the guest
2290 #         starts once migration finishes, removing the effect of the -S
2291 #         command line option if it was passed.
2293 # Example:
2295 # -> { "execute": "cont" }
2296 # <- { "return": {} }
2299 { 'command': 'cont' }
2302 # @system_wakeup:
2304 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2306 # Since:  1.1
2308 # Returns:  nothing.
2310 # Example:
2312 # -> { "execute": "system_wakeup" }
2313 # <- { "return": {} }
2316 { 'command': 'system_wakeup' }
2319 # @inject-nmi:
2321 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2322 # The command fails when the guest doesn't support injecting.
2324 # Returns:  If successful, nothing
2326 # Since:  0.14.0
2328 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2330 # Example:
2332 # -> { "execute": "inject-nmi" }
2333 # <- { "return": {} }
2336 { 'command': 'inject-nmi' }
2339 # @set_link:
2341 # Sets the link status of a virtual network adapter.
2343 # @name: the device name of the virtual network adapter
2345 # @up: true to set the link status to be up
2347 # Returns: Nothing on success
2348 #          If @name is not a valid network device, DeviceNotFound
2350 # Since: 0.14.0
2352 # Notes: Not all network adapters support setting link status.  This command
2353 #        will succeed even if the network adapter does not support link status
2354 #        notification.
2356 # Example:
2358 # -> { "execute": "set_link",
2359 #      "arguments": { "name": "e1000.0", "up": false } }
2360 # <- { "return": {} }
2363 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2366 # @balloon:
2368 # Request the balloon driver to change its balloon size.
2370 # @value: the target size of the balloon in bytes
2372 # Returns: Nothing on success
2373 #          If the balloon driver is enabled but not functional because the KVM
2374 #            kernel module cannot support it, KvmMissingCap
2375 #          If no balloon device is present, DeviceNotActive
2377 # Notes: This command just issues a request to the guest.  When it returns,
2378 #        the balloon size may not have changed.  A guest can change the balloon
2379 #        size independent of this command.
2381 # Since: 0.14.0
2383 # Example:
2385 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2386 # <- { "return": {} }
2389 { 'command': 'balloon', 'data': {'value': 'int'} }
2392 # @Abort:
2394 # This action can be used to test transaction failure.
2396 # Since: 1.6
2398 { 'struct': 'Abort',
2399   'data': { } }
2402 # @ActionCompletionMode:
2404 # An enumeration of Transactional completion modes.
2406 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2407 #              after the Transaction request succeeds. All Actions that
2408 #              can complete successfully will do so without waiting on others.
2409 #              This is the default.
2411 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2412 #           Actions. Actions do not complete until all Actions are ready to
2413 #           complete. May be rejected by Actions that do not support this
2414 #           completion mode.
2416 # Since: 2.5
2418 { 'enum': 'ActionCompletionMode',
2419   'data': [ 'individual', 'grouped' ] }
2422 # @TransactionAction:
2424 # A discriminated record of operations that can be performed with
2425 # @transaction. Action @type can be:
2427 # - @abort: since 1.6
2428 # - @block-dirty-bitmap-add: since 2.5
2429 # - @block-dirty-bitmap-clear: since 2.5
2430 # - @blockdev-backup: since 2.3
2431 # - @blockdev-snapshot: since 2.5
2432 # - @blockdev-snapshot-internal-sync: since 1.7
2433 # - @blockdev-snapshot-sync: since 1.1
2434 # - @drive-backup: since 1.6
2436 # Since: 1.1
2438 { 'union': 'TransactionAction',
2439   'data': {
2440        'abort': 'Abort',
2441        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2442        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2443        'blockdev-backup': 'BlockdevBackup',
2444        'blockdev-snapshot': 'BlockdevSnapshot',
2445        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2446        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2447        'drive-backup': 'DriveBackup'
2448    } }
2451 # @TransactionProperties:
2453 # Optional arguments to modify the behavior of a Transaction.
2455 # @completion-mode: #optional Controls how jobs launched asynchronously by
2456 #                   Actions will complete or fail as a group.
2457 #                   See @ActionCompletionMode for details.
2459 # Since: 2.5
2461 { 'struct': 'TransactionProperties',
2462   'data': {
2463        '*completion-mode': 'ActionCompletionMode'
2464   }
2468 # @transaction:
2470 # Executes a number of transactionable QMP commands atomically. If any
2471 # operation fails, then the entire set of actions will be abandoned and the
2472 # appropriate error returned.
2474 # For external snapshots, the dictionary contains the device, the file to use for
2475 # the new snapshot, and the format.  The default format, if not specified, is
2476 # qcow2.
2478 # Each new snapshot defaults to being created by QEMU (wiping any
2479 # contents if the file already exists), but it is also possible to reuse
2480 # an externally-created file.  In the latter case, you should ensure that
2481 # the new image file has the same contents as the current one; QEMU cannot
2482 # perform any meaningful check.  Typically this is achieved by using the
2483 # current image file as the backing file for the new image.
2485 # On failure, the original disks pre-snapshot attempt will be used.
2487 # For internal snapshots, the dictionary contains the device and the snapshot's
2488 # name.  If an internal snapshot matching name already exists, the request will
2489 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2490 # and sheepdog.
2492 # On failure, qemu will try delete the newly created internal snapshot in the
2493 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2494 # it later with qemu-img or other command.
2496 # @actions: List of @TransactionAction;
2497 #           information needed for the respective operations.
2499 # @properties: #optional structure of additional options to control the
2500 #              execution of the transaction. See @TransactionProperties
2501 #              for additional detail.
2503 # Returns: nothing on success
2505 #          Errors depend on the operations of the transaction
2507 # Note: The transaction aborts on the first failure.  Therefore, there will be
2508 # information on only one failed operation returned in an error condition, and
2509 # subsequent actions will not have been attempted.
2511 # Since: 1.1
2513 # Example:
2515 # -> { "execute": "transaction",
2516 #      "arguments": { "actions": [
2517 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2518 #                                      "snapshot-file": "/some/place/my-image",
2519 #                                      "format": "qcow2" } },
2520 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2521 #                                      "snapshot-file": "/some/place/my-image2",
2522 #                                      "snapshot-node-name": "node3432",
2523 #                                      "mode": "existing",
2524 #                                      "format": "qcow2" } },
2525 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2526 #                                      "snapshot-file": "/some/place/my-image2",
2527 #                                      "mode": "existing",
2528 #                                      "format": "qcow2" } },
2529 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2530 #                                      "device": "ide-hd2",
2531 #                                      "name": "snapshot0" } } ] } }
2532 # <- { "return": {} }
2535 { 'command': 'transaction',
2536   'data': { 'actions': [ 'TransactionAction' ],
2537             '*properties': 'TransactionProperties'
2538           }
2542 # @human-monitor-command:
2544 # Execute a command on the human monitor and return the output.
2546 # @command-line: the command to execute in the human monitor
2548 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2550 # Returns: the output of the command as a string
2552 # Since: 0.14.0
2554 # Notes: This command only exists as a stop-gap.  Its use is highly
2555 #        discouraged.  The semantics of this command are not
2556 #        guaranteed: this means that command names, arguments and
2557 #        responses can change or be removed at ANY time.  Applications
2558 #        that rely on long term stability guarantees should NOT
2559 #        use this command.
2561 #        Known limitations:
2563 #        * This command is stateless, this means that commands that depend
2564 #          on state information (such as getfd) might not work
2566 #        * Commands that prompt the user for data (eg. 'cont' when the block
2567 #          device is encrypted) don't currently work
2569 # Example:
2571 # -> { "execute": "human-monitor-command",
2572 #      "arguments": { "command-line": "info kvm" } }
2573 # <- { "return": "kvm support: enabled\r\n" }
2576 { 'command': 'human-monitor-command',
2577   'data': {'command-line': 'str', '*cpu-index': 'int'},
2578   'returns': 'str' }
2581 # @migrate_cancel:
2583 # Cancel the current executing migration process.
2585 # Returns: nothing on success
2587 # Notes: This command succeeds even if there is no migration process running.
2589 # Since: 0.14.0
2591 # Example:
2593 # -> { "execute": "migrate_cancel" }
2594 # <- { "return": {} }
2597 { 'command': 'migrate_cancel' }
2600 # @migrate_set_downtime:
2602 # Set maximum tolerated downtime for migration.
2604 # @value: maximum downtime in seconds
2606 # Returns: nothing on success
2608 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2610 # Since: 0.14.0
2612 # Example:
2614 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2615 # <- { "return": {} }
2618 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2621 # @migrate_set_speed:
2623 # Set maximum speed for migration.
2625 # @value: maximum speed in bytes per second.
2627 # Returns: nothing on success
2629 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2631 # Since: 0.14.0
2633 # Example:
2635 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2636 # <- { "return": {} }
2639 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2642 # @migrate-set-cache-size:
2644 # Set XBZRLE cache size
2646 # @value: cache size in bytes
2648 # The size will be rounded down to the nearest power of 2.
2649 # The cache size can be modified before and during ongoing migration
2651 # Returns: nothing on success
2653 # Since: 1.2
2655 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2658 # @query-migrate-cache-size:
2660 # Query migration XBZRLE cache size
2662 # Returns: XBZRLE cache size in bytes
2664 # Since: 1.2
2666 # Example:
2668 # -> { "execute": "query-migrate-cache-size" }
2669 # <- { "return": 67108864 }
2672 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2675 # @ObjectPropertyInfo:
2677 # @name: the name of the property
2679 # @type: the type of the property.  This will typically come in one of four
2680 #        forms:
2682 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2683 #           These types are mapped to the appropriate JSON type.
2685 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2686 #           device type name.  Child properties create the composition tree.
2688 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2689 #           device type name.  Link properties form the device model graph.
2691 # Since: 1.2
2693 { 'struct': 'ObjectPropertyInfo',
2694   'data': { 'name': 'str', 'type': 'str' } }
2697 # @qom-list:
2699 # This command will list any properties of a object given a path in the object
2700 # model.
2702 # @path: the path within the object model.  See @qom-get for a description of
2703 #        this parameter.
2705 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2706 #          object.
2708 # Since: 1.2
2710 { 'command': 'qom-list',
2711   'data': { 'path': 'str' },
2712   'returns': [ 'ObjectPropertyInfo' ] }
2715 # @qom-get:
2717 # This command will get a property from a object model path and return the
2718 # value.
2720 # @path: The path within the object model.  There are two forms of supported
2721 #        paths--absolute and partial paths.
2723 #        Absolute paths are derived from the root object and can follow child<>
2724 #        or link<> properties.  Since they can follow link<> properties, they
2725 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2726 #        and are prefixed  with a leading slash.
2728 #        Partial paths look like relative filenames.  They do not begin
2729 #        with a prefix.  The matching rules for partial paths are subtle but
2730 #        designed to make specifying objects easy.  At each level of the
2731 #        composition tree, the partial path is matched as an absolute path.
2732 #        The first match is not returned.  At least two matches are searched
2733 #        for.  A successful result is only returned if only one match is
2734 #        found.  If more than one match is found, a flag is return to
2735 #        indicate that the match was ambiguous.
2737 # @property: The property name to read
2739 # Returns: The property value.  The type depends on the property
2740 #          type. child<> and link<> properties are returned as #str
2741 #          pathnames.  All integer property types (u8, u16, etc) are
2742 #          returned as #int.
2744 # Since: 1.2
2746 { 'command': 'qom-get',
2747   'data': { 'path': 'str', 'property': 'str' },
2748   'returns': 'any' }
2751 # @qom-set:
2753 # This command will set a property from a object model path.
2755 # @path: see @qom-get for a description of this parameter
2757 # @property: the property name to set
2759 # @value: a value who's type is appropriate for the property type.  See @qom-get
2760 #         for a description of type mapping.
2762 # Since: 1.2
2764 { 'command': 'qom-set',
2765   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2768 # @set_password:
2770 # Sets the password of a remote display session.
2772 # @protocol: `vnc' to modify the VNC server password
2773 #            `spice' to modify the Spice server password
2775 # @password: the new password
2777 # @connected: #optional how to handle existing clients when changing the
2778 #                       password.  If nothing is specified, defaults to `keep'
2779 #                       `fail' to fail the command if clients are connected
2780 #                       `disconnect' to disconnect existing clients
2781 #                       `keep' to maintain existing clients
2783 # Returns: Nothing on success
2784 #          If Spice is not enabled, DeviceNotFound
2786 # Since: 0.14.0
2788 # Example:
2790 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2791 #                                                "password": "secret" } }
2792 # <- { "return": {} }
2795 { 'command': 'set_password',
2796   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2799 # @expire_password:
2801 # Expire the password of a remote display server.
2803 # @protocol: the name of the remote display protocol `vnc' or `spice'
2805 # @time: when to expire the password.
2806 #        `now' to expire the password immediately
2807 #        `never' to cancel password expiration
2808 #        `+INT' where INT is the number of seconds from now (integer)
2809 #        `INT' where INT is the absolute time in seconds
2811 # Returns: Nothing on success
2812 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2814 # Since: 0.14.0
2816 # Notes: Time is relative to the server and currently there is no way to
2817 #        coordinate server time with client time.  It is not recommended to
2818 #        use the absolute time version of the @time parameter unless you're
2819 #        sure you are on the same machine as the QEMU instance.
2821 # Example:
2823 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2824 #                                                   "time": "+60" } }
2825 # <- { "return": {} }
2828 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2831 # @change-vnc-password:
2833 # Change the VNC server password.
2835 # @password:  the new password to use with VNC authentication
2837 # Since: 1.1
2839 # Notes:  An empty password in this command will set the password to the empty
2840 #         string.  Existing clients are unaffected by executing this command.
2842 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2845 # @change:
2847 # This command is multiple commands multiplexed together.
2849 # @device: This is normally the name of a block device but it may also be 'vnc'.
2850 #          when it's 'vnc', then sub command depends on @target
2852 # @target: If @device is a block device, then this is the new filename.
2853 #          If @device is 'vnc', then if the value 'password' selects the vnc
2854 #          change password command.   Otherwise, this specifies a new server URI
2855 #          address to listen to for VNC connections.
2857 # @arg:    If @device is a block device, then this is an optional format to open
2858 #          the device with.
2859 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2860 #          password to set.  If this argument is an empty string, then no future
2861 #          logins will be allowed.
2863 # Returns: Nothing on success.
2864 #          If @device is not a valid block device, DeviceNotFound
2865 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2866 #          if this error is returned, the device has been opened successfully
2867 #          and an additional call to @block_passwd is required to set the
2868 #          device's password.  The behavior of reads and writes to the block
2869 #          device between when these calls are executed is undefined.
2871 # Notes:  This interface is deprecated, and it is strongly recommended that you
2872 #         avoid using it.  For changing block devices, use
2873 #         blockdev-change-medium; for changing VNC parameters, use
2874 #         change-vnc-password.
2876 # Since: 0.14.0
2878 # Example:
2880 # 1. Change a removable medium
2882 # -> { "execute": "change",
2883 #      "arguments": { "device": "ide1-cd0",
2884 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
2885 # <- { "return": {} }
2887 # 2. Change VNC password
2889 # -> { "execute": "change",
2890 #      "arguments": { "device": "vnc", "target": "password",
2891 #                     "arg": "foobar1" } }
2892 # <- { "return": {} }
2895 { 'command': 'change',
2896   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2899 # @ObjectTypeInfo:
2901 # This structure describes a search result from @qom-list-types
2903 # @name: the type name found in the search
2905 # Since: 1.1
2907 # Notes: This command is experimental and may change syntax in future releases.
2909 { 'struct': 'ObjectTypeInfo',
2910   'data': { 'name': 'str' } }
2913 # @qom-list-types:
2915 # This command will return a list of types given search parameters
2917 # @implements: if specified, only return types that implement this type name
2919 # @abstract: if true, include abstract types in the results
2921 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2923 # Since: 1.1
2925 { 'command': 'qom-list-types',
2926   'data': { '*implements': 'str', '*abstract': 'bool' },
2927   'returns': [ 'ObjectTypeInfo' ] }
2930 # @DevicePropertyInfo:
2932 # Information about device properties.
2934 # @name: the name of the property
2935 # @type: the typename of the property
2936 # @description: #optional if specified, the description of the property.
2937 #               (since 2.2)
2939 # Since: 1.2
2941 { 'struct': 'DevicePropertyInfo',
2942   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
2945 # @device-list-properties:
2947 # List properties associated with a device.
2949 # @typename: the type name of a device
2951 # Returns: a list of DevicePropertyInfo describing a devices properties
2953 # Since: 1.2
2955 { 'command': 'device-list-properties',
2956   'data': { 'typename': 'str'},
2957   'returns': [ 'DevicePropertyInfo' ] }
2960 # @migrate:
2962 # Migrates the current running guest to another Virtual Machine.
2964 # @uri: the Uniform Resource Identifier of the destination VM
2966 # @blk: #optional do block migration (full disk copy)
2968 # @inc: #optional incremental disk copy migration
2970 # @detach: this argument exists only for compatibility reasons and
2971 #          is ignored by QEMU
2973 # Returns: nothing on success
2975 # Since: 0.14.0
2977 # Notes:
2979 # 1. The 'query-migrate' command should be used to check migration's progress
2980 #    and final result (this information is provided by the 'status' member)
2982 # 2. All boolean arguments default to false
2984 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
2985 #    be used
2987 # Example:
2989 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
2990 # <- { "return": {} }
2993 { 'command': 'migrate',
2994   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2997 # @migrate-incoming:
2999 # Start an incoming migration, the qemu must have been started
3000 # with -incoming defer
3002 # @uri: The Uniform Resource Identifier identifying the source or
3003 #       address to listen on
3005 # Returns: nothing on success
3007 # Since: 2.3
3009 # Notes:
3011 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3012 #    compatible with -incoming and the format of the uri is already exposed
3013 #    above libvirt.
3015 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3016 #    be used.
3018 # 3. The uri format is the same as for -incoming
3020 # Example:
3022 # -> { "execute": "migrate-incoming",
3023 #      "arguments": { "uri": "tcp::4446" } }
3024 # <- { "return": {} }
3027 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3030 # @xen-save-devices-state:
3032 # Save the state of all devices to file. The RAM and the block devices
3033 # of the VM are not saved by this command.
3035 # @filename: the file to save the state of the devices to as binary
3036 # data. See xen-save-devices-state.txt for a description of the binary
3037 # format.
3039 # Returns: Nothing on success
3041 # Since: 1.1
3043 # Example:
3045 # -> { "execute": "xen-save-devices-state",
3046 #      "arguments": { "filename": "/tmp/save" } }
3047 # <- { "return": {} }
3050 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3053 # @xen-set-global-dirty-log:
3055 # Enable or disable the global dirty log mode.
3057 # @enable: true to enable, false to disable.
3059 # Returns: nothing
3061 # Since: 1.3
3063 # Example:
3065 # -> { "execute": "xen-set-global-dirty-log",
3066 #      "arguments": { "enable": true } }
3067 # <- { "return": {} }
3070 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3073 # @device_add:
3075 # @driver: the name of the new device's driver
3077 # @bus: #optional the device's parent bus (device tree path)
3079 # @id: #optional the device's ID, must be unique
3081 # Additional arguments depend on the type.
3083 # Add a device.
3085 # Notes:
3086 # 1. For detailed information about this command, please refer to the
3087 #    'docs/qdev-device-use.txt' file.
3089 # 2. It's possible to list device properties by running QEMU with the
3090 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3091 #    device's name
3093 # Example:
3095 # -> { "execute": "device_add",
3096 #      "arguments": { "driver": "e1000", "id": "net1",
3097 #                     "bus": "pci.0",
3098 #                     "mac": "52:54:00:12:34:56" } }
3099 # <- { "return": {} }
3101 # TODO: This command effectively bypasses QAPI completely due to its
3102 # "additional arguments" business.  It shouldn't have been added to
3103 # the schema in this form.  It should be qapified properly, or
3104 # replaced by a properly qapified command.
3106 # Since: 0.13
3108 { 'command': 'device_add',
3109   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3110   'gen': false } # so we can get the additional arguments
3113 # @device_del:
3115 # Remove a device from a guest
3117 # @id: the device's ID or QOM path
3119 # Returns: Nothing on success
3120 #          If @id is not a valid device, DeviceNotFound
3122 # Notes: When this command completes, the device may not be removed from the
3123 #        guest.  Hot removal is an operation that requires guest cooperation.
3124 #        This command merely requests that the guest begin the hot removal
3125 #        process.  Completion of the device removal process is signaled with a
3126 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3127 #        for all devices.
3129 # Since: 0.14.0
3131 # Example:
3133 # -> { "execute": "device_del",
3134 #      "arguments": { "id": "net1" } }
3135 # <- { "return": {} }
3137 # -> { "execute": "device_del",
3138 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3139 # <- { "return": {} }
3142 { 'command': 'device_del', 'data': {'id': 'str'} }
3145 # @DumpGuestMemoryFormat:
3147 # An enumeration of guest-memory-dump's format.
3149 # @elf: elf format
3151 # @kdump-zlib: kdump-compressed format with zlib-compressed
3153 # @kdump-lzo: kdump-compressed format with lzo-compressed
3155 # @kdump-snappy: kdump-compressed format with snappy-compressed
3157 # Since: 2.0
3159 { 'enum': 'DumpGuestMemoryFormat',
3160   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3163 # @dump-guest-memory:
3165 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3166 # very long depending on the amount of guest memory.
3168 # @paging: if true, do paging to get guest's memory mapping. This allows
3169 #          using gdb to process the core file.
3171 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3172 #                     of RAM. This can happen for a large guest, or a
3173 #                     malicious guest pretending to be large.
3175 #          Also, paging=true has the following limitations:
3177 #             1. The guest may be in a catastrophic state or can have corrupted
3178 #                memory, which cannot be trusted
3179 #             2. The guest can be in real-mode even if paging is enabled. For
3180 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3181 #                goes in real-mode
3182 #             3. Currently only supported on i386 and x86_64.
3184 # @protocol: the filename or file descriptor of the vmcore. The supported
3185 #            protocols are:
3187 #            1. file: the protocol starts with "file:", and the following
3188 #               string is the file's path.
3189 #            2. fd: the protocol starts with "fd:", and the following string
3190 #               is the fd's name.
3192 # @detach: #optional if true, QMP will return immediately rather than
3193 #          waiting for the dump to finish. The user can track progress
3194 #          using "query-dump". (since 2.6).
3196 # @begin: #optional if specified, the starting physical address.
3198 # @length: #optional if specified, the memory size, in bytes. If you don't
3199 #          want to dump all guest's memory, please specify the start @begin
3200 #          and @length
3202 # @format: #optional if specified, the format of guest memory dump. But non-elf
3203 #          format is conflict with paging and filter, ie. @paging, @begin and
3204 #          @length is not allowed to be specified with non-elf @format at the
3205 #          same time (since 2.0)
3207 # Note: All boolean arguments default to false
3209 # Returns: nothing on success
3211 # Since: 1.2
3213 # Example:
3215 # -> { "execute": "dump-guest-memory",
3216 #      "arguments": { "protocol": "fd:dump" } }
3217 # <- { "return": {} }
3220 { 'command': 'dump-guest-memory',
3221   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3222             '*begin': 'int', '*length': 'int',
3223             '*format': 'DumpGuestMemoryFormat'} }
3226 # @DumpStatus:
3228 # Describe the status of a long-running background guest memory dump.
3230 # @none: no dump-guest-memory has started yet.
3232 # @active: there is one dump running in background.
3234 # @completed: the last dump has finished successfully.
3236 # @failed: the last dump has failed.
3238 # Since: 2.6
3240 { 'enum': 'DumpStatus',
3241   'data': [ 'none', 'active', 'completed', 'failed' ] }
3244 # @DumpQueryResult:
3246 # The result format for 'query-dump'.
3248 # @status: enum of @DumpStatus, which shows current dump status
3250 # @completed: bytes written in latest dump (uncompressed)
3252 # @total: total bytes to be written in latest dump (uncompressed)
3254 # Since: 2.6
3256 { 'struct': 'DumpQueryResult',
3257   'data': { 'status': 'DumpStatus',
3258             'completed': 'int',
3259             'total': 'int' } }
3262 # @query-dump:
3264 # Query latest dump status.
3266 # Returns: A @DumpStatus object showing the dump status.
3268 # Since: 2.6
3270 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3273 # @DumpGuestMemoryCapability:
3275 # A list of the available formats for dump-guest-memory
3277 # Since: 2.0
3279 { 'struct': 'DumpGuestMemoryCapability',
3280   'data': {
3281       'formats': ['DumpGuestMemoryFormat'] } }
3284 # @query-dump-guest-memory-capability:
3286 # Returns the available formats for dump-guest-memory
3288 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3289 #           dump-guest-memory
3291 # Since: 2.0
3293 # Example:
3295 # -> { "execute": "query-dump-guest-memory-capability" }
3296 # <- { "return": { "formats":
3297 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3300 { 'command': 'query-dump-guest-memory-capability',
3301   'returns': 'DumpGuestMemoryCapability' }
3304 # @dump-skeys:
3306 # Dump guest's storage keys
3308 # @filename: the path to the file to dump to
3310 # This command is only supported on s390 architecture.
3312 # Since: 2.5
3314 # Example:
3316 # -> { "execute": "dump-skeys",
3317 #      "arguments": { "filename": "/tmp/skeys" } }
3318 # <- { "return": {} }
3321 { 'command': 'dump-skeys',
3322   'data': { 'filename': 'str' } }
3325 # @netdev_add:
3327 # Add a network backend.
3329 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3330 #        'vde', 'socket', 'dump' and 'bridge'
3332 # @id: the name of the new network backend
3334 # Additional arguments depend on the type.
3336 # TODO: This command effectively bypasses QAPI completely due to its
3337 # "additional arguments" business.  It shouldn't have been added to
3338 # the schema in this form.  It should be qapified properly, or
3339 # replaced by a properly qapified command.
3341 # Since: 0.14.0
3343 # Returns: Nothing on success
3344 #          If @type is not a valid network backend, DeviceNotFound
3346 # Example:
3348 # -> { "execute": "netdev_add",
3349 #      "arguments": { "type": "user", "id": "netdev1",
3350 #                     "dnssearch": "example.org" } }
3351 # <- { "return": {} }
3354 { 'command': 'netdev_add',
3355   'data': {'type': 'str', 'id': 'str'},
3356   'gen': false }                # so we can get the additional arguments
3359 # @netdev_del:
3361 # Remove a network backend.
3363 # @id: the name of the network backend to remove
3365 # Returns: Nothing on success
3366 #          If @id is not a valid network backend, DeviceNotFound
3368 # Since: 0.14.0
3370 # Example:
3372 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3373 # <- { "return": {} }
3376 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3379 # @object-add:
3381 # Create a QOM object.
3383 # @qom-type: the class name for the object to be created
3385 # @id: the name of the new object
3387 # @props: #optional a dictionary of properties to be passed to the backend
3389 # Returns: Nothing on success
3390 #          Error if @qom-type is not a valid class name
3392 # Since: 2.0
3394 # Example:
3396 # -> { "execute": "object-add",
3397 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3398 #                     "props": { "filename": "/dev/hwrng" } } }
3399 # <- { "return": {} }
3402 { 'command': 'object-add',
3403   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3406 # @object-del:
3408 # Remove a QOM object.
3410 # @id: the name of the QOM object to remove
3412 # Returns: Nothing on success
3413 #          Error if @id is not a valid id for a QOM object
3415 # Since: 2.0
3417 # Example:
3419 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3420 # <- { "return": {} }
3423 { 'command': 'object-del', 'data': {'id': 'str'} }
3426 # @NetdevNoneOptions:
3428 # Use it alone to have zero network devices.
3430 # Since: 1.2
3432 { 'struct': 'NetdevNoneOptions',
3433   'data': { } }
3436 # @NetLegacyNicOptions:
3438 # Create a new Network Interface Card.
3440 # @netdev: #optional id of -netdev to connect to
3442 # @macaddr: #optional MAC address
3444 # @model: #optional device model (e1000, rtl8139, virtio etc.)
3446 # @addr: #optional PCI device address
3448 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
3450 # Since: 1.2
3452 { 'struct': 'NetLegacyNicOptions',
3453   'data': {
3454     '*netdev':  'str',
3455     '*macaddr': 'str',
3456     '*model':   'str',
3457     '*addr':    'str',
3458     '*vectors': 'uint32' } }
3461 # @String:
3463 # A fat type wrapping 'str', to be embedded in lists.
3465 # Since: 1.2
3467 { 'struct': 'String',
3468   'data': {
3469     'str': 'str' } }
3472 # @NetdevUserOptions:
3474 # Use the user mode network stack which requires no administrator privilege to
3475 # run.
3477 # @hostname: #optional client hostname reported by the builtin DHCP server
3479 # @restrict: #optional isolate the guest from the host
3481 # @ipv4: #optional whether to support IPv4, default true for enabled
3482 #        (since 2.6)
3484 # @ipv6: #optional whether to support IPv6, default true for enabled
3485 #        (since 2.6)
3487 # @ip: #optional legacy parameter, use net= instead
3489 # @net: #optional IP network address that the guest will see, in the
3490 #       form addr[/netmask] The netmask is optional, and can be
3491 #       either in the form a.b.c.d or as a number of valid top-most
3492 #       bits. Default is 10.0.2.0/24.
3494 # @host: #optional guest-visible address of the host
3496 # @tftp: #optional root directory of the built-in TFTP server
3498 # @bootfile: #optional BOOTP filename, for use with tftp=
3500 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
3501 #             assign
3503 # @dns: #optional guest-visible address of the virtual nameserver
3505 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
3506 #             to the guest
3508 # @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since
3509 #               2.6). The network prefix is given in the usual
3510 #               hexadecimal IPv6 address notation.
3512 # @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64)
3513 #                  (since 2.6)
3515 # @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6)
3517 # @ipv6-dns: #optional guest-visible IPv6 address of the virtual
3518 #            nameserver (since 2.6)
3520 # @smb: #optional root directory of the built-in SMB server
3522 # @smbserver: #optional IP address of the built-in SMB server
3524 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
3525 #           endpoints
3527 # @guestfwd: #optional forward guest TCP connections
3529 # Since: 1.2
3531 { 'struct': 'NetdevUserOptions',
3532   'data': {
3533     '*hostname':  'str',
3534     '*restrict':  'bool',
3535     '*ipv4':      'bool',
3536     '*ipv6':      'bool',
3537     '*ip':        'str',
3538     '*net':       'str',
3539     '*host':      'str',
3540     '*tftp':      'str',
3541     '*bootfile':  'str',
3542     '*dhcpstart': 'str',
3543     '*dns':       'str',
3544     '*dnssearch': ['String'],
3545     '*ipv6-prefix':      'str',
3546     '*ipv6-prefixlen':   'int',
3547     '*ipv6-host':        'str',
3548     '*ipv6-dns':         'str',
3549     '*smb':       'str',
3550     '*smbserver': 'str',
3551     '*hostfwd':   ['String'],
3552     '*guestfwd':  ['String'] } }
3555 # @NetdevTapOptions:
3557 # Connect the host TAP network interface name to the VLAN.
3559 # @ifname: #optional interface name
3561 # @fd: #optional file descriptor of an already opened tap
3563 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3564 # tap
3566 # @script: #optional script to initialize the interface
3568 # @downscript: #optional script to shut down the interface
3570 # @br: #optional bridge name (since 2.8)
3572 # @helper: #optional command to execute to configure bridge
3574 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3576 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3578 # @vhost: #optional enable vhost-net network accelerator
3580 # @vhostfd: #optional file descriptor of an already opened vhost net device
3582 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3583 # devices
3585 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3587 # @queues: #optional number of queues to be created for multiqueue capable tap
3589 # @poll-us: #optional maximum number of microseconds that could
3590 # be spent on busy polling for tap (since 2.7)
3592 # Since: 1.2
3594 { 'struct': 'NetdevTapOptions',
3595   'data': {
3596     '*ifname':     'str',
3597     '*fd':         'str',
3598     '*fds':        'str',
3599     '*script':     'str',
3600     '*downscript': 'str',
3601     '*br':         'str',
3602     '*helper':     'str',
3603     '*sndbuf':     'size',
3604     '*vnet_hdr':   'bool',
3605     '*vhost':      'bool',
3606     '*vhostfd':    'str',
3607     '*vhostfds':   'str',
3608     '*vhostforce': 'bool',
3609     '*queues':     'uint32',
3610     '*poll-us':    'uint32'} }
3613 # @NetdevSocketOptions:
3615 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3616 # socket connection.
3618 # @fd: #optional file descriptor of an already opened socket
3620 # @listen: #optional port number, and optional hostname, to listen on
3622 # @connect: #optional port number, and optional hostname, to connect to
3624 # @mcast: #optional UDP multicast address and port number
3626 # @localaddr: #optional source address and port for multicast and udp packets
3628 # @udp: #optional UDP unicast address and port number
3630 # Since: 1.2
3632 { 'struct': 'NetdevSocketOptions',
3633   'data': {
3634     '*fd':        'str',
3635     '*listen':    'str',
3636     '*connect':   'str',
3637     '*mcast':     'str',
3638     '*localaddr': 'str',
3639     '*udp':       'str' } }
3642 # @NetdevL2TPv3Options:
3644 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3646 # @src: source address
3648 # @dst: destination address
3650 # @srcport: #optional source port - mandatory for udp, optional for ip
3652 # @dstport: #optional destination port - mandatory for udp, optional for ip
3654 # @ipv6: #optional - force the use of ipv6
3656 # @udp: #optional - use the udp version of l2tpv3 encapsulation
3658 # @cookie64: #optional - use 64 bit coookies
3660 # @counter: #optional have sequence counter
3662 # @pincounter: #optional pin sequence counter to zero -
3663 #              workaround for buggy implementations or
3664 #              networks with packet reorder
3666 # @txcookie: #optional 32 or 64 bit transmit cookie
3668 # @rxcookie: #optional 32 or 64 bit receive cookie
3670 # @txsession: 32 bit transmit session
3672 # @rxsession: #optional 32 bit receive session - if not specified
3673 #             set to the same value as transmit
3675 # @offset: #optional additional offset - allows the insertion of
3676 #          additional application-specific data before the packet payload
3678 # Since: 2.1
3680 { 'struct': 'NetdevL2TPv3Options',
3681   'data': {
3682     'src':          'str',
3683     'dst':          'str',
3684     '*srcport':     'str',
3685     '*dstport':     'str',
3686     '*ipv6':        'bool',
3687     '*udp':         'bool',
3688     '*cookie64':    'bool',
3689     '*counter':     'bool',
3690     '*pincounter':  'bool',
3691     '*txcookie':    'uint64',
3692     '*rxcookie':    'uint64',
3693     'txsession':    'uint32',
3694     '*rxsession':   'uint32',
3695     '*offset':      'uint32' } }
3698 # @NetdevVdeOptions:
3700 # Connect the VLAN to a vde switch running on the host.
3702 # @sock: #optional socket path
3704 # @port: #optional port number
3706 # @group: #optional group owner of socket
3708 # @mode: #optional permissions for socket
3710 # Since: 1.2
3712 { 'struct': 'NetdevVdeOptions',
3713   'data': {
3714     '*sock':  'str',
3715     '*port':  'uint16',
3716     '*group': 'str',
3717     '*mode':  'uint16' } }
3720 # @NetdevDumpOptions:
3722 # Dump VLAN network traffic to a file.
3724 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3725 # suffixes.
3727 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3729 # Since: 1.2
3731 { 'struct': 'NetdevDumpOptions',
3732   'data': {
3733     '*len':  'size',
3734     '*file': 'str' } }
3737 # @NetdevBridgeOptions:
3739 # Connect a host TAP network interface to a host bridge device.
3741 # @br: #optional bridge name
3743 # @helper: #optional command to execute to configure bridge
3745 # Since: 1.2
3747 { 'struct': 'NetdevBridgeOptions',
3748   'data': {
3749     '*br':     'str',
3750     '*helper': 'str' } }
3753 # @NetdevHubPortOptions:
3755 # Connect two or more net clients through a software hub.
3757 # @hubid: hub identifier number
3759 # Since: 1.2
3761 { 'struct': 'NetdevHubPortOptions',
3762   'data': {
3763     'hubid':     'int32' } }
3766 # @NetdevNetmapOptions:
3768 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3770 # @ifname: Either the name of an existing network interface supported by
3771 #          netmap, or the name of a VALE port (created on the fly).
3772 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3773 #          YYY are non-negative integers. XXX identifies a switch and
3774 #          YYY identifies a port of the switch. VALE ports having the
3775 #          same XXX are therefore connected to the same switch.
3777 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3779 # Since: 2.0
3781 { 'struct': 'NetdevNetmapOptions',
3782   'data': {
3783     'ifname':     'str',
3784     '*devname':    'str' } }
3787 # @NetdevVhostUserOptions:
3789 # Vhost-user network backend
3791 # @chardev: name of a unix socket chardev
3793 # @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false).
3795 # @queues: #optional number of queues to be created for multiqueue vhost-user
3796 #          (default: 1) (Since 2.5)
3798 # Since: 2.1
3800 { 'struct': 'NetdevVhostUserOptions',
3801   'data': {
3802     'chardev':        'str',
3803     '*vhostforce':    'bool',
3804     '*queues':        'int' } }
3807 # @NetClientDriver:
3809 # Available netdev drivers.
3811 # Since: 2.7
3813 { 'enum': 'NetClientDriver',
3814   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
3815             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
3818 # @Netdev:
3820 # Captures the configuration of a network device.
3822 # @id: identifier for monitor commands.
3824 # @type: Specify the driver used for interpreting remaining arguments.
3826 # Since: 1.2
3828 # 'l2tpv3' - since 2.1
3830 { 'union': 'Netdev',
3831   'base': { 'id': 'str', 'type': 'NetClientDriver' },
3832   'discriminator': 'type',
3833   'data': {
3834     'none':     'NetdevNoneOptions',
3835     'nic':      'NetLegacyNicOptions',
3836     'user':     'NetdevUserOptions',
3837     'tap':      'NetdevTapOptions',
3838     'l2tpv3':   'NetdevL2TPv3Options',
3839     'socket':   'NetdevSocketOptions',
3840     'vde':      'NetdevVdeOptions',
3841     'dump':     'NetdevDumpOptions',
3842     'bridge':   'NetdevBridgeOptions',
3843     'hubport':  'NetdevHubPortOptions',
3844     'netmap':   'NetdevNetmapOptions',
3845     'vhost-user': 'NetdevVhostUserOptions' } }
3848 # @NetLegacy:
3850 # Captures the configuration of a network device; legacy.
3852 # @vlan: #optional vlan number
3854 # @id: #optional identifier for monitor commands
3856 # @name: #optional identifier for monitor commands, ignored if @id is present
3858 # @opts: device type specific properties (legacy)
3860 # Since: 1.2
3862 { 'struct': 'NetLegacy',
3863   'data': {
3864     '*vlan': 'int32',
3865     '*id':   'str',
3866     '*name': 'str',
3867     'opts':  'NetLegacyOptions' } }
3870 # @NetLegacyOptions:
3872 # Like Netdev, but for use only by the legacy command line options
3874 # Since: 1.2
3876 { 'union': 'NetLegacyOptions',
3877   'data': {
3878     'none':     'NetdevNoneOptions',
3879     'nic':      'NetLegacyNicOptions',
3880     'user':     'NetdevUserOptions',
3881     'tap':      'NetdevTapOptions',
3882     'l2tpv3':   'NetdevL2TPv3Options',
3883     'socket':   'NetdevSocketOptions',
3884     'vde':      'NetdevVdeOptions',
3885     'dump':     'NetdevDumpOptions',
3886     'bridge':   'NetdevBridgeOptions',
3887     'netmap':   'NetdevNetmapOptions',
3888     'vhost-user': 'NetdevVhostUserOptions' } }
3891 # @NetFilterDirection:
3893 # Indicates whether a netfilter is attached to a netdev's transmit queue or
3894 # receive queue or both.
3896 # @all: the filter is attached both to the receive and the transmit
3897 #       queue of the netdev (default).
3899 # @rx: the filter is attached to the receive queue of the netdev,
3900 #      where it will receive packets sent to the netdev.
3902 # @tx: the filter is attached to the transmit queue of the netdev,
3903 #      where it will receive packets sent by the netdev.
3905 # Since: 2.5
3907 { 'enum': 'NetFilterDirection',
3908   'data': [ 'all', 'rx', 'tx' ] }
3911 # @InetSocketAddress:
3913 # Captures a socket address or address range in the Internet namespace.
3915 # @host: host part of the address
3917 # @port: port part of the address, or lowest port if @to is present
3919 # @to: highest port to try
3921 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3922 #        #optional
3924 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3925 #        #optional
3927 # Since: 1.3
3929 { 'struct': 'InetSocketAddress',
3930   'data': {
3931     'host': 'str',
3932     'port': 'str',
3933     '*to': 'uint16',
3934     '*ipv4': 'bool',
3935     '*ipv6': 'bool' } }
3938 # @UnixSocketAddress:
3940 # Captures a socket address in the local ("Unix socket") namespace.
3942 # @path: filesystem path to use
3944 # Since: 1.3
3946 { 'struct': 'UnixSocketAddress',
3947   'data': {
3948     'path': 'str' } }
3951 # @VsockSocketAddress:
3953 # Captures a socket address in the vsock namespace.
3955 # @cid: unique host identifier
3956 # @port: port
3958 # Note: string types are used to allow for possible future hostname or
3959 # service resolution support.
3961 # Since: 2.8
3963 { 'struct': 'VsockSocketAddress',
3964   'data': {
3965     'cid': 'str',
3966     'port': 'str' } }
3969 # @SocketAddress:
3971 # Captures the address of a socket, which could also be a named file descriptor
3973 # Since: 1.3
3975 { 'union': 'SocketAddress',
3976   'data': {
3977     'inet': 'InetSocketAddress',
3978     'unix': 'UnixSocketAddress',
3979     'vsock': 'VsockSocketAddress',
3980     'fd': 'String' } }
3983 # @getfd:
3985 # Receive a file descriptor via SCM rights and assign it a name
3987 # @fdname: file descriptor name
3989 # Returns: Nothing on success
3991 # Since: 0.14.0
3993 # Notes: If @fdname already exists, the file descriptor assigned to
3994 #        it will be closed and replaced by the received file
3995 #        descriptor.
3997 #        The 'closefd' command can be used to explicitly close the
3998 #        file descriptor when it is no longer needed.
4000 # Example:
4002 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4003 # <- { "return": {} }
4006 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4009 # @closefd:
4011 # Close a file descriptor previously passed via SCM rights
4013 # @fdname: file descriptor name
4015 # Returns: Nothing on success
4017 # Since: 0.14.0
4019 # Example:
4021 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4022 # <- { "return": {} }
4025 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4028 # @MachineInfo:
4030 # Information describing a machine.
4032 # @name: the name of the machine
4034 # @alias: #optional an alias for the machine name
4036 # @is-default: #optional whether the machine is default
4038 # @cpu-max: maximum number of CPUs supported by the machine type
4039 #           (since 1.5.0)
4041 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4043 # Since: 1.2.0
4045 { 'struct': 'MachineInfo',
4046   'data': { 'name': 'str', '*alias': 'str',
4047             '*is-default': 'bool', 'cpu-max': 'int',
4048             'hotpluggable-cpus': 'bool'} }
4051 # @query-machines:
4053 # Return a list of supported machines
4055 # Returns: a list of MachineInfo
4057 # Since: 1.2.0
4059 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4062 # @CpuDefinitionInfo:
4064 # Virtual CPU definition.
4066 # @name: the name of the CPU definition
4068 # @migration-safe: #optional whether a CPU definition can be safely used for
4069 #                  migration in combination with a QEMU compatibility machine
4070 #                  when migrating between different QMU versions and between
4071 #                  hosts with different sets of (hardware or software)
4072 #                  capabilities. If not provided, information is not available
4073 #                  and callers should not assume the CPU definition to be
4074 #                  migration-safe. (since 2.8)
4076 # @static: whether a CPU definition is static and will not change depending on
4077 #          QEMU version, machine type, machine options and accelerator options.
4078 #          A static model is always migration-safe. (since 2.8)
4080 # @unavailable-features: #optional List of properties that prevent
4081 #                        the CPU model from running in the current
4082 #                        host. (since 2.8)
4083 # @typename: Type name that can be used as argument to @device-list-properties,
4084 #            to introspect properties configurable using -cpu or -global.
4085 #            (since 2.9)
4087 # @unavailable-features is a list of QOM property names that
4088 # represent CPU model attributes that prevent the CPU from running.
4089 # If the QOM property is read-only, that means there's no known
4090 # way to make the CPU model run in the current host. Implementations
4091 # that choose not to provide specific information return the
4092 # property name "type".
4093 # If the property is read-write, it means that it MAY be possible
4094 # to run the CPU model in the current host if that property is
4095 # changed. Management software can use it as hints to suggest or
4096 # choose an alternative for the user, or just to generate meaningful
4097 # error messages explaining why the CPU model can't be used.
4098 # If @unavailable-features is an empty list, the CPU model is
4099 # runnable using the current host and machine-type.
4100 # If @unavailable-features is not present, runnability
4101 # information for the CPU is not available.
4103 # Since: 1.2.0
4105 { 'struct': 'CpuDefinitionInfo',
4106   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4107             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4110 # @query-cpu-definitions:
4112 # Return a list of supported virtual CPU definitions
4114 # Returns: a list of CpuDefInfo
4116 # Since: 1.2.0
4118 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4121 # @CpuModelInfo:
4123 # Virtual CPU model.
4125 # A CPU model consists of the name of a CPU definition, to which
4126 # delta changes are applied (e.g. features added/removed). Most magic values
4127 # that an architecture might require should be hidden behind the name.
4128 # However, if required, architectures can expose relevant properties.
4130 # @name: the name of the CPU definition the model is based on
4131 # @props: #optional a dictionary of QOM properties to be applied
4133 # Since: 2.8.0
4135 { 'struct': 'CpuModelInfo',
4136   'data': { 'name': 'str',
4137             '*props': 'any' } }
4140 # @CpuModelExpansionType:
4142 # An enumeration of CPU model expansion types.
4144 # @static: Expand to a static CPU model, a combination of a static base
4145 #          model name and property delta changes. As the static base model will
4146 #          never change, the expanded CPU model will be the same, independant of
4147 #          independent of QEMU version, machine type, machine options, and
4148 #          accelerator options. Therefore, the resulting model can be used by
4149 #          tooling without having to specify a compatibility machine - e.g. when
4150 #          displaying the "host" model. static CPU models are migration-safe.
4152 # @full: Expand all properties. The produced model is not guaranteed to be
4153 #        migration-safe, but allows tooling to get an insight and work with
4154 #        model details.
4156 # Since: 2.8.0
4158 { 'enum': 'CpuModelExpansionType',
4159   'data': [ 'static', 'full' ] }
4163 # @CpuModelExpansionInfo:
4165 # The result of a cpu model expansion.
4167 # @model: the expanded CpuModelInfo.
4169 # Since: 2.8.0
4171 { 'struct': 'CpuModelExpansionInfo',
4172   'data': { 'model': 'CpuModelInfo' } }
4176 # @query-cpu-model-expansion:
4178 # Expands a given CPU model (or a combination of CPU model + additional options)
4179 # to different granularities, allowing tooling to get an understanding what a
4180 # specific CPU model looks like in QEMU under a certain configuration.
4182 # This interface can be used to query the "host" CPU model.
4184 # The data returned by this command may be affected by:
4186 # * QEMU version: CPU models may look different depending on the QEMU version.
4187 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4188 # * machine-type: CPU model  may look different depending on the machine-type.
4189 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4190 # * machine options (including accelerator): in some architectures, CPU models
4191 #   may look different depending on machine and accelerator options. (Except for
4192 #   CPU models reported as "static" in query-cpu-definitions.)
4193 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4194 #   global properties may affect expansion of CPU models. Using
4195 #   query-cpu-model-expansion while using these is not advised.
4197 # Some architectures may not support all expansion types. s390x supports
4198 # "full" and "static".
4200 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4201 #          not supported, if the model cannot be expanded, if the model contains
4202 #          an unknown CPU definition name, unknown properties or properties
4203 #          with a wrong type. Also returns an error if an expansion type is
4204 #          not supported.
4206 # Since: 2.8.0
4208 { 'command': 'query-cpu-model-expansion',
4209   'data': { 'type': 'CpuModelExpansionType',
4210             'model': 'CpuModelInfo' },
4211   'returns': 'CpuModelExpansionInfo' }
4214 # @CpuModelCompareResult:
4216 # An enumeration of CPU model comparation results. The result is usually
4217 # calculated using e.g. CPU features or CPU generations.
4219 # @incompatible: If model A is incompatible to model B, model A is not
4220 #                guaranteed to run where model B runs and the other way around.
4222 # @identical: If model A is identical to model B, model A is guaranteed to run
4223 #             where model B runs and the other way around.
4225 # @superset: If model A is a superset of model B, model B is guaranteed to run
4226 #            where model A runs. There are no guarantees about the other way.
4228 # @subset: If model A is a subset of model B, model A is guaranteed to run
4229 #          where model B runs. There are no guarantees about the other way.
4231 # Since: 2.8.0
4233 { 'enum': 'CpuModelCompareResult',
4234   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4237 # @CpuModelCompareInfo:
4239 # The result of a CPU model comparison.
4241 # @result: The result of the compare operation.
4242 # @responsible-properties: List of properties that led to the comparison result
4243 #                          not being identical.
4245 # @responsible-properties is a list of QOM property names that led to
4246 # both CPUs not being detected as identical. For identical models, this
4247 # list is empty.
4248 # If a QOM property is read-only, that means there's no known way to make the
4249 # CPU models identical. If the special property name "type" is included, the
4250 # models are by definition not identical and cannot be made identical.
4252 # Since: 2.8.0
4254 { 'struct': 'CpuModelCompareInfo',
4255   'data': {'result': 'CpuModelCompareResult',
4256            'responsible-properties': ['str']
4257           }
4261 # @query-cpu-model-comparison:
4263 # Compares two CPU models, returning how they compare in a specific
4264 # configuration. The results indicates how both models compare regarding
4265 # runnability. This result can be used by tooling to make decisions if a
4266 # certain CPU model will run in a certain configuration or if a compatible
4267 # CPU model has to be created by baselining.
4269 # Usually, a CPU model is compared against the maximum possible CPU model
4270 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4271 # model is identical or a subset, it will run in that configuration.
4273 # The result returned by this command may be affected by:
4275 # * QEMU version: CPU models may look different depending on the QEMU version.
4276 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4277 # * machine-type: CPU model may look different depending on the machine-type.
4278 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4279 # * machine options (including accelerator): in some architectures, CPU models
4280 #   may look different depending on machine and accelerator options. (Except for
4281 #   CPU models reported as "static" in query-cpu-definitions.)
4282 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4283 #   global properties may affect expansion of CPU models. Using
4284 #   query-cpu-model-expansion while using these is not advised.
4286 # Some architectures may not support comparing CPU models. s390x supports
4287 # comparing CPU models.
4289 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4290 #          not supported, if a model cannot be used, if a model contains
4291 #          an unknown cpu definition name, unknown properties or properties
4292 #          with wrong types.
4294 # Since: 2.8.0
4296 { 'command': 'query-cpu-model-comparison',
4297   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4298   'returns': 'CpuModelCompareInfo' }
4301 # @CpuModelBaselineInfo:
4303 # The result of a CPU model baseline.
4305 # @model: the baselined CpuModelInfo.
4307 # Since: 2.8.0
4309 { 'struct': 'CpuModelBaselineInfo',
4310   'data': { 'model': 'CpuModelInfo' } }
4313 # @query-cpu-model-baseline:
4315 # Baseline two CPU models, creating a compatible third model. The created
4316 # model will always be a static, migration-safe CPU model (see "static"
4317 # CPU model expansion for details).
4319 # This interface can be used by tooling to create a compatible CPU model out
4320 # two CPU models. The created CPU model will be identical to or a subset of
4321 # both CPU models when comparing them. Therefore, the created CPU model is
4322 # guaranteed to run where the given CPU models run.
4324 # The result returned by this command may be affected by:
4326 # * QEMU version: CPU models may look different depending on the QEMU version.
4327 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4328 # * machine-type: CPU model may look different depending on the machine-type.
4329 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4330 # * machine options (including accelerator): in some architectures, CPU models
4331 #   may look different depending on machine and accelerator options. (Except for
4332 #   CPU models reported as "static" in query-cpu-definitions.)
4333 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4334 #   global properties may affect expansion of CPU models. Using
4335 #   query-cpu-model-expansion while using these is not advised.
4337 # Some architectures may not support baselining CPU models. s390x supports
4338 # baselining CPU models.
4340 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4341 #          not supported, if a model cannot be used, if a model contains
4342 #          an unknown cpu definition name, unknown properties or properties
4343 #          with wrong types.
4345 # Since: 2.8.0
4347 { 'command': 'query-cpu-model-baseline',
4348   'data': { 'modela': 'CpuModelInfo',
4349             'modelb': 'CpuModelInfo' },
4350   'returns': 'CpuModelBaselineInfo' }
4353 # @AddfdInfo:
4355 # Information about a file descriptor that was added to an fd set.
4357 # @fdset-id: The ID of the fd set that @fd was added to.
4359 # @fd: The file descriptor that was received via SCM rights and
4360 #      added to the fd set.
4362 # Since: 1.2.0
4364 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4367 # @add-fd:
4369 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4371 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
4373 # @opaque: #optional A free-form string that can be used to describe the fd.
4375 # Returns: @AddfdInfo on success
4377 #          If file descriptor was not received, FdNotSupplied
4379 #          If @fdset-id is a negative value, InvalidParameterValue
4381 # Notes: The list of fd sets is shared by all monitor connections.
4383 #        If @fdset-id is not specified, a new fd set will be created.
4385 # Since: 1.2.0
4387 # Example:
4389 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4390 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4393 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4394   'returns': 'AddfdInfo' }
4397 # @remove-fd:
4399 # Remove a file descriptor from an fd set.
4401 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4403 # @fd: #optional The file descriptor that is to be removed.
4405 # Returns: Nothing on success
4406 #          If @fdset-id or @fd is not found, FdNotFound
4408 # Since: 1.2.0
4410 # Notes: The list of fd sets is shared by all monitor connections.
4412 #        If @fd is not specified, all file descriptors in @fdset-id
4413 #        will be removed.
4415 # Example:
4417 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4418 # <- { "return": {} }
4421 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4424 # @FdsetFdInfo:
4426 # Information about a file descriptor that belongs to an fd set.
4428 # @fd: The file descriptor value.
4430 # @opaque: #optional A free-form string that can be used to describe the fd.
4432 # Since: 1.2.0
4434 { 'struct': 'FdsetFdInfo',
4435   'data': {'fd': 'int', '*opaque': 'str'} }
4438 # @FdsetInfo:
4440 # Information about an fd set.
4442 # @fdset-id: The ID of the fd set.
4444 # @fds: A list of file descriptors that belong to this fd set.
4446 # Since: 1.2.0
4448 { 'struct': 'FdsetInfo',
4449   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4452 # @query-fdsets:
4454 # Return information describing all fd sets.
4456 # Returns: A list of @FdsetInfo
4458 # Since: 1.2.0
4460 # Note: The list of fd sets is shared by all monitor connections.
4462 # Example:
4464 # -> { "execute": "query-fdsets" }
4465 # <- { "return": [
4466 #        {
4467 #          "fds": [
4468 #            {
4469 #              "fd": 30,
4470 #              "opaque": "rdonly:/path/to/file"
4471 #            },
4472 #            {
4473 #              "fd": 24,
4474 #              "opaque": "rdwr:/path/to/file"
4475 #            }
4476 #          ],
4477 #          "fdset-id": 1
4478 #        },
4479 #        {
4480 #          "fds": [
4481 #            {
4482 #              "fd": 28
4483 #            },
4484 #            {
4485 #              "fd": 29
4486 #            }
4487 #          ],
4488 #          "fdset-id": 0
4489 #        }
4490 #      ]
4491 #    }
4494 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4497 # @TargetInfo:
4499 # Information describing the QEMU target.
4501 # @arch: the target architecture (eg "x86_64", "i386", etc)
4503 # Since: 1.2.0
4505 { 'struct': 'TargetInfo',
4506   'data': { 'arch': 'str' } }
4509 # @query-target:
4511 # Return information about the target for this QEMU
4513 # Returns: TargetInfo
4515 # Since: 1.2.0
4517 { 'command': 'query-target', 'returns': 'TargetInfo' }
4520 # @QKeyCode:
4522 # An enumeration of key name.
4524 # This is used by the @send-key command.
4526 # @unmapped: since 2.0
4527 # @pause: since 2.0
4528 # @ro: since 2.4
4529 # @kp_comma: since 2.4
4530 # @kp_equals: since 2.6
4531 # @power: since 2.6
4532 # @hiragana: since 2.9
4533 # @henkan: since 2.9
4534 # @yen: since 2.9
4536 # Since: 1.3.0
4539 { 'enum': 'QKeyCode',
4540   'data': [ 'unmapped',
4541             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
4542             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4543             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4544             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4545             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4546             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4547             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4548             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4549             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4550             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4551             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4552             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4553             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4554             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4555             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4556             'ro', 'hiragana', 'henkan', 'yen',
4557             'kp_comma', 'kp_equals', 'power' ] }
4560 # @KeyValue:
4562 # Represents a keyboard key.
4564 # Since: 1.3.0
4566 { 'union': 'KeyValue',
4567   'data': {
4568     'number': 'int',
4569     'qcode': 'QKeyCode' } }
4572 # @send-key:
4574 # Send keys to guest.
4576 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4577 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4578 #        directly to the guest, while @KeyValue.qcode must be a valid
4579 #        @QKeyCode value
4581 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
4582 #             to 100
4584 # Returns: Nothing on success
4585 #          If key is unknown or redundant, InvalidParameter
4587 # Since: 1.3.0
4589 # Example:
4591 # -> { "execute": "send-key",
4592 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4593 #                               { "type": "qcode", "data": "alt" },
4594 #                               { "type": "qcode", "data": "delete" } ] } }
4595 # <- { "return": {} }
4598 { 'command': 'send-key',
4599   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4602 # @screendump:
4604 # Write a PPM of the VGA screen to a file.
4606 # @filename: the path of a new PPM file to store the image
4608 # Returns: Nothing on success
4610 # Since: 0.14.0
4612 # Example:
4614 # -> { "execute": "screendump",
4615 #      "arguments": { "filename": "/tmp/image" } }
4616 # <- { "return": {} }
4619 { 'command': 'screendump', 'data': {'filename': 'str'} }
4623 # @ChardevCommon:
4625 # Configuration shared across all chardev backends
4627 # @logfile: #optional The name of a logfile to save output
4628 # @logappend: #optional true to append instead of truncate
4629 #             (default to false to truncate)
4631 # Since: 2.6
4633 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4634                                        '*logappend': 'bool' } }
4637 # @ChardevFile:
4639 # Configuration info for file chardevs.
4641 # @in:  #optional The name of the input file
4642 # @out: The name of the output file
4643 # @append: #optional Open the file in append mode (default false to
4644 #          truncate) (Since 2.6)
4646 # Since: 1.4
4648 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4649                                    'out' : 'str',
4650                                    '*append': 'bool' },
4651   'base': 'ChardevCommon' }
4654 # @ChardevHostdev:
4656 # Configuration info for device and pipe chardevs.
4658 # @device: The name of the special file for the device,
4659 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4661 # Since: 1.4
4663 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4664   'base': 'ChardevCommon' }
4667 # @ChardevSocket:
4669 # Configuration info for (stream) socket chardevs.
4671 # @addr: socket address to listen on (server=true)
4672 #        or connect to (server=false)
4673 # @tls-creds: #optional the ID of the TLS credentials object (since 2.6)
4674 # @server: #optional create server socket (default: true)
4675 # @wait: #optional wait for incoming connection on server
4676 #        sockets (default: false).
4677 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
4678 # @telnet: #optional enable telnet protocol on server
4679 #          sockets (default: false)
4680 # @reconnect: #optional For a client socket, if a socket is disconnected,
4681 #          then attempt a reconnect after the given number of seconds.
4682 #          Setting this to zero disables this function. (default: 0)
4683 #          (Since: 2.2)
4685 # Since: 1.4
4687 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddress',
4688                                      '*tls-creds'  : 'str',
4689                                      '*server'    : 'bool',
4690                                      '*wait'      : 'bool',
4691                                      '*nodelay'   : 'bool',
4692                                      '*telnet'    : 'bool',
4693                                      '*reconnect' : 'int' },
4694   'base': 'ChardevCommon' }
4697 # @ChardevUdp:
4699 # Configuration info for datagram socket chardevs.
4701 # @remote: remote address
4702 # @local: #optional local address
4704 # Since: 1.5
4706 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
4707                                   '*local' : 'SocketAddress' },
4708   'base': 'ChardevCommon' }
4711 # @ChardevMux:
4713 # Configuration info for mux chardevs.
4715 # @chardev: name of the base chardev.
4717 # Since: 1.5
4719 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
4720   'base': 'ChardevCommon' }
4723 # @ChardevStdio:
4725 # Configuration info for stdio chardevs.
4727 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
4728 #          be delivered to qemu.  Default: true in -nographic mode,
4729 #          false otherwise.
4731 # Since: 1.5
4733 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
4734   'base': 'ChardevCommon' }
4738 # @ChardevSpiceChannel:
4740 # Configuration info for spice vm channel chardevs.
4742 # @type: kind of channel (for example vdagent).
4744 # Since: 1.5
4746 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
4747   'base': 'ChardevCommon' }
4750 # @ChardevSpicePort:
4752 # Configuration info for spice port chardevs.
4754 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
4756 # Since: 1.5
4758 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
4759   'base': 'ChardevCommon' }
4762 # @ChardevVC:
4764 # Configuration info for virtual console chardevs.
4766 # @width:  console width,  in pixels
4767 # @height: console height, in pixels
4768 # @cols:   console width,  in chars
4769 # @rows:   console height, in chars
4771 # Since: 1.5
4773 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
4774                                  '*height' : 'int',
4775                                  '*cols'   : 'int',
4776                                  '*rows'   : 'int' },
4777   'base': 'ChardevCommon' }
4780 # @ChardevRingbuf:
4782 # Configuration info for ring buffer chardevs.
4784 # @size: #optional ring buffer size, must be power of two, default is 65536
4786 # Since: 1.5
4788 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
4789   'base': 'ChardevCommon' }
4792 # @ChardevBackend:
4794 # Configuration info for the new chardev backend.
4796 # Since: 1.4 (testdev since 2.2)
4798 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
4799                                        'serial' : 'ChardevHostdev',
4800                                        'parallel': 'ChardevHostdev',
4801                                        'pipe'   : 'ChardevHostdev',
4802                                        'socket' : 'ChardevSocket',
4803                                        'udp'    : 'ChardevUdp',
4804                                        'pty'    : 'ChardevCommon',
4805                                        'null'   : 'ChardevCommon',
4806                                        'mux'    : 'ChardevMux',
4807                                        'msmouse': 'ChardevCommon',
4808                                        'braille': 'ChardevCommon',
4809                                        'testdev': 'ChardevCommon',
4810                                        'stdio'  : 'ChardevStdio',
4811                                        'console': 'ChardevCommon',
4812                                        'spicevmc' : 'ChardevSpiceChannel',
4813                                        'spiceport' : 'ChardevSpicePort',
4814                                        'vc'     : 'ChardevVC',
4815                                        'ringbuf': 'ChardevRingbuf',
4816                                        # next one is just for compatibility
4817                                        'memory' : 'ChardevRingbuf' } }
4820 # @ChardevReturn:
4822 # Return info about the chardev backend just created.
4824 # @pty: #optional name of the slave pseudoterminal device, present if
4825 #       and only if a chardev of type 'pty' was created
4827 # Since: 1.4
4829 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
4832 # @chardev-add:
4834 # Add a character device backend
4836 # @id: the chardev's ID, must be unique
4837 # @backend: backend type and parameters
4839 # Returns: ChardevReturn.
4841 # Since: 1.4
4843 # Example:
4845 # -> { "execute" : "chardev-add",
4846 #      "arguments" : { "id" : "foo",
4847 #                      "backend" : { "type" : "null", "data" : {} } } }
4848 # <- { "return": {} }
4850 # -> { "execute" : "chardev-add",
4851 #      "arguments" : { "id" : "bar",
4852 #                      "backend" : { "type" : "file",
4853 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
4854 # <- { "return": {} }
4856 # -> { "execute" : "chardev-add",
4857 #      "arguments" : { "id" : "baz",
4858 #                      "backend" : { "type" : "pty", "data" : {} } } }
4859 # <- { "return": { "pty" : "/dev/pty/42" } }
4862 { 'command': 'chardev-add', 'data': {'id'      : 'str',
4863                                      'backend' : 'ChardevBackend' },
4864   'returns': 'ChardevReturn' }
4867 # @chardev-remove:
4869 # Remove a character device backend
4871 # @id: the chardev's ID, must exist and not be in use
4873 # Returns: Nothing on success
4875 # Since: 1.4
4877 # Example:
4879 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4880 # <- { "return": {} }
4883 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
4886 # @TpmModel:
4888 # An enumeration of TPM models
4890 # @tpm-tis: TPM TIS model
4892 # Since: 1.5
4894 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
4897 # @query-tpm-models:
4899 # Return a list of supported TPM models
4901 # Returns: a list of TpmModel
4903 # Since: 1.5
4905 # Example:
4907 # -> { "execute": "query-tpm-models" }
4908 # <- { "return": [ "tpm-tis" ] }
4911 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
4914 # @TpmType:
4916 # An enumeration of TPM types
4918 # @passthrough: TPM passthrough type
4920 # Since: 1.5
4922 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
4925 # @query-tpm-types:
4927 # Return a list of supported TPM types
4929 # Returns: a list of TpmType
4931 # Since: 1.5
4933 # Example:
4935 # -> { "execute": "query-tpm-types" }
4936 # <- { "return": [ "passthrough" ] }
4939 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
4942 # @TPMPassthroughOptions:
4944 # Information about the TPM passthrough type
4946 # @path: #optional string describing the path used for accessing the TPM device
4948 # @cancel-path: #optional string showing the TPM's sysfs cancel file
4949 #               for cancellation of TPM commands while they are executing
4951 # Since: 1.5
4953 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
4954                                              '*cancel-path' : 'str'} }
4957 # @TpmTypeOptions:
4959 # A union referencing different TPM backend types' configuration options
4961 # @type: 'passthrough' The configuration options for the TPM passthrough type
4963 # Since: 1.5
4965 { 'union': 'TpmTypeOptions',
4966    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
4969 # @TPMInfo:
4971 # Information about the TPM
4973 # @id: The Id of the TPM
4975 # @model: The TPM frontend model
4977 # @options: The TPM (backend) type configuration options
4979 # Since: 1.5
4981 { 'struct': 'TPMInfo',
4982   'data': {'id': 'str',
4983            'model': 'TpmModel',
4984            'options': 'TpmTypeOptions' } }
4987 # @query-tpm:
4989 # Return information about the TPM device
4991 # Returns: @TPMInfo on success
4993 # Since: 1.5
4995 # Example:
4997 # -> { "execute": "query-tpm" }
4998 # <- { "return":
4999 #      [
5000 #        { "model": "tpm-tis",
5001 #          "options":
5002 #            { "type": "passthrough",
5003 #              "data":
5004 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5005 #                  "path": "/dev/tpm0"
5006 #                }
5007 #            },
5008 #          "id": "tpm0"
5009 #        }
5010 #      ]
5011 #    }
5014 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5017 # @AcpiTableOptions:
5019 # Specify an ACPI table on the command line to load.
5021 # At most one of @file and @data can be specified. The list of files specified
5022 # by any one of them is loaded and concatenated in order. If both are omitted,
5023 # @data is implied.
5025 # Other fields / optargs can be used to override fields of the generic ACPI
5026 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5027 # Description Table Header. If a header field is not overridden, then the
5028 # corresponding value from the concatenated blob is used (in case of @file), or
5029 # it is filled in with a hard-coded value (in case of @data).
5031 # String fields are copied into the matching ACPI member from lowest address
5032 # upwards, and silently truncated / NUL-padded to length.
5034 # @sig: #optional table signature / identifier (4 bytes)
5036 # @rev: #optional table revision number (dependent on signature, 1 byte)
5038 # @oem_id: #optional OEM identifier (6 bytes)
5040 # @oem_table_id: #optional OEM table identifier (8 bytes)
5042 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
5044 # @asl_compiler_id: #optional identifier of the utility that created the table
5045 #                   (4 bytes)
5047 # @asl_compiler_rev: #optional revision number of the utility that created the
5048 #                    table (4 bytes)
5050 # @file: #optional colon (:) separated list of pathnames to load and
5051 #        concatenate as table data. The resultant binary blob is expected to
5052 #        have an ACPI table header. At least one file is required. This field
5053 #        excludes @data.
5055 # @data: #optional colon (:) separated list of pathnames to load and
5056 #        concatenate as table data. The resultant binary blob must not have an
5057 #        ACPI table header. At least one file is required. This field excludes
5058 #        @file.
5060 # Since: 1.5
5062 { 'struct': 'AcpiTableOptions',
5063   'data': {
5064     '*sig':               'str',
5065     '*rev':               'uint8',
5066     '*oem_id':            'str',
5067     '*oem_table_id':      'str',
5068     '*oem_rev':           'uint32',
5069     '*asl_compiler_id':   'str',
5070     '*asl_compiler_rev':  'uint32',
5071     '*file':              'str',
5072     '*data':              'str' }}
5075 # @CommandLineParameterType:
5077 # Possible types for an option parameter.
5079 # @string: accepts a character string
5081 # @boolean: accepts "on" or "off"
5083 # @number: accepts a number
5085 # @size: accepts a number followed by an optional suffix (K)ilo,
5086 #        (M)ega, (G)iga, (T)era
5088 # Since: 1.5
5090 { 'enum': 'CommandLineParameterType',
5091   'data': ['string', 'boolean', 'number', 'size'] }
5094 # @CommandLineParameterInfo:
5096 # Details about a single parameter of a command line option.
5098 # @name: parameter name
5100 # @type: parameter @CommandLineParameterType
5102 # @help: #optional human readable text string, not suitable for parsing.
5104 # @default: #optional default value string (since 2.1)
5106 # Since: 1.5
5108 { 'struct': 'CommandLineParameterInfo',
5109   'data': { 'name': 'str',
5110             'type': 'CommandLineParameterType',
5111             '*help': 'str',
5112             '*default': 'str' } }
5115 # @CommandLineOptionInfo:
5117 # Details about a command line option, including its list of parameter details
5119 # @option: option name
5121 # @parameters: an array of @CommandLineParameterInfo
5123 # Since: 1.5
5125 { 'struct': 'CommandLineOptionInfo',
5126   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5129 # @query-command-line-options:
5131 # Query command line option schema.
5133 # @option: #optional option name
5135 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5136 #          @option).  Returns an error if the given @option doesn't exist.
5138 # Since: 1.5
5140 # Example:
5142 # -> { "execute": "query-command-line-options",
5143 #      "arguments": { "option": "option-rom" } }
5144 # <- { "return": [
5145 #         {
5146 #             "parameters": [
5147 #                 {
5148 #                     "name": "romfile",
5149 #                     "type": "string"
5150 #                 },
5151 #                 {
5152 #                     "name": "bootindex",
5153 #                     "type": "number"
5154 #                 }
5155 #             ],
5156 #             "option": "option-rom"
5157 #         }
5158 #      ]
5159 #    }
5162 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5163  'returns': ['CommandLineOptionInfo'] }
5166 # @X86CPURegister32:
5168 # A X86 32-bit register
5170 # Since: 1.5
5172 { 'enum': 'X86CPURegister32',
5173   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5176 # @X86CPUFeatureWordInfo:
5178 # Information about a X86 CPU feature word
5180 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5182 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
5183 #                   feature word
5185 # @cpuid-register: Output register containing the feature bits
5187 # @features: value of output register, containing the feature bits
5189 # Since: 1.5
5191 { 'struct': 'X86CPUFeatureWordInfo',
5192   'data': { 'cpuid-input-eax': 'int',
5193             '*cpuid-input-ecx': 'int',
5194             'cpuid-register': 'X86CPURegister32',
5195             'features': 'int' } }
5198 # @DummyForceArrays:
5200 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5202 # Since: 2.5
5204 { 'struct': 'DummyForceArrays',
5205   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5209 # @RxState:
5211 # Packets receiving state
5213 # @normal: filter assigned packets according to the mac-table
5215 # @none: don't receive any assigned packet
5217 # @all: receive all assigned packets
5219 # Since: 1.6
5221 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5224 # @RxFilterInfo:
5226 # Rx-filter information for a NIC.
5228 # @name: net client name
5230 # @promiscuous: whether promiscuous mode is enabled
5232 # @multicast: multicast receive state
5234 # @unicast: unicast receive state
5236 # @vlan: vlan receive state (Since 2.0)
5238 # @broadcast-allowed: whether to receive broadcast
5240 # @multicast-overflow: multicast table is overflowed or not
5242 # @unicast-overflow: unicast table is overflowed or not
5244 # @main-mac: the main macaddr string
5246 # @vlan-table: a list of active vlan id
5248 # @unicast-table: a list of unicast macaddr string
5250 # @multicast-table: a list of multicast macaddr string
5252 # Since: 1.6
5254 { 'struct': 'RxFilterInfo',
5255   'data': {
5256     'name':               'str',
5257     'promiscuous':        'bool',
5258     'multicast':          'RxState',
5259     'unicast':            'RxState',
5260     'vlan':               'RxState',
5261     'broadcast-allowed':  'bool',
5262     'multicast-overflow': 'bool',
5263     'unicast-overflow':   'bool',
5264     'main-mac':           'str',
5265     'vlan-table':         ['int'],
5266     'unicast-table':      ['str'],
5267     'multicast-table':    ['str'] }}
5270 # @query-rx-filter:
5272 # Return rx-filter information for all NICs (or for the given NIC).
5274 # @name: #optional net client name
5276 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5277 #          Returns an error if the given @name doesn't exist, or given
5278 #          NIC doesn't support rx-filter querying, or given net client
5279 #          isn't a NIC.
5281 # Since: 1.6
5283 # Example:
5285 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5286 # <- { "return": [
5287 #         {
5288 #             "promiscuous": true,
5289 #             "name": "vnet0",
5290 #             "main-mac": "52:54:00:12:34:56",
5291 #             "unicast": "normal",
5292 #             "vlan": "normal",
5293 #             "vlan-table": [
5294 #                 4,
5295 #                 0
5296 #             ],
5297 #             "unicast-table": [
5298 #             ],
5299 #             "multicast": "normal",
5300 #             "multicast-overflow": false,
5301 #             "unicast-overflow": false,
5302 #             "multicast-table": [
5303 #                 "01:00:5e:00:00:01",
5304 #                 "33:33:00:00:00:01",
5305 #                 "33:33:ff:12:34:56"
5306 #             ],
5307 #             "broadcast-allowed": false
5308 #         }
5309 #       ]
5310 #    }
5313 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5314   'returns': ['RxFilterInfo'] }
5317 # @InputButton:
5319 # Button of a pointer input device (mouse, tablet).
5321 # Since: 2.0
5323 { 'enum'  : 'InputButton',
5324   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down' ] }
5327 # @InputAxis:
5329 # Position axis of a pointer input device (mouse, tablet).
5331 # Since: 2.0
5333 { 'enum'  : 'InputAxis',
5334   'data'  : [ 'x', 'y' ] }
5337 # @InputKeyEvent:
5339 # Keyboard input event.
5341 # @key:    Which key this event is for.
5342 # @down:   True for key-down and false for key-up events.
5344 # Since: 2.0
5346 { 'struct'  : 'InputKeyEvent',
5347   'data'  : { 'key'     : 'KeyValue',
5348               'down'    : 'bool' } }
5351 # @InputBtnEvent:
5353 # Pointer button input event.
5355 # @button: Which button this event is for.
5356 # @down:   True for key-down and false for key-up events.
5358 # Since: 2.0
5360 { 'struct'  : 'InputBtnEvent',
5361   'data'  : { 'button'  : 'InputButton',
5362               'down'    : 'bool' } }
5365 # @InputMoveEvent:
5367 # Pointer motion input event.
5369 # @axis:   Which axis is referenced by @value.
5370 # @value:  Pointer position.  For absolute coordinates the
5371 #          valid range is 0 -> 0x7ffff
5373 # Since: 2.0
5375 { 'struct'  : 'InputMoveEvent',
5376   'data'  : { 'axis'    : 'InputAxis',
5377               'value'   : 'int' } }
5380 # @InputEvent:
5382 # Input event union.
5384 # @type: the input type, one of:
5385 #  - 'key': Input event of Keyboard
5386 #  - 'btn': Input event of pointer buttons
5387 #  - 'rel': Input event of relative pointer motion
5388 #  - 'abs': Input event of absolute pointer motion
5390 # Since: 2.0
5392 { 'union' : 'InputEvent',
5393   'data'  : { 'key'     : 'InputKeyEvent',
5394               'btn'     : 'InputBtnEvent',
5395               'rel'     : 'InputMoveEvent',
5396               'abs'     : 'InputMoveEvent' } }
5399 # @input-send-event:
5401 # Send input event(s) to guest.
5403 # @device: #optional display device to send event(s) to.
5404 # @head: #optional head to send event(s) to, in case the
5405 #        display device supports multiple scanouts.
5406 # @events: List of InputEvent union.
5408 # Returns: Nothing on success.
5410 # The @device and @head parameters can be used to send the input event
5411 # to specific input devices in case (a) multiple input devices of the
5412 # same kind are added to the virtual machine and (b) you have
5413 # configured input routing (see docs/multiseat.txt) for those input
5414 # devices.  The parameters work exactly like the device and head
5415 # properties of input devices.  If @device is missing, only devices
5416 # that have no input routing config are admissible.  If @device is
5417 # specified, both input devices with and without input routing config
5418 # are admissible, but devices with input routing config take
5419 # precedence.
5421 # Since: 2.6
5423 # Note: The consoles are visible in the qom tree, under
5424 # /backend/console[$index]. They have a device link and head property,
5425 # so it is possible to map which console belongs to which device and
5426 # display.
5428 # Example:
5430 # 1. Press left mouse button.
5432 # -> { "execute": "input-send-event",
5433 #     "arguments": { "device": "video0",
5434 #                    "events": [ { "type": "btn",
5435 #                    "data" : { "down": true, "button": "left" } } ] } }
5436 # <- { "return": {} }
5438 # -> { "execute": "input-send-event",
5439 #     "arguments": { "device": "video0",
5440 #                    "events": [ { "type": "btn",
5441 #                    "data" : { "down": false, "button": "left" } } ] } }
5442 # <- { "return": {} }
5444 # 2. Press ctrl-alt-del.
5446 # -> { "execute": "input-send-event",
5447 #      "arguments": { "events": [
5448 #         { "type": "key", "data" : { "down": true,
5449 #           "key": {"type": "qcode", "data": "ctrl" } } },
5450 #         { "type": "key", "data" : { "down": true,
5451 #           "key": {"type": "qcode", "data": "alt" } } },
5452 #         { "type": "key", "data" : { "down": true,
5453 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5454 # <- { "return": {} }
5456 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5458 # -> { "execute": "input-send-event" ,
5459 #   "arguments": { "events": [
5460 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5461 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5462 # <- { "return": {} }
5465 { 'command': 'input-send-event',
5466   'data': { '*device': 'str',
5467             '*head'  : 'int',
5468             'events' : [ 'InputEvent' ] } }
5471 # @NumaOptions:
5473 # A discriminated record of NUMA options. (for OptsVisitor)
5475 # Since: 2.1
5477 { 'union': 'NumaOptions',
5478   'data': {
5479     'node': 'NumaNodeOptions' }}
5482 # @NumaNodeOptions:
5484 # Create a guest NUMA node. (for OptsVisitor)
5486 # @nodeid: #optional NUMA node ID (increase by 1 from 0 if omitted)
5488 # @cpus: #optional VCPUs belonging to this node (assign VCPUS round-robin
5489 #         if omitted)
5491 # @mem: #optional memory size of this node; mutually exclusive with @memdev.
5492 #       Equally divide total memory among nodes if both @mem and @memdev are
5493 #       omitted.
5495 # @memdev: #optional memory backend object.  If specified for one node,
5496 #          it must be specified for all nodes.
5498 # Since: 2.1
5500 { 'struct': 'NumaNodeOptions',
5501   'data': {
5502    '*nodeid': 'uint16',
5503    '*cpus':   ['uint16'],
5504    '*mem':    'size',
5505    '*memdev': 'str' }}
5508 # @HostMemPolicy:
5510 # Host memory policy types
5512 # @default: restore default policy, remove any nondefault policy
5514 # @preferred: set the preferred host nodes for allocation
5516 # @bind: a strict policy that restricts memory allocation to the
5517 #        host nodes specified
5519 # @interleave: memory allocations are interleaved across the set
5520 #              of host nodes specified
5522 # Since: 2.1
5524 { 'enum': 'HostMemPolicy',
5525   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5528 # @Memdev:
5530 # Information about memory backend
5532 # @id: #optional backend's ID if backend has 'id' property (since 2.9)
5534 # @size: memory backend size
5536 # @merge: enables or disables memory merge support
5538 # @dump: includes memory backend's memory in a core dump or not
5540 # @prealloc: enables or disables memory preallocation
5542 # @host-nodes: host nodes for its memory policy
5544 # @policy: memory policy of memory backend
5546 # Since: 2.1
5548 { 'struct': 'Memdev',
5549   'data': {
5550     '*id':        'str',
5551     'size':       'size',
5552     'merge':      'bool',
5553     'dump':       'bool',
5554     'prealloc':   'bool',
5555     'host-nodes': ['uint16'],
5556     'policy':     'HostMemPolicy' }}
5559 # @query-memdev:
5561 # Returns information for all memory backends.
5563 # Returns: a list of @Memdev.
5565 # Since: 2.1
5567 # Example:
5569 # -> { "execute": "query-memdev" }
5570 # <- { "return": [
5571 #        {
5572 #          "id": "mem1",
5573 #          "size": 536870912,
5574 #          "merge": false,
5575 #          "dump": true,
5576 #          "prealloc": false,
5577 #          "host-nodes": [0, 1],
5578 #          "policy": "bind"
5579 #        },
5580 #        {
5581 #          "size": 536870912,
5582 #          "merge": false,
5583 #          "dump": true,
5584 #          "prealloc": true,
5585 #          "host-nodes": [2, 3],
5586 #          "policy": "preferred"
5587 #        }
5588 #      ]
5589 #    }
5592 { 'command': 'query-memdev', 'returns': ['Memdev'] }
5595 # @PCDIMMDeviceInfo:
5597 # PCDIMMDevice state information
5599 # @id: #optional device's ID
5601 # @addr: physical address, where device is mapped
5603 # @size: size of memory that the device provides
5605 # @slot: slot number at which device is plugged in
5607 # @node: NUMA node number where device is plugged in
5609 # @memdev: memory backend linked with device
5611 # @hotplugged: true if device was hotplugged
5613 # @hotpluggable: true if device if could be added/removed while machine is running
5615 # Since: 2.1
5617 { 'struct': 'PCDIMMDeviceInfo',
5618   'data': { '*id': 'str',
5619             'addr': 'int',
5620             'size': 'int',
5621             'slot': 'int',
5622             'node': 'int',
5623             'memdev': 'str',
5624             'hotplugged': 'bool',
5625             'hotpluggable': 'bool'
5626           }
5630 # @MemoryDeviceInfo:
5632 # Union containing information about a memory device
5634 # Since: 2.1
5636 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
5639 # @query-memory-devices:
5641 # Lists available memory devices and their state
5643 # Since: 2.1
5645 # Example:
5647 # -> { "execute": "query-memory-devices" }
5648 # <- { "return": [ { "data":
5649 #                       { "addr": 5368709120,
5650 #                         "hotpluggable": true,
5651 #                         "hotplugged": true,
5652 #                         "id": "d1",
5653 #                         "memdev": "/objects/memX",
5654 #                         "node": 0,
5655 #                         "size": 1073741824,
5656 #                         "slot": 0},
5657 #                    "type": "dimm"
5658 #                  } ] }
5661 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
5664 # @ACPISlotType:
5666 # @DIMM: memory slot
5667 # @CPU: logical CPU slot (since 2.7)
5669 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
5672 # @ACPIOSTInfo:
5674 # OSPM Status Indication for a device
5675 # For description of possible values of @source and @status fields
5676 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
5678 # @device: #optional device ID associated with slot
5680 # @slot: slot ID, unique per slot of a given @slot-type
5682 # @slot-type: type of the slot
5684 # @source: an integer containing the source event
5686 # @status: an integer containing the status code
5688 # Since: 2.1
5690 { 'struct': 'ACPIOSTInfo',
5691   'data'  : { '*device': 'str',
5692               'slot': 'str',
5693               'slot-type': 'ACPISlotType',
5694               'source': 'int',
5695               'status': 'int' } }
5698 # @query-acpi-ospm-status:
5700 # Return a list of ACPIOSTInfo for devices that support status
5701 # reporting via ACPI _OST method.
5703 # Since: 2.1
5705 # Example:
5707 # -> { "execute": "query-acpi-ospm-status" }
5708 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
5709 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
5710 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
5711 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
5712 #    ]}
5715 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
5718 # @WatchdogExpirationAction:
5720 # An enumeration of the actions taken when the watchdog device's timer is
5721 # expired
5723 # @reset: system resets
5725 # @shutdown: system shutdown, note that it is similar to @powerdown, which
5726 #            tries to set to system status and notify guest
5728 # @poweroff: system poweroff, the emulator program exits
5730 # @pause: system pauses, similar to @stop
5732 # @debug: system enters debug state
5734 # @none: nothing is done
5736 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
5737 #              VCPUS on x86) (since 2.4)
5739 # Since: 2.1
5741 { 'enum': 'WatchdogExpirationAction',
5742   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
5743             'inject-nmi' ] }
5746 # @IoOperationType:
5748 # An enumeration of the I/O operation types
5750 # @read: read operation
5752 # @write: write operation
5754 # Since: 2.1
5756 { 'enum': 'IoOperationType',
5757   'data': [ 'read', 'write' ] }
5760 # @GuestPanicAction:
5762 # An enumeration of the actions taken when guest OS panic is detected
5764 # @pause: system pauses
5766 # Since: 2.1 (poweroff since 2.8)
5768 { 'enum': 'GuestPanicAction',
5769   'data': [ 'pause', 'poweroff' ] }
5772 # @rtc-reset-reinjection:
5774 # This command will reset the RTC interrupt reinjection backlog.
5775 # Can be used if another mechanism to synchronize guest time
5776 # is in effect, for example QEMU guest agent's guest-set-time
5777 # command.
5779 # Since: 2.1
5781 # Example:
5783 # -> { "execute": "rtc-reset-reinjection" }
5784 # <- { "return": {} }
5787 { 'command': 'rtc-reset-reinjection' }
5789 # Rocker ethernet network switch
5790 { 'include': 'qapi/rocker.json' }
5793 # @ReplayMode:
5795 # Mode of the replay subsystem.
5797 # @none: normal execution mode. Replay or record are not enabled.
5799 # @record: record mode. All non-deterministic data is written into the
5800 #          replay log.
5802 # @play: replay mode. Non-deterministic data required for system execution
5803 #        is read from the log.
5805 # Since: 2.5
5807 { 'enum': 'ReplayMode',
5808   'data': [ 'none', 'record', 'play' ] }
5811 # @xen-load-devices-state:
5813 # Load the state of all devices from file. The RAM and the block devices
5814 # of the VM are not loaded by this command.
5816 # @filename: the file to load the state of the devices from as binary
5817 # data. See xen-save-devices-state.txt for a description of the binary
5818 # format.
5820 # Since: 2.7
5822 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
5825 # @GICCapability:
5827 # The struct describes capability for a specific GIC (Generic
5828 # Interrupt Controller) version. These bits are not only decided by
5829 # QEMU/KVM software version, but also decided by the hardware that
5830 # the program is running upon.
5832 # @version:  version of GIC to be described. Currently, only 2 and 3
5833 #            are supported.
5835 # @emulated: whether current QEMU/hardware supports emulated GIC
5836 #            device in user space.
5838 # @kernel:   whether current QEMU/hardware supports hardware
5839 #            accelerated GIC device in kernel.
5841 # Since: 2.6
5843 { 'struct': 'GICCapability',
5844   'data': { 'version': 'int',
5845             'emulated': 'bool',
5846             'kernel': 'bool' } }
5849 # @query-gic-capabilities:
5851 # This command is ARM-only. It will return a list of GICCapability
5852 # objects that describe its capability bits.
5854 # Returns: a list of GICCapability objects.
5856 # Since: 2.6
5858 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
5861 # @CpuInstanceProperties:
5863 # List of properties to be used for hotplugging a CPU instance,
5864 # it should be passed by management with device_add command when
5865 # a CPU is being hotplugged.
5867 # @node-id: #optional NUMA node ID the CPU belongs to
5868 # @socket-id: #optional socket number within node/board the CPU belongs to
5869 # @core-id: #optional core number within socket the CPU belongs to
5870 # @thread-id: #optional thread number within core the CPU belongs to
5872 # Note: currently there are 4 properties that could be present
5873 # but management should be prepared to pass through other
5874 # properties with device_add command to allow for future
5875 # interface extension. This also requires the filed names to be kept in
5876 # sync with the properties passed to -device/device_add.
5878 # Since: 2.7
5880 { 'struct': 'CpuInstanceProperties',
5881   'data': { '*node-id': 'int',
5882             '*socket-id': 'int',
5883             '*core-id': 'int',
5884             '*thread-id': 'int'
5885   }
5889 # @HotpluggableCPU:
5891 # @type: CPU object type for usage with device_add command
5892 # @props: list of properties to be used for hotplugging CPU
5893 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
5894 # @qom-path: #optional link to existing CPU object if CPU is present or
5895 #            omitted if CPU is not present.
5897 # Since: 2.7
5899 { 'struct': 'HotpluggableCPU',
5900   'data': { 'type': 'str',
5901             'vcpus-count': 'int',
5902             'props': 'CpuInstanceProperties',
5903             '*qom-path': 'str'
5904           }
5908 # @query-hotpluggable-cpus:
5910 # Returns: a list of HotpluggableCPU objects.
5912 # Since: 2.7
5914 # Example:
5916 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
5918 # -> { "execute": "query-hotpluggable-cpus" }
5919 # <- {"return": [
5920 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
5921 #        "vcpus-count": 1 },
5922 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
5923 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5924 #    ]}'
5926 # For pc machine type started with -smp 1,maxcpus=2:
5928 # -> { "execute": "query-hotpluggable-cpus" }
5929 # <- {"return": [
5930 #      {
5931 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5932 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5933 #      },
5934 #      {
5935 #         "qom-path": "/machine/unattached/device[0]",
5936 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5937 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
5938 #      }
5939 #    ]}
5942 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }