]> Git Repo - qemu.git/blob - qapi-schema.json
qapi-schema: Rocker doc section contains unrelated stuff, fix
[qemu.git] / qapi-schema.json
1 # -*- Mode: Python -*-
2 ##
3 # = Introduction
4 #
5 # This document describes all commands currently supported by QMP.
6 #
7 # Most of the time their usage is exactly the same as in the user Monitor, this
8 # means that any other document which also describe commands (the manpage,
9 # QEMU's manual, etc) can and should be consulted.
10 #
11 # QMP has two types of commands: regular and query commands. Regular commands
12 # usually change the Virtual Machine's state someway, while query commands just
13 # return information. The sections below are divided accordingly.
14 #
15 # It's important to observe that all communication examples are formatted in
16 # a reader-friendly way, so that they're easier to understand. However, in real
17 # protocol usage, they're emitted as a single line.
18 #
19 # Also, the following notation is used to denote data flow:
20 #
21 # Example:
22 #
23 # | -> data issued by the Client
24 # | <- Server data response
25 #
26 # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for
27 # detailed information on the Server command and response formats.
28 #
29 # = Stability Considerations
30 #
31 # The current QMP command set (described in this file) may be useful for a
32 # number of use cases, however it's limited and several commands have bad
33 # defined semantics, specially with regard to command completion.
34 #
35 # These problems are going to be solved incrementally in the next QEMU releases
36 # and we're going to establish a deprecation policy for badly defined commands.
37 #
38 # If you're planning to adopt QMP, please observe the following:
39 #
40 #     1. The deprecation policy will take effect and be documented soon, please
41 #        check the documentation of each used command as soon as a new release of
42 #        QEMU is available
43 #
44 #     2. DO NOT rely on anything which is not explicit documented
45 #
46 #     3. Errors, in special, are not documented. Applications should NOT check
47 #        for specific errors classes or data (it's strongly recommended to only
48 #        check for the "error" key)
49 #
50 ##
51
52 { 'pragma': { 'doc-required': true } }
53
54 # Whitelists to permit QAPI rule violations; think twice before you
55 # add to them!
56 { 'pragma': {
57     # Commands allowed to return a non-dictionary:
58     'returns-whitelist': [
59         'human-monitor-command',
60         'qom-get',
61         'query-migrate-cache-size',
62         'query-tpm-models',
63         'query-tpm-types',
64         'ringbuf-read' ],
65     'name-case-whitelist': [
66         'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
67         'CpuInfoMIPS',          # PC, visible through query-cpu
68         'CpuInfoTricore',       # PC, visible through query-cpu
69         'QapiErrorClass',       # all members, visible through errors
70         'UuidInfo',             # UUID, visible through query-uuid
71         'X86CPURegister32',     # all members, visible indirectly through qom-get
72         'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
73     ] } }
74
75 # Documentation generated with qapi2texi.py is in source order, with
76 # included sub-schemas inserted at the first include directive
77 # (subsequent include directives have no effect).  To get a sane and
78 # stable order, it's best to include each sub-schema just once, or
79 # include it first in qapi-schema.json.
80
81 { 'include': 'qapi/common.json' }
82 { 'include': 'qapi/crypto.json' }
83 { 'include': 'qapi/block.json' }
84 { 'include': 'qapi/rocker.json' }
85 { 'include': 'qapi/event.json' }
86 { 'include': 'qapi/trace.json' }
87 { 'include': 'qapi/introspect.json' }
88
89 ##
90 # = QMP commands
91 ##
92
93 ##
94 # @qmp_capabilities:
95 #
96 # Enable QMP capabilities.
97 #
98 # Arguments: None.
99 #
100 # Example:
101 #
102 # -> { "execute": "qmp_capabilities" }
103 # <- { "return": {} }
104 #
105 # Notes: This command is valid exactly when first connecting: it must be
106 # issued before any other command will be accepted, and will fail once the
107 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
108 #
109 # Since: 0.13
110 #
111 ##
112 { 'command': 'qmp_capabilities' }
113
114 ##
115 # @StrOrNull:
116 #
117 # This is a string value or the explicit lack of a string (null
118 # pointer in C).  Intended for cases when 'optional absent' already
119 # has a different meaning.
120 #
121 # @s: the string value
122 # @n: no string value
123 #
124 # Since: 2.10
125 ##
126 { 'alternate': 'StrOrNull',
127   'data': { 's': 'str',
128             'n': 'null' } }
129
130 ##
131 # @LostTickPolicy:
132 #
133 # Policy for handling lost ticks in timer devices.
134 #
135 # @discard: throw away the missed tick(s) and continue with future injection
136 #           normally.  Guest time may be delayed, unless the OS has explicit
137 #           handling of lost ticks
138 #
139 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
140 #         delayed due to the late tick
141 #
142 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
143 #         may be delayed, depending on how the OS reacts to the merging
144 #         of ticks
145 #
146 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
147 #        guest time should not be delayed once catchup is complete.
148 #
149 # Since: 2.0
150 ##
151 { 'enum': 'LostTickPolicy',
152   'data': ['discard', 'delay', 'merge', 'slew' ] }
153
154 ##
155 # @add_client:
156 #
157 # Allow client connections for VNC, Spice and socket based
158 # character devices to be passed in to QEMU via SCM_RIGHTS.
159 #
160 # @protocol: protocol name. Valid names are "vnc", "spice" or the
161 #            name of a character device (eg. from -chardev id=XXXX)
162 #
163 # @fdname: file descriptor name previously passed via 'getfd' command
164 #
165 # @skipauth: whether to skip authentication. Only applies
166 #            to "vnc" and "spice" protocols
167 #
168 # @tls: whether to perform TLS. Only applies to the "spice"
169 #       protocol
170 #
171 # Returns: nothing on success.
172 #
173 # Since: 0.14.0
174 #
175 # Example:
176 #
177 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
178 #                                              "fdname": "myclient" } }
179 # <- { "return": {} }
180 #
181 ##
182 { 'command': 'add_client',
183   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
184             '*tls': 'bool' } }
185
186 ##
187 # @NameInfo:
188 #
189 # Guest name information.
190 #
191 # @name: The name of the guest
192 #
193 # Since: 0.14.0
194 ##
195 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
196
197 ##
198 # @query-name:
199 #
200 # Return the name information of a guest.
201 #
202 # Returns: @NameInfo of the guest
203 #
204 # Since: 0.14.0
205 #
206 # Example:
207 #
208 # -> { "execute": "query-name" }
209 # <- { "return": { "name": "qemu-name" } }
210 #
211 ##
212 { 'command': 'query-name', 'returns': 'NameInfo' }
213
214 ##
215 # @KvmInfo:
216 #
217 # Information about support for KVM acceleration
218 #
219 # @enabled: true if KVM acceleration is active
220 #
221 # @present: true if KVM acceleration is built into this executable
222 #
223 # Since: 0.14.0
224 ##
225 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
226
227 ##
228 # @query-kvm:
229 #
230 # Returns information about KVM acceleration
231 #
232 # Returns: @KvmInfo
233 #
234 # Since: 0.14.0
235 #
236 # Example:
237 #
238 # -> { "execute": "query-kvm" }
239 # <- { "return": { "enabled": true, "present": true } }
240 #
241 ##
242 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
243
244 ##
245 # @RunState:
246 #
247 # An enumeration of VM run states.
248 #
249 # @debug: QEMU is running on a debugger
250 #
251 # @finish-migrate: guest is paused to finish the migration process
252 #
253 # @inmigrate: guest is paused waiting for an incoming migration.  Note
254 # that this state does not tell whether the machine will start at the
255 # end of the migration.  This depends on the command-line -S option and
256 # any invocation of 'stop' or 'cont' that has happened since QEMU was
257 # started.
258 #
259 # @internal-error: An internal error that prevents further guest execution
260 # has occurred
261 #
262 # @io-error: the last IOP has failed and the device is configured to pause
263 # on I/O errors
264 #
265 # @paused: guest has been paused via the 'stop' command
266 #
267 # @postmigrate: guest is paused following a successful 'migrate'
268 #
269 # @prelaunch: QEMU was started with -S and guest has not started
270 #
271 # @restore-vm: guest is paused to restore VM state
272 #
273 # @running: guest is actively running
274 #
275 # @save-vm: guest is paused to save the VM state
276 #
277 # @shutdown: guest is shut down (and -no-shutdown is in use)
278 #
279 # @suspended: guest is suspended (ACPI S3)
280 #
281 # @watchdog: the watchdog action is configured to pause and has been triggered
282 #
283 # @guest-panicked: guest has been panicked as a result of guest OS panic
284 #
285 # @colo: guest is paused to save/restore VM state under colo checkpoint,
286 #        VM can not get into this state unless colo capability is enabled
287 #        for migration. (since 2.8)
288 ##
289 { 'enum': 'RunState',
290   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
291             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
292             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
293             'guest-panicked', 'colo' ] }
294
295 ##
296 # @StatusInfo:
297 #
298 # Information about VCPU run state
299 #
300 # @running: true if all VCPUs are runnable, false if not runnable
301 #
302 # @singlestep: true if VCPUs are in single-step mode
303 #
304 # @status: the virtual machine @RunState
305 #
306 # Since:  0.14.0
307 #
308 # Notes: @singlestep is enabled through the GDB stub
309 ##
310 { 'struct': 'StatusInfo',
311   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
312
313 ##
314 # @query-status:
315 #
316 # Query the run status of all VCPUs
317 #
318 # Returns: @StatusInfo reflecting all VCPUs
319 #
320 # Since:  0.14.0
321 #
322 # Example:
323 #
324 # -> { "execute": "query-status" }
325 # <- { "return": { "running": true,
326 #                  "singlestep": false,
327 #                  "status": "running" } }
328 #
329 ##
330 { 'command': 'query-status', 'returns': 'StatusInfo' }
331
332 ##
333 # @UuidInfo:
334 #
335 # Guest UUID information (Universally Unique Identifier).
336 #
337 # @UUID: the UUID of the guest
338 #
339 # Since: 0.14.0
340 #
341 # Notes: If no UUID was specified for the guest, a null UUID is returned.
342 ##
343 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
344
345 ##
346 # @query-uuid:
347 #
348 # Query the guest UUID information.
349 #
350 # Returns: The @UuidInfo for the guest
351 #
352 # Since: 0.14.0
353 #
354 # Example:
355 #
356 # -> { "execute": "query-uuid" }
357 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
358 #
359 ##
360 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
361
362 ##
363 # @ChardevInfo:
364 #
365 # Information about a character device.
366 #
367 # @label: the label of the character device
368 #
369 # @filename: the filename of the character device
370 #
371 # @frontend-open: shows whether the frontend device attached to this backend
372 #                 (eg. with the chardev=... option) is in open or closed state
373 #                 (since 2.1)
374 #
375 # Notes: @filename is encoded using the QEMU command line character device
376 #        encoding.  See the QEMU man page for details.
377 #
378 # Since: 0.14.0
379 ##
380 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
381                                   'filename': 'str',
382                                   'frontend-open': 'bool'} }
383
384 ##
385 # @query-chardev:
386 #
387 # Returns information about current character devices.
388 #
389 # Returns: a list of @ChardevInfo
390 #
391 # Since: 0.14.0
392 #
393 # Example:
394 #
395 # -> { "execute": "query-chardev" }
396 # <- {
397 #       "return": [
398 #          {
399 #             "label": "charchannel0",
400 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
401 #             "frontend-open": false
402 #          },
403 #          {
404 #             "label": "charmonitor",
405 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
406 #             "frontend-open": true
407 #          },
408 #          {
409 #             "label": "charserial0",
410 #             "filename": "pty:/dev/pts/2",
411 #             "frontend-open": true
412 #          }
413 #       ]
414 #    }
415 #
416 ##
417 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
418
419 ##
420 # @ChardevBackendInfo:
421 #
422 # Information about a character device backend
423 #
424 # @name: The backend name
425 #
426 # Since: 2.0
427 ##
428 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
429
430 ##
431 # @query-chardev-backends:
432 #
433 # Returns information about character device backends.
434 #
435 # Returns: a list of @ChardevBackendInfo
436 #
437 # Since: 2.0
438 #
439 # Example:
440 #
441 # -> { "execute": "query-chardev-backends" }
442 # <- {
443 #       "return":[
444 #          {
445 #             "name":"udp"
446 #          },
447 #          {
448 #             "name":"tcp"
449 #          },
450 #          {
451 #             "name":"unix"
452 #          },
453 #          {
454 #             "name":"spiceport"
455 #          }
456 #       ]
457 #    }
458 #
459 ##
460 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
461
462 ##
463 # @DataFormat:
464 #
465 # An enumeration of data format.
466 #
467 # @utf8: Data is a UTF-8 string (RFC 3629)
468 #
469 # @base64: Data is Base64 encoded binary (RFC 3548)
470 #
471 # Since: 1.4
472 ##
473 { 'enum': 'DataFormat',
474   'data': [ 'utf8', 'base64' ] }
475
476 ##
477 # @ringbuf-write:
478 #
479 # Write to a ring buffer character device.
480 #
481 # @device: the ring buffer character device name
482 #
483 # @data: data to write
484 #
485 # @format: data encoding (default 'utf8').
486 #          - base64: data must be base64 encoded text.  Its binary
487 #            decoding gets written.
488 #          - utf8: data's UTF-8 encoding is written
489 #          - data itself is always Unicode regardless of format, like
490 #            any other string.
491 #
492 # Returns: Nothing on success
493 #
494 # Since: 1.4
495 #
496 # Example:
497 #
498 # -> { "execute": "ringbuf-write",
499 #      "arguments": { "device": "foo",
500 #                     "data": "abcdefgh",
501 #                     "format": "utf8" } }
502 # <- { "return": {} }
503 #
504 ##
505 { 'command': 'ringbuf-write',
506   'data': {'device': 'str', 'data': 'str',
507            '*format': 'DataFormat'} }
508
509 ##
510 # @ringbuf-read:
511 #
512 # Read from a ring buffer character device.
513 #
514 # @device: the ring buffer character device name
515 #
516 # @size: how many bytes to read at most
517 #
518 # @format: data encoding (default 'utf8').
519 #          - base64: the data read is returned in base64 encoding.
520 #          - utf8: the data read is interpreted as UTF-8.
521 #            Bug: can screw up when the buffer contains invalid UTF-8
522 #            sequences, NUL characters, after the ring buffer lost
523 #            data, and when reading stops because the size limit is
524 #            reached.
525 #          - The return value is always Unicode regardless of format,
526 #            like any other string.
527 #
528 # Returns: data read from the device
529 #
530 # Since: 1.4
531 #
532 # Example:
533 #
534 # -> { "execute": "ringbuf-read",
535 #      "arguments": { "device": "foo",
536 #                     "size": 1000,
537 #                     "format": "utf8" } }
538 # <- { "return": "abcdefgh" }
539 #
540 ##
541 { 'command': 'ringbuf-read',
542   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
543   'returns': 'str' }
544
545 ##
546 # @EventInfo:
547 #
548 # Information about a QMP event
549 #
550 # @name: The event name
551 #
552 # Since: 1.2.0
553 ##
554 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
555
556 ##
557 # @query-events:
558 #
559 # Return a list of supported QMP events by this server
560 #
561 # Returns: A list of @EventInfo for all supported events
562 #
563 # Since: 1.2.0
564 #
565 # Example:
566 #
567 # -> { "execute": "query-events" }
568 # <- {
569 #      "return": [
570 #          {
571 #             "name":"SHUTDOWN"
572 #          },
573 #          {
574 #             "name":"RESET"
575 #          }
576 #       ]
577 #    }
578 #
579 # Note: This example has been shortened as the real response is too long.
580 #
581 ##
582 { 'command': 'query-events', 'returns': ['EventInfo'] }
583
584 ##
585 # @MigrationStats:
586 #
587 # Detailed migration status.
588 #
589 # @transferred: amount of bytes already transferred to the target VM
590 #
591 # @remaining: amount of bytes remaining to be transferred to the target VM
592 #
593 # @total: total amount of bytes involved in the migration process
594 #
595 # @duplicate: number of duplicate (zero) pages (since 1.2)
596 #
597 # @skipped: number of skipped zero pages (since 1.5)
598 #
599 # @normal: number of normal pages (since 1.2)
600 #
601 # @normal-bytes: number of normal bytes sent (since 1.2)
602 #
603 # @dirty-pages-rate: number of pages dirtied by second by the
604 #        guest (since 1.3)
605 #
606 # @mbps: throughput in megabits/sec. (since 1.6)
607 #
608 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
609 #
610 # @postcopy-requests: The number of page requests received from the destination
611 #        (since 2.7)
612 #
613 # @page-size: The number of bytes per page for the various page-based
614 #        statistics (since 2.10)
615 #
616 # Since: 0.14.0
617 ##
618 { 'struct': 'MigrationStats',
619   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
620            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
621            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
622            'mbps' : 'number', 'dirty-sync-count' : 'int',
623            'postcopy-requests' : 'int', 'page-size' : 'int' } }
624
625 ##
626 # @XBZRLECacheStats:
627 #
628 # Detailed XBZRLE migration cache statistics
629 #
630 # @cache-size: XBZRLE cache size
631 #
632 # @bytes: amount of bytes already transferred to the target VM
633 #
634 # @pages: amount of pages transferred to the target VM
635 #
636 # @cache-miss: number of cache miss
637 #
638 # @cache-miss-rate: rate of cache miss (since 2.1)
639 #
640 # @overflow: number of overflows
641 #
642 # Since: 1.2
643 ##
644 { 'struct': 'XBZRLECacheStats',
645   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
646            'cache-miss': 'int', 'cache-miss-rate': 'number',
647            'overflow': 'int' } }
648
649 ##
650 # @MigrationStatus:
651 #
652 # An enumeration of migration status.
653 #
654 # @none: no migration has ever happened.
655 #
656 # @setup: migration process has been initiated.
657 #
658 # @cancelling: in the process of cancelling migration.
659 #
660 # @cancelled: cancelling migration is finished.
661 #
662 # @active: in the process of doing migration.
663 #
664 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
665 #
666 # @completed: migration is finished.
667 #
668 # @failed: some error occurred during migration process.
669 #
670 # @colo: VM is in the process of fault tolerance, VM can not get into this
671 #        state unless colo capability is enabled for migration. (since 2.8)
672 #
673 # Since: 2.3
674 #
675 ##
676 { 'enum': 'MigrationStatus',
677   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
678             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
679
680 ##
681 # @MigrationInfo:
682 #
683 # Information about current migration process.
684 #
685 # @status: @MigrationStatus describing the current migration status.
686 #          If this field is not returned, no migration process
687 #          has been initiated
688 #
689 # @ram: @MigrationStats containing detailed migration
690 #       status, only returned if status is 'active' or
691 #       'completed'(since 1.2)
692 #
693 # @disk: @MigrationStats containing detailed disk migration
694 #        status, only returned if status is 'active' and it is a block
695 #        migration
696 #
697 # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
698 #                migration statistics, only returned if XBZRLE feature is on and
699 #                status is 'active' or 'completed' (since 1.2)
700 #
701 # @total-time: total amount of milliseconds since migration started.
702 #        If migration has ended, it returns the total migration
703 #        time. (since 1.2)
704 #
705 # @downtime: only present when migration finishes correctly
706 #        total downtime in milliseconds for the guest.
707 #        (since 1.3)
708 #
709 # @expected-downtime: only present while migration is active
710 #        expected downtime in milliseconds for the guest in last walk
711 #        of the dirty bitmap. (since 1.3)
712 #
713 # @setup-time: amount of setup time in milliseconds _before_ the
714 #        iterations begin but _after_ the QMP command is issued. This is designed
715 #        to provide an accounting of any activities (such as RDMA pinning) which
716 #        may be expensive, but do not actually occur during the iterative
717 #        migration rounds themselves. (since 1.6)
718 #
719 # @cpu-throttle-percentage: percentage of time guest cpus are being
720 #        throttled during auto-converge. This is only present when auto-converge
721 #        has started throttling guest cpus. (Since 2.7)
722 #
723 # @error-desc: the human readable error description string, when
724 #              @status is 'failed'. Clients should not attempt to parse the
725 #              error strings. (Since 2.7)
726 #
727 # Since: 0.14.0
728 ##
729 { 'struct': 'MigrationInfo',
730   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
731            '*disk': 'MigrationStats',
732            '*xbzrle-cache': 'XBZRLECacheStats',
733            '*total-time': 'int',
734            '*expected-downtime': 'int',
735            '*downtime': 'int',
736            '*setup-time': 'int',
737            '*cpu-throttle-percentage': 'int',
738            '*error-desc': 'str'} }
739
740 ##
741 # @query-migrate:
742 #
743 # Returns information about current migration process. If migration
744 # is active there will be another json-object with RAM migration
745 # status and if block migration is active another one with block
746 # migration status.
747 #
748 # Returns: @MigrationInfo
749 #
750 # Since: 0.14.0
751 #
752 # Example:
753 #
754 # 1. Before the first migration
755 #
756 # -> { "execute": "query-migrate" }
757 # <- { "return": {} }
758 #
759 # 2. Migration is done and has succeeded
760 #
761 # -> { "execute": "query-migrate" }
762 # <- { "return": {
763 #         "status": "completed",
764 #         "ram":{
765 #           "transferred":123,
766 #           "remaining":123,
767 #           "total":246,
768 #           "total-time":12345,
769 #           "setup-time":12345,
770 #           "downtime":12345,
771 #           "duplicate":123,
772 #           "normal":123,
773 #           "normal-bytes":123456,
774 #           "dirty-sync-count":15
775 #         }
776 #      }
777 #    }
778 #
779 # 3. Migration is done and has failed
780 #
781 # -> { "execute": "query-migrate" }
782 # <- { "return": { "status": "failed" } }
783 #
784 # 4. Migration is being performed and is not a block migration:
785 #
786 # -> { "execute": "query-migrate" }
787 # <- {
788 #       "return":{
789 #          "status":"active",
790 #          "ram":{
791 #             "transferred":123,
792 #             "remaining":123,
793 #             "total":246,
794 #             "total-time":12345,
795 #             "setup-time":12345,
796 #             "expected-downtime":12345,
797 #             "duplicate":123,
798 #             "normal":123,
799 #             "normal-bytes":123456,
800 #             "dirty-sync-count":15
801 #          }
802 #       }
803 #    }
804 #
805 # 5. Migration is being performed and is a block migration:
806 #
807 # -> { "execute": "query-migrate" }
808 # <- {
809 #       "return":{
810 #          "status":"active",
811 #          "ram":{
812 #             "total":1057024,
813 #             "remaining":1053304,
814 #             "transferred":3720,
815 #             "total-time":12345,
816 #             "setup-time":12345,
817 #             "expected-downtime":12345,
818 #             "duplicate":123,
819 #             "normal":123,
820 #             "normal-bytes":123456,
821 #             "dirty-sync-count":15
822 #          },
823 #          "disk":{
824 #             "total":20971520,
825 #             "remaining":20880384,
826 #             "transferred":91136
827 #          }
828 #       }
829 #    }
830 #
831 # 6. Migration is being performed and XBZRLE is active:
832 #
833 # -> { "execute": "query-migrate" }
834 # <- {
835 #       "return":{
836 #          "status":"active",
837 #          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
838 #          "ram":{
839 #             "total":1057024,
840 #             "remaining":1053304,
841 #             "transferred":3720,
842 #             "total-time":12345,
843 #             "setup-time":12345,
844 #             "expected-downtime":12345,
845 #             "duplicate":10,
846 #             "normal":3333,
847 #             "normal-bytes":3412992,
848 #             "dirty-sync-count":15
849 #          },
850 #          "xbzrle-cache":{
851 #             "cache-size":67108864,
852 #             "bytes":20971520,
853 #             "pages":2444343,
854 #             "cache-miss":2244,
855 #             "cache-miss-rate":0.123,
856 #             "overflow":34434
857 #          }
858 #       }
859 #    }
860 #
861 ##
862 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
863
864 ##
865 # @MigrationCapability:
866 #
867 # Migration capabilities enumeration
868 #
869 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
870 #          This feature allows us to minimize migration traffic for certain work
871 #          loads, by sending compressed difference of the pages
872 #
873 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
874 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
875 #          Disabled by default. (since 2.0)
876 #
877 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
878 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
879 #          source and target VM to support this feature. To enable it is sufficient
880 #          to enable the capability on the source VM. The feature is disabled by
881 #          default. (since 1.6)
882 #
883 # @compress: Use multiple compression threads to accelerate live migration.
884 #          This feature can help to reduce the migration traffic, by sending
885 #          compressed pages. Please note that if compress and xbzrle are both
886 #          on, compress only takes effect in the ram bulk stage, after that,
887 #          it will be disabled and only xbzrle takes effect, this can help to
888 #          minimize migration traffic. The feature is disabled by default.
889 #          (since 2.4 )
890 #
891 # @events: generate events for each migration state change
892 #          (since 2.4 )
893 #
894 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
895 #          to speed up convergence of RAM migration. (since 1.6)
896 #
897 # @postcopy-ram: Start executing on the migration target before all of RAM has
898 #          been migrated, pulling the remaining pages along as needed. NOTE: If
899 #          the migration fails during postcopy the VM will fail.  (since 2.6)
900 #
901 # @x-colo: If enabled, migration will never end, and the state of the VM on the
902 #        primary side will be migrated continuously to the VM on secondary
903 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
904 #        Non-stop Service. (since 2.8)
905 #
906 # @release-ram: if enabled, qemu will free the migrated ram pages on the source
907 #        during postcopy-ram migration. (since 2.9)
908 #
909 # @block: If enabled, QEMU will also migrate the contents of all block
910 #          devices.  Default is disabled.  A possible alternative uses
911 #          mirror jobs to a builtin NBD server on the destination, which
912 #          offers more flexibility.
913 #          (Since 2.10)
914 #
915 # @return-path: If enabled, migration will use the return path even
916 #               for precopy. (since 2.10)
917 #
918 # Since: 1.2
919 ##
920 { 'enum': 'MigrationCapability',
921   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
922            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
923            'block', 'return-path' ] }
924
925 ##
926 # @MigrationCapabilityStatus:
927 #
928 # Migration capability information
929 #
930 # @capability: capability enum
931 #
932 # @state: capability state bool
933 #
934 # Since: 1.2
935 ##
936 { 'struct': 'MigrationCapabilityStatus',
937   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
938
939 ##
940 # @migrate-set-capabilities:
941 #
942 # Enable/Disable the following migration capabilities (like xbzrle)
943 #
944 # @capabilities: json array of capability modifications to make
945 #
946 # Since: 1.2
947 #
948 # Example:
949 #
950 # -> { "execute": "migrate-set-capabilities" , "arguments":
951 #      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
952 #
953 ##
954 { 'command': 'migrate-set-capabilities',
955   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
956
957 ##
958 # @query-migrate-capabilities:
959 #
960 # Returns information about the current migration capabilities status
961 #
962 # Returns: @MigrationCapabilitiesStatus
963 #
964 # Since: 1.2
965 #
966 # Example:
967 #
968 # -> { "execute": "query-migrate-capabilities" }
969 # <- { "return": [
970 #       {"state": false, "capability": "xbzrle"},
971 #       {"state": false, "capability": "rdma-pin-all"},
972 #       {"state": false, "capability": "auto-converge"},
973 #       {"state": false, "capability": "zero-blocks"},
974 #       {"state": false, "capability": "compress"},
975 #       {"state": true, "capability": "events"},
976 #       {"state": false, "capability": "postcopy-ram"},
977 #       {"state": false, "capability": "x-colo"}
978 #    ]}
979 #
980 ##
981 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
982
983 ##
984 # @MigrationParameter:
985 #
986 # Migration parameters enumeration
987 #
988 # @compress-level: Set the compression level to be used in live migration,
989 #          the compression level is an integer between 0 and 9, where 0 means
990 #          no compression, 1 means the best compression speed, and 9 means best
991 #          compression ratio which will consume more CPU.
992 #
993 # @compress-threads: Set compression thread count to be used in live migration,
994 #          the compression thread count is an integer between 1 and 255.
995 #
996 # @decompress-threads: Set decompression thread count to be used in live
997 #          migration, the decompression thread count is an integer between 1
998 #          and 255. Usually, decompression is at least 4 times as fast as
999 #          compression, so set the decompress-threads to the number about 1/4
1000 #          of compress-threads is adequate.
1001 #
1002 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
1003 #                        when migration auto-converge is activated. The
1004 #                        default value is 20. (Since 2.7)
1005 #
1006 # @cpu-throttle-increment: throttle percentage increase each time
1007 #                          auto-converge detects that migration is not making
1008 #                          progress. The default value is 10. (Since 2.7)
1009 #
1010 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
1011 #             establishing a TLS connection over the migration data channel.
1012 #             On the outgoing side of the migration, the credentials must
1013 #             be for a 'client' endpoint, while for the incoming side the
1014 #             credentials must be for a 'server' endpoint. Setting this
1015 #             will enable TLS for all migrations. The default is unset,
1016 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
1017 #
1018 # @tls-hostname: hostname of the target host for the migration. This is
1019 #                required when using x509 based TLS credentials and the
1020 #                migration URI does not already include a hostname. For
1021 #                example if using fd: or exec: based migration, the
1022 #                hostname must be provided so that the server's x509
1023 #                certificate identity can be validated. (Since 2.7)
1024 #
1025 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1026 #                 bytes per second. (Since 2.8)
1027 #
1028 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1029 #                  downtime in milliseconds (Since 2.8)
1030 #
1031 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
1032 #          periodic mode. (Since 2.8)
1033 #
1034 # @block-incremental: Affects how much storage is migrated when the
1035 #       block migration capability is enabled.  When false, the entire
1036 #       storage backing chain is migrated into a flattened image at
1037 #       the destination; when true, only the active qcow2 layer is
1038 #       migrated and the destination must already have access to the
1039 #       same backing chain as was used on the source.  (since 2.10)
1040 #
1041 # Since: 2.4
1042 ##
1043 { 'enum': 'MigrationParameter',
1044   'data': ['compress-level', 'compress-threads', 'decompress-threads',
1045            'cpu-throttle-initial', 'cpu-throttle-increment',
1046            'tls-creds', 'tls-hostname', 'max-bandwidth',
1047            'downtime-limit', 'x-checkpoint-delay', 'block-incremental' ] }
1048
1049 ##
1050 # @MigrateSetParameters:
1051 #
1052 # @compress-level: compression level
1053 #
1054 # @compress-threads: compression thread count
1055 #
1056 # @decompress-threads: decompression thread count
1057 #
1058 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1059 #                        throttled when migration auto-converge is activated.
1060 #                        The default value is 20. (Since 2.7)
1061 #
1062 # @cpu-throttle-increment: throttle percentage increase each time
1063 #                          auto-converge detects that migration is not making
1064 #                          progress. The default value is 10. (Since 2.7)
1065 #
1066 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1067 #             for establishing a TLS connection over the migration data
1068 #             channel. On the outgoing side of the migration, the credentials
1069 #             must be for a 'client' endpoint, while for the incoming side the
1070 #             credentials must be for a 'server' endpoint. Setting this
1071 #             to a non-empty string enables TLS for all migrations.
1072 #             An empty string means that QEMU will use plain text mode for
1073 #             migration, rather than TLS (Since 2.9)
1074 #             Previously (since 2.7), this was reported by omitting
1075 #             tls-creds instead.
1076 #
1077 # @tls-hostname: hostname of the target host for the migration. This
1078 #                is required when using x509 based TLS credentials and the
1079 #                migration URI does not already include a hostname. For
1080 #                example if using fd: or exec: based migration, the
1081 #                hostname must be provided so that the server's x509
1082 #                certificate identity can be validated. (Since 2.7)
1083 #                An empty string means that QEMU will use the hostname
1084 #                associated with the migration URI, if any. (Since 2.9)
1085 #                Previously (since 2.7), this was reported by omitting
1086 #                tls-hostname instead.
1087 #
1088 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1089 #                 bytes per second. (Since 2.8)
1090 #
1091 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1092 #                  downtime in milliseconds (Since 2.8)
1093 #
1094 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1095 #
1096 # @block-incremental: Affects how much storage is migrated when the
1097 #       block migration capability is enabled.  When false, the entire
1098 #       storage backing chain is migrated into a flattened image at
1099 #       the destination; when true, only the active qcow2 layer is
1100 #       migrated and the destination must already have access to the
1101 #       same backing chain as was used on the source.  (since 2.10)
1102 #
1103 # Since: 2.4
1104 ##
1105 # TODO either fuse back into MigrationParameters, or make
1106 # MigrationParameters members mandatory
1107 { 'struct': 'MigrateSetParameters',
1108   'data': { '*compress-level': 'int',
1109             '*compress-threads': 'int',
1110             '*decompress-threads': 'int',
1111             '*cpu-throttle-initial': 'int',
1112             '*cpu-throttle-increment': 'int',
1113             '*tls-creds': 'StrOrNull',
1114             '*tls-hostname': 'StrOrNull',
1115             '*max-bandwidth': 'int',
1116             '*downtime-limit': 'int',
1117             '*x-checkpoint-delay': 'int',
1118             '*block-incremental': 'bool' } }
1119
1120 ##
1121 # @migrate-set-parameters:
1122 #
1123 # Set various migration parameters.
1124 #
1125 # Since: 2.4
1126 #
1127 # Example:
1128 #
1129 # -> { "execute": "migrate-set-parameters" ,
1130 #      "arguments": { "compress-level": 1 } }
1131 #
1132 ##
1133 { 'command': 'migrate-set-parameters', 'boxed': true,
1134   'data': 'MigrateSetParameters' }
1135
1136 ##
1137 # @MigrationParameters:
1138 #
1139 # The optional members aren't actually optional.
1140 #
1141 # @compress-level: compression level
1142 #
1143 # @compress-threads: compression thread count
1144 #
1145 # @decompress-threads: decompression thread count
1146 #
1147 # @cpu-throttle-initial: Initial percentage of time guest cpus are
1148 #                        throttled when migration auto-converge is activated.
1149 #                        (Since 2.7)
1150 #
1151 # @cpu-throttle-increment: throttle percentage increase each time
1152 #                          auto-converge detects that migration is not making
1153 #                          progress. (Since 2.7)
1154 #
1155 # @tls-creds: ID of the 'tls-creds' object that provides credentials
1156 #             for establishing a TLS connection over the migration data
1157 #             channel. On the outgoing side of the migration, the credentials
1158 #             must be for a 'client' endpoint, while for the incoming side the
1159 #             credentials must be for a 'server' endpoint.
1160 #             An empty string means that QEMU will use plain text mode for
1161 #             migration, rather than TLS (Since 2.7)
1162 #             Note: 2.8 reports this by omitting tls-creds instead.
1163 #
1164 # @tls-hostname: hostname of the target host for the migration. This
1165 #                is required when using x509 based TLS credentials and the
1166 #                migration URI does not already include a hostname. For
1167 #                example if using fd: or exec: based migration, the
1168 #                hostname must be provided so that the server's x509
1169 #                certificate identity can be validated. (Since 2.7)
1170 #                An empty string means that QEMU will use the hostname
1171 #                associated with the migration URI, if any. (Since 2.9)
1172 #                Note: 2.8 reports this by omitting tls-hostname instead.
1173 #
1174 # @max-bandwidth: to set maximum speed for migration. maximum speed in
1175 #                 bytes per second. (Since 2.8)
1176 #
1177 # @downtime-limit: set maximum tolerated downtime for migration. maximum
1178 #                  downtime in milliseconds (Since 2.8)
1179 #
1180 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1181 #
1182 # @block-incremental: Affects how much storage is migrated when the
1183 #       block migration capability is enabled.  When false, the entire
1184 #       storage backing chain is migrated into a flattened image at
1185 #       the destination; when true, only the active qcow2 layer is
1186 #       migrated and the destination must already have access to the
1187 #       same backing chain as was used on the source.  (since 2.10)
1188 #
1189 # Since: 2.4
1190 ##
1191 { 'struct': 'MigrationParameters',
1192   'data': { '*compress-level': 'int',
1193             '*compress-threads': 'int',
1194             '*decompress-threads': 'int',
1195             '*cpu-throttle-initial': 'int',
1196             '*cpu-throttle-increment': 'int',
1197             '*tls-creds': 'str',
1198             '*tls-hostname': 'str',
1199             '*max-bandwidth': 'int',
1200             '*downtime-limit': 'int',
1201             '*x-checkpoint-delay': 'int',
1202             '*block-incremental': 'bool' } }
1203
1204 ##
1205 # @query-migrate-parameters:
1206 #
1207 # Returns information about the current migration parameters
1208 #
1209 # Returns: @MigrationParameters
1210 #
1211 # Since: 2.4
1212 #
1213 # Example:
1214 #
1215 # -> { "execute": "query-migrate-parameters" }
1216 # <- { "return": {
1217 #          "decompress-threads": 2,
1218 #          "cpu-throttle-increment": 10,
1219 #          "compress-threads": 8,
1220 #          "compress-level": 1,
1221 #          "cpu-throttle-initial": 20,
1222 #          "max-bandwidth": 33554432,
1223 #          "downtime-limit": 300
1224 #       }
1225 #    }
1226 #
1227 ##
1228 { 'command': 'query-migrate-parameters',
1229   'returns': 'MigrationParameters' }
1230
1231 ##
1232 # @client_migrate_info:
1233 #
1234 # Set migration information for remote display.  This makes the server
1235 # ask the client to automatically reconnect using the new parameters
1236 # once migration finished successfully.  Only implemented for SPICE.
1237 #
1238 # @protocol:     must be "spice"
1239 # @hostname:     migration target hostname
1240 # @port:         spice tcp port for plaintext channels
1241 # @tls-port:     spice tcp port for tls-secured channels
1242 # @cert-subject: server certificate subject
1243 #
1244 # Since: 0.14.0
1245 #
1246 # Example:
1247 #
1248 # -> { "execute": "client_migrate_info",
1249 #      "arguments": { "protocol": "spice",
1250 #                     "hostname": "virt42.lab.kraxel.org",
1251 #                     "port": 1234 } }
1252 # <- { "return": {} }
1253 #
1254 ##
1255 { 'command': 'client_migrate_info',
1256   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1257             '*tls-port': 'int', '*cert-subject': 'str' } }
1258
1259 ##
1260 # @migrate-start-postcopy:
1261 #
1262 # Followup to a migration command to switch the migration to postcopy mode.
1263 # The postcopy-ram capability must be set before the original migration
1264 # command.
1265 #
1266 # Since: 2.5
1267 #
1268 # Example:
1269 #
1270 # -> { "execute": "migrate-start-postcopy" }
1271 # <- { "return": {} }
1272 #
1273 ##
1274 { 'command': 'migrate-start-postcopy' }
1275
1276 ##
1277 # @COLOMessage:
1278 #
1279 # The message transmission between Primary side and Secondary side.
1280 #
1281 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1282 #
1283 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1284 #
1285 # @checkpoint-reply: SVM gets PVM's checkpoint request
1286 #
1287 # @vmstate-send: VM's state will be sent by PVM.
1288 #
1289 # @vmstate-size: The total size of VMstate.
1290 #
1291 # @vmstate-received: VM's state has been received by SVM.
1292 #
1293 # @vmstate-loaded: VM's state has been loaded by SVM.
1294 #
1295 # Since: 2.8
1296 ##
1297 { 'enum': 'COLOMessage',
1298   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1299             'vmstate-send', 'vmstate-size', 'vmstate-received',
1300             'vmstate-loaded' ] }
1301
1302 ##
1303 # @COLOMode:
1304 #
1305 # The colo mode
1306 #
1307 # @unknown: unknown mode
1308 #
1309 # @primary: master side
1310 #
1311 # @secondary: slave side
1312 #
1313 # Since: 2.8
1314 ##
1315 { 'enum': 'COLOMode',
1316   'data': [ 'unknown', 'primary', 'secondary'] }
1317
1318 ##
1319 # @FailoverStatus:
1320 #
1321 # An enumeration of COLO failover status
1322 #
1323 # @none: no failover has ever happened
1324 #
1325 # @require: got failover requirement but not handled
1326 #
1327 # @active: in the process of doing failover
1328 #
1329 # @completed: finish the process of failover
1330 #
1331 # @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1332 #
1333 # Since: 2.8
1334 ##
1335 { 'enum': 'FailoverStatus',
1336   'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
1337
1338 ##
1339 # @x-colo-lost-heartbeat:
1340 #
1341 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
1342 # If this command is sent to the PVM, the Primary side will exit COLO mode.
1343 # If sent to the Secondary, the Secondary side will run failover work,
1344 # then takes over server operation to become the service VM.
1345 #
1346 # Since: 2.8
1347 #
1348 # Example:
1349 #
1350 # -> { "execute": "x-colo-lost-heartbeat" }
1351 # <- { "return": {} }
1352 #
1353 ##
1354 { 'command': 'x-colo-lost-heartbeat' }
1355
1356 ##
1357 # @MouseInfo:
1358 #
1359 # Information about a mouse device.
1360 #
1361 # @name: the name of the mouse device
1362 #
1363 # @index: the index of the mouse device
1364 #
1365 # @current: true if this device is currently receiving mouse events
1366 #
1367 # @absolute: true if this device supports absolute coordinates as input
1368 #
1369 # Since: 0.14.0
1370 ##
1371 { 'struct': 'MouseInfo',
1372   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1373            'absolute': 'bool'} }
1374
1375 ##
1376 # @query-mice:
1377 #
1378 # Returns information about each active mouse device
1379 #
1380 # Returns: a list of @MouseInfo for each device
1381 #
1382 # Since: 0.14.0
1383 #
1384 # Example:
1385 #
1386 # -> { "execute": "query-mice" }
1387 # <- { "return": [
1388 #          {
1389 #             "name":"QEMU Microsoft Mouse",
1390 #             "index":0,
1391 #             "current":false,
1392 #             "absolute":false
1393 #          },
1394 #          {
1395 #             "name":"QEMU PS/2 Mouse",
1396 #             "index":1,
1397 #             "current":true,
1398 #             "absolute":true
1399 #          }
1400 #       ]
1401 #    }
1402 #
1403 ##
1404 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
1405
1406 ##
1407 # @CpuInfoArch:
1408 #
1409 # An enumeration of cpu types that enable additional information during
1410 # @query-cpus.
1411 #
1412 # Since: 2.6
1413 ##
1414 { 'enum': 'CpuInfoArch',
1415   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1416
1417 ##
1418 # @CpuInfo:
1419 #
1420 # Information about a virtual CPU
1421 #
1422 # @CPU: the index of the virtual CPU
1423 #
1424 # @current: this only exists for backwards compatibility and should be ignored
1425 #
1426 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
1427 #          to a processor specific low power mode.
1428 #
1429 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
1430 #
1431 # @thread_id: ID of the underlying host thread
1432 #
1433 # @props: properties describing to which node/socket/core/thread
1434 #         virtual CPU belongs to, provided if supported by board (since 2.10)
1435 #
1436 # @arch: architecture of the cpu, which determines which additional fields
1437 #        will be listed (since 2.6)
1438 #
1439 # Since: 0.14.0
1440 #
1441 # Notes: @halted is a transient state that changes frequently.  By the time the
1442 #        data is sent to the client, the guest may no longer be halted.
1443 ##
1444 { 'union': 'CpuInfo',
1445   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1446            'qom_path': 'str', 'thread_id': 'int',
1447            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
1448   'discriminator': 'arch',
1449   'data': { 'x86': 'CpuInfoX86',
1450             'sparc': 'CpuInfoSPARC',
1451             'ppc': 'CpuInfoPPC',
1452             'mips': 'CpuInfoMIPS',
1453             'tricore': 'CpuInfoTricore',
1454             'other': 'CpuInfoOther' } }
1455
1456 ##
1457 # @CpuInfoX86:
1458 #
1459 # Additional information about a virtual i386 or x86_64 CPU
1460 #
1461 # @pc: the 64-bit instruction pointer
1462 #
1463 # Since: 2.6
1464 ##
1465 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1466
1467 ##
1468 # @CpuInfoSPARC:
1469 #
1470 # Additional information about a virtual SPARC CPU
1471 #
1472 # @pc: the PC component of the instruction pointer
1473 #
1474 # @npc: the NPC component of the instruction pointer
1475 #
1476 # Since: 2.6
1477 ##
1478 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1479
1480 ##
1481 # @CpuInfoPPC:
1482 #
1483 # Additional information about a virtual PPC CPU
1484 #
1485 # @nip: the instruction pointer
1486 #
1487 # Since: 2.6
1488 ##
1489 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1490
1491 ##
1492 # @CpuInfoMIPS:
1493 #
1494 # Additional information about a virtual MIPS CPU
1495 #
1496 # @PC: the instruction pointer
1497 #
1498 # Since: 2.6
1499 ##
1500 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1501
1502 ##
1503 # @CpuInfoTricore:
1504 #
1505 # Additional information about a virtual Tricore CPU
1506 #
1507 # @PC: the instruction pointer
1508 #
1509 # Since: 2.6
1510 ##
1511 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1512
1513 ##
1514 # @CpuInfoOther:
1515 #
1516 # No additional information is available about the virtual CPU
1517 #
1518 # Since: 2.6
1519 #
1520 ##
1521 { 'struct': 'CpuInfoOther', 'data': { } }
1522
1523 ##
1524 # @query-cpus:
1525 #
1526 # Returns a list of information about each virtual CPU.
1527 #
1528 # Returns: a list of @CpuInfo for each virtual CPU
1529 #
1530 # Since: 0.14.0
1531 #
1532 # Example:
1533 #
1534 # -> { "execute": "query-cpus" }
1535 # <- { "return": [
1536 #          {
1537 #             "CPU":0,
1538 #             "current":true,
1539 #             "halted":false,
1540 #             "qom_path":"/machine/unattached/device[0]",
1541 #             "arch":"x86",
1542 #             "pc":3227107138,
1543 #             "thread_id":3134
1544 #          },
1545 #          {
1546 #             "CPU":1,
1547 #             "current":false,
1548 #             "halted":true,
1549 #             "qom_path":"/machine/unattached/device[2]",
1550 #             "arch":"x86",
1551 #             "pc":7108165,
1552 #             "thread_id":3135
1553 #          }
1554 #       ]
1555 #    }
1556 #
1557 ##
1558 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1559
1560 ##
1561 # @IOThreadInfo:
1562 #
1563 # Information about an iothread
1564 #
1565 # @id: the identifier of the iothread
1566 #
1567 # @thread-id: ID of the underlying host thread
1568 #
1569 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1570 #               (since 2.9)
1571 #
1572 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
1573 #             configured (since 2.9)
1574 #
1575 # @poll-shrink: how many ns will be removed from polling time, 0 means that
1576 #               it's not configured (since 2.9)
1577 #
1578 # Since: 2.0
1579 ##
1580 { 'struct': 'IOThreadInfo',
1581   'data': {'id': 'str',
1582            'thread-id': 'int',
1583            'poll-max-ns': 'int',
1584            'poll-grow': 'int',
1585            'poll-shrink': 'int' } }
1586
1587 ##
1588 # @query-iothreads:
1589 #
1590 # Returns a list of information about each iothread.
1591 #
1592 # Note: this list excludes the QEMU main loop thread, which is not declared
1593 # using the -object iothread command-line option.  It is always the main thread
1594 # of the process.
1595 #
1596 # Returns: a list of @IOThreadInfo for each iothread
1597 #
1598 # Since: 2.0
1599 #
1600 # Example:
1601 #
1602 # -> { "execute": "query-iothreads" }
1603 # <- { "return": [
1604 #          {
1605 #             "id":"iothread0",
1606 #             "thread-id":3134
1607 #          },
1608 #          {
1609 #             "id":"iothread1",
1610 #             "thread-id":3135
1611 #          }
1612 #       ]
1613 #    }
1614 #
1615 ##
1616 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1617
1618 ##
1619 # @NetworkAddressFamily:
1620 #
1621 # The network address family
1622 #
1623 # @ipv4: IPV4 family
1624 #
1625 # @ipv6: IPV6 family
1626 #
1627 # @unix: unix socket
1628 #
1629 # @vsock: vsock family (since 2.8)
1630 #
1631 # @unknown: otherwise
1632 #
1633 # Since: 2.1
1634 ##
1635 { 'enum': 'NetworkAddressFamily',
1636   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1637
1638 ##
1639 # @VncBasicInfo:
1640 #
1641 # The basic information for vnc network connection
1642 #
1643 # @host: IP address
1644 #
1645 # @service: The service name of the vnc port. This may depend on the host
1646 #           system's service database so symbolic names should not be relied
1647 #           on.
1648 #
1649 # @family: address family
1650 #
1651 # @websocket: true in case the socket is a websocket (since 2.3).
1652 #
1653 # Since: 2.1
1654 ##
1655 { 'struct': 'VncBasicInfo',
1656   'data': { 'host': 'str',
1657             'service': 'str',
1658             'family': 'NetworkAddressFamily',
1659             'websocket': 'bool' } }
1660
1661 ##
1662 # @VncServerInfo:
1663 #
1664 # The network connection information for server
1665 #
1666 # @auth: authentication method used for
1667 #        the plain (non-websocket) VNC server
1668 #
1669 # Since: 2.1
1670 ##
1671 { 'struct': 'VncServerInfo',
1672   'base': 'VncBasicInfo',
1673   'data': { '*auth': 'str' } }
1674
1675 ##
1676 # @VncClientInfo:
1677 #
1678 # Information about a connected VNC client.
1679 #
1680 # @x509_dname: If x509 authentication is in use, the Distinguished
1681 #              Name of the client.
1682 #
1683 # @sasl_username: If SASL authentication is in use, the SASL username
1684 #                 used for authentication.
1685 #
1686 # Since: 0.14.0
1687 ##
1688 { 'struct': 'VncClientInfo',
1689   'base': 'VncBasicInfo',
1690   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1691
1692 ##
1693 # @VncInfo:
1694 #
1695 # Information about the VNC session.
1696 #
1697 # @enabled: true if the VNC server is enabled, false otherwise
1698 #
1699 # @host: The hostname the VNC server is bound to.  This depends on
1700 #        the name resolution on the host and may be an IP address.
1701 #
1702 # @family: 'ipv6' if the host is listening for IPv6 connections
1703 #                    'ipv4' if the host is listening for IPv4 connections
1704 #                    'unix' if the host is listening on a unix domain socket
1705 #                    'unknown' otherwise
1706 #
1707 # @service: The service name of the server's port.  This may depends
1708 #           on the host system's service database so symbolic names should not
1709 #           be relied on.
1710 #
1711 # @auth: the current authentication type used by the server
1712 #        'none' if no authentication is being used
1713 #        'vnc' if VNC authentication is being used
1714 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1715 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1716 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1717 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1718 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1719 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1720 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1721 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1722 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1723 #
1724 # @clients: a list of @VncClientInfo of all currently connected clients
1725 #
1726 # Since: 0.14.0
1727 ##
1728 { 'struct': 'VncInfo',
1729   'data': {'enabled': 'bool', '*host': 'str',
1730            '*family': 'NetworkAddressFamily',
1731            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1732
1733 ##
1734 # @VncPrimaryAuth:
1735 #
1736 # vnc primary authentication method.
1737 #
1738 # Since: 2.3
1739 ##
1740 { 'enum': 'VncPrimaryAuth',
1741   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1742             'tls', 'vencrypt', 'sasl' ] }
1743
1744 ##
1745 # @VncVencryptSubAuth:
1746 #
1747 # vnc sub authentication method with vencrypt.
1748 #
1749 # Since: 2.3
1750 ##
1751 { 'enum': 'VncVencryptSubAuth',
1752   'data': [ 'plain',
1753             'tls-none',  'x509-none',
1754             'tls-vnc',   'x509-vnc',
1755             'tls-plain', 'x509-plain',
1756             'tls-sasl',  'x509-sasl' ] }
1757
1758
1759 ##
1760 # @VncServerInfo2:
1761 #
1762 # The network connection information for server
1763 #
1764 # @auth: The current authentication type used by the servers
1765 #
1766 # @vencrypt: The vencrypt sub authentication type used by the
1767 #            servers, only specified in case auth == vencrypt.
1768 #
1769 # Since: 2.9
1770 ##
1771 { 'struct': 'VncServerInfo2',
1772   'base': 'VncBasicInfo',
1773   'data': { 'auth'      : 'VncPrimaryAuth',
1774             '*vencrypt' : 'VncVencryptSubAuth' } }
1775
1776
1777 ##
1778 # @VncInfo2:
1779 #
1780 # Information about a vnc server
1781 #
1782 # @id: vnc server name.
1783 #
1784 # @server: A list of @VncBasincInfo describing all listening sockets.
1785 #          The list can be empty (in case the vnc server is disabled).
1786 #          It also may have multiple entries: normal + websocket,
1787 #          possibly also ipv4 + ipv6 in the future.
1788 #
1789 # @clients: A list of @VncClientInfo of all currently connected clients.
1790 #           The list can be empty, for obvious reasons.
1791 #
1792 # @auth: The current authentication type used by the non-websockets servers
1793 #
1794 # @vencrypt: The vencrypt authentication type used by the servers,
1795 #            only specified in case auth == vencrypt.
1796 #
1797 # @display: The display device the vnc server is linked to.
1798 #
1799 # Since: 2.3
1800 ##
1801 { 'struct': 'VncInfo2',
1802   'data': { 'id'        : 'str',
1803             'server'    : ['VncServerInfo2'],
1804             'clients'   : ['VncClientInfo'],
1805             'auth'      : 'VncPrimaryAuth',
1806             '*vencrypt' : 'VncVencryptSubAuth',
1807             '*display'  : 'str' } }
1808
1809 ##
1810 # @query-vnc:
1811 #
1812 # Returns information about the current VNC server
1813 #
1814 # Returns: @VncInfo
1815 #
1816 # Since: 0.14.0
1817 #
1818 # Example:
1819 #
1820 # -> { "execute": "query-vnc" }
1821 # <- { "return": {
1822 #          "enabled":true,
1823 #          "host":"0.0.0.0",
1824 #          "service":"50402",
1825 #          "auth":"vnc",
1826 #          "family":"ipv4",
1827 #          "clients":[
1828 #             {
1829 #                "host":"127.0.0.1",
1830 #                "service":"50401",
1831 #                "family":"ipv4"
1832 #             }
1833 #          ]
1834 #       }
1835 #    }
1836 #
1837 ##
1838 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1839
1840 ##
1841 # @query-vnc-servers:
1842 #
1843 # Returns a list of vnc servers.  The list can be empty.
1844 #
1845 # Returns: a list of @VncInfo2
1846 #
1847 # Since: 2.3
1848 ##
1849 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1850
1851 ##
1852 # @SpiceBasicInfo:
1853 #
1854 # The basic information for SPICE network connection
1855 #
1856 # @host: IP address
1857 #
1858 # @port: port number
1859 #
1860 # @family: address family
1861 #
1862 # Since: 2.1
1863 ##
1864 { 'struct': 'SpiceBasicInfo',
1865   'data': { 'host': 'str',
1866             'port': 'str',
1867             'family': 'NetworkAddressFamily' } }
1868
1869 ##
1870 # @SpiceServerInfo:
1871 #
1872 # Information about a SPICE server
1873 #
1874 # @auth: authentication method
1875 #
1876 # Since: 2.1
1877 ##
1878 { 'struct': 'SpiceServerInfo',
1879   'base': 'SpiceBasicInfo',
1880   'data': { '*auth': 'str' } }
1881
1882 ##
1883 # @SpiceChannel:
1884 #
1885 # Information about a SPICE client channel.
1886 #
1887 # @connection-id: SPICE connection id number.  All channels with the same id
1888 #                 belong to the same SPICE session.
1889 #
1890 # @channel-type: SPICE channel type number.  "1" is the main control
1891 #                channel, filter for this one if you want to track spice
1892 #                sessions only
1893 #
1894 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1895 #              multiple channels of the same type exist, such as multiple
1896 #              display channels in a multihead setup
1897 #
1898 # @tls: true if the channel is encrypted, false otherwise.
1899 #
1900 # Since: 0.14.0
1901 ##
1902 { 'struct': 'SpiceChannel',
1903   'base': 'SpiceBasicInfo',
1904   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1905            'tls': 'bool'} }
1906
1907 ##
1908 # @SpiceQueryMouseMode:
1909 #
1910 # An enumeration of Spice mouse states.
1911 #
1912 # @client: Mouse cursor position is determined by the client.
1913 #
1914 # @server: Mouse cursor position is determined by the server.
1915 #
1916 # @unknown: No information is available about mouse mode used by
1917 #           the spice server.
1918 #
1919 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1920 #
1921 # Since: 1.1
1922 ##
1923 { 'enum': 'SpiceQueryMouseMode',
1924   'data': [ 'client', 'server', 'unknown' ] }
1925
1926 ##
1927 # @SpiceInfo:
1928 #
1929 # Information about the SPICE session.
1930 #
1931 # @enabled: true if the SPICE server is enabled, false otherwise
1932 #
1933 # @migrated: true if the last guest migration completed and spice
1934 #            migration had completed as well. false otherwise. (since 1.4)
1935 #
1936 # @host: The hostname the SPICE server is bound to.  This depends on
1937 #        the name resolution on the host and may be an IP address.
1938 #
1939 # @port: The SPICE server's port number.
1940 #
1941 # @compiled-version: SPICE server version.
1942 #
1943 # @tls-port: The SPICE server's TLS port number.
1944 #
1945 # @auth: the current authentication type used by the server
1946 #        'none'  if no authentication is being used
1947 #        'spice' uses SASL or direct TLS authentication, depending on command
1948 #                line options
1949 #
1950 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1951 #              be determined by the client or the server, or unknown if spice
1952 #              server doesn't provide this information. (since: 1.1)
1953 #
1954 # @channels: a list of @SpiceChannel for each active spice channel
1955 #
1956 # Since: 0.14.0
1957 ##
1958 { 'struct': 'SpiceInfo',
1959   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1960            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1961            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1962
1963 ##
1964 # @query-spice:
1965 #
1966 # Returns information about the current SPICE server
1967 #
1968 # Returns: @SpiceInfo
1969 #
1970 # Since: 0.14.0
1971 #
1972 # Example:
1973 #
1974 # -> { "execute": "query-spice" }
1975 # <- { "return": {
1976 #          "enabled": true,
1977 #          "auth": "spice",
1978 #          "port": 5920,
1979 #          "tls-port": 5921,
1980 #          "host": "0.0.0.0",
1981 #          "channels": [
1982 #             {
1983 #                "port": "54924",
1984 #                "family": "ipv4",
1985 #                "channel-type": 1,
1986 #                "connection-id": 1804289383,
1987 #                "host": "127.0.0.1",
1988 #                "channel-id": 0,
1989 #                "tls": true
1990 #             },
1991 #             {
1992 #                "port": "36710",
1993 #                "family": "ipv4",
1994 #                "channel-type": 4,
1995 #                "connection-id": 1804289383,
1996 #                "host": "127.0.0.1",
1997 #                "channel-id": 0,
1998 #                "tls": false
1999 #             },
2000 #             [ ... more channels follow ... ]
2001 #          ]
2002 #       }
2003 #    }
2004 #
2005 ##
2006 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
2007
2008 ##
2009 # @BalloonInfo:
2010 #
2011 # Information about the guest balloon device.
2012 #
2013 # @actual: the number of bytes the balloon currently contains
2014 #
2015 # Since: 0.14.0
2016 #
2017 ##
2018 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
2019
2020 ##
2021 # @query-balloon:
2022 #
2023 # Return information about the balloon device.
2024 #
2025 # Returns: @BalloonInfo on success
2026 #
2027 #          If the balloon driver is enabled but not functional because the KVM
2028 #          kernel module cannot support it, KvmMissingCap
2029 #
2030 #          If no balloon device is present, DeviceNotActive
2031 #
2032 # Since: 0.14.0
2033 #
2034 # Example:
2035 #
2036 # -> { "execute": "query-balloon" }
2037 # <- { "return": {
2038 #          "actual": 1073741824,
2039 #       }
2040 #    }
2041 #
2042 ##
2043 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
2044
2045 ##
2046 # @PciMemoryRange:
2047 #
2048 # A PCI device memory region
2049 #
2050 # @base: the starting address (guest physical)
2051 #
2052 # @limit: the ending address (guest physical)
2053 #
2054 # Since: 0.14.0
2055 ##
2056 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
2057
2058 ##
2059 # @PciMemoryRegion:
2060 #
2061 # Information about a PCI device I/O region.
2062 #
2063 # @bar: the index of the Base Address Register for this region
2064 #
2065 # @type: 'io' if the region is a PIO region
2066 #        'memory' if the region is a MMIO region
2067 #
2068 # @size: memory size
2069 #
2070 # @prefetch: if @type is 'memory', true if the memory is prefetchable
2071 #
2072 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
2073 #
2074 # Since: 0.14.0
2075 ##
2076 { 'struct': 'PciMemoryRegion',
2077   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
2078            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
2079
2080 ##
2081 # @PciBusInfo:
2082 #
2083 # Information about a bus of a PCI Bridge device
2084 #
2085 # @number: primary bus interface number.  This should be the number of the
2086 #          bus the device resides on.
2087 #
2088 # @secondary: secondary bus interface number.  This is the number of the
2089 #             main bus for the bridge
2090 #
2091 # @subordinate: This is the highest number bus that resides below the
2092 #               bridge.
2093 #
2094 # @io_range: The PIO range for all devices on this bridge
2095 #
2096 # @memory_range: The MMIO range for all devices on this bridge
2097 #
2098 # @prefetchable_range: The range of prefetchable MMIO for all devices on
2099 #                      this bridge
2100 #
2101 # Since: 2.4
2102 ##
2103 { 'struct': 'PciBusInfo',
2104   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
2105            'io_range': 'PciMemoryRange',
2106            'memory_range': 'PciMemoryRange',
2107            'prefetchable_range': 'PciMemoryRange' } }
2108
2109 ##
2110 # @PciBridgeInfo:
2111 #
2112 # Information about a PCI Bridge device
2113 #
2114 # @bus: information about the bus the device resides on
2115 #
2116 # @devices: a list of @PciDeviceInfo for each device on this bridge
2117 #
2118 # Since: 0.14.0
2119 ##
2120 { 'struct': 'PciBridgeInfo',
2121   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
2122
2123 ##
2124 # @PciDeviceClass:
2125 #
2126 # Information about the Class of a PCI device
2127 #
2128 # @desc: a string description of the device's class
2129 #
2130 # @class: the class code of the device
2131 #
2132 # Since: 2.4
2133 ##
2134 { 'struct': 'PciDeviceClass',
2135   'data': {'*desc': 'str', 'class': 'int'} }
2136
2137 ##
2138 # @PciDeviceId:
2139 #
2140 # Information about the Id of a PCI device
2141 #
2142 # @device: the PCI device id
2143 #
2144 # @vendor: the PCI vendor id
2145 #
2146 # Since: 2.4
2147 ##
2148 { 'struct': 'PciDeviceId',
2149   'data': {'device': 'int', 'vendor': 'int'} }
2150
2151 ##
2152 # @PciDeviceInfo:
2153 #
2154 # Information about a PCI device
2155 #
2156 # @bus: the bus number of the device
2157 #
2158 # @slot: the slot the device is located in
2159 #
2160 # @function: the function of the slot used by the device
2161 #
2162 # @class_info: the class of the device
2163 #
2164 # @id: the PCI device id
2165 #
2166 # @irq: if an IRQ is assigned to the device, the IRQ number
2167 #
2168 # @qdev_id: the device name of the PCI device
2169 #
2170 # @pci_bridge: if the device is a PCI bridge, the bridge information
2171 #
2172 # @regions: a list of the PCI I/O regions associated with the device
2173 #
2174 # Notes: the contents of @class_info.desc are not stable and should only be
2175 #        treated as informational.
2176 #
2177 # Since: 0.14.0
2178 ##
2179 { 'struct': 'PciDeviceInfo',
2180   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
2181            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
2182            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2183            'regions': ['PciMemoryRegion']} }
2184
2185 ##
2186 # @PciInfo:
2187 #
2188 # Information about a PCI bus
2189 #
2190 # @bus: the bus index
2191 #
2192 # @devices: a list of devices on this bus
2193 #
2194 # Since: 0.14.0
2195 ##
2196 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
2197
2198 ##
2199 # @query-pci:
2200 #
2201 # Return information about the PCI bus topology of the guest.
2202 #
2203 # Returns: a list of @PciInfo for each PCI bus. Each bus is
2204 # represented by a json-object, which has a key with a json-array of
2205 # all PCI devices attached to it. Each device is represented by a
2206 # json-object.
2207 #
2208 # Since: 0.14.0
2209 #
2210 # Example:
2211 #
2212 # -> { "execute": "query-pci" }
2213 # <- { "return": [
2214 #          {
2215 #             "bus": 0,
2216 #             "devices": [
2217 #                {
2218 #                   "bus": 0,
2219 #                   "qdev_id": "",
2220 #                   "slot": 0,
2221 #                   "class_info": {
2222 #                      "class": 1536,
2223 #                      "desc": "Host bridge"
2224 #                   },
2225 #                   "id": {
2226 #                      "device": 32902,
2227 #                      "vendor": 4663
2228 #                   },
2229 #                   "function": 0,
2230 #                   "regions": [
2231 #                   ]
2232 #                },
2233 #                {
2234 #                   "bus": 0,
2235 #                   "qdev_id": "",
2236 #                   "slot": 1,
2237 #                   "class_info": {
2238 #                      "class": 1537,
2239 #                      "desc": "ISA bridge"
2240 #                   },
2241 #                   "id": {
2242 #                      "device": 32902,
2243 #                      "vendor": 28672
2244 #                   },
2245 #                   "function": 0,
2246 #                   "regions": [
2247 #                   ]
2248 #                },
2249 #                {
2250 #                   "bus": 0,
2251 #                   "qdev_id": "",
2252 #                   "slot": 1,
2253 #                   "class_info": {
2254 #                      "class": 257,
2255 #                      "desc": "IDE controller"
2256 #                   },
2257 #                   "id": {
2258 #                      "device": 32902,
2259 #                      "vendor": 28688
2260 #                   },
2261 #                   "function": 1,
2262 #                   "regions": [
2263 #                      {
2264 #                         "bar": 4,
2265 #                         "size": 16,
2266 #                         "address": 49152,
2267 #                         "type": "io"
2268 #                      }
2269 #                   ]
2270 #                },
2271 #                {
2272 #                   "bus": 0,
2273 #                   "qdev_id": "",
2274 #                   "slot": 2,
2275 #                   "class_info": {
2276 #                      "class": 768,
2277 #                      "desc": "VGA controller"
2278 #                   },
2279 #                   "id": {
2280 #                      "device": 4115,
2281 #                      "vendor": 184
2282 #                   },
2283 #                   "function": 0,
2284 #                   "regions": [
2285 #                      {
2286 #                         "prefetch": true,
2287 #                         "mem_type_64": false,
2288 #                         "bar": 0,
2289 #                         "size": 33554432,
2290 #                         "address": 4026531840,
2291 #                         "type": "memory"
2292 #                      },
2293 #                      {
2294 #                         "prefetch": false,
2295 #                         "mem_type_64": false,
2296 #                         "bar": 1,
2297 #                         "size": 4096,
2298 #                         "address": 4060086272,
2299 #                         "type": "memory"
2300 #                      },
2301 #                      {
2302 #                         "prefetch": false,
2303 #                         "mem_type_64": false,
2304 #                         "bar": 6,
2305 #                         "size": 65536,
2306 #                         "address": -1,
2307 #                         "type": "memory"
2308 #                      }
2309 #                   ]
2310 #                },
2311 #                {
2312 #                   "bus": 0,
2313 #                   "qdev_id": "",
2314 #                   "irq": 11,
2315 #                   "slot": 4,
2316 #                   "class_info": {
2317 #                      "class": 1280,
2318 #                      "desc": "RAM controller"
2319 #                   },
2320 #                   "id": {
2321 #                      "device": 6900,
2322 #                      "vendor": 4098
2323 #                   },
2324 #                   "function": 0,
2325 #                   "regions": [
2326 #                      {
2327 #                         "bar": 0,
2328 #                         "size": 32,
2329 #                         "address": 49280,
2330 #                         "type": "io"
2331 #                      }
2332 #                   ]
2333 #                }
2334 #             ]
2335 #          }
2336 #       ]
2337 #    }
2338 #
2339 # Note: This example has been shortened as the real response is too long.
2340 #
2341 ##
2342 { 'command': 'query-pci', 'returns': ['PciInfo'] }
2343
2344 ##
2345 # @quit:
2346 #
2347 # This command will cause the QEMU process to exit gracefully.  While every
2348 # attempt is made to send the QMP response before terminating, this is not
2349 # guaranteed.  When using this interface, a premature EOF would not be
2350 # unexpected.
2351 #
2352 # Since: 0.14.0
2353 #
2354 # Example:
2355 #
2356 # -> { "execute": "quit" }
2357 # <- { "return": {} }
2358 ##
2359 { 'command': 'quit' }
2360
2361 ##
2362 # @stop:
2363 #
2364 # Stop all guest VCPU execution.
2365 #
2366 # Since:  0.14.0
2367 #
2368 # Notes:  This function will succeed even if the guest is already in the stopped
2369 #         state.  In "inmigrate" state, it will ensure that the guest
2370 #         remains paused once migration finishes, as if the -S option was
2371 #         passed on the command line.
2372 #
2373 # Example:
2374 #
2375 # -> { "execute": "stop" }
2376 # <- { "return": {} }
2377 #
2378 ##
2379 { 'command': 'stop' }
2380
2381 ##
2382 # @system_reset:
2383 #
2384 # Performs a hard reset of a guest.
2385 #
2386 # Since: 0.14.0
2387 #
2388 # Example:
2389 #
2390 # -> { "execute": "system_reset" }
2391 # <- { "return": {} }
2392 #
2393 ##
2394 { 'command': 'system_reset' }
2395
2396 ##
2397 # @system_powerdown:
2398 #
2399 # Requests that a guest perform a powerdown operation.
2400 #
2401 # Since: 0.14.0
2402 #
2403 # Notes: A guest may or may not respond to this command.  This command
2404 #        returning does not indicate that a guest has accepted the request or
2405 #        that it has shut down.  Many guests will respond to this command by
2406 #        prompting the user in some way.
2407 # Example:
2408 #
2409 # -> { "execute": "system_powerdown" }
2410 # <- { "return": {} }
2411 #
2412 ##
2413 { 'command': 'system_powerdown' }
2414
2415 ##
2416 # @cpu:
2417 #
2418 # This command is a nop that is only provided for the purposes of compatibility.
2419 #
2420 # Since: 0.14.0
2421 #
2422 # Notes: Do not use this command.
2423 ##
2424 { 'command': 'cpu', 'data': {'index': 'int'} }
2425
2426 ##
2427 # @cpu-add:
2428 #
2429 # Adds CPU with specified ID
2430 #
2431 # @id: ID of CPU to be created, valid values [0..max_cpus)
2432 #
2433 # Returns: Nothing on success
2434 #
2435 # Since: 1.5
2436 #
2437 # Example:
2438 #
2439 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2440 # <- { "return": {} }
2441 #
2442 ##
2443 { 'command': 'cpu-add', 'data': {'id': 'int'} }
2444
2445 ##
2446 # @memsave:
2447 #
2448 # Save a portion of guest memory to a file.
2449 #
2450 # @val: the virtual address of the guest to start from
2451 #
2452 # @size: the size of memory region to save
2453 #
2454 # @filename: the file to save the memory to as binary data
2455 #
2456 # @cpu-index: the index of the virtual CPU to use for translating the
2457 #                       virtual address (defaults to CPU 0)
2458 #
2459 # Returns: Nothing on success
2460 #
2461 # Since: 0.14.0
2462 #
2463 # Notes: Errors were not reliably returned until 1.1
2464 #
2465 # Example:
2466 #
2467 # -> { "execute": "memsave",
2468 #      "arguments": { "val": 10,
2469 #                     "size": 100,
2470 #                     "filename": "/tmp/virtual-mem-dump" } }
2471 # <- { "return": {} }
2472 #
2473 ##
2474 { 'command': 'memsave',
2475   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
2476
2477 ##
2478 # @pmemsave:
2479 #
2480 # Save a portion of guest physical memory to a file.
2481 #
2482 # @val: the physical address of the guest to start from
2483 #
2484 # @size: the size of memory region to save
2485 #
2486 # @filename: the file to save the memory to as binary data
2487 #
2488 # Returns: Nothing on success
2489 #
2490 # Since: 0.14.0
2491 #
2492 # Notes: Errors were not reliably returned until 1.1
2493 #
2494 # Example:
2495 #
2496 # -> { "execute": "pmemsave",
2497 #      "arguments": { "val": 10,
2498 #                     "size": 100,
2499 #                     "filename": "/tmp/physical-mem-dump" } }
2500 # <- { "return": {} }
2501 #
2502 ##
2503 { 'command': 'pmemsave',
2504   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
2505
2506 ##
2507 # @cont:
2508 #
2509 # Resume guest VCPU execution.
2510 #
2511 # Since:  0.14.0
2512 #
2513 # Returns:  If successful, nothing
2514 #
2515 # Notes:  This command will succeed if the guest is currently running.  It
2516 #         will also succeed if the guest is in the "inmigrate" state; in
2517 #         this case, the effect of the command is to make sure the guest
2518 #         starts once migration finishes, removing the effect of the -S
2519 #         command line option if it was passed.
2520 #
2521 # Example:
2522 #
2523 # -> { "execute": "cont" }
2524 # <- { "return": {} }
2525 #
2526 ##
2527 { 'command': 'cont' }
2528
2529 ##
2530 # @system_wakeup:
2531 #
2532 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
2533 #
2534 # Since:  1.1
2535 #
2536 # Returns:  nothing.
2537 #
2538 # Example:
2539 #
2540 # -> { "execute": "system_wakeup" }
2541 # <- { "return": {} }
2542 #
2543 ##
2544 { 'command': 'system_wakeup' }
2545
2546 ##
2547 # @inject-nmi:
2548 #
2549 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
2550 # The command fails when the guest doesn't support injecting.
2551 #
2552 # Returns:  If successful, nothing
2553 #
2554 # Since:  0.14.0
2555 #
2556 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
2557 #
2558 # Example:
2559 #
2560 # -> { "execute": "inject-nmi" }
2561 # <- { "return": {} }
2562 #
2563 ##
2564 { 'command': 'inject-nmi' }
2565
2566 ##
2567 # @set_link:
2568 #
2569 # Sets the link status of a virtual network adapter.
2570 #
2571 # @name: the device name of the virtual network adapter
2572 #
2573 # @up: true to set the link status to be up
2574 #
2575 # Returns: Nothing on success
2576 #          If @name is not a valid network device, DeviceNotFound
2577 #
2578 # Since: 0.14.0
2579 #
2580 # Notes: Not all network adapters support setting link status.  This command
2581 #        will succeed even if the network adapter does not support link status
2582 #        notification.
2583 #
2584 # Example:
2585 #
2586 # -> { "execute": "set_link",
2587 #      "arguments": { "name": "e1000.0", "up": false } }
2588 # <- { "return": {} }
2589 #
2590 ##
2591 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
2592
2593 ##
2594 # @balloon:
2595 #
2596 # Request the balloon driver to change its balloon size.
2597 #
2598 # @value: the target size of the balloon in bytes
2599 #
2600 # Returns: Nothing on success
2601 #          If the balloon driver is enabled but not functional because the KVM
2602 #            kernel module cannot support it, KvmMissingCap
2603 #          If no balloon device is present, DeviceNotActive
2604 #
2605 # Notes: This command just issues a request to the guest.  When it returns,
2606 #        the balloon size may not have changed.  A guest can change the balloon
2607 #        size independent of this command.
2608 #
2609 # Since: 0.14.0
2610 #
2611 # Example:
2612 #
2613 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2614 # <- { "return": {} }
2615 #
2616 ##
2617 { 'command': 'balloon', 'data': {'value': 'int'} }
2618
2619 ##
2620 # @Abort:
2621 #
2622 # This action can be used to test transaction failure.
2623 #
2624 # Since: 1.6
2625 ##
2626 { 'struct': 'Abort',
2627   'data': { } }
2628
2629 ##
2630 # @ActionCompletionMode:
2631 #
2632 # An enumeration of Transactional completion modes.
2633 #
2634 # @individual: Do not attempt to cancel any other Actions if any Actions fail
2635 #              after the Transaction request succeeds. All Actions that
2636 #              can complete successfully will do so without waiting on others.
2637 #              This is the default.
2638 #
2639 # @grouped: If any Action fails after the Transaction succeeds, cancel all
2640 #           Actions. Actions do not complete until all Actions are ready to
2641 #           complete. May be rejected by Actions that do not support this
2642 #           completion mode.
2643 #
2644 # Since: 2.5
2645 ##
2646 { 'enum': 'ActionCompletionMode',
2647   'data': [ 'individual', 'grouped' ] }
2648
2649 ##
2650 # @TransactionAction:
2651 #
2652 # A discriminated record of operations that can be performed with
2653 # @transaction. Action @type can be:
2654 #
2655 # - @abort: since 1.6
2656 # - @block-dirty-bitmap-add: since 2.5
2657 # - @block-dirty-bitmap-clear: since 2.5
2658 # - @blockdev-backup: since 2.3
2659 # - @blockdev-snapshot: since 2.5
2660 # - @blockdev-snapshot-internal-sync: since 1.7
2661 # - @blockdev-snapshot-sync: since 1.1
2662 # - @drive-backup: since 1.6
2663 #
2664 # Since: 1.1
2665 ##
2666 { 'union': 'TransactionAction',
2667   'data': {
2668        'abort': 'Abort',
2669        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
2670        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2671        'blockdev-backup': 'BlockdevBackup',
2672        'blockdev-snapshot': 'BlockdevSnapshot',
2673        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2674        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2675        'drive-backup': 'DriveBackup'
2676    } }
2677
2678 ##
2679 # @TransactionProperties:
2680 #
2681 # Optional arguments to modify the behavior of a Transaction.
2682 #
2683 # @completion-mode: Controls how jobs launched asynchronously by
2684 #                   Actions will complete or fail as a group.
2685 #                   See @ActionCompletionMode for details.
2686 #
2687 # Since: 2.5
2688 ##
2689 { 'struct': 'TransactionProperties',
2690   'data': {
2691        '*completion-mode': 'ActionCompletionMode'
2692   }
2693 }
2694
2695 ##
2696 # @transaction:
2697 #
2698 # Executes a number of transactionable QMP commands atomically. If any
2699 # operation fails, then the entire set of actions will be abandoned and the
2700 # appropriate error returned.
2701 #
2702 # For external snapshots, the dictionary contains the device, the file to use for
2703 # the new snapshot, and the format.  The default format, if not specified, is
2704 # qcow2.
2705 #
2706 # Each new snapshot defaults to being created by QEMU (wiping any
2707 # contents if the file already exists), but it is also possible to reuse
2708 # an externally-created file.  In the latter case, you should ensure that
2709 # the new image file has the same contents as the current one; QEMU cannot
2710 # perform any meaningful check.  Typically this is achieved by using the
2711 # current image file as the backing file for the new image.
2712 #
2713 # On failure, the original disks pre-snapshot attempt will be used.
2714 #
2715 # For internal snapshots, the dictionary contains the device and the snapshot's
2716 # name.  If an internal snapshot matching name already exists, the request will
2717 # be rejected.  Only some image formats support it, for example, qcow2, rbd,
2718 # and sheepdog.
2719 #
2720 # On failure, qemu will try delete the newly created internal snapshot in the
2721 # transaction.  When an I/O error occurs during deletion, the user needs to fix
2722 # it later with qemu-img or other command.
2723 #
2724 # @actions: List of @TransactionAction;
2725 #           information needed for the respective operations.
2726 #
2727 # @properties: structure of additional options to control the
2728 #              execution of the transaction. See @TransactionProperties
2729 #              for additional detail.
2730 #
2731 # Returns: nothing on success
2732 #
2733 #          Errors depend on the operations of the transaction
2734 #
2735 # Note: The transaction aborts on the first failure.  Therefore, there will be
2736 # information on only one failed operation returned in an error condition, and
2737 # subsequent actions will not have been attempted.
2738 #
2739 # Since: 1.1
2740 #
2741 # Example:
2742 #
2743 # -> { "execute": "transaction",
2744 #      "arguments": { "actions": [
2745 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2746 #                                      "snapshot-file": "/some/place/my-image",
2747 #                                      "format": "qcow2" } },
2748 #          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2749 #                                      "snapshot-file": "/some/place/my-image2",
2750 #                                      "snapshot-node-name": "node3432",
2751 #                                      "mode": "existing",
2752 #                                      "format": "qcow2" } },
2753 #          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2754 #                                      "snapshot-file": "/some/place/my-image2",
2755 #                                      "mode": "existing",
2756 #                                      "format": "qcow2" } },
2757 #          { "type": "blockdev-snapshot-internal-sync", "data" : {
2758 #                                      "device": "ide-hd2",
2759 #                                      "name": "snapshot0" } } ] } }
2760 # <- { "return": {} }
2761 #
2762 ##
2763 { 'command': 'transaction',
2764   'data': { 'actions': [ 'TransactionAction' ],
2765             '*properties': 'TransactionProperties'
2766           }
2767 }
2768
2769 ##
2770 # @human-monitor-command:
2771 #
2772 # Execute a command on the human monitor and return the output.
2773 #
2774 # @command-line: the command to execute in the human monitor
2775 #
2776 # @cpu-index: The CPU to use for commands that require an implicit CPU
2777 #
2778 # Returns: the output of the command as a string
2779 #
2780 # Since: 0.14.0
2781 #
2782 # Notes: This command only exists as a stop-gap.  Its use is highly
2783 #        discouraged.  The semantics of this command are not
2784 #        guaranteed: this means that command names, arguments and
2785 #        responses can change or be removed at ANY time.  Applications
2786 #        that rely on long term stability guarantees should NOT
2787 #        use this command.
2788 #
2789 #        Known limitations:
2790 #
2791 #        * This command is stateless, this means that commands that depend
2792 #          on state information (such as getfd) might not work
2793 #
2794 #        * Commands that prompt the user for data don't currently work
2795 #
2796 # Example:
2797 #
2798 # -> { "execute": "human-monitor-command",
2799 #      "arguments": { "command-line": "info kvm" } }
2800 # <- { "return": "kvm support: enabled\r\n" }
2801 #
2802 ##
2803 { 'command': 'human-monitor-command',
2804   'data': {'command-line': 'str', '*cpu-index': 'int'},
2805   'returns': 'str' }
2806
2807 ##
2808 # @migrate_cancel:
2809 #
2810 # Cancel the current executing migration process.
2811 #
2812 # Returns: nothing on success
2813 #
2814 # Notes: This command succeeds even if there is no migration process running.
2815 #
2816 # Since: 0.14.0
2817 #
2818 # Example:
2819 #
2820 # -> { "execute": "migrate_cancel" }
2821 # <- { "return": {} }
2822 #
2823 ##
2824 { 'command': 'migrate_cancel' }
2825
2826 ##
2827 # @migrate_set_downtime:
2828 #
2829 # Set maximum tolerated downtime for migration.
2830 #
2831 # @value: maximum downtime in seconds
2832 #
2833 # Returns: nothing on success
2834 #
2835 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2836 #
2837 # Since: 0.14.0
2838 #
2839 # Example:
2840 #
2841 # -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2842 # <- { "return": {} }
2843 #
2844 ##
2845 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2846
2847 ##
2848 # @migrate_set_speed:
2849 #
2850 # Set maximum speed for migration.
2851 #
2852 # @value: maximum speed in bytes per second.
2853 #
2854 # Returns: nothing on success
2855 #
2856 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
2857 #
2858 # Since: 0.14.0
2859 #
2860 # Example:
2861 #
2862 # -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2863 # <- { "return": {} }
2864 #
2865 ##
2866 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2867
2868 ##
2869 # @migrate-set-cache-size:
2870 #
2871 # Set cache size to be used by XBZRLE migration
2872 #
2873 # @value: cache size in bytes
2874 #
2875 # The size will be rounded down to the nearest power of 2.
2876 # The cache size can be modified before and during ongoing migration
2877 #
2878 # Returns: nothing on success
2879 #
2880 # Since: 1.2
2881 #
2882 # Example:
2883 #
2884 # -> { "execute": "migrate-set-cache-size",
2885 #      "arguments": { "value": 536870912 } }
2886 # <- { "return": {} }
2887 #
2888 ##
2889 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2890
2891 ##
2892 # @query-migrate-cache-size:
2893 #
2894 # Query migration XBZRLE cache size
2895 #
2896 # Returns: XBZRLE cache size in bytes
2897 #
2898 # Since: 1.2
2899 #
2900 # Example:
2901 #
2902 # -> { "execute": "query-migrate-cache-size" }
2903 # <- { "return": 67108864 }
2904 #
2905 ##
2906 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2907
2908 ##
2909 # @ObjectPropertyInfo:
2910 #
2911 # @name: the name of the property
2912 #
2913 # @type: the type of the property.  This will typically come in one of four
2914 #        forms:
2915 #
2916 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2917 #           These types are mapped to the appropriate JSON type.
2918 #
2919 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
2920 #           device type name.  Child properties create the composition tree.
2921 #
2922 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2923 #           device type name.  Link properties form the device model graph.
2924 #
2925 # Since: 1.2
2926 ##
2927 { 'struct': 'ObjectPropertyInfo',
2928   'data': { 'name': 'str', 'type': 'str' } }
2929
2930 ##
2931 # @qom-list:
2932 #
2933 # This command will list any properties of a object given a path in the object
2934 # model.
2935 #
2936 # @path: the path within the object model.  See @qom-get for a description of
2937 #        this parameter.
2938 #
2939 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2940 #          object.
2941 #
2942 # Since: 1.2
2943 ##
2944 { 'command': 'qom-list',
2945   'data': { 'path': 'str' },
2946   'returns': [ 'ObjectPropertyInfo' ] }
2947
2948 ##
2949 # @qom-get:
2950 #
2951 # This command will get a property from a object model path and return the
2952 # value.
2953 #
2954 # @path: The path within the object model.  There are two forms of supported
2955 #        paths--absolute and partial paths.
2956 #
2957 #        Absolute paths are derived from the root object and can follow child<>
2958 #        or link<> properties.  Since they can follow link<> properties, they
2959 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2960 #        and are prefixed  with a leading slash.
2961 #
2962 #        Partial paths look like relative filenames.  They do not begin
2963 #        with a prefix.  The matching rules for partial paths are subtle but
2964 #        designed to make specifying objects easy.  At each level of the
2965 #        composition tree, the partial path is matched as an absolute path.
2966 #        The first match is not returned.  At least two matches are searched
2967 #        for.  A successful result is only returned if only one match is
2968 #        found.  If more than one match is found, a flag is return to
2969 #        indicate that the match was ambiguous.
2970 #
2971 # @property: The property name to read
2972 #
2973 # Returns: The property value.  The type depends on the property
2974 #          type. child<> and link<> properties are returned as #str
2975 #          pathnames.  All integer property types (u8, u16, etc) are
2976 #          returned as #int.
2977 #
2978 # Since: 1.2
2979 ##
2980 { 'command': 'qom-get',
2981   'data': { 'path': 'str', 'property': 'str' },
2982   'returns': 'any' }
2983
2984 ##
2985 # @qom-set:
2986 #
2987 # This command will set a property from a object model path.
2988 #
2989 # @path: see @qom-get for a description of this parameter
2990 #
2991 # @property: the property name to set
2992 #
2993 # @value: a value who's type is appropriate for the property type.  See @qom-get
2994 #         for a description of type mapping.
2995 #
2996 # Since: 1.2
2997 ##
2998 { 'command': 'qom-set',
2999   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
3000
3001 ##
3002 # @set_password:
3003 #
3004 # Sets the password of a remote display session.
3005 #
3006 # @protocol: `vnc' to modify the VNC server password
3007 #            `spice' to modify the Spice server password
3008 #
3009 # @password: the new password
3010 #
3011 # @connected: how to handle existing clients when changing the
3012 #                       password.  If nothing is specified, defaults to `keep'
3013 #                       `fail' to fail the command if clients are connected
3014 #                       `disconnect' to disconnect existing clients
3015 #                       `keep' to maintain existing clients
3016 #
3017 # Returns: Nothing on success
3018 #          If Spice is not enabled, DeviceNotFound
3019 #
3020 # Since: 0.14.0
3021 #
3022 # Example:
3023 #
3024 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
3025 #                                                "password": "secret" } }
3026 # <- { "return": {} }
3027 #
3028 ##
3029 { 'command': 'set_password',
3030   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
3031
3032 ##
3033 # @expire_password:
3034 #
3035 # Expire the password of a remote display server.
3036 #
3037 # @protocol: the name of the remote display protocol `vnc' or `spice'
3038 #
3039 # @time: when to expire the password.
3040 #        `now' to expire the password immediately
3041 #        `never' to cancel password expiration
3042 #        `+INT' where INT is the number of seconds from now (integer)
3043 #        `INT' where INT is the absolute time in seconds
3044 #
3045 # Returns: Nothing on success
3046 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
3047 #
3048 # Since: 0.14.0
3049 #
3050 # Notes: Time is relative to the server and currently there is no way to
3051 #        coordinate server time with client time.  It is not recommended to
3052 #        use the absolute time version of the @time parameter unless you're
3053 #        sure you are on the same machine as the QEMU instance.
3054 #
3055 # Example:
3056 #
3057 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
3058 #                                                   "time": "+60" } }
3059 # <- { "return": {} }
3060 #
3061 ##
3062 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
3063
3064 ##
3065 # @change-vnc-password:
3066 #
3067 # Change the VNC server password.
3068 #
3069 # @password:  the new password to use with VNC authentication
3070 #
3071 # Since: 1.1
3072 #
3073 # Notes:  An empty password in this command will set the password to the empty
3074 #         string.  Existing clients are unaffected by executing this command.
3075 ##
3076 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
3077
3078 ##
3079 # @change:
3080 #
3081 # This command is multiple commands multiplexed together.
3082 #
3083 # @device: This is normally the name of a block device but it may also be 'vnc'.
3084 #          when it's 'vnc', then sub command depends on @target
3085 #
3086 # @target: If @device is a block device, then this is the new filename.
3087 #          If @device is 'vnc', then if the value 'password' selects the vnc
3088 #          change password command.   Otherwise, this specifies a new server URI
3089 #          address to listen to for VNC connections.
3090 #
3091 # @arg:    If @device is a block device, then this is an optional format to open
3092 #          the device with.
3093 #          If @device is 'vnc' and @target is 'password', this is the new VNC
3094 #          password to set.  See change-vnc-password for additional notes.
3095 #
3096 # Returns: Nothing on success.
3097 #          If @device is not a valid block device, DeviceNotFound
3098 #
3099 # Notes:  This interface is deprecated, and it is strongly recommended that you
3100 #         avoid using it.  For changing block devices, use
3101 #         blockdev-change-medium; for changing VNC parameters, use
3102 #         change-vnc-password.
3103 #
3104 # Since: 0.14.0
3105 #
3106 # Example:
3107 #
3108 # 1. Change a removable medium
3109 #
3110 # -> { "execute": "change",
3111 #      "arguments": { "device": "ide1-cd0",
3112 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
3113 # <- { "return": {} }
3114 #
3115 # 2. Change VNC password
3116 #
3117 # -> { "execute": "change",
3118 #      "arguments": { "device": "vnc", "target": "password",
3119 #                     "arg": "foobar1" } }
3120 # <- { "return": {} }
3121 #
3122 ##
3123 { 'command': 'change',
3124   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
3125
3126 ##
3127 # @ObjectTypeInfo:
3128 #
3129 # This structure describes a search result from @qom-list-types
3130 #
3131 # @name: the type name found in the search
3132 #
3133 # @abstract: the type is abstract and can't be directly instantiated.
3134 #            Omitted if false. (since 2.10)
3135 #
3136 # @parent: Name of parent type, if any (since 2.10)
3137 #
3138 # Since: 1.1
3139 ##
3140 { 'struct': 'ObjectTypeInfo',
3141   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
3142
3143 ##
3144 # @qom-list-types:
3145 #
3146 # This command will return a list of types given search parameters
3147 #
3148 # @implements: if specified, only return types that implement this type name
3149 #
3150 # @abstract: if true, include abstract types in the results
3151 #
3152 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3153 #
3154 # Since: 1.1
3155 ##
3156 { 'command': 'qom-list-types',
3157   'data': { '*implements': 'str', '*abstract': 'bool' },
3158   'returns': [ 'ObjectTypeInfo' ] }
3159
3160 ##
3161 # @DevicePropertyInfo:
3162 #
3163 # Information about device properties.
3164 #
3165 # @name: the name of the property
3166 # @type: the typename of the property
3167 # @description: if specified, the description of the property.
3168 #               (since 2.2)
3169 #
3170 # Since: 1.2
3171 ##
3172 { 'struct': 'DevicePropertyInfo',
3173   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
3174
3175 ##
3176 # @device-list-properties:
3177 #
3178 # List properties associated with a device.
3179 #
3180 # @typename: the type name of a device
3181 #
3182 # Returns: a list of DevicePropertyInfo describing a devices properties
3183 #
3184 # Since: 1.2
3185 ##
3186 { 'command': 'device-list-properties',
3187   'data': { 'typename': 'str'},
3188   'returns': [ 'DevicePropertyInfo' ] }
3189
3190 ##
3191 # @migrate:
3192 #
3193 # Migrates the current running guest to another Virtual Machine.
3194 #
3195 # @uri: the Uniform Resource Identifier of the destination VM
3196 #
3197 # @blk: do block migration (full disk copy)
3198 #
3199 # @inc: incremental disk copy migration
3200 #
3201 # @detach: this argument exists only for compatibility reasons and
3202 #          is ignored by QEMU
3203 #
3204 # Returns: nothing on success
3205 #
3206 # Since: 0.14.0
3207 #
3208 # Notes:
3209 #
3210 # 1. The 'query-migrate' command should be used to check migration's progress
3211 #    and final result (this information is provided by the 'status' member)
3212 #
3213 # 2. All boolean arguments default to false
3214 #
3215 # 3. The user Monitor's "detach" argument is invalid in QMP and should not
3216 #    be used
3217 #
3218 # Example:
3219 #
3220 # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3221 # <- { "return": {} }
3222 #
3223 ##
3224 { 'command': 'migrate',
3225   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
3226
3227 ##
3228 # @migrate-incoming:
3229 #
3230 # Start an incoming migration, the qemu must have been started
3231 # with -incoming defer
3232 #
3233 # @uri: The Uniform Resource Identifier identifying the source or
3234 #       address to listen on
3235 #
3236 # Returns: nothing on success
3237 #
3238 # Since: 2.3
3239 #
3240 # Notes:
3241 #
3242 # 1. It's a bad idea to use a string for the uri, but it needs to stay
3243 #    compatible with -incoming and the format of the uri is already exposed
3244 #    above libvirt.
3245 #
3246 # 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3247 #    be used.
3248 #
3249 # 3. The uri format is the same as for -incoming
3250 #
3251 # Example:
3252 #
3253 # -> { "execute": "migrate-incoming",
3254 #      "arguments": { "uri": "tcp::4446" } }
3255 # <- { "return": {} }
3256 #
3257 ##
3258 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3259
3260 ##
3261 # @xen-save-devices-state:
3262 #
3263 # Save the state of all devices to file. The RAM and the block devices
3264 # of the VM are not saved by this command.
3265 #
3266 # @filename: the file to save the state of the devices to as binary
3267 # data. See xen-save-devices-state.txt for a description of the binary
3268 # format.
3269 #
3270 # Returns: Nothing on success
3271 #
3272 # Since: 1.1
3273 #
3274 # Example:
3275 #
3276 # -> { "execute": "xen-save-devices-state",
3277 #      "arguments": { "filename": "/tmp/save" } }
3278 # <- { "return": {} }
3279 #
3280 ##
3281 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
3282
3283 ##
3284 # @xen-set-global-dirty-log:
3285 #
3286 # Enable or disable the global dirty log mode.
3287 #
3288 # @enable: true to enable, false to disable.
3289 #
3290 # Returns: nothing
3291 #
3292 # Since: 1.3
3293 #
3294 # Example:
3295 #
3296 # -> { "execute": "xen-set-global-dirty-log",
3297 #      "arguments": { "enable": true } }
3298 # <- { "return": {} }
3299 #
3300 ##
3301 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3302
3303 ##
3304 # @device_add:
3305 #
3306 # @driver: the name of the new device's driver
3307 #
3308 # @bus: the device's parent bus (device tree path)
3309 #
3310 # @id: the device's ID, must be unique
3311 #
3312 # Additional arguments depend on the type.
3313 #
3314 # Add a device.
3315 #
3316 # Notes:
3317 # 1. For detailed information about this command, please refer to the
3318 #    'docs/qdev-device-use.txt' file.
3319 #
3320 # 2. It's possible to list device properties by running QEMU with the
3321 #    "-device DEVICE,help" command-line argument, where DEVICE is the
3322 #    device's name
3323 #
3324 # Example:
3325 #
3326 # -> { "execute": "device_add",
3327 #      "arguments": { "driver": "e1000", "id": "net1",
3328 #                     "bus": "pci.0",
3329 #                     "mac": "52:54:00:12:34:56" } }
3330 # <- { "return": {} }
3331 #
3332 # TODO: This command effectively bypasses QAPI completely due to its
3333 # "additional arguments" business.  It shouldn't have been added to
3334 # the schema in this form.  It should be qapified properly, or
3335 # replaced by a properly qapified command.
3336 #
3337 # Since: 0.13
3338 ##
3339 { 'command': 'device_add',
3340   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
3341   'gen': false } # so we can get the additional arguments
3342
3343 ##
3344 # @device_del:
3345 #
3346 # Remove a device from a guest
3347 #
3348 # @id: the device's ID or QOM path
3349 #
3350 # Returns: Nothing on success
3351 #          If @id is not a valid device, DeviceNotFound
3352 #
3353 # Notes: When this command completes, the device may not be removed from the
3354 #        guest.  Hot removal is an operation that requires guest cooperation.
3355 #        This command merely requests that the guest begin the hot removal
3356 #        process.  Completion of the device removal process is signaled with a
3357 #        DEVICE_DELETED event. Guest reset will automatically complete removal
3358 #        for all devices.
3359 #
3360 # Since: 0.14.0
3361 #
3362 # Example:
3363 #
3364 # -> { "execute": "device_del",
3365 #      "arguments": { "id": "net1" } }
3366 # <- { "return": {} }
3367 #
3368 # -> { "execute": "device_del",
3369 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3370 # <- { "return": {} }
3371 #
3372 ##
3373 { 'command': 'device_del', 'data': {'id': 'str'} }
3374
3375 ##
3376 # @DumpGuestMemoryFormat:
3377 #
3378 # An enumeration of guest-memory-dump's format.
3379 #
3380 # @elf: elf format
3381 #
3382 # @kdump-zlib: kdump-compressed format with zlib-compressed
3383 #
3384 # @kdump-lzo: kdump-compressed format with lzo-compressed
3385 #
3386 # @kdump-snappy: kdump-compressed format with snappy-compressed
3387 #
3388 # Since: 2.0
3389 ##
3390 { 'enum': 'DumpGuestMemoryFormat',
3391   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3392
3393 ##
3394 # @dump-guest-memory:
3395 #
3396 # Dump guest's memory to vmcore. It is a synchronous operation that can take
3397 # very long depending on the amount of guest memory.
3398 #
3399 # @paging: if true, do paging to get guest's memory mapping. This allows
3400 #          using gdb to process the core file.
3401 #
3402 #          IMPORTANT: this option can make QEMU allocate several gigabytes
3403 #                     of RAM. This can happen for a large guest, or a
3404 #                     malicious guest pretending to be large.
3405 #
3406 #          Also, paging=true has the following limitations:
3407 #
3408 #             1. The guest may be in a catastrophic state or can have corrupted
3409 #                memory, which cannot be trusted
3410 #             2. The guest can be in real-mode even if paging is enabled. For
3411 #                example, the guest uses ACPI to sleep, and ACPI sleep state
3412 #                goes in real-mode
3413 #             3. Currently only supported on i386 and x86_64.
3414 #
3415 # @protocol: the filename or file descriptor of the vmcore. The supported
3416 #            protocols are:
3417 #
3418 #            1. file: the protocol starts with "file:", and the following
3419 #               string is the file's path.
3420 #            2. fd: the protocol starts with "fd:", and the following string
3421 #               is the fd's name.
3422 #
3423 # @detach: if true, QMP will return immediately rather than
3424 #          waiting for the dump to finish. The user can track progress
3425 #          using "query-dump". (since 2.6).
3426 #
3427 # @begin: if specified, the starting physical address.
3428 #
3429 # @length: if specified, the memory size, in bytes. If you don't
3430 #          want to dump all guest's memory, please specify the start @begin
3431 #          and @length
3432 #
3433 # @format: if specified, the format of guest memory dump. But non-elf
3434 #          format is conflict with paging and filter, ie. @paging, @begin and
3435 #          @length is not allowed to be specified with non-elf @format at the
3436 #          same time (since 2.0)
3437 #
3438 # Note: All boolean arguments default to false
3439 #
3440 # Returns: nothing on success
3441 #
3442 # Since: 1.2
3443 #
3444 # Example:
3445 #
3446 # -> { "execute": "dump-guest-memory",
3447 #      "arguments": { "protocol": "fd:dump" } }
3448 # <- { "return": {} }
3449 #
3450 ##
3451 { 'command': 'dump-guest-memory',
3452   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3453             '*begin': 'int', '*length': 'int',
3454             '*format': 'DumpGuestMemoryFormat'} }
3455
3456 ##
3457 # @DumpStatus:
3458 #
3459 # Describe the status of a long-running background guest memory dump.
3460 #
3461 # @none: no dump-guest-memory has started yet.
3462 #
3463 # @active: there is one dump running in background.
3464 #
3465 # @completed: the last dump has finished successfully.
3466 #
3467 # @failed: the last dump has failed.
3468 #
3469 # Since: 2.6
3470 ##
3471 { 'enum': 'DumpStatus',
3472   'data': [ 'none', 'active', 'completed', 'failed' ] }
3473
3474 ##
3475 # @DumpQueryResult:
3476 #
3477 # The result format for 'query-dump'.
3478 #
3479 # @status: enum of @DumpStatus, which shows current dump status
3480 #
3481 # @completed: bytes written in latest dump (uncompressed)
3482 #
3483 # @total: total bytes to be written in latest dump (uncompressed)
3484 #
3485 # Since: 2.6
3486 ##
3487 { 'struct': 'DumpQueryResult',
3488   'data': { 'status': 'DumpStatus',
3489             'completed': 'int',
3490             'total': 'int' } }
3491
3492 ##
3493 # @query-dump:
3494 #
3495 # Query latest dump status.
3496 #
3497 # Returns: A @DumpStatus object showing the dump status.
3498 #
3499 # Since: 2.6
3500 #
3501 # Example:
3502 #
3503 # -> { "execute": "query-dump" }
3504 # <- { "return": { "status": "active", "completed": 1024000,
3505 #                  "total": 2048000 } }
3506 #
3507 ##
3508 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3509
3510 ##
3511 # @DumpGuestMemoryCapability:
3512 #
3513 # A list of the available formats for dump-guest-memory
3514 #
3515 # Since: 2.0
3516 ##
3517 { 'struct': 'DumpGuestMemoryCapability',
3518   'data': {
3519       'formats': ['DumpGuestMemoryFormat'] } }
3520
3521 ##
3522 # @query-dump-guest-memory-capability:
3523 #
3524 # Returns the available formats for dump-guest-memory
3525 #
3526 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
3527 #           dump-guest-memory
3528 #
3529 # Since: 2.0
3530 #
3531 # Example:
3532 #
3533 # -> { "execute": "query-dump-guest-memory-capability" }
3534 # <- { "return": { "formats":
3535 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3536 #
3537 ##
3538 { 'command': 'query-dump-guest-memory-capability',
3539   'returns': 'DumpGuestMemoryCapability' }
3540
3541 ##
3542 # @dump-skeys:
3543 #
3544 # Dump guest's storage keys
3545 #
3546 # @filename: the path to the file to dump to
3547 #
3548 # This command is only supported on s390 architecture.
3549 #
3550 # Since: 2.5
3551 #
3552 # Example:
3553 #
3554 # -> { "execute": "dump-skeys",
3555 #      "arguments": { "filename": "/tmp/skeys" } }
3556 # <- { "return": {} }
3557 #
3558 ##
3559 { 'command': 'dump-skeys',
3560   'data': { 'filename': 'str' } }
3561
3562 ##
3563 # @netdev_add:
3564 #
3565 # Add a network backend.
3566 #
3567 # @type: the type of network backend.  Current valid values are 'user', 'tap',
3568 #        'vde', 'socket', 'dump' and 'bridge'
3569 #
3570 # @id: the name of the new network backend
3571 #
3572 # Additional arguments depend on the type.
3573 #
3574 # TODO: This command effectively bypasses QAPI completely due to its
3575 # "additional arguments" business.  It shouldn't have been added to
3576 # the schema in this form.  It should be qapified properly, or
3577 # replaced by a properly qapified command.
3578 #
3579 # Since: 0.14.0
3580 #
3581 # Returns: Nothing on success
3582 #          If @type is not a valid network backend, DeviceNotFound
3583 #
3584 # Example:
3585 #
3586 # -> { "execute": "netdev_add",
3587 #      "arguments": { "type": "user", "id": "netdev1",
3588 #                     "dnssearch": "example.org" } }
3589 # <- { "return": {} }
3590 #
3591 ##
3592 { 'command': 'netdev_add',
3593   'data': {'type': 'str', 'id': 'str'},
3594   'gen': false }                # so we can get the additional arguments
3595
3596 ##
3597 # @netdev_del:
3598 #
3599 # Remove a network backend.
3600 #
3601 # @id: the name of the network backend to remove
3602 #
3603 # Returns: Nothing on success
3604 #          If @id is not a valid network backend, DeviceNotFound
3605 #
3606 # Since: 0.14.0
3607 #
3608 # Example:
3609 #
3610 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3611 # <- { "return": {} }
3612 #
3613 ##
3614 { 'command': 'netdev_del', 'data': {'id': 'str'} }
3615
3616 ##
3617 # @object-add:
3618 #
3619 # Create a QOM object.
3620 #
3621 # @qom-type: the class name for the object to be created
3622 #
3623 # @id: the name of the new object
3624 #
3625 # @props: a dictionary of properties to be passed to the backend
3626 #
3627 # Returns: Nothing on success
3628 #          Error if @qom-type is not a valid class name
3629 #
3630 # Since: 2.0
3631 #
3632 # Example:
3633 #
3634 # -> { "execute": "object-add",
3635 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
3636 #                     "props": { "filename": "/dev/hwrng" } } }
3637 # <- { "return": {} }
3638 #
3639 ##
3640 { 'command': 'object-add',
3641   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
3642
3643 ##
3644 # @object-del:
3645 #
3646 # Remove a QOM object.
3647 #
3648 # @id: the name of the QOM object to remove
3649 #
3650 # Returns: Nothing on success
3651 #          Error if @id is not a valid id for a QOM object
3652 #
3653 # Since: 2.0
3654 #
3655 # Example:
3656 #
3657 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3658 # <- { "return": {} }
3659 #
3660 ##
3661 { 'command': 'object-del', 'data': {'id': 'str'} }
3662
3663 ##
3664 # @NetdevNoneOptions:
3665 #
3666 # Use it alone to have zero network devices.
3667 #
3668 # Since: 1.2
3669 ##
3670 { 'struct': 'NetdevNoneOptions',
3671   'data': { } }
3672
3673 ##
3674 # @NetLegacyNicOptions:
3675 #
3676 # Create a new Network Interface Card.
3677 #
3678 # @netdev: id of -netdev to connect to
3679 #
3680 # @macaddr: MAC address
3681 #
3682 # @model: device model (e1000, rtl8139, virtio etc.)
3683 #
3684 # @addr: PCI device address
3685 #
3686 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
3687 #
3688 # Since: 1.2
3689 ##
3690 { 'struct': 'NetLegacyNicOptions',
3691   'data': {
3692     '*netdev':  'str',
3693     '*macaddr': 'str',
3694     '*model':   'str',
3695     '*addr':    'str',
3696     '*vectors': 'uint32' } }
3697
3698 ##
3699 # @String:
3700 #
3701 # A fat type wrapping 'str', to be embedded in lists.
3702 #
3703 # Since: 1.2
3704 ##
3705 { 'struct': 'String',
3706   'data': {
3707     'str': 'str' } }
3708
3709 ##
3710 # @NetdevUserOptions:
3711 #
3712 # Use the user mode network stack which requires no administrator privilege to
3713 # run.
3714 #
3715 # @hostname: client hostname reported by the builtin DHCP server
3716 #
3717 # @restrict: isolate the guest from the host
3718 #
3719 # @ipv4: whether to support IPv4, default true for enabled
3720 #        (since 2.6)
3721 #
3722 # @ipv6: whether to support IPv6, default true for enabled
3723 #        (since 2.6)
3724 #
3725 # @ip: legacy parameter, use net= instead
3726 #
3727 # @net: IP network address that the guest will see, in the
3728 #       form addr[/netmask] The netmask is optional, and can be
3729 #       either in the form a.b.c.d or as a number of valid top-most
3730 #       bits. Default is 10.0.2.0/24.
3731 #
3732 # @host: guest-visible address of the host
3733 #
3734 # @tftp: root directory of the built-in TFTP server
3735 #
3736 # @bootfile: BOOTP filename, for use with tftp=
3737 #
3738 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
3739 #             assign
3740 #
3741 # @dns: guest-visible address of the virtual nameserver
3742 #
3743 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
3744 #             to the guest
3745 #
3746 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
3747 #               2.6). The network prefix is given in the usual
3748 #               hexadecimal IPv6 address notation.
3749 #
3750 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
3751 #                  (since 2.6)
3752 #
3753 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
3754 #
3755 # @ipv6-dns: guest-visible IPv6 address of the virtual
3756 #            nameserver (since 2.6)
3757 #
3758 # @smb: root directory of the built-in SMB server
3759 #
3760 # @smbserver: IP address of the built-in SMB server
3761 #
3762 # @hostfwd: redirect incoming TCP or UDP host connections to guest
3763 #           endpoints
3764 #
3765 # @guestfwd: forward guest TCP connections
3766 #
3767 # Since: 1.2
3768 ##
3769 { 'struct': 'NetdevUserOptions',
3770   'data': {
3771     '*hostname':  'str',
3772     '*restrict':  'bool',
3773     '*ipv4':      'bool',
3774     '*ipv6':      'bool',
3775     '*ip':        'str',
3776     '*net':       'str',
3777     '*host':      'str',
3778     '*tftp':      'str',
3779     '*bootfile':  'str',
3780     '*dhcpstart': 'str',
3781     '*dns':       'str',
3782     '*dnssearch': ['String'],
3783     '*ipv6-prefix':      'str',
3784     '*ipv6-prefixlen':   'int',
3785     '*ipv6-host':        'str',
3786     '*ipv6-dns':         'str',
3787     '*smb':       'str',
3788     '*smbserver': 'str',
3789     '*hostfwd':   ['String'],
3790     '*guestfwd':  ['String'] } }
3791
3792 ##
3793 # @NetdevTapOptions:
3794 #
3795 # Connect the host TAP network interface name to the VLAN.
3796 #
3797 # @ifname: interface name
3798 #
3799 # @fd: file descriptor of an already opened tap
3800 #
3801 # @fds: multiple file descriptors of already opened multiqueue capable
3802 # tap
3803 #
3804 # @script: script to initialize the interface
3805 #
3806 # @downscript: script to shut down the interface
3807 #
3808 # @br: bridge name (since 2.8)
3809 #
3810 # @helper: command to execute to configure bridge
3811 #
3812 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
3813 #
3814 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
3815 #
3816 # @vhost: enable vhost-net network accelerator
3817 #
3818 # @vhostfd: file descriptor of an already opened vhost net device
3819 #
3820 # @vhostfds: file descriptors of multiple already opened vhost net
3821 # devices
3822 #
3823 # @vhostforce: vhost on for non-MSIX virtio guests
3824 #
3825 # @queues: number of queues to be created for multiqueue capable tap
3826 #
3827 # @poll-us: maximum number of microseconds that could
3828 # be spent on busy polling for tap (since 2.7)
3829 #
3830 # Since: 1.2
3831 ##
3832 { 'struct': 'NetdevTapOptions',
3833   'data': {
3834     '*ifname':     'str',
3835     '*fd':         'str',
3836     '*fds':        'str',
3837     '*script':     'str',
3838     '*downscript': 'str',
3839     '*br':         'str',
3840     '*helper':     'str',
3841     '*sndbuf':     'size',
3842     '*vnet_hdr':   'bool',
3843     '*vhost':      'bool',
3844     '*vhostfd':    'str',
3845     '*vhostfds':   'str',
3846     '*vhostforce': 'bool',
3847     '*queues':     'uint32',
3848     '*poll-us':    'uint32'} }
3849
3850 ##
3851 # @NetdevSocketOptions:
3852 #
3853 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3854 # socket connection.
3855 #
3856 # @fd: file descriptor of an already opened socket
3857 #
3858 # @listen: port number, and optional hostname, to listen on
3859 #
3860 # @connect: port number, and optional hostname, to connect to
3861 #
3862 # @mcast: UDP multicast address and port number
3863 #
3864 # @localaddr: source address and port for multicast and udp packets
3865 #
3866 # @udp: UDP unicast address and port number
3867 #
3868 # Since: 1.2
3869 ##
3870 { 'struct': 'NetdevSocketOptions',
3871   'data': {
3872     '*fd':        'str',
3873     '*listen':    'str',
3874     '*connect':   'str',
3875     '*mcast':     'str',
3876     '*localaddr': 'str',
3877     '*udp':       'str' } }
3878
3879 ##
3880 # @NetdevL2TPv3Options:
3881 #
3882 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3883 #
3884 # @src: source address
3885 #
3886 # @dst: destination address
3887 #
3888 # @srcport: source port - mandatory for udp, optional for ip
3889 #
3890 # @dstport: destination port - mandatory for udp, optional for ip
3891 #
3892 # @ipv6: force the use of ipv6
3893 #
3894 # @udp: use the udp version of l2tpv3 encapsulation
3895 #
3896 # @cookie64: use 64 bit coookies
3897 #
3898 # @counter: have sequence counter
3899 #
3900 # @pincounter: pin sequence counter to zero -
3901 #              workaround for buggy implementations or
3902 #              networks with packet reorder
3903 #
3904 # @txcookie: 32 or 64 bit transmit cookie
3905 #
3906 # @rxcookie: 32 or 64 bit receive cookie
3907 #
3908 # @txsession: 32 bit transmit session
3909 #
3910 # @rxsession: 32 bit receive session - if not specified
3911 #             set to the same value as transmit
3912 #
3913 # @offset: additional offset - allows the insertion of
3914 #          additional application-specific data before the packet payload
3915 #
3916 # Since: 2.1
3917 ##
3918 { 'struct': 'NetdevL2TPv3Options',
3919   'data': {
3920     'src':          'str',
3921     'dst':          'str',
3922     '*srcport':     'str',
3923     '*dstport':     'str',
3924     '*ipv6':        'bool',
3925     '*udp':         'bool',
3926     '*cookie64':    'bool',
3927     '*counter':     'bool',
3928     '*pincounter':  'bool',
3929     '*txcookie':    'uint64',
3930     '*rxcookie':    'uint64',
3931     'txsession':    'uint32',
3932     '*rxsession':   'uint32',
3933     '*offset':      'uint32' } }
3934
3935 ##
3936 # @NetdevVdeOptions:
3937 #
3938 # Connect the VLAN to a vde switch running on the host.
3939 #
3940 # @sock: socket path
3941 #
3942 # @port: port number
3943 #
3944 # @group: group owner of socket
3945 #
3946 # @mode: permissions for socket
3947 #
3948 # Since: 1.2
3949 ##
3950 { 'struct': 'NetdevVdeOptions',
3951   'data': {
3952     '*sock':  'str',
3953     '*port':  'uint16',
3954     '*group': 'str',
3955     '*mode':  'uint16' } }
3956
3957 ##
3958 # @NetdevDumpOptions:
3959 #
3960 # Dump VLAN network traffic to a file.
3961 #
3962 # @len: per-packet size limit (64k default). Understands [TGMKkb]
3963 # suffixes.
3964 #
3965 # @file: dump file path (default is qemu-vlan0.pcap)
3966 #
3967 # Since: 1.2
3968 ##
3969 { 'struct': 'NetdevDumpOptions',
3970   'data': {
3971     '*len':  'size',
3972     '*file': 'str' } }
3973
3974 ##
3975 # @NetdevBridgeOptions:
3976 #
3977 # Connect a host TAP network interface to a host bridge device.
3978 #
3979 # @br: bridge name
3980 #
3981 # @helper: command to execute to configure bridge
3982 #
3983 # Since: 1.2
3984 ##
3985 { 'struct': 'NetdevBridgeOptions',
3986   'data': {
3987     '*br':     'str',
3988     '*helper': 'str' } }
3989
3990 ##
3991 # @NetdevHubPortOptions:
3992 #
3993 # Connect two or more net clients through a software hub.
3994 #
3995 # @hubid: hub identifier number
3996 #
3997 # Since: 1.2
3998 ##
3999 { 'struct': 'NetdevHubPortOptions',
4000   'data': {
4001     'hubid':     'int32' } }
4002
4003 ##
4004 # @NetdevNetmapOptions:
4005 #
4006 # Connect a client to a netmap-enabled NIC or to a VALE switch port
4007 #
4008 # @ifname: Either the name of an existing network interface supported by
4009 #          netmap, or the name of a VALE port (created on the fly).
4010 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
4011 #          YYY are non-negative integers. XXX identifies a switch and
4012 #          YYY identifies a port of the switch. VALE ports having the
4013 #          same XXX are therefore connected to the same switch.
4014 #
4015 # @devname: path of the netmap device (default: '/dev/netmap').
4016 #
4017 # Since: 2.0
4018 ##
4019 { 'struct': 'NetdevNetmapOptions',
4020   'data': {
4021     'ifname':     'str',
4022     '*devname':    'str' } }
4023
4024 ##
4025 # @NetdevVhostUserOptions:
4026 #
4027 # Vhost-user network backend
4028 #
4029 # @chardev: name of a unix socket chardev
4030 #
4031 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
4032 #
4033 # @queues: number of queues to be created for multiqueue vhost-user
4034 #          (default: 1) (Since 2.5)
4035 #
4036 # Since: 2.1
4037 ##
4038 { 'struct': 'NetdevVhostUserOptions',
4039   'data': {
4040     'chardev':        'str',
4041     '*vhostforce':    'bool',
4042     '*queues':        'int' } }
4043
4044 ##
4045 # @NetClientDriver:
4046 #
4047 # Available netdev drivers.
4048 #
4049 # Since: 2.7
4050 ##
4051 { 'enum': 'NetClientDriver',
4052   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
4053             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
4054
4055 ##
4056 # @Netdev:
4057 #
4058 # Captures the configuration of a network device.
4059 #
4060 # @id: identifier for monitor commands.
4061 #
4062 # @type: Specify the driver used for interpreting remaining arguments.
4063 #
4064 # Since: 1.2
4065 #
4066 # 'l2tpv3' - since 2.1
4067 ##
4068 { 'union': 'Netdev',
4069   'base': { 'id': 'str', 'type': 'NetClientDriver' },
4070   'discriminator': 'type',
4071   'data': {
4072     'none':     'NetdevNoneOptions',
4073     'nic':      'NetLegacyNicOptions',
4074     'user':     'NetdevUserOptions',
4075     'tap':      'NetdevTapOptions',
4076     'l2tpv3':   'NetdevL2TPv3Options',
4077     'socket':   'NetdevSocketOptions',
4078     'vde':      'NetdevVdeOptions',
4079     'dump':     'NetdevDumpOptions',
4080     'bridge':   'NetdevBridgeOptions',
4081     'hubport':  'NetdevHubPortOptions',
4082     'netmap':   'NetdevNetmapOptions',
4083     'vhost-user': 'NetdevVhostUserOptions' } }
4084
4085 ##
4086 # @NetLegacy:
4087 #
4088 # Captures the configuration of a network device; legacy.
4089 #
4090 # @vlan: vlan number
4091 #
4092 # @id: identifier for monitor commands
4093 #
4094 # @name: identifier for monitor commands, ignored if @id is present
4095 #
4096 # @opts: device type specific properties (legacy)
4097 #
4098 # Since: 1.2
4099 ##
4100 { 'struct': 'NetLegacy',
4101   'data': {
4102     '*vlan': 'int32',
4103     '*id':   'str',
4104     '*name': 'str',
4105     'opts':  'NetLegacyOptions' } }
4106
4107 ##
4108 # @NetLegacyOptionsType:
4109 #
4110 # Since: 1.2
4111 ##
4112 { 'enum': 'NetLegacyOptionsType',
4113   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
4114            'dump', 'bridge', 'netmap', 'vhost-user'] }
4115
4116 ##
4117 # @NetLegacyOptions:
4118 #
4119 # Like Netdev, but for use only by the legacy command line options
4120 #
4121 # Since: 1.2
4122 ##
4123 { 'union': 'NetLegacyOptions',
4124   'base': { 'type': 'NetLegacyOptionsType' },
4125   'discriminator': 'type',
4126   'data': {
4127     'none':     'NetdevNoneOptions',
4128     'nic':      'NetLegacyNicOptions',
4129     'user':     'NetdevUserOptions',
4130     'tap':      'NetdevTapOptions',
4131     'l2tpv3':   'NetdevL2TPv3Options',
4132     'socket':   'NetdevSocketOptions',
4133     'vde':      'NetdevVdeOptions',
4134     'dump':     'NetdevDumpOptions',
4135     'bridge':   'NetdevBridgeOptions',
4136     'netmap':   'NetdevNetmapOptions',
4137     'vhost-user': 'NetdevVhostUserOptions' } }
4138
4139 ##
4140 # @NetFilterDirection:
4141 #
4142 # Indicates whether a netfilter is attached to a netdev's transmit queue or
4143 # receive queue or both.
4144 #
4145 # @all: the filter is attached both to the receive and the transmit
4146 #       queue of the netdev (default).
4147 #
4148 # @rx: the filter is attached to the receive queue of the netdev,
4149 #      where it will receive packets sent to the netdev.
4150 #
4151 # @tx: the filter is attached to the transmit queue of the netdev,
4152 #      where it will receive packets sent by the netdev.
4153 #
4154 # Since: 2.5
4155 ##
4156 { 'enum': 'NetFilterDirection',
4157   'data': [ 'all', 'rx', 'tx' ] }
4158
4159 ##
4160 # @InetSocketAddressBase:
4161 #
4162 # @host: host part of the address
4163 # @port: port part of the address
4164 ##
4165 { 'struct': 'InetSocketAddressBase',
4166   'data': {
4167     'host': 'str',
4168     'port': 'str' } }
4169
4170 ##
4171 # @InetSocketAddress:
4172 #
4173 # Captures a socket address or address range in the Internet namespace.
4174 #
4175 # @numeric: true if the host/port are guaranteed to be numeric,
4176 #           false if name resolution should be attempted. Defaults to false.
4177 #           (Since 2.9)
4178 #
4179 # @to: If present, this is range of possible addresses, with port
4180 #      between @port and @to.
4181 #
4182 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4183 #
4184 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4185 #
4186 # Since: 1.3
4187 ##
4188 { 'struct': 'InetSocketAddress',
4189   'base': 'InetSocketAddressBase',
4190   'data': {
4191     '*numeric':  'bool',
4192     '*to': 'uint16',
4193     '*ipv4': 'bool',
4194     '*ipv6': 'bool' } }
4195
4196 ##
4197 # @UnixSocketAddress:
4198 #
4199 # Captures a socket address in the local ("Unix socket") namespace.
4200 #
4201 # @path: filesystem path to use
4202 #
4203 # Since: 1.3
4204 ##
4205 { 'struct': 'UnixSocketAddress',
4206   'data': {
4207     'path': 'str' } }
4208
4209 ##
4210 # @VsockSocketAddress:
4211 #
4212 # Captures a socket address in the vsock namespace.
4213 #
4214 # @cid: unique host identifier
4215 # @port: port
4216 #
4217 # Note: string types are used to allow for possible future hostname or
4218 # service resolution support.
4219 #
4220 # Since: 2.8
4221 ##
4222 { 'struct': 'VsockSocketAddress',
4223   'data': {
4224     'cid': 'str',
4225     'port': 'str' } }
4226
4227 ##
4228 # @SocketAddressLegacy:
4229 #
4230 # Captures the address of a socket, which could also be a named file descriptor
4231 #
4232 # Note: This type is deprecated in favor of SocketAddress.  The
4233 # difference between SocketAddressLegacy and SocketAddress is that the
4234 # latter is a flat union rather than a simple union. Flat is nicer
4235 # because it avoids nesting on the wire, i.e. that form has fewer {}.
4236
4237 #
4238 # Since: 1.3
4239 ##
4240 { 'union': 'SocketAddressLegacy',
4241   'data': {
4242     'inet': 'InetSocketAddress',
4243     'unix': 'UnixSocketAddress',
4244     'vsock': 'VsockSocketAddress',
4245     'fd': 'String' } }
4246
4247 ##
4248 # @SocketAddressType:
4249 #
4250 # Available SocketAddress types
4251 #
4252 # @inet:  Internet address
4253 #
4254 # @unix:  Unix domain socket
4255 #
4256 # Since: 2.9
4257 ##
4258 { 'enum': 'SocketAddressType',
4259   'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
4260
4261 ##
4262 # @SocketAddress:
4263 #
4264 # Captures the address of a socket, which could also be a named file
4265 # descriptor
4266 #
4267 # @type:       Transport type
4268 #
4269 # Since: 2.9
4270 ##
4271 { 'union': 'SocketAddress',
4272   'base': { 'type': 'SocketAddressType' },
4273   'discriminator': 'type',
4274   'data': { 'inet': 'InetSocketAddress',
4275             'unix': 'UnixSocketAddress',
4276             'vsock': 'VsockSocketAddress',
4277             'fd': 'String' } }
4278
4279 ##
4280 # @getfd:
4281 #
4282 # Receive a file descriptor via SCM rights and assign it a name
4283 #
4284 # @fdname: file descriptor name
4285 #
4286 # Returns: Nothing on success
4287 #
4288 # Since: 0.14.0
4289 #
4290 # Notes: If @fdname already exists, the file descriptor assigned to
4291 #        it will be closed and replaced by the received file
4292 #        descriptor.
4293 #
4294 #        The 'closefd' command can be used to explicitly close the
4295 #        file descriptor when it is no longer needed.
4296 #
4297 # Example:
4298 #
4299 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4300 # <- { "return": {} }
4301 #
4302 ##
4303 { 'command': 'getfd', 'data': {'fdname': 'str'} }
4304
4305 ##
4306 # @closefd:
4307 #
4308 # Close a file descriptor previously passed via SCM rights
4309 #
4310 # @fdname: file descriptor name
4311 #
4312 # Returns: Nothing on success
4313 #
4314 # Since: 0.14.0
4315 #
4316 # Example:
4317 #
4318 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4319 # <- { "return": {} }
4320 #
4321 ##
4322 { 'command': 'closefd', 'data': {'fdname': 'str'} }
4323
4324 ##
4325 # @MachineInfo:
4326 #
4327 # Information describing a machine.
4328 #
4329 # @name: the name of the machine
4330 #
4331 # @alias: an alias for the machine name
4332 #
4333 # @is-default: whether the machine is default
4334 #
4335 # @cpu-max: maximum number of CPUs supported by the machine type
4336 #           (since 1.5.0)
4337 #
4338 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4339 #
4340 # Since: 1.2.0
4341 ##
4342 { 'struct': 'MachineInfo',
4343   'data': { 'name': 'str', '*alias': 'str',
4344             '*is-default': 'bool', 'cpu-max': 'int',
4345             'hotpluggable-cpus': 'bool'} }
4346
4347 ##
4348 # @query-machines:
4349 #
4350 # Return a list of supported machines
4351 #
4352 # Returns: a list of MachineInfo
4353 #
4354 # Since: 1.2.0
4355 ##
4356 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
4357
4358 ##
4359 # @CpuDefinitionInfo:
4360 #
4361 # Virtual CPU definition.
4362 #
4363 # @name: the name of the CPU definition
4364 #
4365 # @migration-safe: whether a CPU definition can be safely used for
4366 #                  migration in combination with a QEMU compatibility machine
4367 #                  when migrating between different QMU versions and between
4368 #                  hosts with different sets of (hardware or software)
4369 #                  capabilities. If not provided, information is not available
4370 #                  and callers should not assume the CPU definition to be
4371 #                  migration-safe. (since 2.8)
4372 #
4373 # @static: whether a CPU definition is static and will not change depending on
4374 #          QEMU version, machine type, machine options and accelerator options.
4375 #          A static model is always migration-safe. (since 2.8)
4376 #
4377 # @unavailable-features: List of properties that prevent
4378 #                        the CPU model from running in the current
4379 #                        host. (since 2.8)
4380 # @typename: Type name that can be used as argument to @device-list-properties,
4381 #            to introspect properties configurable using -cpu or -global.
4382 #            (since 2.9)
4383 #
4384 # @unavailable-features is a list of QOM property names that
4385 # represent CPU model attributes that prevent the CPU from running.
4386 # If the QOM property is read-only, that means there's no known
4387 # way to make the CPU model run in the current host. Implementations
4388 # that choose not to provide specific information return the
4389 # property name "type".
4390 # If the property is read-write, it means that it MAY be possible
4391 # to run the CPU model in the current host if that property is
4392 # changed. Management software can use it as hints to suggest or
4393 # choose an alternative for the user, or just to generate meaningful
4394 # error messages explaining why the CPU model can't be used.
4395 # If @unavailable-features is an empty list, the CPU model is
4396 # runnable using the current host and machine-type.
4397 # If @unavailable-features is not present, runnability
4398 # information for the CPU is not available.
4399 #
4400 # Since: 1.2.0
4401 ##
4402 { 'struct': 'CpuDefinitionInfo',
4403   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
4404             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
4405
4406 ##
4407 # @query-cpu-definitions:
4408 #
4409 # Return a list of supported virtual CPU definitions
4410 #
4411 # Returns: a list of CpuDefInfo
4412 #
4413 # Since: 1.2.0
4414 ##
4415 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
4416
4417 ##
4418 # @CpuModelInfo:
4419 #
4420 # Virtual CPU model.
4421 #
4422 # A CPU model consists of the name of a CPU definition, to which
4423 # delta changes are applied (e.g. features added/removed). Most magic values
4424 # that an architecture might require should be hidden behind the name.
4425 # However, if required, architectures can expose relevant properties.
4426 #
4427 # @name: the name of the CPU definition the model is based on
4428 # @props: a dictionary of QOM properties to be applied
4429 #
4430 # Since: 2.8.0
4431 ##
4432 { 'struct': 'CpuModelInfo',
4433   'data': { 'name': 'str',
4434             '*props': 'any' } }
4435
4436 ##
4437 # @CpuModelExpansionType:
4438 #
4439 # An enumeration of CPU model expansion types.
4440 #
4441 # @static: Expand to a static CPU model, a combination of a static base
4442 #          model name and property delta changes. As the static base model will
4443 #          never change, the expanded CPU model will be the same, independant of
4444 #          independent of QEMU version, machine type, machine options, and
4445 #          accelerator options. Therefore, the resulting model can be used by
4446 #          tooling without having to specify a compatibility machine - e.g. when
4447 #          displaying the "host" model. static CPU models are migration-safe.
4448 #
4449 # @full: Expand all properties. The produced model is not guaranteed to be
4450 #        migration-safe, but allows tooling to get an insight and work with
4451 #        model details.
4452 #
4453 # Note: When a non-migration-safe CPU model is expanded in static mode, some
4454 # features enabled by the CPU model may be omitted, because they can't be
4455 # implemented by a static CPU model definition (e.g. cache info passthrough and
4456 # PMU passthrough in x86). If you need an accurate representation of the
4457 # features enabled by a non-migration-safe CPU model, use @full. If you need a
4458 # static representation that will keep ABI compatibility even when changing QEMU
4459 # version or machine-type, use @static (but keep in mind that some features may
4460 # be omitted).
4461 #
4462 # Since: 2.8.0
4463 ##
4464 { 'enum': 'CpuModelExpansionType',
4465   'data': [ 'static', 'full' ] }
4466
4467
4468 ##
4469 # @CpuModelExpansionInfo:
4470 #
4471 # The result of a cpu model expansion.
4472 #
4473 # @model: the expanded CpuModelInfo.
4474 #
4475 # Since: 2.8.0
4476 ##
4477 { 'struct': 'CpuModelExpansionInfo',
4478   'data': { 'model': 'CpuModelInfo' } }
4479
4480
4481 ##
4482 # @query-cpu-model-expansion:
4483 #
4484 # Expands a given CPU model (or a combination of CPU model + additional options)
4485 # to different granularities, allowing tooling to get an understanding what a
4486 # specific CPU model looks like in QEMU under a certain configuration.
4487 #
4488 # This interface can be used to query the "host" CPU model.
4489 #
4490 # The data returned by this command may be affected by:
4491 #
4492 # * QEMU version: CPU models may look different depending on the QEMU version.
4493 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4494 # * machine-type: CPU model  may look different depending on the machine-type.
4495 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4496 # * machine options (including accelerator): in some architectures, CPU models
4497 #   may look different depending on machine and accelerator options. (Except for
4498 #   CPU models reported as "static" in query-cpu-definitions.)
4499 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4500 #   global properties may affect expansion of CPU models. Using
4501 #   query-cpu-model-expansion while using these is not advised.
4502 #
4503 # Some architectures may not support all expansion types. s390x supports
4504 # "full" and "static".
4505 #
4506 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4507 #          not supported, if the model cannot be expanded, if the model contains
4508 #          an unknown CPU definition name, unknown properties or properties
4509 #          with a wrong type. Also returns an error if an expansion type is
4510 #          not supported.
4511 #
4512 # Since: 2.8.0
4513 ##
4514 { 'command': 'query-cpu-model-expansion',
4515   'data': { 'type': 'CpuModelExpansionType',
4516             'model': 'CpuModelInfo' },
4517   'returns': 'CpuModelExpansionInfo' }
4518
4519 ##
4520 # @CpuModelCompareResult:
4521 #
4522 # An enumeration of CPU model comparation results. The result is usually
4523 # calculated using e.g. CPU features or CPU generations.
4524 #
4525 # @incompatible: If model A is incompatible to model B, model A is not
4526 #                guaranteed to run where model B runs and the other way around.
4527 #
4528 # @identical: If model A is identical to model B, model A is guaranteed to run
4529 #             where model B runs and the other way around.
4530 #
4531 # @superset: If model A is a superset of model B, model B is guaranteed to run
4532 #            where model A runs. There are no guarantees about the other way.
4533 #
4534 # @subset: If model A is a subset of model B, model A is guaranteed to run
4535 #          where model B runs. There are no guarantees about the other way.
4536 #
4537 # Since: 2.8.0
4538 ##
4539 { 'enum': 'CpuModelCompareResult',
4540   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4541
4542 ##
4543 # @CpuModelCompareInfo:
4544 #
4545 # The result of a CPU model comparison.
4546 #
4547 # @result: The result of the compare operation.
4548 # @responsible-properties: List of properties that led to the comparison result
4549 #                          not being identical.
4550 #
4551 # @responsible-properties is a list of QOM property names that led to
4552 # both CPUs not being detected as identical. For identical models, this
4553 # list is empty.
4554 # If a QOM property is read-only, that means there's no known way to make the
4555 # CPU models identical. If the special property name "type" is included, the
4556 # models are by definition not identical and cannot be made identical.
4557 #
4558 # Since: 2.8.0
4559 ##
4560 { 'struct': 'CpuModelCompareInfo',
4561   'data': {'result': 'CpuModelCompareResult',
4562            'responsible-properties': ['str']
4563           }
4564 }
4565
4566 ##
4567 # @query-cpu-model-comparison:
4568 #
4569 # Compares two CPU models, returning how they compare in a specific
4570 # configuration. The results indicates how both models compare regarding
4571 # runnability. This result can be used by tooling to make decisions if a
4572 # certain CPU model will run in a certain configuration or if a compatible
4573 # CPU model has to be created by baselining.
4574 #
4575 # Usually, a CPU model is compared against the maximum possible CPU model
4576 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
4577 # model is identical or a subset, it will run in that configuration.
4578 #
4579 # The result returned by this command may be affected by:
4580 #
4581 # * QEMU version: CPU models may look different depending on the QEMU version.
4582 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4583 # * machine-type: CPU model may look different depending on the machine-type.
4584 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4585 # * machine options (including accelerator): in some architectures, CPU models
4586 #   may look different depending on machine and accelerator options. (Except for
4587 #   CPU models reported as "static" in query-cpu-definitions.)
4588 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4589 #   global properties may affect expansion of CPU models. Using
4590 #   query-cpu-model-expansion while using these is not advised.
4591 #
4592 # Some architectures may not support comparing CPU models. s390x supports
4593 # comparing CPU models.
4594 #
4595 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4596 #          not supported, if a model cannot be used, if a model contains
4597 #          an unknown cpu definition name, unknown properties or properties
4598 #          with wrong types.
4599 #
4600 # Since: 2.8.0
4601 ##
4602 { 'command': 'query-cpu-model-comparison',
4603   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4604   'returns': 'CpuModelCompareInfo' }
4605
4606 ##
4607 # @CpuModelBaselineInfo:
4608 #
4609 # The result of a CPU model baseline.
4610 #
4611 # @model: the baselined CpuModelInfo.
4612 #
4613 # Since: 2.8.0
4614 ##
4615 { 'struct': 'CpuModelBaselineInfo',
4616   'data': { 'model': 'CpuModelInfo' } }
4617
4618 ##
4619 # @query-cpu-model-baseline:
4620 #
4621 # Baseline two CPU models, creating a compatible third model. The created
4622 # model will always be a static, migration-safe CPU model (see "static"
4623 # CPU model expansion for details).
4624 #
4625 # This interface can be used by tooling to create a compatible CPU model out
4626 # two CPU models. The created CPU model will be identical to or a subset of
4627 # both CPU models when comparing them. Therefore, the created CPU model is
4628 # guaranteed to run where the given CPU models run.
4629 #
4630 # The result returned by this command may be affected by:
4631 #
4632 # * QEMU version: CPU models may look different depending on the QEMU version.
4633 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4634 # * machine-type: CPU model may look different depending on the machine-type.
4635 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
4636 # * machine options (including accelerator): in some architectures, CPU models
4637 #   may look different depending on machine and accelerator options. (Except for
4638 #   CPU models reported as "static" in query-cpu-definitions.)
4639 # * "-cpu" arguments and global properties: arguments to the -cpu option and
4640 #   global properties may affect expansion of CPU models. Using
4641 #   query-cpu-model-expansion while using these is not advised.
4642 #
4643 # Some architectures may not support baselining CPU models. s390x supports
4644 # baselining CPU models.
4645 #
4646 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4647 #          not supported, if a model cannot be used, if a model contains
4648 #          an unknown cpu definition name, unknown properties or properties
4649 #          with wrong types.
4650 #
4651 # Since: 2.8.0
4652 ##
4653 { 'command': 'query-cpu-model-baseline',
4654   'data': { 'modela': 'CpuModelInfo',
4655             'modelb': 'CpuModelInfo' },
4656   'returns': 'CpuModelBaselineInfo' }
4657
4658 ##
4659 # @AddfdInfo:
4660 #
4661 # Information about a file descriptor that was added to an fd set.
4662 #
4663 # @fdset-id: The ID of the fd set that @fd was added to.
4664 #
4665 # @fd: The file descriptor that was received via SCM rights and
4666 #      added to the fd set.
4667 #
4668 # Since: 1.2.0
4669 ##
4670 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
4671
4672 ##
4673 # @add-fd:
4674 #
4675 # Add a file descriptor, that was passed via SCM rights, to an fd set.
4676 #
4677 # @fdset-id: The ID of the fd set to add the file descriptor to.
4678 #
4679 # @opaque: A free-form string that can be used to describe the fd.
4680 #
4681 # Returns: @AddfdInfo on success
4682 #
4683 #          If file descriptor was not received, FdNotSupplied
4684 #
4685 #          If @fdset-id is a negative value, InvalidParameterValue
4686 #
4687 # Notes: The list of fd sets is shared by all monitor connections.
4688 #
4689 #        If @fdset-id is not specified, a new fd set will be created.
4690 #
4691 # Since: 1.2.0
4692 #
4693 # Example:
4694 #
4695 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4696 # <- { "return": { "fdset-id": 1, "fd": 3 } }
4697 #
4698 ##
4699 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4700   'returns': 'AddfdInfo' }
4701
4702 ##
4703 # @remove-fd:
4704 #
4705 # Remove a file descriptor from an fd set.
4706 #
4707 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
4708 #
4709 # @fd: The file descriptor that is to be removed.
4710 #
4711 # Returns: Nothing on success
4712 #          If @fdset-id or @fd is not found, FdNotFound
4713 #
4714 # Since: 1.2.0
4715 #
4716 # Notes: The list of fd sets is shared by all monitor connections.
4717 #
4718 #        If @fd is not specified, all file descriptors in @fdset-id
4719 #        will be removed.
4720 #
4721 # Example:
4722 #
4723 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4724 # <- { "return": {} }
4725 #
4726 ##
4727 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4728
4729 ##
4730 # @FdsetFdInfo:
4731 #
4732 # Information about a file descriptor that belongs to an fd set.
4733 #
4734 # @fd: The file descriptor value.
4735 #
4736 # @opaque: A free-form string that can be used to describe the fd.
4737 #
4738 # Since: 1.2.0
4739 ##
4740 { 'struct': 'FdsetFdInfo',
4741   'data': {'fd': 'int', '*opaque': 'str'} }
4742
4743 ##
4744 # @FdsetInfo:
4745 #
4746 # Information about an fd set.
4747 #
4748 # @fdset-id: The ID of the fd set.
4749 #
4750 # @fds: A list of file descriptors that belong to this fd set.
4751 #
4752 # Since: 1.2.0
4753 ##
4754 { 'struct': 'FdsetInfo',
4755   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4756
4757 ##
4758 # @query-fdsets:
4759 #
4760 # Return information describing all fd sets.
4761 #
4762 # Returns: A list of @FdsetInfo
4763 #
4764 # Since: 1.2.0
4765 #
4766 # Note: The list of fd sets is shared by all monitor connections.
4767 #
4768 # Example:
4769 #
4770 # -> { "execute": "query-fdsets" }
4771 # <- { "return": [
4772 #        {
4773 #          "fds": [
4774 #            {
4775 #              "fd": 30,
4776 #              "opaque": "rdonly:/path/to/file"
4777 #            },
4778 #            {
4779 #              "fd": 24,
4780 #              "opaque": "rdwr:/path/to/file"
4781 #            }
4782 #          ],
4783 #          "fdset-id": 1
4784 #        },
4785 #        {
4786 #          "fds": [
4787 #            {
4788 #              "fd": 28
4789 #            },
4790 #            {
4791 #              "fd": 29
4792 #            }
4793 #          ],
4794 #          "fdset-id": 0
4795 #        }
4796 #      ]
4797 #    }
4798 #
4799 ##
4800 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
4801
4802 ##
4803 # @TargetInfo:
4804 #
4805 # Information describing the QEMU target.
4806 #
4807 # @arch: the target architecture (eg "x86_64", "i386", etc)
4808 #
4809 # Since: 1.2.0
4810 ##
4811 { 'struct': 'TargetInfo',
4812   'data': { 'arch': 'str' } }
4813
4814 ##
4815 # @query-target:
4816 #
4817 # Return information about the target for this QEMU
4818 #
4819 # Returns: TargetInfo
4820 #
4821 # Since: 1.2.0
4822 ##
4823 { 'command': 'query-target', 'returns': 'TargetInfo' }
4824
4825 ##
4826 # @QKeyCode:
4827 #
4828 # An enumeration of key name.
4829 #
4830 # This is used by the @send-key command.
4831 #
4832 # @unmapped: since 2.0
4833 # @pause: since 2.0
4834 # @ro: since 2.4
4835 # @kp_comma: since 2.4
4836 # @kp_equals: since 2.6
4837 # @power: since 2.6
4838 # @hiragana: since 2.9
4839 # @henkan: since 2.9
4840 # @yen: since 2.9
4841 #
4842 # @sleep: since 2.10
4843 # @wake: since 2.10
4844 # @audionext: since 2.10
4845 # @audioprev: since 2.10
4846 # @audiostop: since 2.10
4847 # @audioplay: since 2.10
4848 # @audiomute: since 2.10
4849 # @volumeup: since 2.10
4850 # @volumedown: since 2.10
4851 # @mediaselect: since 2.10
4852 # @mail: since 2.10
4853 # @calculator: since 2.10
4854 # @computer: since 2.10
4855 # @ac_home: since 2.10
4856 # @ac_back: since 2.10
4857 # @ac_forward: since 2.10
4858 # @ac_refresh: since 2.10
4859 # @ac_bookmarks: since 2.10
4860 # altgr, altgr_r: dropped in 2.10
4861 #
4862 # Since: 1.3.0
4863 #
4864 ##
4865 { 'enum': 'QKeyCode',
4866   'data': [ 'unmapped',
4867             'shift', 'shift_r', 'alt', 'alt_r', 'ctrl',
4868             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4869             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4870             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4871             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4872             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4873             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4874             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4875             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4876             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4877             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4878             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4879             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4880             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
4881             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4882             'ro', 'hiragana', 'henkan', 'yen',
4883             'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
4884             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
4885             'volumeup', 'volumedown', 'mediaselect',
4886             'mail', 'calculator', 'computer',
4887             'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
4888
4889 ##
4890 # @KeyValue:
4891 #
4892 # Represents a keyboard key.
4893 #
4894 # Since: 1.3.0
4895 ##
4896 { 'union': 'KeyValue',
4897   'data': {
4898     'number': 'int',
4899     'qcode': 'QKeyCode' } }
4900
4901 ##
4902 # @send-key:
4903 #
4904 # Send keys to guest.
4905 #
4906 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
4907 #        simultaneously sent to the guest. A @KeyValue.number value is sent
4908 #        directly to the guest, while @KeyValue.qcode must be a valid
4909 #        @QKeyCode value
4910 #
4911 # @hold-time: time to delay key up events, milliseconds. Defaults
4912 #             to 100
4913 #
4914 # Returns: Nothing on success
4915 #          If key is unknown or redundant, InvalidParameter
4916 #
4917 # Since: 1.3.0
4918 #
4919 # Example:
4920 #
4921 # -> { "execute": "send-key",
4922 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4923 #                               { "type": "qcode", "data": "alt" },
4924 #                               { "type": "qcode", "data": "delete" } ] } }
4925 # <- { "return": {} }
4926 #
4927 ##
4928 { 'command': 'send-key',
4929   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
4930
4931 ##
4932 # @screendump:
4933 #
4934 # Write a PPM of the VGA screen to a file.
4935 #
4936 # @filename: the path of a new PPM file to store the image
4937 #
4938 # Returns: Nothing on success
4939 #
4940 # Since: 0.14.0
4941 #
4942 # Example:
4943 #
4944 # -> { "execute": "screendump",
4945 #      "arguments": { "filename": "/tmp/image" } }
4946 # <- { "return": {} }
4947 #
4948 ##
4949 { 'command': 'screendump', 'data': {'filename': 'str'} }
4950
4951
4952 ##
4953 # @ChardevCommon:
4954 #
4955 # Configuration shared across all chardev backends
4956 #
4957 # @logfile: The name of a logfile to save output
4958 # @logappend: true to append instead of truncate
4959 #             (default to false to truncate)
4960 #
4961 # Since: 2.6
4962 ##
4963 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4964                                        '*logappend': 'bool' } }
4965
4966 ##
4967 # @ChardevFile:
4968 #
4969 # Configuration info for file chardevs.
4970 #
4971 # @in:  The name of the input file
4972 # @out: The name of the output file
4973 # @append: Open the file in append mode (default false to
4974 #          truncate) (Since 2.6)
4975 #
4976 # Since: 1.4
4977 ##
4978 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
4979                                    'out' : 'str',
4980                                    '*append': 'bool' },
4981   'base': 'ChardevCommon' }
4982
4983 ##
4984 # @ChardevHostdev:
4985 #
4986 # Configuration info for device and pipe chardevs.
4987 #
4988 # @device: The name of the special file for the device,
4989 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
4990 #
4991 # Since: 1.4
4992 ##
4993 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4994   'base': 'ChardevCommon' }
4995
4996 ##
4997 # @ChardevSocket:
4998 #
4999 # Configuration info for (stream) socket chardevs.
5000 #
5001 # @addr: socket address to listen on (server=true)
5002 #        or connect to (server=false)
5003 # @tls-creds: the ID of the TLS credentials object (since 2.6)
5004 # @server: create server socket (default: true)
5005 # @wait: wait for incoming connection on server
5006 #        sockets (default: false).
5007 # @nodelay: set TCP_NODELAY socket option (default: false)
5008 # @telnet: enable telnet protocol on server
5009 #          sockets (default: false)
5010 # @tn3270: enable tn3270 protocol on server
5011 #          sockets (default: false) (Since: 2.10)
5012 # @reconnect: For a client socket, if a socket is disconnected,
5013 #          then attempt a reconnect after the given number of seconds.
5014 #          Setting this to zero disables this function. (default: 0)
5015 #          (Since: 2.2)
5016 #
5017 # Since: 1.4
5018 ##
5019 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddressLegacy',
5020                                      '*tls-creds'  : 'str',
5021                                      '*server'    : 'bool',
5022                                      '*wait'      : 'bool',
5023                                      '*nodelay'   : 'bool',
5024                                      '*telnet'    : 'bool',
5025                                      '*tn3270'    : 'bool',
5026                                      '*reconnect' : 'int' },
5027   'base': 'ChardevCommon' }
5028
5029 ##
5030 # @ChardevUdp:
5031 #
5032 # Configuration info for datagram socket chardevs.
5033 #
5034 # @remote: remote address
5035 # @local: local address
5036 #
5037 # Since: 1.5
5038 ##
5039 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
5040                                   '*local' : 'SocketAddressLegacy' },
5041   'base': 'ChardevCommon' }
5042
5043 ##
5044 # @ChardevMux:
5045 #
5046 # Configuration info for mux chardevs.
5047 #
5048 # @chardev: name of the base chardev.
5049 #
5050 # Since: 1.5
5051 ##
5052 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
5053   'base': 'ChardevCommon' }
5054
5055 ##
5056 # @ChardevStdio:
5057 #
5058 # Configuration info for stdio chardevs.
5059 #
5060 # @signal: Allow signals (such as SIGINT triggered by ^C)
5061 #          be delivered to qemu.  Default: true in -nographic mode,
5062 #          false otherwise.
5063 #
5064 # Since: 1.5
5065 ##
5066 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
5067   'base': 'ChardevCommon' }
5068
5069
5070 ##
5071 # @ChardevSpiceChannel:
5072 #
5073 # Configuration info for spice vm channel chardevs.
5074 #
5075 # @type: kind of channel (for example vdagent).
5076 #
5077 # Since: 1.5
5078 ##
5079 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
5080   'base': 'ChardevCommon' }
5081
5082 ##
5083 # @ChardevSpicePort:
5084 #
5085 # Configuration info for spice port chardevs.
5086 #
5087 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
5088 #
5089 # Since: 1.5
5090 ##
5091 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
5092   'base': 'ChardevCommon' }
5093
5094 ##
5095 # @ChardevVC:
5096 #
5097 # Configuration info for virtual console chardevs.
5098 #
5099 # @width:  console width,  in pixels
5100 # @height: console height, in pixels
5101 # @cols:   console width,  in chars
5102 # @rows:   console height, in chars
5103 #
5104 # Since: 1.5
5105 ##
5106 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
5107                                  '*height' : 'int',
5108                                  '*cols'   : 'int',
5109                                  '*rows'   : 'int' },
5110   'base': 'ChardevCommon' }
5111
5112 ##
5113 # @ChardevRingbuf:
5114 #
5115 # Configuration info for ring buffer chardevs.
5116 #
5117 # @size: ring buffer size, must be power of two, default is 65536
5118 #
5119 # Since: 1.5
5120 ##
5121 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
5122   'base': 'ChardevCommon' }
5123
5124 ##
5125 # @ChardevBackend:
5126 #
5127 # Configuration info for the new chardev backend.
5128 #
5129 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
5130 ##
5131 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
5132                                        'serial' : 'ChardevHostdev',
5133                                        'parallel': 'ChardevHostdev',
5134                                        'pipe'   : 'ChardevHostdev',
5135                                        'socket' : 'ChardevSocket',
5136                                        'udp'    : 'ChardevUdp',
5137                                        'pty'    : 'ChardevCommon',
5138                                        'null'   : 'ChardevCommon',
5139                                        'mux'    : 'ChardevMux',
5140                                        'msmouse': 'ChardevCommon',
5141                                        'wctablet' : 'ChardevCommon',
5142                                        'braille': 'ChardevCommon',
5143                                        'testdev': 'ChardevCommon',
5144                                        'stdio'  : 'ChardevStdio',
5145                                        'console': 'ChardevCommon',
5146                                        'spicevmc' : 'ChardevSpiceChannel',
5147                                        'spiceport' : 'ChardevSpicePort',
5148                                        'vc'     : 'ChardevVC',
5149                                        'ringbuf': 'ChardevRingbuf',
5150                                        # next one is just for compatibility
5151                                        'memory' : 'ChardevRingbuf' } }
5152
5153 ##
5154 # @ChardevReturn:
5155 #
5156 # Return info about the chardev backend just created.
5157 #
5158 # @pty: name of the slave pseudoterminal device, present if
5159 #       and only if a chardev of type 'pty' was created
5160 #
5161 # Since: 1.4
5162 ##
5163 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
5164
5165 ##
5166 # @chardev-add:
5167 #
5168 # Add a character device backend
5169 #
5170 # @id: the chardev's ID, must be unique
5171 # @backend: backend type and parameters
5172 #
5173 # Returns: ChardevReturn.
5174 #
5175 # Since: 1.4
5176 #
5177 # Example:
5178 #
5179 # -> { "execute" : "chardev-add",
5180 #      "arguments" : { "id" : "foo",
5181 #                      "backend" : { "type" : "null", "data" : {} } } }
5182 # <- { "return": {} }
5183 #
5184 # -> { "execute" : "chardev-add",
5185 #      "arguments" : { "id" : "bar",
5186 #                      "backend" : { "type" : "file",
5187 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
5188 # <- { "return": {} }
5189 #
5190 # -> { "execute" : "chardev-add",
5191 #      "arguments" : { "id" : "baz",
5192 #                      "backend" : { "type" : "pty", "data" : {} } } }
5193 # <- { "return": { "pty" : "/dev/pty/42" } }
5194 #
5195 ##
5196 { 'command': 'chardev-add', 'data': {'id'      : 'str',
5197                                      'backend' : 'ChardevBackend' },
5198   'returns': 'ChardevReturn' }
5199
5200 ##
5201 # @chardev-change:
5202 #
5203 # Change a character device backend
5204 #
5205 # @id: the chardev's ID, must exist
5206 # @backend: new backend type and parameters
5207 #
5208 # Returns: ChardevReturn.
5209 #
5210 # Since: 2.10
5211 #
5212 # Example:
5213 #
5214 # -> { "execute" : "chardev-change",
5215 #      "arguments" : { "id" : "baz",
5216 #                      "backend" : { "type" : "pty", "data" : {} } } }
5217 # <- { "return": { "pty" : "/dev/pty/42" } }
5218 #
5219 # -> {"execute" : "chardev-change",
5220 #     "arguments" : {
5221 #         "id" : "charchannel2",
5222 #         "backend" : {
5223 #             "type" : "socket",
5224 #             "data" : {
5225 #                 "addr" : {
5226 #                     "type" : "unix" ,
5227 #                     "data" : {
5228 #                         "path" : "/tmp/charchannel2.socket"
5229 #                     }
5230 #                  },
5231 #                  "server" : true,
5232 #                  "wait" : false }}}}
5233 # <- {"return": {}}
5234 #
5235 ##
5236 { 'command': 'chardev-change', 'data': {'id'      : 'str',
5237                                         'backend' : 'ChardevBackend' },
5238   'returns': 'ChardevReturn' }
5239
5240 ##
5241 # @chardev-remove:
5242 #
5243 # Remove a character device backend
5244 #
5245 # @id: the chardev's ID, must exist and not be in use
5246 #
5247 # Returns: Nothing on success
5248 #
5249 # Since: 1.4
5250 #
5251 # Example:
5252 #
5253 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
5254 # <- { "return": {} }
5255 #
5256 ##
5257 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
5258
5259 ##
5260 # @chardev-send-break:
5261 #
5262 # Send a break to a character device
5263 #
5264 # @id: the chardev's ID, must exist
5265 #
5266 # Returns: Nothing on success
5267 #
5268 # Since: 2.10
5269 #
5270 # Example:
5271 #
5272 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
5273 # <- { "return": {} }
5274 #
5275 ##
5276 { 'command': 'chardev-send-break', 'data': {'id': 'str'} }
5277
5278
5279 ##
5280 # @TpmModel:
5281 #
5282 # An enumeration of TPM models
5283 #
5284 # @tpm-tis: TPM TIS model
5285 #
5286 # Since: 1.5
5287 ##
5288 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
5289
5290 ##
5291 # @query-tpm-models:
5292 #
5293 # Return a list of supported TPM models
5294 #
5295 # Returns: a list of TpmModel
5296 #
5297 # Since: 1.5
5298 #
5299 # Example:
5300 #
5301 # -> { "execute": "query-tpm-models" }
5302 # <- { "return": [ "tpm-tis" ] }
5303 #
5304 ##
5305 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5306
5307 ##
5308 # @TpmType:
5309 #
5310 # An enumeration of TPM types
5311 #
5312 # @passthrough: TPM passthrough type
5313 #
5314 # Since: 1.5
5315 ##
5316 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5317
5318 ##
5319 # @query-tpm-types:
5320 #
5321 # Return a list of supported TPM types
5322 #
5323 # Returns: a list of TpmType
5324 #
5325 # Since: 1.5
5326 #
5327 # Example:
5328 #
5329 # -> { "execute": "query-tpm-types" }
5330 # <- { "return": [ "passthrough" ] }
5331 #
5332 ##
5333 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5334
5335 ##
5336 # @TPMPassthroughOptions:
5337 #
5338 # Information about the TPM passthrough type
5339 #
5340 # @path: string describing the path used for accessing the TPM device
5341 #
5342 # @cancel-path: string showing the TPM's sysfs cancel file
5343 #               for cancellation of TPM commands while they are executing
5344 #
5345 # Since: 1.5
5346 ##
5347 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
5348                                              '*cancel-path' : 'str'} }
5349
5350 ##
5351 # @TpmTypeOptions:
5352 #
5353 # A union referencing different TPM backend types' configuration options
5354 #
5355 # @type: 'passthrough' The configuration options for the TPM passthrough type
5356 #
5357 # Since: 1.5
5358 ##
5359 { 'union': 'TpmTypeOptions',
5360    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
5361
5362 ##
5363 # @TPMInfo:
5364 #
5365 # Information about the TPM
5366 #
5367 # @id: The Id of the TPM
5368 #
5369 # @model: The TPM frontend model
5370 #
5371 # @options: The TPM (backend) type configuration options
5372 #
5373 # Since: 1.5
5374 ##
5375 { 'struct': 'TPMInfo',
5376   'data': {'id': 'str',
5377            'model': 'TpmModel',
5378            'options': 'TpmTypeOptions' } }
5379
5380 ##
5381 # @query-tpm:
5382 #
5383 # Return information about the TPM device
5384 #
5385 # Returns: @TPMInfo on success
5386 #
5387 # Since: 1.5
5388 #
5389 # Example:
5390 #
5391 # -> { "execute": "query-tpm" }
5392 # <- { "return":
5393 #      [
5394 #        { "model": "tpm-tis",
5395 #          "options":
5396 #            { "type": "passthrough",
5397 #              "data":
5398 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5399 #                  "path": "/dev/tpm0"
5400 #                }
5401 #            },
5402 #          "id": "tpm0"
5403 #        }
5404 #      ]
5405 #    }
5406 #
5407 ##
5408 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
5409
5410 ##
5411 # @AcpiTableOptions:
5412 #
5413 # Specify an ACPI table on the command line to load.
5414 #
5415 # At most one of @file and @data can be specified. The list of files specified
5416 # by any one of them is loaded and concatenated in order. If both are omitted,
5417 # @data is implied.
5418 #
5419 # Other fields / optargs can be used to override fields of the generic ACPI
5420 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
5421 # Description Table Header. If a header field is not overridden, then the
5422 # corresponding value from the concatenated blob is used (in case of @file), or
5423 # it is filled in with a hard-coded value (in case of @data).
5424 #
5425 # String fields are copied into the matching ACPI member from lowest address
5426 # upwards, and silently truncated / NUL-padded to length.
5427 #
5428 # @sig: table signature / identifier (4 bytes)
5429 #
5430 # @rev: table revision number (dependent on signature, 1 byte)
5431 #
5432 # @oem_id: OEM identifier (6 bytes)
5433 #
5434 # @oem_table_id: OEM table identifier (8 bytes)
5435 #
5436 # @oem_rev: OEM-supplied revision number (4 bytes)
5437 #
5438 # @asl_compiler_id: identifier of the utility that created the table
5439 #                   (4 bytes)
5440 #
5441 # @asl_compiler_rev: revision number of the utility that created the
5442 #                    table (4 bytes)
5443 #
5444 # @file: colon (:) separated list of pathnames to load and
5445 #        concatenate as table data. The resultant binary blob is expected to
5446 #        have an ACPI table header. At least one file is required. This field
5447 #        excludes @data.
5448 #
5449 # @data: colon (:) separated list of pathnames to load and
5450 #        concatenate as table data. The resultant binary blob must not have an
5451 #        ACPI table header. At least one file is required. This field excludes
5452 #        @file.
5453 #
5454 # Since: 1.5
5455 ##
5456 { 'struct': 'AcpiTableOptions',
5457   'data': {
5458     '*sig':               'str',
5459     '*rev':               'uint8',
5460     '*oem_id':            'str',
5461     '*oem_table_id':      'str',
5462     '*oem_rev':           'uint32',
5463     '*asl_compiler_id':   'str',
5464     '*asl_compiler_rev':  'uint32',
5465     '*file':              'str',
5466     '*data':              'str' }}
5467
5468 ##
5469 # @CommandLineParameterType:
5470 #
5471 # Possible types for an option parameter.
5472 #
5473 # @string: accepts a character string
5474 #
5475 # @boolean: accepts "on" or "off"
5476 #
5477 # @number: accepts a number
5478 #
5479 # @size: accepts a number followed by an optional suffix (K)ilo,
5480 #        (M)ega, (G)iga, (T)era
5481 #
5482 # Since: 1.5
5483 ##
5484 { 'enum': 'CommandLineParameterType',
5485   'data': ['string', 'boolean', 'number', 'size'] }
5486
5487 ##
5488 # @CommandLineParameterInfo:
5489 #
5490 # Details about a single parameter of a command line option.
5491 #
5492 # @name: parameter name
5493 #
5494 # @type: parameter @CommandLineParameterType
5495 #
5496 # @help: human readable text string, not suitable for parsing.
5497 #
5498 # @default: default value string (since 2.1)
5499 #
5500 # Since: 1.5
5501 ##
5502 { 'struct': 'CommandLineParameterInfo',
5503   'data': { 'name': 'str',
5504             'type': 'CommandLineParameterType',
5505             '*help': 'str',
5506             '*default': 'str' } }
5507
5508 ##
5509 # @CommandLineOptionInfo:
5510 #
5511 # Details about a command line option, including its list of parameter details
5512 #
5513 # @option: option name
5514 #
5515 # @parameters: an array of @CommandLineParameterInfo
5516 #
5517 # Since: 1.5
5518 ##
5519 { 'struct': 'CommandLineOptionInfo',
5520   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5521
5522 ##
5523 # @query-command-line-options:
5524 #
5525 # Query command line option schema.
5526 #
5527 # @option: option name
5528 #
5529 # Returns: list of @CommandLineOptionInfo for all options (or for the given
5530 #          @option).  Returns an error if the given @option doesn't exist.
5531 #
5532 # Since: 1.5
5533 #
5534 # Example:
5535 #
5536 # -> { "execute": "query-command-line-options",
5537 #      "arguments": { "option": "option-rom" } }
5538 # <- { "return": [
5539 #         {
5540 #             "parameters": [
5541 #                 {
5542 #                     "name": "romfile",
5543 #                     "type": "string"
5544 #                 },
5545 #                 {
5546 #                     "name": "bootindex",
5547 #                     "type": "number"
5548 #                 }
5549 #             ],
5550 #             "option": "option-rom"
5551 #         }
5552 #      ]
5553 #    }
5554 #
5555 ##
5556 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
5557  'returns': ['CommandLineOptionInfo'] }
5558
5559 ##
5560 # @X86CPURegister32:
5561 #
5562 # A X86 32-bit register
5563 #
5564 # Since: 1.5
5565 ##
5566 { 'enum': 'X86CPURegister32',
5567   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5568
5569 ##
5570 # @X86CPUFeatureWordInfo:
5571 #
5572 # Information about a X86 CPU feature word
5573 #
5574 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5575 #
5576 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
5577 #                   feature word
5578 #
5579 # @cpuid-register: Output register containing the feature bits
5580 #
5581 # @features: value of output register, containing the feature bits
5582 #
5583 # Since: 1.5
5584 ##
5585 { 'struct': 'X86CPUFeatureWordInfo',
5586   'data': { 'cpuid-input-eax': 'int',
5587             '*cpuid-input-ecx': 'int',
5588             'cpuid-register': 'X86CPURegister32',
5589             'features': 'int' } }
5590
5591 ##
5592 # @DummyForceArrays:
5593 #
5594 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5595 #
5596 # Since: 2.5
5597 ##
5598 { 'struct': 'DummyForceArrays',
5599   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5600
5601
5602 ##
5603 # @RxState:
5604 #
5605 # Packets receiving state
5606 #
5607 # @normal: filter assigned packets according to the mac-table
5608 #
5609 # @none: don't receive any assigned packet
5610 #
5611 # @all: receive all assigned packets
5612 #
5613 # Since: 1.6
5614 ##
5615 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5616
5617 ##
5618 # @RxFilterInfo:
5619 #
5620 # Rx-filter information for a NIC.
5621 #
5622 # @name: net client name
5623 #
5624 # @promiscuous: whether promiscuous mode is enabled
5625 #
5626 # @multicast: multicast receive state
5627 #
5628 # @unicast: unicast receive state
5629 #
5630 # @vlan: vlan receive state (Since 2.0)
5631 #
5632 # @broadcast-allowed: whether to receive broadcast
5633 #
5634 # @multicast-overflow: multicast table is overflowed or not
5635 #
5636 # @unicast-overflow: unicast table is overflowed or not
5637 #
5638 # @main-mac: the main macaddr string
5639 #
5640 # @vlan-table: a list of active vlan id
5641 #
5642 # @unicast-table: a list of unicast macaddr string
5643 #
5644 # @multicast-table: a list of multicast macaddr string
5645 #
5646 # Since: 1.6
5647 ##
5648 { 'struct': 'RxFilterInfo',
5649   'data': {
5650     'name':               'str',
5651     'promiscuous':        'bool',
5652     'multicast':          'RxState',
5653     'unicast':            'RxState',
5654     'vlan':               'RxState',
5655     'broadcast-allowed':  'bool',
5656     'multicast-overflow': 'bool',
5657     'unicast-overflow':   'bool',
5658     'main-mac':           'str',
5659     'vlan-table':         ['int'],
5660     'unicast-table':      ['str'],
5661     'multicast-table':    ['str'] }}
5662
5663 ##
5664 # @query-rx-filter:
5665 #
5666 # Return rx-filter information for all NICs (or for the given NIC).
5667 #
5668 # @name: net client name
5669 #
5670 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5671 #          Returns an error if the given @name doesn't exist, or given
5672 #          NIC doesn't support rx-filter querying, or given net client
5673 #          isn't a NIC.
5674 #
5675 # Since: 1.6
5676 #
5677 # Example:
5678 #
5679 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5680 # <- { "return": [
5681 #         {
5682 #             "promiscuous": true,
5683 #             "name": "vnet0",
5684 #             "main-mac": "52:54:00:12:34:56",
5685 #             "unicast": "normal",
5686 #             "vlan": "normal",
5687 #             "vlan-table": [
5688 #                 4,
5689 #                 0
5690 #             ],
5691 #             "unicast-table": [
5692 #             ],
5693 #             "multicast": "normal",
5694 #             "multicast-overflow": false,
5695 #             "unicast-overflow": false,
5696 #             "multicast-table": [
5697 #                 "01:00:5e:00:00:01",
5698 #                 "33:33:00:00:00:01",
5699 #                 "33:33:ff:12:34:56"
5700 #             ],
5701 #             "broadcast-allowed": false
5702 #         }
5703 #       ]
5704 #    }
5705 #
5706 ##
5707 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5708   'returns': ['RxFilterInfo'] }
5709
5710 ##
5711 # @InputButton:
5712 #
5713 # Button of a pointer input device (mouse, tablet).
5714 #
5715 # @side: front side button of a 5-button mouse (since 2.9)
5716 #
5717 # @extra: rear side button of a 5-button mouse (since 2.9)
5718 #
5719 # Since: 2.0
5720 ##
5721 { 'enum'  : 'InputButton',
5722   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5723   'extra' ] }
5724
5725 ##
5726 # @InputAxis:
5727 #
5728 # Position axis of a pointer input device (mouse, tablet).
5729 #
5730 # Since: 2.0
5731 ##
5732 { 'enum'  : 'InputAxis',
5733   'data'  : [ 'x', 'y' ] }
5734
5735 ##
5736 # @InputKeyEvent:
5737 #
5738 # Keyboard input event.
5739 #
5740 # @key:    Which key this event is for.
5741 # @down:   True for key-down and false for key-up events.
5742 #
5743 # Since: 2.0
5744 ##
5745 { 'struct'  : 'InputKeyEvent',
5746   'data'  : { 'key'     : 'KeyValue',
5747               'down'    : 'bool' } }
5748
5749 ##
5750 # @InputBtnEvent:
5751 #
5752 # Pointer button input event.
5753 #
5754 # @button: Which button this event is for.
5755 # @down:   True for key-down and false for key-up events.
5756 #
5757 # Since: 2.0
5758 ##
5759 { 'struct'  : 'InputBtnEvent',
5760   'data'  : { 'button'  : 'InputButton',
5761               'down'    : 'bool' } }
5762
5763 ##
5764 # @InputMoveEvent:
5765 #
5766 # Pointer motion input event.
5767 #
5768 # @axis:   Which axis is referenced by @value.
5769 # @value:  Pointer position.  For absolute coordinates the
5770 #          valid range is 0 -> 0x7ffff
5771 #
5772 # Since: 2.0
5773 ##
5774 { 'struct'  : 'InputMoveEvent',
5775   'data'  : { 'axis'    : 'InputAxis',
5776               'value'   : 'int' } }
5777
5778 ##
5779 # @InputEvent:
5780 #
5781 # Input event union.
5782 #
5783 # @type: the input type, one of:
5784 #  - 'key': Input event of Keyboard
5785 #  - 'btn': Input event of pointer buttons
5786 #  - 'rel': Input event of relative pointer motion
5787 #  - 'abs': Input event of absolute pointer motion
5788 #
5789 # Since: 2.0
5790 ##
5791 { 'union' : 'InputEvent',
5792   'data'  : { 'key'     : 'InputKeyEvent',
5793               'btn'     : 'InputBtnEvent',
5794               'rel'     : 'InputMoveEvent',
5795               'abs'     : 'InputMoveEvent' } }
5796
5797 ##
5798 # @input-send-event:
5799 #
5800 # Send input event(s) to guest.
5801 #
5802 # @device: display device to send event(s) to.
5803 # @head: head to send event(s) to, in case the
5804 #        display device supports multiple scanouts.
5805 # @events: List of InputEvent union.
5806 #
5807 # Returns: Nothing on success.
5808 #
5809 # The @device and @head parameters can be used to send the input event
5810 # to specific input devices in case (a) multiple input devices of the
5811 # same kind are added to the virtual machine and (b) you have
5812 # configured input routing (see docs/multiseat.txt) for those input
5813 # devices.  The parameters work exactly like the device and head
5814 # properties of input devices.  If @device is missing, only devices
5815 # that have no input routing config are admissible.  If @device is
5816 # specified, both input devices with and without input routing config
5817 # are admissible, but devices with input routing config take
5818 # precedence.
5819 #
5820 # Since: 2.6
5821 #
5822 # Note: The consoles are visible in the qom tree, under
5823 # /backend/console[$index]. They have a device link and head property,
5824 # so it is possible to map which console belongs to which device and
5825 # display.
5826 #
5827 # Example:
5828 #
5829 # 1. Press left mouse button.
5830 #
5831 # -> { "execute": "input-send-event",
5832 #     "arguments": { "device": "video0",
5833 #                    "events": [ { "type": "btn",
5834 #                    "data" : { "down": true, "button": "left" } } ] } }
5835 # <- { "return": {} }
5836 #
5837 # -> { "execute": "input-send-event",
5838 #     "arguments": { "device": "video0",
5839 #                    "events": [ { "type": "btn",
5840 #                    "data" : { "down": false, "button": "left" } } ] } }
5841 # <- { "return": {} }
5842 #
5843 # 2. Press ctrl-alt-del.
5844 #
5845 # -> { "execute": "input-send-event",
5846 #      "arguments": { "events": [
5847 #         { "type": "key", "data" : { "down": true,
5848 #           "key": {"type": "qcode", "data": "ctrl" } } },
5849 #         { "type": "key", "data" : { "down": true,
5850 #           "key": {"type": "qcode", "data": "alt" } } },
5851 #         { "type": "key", "data" : { "down": true,
5852 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
5853 # <- { "return": {} }
5854 #
5855 # 3. Move mouse pointer to absolute coordinates (20000, 400).
5856 #
5857 # -> { "execute": "input-send-event" ,
5858 #   "arguments": { "events": [
5859 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5860 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5861 # <- { "return": {} }
5862 #
5863 ##
5864 { 'command': 'input-send-event',
5865   'data': { '*device': 'str',
5866             '*head'  : 'int',
5867             'events' : [ 'InputEvent' ] } }
5868
5869 ##
5870 # @NumaOptionsType:
5871 #
5872 # @node: NUMA nodes configuration
5873 #
5874 # @dist: NUMA distance configuration (since 2.10)
5875 #
5876 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
5877 #
5878 # Since: 2.1
5879 ##
5880 { 'enum': 'NumaOptionsType',
5881   'data': [ 'node', 'dist', 'cpu' ] }
5882
5883 ##
5884 # @NumaOptions:
5885 #
5886 # A discriminated record of NUMA options. (for OptsVisitor)
5887 #
5888 # Since: 2.1
5889 ##
5890 { 'union': 'NumaOptions',
5891   'base': { 'type': 'NumaOptionsType' },
5892   'discriminator': 'type',
5893   'data': {
5894     'node': 'NumaNodeOptions',
5895     'dist': 'NumaDistOptions',
5896     'cpu': 'NumaCpuOptions' }}
5897
5898 ##
5899 # @NumaNodeOptions:
5900 #
5901 # Create a guest NUMA node. (for OptsVisitor)
5902 #
5903 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
5904 #
5905 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
5906 #         if omitted)
5907 #
5908 # @mem: memory size of this node; mutually exclusive with @memdev.
5909 #       Equally divide total memory among nodes if both @mem and @memdev are
5910 #       omitted.
5911 #
5912 # @memdev: memory backend object.  If specified for one node,
5913 #          it must be specified for all nodes.
5914 #
5915 # Since: 2.1
5916 ##
5917 { 'struct': 'NumaNodeOptions',
5918   'data': {
5919    '*nodeid': 'uint16',
5920    '*cpus':   ['uint16'],
5921    '*mem':    'size',
5922    '*memdev': 'str' }}
5923
5924 ##
5925 # @NumaDistOptions:
5926 #
5927 # Set the distance between 2 NUMA nodes.
5928 #
5929 # @src: source NUMA node.
5930 #
5931 # @dst: destination NUMA node.
5932 #
5933 # @val: NUMA distance from source node to destination node.
5934 #       When a node is unreachable from another node, set the distance
5935 #       between them to 255.
5936 #
5937 # Since: 2.10
5938 ##
5939 { 'struct': 'NumaDistOptions',
5940   'data': {
5941    'src': 'uint16',
5942    'dst': 'uint16',
5943    'val': 'uint8' }}
5944
5945 ##
5946 # @NumaCpuOptions:
5947 #
5948 # Option "-numa cpu" overrides default cpu to node mapping.
5949 # It accepts the same set of cpu properties as returned by
5950 # query-hotpluggable-cpus[].props, where node-id could be used to
5951 # override default node mapping.
5952 #
5953 # Since: 2.10
5954 ##
5955 { 'struct': 'NumaCpuOptions',
5956    'base': 'CpuInstanceProperties',
5957    'data' : {} }
5958
5959 ##
5960 # @HostMemPolicy:
5961 #
5962 # Host memory policy types
5963 #
5964 # @default: restore default policy, remove any nondefault policy
5965 #
5966 # @preferred: set the preferred host nodes for allocation
5967 #
5968 # @bind: a strict policy that restricts memory allocation to the
5969 #        host nodes specified
5970 #
5971 # @interleave: memory allocations are interleaved across the set
5972 #              of host nodes specified
5973 #
5974 # Since: 2.1
5975 ##
5976 { 'enum': 'HostMemPolicy',
5977   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
5978
5979 ##
5980 # @Memdev:
5981 #
5982 # Information about memory backend
5983 #
5984 # @id: backend's ID if backend has 'id' property (since 2.9)
5985 #
5986 # @size: memory backend size
5987 #
5988 # @merge: enables or disables memory merge support
5989 #
5990 # @dump: includes memory backend's memory in a core dump or not
5991 #
5992 # @prealloc: enables or disables memory preallocation
5993 #
5994 # @host-nodes: host nodes for its memory policy
5995 #
5996 # @policy: memory policy of memory backend
5997 #
5998 # Since: 2.1
5999 ##
6000 { 'struct': 'Memdev',
6001   'data': {
6002     '*id':        'str',
6003     'size':       'size',
6004     'merge':      'bool',
6005     'dump':       'bool',
6006     'prealloc':   'bool',
6007     'host-nodes': ['uint16'],
6008     'policy':     'HostMemPolicy' }}
6009
6010 ##
6011 # @query-memdev:
6012 #
6013 # Returns information for all memory backends.
6014 #
6015 # Returns: a list of @Memdev.
6016 #
6017 # Since: 2.1
6018 #
6019 # Example:
6020 #
6021 # -> { "execute": "query-memdev" }
6022 # <- { "return": [
6023 #        {
6024 #          "id": "mem1",
6025 #          "size": 536870912,
6026 #          "merge": false,
6027 #          "dump": true,
6028 #          "prealloc": false,
6029 #          "host-nodes": [0, 1],
6030 #          "policy": "bind"
6031 #        },
6032 #        {
6033 #          "size": 536870912,
6034 #          "merge": false,
6035 #          "dump": true,
6036 #          "prealloc": true,
6037 #          "host-nodes": [2, 3],
6038 #          "policy": "preferred"
6039 #        }
6040 #      ]
6041 #    }
6042 #
6043 ##
6044 { 'command': 'query-memdev', 'returns': ['Memdev'] }
6045
6046 ##
6047 # @PCDIMMDeviceInfo:
6048 #
6049 # PCDIMMDevice state information
6050 #
6051 # @id: device's ID
6052 #
6053 # @addr: physical address, where device is mapped
6054 #
6055 # @size: size of memory that the device provides
6056 #
6057 # @slot: slot number at which device is plugged in
6058 #
6059 # @node: NUMA node number where device is plugged in
6060 #
6061 # @memdev: memory backend linked with device
6062 #
6063 # @hotplugged: true if device was hotplugged
6064 #
6065 # @hotpluggable: true if device if could be added/removed while machine is running
6066 #
6067 # Since: 2.1
6068 ##
6069 { 'struct': 'PCDIMMDeviceInfo',
6070   'data': { '*id': 'str',
6071             'addr': 'int',
6072             'size': 'int',
6073             'slot': 'int',
6074             'node': 'int',
6075             'memdev': 'str',
6076             'hotplugged': 'bool',
6077             'hotpluggable': 'bool'
6078           }
6079 }
6080
6081 ##
6082 # @MemoryDeviceInfo:
6083 #
6084 # Union containing information about a memory device
6085 #
6086 # Since: 2.1
6087 ##
6088 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
6089
6090 ##
6091 # @query-memory-devices:
6092 #
6093 # Lists available memory devices and their state
6094 #
6095 # Since: 2.1
6096 #
6097 # Example:
6098 #
6099 # -> { "execute": "query-memory-devices" }
6100 # <- { "return": [ { "data":
6101 #                       { "addr": 5368709120,
6102 #                         "hotpluggable": true,
6103 #                         "hotplugged": true,
6104 #                         "id": "d1",
6105 #                         "memdev": "/objects/memX",
6106 #                         "node": 0,
6107 #                         "size": 1073741824,
6108 #                         "slot": 0},
6109 #                    "type": "dimm"
6110 #                  } ] }
6111 #
6112 ##
6113 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
6114
6115 ##
6116 # @ACPISlotType:
6117 #
6118 # @DIMM: memory slot
6119 # @CPU: logical CPU slot (since 2.7)
6120 ##
6121 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
6122
6123 ##
6124 # @ACPIOSTInfo:
6125 #
6126 # OSPM Status Indication for a device
6127 # For description of possible values of @source and @status fields
6128 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
6129 #
6130 # @device: device ID associated with slot
6131 #
6132 # @slot: slot ID, unique per slot of a given @slot-type
6133 #
6134 # @slot-type: type of the slot
6135 #
6136 # @source: an integer containing the source event
6137 #
6138 # @status: an integer containing the status code
6139 #
6140 # Since: 2.1
6141 ##
6142 { 'struct': 'ACPIOSTInfo',
6143   'data'  : { '*device': 'str',
6144               'slot': 'str',
6145               'slot-type': 'ACPISlotType',
6146               'source': 'int',
6147               'status': 'int' } }
6148
6149 ##
6150 # @query-acpi-ospm-status:
6151 #
6152 # Return a list of ACPIOSTInfo for devices that support status
6153 # reporting via ACPI _OST method.
6154 #
6155 # Since: 2.1
6156 #
6157 # Example:
6158 #
6159 # -> { "execute": "query-acpi-ospm-status" }
6160 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
6161 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
6162 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
6163 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
6164 #    ]}
6165 #
6166 ##
6167 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
6168
6169 ##
6170 # @WatchdogExpirationAction:
6171 #
6172 # An enumeration of the actions taken when the watchdog device's timer is
6173 # expired
6174 #
6175 # @reset: system resets
6176 #
6177 # @shutdown: system shutdown, note that it is similar to @powerdown, which
6178 #            tries to set to system status and notify guest
6179 #
6180 # @poweroff: system poweroff, the emulator program exits
6181 #
6182 # @pause: system pauses, similar to @stop
6183 #
6184 # @debug: system enters debug state
6185 #
6186 # @none: nothing is done
6187 #
6188 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
6189 #              VCPUS on x86) (since 2.4)
6190 #
6191 # Since: 2.1
6192 ##
6193 { 'enum': 'WatchdogExpirationAction',
6194   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
6195             'inject-nmi' ] }
6196
6197 ##
6198 # @IoOperationType:
6199 #
6200 # An enumeration of the I/O operation types
6201 #
6202 # @read: read operation
6203 #
6204 # @write: write operation
6205 #
6206 # Since: 2.1
6207 ##
6208 { 'enum': 'IoOperationType',
6209   'data': [ 'read', 'write' ] }
6210
6211 ##
6212 # @GuestPanicAction:
6213 #
6214 # An enumeration of the actions taken when guest OS panic is detected
6215 #
6216 # @pause: system pauses
6217 #
6218 # Since: 2.1 (poweroff since 2.8)
6219 ##
6220 { 'enum': 'GuestPanicAction',
6221   'data': [ 'pause', 'poweroff' ] }
6222
6223 ##
6224 # @GuestPanicInformationType:
6225 #
6226 # An enumeration of the guest panic information types
6227 #
6228 # Since: 2.9
6229 ##
6230 { 'enum': 'GuestPanicInformationType',
6231   'data': [ 'hyper-v'] }
6232
6233 ##
6234 # @GuestPanicInformation:
6235 #
6236 # Information about a guest panic
6237 #
6238 # Since: 2.9
6239 ##
6240 {'union': 'GuestPanicInformation',
6241  'base': {'type': 'GuestPanicInformationType'},
6242  'discriminator': 'type',
6243  'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
6244
6245 ##
6246 # @GuestPanicInformationHyperV:
6247 #
6248 # Hyper-V specific guest panic information (HV crash MSRs)
6249 #
6250 # Since: 2.9
6251 ##
6252 {'struct': 'GuestPanicInformationHyperV',
6253  'data': { 'arg1': 'uint64',
6254            'arg2': 'uint64',
6255            'arg3': 'uint64',
6256            'arg4': 'uint64',
6257            'arg5': 'uint64' } }
6258
6259 ##
6260 # @rtc-reset-reinjection:
6261 #
6262 # This command will reset the RTC interrupt reinjection backlog.
6263 # Can be used if another mechanism to synchronize guest time
6264 # is in effect, for example QEMU guest agent's guest-set-time
6265 # command.
6266 #
6267 # Since: 2.1
6268 #
6269 # Example:
6270 #
6271 # -> { "execute": "rtc-reset-reinjection" }
6272 # <- { "return": {} }
6273 #
6274 ##
6275 { 'command': 'rtc-reset-reinjection' }
6276
6277 ##
6278 # @ReplayMode:
6279 #
6280 # Mode of the replay subsystem.
6281 #
6282 # @none: normal execution mode. Replay or record are not enabled.
6283 #
6284 # @record: record mode. All non-deterministic data is written into the
6285 #          replay log.
6286 #
6287 # @play: replay mode. Non-deterministic data required for system execution
6288 #        is read from the log.
6289 #
6290 # Since: 2.5
6291 ##
6292 { 'enum': 'ReplayMode',
6293   'data': [ 'none', 'record', 'play' ] }
6294
6295 ##
6296 # @xen-load-devices-state:
6297 #
6298 # Load the state of all devices from file. The RAM and the block devices
6299 # of the VM are not loaded by this command.
6300 #
6301 # @filename: the file to load the state of the devices from as binary
6302 # data. See xen-save-devices-state.txt for a description of the binary
6303 # format.
6304 #
6305 # Since: 2.7
6306 #
6307 # Example:
6308 #
6309 # -> { "execute": "xen-load-devices-state",
6310 #      "arguments": { "filename": "/tmp/resume" } }
6311 # <- { "return": {} }
6312 #
6313 ##
6314 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
6315
6316 ##
6317 # @xen-set-replication:
6318 #
6319 # Enable or disable replication.
6320 #
6321 # @enable: true to enable, false to disable.
6322 #
6323 # @primary: true for primary or false for secondary.
6324 #
6325 # @failover: true to do failover, false to stop. but cannot be
6326 #            specified if 'enable' is true. default value is false.
6327 #
6328 # Returns: nothing.
6329 #
6330 # Example:
6331 #
6332 # -> { "execute": "xen-set-replication",
6333 #      "arguments": {"enable": true, "primary": false} }
6334 # <- { "return": {} }
6335 #
6336 # Since: 2.9
6337 ##
6338 { 'command': 'xen-set-replication',
6339   'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
6340
6341 ##
6342 # @ReplicationStatus:
6343 #
6344 # The result format for 'query-xen-replication-status'.
6345 #
6346 # @error: true if an error happened, false if replication is normal.
6347 #
6348 # @desc: the human readable error description string, when
6349 #        @error is 'true'.
6350 #
6351 # Since: 2.9
6352 ##
6353 { 'struct': 'ReplicationStatus',
6354   'data': { 'error': 'bool', '*desc': 'str' } }
6355
6356 ##
6357 # @query-xen-replication-status:
6358 #
6359 # Query replication status while the vm is running.
6360 #
6361 # Returns: A @ReplicationResult object showing the status.
6362 #
6363 # Example:
6364 #
6365 # -> { "execute": "query-xen-replication-status" }
6366 # <- { "return": { "error": false } }
6367 #
6368 # Since: 2.9
6369 ##
6370 { 'command': 'query-xen-replication-status',
6371   'returns': 'ReplicationStatus' }
6372
6373 ##
6374 # @xen-colo-do-checkpoint:
6375 #
6376 # Xen uses this command to notify replication to trigger a checkpoint.
6377 #
6378 # Returns: nothing.
6379 #
6380 # Example:
6381 #
6382 # -> { "execute": "xen-colo-do-checkpoint" }
6383 # <- { "return": {} }
6384 #
6385 # Since: 2.9
6386 ##
6387 { 'command': 'xen-colo-do-checkpoint' }
6388
6389 ##
6390 # @GICCapability:
6391 #
6392 # The struct describes capability for a specific GIC (Generic
6393 # Interrupt Controller) version. These bits are not only decided by
6394 # QEMU/KVM software version, but also decided by the hardware that
6395 # the program is running upon.
6396 #
6397 # @version:  version of GIC to be described. Currently, only 2 and 3
6398 #            are supported.
6399 #
6400 # @emulated: whether current QEMU/hardware supports emulated GIC
6401 #            device in user space.
6402 #
6403 # @kernel:   whether current QEMU/hardware supports hardware
6404 #            accelerated GIC device in kernel.
6405 #
6406 # Since: 2.6
6407 ##
6408 { 'struct': 'GICCapability',
6409   'data': { 'version': 'int',
6410             'emulated': 'bool',
6411             'kernel': 'bool' } }
6412
6413 ##
6414 # @query-gic-capabilities:
6415 #
6416 # This command is ARM-only. It will return a list of GICCapability
6417 # objects that describe its capability bits.
6418 #
6419 # Returns: a list of GICCapability objects.
6420 #
6421 # Since: 2.6
6422 #
6423 # Example:
6424 #
6425 # -> { "execute": "query-gic-capabilities" }
6426 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
6427 #                 { "version": 3, "emulated": false, "kernel": true } ] }
6428 #
6429 ##
6430 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
6431
6432 ##
6433 # @CpuInstanceProperties:
6434 #
6435 # List of properties to be used for hotplugging a CPU instance,
6436 # it should be passed by management with device_add command when
6437 # a CPU is being hotplugged.
6438 #
6439 # @node-id: NUMA node ID the CPU belongs to
6440 # @socket-id: socket number within node/board the CPU belongs to
6441 # @core-id: core number within socket the CPU belongs to
6442 # @thread-id: thread number within core the CPU belongs to
6443 #
6444 # Note: currently there are 4 properties that could be present
6445 # but management should be prepared to pass through other
6446 # properties with device_add command to allow for future
6447 # interface extension. This also requires the filed names to be kept in
6448 # sync with the properties passed to -device/device_add.
6449 #
6450 # Since: 2.7
6451 ##
6452 { 'struct': 'CpuInstanceProperties',
6453   'data': { '*node-id': 'int',
6454             '*socket-id': 'int',
6455             '*core-id': 'int',
6456             '*thread-id': 'int'
6457   }
6458 }
6459
6460 ##
6461 # @HotpluggableCPU:
6462 #
6463 # @type: CPU object type for usage with device_add command
6464 # @props: list of properties to be used for hotplugging CPU
6465 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6466 # @qom-path: link to existing CPU object if CPU is present or
6467 #            omitted if CPU is not present.
6468 #
6469 # Since: 2.7
6470 ##
6471 { 'struct': 'HotpluggableCPU',
6472   'data': { 'type': 'str',
6473             'vcpus-count': 'int',
6474             'props': 'CpuInstanceProperties',
6475             '*qom-path': 'str'
6476           }
6477 }
6478
6479 ##
6480 # @query-hotpluggable-cpus:
6481 #
6482 # Returns: a list of HotpluggableCPU objects.
6483 #
6484 # Since: 2.7
6485 #
6486 # Example:
6487 #
6488 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6489 #
6490 # -> { "execute": "query-hotpluggable-cpus" }
6491 # <- {"return": [
6492 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6493 #        "vcpus-count": 1 },
6494 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6495 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6496 #    ]}'
6497 #
6498 # For pc machine type started with -smp 1,maxcpus=2:
6499 #
6500 # -> { "execute": "query-hotpluggable-cpus" }
6501 # <- {"return": [
6502 #      {
6503 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6504 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6505 #      },
6506 #      {
6507 #         "qom-path": "/machine/unattached/device[0]",
6508 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6509 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6510 #      }
6511 #    ]}
6512 #
6513 ##
6514 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
6515
6516 ##
6517 # @GuidInfo:
6518 #
6519 # GUID information.
6520 #
6521 # @guid: the globally unique identifier
6522 #
6523 # Since: 2.9
6524 ##
6525 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
6526
6527 ##
6528 # @query-vm-generation-id:
6529 #
6530 # Show Virtual Machine Generation ID
6531 #
6532 # Since 2.9
6533 ##
6534 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
This page took 0.389401 seconds and 4 git commands to generate.