skin: control size of controller window
[sdk/emulator/qemu.git] / qapi-schema.json
1 # -*- Mode: Python -*-
2 #
3 # QAPI Schema
4
5 # QAPI common definitions
6 { 'include': 'qapi/common.json' }
7
8 # QAPI crypto definitions
9 { 'include': 'qapi/crypto.json' }
10
11 # QAPI block definitions
12 { 'include': 'qapi/block.json' }
13
14 # QAPI event definitions
15 { 'include': 'qapi/event.json' }
16
17 # Tracing commands
18 { 'include': 'qapi/trace.json' }
19
20 # QAPI introspection
21 { 'include': 'qapi/introspect.json' }
22
23 ##
24 # @qmp_capabilities:
25 #
26 # Enable QMP capabilities.
27 #
28 # Arguments: None.
29 #
30 # Example:
31 #
32 # -> { "execute": "qmp_capabilities" }
33 # <- { "return": {} }
34 #
35 # Notes: This command is valid exactly when first connecting: it must be
36 # issued before any other command will be accepted, and will fail once the
37 # monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
38 #
39 # Since: 0.13
40 #
41 ##
42 { 'command': 'qmp_capabilities' }
43
44 ##
45 # @LostTickPolicy:
46 #
47 # Policy for handling lost ticks in timer devices.
48 #
49 # @discard: throw away the missed tick(s) and continue with future injection
50 #           normally.  Guest time may be delayed, unless the OS has explicit
51 #           handling of lost ticks
52 #
53 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
54 #         delayed due to the late tick
55 #
56 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
57 #         may be delayed, depending on how the OS reacts to the merging
58 #         of ticks
59 #
60 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
61 #        guest time should not be delayed once catchup is complete.
62 #
63 # Since: 2.0
64 ##
65 { 'enum': 'LostTickPolicy',
66   'data': ['discard', 'delay', 'merge', 'slew' ] }
67
68 ##
69 # @add_client:
70 #
71 # Allow client connections for VNC, Spice and socket based
72 # character devices to be passed in to QEMU via SCM_RIGHTS.
73 #
74 # @protocol: protocol name. Valid names are "vnc", "spice" or the
75 #            name of a character device (eg. from -chardev id=XXXX)
76 #
77 # @fdname: file descriptor name previously passed via 'getfd' command
78 #
79 # @skipauth: #optional whether to skip authentication. Only applies
80 #            to "vnc" and "spice" protocols
81 #
82 # @tls: #optional whether to perform TLS. Only applies to the "spice"
83 #       protocol
84 #
85 # Returns: nothing on success.
86 #
87 # Since: 0.14.0
88 ##
89 { 'command': 'add_client',
90   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
91             '*tls': 'bool' } }
92
93 ##
94 # @NameInfo:
95 #
96 # Guest name information.
97 #
98 # @name: #optional The name of the guest
99 #
100 # Since: 0.14.0
101 ##
102 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
103
104 ##
105 # @query-name:
106 #
107 # Return the name information of a guest.
108 #
109 # Returns: @NameInfo of the guest
110 #
111 # Since: 0.14.0
112 ##
113 { 'command': 'query-name', 'returns': 'NameInfo' }
114
115 ##
116 # @KvmInfo:
117 #
118 # Information about support for KVM acceleration
119 #
120 # @enabled: true if KVM acceleration is active
121 #
122 # @present: true if KVM acceleration is built into this executable
123 #
124 # Since: 0.14.0
125 ##
126 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
127
128 ##
129 # @query-kvm:
130 #
131 # Returns information about KVM acceleration
132 #
133 # Returns: @KvmInfo
134 #
135 # Since: 0.14.0
136 ##
137 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
138
139 ##
140 # @RunState:
141 #
142 # An enumeration of VM run states.
143 #
144 # @debug: QEMU is running on a debugger
145 #
146 # @finish-migrate: guest is paused to finish the migration process
147 #
148 # @inmigrate: guest is paused waiting for an incoming migration.  Note
149 # that this state does not tell whether the machine will start at the
150 # end of the migration.  This depends on the command-line -S option and
151 # any invocation of 'stop' or 'cont' that has happened since QEMU was
152 # started.
153 #
154 # @internal-error: An internal error that prevents further guest execution
155 # has occurred
156 #
157 # @io-error: the last IOP has failed and the device is configured to pause
158 # on I/O errors
159 #
160 # @paused: guest has been paused via the 'stop' command
161 #
162 # @postmigrate: guest is paused following a successful 'migrate'
163 #
164 # @prelaunch: QEMU was started with -S and guest has not started
165 #
166 # @restore-vm: guest is paused to restore VM state
167 #
168 # @running: guest is actively running
169 #
170 # @save-vm: guest is paused to save the VM state
171 #
172 # @shutdown: guest is shut down (and -no-shutdown is in use)
173 #
174 # @suspended: guest is suspended (ACPI S3)
175 #
176 # @watchdog: the watchdog action is configured to pause and has been triggered
177 #
178 # @guest-panicked: guest has been panicked as a result of guest OS panic
179 #
180 # @colo: guest is paused to save/restore VM state under colo checkpoint,
181 #        VM can not get into this state unless colo capability is enabled
182 #        for migration. (since 2.8)
183 ##
184 { 'enum': 'RunState',
185   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
186             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
187             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
188             'guest-panicked', 'colo' ] }
189
190 ##
191 # @StatusInfo:
192 #
193 # Information about VCPU run state
194 #
195 # @running: true if all VCPUs are runnable, false if not runnable
196 #
197 # @singlestep: true if VCPUs are in single-step mode
198 #
199 # @status: the virtual machine @RunState
200 #
201 # Since:  0.14.0
202 #
203 # Notes: @singlestep is enabled through the GDB stub
204 ##
205 { 'struct': 'StatusInfo',
206   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
207
208 ##
209 # @query-status:
210 #
211 # Query the run status of all VCPUs
212 #
213 # Returns: @StatusInfo reflecting all VCPUs
214 #
215 # Since:  0.14.0
216 ##
217 { 'command': 'query-status', 'returns': 'StatusInfo' }
218
219 ##
220 # @UuidInfo:
221 #
222 # Guest UUID information.
223 #
224 # @UUID: the UUID of the guest
225 #
226 # Since: 0.14.0
227 #
228 # Notes: If no UUID was specified for the guest, a null UUID is returned.
229 ##
230 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
231
232 ##
233 # @query-uuid:
234 #
235 # Query the guest UUID information.
236 #
237 # Returns: The @UuidInfo for the guest
238 #
239 # Since: 0.14.0
240 ##
241 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
242
243 ##
244 # @ChardevInfo:
245 #
246 # Information about a character device.
247 #
248 # @label: the label of the character device
249 #
250 # @filename: the filename of the character device
251 #
252 # @frontend-open: shows whether the frontend device attached to this backend
253 #                 (eg. with the chardev=... option) is in open or closed state
254 #                 (since 2.1)
255 #
256 # Notes: @filename is encoded using the QEMU command line character device
257 #        encoding.  See the QEMU man page for details.
258 #
259 # Since: 0.14.0
260 ##
261 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
262                                   'filename': 'str',
263                                   'frontend-open': 'bool'} }
264
265 ##
266 # @query-chardev:
267 #
268 # Returns information about current character devices.
269 #
270 # Returns: a list of @ChardevInfo
271 #
272 # Since: 0.14.0
273 ##
274 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
275
276 ##
277 # @ChardevBackendInfo:
278 #
279 # Information about a character device backend
280 #
281 # @name: The backend name
282 #
283 # Since: 2.0
284 ##
285 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
286
287 ##
288 # @query-chardev-backends:
289 #
290 # Returns information about character device backends.
291 #
292 # Returns: a list of @ChardevBackendInfo
293 #
294 # Since: 2.0
295 ##
296 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
297
298 ##
299 # @DataFormat:
300 #
301 # An enumeration of data format.
302 #
303 # @utf8: Data is a UTF-8 string (RFC 3629)
304 #
305 # @base64: Data is Base64 encoded binary (RFC 3548)
306 #
307 # Since: 1.4
308 ##
309 { 'enum': 'DataFormat',
310   'data': [ 'utf8', 'base64' ] }
311
312 ##
313 # @ringbuf-write:
314 #
315 # Write to a ring buffer character device.
316 #
317 # @device: the ring buffer character device name
318 #
319 # @data: data to write
320 #
321 # @format: #optional data encoding (default 'utf8').
322 #          - base64: data must be base64 encoded text.  Its binary
323 #            decoding gets written.
324 #          - utf8: data's UTF-8 encoding is written
325 #          - data itself is always Unicode regardless of format, like
326 #            any other string.
327 #
328 # Returns: Nothing on success
329 #
330 # Since: 1.4
331 ##
332 { 'command': 'ringbuf-write',
333   'data': {'device': 'str', 'data': 'str',
334            '*format': 'DataFormat'} }
335
336 ##
337 # @ringbuf-read:
338 #
339 # Read from a ring buffer character device.
340 #
341 # @device: the ring buffer character device name
342 #
343 # @size: how many bytes to read at most
344 #
345 # @format: #optional data encoding (default 'utf8').
346 #          - base64: the data read is returned in base64 encoding.
347 #          - utf8: the data read is interpreted as UTF-8.
348 #            Bug: can screw up when the buffer contains invalid UTF-8
349 #            sequences, NUL characters, after the ring buffer lost
350 #            data, and when reading stops because the size limit is
351 #            reached.
352 #          - The return value is always Unicode regardless of format,
353 #            like any other string.
354 #
355 # Returns: data read from the device
356 #
357 # Since: 1.4
358 ##
359 { 'command': 'ringbuf-read',
360   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
361   'returns': 'str' }
362
363 ##
364 # @EventInfo:
365 #
366 # Information about a QMP event
367 #
368 # @name: The event name
369 #
370 # Since: 1.2.0
371 ##
372 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
373
374 ##
375 # @query-events:
376 #
377 # Return a list of supported QMP events by this server
378 #
379 # Returns: A list of @EventInfo for all supported events
380 #
381 # Since: 1.2.0
382 ##
383 { 'command': 'query-events', 'returns': ['EventInfo'] }
384
385 ##
386 # @MigrationStats:
387 #
388 # Detailed migration status.
389 #
390 # @transferred: amount of bytes already transferred to the target VM
391 #
392 # @remaining: amount of bytes remaining to be transferred to the target VM
393 #
394 # @total: total amount of bytes involved in the migration process
395 #
396 # @duplicate: number of duplicate (zero) pages (since 1.2)
397 #
398 # @skipped: number of skipped zero pages (since 1.5)
399 #
400 # @normal: number of normal pages (since 1.2)
401 #
402 # @normal-bytes: number of normal bytes sent (since 1.2)
403 #
404 # @dirty-pages-rate: number of pages dirtied by second by the
405 #        guest (since 1.3)
406 #
407 # @mbps: throughput in megabits/sec. (since 1.6)
408 #
409 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
410 #
411 # @postcopy-requests: The number of page requests received from the destination
412 #        (since 2.7)
413 #
414 # Since: 0.14.0
415 ##
416 { 'struct': 'MigrationStats',
417   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
418            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
419            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
420            'mbps' : 'number', 'dirty-sync-count' : 'int',
421            'postcopy-requests' : 'int' } }
422
423 ##
424 # @XBZRLECacheStats:
425 #
426 # Detailed XBZRLE migration cache statistics
427 #
428 # @cache-size: XBZRLE cache size
429 #
430 # @bytes: amount of bytes already transferred to the target VM
431 #
432 # @pages: amount of pages transferred to the target VM
433 #
434 # @cache-miss: number of cache miss
435 #
436 # @cache-miss-rate: rate of cache miss (since 2.1)
437 #
438 # @overflow: number of overflows
439 #
440 # Since: 1.2
441 ##
442 { 'struct': 'XBZRLECacheStats',
443   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
444            'cache-miss': 'int', 'cache-miss-rate': 'number',
445            'overflow': 'int' } }
446
447 ##
448 # @MigrationStatus:
449 #
450 # An enumeration of migration status.
451 #
452 # @none: no migration has ever happened.
453 #
454 # @setup: migration process has been initiated.
455 #
456 # @cancelling: in the process of cancelling migration.
457 #
458 # @cancelled: cancelling migration is finished.
459 #
460 # @active: in the process of doing migration.
461 #
462 # @postcopy-active: like active, but now in postcopy mode. (since 2.5)
463 #
464 # @completed: migration is finished.
465 #
466 # @failed: some error occurred during migration process.
467 #
468 # @colo: VM is in the process of fault tolerance, VM can not get into this
469 #        state unless colo capability is enabled for migration. (since 2.8)
470 #
471 # Since: 2.3
472 #
473 ##
474 { 'enum': 'MigrationStatus',
475   'data': [ 'none', 'setup', 'cancelling', 'cancelled',
476             'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
477
478 ##
479 # @MigrationInfo:
480 #
481 # Information about current migration process.
482 #
483 # @status: #optional @MigrationStatus describing the current migration status.
484 #          If this field is not returned, no migration process
485 #          has been initiated
486 #
487 # @ram: #optional @MigrationStats containing detailed migration
488 #       status, only returned if status is 'active' or
489 #       'completed'(since 1.2)
490 #
491 # @disk: #optional @MigrationStats containing detailed disk migration
492 #        status, only returned if status is 'active' and it is a block
493 #        migration
494 #
495 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
496 #                migration statistics, only returned if XBZRLE feature is on and
497 #                status is 'active' or 'completed' (since 1.2)
498 #
499 # @total-time: #optional total amount of milliseconds since migration started.
500 #        If migration has ended, it returns the total migration
501 #        time. (since 1.2)
502 #
503 # @downtime: #optional only present when migration finishes correctly
504 #        total downtime in milliseconds for the guest.
505 #        (since 1.3)
506 #
507 # @expected-downtime: #optional only present while migration is active
508 #        expected downtime in milliseconds for the guest in last walk
509 #        of the dirty bitmap. (since 1.3)
510 #
511 # @setup-time: #optional amount of setup time in milliseconds _before_ the
512 #        iterations begin but _after_ the QMP command is issued. This is designed
513 #        to provide an accounting of any activities (such as RDMA pinning) which
514 #        may be expensive, but do not actually occur during the iterative
515 #        migration rounds themselves. (since 1.6)
516 #
517 # @cpu-throttle-percentage: #optional percentage of time guest cpus are being
518 #        throttled during auto-converge. This is only present when auto-converge
519 #        has started throttling guest cpus. (Since 2.7)
520 #
521 # @error-desc: #optional the human readable error description string, when
522 #              @status is 'failed'. Clients should not attempt to parse the
523 #              error strings. (Since 2.7)
524 #
525 # Since: 0.14.0
526 ##
527 { 'struct': 'MigrationInfo',
528   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
529            '*disk': 'MigrationStats',
530            '*xbzrle-cache': 'XBZRLECacheStats',
531            '*total-time': 'int',
532            '*expected-downtime': 'int',
533            '*downtime': 'int',
534            '*setup-time': 'int',
535            '*cpu-throttle-percentage': 'int',
536            '*error-desc': 'str'} }
537
538 ##
539 # @query-migrate:
540 #
541 # Returns information about current migration process.
542 #
543 # Returns: @MigrationInfo
544 #
545 # Since: 0.14.0
546 ##
547 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
548
549 ##
550 # @MigrationCapability:
551 #
552 # Migration capabilities enumeration
553 #
554 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
555 #          This feature allows us to minimize migration traffic for certain work
556 #          loads, by sending compressed difference of the pages
557 #
558 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
559 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
560 #          Disabled by default. (since 2.0)
561 #
562 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
563 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
564 #          source and target VM to support this feature. To enable it is sufficient
565 #          to enable the capability on the source VM. The feature is disabled by
566 #          default. (since 1.6)
567 #
568 # @compress: Use multiple compression threads to accelerate live migration.
569 #          This feature can help to reduce the migration traffic, by sending
570 #          compressed pages. Please note that if compress and xbzrle are both
571 #          on, compress only takes effect in the ram bulk stage, after that,
572 #          it will be disabled and only xbzrle takes effect, this can help to
573 #          minimize migration traffic. The feature is disabled by default.
574 #          (since 2.4 )
575 #
576 # @events: generate events for each migration state change
577 #          (since 2.4 )
578 #
579 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
580 #          to speed up convergence of RAM migration. (since 1.6)
581 #
582 # @postcopy-ram: Start executing on the migration target before all of RAM has
583 #          been migrated, pulling the remaining pages along as needed. NOTE: If
584 #          the migration fails during postcopy the VM will fail.  (since 2.6)
585 #
586 # @x-colo: If enabled, migration will never end, and the state of the VM on the
587 #        primary side will be migrated continuously to the VM on secondary
588 #        side, this process is called COarse-Grain LOck Stepping (COLO) for
589 #        Non-stop Service. (since 2.8)
590 #
591 # Since: 1.2
592 ##
593 { 'enum': 'MigrationCapability',
594   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
595            'compress', 'events', 'postcopy-ram', 'x-colo'] }
596
597 ##
598 # @MigrationCapabilityStatus:
599 #
600 # Migration capability information
601 #
602 # @capability: capability enum
603 #
604 # @state: capability state bool
605 #
606 # Since: 1.2
607 ##
608 { 'struct': 'MigrationCapabilityStatus',
609   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
610
611 ##
612 # @migrate-set-capabilities:
613 #
614 # Enable/Disable the following migration capabilities (like xbzrle)
615 #
616 # @capabilities: json array of capability modifications to make
617 #
618 # Since: 1.2
619 ##
620 { 'command': 'migrate-set-capabilities',
621   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
622
623 ##
624 # @query-migrate-capabilities:
625 #
626 # Returns information about the current migration capabilities status
627 #
628 # Returns: @MigrationCapabilitiesStatus
629 #
630 # Since: 1.2
631 ##
632 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
633
634 ##
635 # @MigrationParameter:
636 #
637 # Migration parameters enumeration
638 #
639 # @compress-level: Set the compression level to be used in live migration,
640 #          the compression level is an integer between 0 and 9, where 0 means
641 #          no compression, 1 means the best compression speed, and 9 means best
642 #          compression ratio which will consume more CPU.
643 #
644 # @compress-threads: Set compression thread count to be used in live migration,
645 #          the compression thread count is an integer between 1 and 255.
646 #
647 # @decompress-threads: Set decompression thread count to be used in live
648 #          migration, the decompression thread count is an integer between 1
649 #          and 255. Usually, decompression is at least 4 times as fast as
650 #          compression, so set the decompress-threads to the number about 1/4
651 #          of compress-threads is adequate.
652 #
653 # @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
654 #                        when migration auto-converge is activated. The
655 #                        default value is 20. (Since 2.7)
656 #
657 # @cpu-throttle-increment: throttle percentage increase each time
658 #                          auto-converge detects that migration is not making
659 #                          progress. The default value is 10. (Since 2.7)
660 #
661 # @tls-creds: ID of the 'tls-creds' object that provides credentials for
662 #             establishing a TLS connection over the migration data channel.
663 #             On the outgoing side of the migration, the credentials must
664 #             be for a 'client' endpoint, while for the incoming side the
665 #             credentials must be for a 'server' endpoint. Setting this
666 #             will enable TLS for all migrations. The default is unset,
667 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
668 #
669 # @tls-hostname: hostname of the target host for the migration. This is
670 #                required when using x509 based TLS credentials and the
671 #                migration URI does not already include a hostname. For
672 #                example if using fd: or exec: based migration, the
673 #                hostname must be provided so that the server's x509
674 #                certificate identity can be validated. (Since 2.7)
675 #
676 # @max-bandwidth: to set maximum speed for migration. maximum speed in
677 #                 bytes per second. (Since 2.8)
678 #
679 # @downtime-limit: set maximum tolerated downtime for migration. maximum
680 #                  downtime in milliseconds (Since 2.8)
681 #
682 # @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
683 #          periodic mode. (Since 2.8)
684 #
685 # Since: 2.4
686 ##
687 { 'enum': 'MigrationParameter',
688   'data': ['compress-level', 'compress-threads', 'decompress-threads',
689            'cpu-throttle-initial', 'cpu-throttle-increment',
690            'tls-creds', 'tls-hostname', 'max-bandwidth',
691            'downtime-limit', 'x-checkpoint-delay' ] }
692
693 ##
694 # @migrate-set-parameters:
695 #
696 # Set various migration parameters.  See MigrationParameters for details.
697 #
698 # Since: 2.4
699 ##
700 { 'command': 'migrate-set-parameters', 'boxed': true,
701   'data': 'MigrationParameters' }
702
703 ##
704 # @MigrationParameters:
705 #
706 # Optional members can be omitted on input ('migrate-set-parameters')
707 # but most members will always be present on output
708 # ('query-migrate-parameters'), with the exception of tls-creds and
709 # tls-hostname.
710 #
711 # @compress-level: #optional compression level
712 #
713 # @compress-threads: #optional compression thread count
714 #
715 # @decompress-threads: #optional decompression thread count
716 #
717 # @cpu-throttle-initial: #optional Initial percentage of time guest cpus are
718 #                        throttledwhen migration auto-converge is activated.
719 #                        The default value is 20. (Since 2.7)
720 #
721 # @cpu-throttle-increment: #optional throttle percentage increase each time
722 #                          auto-converge detects that migration is not making
723 #                          progress. The default value is 10. (Since 2.7)
724 #
725 # @tls-creds: #optional ID of the 'tls-creds' object that provides credentials
726 #             for establishing a TLS connection over the migration data
727 #             channel. On the outgoing side of the migration, the credentials
728 #             must be for a 'client' endpoint, while for the incoming side the
729 #             credentials must be for a 'server' endpoint. Setting this
730 #             will enable TLS for all migrations. The default is unset,
731 #             resulting in unsecured migration at the QEMU level. (Since 2.7)
732 #
733 # @tls-hostname: #optional hostname of the target host for the migration. This
734 #                is required when using x509 based TLS credentials and the
735 #                migration URI does not already include a hostname. For
736 #                example if using fd: or exec: based migration, the
737 #                hostname must be provided so that the server's x509
738 #                certificate identity can be validated. (Since 2.7)
739 #
740 # @max-bandwidth: to set maximum speed for migration. maximum speed in
741 #                 bytes per second. (Since 2.8)
742 #
743 # @downtime-limit: set maximum tolerated downtime for migration. maximum
744 #                  downtime in milliseconds (Since 2.8)
745 #
746 # @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
747 #
748 # Since: 2.4
749 ##
750 { 'struct': 'MigrationParameters',
751   'data': { '*compress-level': 'int',
752             '*compress-threads': 'int',
753             '*decompress-threads': 'int',
754             '*cpu-throttle-initial': 'int',
755             '*cpu-throttle-increment': 'int',
756             '*tls-creds': 'str',
757             '*tls-hostname': 'str',
758             '*max-bandwidth': 'int',
759             '*downtime-limit': 'int',
760             '*x-checkpoint-delay': 'int'} }
761
762 ##
763 # @query-migrate-parameters:
764 #
765 # Returns information about the current migration parameters
766 #
767 # Returns: @MigrationParameters
768 #
769 # Since: 2.4
770 ##
771 { 'command': 'query-migrate-parameters',
772   'returns': 'MigrationParameters' }
773
774 ##
775 # @client_migrate_info:
776 #
777 # Set migration information for remote display.  This makes the server
778 # ask the client to automatically reconnect using the new parameters
779 # once migration finished successfully.  Only implemented for SPICE.
780 #
781 # @protocol:     must be "spice"
782 # @hostname:     migration target hostname
783 # @port:         #optional spice tcp port for plaintext channels
784 # @tls-port:     #optional spice tcp port for tls-secured channels
785 # @cert-subject: #optional server certificate subject
786 #
787 # Since: 0.14.0
788 ##
789 { 'command': 'client_migrate_info',
790   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
791             '*tls-port': 'int', '*cert-subject': 'str' } }
792
793 ##
794 # @migrate-start-postcopy:
795 #
796 # Followup to a migration command to switch the migration to postcopy mode.
797 # The postcopy-ram capability must be set before the original migration
798 # command.
799 #
800 # Since: 2.5
801 ##
802 { 'command': 'migrate-start-postcopy' }
803
804 ##
805 # @COLOMessage:
806 #
807 # The message transmission between Primary side and Secondary side.
808 #
809 # @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
810 #
811 # @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
812 #
813 # @checkpoint-reply: SVM gets PVM's checkpoint request
814 #
815 # @vmstate-send: VM's state will be sent by PVM.
816 #
817 # @vmstate-size: The total size of VMstate.
818 #
819 # @vmstate-received: VM's state has been received by SVM.
820 #
821 # @vmstate-loaded: VM's state has been loaded by SVM.
822 #
823 # Since: 2.8
824 ##
825 { 'enum': 'COLOMessage',
826   'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
827             'vmstate-send', 'vmstate-size', 'vmstate-received',
828             'vmstate-loaded' ] }
829
830 ##
831 # @COLOMode:
832 #
833 # The colo mode
834 #
835 # @unknown: unknown mode
836 #
837 # @primary: master side
838 #
839 # @secondary: slave side
840 #
841 # Since: 2.8
842 ##
843 { 'enum': 'COLOMode',
844   'data': [ 'unknown', 'primary', 'secondary'] }
845
846 ##
847 # @FailoverStatus:
848 #
849 # An enumeration of COLO failover status
850 #
851 # @none: no failover has ever happened
852 #
853 # @require: got failover requirement but not handled
854 #
855 # @active: in the process of doing failover
856 #
857 # @completed: finish the process of failover
858 #
859 # Since: 2.8
860 ##
861 { 'enum': 'FailoverStatus',
862   'data': [ 'none', 'require', 'active', 'completed'] }
863
864 ##
865 # @x-colo-lost-heartbeat:
866 #
867 # Tell qemu that heartbeat is lost, request it to do takeover procedures.
868 # If this command is sent to the PVM, the Primary side will exit COLO mode.
869 # If sent to the Secondary, the Secondary side will run failover work,
870 # then takes over server operation to become the service VM.
871 #
872 # Since: 2.8
873 ##
874 { 'command': 'x-colo-lost-heartbeat' }
875
876 ##
877 # @MouseInfo:
878 #
879 # Information about a mouse device.
880 #
881 # @name: the name of the mouse device
882 #
883 # @index: the index of the mouse device
884 #
885 # @current: true if this device is currently receiving mouse events
886 #
887 # @absolute: true if this device supports absolute coordinates as input
888 #
889 # Since: 0.14.0
890 ##
891 { 'struct': 'MouseInfo',
892   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
893            'absolute': 'bool'} }
894
895 ##
896 # @query-mice:
897 #
898 # Returns information about each active mouse device
899 #
900 # Returns: a list of @MouseInfo for each device
901 #
902 # Since: 0.14.0
903 ##
904 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
905
906 ##
907 # @CpuInfoArch:
908 #
909 # An enumeration of cpu types that enable additional information during
910 # @query-cpus.
911 #
912 # Since: 2.6
913 ##
914 { 'enum': 'CpuInfoArch',
915   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
916
917 ##
918 # @CpuInfo:
919 #
920 # Information about a virtual CPU
921 #
922 # @CPU: the index of the virtual CPU
923 #
924 # @current: this only exists for backwards compatibility and should be ignored
925 #
926 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
927 #          to a processor specific low power mode.
928 #
929 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
930 #
931 # @thread_id: ID of the underlying host thread
932 #
933 # @arch: architecture of the cpu, which determines which additional fields
934 #        will be listed (since 2.6)
935 #
936 # Since: 0.14.0
937 #
938 # Notes: @halted is a transient state that changes frequently.  By the time the
939 #        data is sent to the client, the guest may no longer be halted.
940 ##
941 { 'union': 'CpuInfo',
942   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
943            'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' },
944   'discriminator': 'arch',
945   'data': { 'x86': 'CpuInfoX86',
946             'sparc': 'CpuInfoSPARC',
947             'ppc': 'CpuInfoPPC',
948             'mips': 'CpuInfoMIPS',
949             'tricore': 'CpuInfoTricore',
950             'other': 'CpuInfoOther' } }
951
952 ##
953 # @CpuInfoX86:
954 #
955 # Additional information about a virtual i386 or x86_64 CPU
956 #
957 # @pc: the 64-bit instruction pointer
958 #
959 # Since: 2.6
960 ##
961 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
962
963 ##
964 # @CpuInfoSPARC:
965 #
966 # Additional information about a virtual SPARC CPU
967 #
968 # @pc: the PC component of the instruction pointer
969 #
970 # @npc: the NPC component of the instruction pointer
971 #
972 # Since: 2.6
973 ##
974 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
975
976 ##
977 # @CpuInfoPPC:
978 #
979 # Additional information about a virtual PPC CPU
980 #
981 # @nip: the instruction pointer
982 #
983 # Since: 2.6
984 ##
985 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
986
987 ##
988 # @CpuInfoMIPS:
989 #
990 # Additional information about a virtual MIPS CPU
991 #
992 # @PC: the instruction pointer
993 #
994 # Since: 2.6
995 ##
996 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
997
998 ##
999 # @CpuInfoTricore:
1000 #
1001 # Additional information about a virtual Tricore CPU
1002 #
1003 # @PC: the instruction pointer
1004 #
1005 # Since: 2.6
1006 ##
1007 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1008
1009 ##
1010 # @CpuInfoOther:
1011 #
1012 # No additional information is available about the virtual CPU
1013 #
1014 # Since: 2.6
1015 #
1016 ##
1017 { 'struct': 'CpuInfoOther', 'data': { } }
1018
1019 ##
1020 # @query-cpus:
1021 #
1022 # Returns a list of information about each virtual CPU.
1023 #
1024 # Returns: a list of @CpuInfo for each virtual CPU
1025 #
1026 # Since: 0.14.0
1027 ##
1028 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1029
1030 ##
1031 # @IOThreadInfo:
1032 #
1033 # Information about an iothread
1034 #
1035 # @id: the identifier of the iothread
1036 #
1037 # @thread-id: ID of the underlying host thread
1038 #
1039 # Since: 2.0
1040 ##
1041 { 'struct': 'IOThreadInfo',
1042   'data': {'id': 'str', 'thread-id': 'int'} }
1043
1044 ##
1045 # @query-iothreads:
1046 #
1047 # Returns a list of information about each iothread.
1048 #
1049 # Note: this list excludes the QEMU main loop thread, which is not declared
1050 # using the -object iothread command-line option.  It is always the main thread
1051 # of the process.
1052 #
1053 # Returns: a list of @IOThreadInfo for each iothread
1054 #
1055 # Since: 2.0
1056 ##
1057 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1058
1059 ##
1060 # @NetworkAddressFamily:
1061 #
1062 # The network address family
1063 #
1064 # @ipv4: IPV4 family
1065 #
1066 # @ipv6: IPV6 family
1067 #
1068 # @unix: unix socket
1069 #
1070 # @vsock: vsock family (since 2.8)
1071 #
1072 # @unknown: otherwise
1073 #
1074 # Since: 2.1
1075 ##
1076 { 'enum': 'NetworkAddressFamily',
1077   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
1078
1079 ##
1080 # @VncBasicInfo:
1081 #
1082 # The basic information for vnc network connection
1083 #
1084 # @host: IP address
1085 #
1086 # @service: The service name of the vnc port. This may depend on the host
1087 #           system's service database so symbolic names should not be relied
1088 #           on.
1089 #
1090 # @family: address family
1091 #
1092 # @websocket: true in case the socket is a websocket (since 2.3).
1093 #
1094 # Since: 2.1
1095 ##
1096 { 'struct': 'VncBasicInfo',
1097   'data': { 'host': 'str',
1098             'service': 'str',
1099             'family': 'NetworkAddressFamily',
1100             'websocket': 'bool' } }
1101
1102 ##
1103 # @VncServerInfo:
1104 #
1105 # The network connection information for server
1106 #
1107 # @auth: #optional, authentication method
1108 #
1109 # Since: 2.1
1110 ##
1111 { 'struct': 'VncServerInfo',
1112   'base': 'VncBasicInfo',
1113   'data': { '*auth': 'str' } }
1114
1115 ##
1116 # @VncClientInfo:
1117 #
1118 # Information about a connected VNC client.
1119 #
1120 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1121 #              Name of the client.
1122 #
1123 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1124 #                 used for authentication.
1125 #
1126 # Since: 0.14.0
1127 ##
1128 { 'struct': 'VncClientInfo',
1129   'base': 'VncBasicInfo',
1130   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
1131
1132 ##
1133 # @VncInfo:
1134 #
1135 # Information about the VNC session.
1136 #
1137 # @enabled: true if the VNC server is enabled, false otherwise
1138 #
1139 # @host: #optional The hostname the VNC server is bound to.  This depends on
1140 #        the name resolution on the host and may be an IP address.
1141 #
1142 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1143 #                    'ipv4' if the host is listening for IPv4 connections
1144 #                    'unix' if the host is listening on a unix domain socket
1145 #                    'unknown' otherwise
1146 #
1147 # @service: #optional The service name of the server's port.  This may depends
1148 #           on the host system's service database so symbolic names should not
1149 #           be relied on.
1150 #
1151 # @auth: #optional the current authentication type used by the server
1152 #        'none' if no authentication is being used
1153 #        'vnc' if VNC authentication is being used
1154 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1155 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1156 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1157 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1158 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1159 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1160 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1161 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1162 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1163 #
1164 # @clients: a list of @VncClientInfo of all currently connected clients
1165 #
1166 # Since: 0.14.0
1167 ##
1168 { 'struct': 'VncInfo',
1169   'data': {'enabled': 'bool', '*host': 'str',
1170            '*family': 'NetworkAddressFamily',
1171            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1172
1173 ##
1174 # @VncPrimaryAuth:
1175 #
1176 # vnc primary authentication method.
1177 #
1178 # Since: 2.3
1179 ##
1180 { 'enum': 'VncPrimaryAuth',
1181   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1182             'tls', 'vencrypt', 'sasl' ] }
1183
1184 ##
1185 # @VncVencryptSubAuth:
1186 #
1187 # vnc sub authentication method with vencrypt.
1188 #
1189 # Since: 2.3
1190 ##
1191 { 'enum': 'VncVencryptSubAuth',
1192   'data': [ 'plain',
1193             'tls-none',  'x509-none',
1194             'tls-vnc',   'x509-vnc',
1195             'tls-plain', 'x509-plain',
1196             'tls-sasl',  'x509-sasl' ] }
1197
1198 ##
1199 # @VncInfo2:
1200 #
1201 # Information about a vnc server
1202 #
1203 # @id: vnc server name.
1204 #
1205 # @server: A list of @VncBasincInfo describing all listening sockets.
1206 #          The list can be empty (in case the vnc server is disabled).
1207 #          It also may have multiple entries: normal + websocket,
1208 #          possibly also ipv4 + ipv6 in the future.
1209 #
1210 # @clients: A list of @VncClientInfo of all currently connected clients.
1211 #           The list can be empty, for obvious reasons.
1212 #
1213 # @auth: The current authentication type used by the server
1214 #
1215 # @vencrypt: #optional The vencrypt sub authentication type used by the server,
1216 #            only specified in case auth == vencrypt.
1217 #
1218 # @display: #optional The display device the vnc server is linked to.
1219 #
1220 # Since: 2.3
1221 ##
1222 { 'struct': 'VncInfo2',
1223   'data': { 'id'        : 'str',
1224             'server'    : ['VncBasicInfo'],
1225             'clients'   : ['VncClientInfo'],
1226             'auth'      : 'VncPrimaryAuth',
1227             '*vencrypt' : 'VncVencryptSubAuth',
1228             '*display'  : 'str' } }
1229
1230 ##
1231 # @query-vnc:
1232 #
1233 # Returns information about the current VNC server
1234 #
1235 # Returns: @VncInfo
1236 #
1237 # Since: 0.14.0
1238 ##
1239 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1240
1241 ##
1242 # @query-vnc-servers:
1243 #
1244 # Returns a list of vnc servers.  The list can be empty.
1245 #
1246 # Returns: a list of @VncInfo2
1247 #
1248 # Since: 2.3
1249 ##
1250 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1251
1252 ##
1253 # @SpiceBasicInfo:
1254 #
1255 # The basic information for SPICE network connection
1256 #
1257 # @host: IP address
1258 #
1259 # @port: port number
1260 #
1261 # @family: address family
1262 #
1263 # Since: 2.1
1264 ##
1265 { 'struct': 'SpiceBasicInfo',
1266   'data': { 'host': 'str',
1267             'port': 'str',
1268             'family': 'NetworkAddressFamily' } }
1269
1270 ##
1271 # @SpiceServerInfo:
1272 #
1273 # Information about a SPICE server
1274 #
1275 # @auth: #optional, authentication method
1276 #
1277 # Since: 2.1
1278 ##
1279 { 'struct': 'SpiceServerInfo',
1280   'base': 'SpiceBasicInfo',
1281   'data': { '*auth': 'str' } }
1282
1283 ##
1284 # @SpiceChannel:
1285 #
1286 # Information about a SPICE client channel.
1287 #
1288 # @connection-id: SPICE connection id number.  All channels with the same id
1289 #                 belong to the same SPICE session.
1290 #
1291 # @channel-type: SPICE channel type number.  "1" is the main control
1292 #                channel, filter for this one if you want to track spice
1293 #                sessions only
1294 #
1295 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1296 #              multiple channels of the same type exist, such as multiple
1297 #              display channels in a multihead setup
1298 #
1299 # @tls: true if the channel is encrypted, false otherwise.
1300 #
1301 # Since: 0.14.0
1302 ##
1303 { 'struct': 'SpiceChannel',
1304   'base': 'SpiceBasicInfo',
1305   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1306            'tls': 'bool'} }
1307
1308 ##
1309 # @SpiceQueryMouseMode:
1310 #
1311 # An enumeration of Spice mouse states.
1312 #
1313 # @client: Mouse cursor position is determined by the client.
1314 #
1315 # @server: Mouse cursor position is determined by the server.
1316 #
1317 # @unknown: No information is available about mouse mode used by
1318 #           the spice server.
1319 #
1320 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1321 #
1322 # Since: 1.1
1323 ##
1324 { 'enum': 'SpiceQueryMouseMode',
1325   'data': [ 'client', 'server', 'unknown' ] }
1326
1327 ##
1328 # @SpiceInfo:
1329 #
1330 # Information about the SPICE session.
1331 #
1332 # @enabled: true if the SPICE server is enabled, false otherwise
1333 #
1334 # @migrated: true if the last guest migration completed and spice
1335 #            migration had completed as well. false otherwise.
1336 #
1337 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1338 #        the name resolution on the host and may be an IP address.
1339 #
1340 # @port: #optional The SPICE server's port number.
1341 #
1342 # @compiled-version: #optional SPICE server version.
1343 #
1344 # @tls-port: #optional The SPICE server's TLS port number.
1345 #
1346 # @auth: #optional the current authentication type used by the server
1347 #        'none'  if no authentication is being used
1348 #        'spice' uses SASL or direct TLS authentication, depending on command
1349 #                line options
1350 #
1351 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1352 #              be determined by the client or the server, or unknown if spice
1353 #              server doesn't provide this information.
1354 #
1355 #              Since: 1.1
1356 #
1357 # @channels: a list of @SpiceChannel for each active spice channel
1358 #
1359 # Since: 0.14.0
1360 ##
1361 { 'struct': 'SpiceInfo',
1362   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1363            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1364            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1365
1366 ##
1367 # @query-spice:
1368 #
1369 # Returns information about the current SPICE server
1370 #
1371 # Returns: @SpiceInfo
1372 #
1373 # Since: 0.14.0
1374 ##
1375 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1376
1377 ##
1378 # @BalloonInfo:
1379 #
1380 # Information about the guest balloon device.
1381 #
1382 # @actual: the number of bytes the balloon currently contains
1383 #
1384 # Since: 0.14.0
1385 #
1386 ##
1387 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1388
1389 ##
1390 # @query-balloon:
1391 #
1392 # Return information about the balloon device.
1393 #
1394 # Returns: @BalloonInfo on success
1395 #          If the balloon driver is enabled but not functional because the KVM
1396 #          kernel module cannot support it, KvmMissingCap
1397 #          If no balloon device is present, DeviceNotActive
1398 #
1399 # Since: 0.14.0
1400 ##
1401 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1402
1403 ##
1404 # @PciMemoryRange:
1405 #
1406 # A PCI device memory region
1407 #
1408 # @base: the starting address (guest physical)
1409 #
1410 # @limit: the ending address (guest physical)
1411 #
1412 # Since: 0.14.0
1413 ##
1414 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1415
1416 ##
1417 # @PciMemoryRegion:
1418 #
1419 # Information about a PCI device I/O region.
1420 #
1421 # @bar: the index of the Base Address Register for this region
1422 #
1423 # @type: 'io' if the region is a PIO region
1424 #        'memory' if the region is a MMIO region
1425 #
1426 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1427 #
1428 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1429 #
1430 # Since: 0.14.0
1431 ##
1432 { 'struct': 'PciMemoryRegion',
1433   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1434            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1435
1436 ##
1437 # @PciBusInfo:
1438 #
1439 # Information about a bus of a PCI Bridge device
1440 #
1441 # @number: primary bus interface number.  This should be the number of the
1442 #          bus the device resides on.
1443 #
1444 # @secondary: secondary bus interface number.  This is the number of the
1445 #             main bus for the bridge
1446 #
1447 # @subordinate: This is the highest number bus that resides below the
1448 #               bridge.
1449 #
1450 # @io_range: The PIO range for all devices on this bridge
1451 #
1452 # @memory_range: The MMIO range for all devices on this bridge
1453 #
1454 # @prefetchable_range: The range of prefetchable MMIO for all devices on
1455 #                      this bridge
1456 #
1457 # Since: 2.4
1458 ##
1459 { 'struct': 'PciBusInfo',
1460   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1461            'io_range': 'PciMemoryRange',
1462            'memory_range': 'PciMemoryRange',
1463            'prefetchable_range': 'PciMemoryRange' } }
1464
1465 ##
1466 # @PciBridgeInfo:
1467 #
1468 # Information about a PCI Bridge device
1469 #
1470 # @bus: information about the bus the device resides on
1471 #
1472 # @devices: a list of @PciDeviceInfo for each device on this bridge
1473 #
1474 # Since: 0.14.0
1475 ##
1476 { 'struct': 'PciBridgeInfo',
1477   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
1478
1479 ##
1480 # @PciDeviceClass:
1481 #
1482 # Information about the Class of a PCI device
1483 #
1484 # @desc: #optional a string description of the device's class
1485 #
1486 # @class: the class code of the device
1487 #
1488 # Since: 2.4
1489 ##
1490 { 'struct': 'PciDeviceClass',
1491   'data': {'*desc': 'str', 'class': 'int'} }
1492
1493 ##
1494 # @PciDeviceId:
1495 #
1496 # Information about the Id of a PCI device
1497 #
1498 # @device: the PCI device id
1499 #
1500 # @vendor: the PCI vendor id
1501 #
1502 # Since: 2.4
1503 ##
1504 { 'struct': 'PciDeviceId',
1505   'data': {'device': 'int', 'vendor': 'int'} }
1506
1507 ##
1508 # @PciDeviceInfo:
1509 #
1510 # Information about a PCI device
1511 #
1512 # @bus: the bus number of the device
1513 #
1514 # @slot: the slot the device is located in
1515 #
1516 # @function: the function of the slot used by the device
1517 #
1518 # @class_info: the class of the device
1519 #
1520 # @id: the PCI device id
1521 #
1522 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1523 #
1524 # @qdev_id: the device name of the PCI device
1525 #
1526 # @pci_bridge: if the device is a PCI bridge, the bridge information
1527 #
1528 # @regions: a list of the PCI I/O regions associated with the device
1529 #
1530 # Notes: the contents of @class_info.desc are not stable and should only be
1531 #        treated as informational.
1532 #
1533 # Since: 0.14.0
1534 ##
1535 { 'struct': 'PciDeviceInfo',
1536   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1537            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
1538            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1539            'regions': ['PciMemoryRegion']} }
1540
1541 ##
1542 # @PciInfo:
1543 #
1544 # Information about a PCI bus
1545 #
1546 # @bus: the bus index
1547 #
1548 # @devices: a list of devices on this bus
1549 #
1550 # Since: 0.14.0
1551 ##
1552 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1553
1554 ##
1555 # @query-pci:
1556 #
1557 # Return information about the PCI bus topology of the guest.
1558 #
1559 # Returns: a list of @PciInfo for each PCI bus
1560 #
1561 # Since: 0.14.0
1562 ##
1563 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1564
1565 ##
1566 # @quit:
1567 #
1568 # This command will cause the QEMU process to exit gracefully.  While every
1569 # attempt is made to send the QMP response before terminating, this is not
1570 # guaranteed.  When using this interface, a premature EOF would not be
1571 # unexpected.
1572 #
1573 # Since: 0.14.0
1574 ##
1575 { 'command': 'quit' }
1576
1577 ##
1578 # @stop:
1579 #
1580 # Stop all guest VCPU execution.
1581 #
1582 # Since:  0.14.0
1583 #
1584 # Notes:  This function will succeed even if the guest is already in the stopped
1585 #         state.  In "inmigrate" state, it will ensure that the guest
1586 #         remains paused once migration finishes, as if the -S option was
1587 #         passed on the command line.
1588 ##
1589 { 'command': 'stop' }
1590
1591 ##
1592 # @system_reset:
1593 #
1594 # Performs a hard reset of a guest.
1595 #
1596 # Since: 0.14.0
1597 ##
1598 { 'command': 'system_reset' }
1599
1600 ##
1601 # @system_powerdown:
1602 #
1603 # Requests that a guest perform a powerdown operation.
1604 #
1605 # Since: 0.14.0
1606 #
1607 # Notes: A guest may or may not respond to this command.  This command
1608 #        returning does not indicate that a guest has accepted the request or
1609 #        that it has shut down.  Many guests will respond to this command by
1610 #        prompting the user in some way.
1611 ##
1612 { 'command': 'system_powerdown' }
1613
1614 ##
1615 # @cpu:
1616 #
1617 # This command is a nop that is only provided for the purposes of compatibility.
1618 #
1619 # Since: 0.14.0
1620 #
1621 # Notes: Do not use this command.
1622 ##
1623 { 'command': 'cpu', 'data': {'index': 'int'} }
1624
1625 ##
1626 # @cpu-add:
1627 #
1628 # Adds CPU with specified ID
1629 #
1630 # @id: ID of CPU to be created, valid values [0..max_cpus)
1631 #
1632 # Returns: Nothing on success
1633 #
1634 # Since: 1.5
1635 ##
1636 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1637
1638 ##
1639 # @memsave:
1640 #
1641 # Save a portion of guest memory to a file.
1642 #
1643 # @val: the virtual address of the guest to start from
1644 #
1645 # @size: the size of memory region to save
1646 #
1647 # @filename: the file to save the memory to as binary data
1648 #
1649 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1650 #                       virtual address (defaults to CPU 0)
1651 #
1652 # Returns: Nothing on success
1653 #
1654 # Since: 0.14.0
1655 #
1656 # Notes: Errors were not reliably returned until 1.1
1657 ##
1658 { 'command': 'memsave',
1659   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1660
1661 ##
1662 # @pmemsave:
1663 #
1664 # Save a portion of guest physical memory to a file.
1665 #
1666 # @val: the physical address of the guest to start from
1667 #
1668 # @size: the size of memory region to save
1669 #
1670 # @filename: the file to save the memory to as binary data
1671 #
1672 # Returns: Nothing on success
1673 #
1674 # Since: 0.14.0
1675 #
1676 # Notes: Errors were not reliably returned until 1.1
1677 ##
1678 { 'command': 'pmemsave',
1679   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1680
1681 ##
1682 # @cont:
1683 #
1684 # Resume guest VCPU execution.
1685 #
1686 # Since:  0.14.0
1687 #
1688 # Returns:  If successful, nothing
1689 #           If QEMU was started with an encrypted block device and a key has
1690 #              not yet been set, DeviceEncrypted.
1691 #
1692 # Notes:  This command will succeed if the guest is currently running.  It
1693 #         will also succeed if the guest is in the "inmigrate" state; in
1694 #         this case, the effect of the command is to make sure the guest
1695 #         starts once migration finishes, removing the effect of the -S
1696 #         command line option if it was passed.
1697 ##
1698 { 'command': 'cont' }
1699
1700 ##
1701 # @system_wakeup:
1702 #
1703 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1704 #
1705 # Since:  1.1
1706 #
1707 # Returns:  nothing.
1708 ##
1709 { 'command': 'system_wakeup' }
1710
1711 ##
1712 # @inject-nmi:
1713 #
1714 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1715 #
1716 # Returns:  If successful, nothing
1717 #
1718 # Since:  0.14.0
1719 #
1720 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1721 ##
1722 { 'command': 'inject-nmi' }
1723
1724 ##
1725 # @set_link:
1726 #
1727 # Sets the link status of a virtual network adapter.
1728 #
1729 # @name: the device name of the virtual network adapter
1730 #
1731 # @up: true to set the link status to be up
1732 #
1733 # Returns: Nothing on success
1734 #          If @name is not a valid network device, DeviceNotFound
1735 #
1736 # Since: 0.14.0
1737 #
1738 # Notes: Not all network adapters support setting link status.  This command
1739 #        will succeed even if the network adapter does not support link status
1740 #        notification.
1741 ##
1742 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1743
1744 ##
1745 # @get_link:
1746 #
1747 # Gets the link status of a virtual network adapter.
1748 #
1749 # @name: the device name of the virtual network adapter
1750 #
1751 # Returns: on|off on success
1752 #          If @name is not a valid network device, DeviceNotFound
1753 #
1754 # Since: 2.0.0
1755 #
1756 # Notes: Not all network adapters support setting link status.  This command
1757 #        will succeed even if the network adapter does not support link status
1758 #        notification.
1759 ##
1760
1761 { 'struct': 'LinkInfo', 'data': {'is_up': 'bool'} }
1762 { 'command': 'get_link', 'data': {'name': 'str'}, 'returns': 'LinkInfo' }
1763
1764 ##
1765 # @balloon:
1766 #
1767 # Request the balloon driver to change its balloon size.
1768 #
1769 # @value: the target size of the balloon in bytes
1770 #
1771 # Returns: Nothing on success
1772 #          If the balloon driver is enabled but not functional because the KVM
1773 #            kernel module cannot support it, KvmMissingCap
1774 #          If no balloon device is present, DeviceNotActive
1775 #
1776 # Notes: This command just issues a request to the guest.  When it returns,
1777 #        the balloon size may not have changed.  A guest can change the balloon
1778 #        size independent of this command.
1779 #
1780 # Since: 0.14.0
1781 ##
1782 { 'command': 'balloon', 'data': {'value': 'int'} }
1783
1784 ##
1785 # @Abort:
1786 #
1787 # This action can be used to test transaction failure.
1788 #
1789 # Since: 1.6
1790 ##
1791 { 'struct': 'Abort',
1792   'data': { } }
1793
1794 ##
1795 # @ActionCompletionMode:
1796 #
1797 # An enumeration of Transactional completion modes.
1798 #
1799 # @individual: Do not attempt to cancel any other Actions if any Actions fail
1800 #              after the Transaction request succeeds. All Actions that
1801 #              can complete successfully will do so without waiting on others.
1802 #              This is the default.
1803 #
1804 # @grouped: If any Action fails after the Transaction succeeds, cancel all
1805 #           Actions. Actions do not complete until all Actions are ready to
1806 #           complete. May be rejected by Actions that do not support this
1807 #           completion mode.
1808 #
1809 # Since: 2.5
1810 ##
1811 { 'enum': 'ActionCompletionMode',
1812   'data': [ 'individual', 'grouped' ] }
1813
1814 ##
1815 # @TransactionAction:
1816 #
1817 # A discriminated record of operations that can be performed with
1818 # @transaction.
1819 #
1820 # Since: 1.1
1821 #
1822 # drive-backup since 1.6
1823 # abort since 1.6
1824 # blockdev-snapshot-internal-sync since 1.7
1825 # blockdev-backup since 2.3
1826 # blockdev-snapshot since 2.5
1827 # block-dirty-bitmap-add since 2.5
1828 # block-dirty-bitmap-clear since 2.5
1829 ##
1830 { 'union': 'TransactionAction',
1831   'data': {
1832        'blockdev-snapshot': 'BlockdevSnapshot',
1833        'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
1834        'drive-backup': 'DriveBackup',
1835        'blockdev-backup': 'BlockdevBackup',
1836        'abort': 'Abort',
1837        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
1838        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
1839        'block-dirty-bitmap-clear': 'BlockDirtyBitmap'
1840    } }
1841
1842 ##
1843 # @TransactionProperties:
1844 #
1845 # Optional arguments to modify the behavior of a Transaction.
1846 #
1847 # @completion-mode: #optional Controls how jobs launched asynchronously by
1848 #                   Actions will complete or fail as a group.
1849 #                   See @ActionCompletionMode for details.
1850 #
1851 # Since: 2.5
1852 ##
1853 { 'struct': 'TransactionProperties',
1854   'data': {
1855        '*completion-mode': 'ActionCompletionMode'
1856   }
1857 }
1858
1859 ##
1860 # @transaction:
1861 #
1862 # Executes a number of transactionable QMP commands atomically. If any
1863 # operation fails, then the entire set of actions will be abandoned and the
1864 # appropriate error returned.
1865 #
1866 # @actions: List of @TransactionAction;
1867 #           information needed for the respective operations.
1868 #
1869 # @properties: #optional structure of additional options to control the
1870 #              execution of the transaction. See @TransactionProperties
1871 #              for additional detail.
1872 #
1873 # Returns: nothing on success
1874 #          Errors depend on the operations of the transaction
1875 #
1876 # Note: The transaction aborts on the first failure.  Therefore, there will be
1877 # information on only one failed operation returned in an error condition, and
1878 # subsequent actions will not have been attempted.
1879 #
1880 # Since: 1.1
1881 ##
1882 { 'command': 'transaction',
1883   'data': { 'actions': [ 'TransactionAction' ],
1884             '*properties': 'TransactionProperties'
1885           }
1886 }
1887
1888 ##
1889 # @human-monitor-command:
1890 #
1891 # Execute a command on the human monitor and return the output.
1892 #
1893 # @command-line: the command to execute in the human monitor
1894 #
1895 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1896 #
1897 # Returns: the output of the command as a string
1898 #
1899 # Since: 0.14.0
1900 #
1901 # Notes: This command only exists as a stop-gap.  Its use is highly
1902 #        discouraged.  The semantics of this command are not guaranteed.
1903 #
1904 #        Known limitations:
1905 #
1906 #        o This command is stateless, this means that commands that depend
1907 #          on state information (such as getfd) might not work
1908 #
1909 #       o Commands that prompt the user for data (eg. 'cont' when the block
1910 #         device is encrypted) don't currently work
1911 ##
1912 { 'command': 'human-monitor-command',
1913   'data': {'command-line': 'str', '*cpu-index': 'int'},
1914   'returns': 'str' }
1915
1916 ##
1917 # @migrate_cancel:
1918 #
1919 # Cancel the current executing migration process.
1920 #
1921 # Returns: nothing on success
1922 #
1923 # Notes: This command succeeds even if there is no migration process running.
1924 #
1925 # Since: 0.14.0
1926 ##
1927 { 'command': 'migrate_cancel' }
1928
1929 ##
1930 # @migrate_set_downtime:
1931 #
1932 # Set maximum tolerated downtime for migration.
1933 #
1934 # @value: maximum downtime in seconds
1935 #
1936 # Returns: nothing on success
1937 #
1938 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1939 #
1940 # Since: 0.14.0
1941 ##
1942 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1943
1944 ##
1945 # @migrate_set_speed:
1946 #
1947 # Set maximum speed for migration.
1948 #
1949 # @value: maximum speed in bytes.
1950 #
1951 # Returns: nothing on success
1952 #
1953 # Notes: This command is deprecated in favor of 'migrate-set-parameters'
1954 #
1955 # Since: 0.14.0
1956 ##
1957 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1958
1959 ##
1960 # @migrate-set-cache-size:
1961 #
1962 # Set XBZRLE cache size
1963 #
1964 # @value: cache size in bytes
1965 #
1966 # The size will be rounded down to the nearest power of 2.
1967 # The cache size can be modified before and during ongoing migration
1968 #
1969 # Returns: nothing on success
1970 #
1971 # Since: 1.2
1972 ##
1973 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1974
1975 ##
1976 # @query-migrate-cache-size:
1977 #
1978 # query XBZRLE cache size
1979 #
1980 # Returns: XBZRLE cache size in bytes
1981 #
1982 # Since: 1.2
1983 ##
1984 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1985
1986 ##
1987 # @ObjectPropertyInfo:
1988 #
1989 # @name: the name of the property
1990 #
1991 # @type: the type of the property.  This will typically come in one of four
1992 #        forms:
1993 #
1994 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1995 #           These types are mapped to the appropriate JSON type.
1996 #
1997 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1998 #           device type name.  Child properties create the composition tree.
1999 #
2000 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
2001 #           device type name.  Link properties form the device model graph.
2002 #
2003 # Since: 1.2
2004 ##
2005 { 'struct': 'ObjectPropertyInfo',
2006   'data': { 'name': 'str', 'type': 'str' } }
2007
2008 ##
2009 # @qom-list:
2010 #
2011 # This command will list any properties of a object given a path in the object
2012 # model.
2013 #
2014 # @path: the path within the object model.  See @qom-get for a description of
2015 #        this parameter.
2016 #
2017 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2018 #          object.
2019 #
2020 # Since: 1.2
2021 ##
2022 { 'command': 'qom-list',
2023   'data': { 'path': 'str' },
2024   'returns': [ 'ObjectPropertyInfo' ] }
2025
2026 ##
2027 # @qom-get:
2028 #
2029 # This command will get a property from a object model path and return the
2030 # value.
2031 #
2032 # @path: The path within the object model.  There are two forms of supported
2033 #        paths--absolute and partial paths.
2034 #
2035 #        Absolute paths are derived from the root object and can follow child<>
2036 #        or link<> properties.  Since they can follow link<> properties, they
2037 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2038 #        and are prefixed  with a leading slash.
2039 #
2040 #        Partial paths look like relative filenames.  They do not begin
2041 #        with a prefix.  The matching rules for partial paths are subtle but
2042 #        designed to make specifying objects easy.  At each level of the
2043 #        composition tree, the partial path is matched as an absolute path.
2044 #        The first match is not returned.  At least two matches are searched
2045 #        for.  A successful result is only returned if only one match is
2046 #        found.  If more than one match is found, a flag is return to
2047 #        indicate that the match was ambiguous.
2048 #
2049 # @property: The property name to read
2050 #
2051 # Returns: The property value.  The type depends on the property
2052 #          type. child<> and link<> properties are returned as #str
2053 #          pathnames.  All integer property types (u8, u16, etc) are
2054 #          returned as #int.
2055 #
2056 # Since: 1.2
2057 ##
2058 { 'command': 'qom-get',
2059   'data': { 'path': 'str', 'property': 'str' },
2060   'returns': 'any' }
2061
2062 ##
2063 # @qom-set:
2064 #
2065 # This command will set a property from a object model path.
2066 #
2067 # @path: see @qom-get for a description of this parameter
2068 #
2069 # @property: the property name to set
2070 #
2071 # @value: a value who's type is appropriate for the property type.  See @qom-get
2072 #         for a description of type mapping.
2073 #
2074 # Since: 1.2
2075 ##
2076 { 'command': 'qom-set',
2077   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
2078
2079 ##
2080 # @set_password:
2081 #
2082 # Sets the password of a remote display session.
2083 #
2084 # @protocol: `vnc' to modify the VNC server password
2085 #            `spice' to modify the Spice server password
2086 #
2087 # @password: the new password
2088 #
2089 # @connected: #optional how to handle existing clients when changing the
2090 #                       password.  If nothing is specified, defaults to `keep'
2091 #                       `fail' to fail the command if clients are connected
2092 #                       `disconnect' to disconnect existing clients
2093 #                       `keep' to maintain existing clients
2094 #
2095 # Returns: Nothing on success
2096 #          If Spice is not enabled, DeviceNotFound
2097 #
2098 # Since: 0.14.0
2099 ##
2100 { 'command': 'set_password',
2101   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2102
2103 ##
2104 # @expire_password:
2105 #
2106 # Expire the password of a remote display server.
2107 #
2108 # @protocol: the name of the remote display protocol `vnc' or `spice'
2109 #
2110 # @time: when to expire the password.
2111 #        `now' to expire the password immediately
2112 #        `never' to cancel password expiration
2113 #        `+INT' where INT is the number of seconds from now (integer)
2114 #        `INT' where INT is the absolute time in seconds
2115 #
2116 # Returns: Nothing on success
2117 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2118 #
2119 # Since: 0.14.0
2120 #
2121 # Notes: Time is relative to the server and currently there is no way to
2122 #        coordinate server time with client time.  It is not recommended to
2123 #        use the absolute time version of the @time parameter unless you're
2124 #        sure you are on the same machine as the QEMU instance.
2125 ##
2126 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2127
2128 ##
2129 # @change-vnc-password:
2130 #
2131 # Change the VNC server password.
2132 #
2133 # @password:  the new password to use with VNC authentication
2134 #
2135 # Since: 1.1
2136 #
2137 # Notes:  An empty password in this command will set the password to the empty
2138 #         string.  Existing clients are unaffected by executing this command.
2139 ##
2140 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2141
2142 ##
2143 # @change:
2144 #
2145 # This command is multiple commands multiplexed together.
2146 #
2147 # @device: This is normally the name of a block device but it may also be 'vnc'.
2148 #          when it's 'vnc', then sub command depends on @target
2149 #
2150 # @target: If @device is a block device, then this is the new filename.
2151 #          If @device is 'vnc', then if the value 'password' selects the vnc
2152 #          change password command.   Otherwise, this specifies a new server URI
2153 #          address to listen to for VNC connections.
2154 #
2155 # @arg:    If @device is a block device, then this is an optional format to open
2156 #          the device with.
2157 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2158 #          password to set.  If this argument is an empty string, then no future
2159 #          logins will be allowed.
2160 #
2161 # Returns: Nothing on success.
2162 #          If @device is not a valid block device, DeviceNotFound
2163 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2164 #          if this error is returned, the device has been opened successfully
2165 #          and an additional call to @block_passwd is required to set the
2166 #          device's password.  The behavior of reads and writes to the block
2167 #          device between when these calls are executed is undefined.
2168 #
2169 # Notes:  This interface is deprecated, and it is strongly recommended that you
2170 #         avoid using it.  For changing block devices, use
2171 #         blockdev-change-medium; for changing VNC parameters, use
2172 #         change-vnc-password.
2173 #
2174 # Since: 0.14.0
2175 ##
2176 { 'command': 'change',
2177   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2178
2179 ##
2180 # @ObjectTypeInfo:
2181 #
2182 # This structure describes a search result from @qom-list-types
2183 #
2184 # @name: the type name found in the search
2185 #
2186 # Since: 1.1
2187 #
2188 # Notes: This command is experimental and may change syntax in future releases.
2189 ##
2190 { 'struct': 'ObjectTypeInfo',
2191   'data': { 'name': 'str' } }
2192
2193 ##
2194 # @qom-list-types:
2195 #
2196 # This command will return a list of types given search parameters
2197 #
2198 # @implements: if specified, only return types that implement this type name
2199 #
2200 # @abstract: if true, include abstract types in the results
2201 #
2202 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2203 #
2204 # Since: 1.1
2205 ##
2206 { 'command': 'qom-list-types',
2207   'data': { '*implements': 'str', '*abstract': 'bool' },
2208   'returns': [ 'ObjectTypeInfo' ] }
2209
2210 ##
2211 # @DevicePropertyInfo:
2212 #
2213 # Information about device properties.
2214 #
2215 # @name: the name of the property
2216 # @type: the typename of the property
2217 # @description: #optional if specified, the description of the property.
2218 #               (since 2.2)
2219 #
2220 # Since: 1.2
2221 ##
2222 { 'struct': 'DevicePropertyInfo',
2223   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
2224
2225 ##
2226 # @device-list-properties:
2227 #
2228 # List properties associated with a device.
2229 #
2230 # @typename: the type name of a device
2231 #
2232 # Returns: a list of DevicePropertyInfo describing a devices properties
2233 #
2234 # Since: 1.2
2235 ##
2236 { 'command': 'device-list-properties',
2237   'data': { 'typename': 'str'},
2238   'returns': [ 'DevicePropertyInfo' ] }
2239
2240 ##
2241 # @migrate:
2242 #
2243 # Migrates the current running guest to another Virtual Machine.
2244 #
2245 # @uri: the Uniform Resource Identifier of the destination VM
2246 #
2247 # @blk: #optional do block migration (full disk copy)
2248 #
2249 # @inc: #optional incremental disk copy migration
2250 #
2251 # @detach: this argument exists only for compatibility reasons and
2252 #          is ignored by QEMU
2253 #
2254 # Returns: nothing on success
2255 #
2256 # Since: 0.14.0
2257 ##
2258 { 'command': 'migrate',
2259   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2260
2261 ##
2262 # @migrate-incoming:
2263 #
2264 # Start an incoming migration, the qemu must have been started
2265 # with -incoming defer
2266 #
2267 # @uri: The Uniform Resource Identifier identifying the source or
2268 #       address to listen on
2269 #
2270 # Returns: nothing on success
2271 #
2272 # Since: 2.3
2273 # Note: It's a bad idea to use a string for the uri, but it needs to stay
2274 # compatible with -incoming and the format of the uri is already exposed
2275 # above libvirt
2276 ##
2277 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
2278
2279 ##
2280 # @xen-save-devices-state:
2281 #
2282 # Save the state of all devices to file. The RAM and the block devices
2283 # of the VM are not saved by this command.
2284 #
2285 # @filename: the file to save the state of the devices to as binary
2286 # data. See xen-save-devices-state.txt for a description of the binary
2287 # format.
2288 #
2289 # Returns: Nothing on success
2290 #
2291 # Since: 1.1
2292 ##
2293 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2294
2295 ##
2296 # @xen-set-global-dirty-log:
2297 #
2298 # Enable or disable the global dirty log mode.
2299 #
2300 # @enable: true to enable, false to disable.
2301 #
2302 # Returns: nothing
2303 #
2304 # Since: 1.3
2305 ##
2306 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2307
2308 ##
2309 # @device_add:
2310 #
2311 # @driver: the name of the new device's driver
2312 #
2313 # @bus: #optional the device's parent bus (device tree path)
2314 #
2315 # @id: the device's ID, must be unique
2316 #
2317 # Additional arguments depend on the type.
2318 #
2319 # Add a device.
2320 #
2321 # Notes:
2322 # 1. For detailed information about this command, please refer to the
2323 #    'docs/qdev-device-use.txt' file.
2324 #
2325 # 2. It's possible to list device properties by running QEMU with the
2326 #    "-device DEVICE,help" command-line argument, where DEVICE is the
2327 #    device's name
2328 #
2329 # Example:
2330 #
2331 # -> { "execute": "device_add",
2332 #      "arguments": { "driver": "e1000", "id": "net1",
2333 #                     "bus": "pci.0",
2334 #                     "mac": "52:54:00:12:34:56" } }
2335 # <- { "return": {} }
2336 #
2337 # TODO This command effectively bypasses QAPI completely due to its
2338 # "additional arguments" business.  It shouldn't have been added to
2339 # the schema in this form.  It should be qapified properly, or
2340 # replaced by a properly qapified command.
2341 #
2342 # Since: 0.13
2343 ##
2344 { 'command': 'device_add',
2345   'data': {'driver': 'str', 'id': 'str'},
2346   'gen': false } # so we can get the additional arguments
2347
2348 ##
2349 # @device_del:
2350 #
2351 # Remove a device from a guest
2352 #
2353 # @id: the name or QOM path of the device
2354 #
2355 # Returns: Nothing on success
2356 #          If @id is not a valid device, DeviceNotFound
2357 #
2358 # Notes: When this command completes, the device may not be removed from the
2359 #        guest.  Hot removal is an operation that requires guest cooperation.
2360 #        This command merely requests that the guest begin the hot removal
2361 #        process.  Completion of the device removal process is signaled with a
2362 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2363 #        for all devices.
2364 #
2365 # Since: 0.14.0
2366 ##
2367 { 'command': 'device_del', 'data': {'id': 'str'} }
2368
2369 ##
2370 # @DumpGuestMemoryFormat:
2371 #
2372 # An enumeration of guest-memory-dump's format.
2373 #
2374 # @elf: elf format
2375 #
2376 # @kdump-zlib: kdump-compressed format with zlib-compressed
2377 #
2378 # @kdump-lzo: kdump-compressed format with lzo-compressed
2379 #
2380 # @kdump-snappy: kdump-compressed format with snappy-compressed
2381 #
2382 # Since: 2.0
2383 ##
2384 { 'enum': 'DumpGuestMemoryFormat',
2385   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
2386
2387 ##
2388 # @dump-guest-memory:
2389 #
2390 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2391 # very long depending on the amount of guest memory.
2392 #
2393 # @paging: if true, do paging to get guest's memory mapping. This allows
2394 #          using gdb to process the core file.
2395 #
2396 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2397 #                     of RAM. This can happen for a large guest, or a
2398 #                     malicious guest pretending to be large.
2399 #
2400 #          Also, paging=true has the following limitations:
2401 #
2402 #             1. The guest may be in a catastrophic state or can have corrupted
2403 #                memory, which cannot be trusted
2404 #             2. The guest can be in real-mode even if paging is enabled. For
2405 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2406 #                goes in real-mode
2407 #             3. Currently only supported on i386 and x86_64.
2408 #
2409 # @protocol: the filename or file descriptor of the vmcore. The supported
2410 #            protocols are:
2411 #
2412 #            1. file: the protocol starts with "file:", and the following
2413 #               string is the file's path.
2414 #            2. fd: the protocol starts with "fd:", and the following string
2415 #               is the fd's name.
2416 #
2417 # @detach: #optional if true, QMP will return immediately rather than
2418 #          waiting for the dump to finish. The user can track progress
2419 #          using "query-dump". (since 2.6).
2420 #
2421 # @begin: #optional if specified, the starting physical address.
2422 #
2423 # @length: #optional if specified, the memory size, in bytes. If you don't
2424 #          want to dump all guest's memory, please specify the start @begin
2425 #          and @length
2426 #
2427 # @format: #optional if specified, the format of guest memory dump. But non-elf
2428 #          format is conflict with paging and filter, ie. @paging, @begin and
2429 #          @length is not allowed to be specified with non-elf @format at the
2430 #          same time (since 2.0)
2431 #
2432 # Returns: nothing on success
2433 #
2434 # Since: 1.2
2435 ##
2436 { 'command': 'dump-guest-memory',
2437   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
2438             '*begin': 'int', '*length': 'int',
2439             '*format': 'DumpGuestMemoryFormat'} }
2440
2441 ##
2442 # @DumpStatus:
2443 #
2444 # Describe the status of a long-running background guest memory dump.
2445 #
2446 # @none: no dump-guest-memory has started yet.
2447 #
2448 # @active: there is one dump running in background.
2449 #
2450 # @completed: the last dump has finished successfully.
2451 #
2452 # @failed: the last dump has failed.
2453 #
2454 # Since: 2.6
2455 ##
2456 { 'enum': 'DumpStatus',
2457   'data': [ 'none', 'active', 'completed', 'failed' ] }
2458
2459 ##
2460 # @DumpQueryResult:
2461 #
2462 # The result format for 'query-dump'.
2463 #
2464 # @status: enum of @DumpStatus, which shows current dump status
2465 #
2466 # @completed: bytes written in latest dump (uncompressed)
2467 #
2468 # @total: total bytes to be written in latest dump (uncompressed)
2469 #
2470 # Since: 2.6
2471 ##
2472 { 'struct': 'DumpQueryResult',
2473   'data': { 'status': 'DumpStatus',
2474             'completed': 'int',
2475             'total': 'int' } }
2476
2477 ##
2478 # @query-dump:
2479 #
2480 # Query latest dump status.
2481 #
2482 # Returns: A @DumpStatus object showing the dump status.
2483 #
2484 # Since: 2.6
2485 ##
2486 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
2487
2488 ##
2489 # @DumpGuestMemoryCapability:
2490 #
2491 # A list of the available formats for dump-guest-memory
2492 #
2493 # Since: 2.0
2494 ##
2495 { 'struct': 'DumpGuestMemoryCapability',
2496   'data': {
2497       'formats': ['DumpGuestMemoryFormat'] } }
2498
2499 ##
2500 # @query-dump-guest-memory-capability:
2501 #
2502 # Returns the available formats for dump-guest-memory
2503 #
2504 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
2505 #           dump-guest-memory
2506 #
2507 # Since: 2.0
2508 ##
2509 { 'command': 'query-dump-guest-memory-capability',
2510   'returns': 'DumpGuestMemoryCapability' }
2511
2512 ##
2513 # @dump-skeys:
2514 #
2515 # Dump guest's storage keys
2516 #
2517 # @filename: the path to the file to dump to
2518 #
2519 # This command is only supported on s390 architecture.
2520 #
2521 # Since: 2.5
2522 ##
2523 { 'command': 'dump-skeys',
2524   'data': { 'filename': 'str' } }
2525
2526 ##
2527 # @netdev_add:
2528 #
2529 # Add a network backend.
2530 #
2531 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2532 #        'vde', 'socket', 'dump' and 'bridge'
2533 #
2534 # @id: the name of the new network backend
2535 #
2536 # Additional arguments depend on the type.
2537 #
2538 # TODO This command effectively bypasses QAPI completely due to its
2539 # "additional arguments" business.  It shouldn't have been added to
2540 # the schema in this form.  It should be qapified properly, or
2541 # replaced by a properly qapified command.
2542 #
2543 # Since: 0.14.0
2544 #
2545 # Returns: Nothing on success
2546 #          If @type is not a valid network backend, DeviceNotFound
2547 ##
2548 { 'command': 'netdev_add',
2549   'data': {'type': 'str', 'id': 'str'},
2550   'gen': false }                # so we can get the additional arguments
2551
2552 ##
2553 # @netdev_del:
2554 #
2555 # Remove a network backend.
2556 #
2557 # @id: the name of the network backend to remove
2558 #
2559 # Returns: Nothing on success
2560 #          If @id is not a valid network backend, DeviceNotFound
2561 #
2562 # Since: 0.14.0
2563 ##
2564 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2565
2566 ##
2567 # @object-add:
2568 #
2569 # Create a QOM object.
2570 #
2571 # @qom-type: the class name for the object to be created
2572 #
2573 # @id: the name of the new object
2574 #
2575 # @props: #optional a dictionary of properties to be passed to the backend
2576 #
2577 # Returns: Nothing on success
2578 #          Error if @qom-type is not a valid class name
2579 #
2580 # Since: 2.0
2581 ##
2582 { 'command': 'object-add',
2583   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
2584
2585 ##
2586 # @object-del:
2587 #
2588 # Remove a QOM object.
2589 #
2590 # @id: the name of the QOM object to remove
2591 #
2592 # Returns: Nothing on success
2593 #          Error if @id is not a valid id for a QOM object
2594 #
2595 # Since: 2.0
2596 ##
2597 { 'command': 'object-del', 'data': {'id': 'str'} }
2598
2599 ##
2600 # @NetdevNoneOptions:
2601 #
2602 # Use it alone to have zero network devices.
2603 #
2604 # Since: 1.2
2605 ##
2606 { 'struct': 'NetdevNoneOptions',
2607   'data': { } }
2608
2609 ##
2610 # @NetLegacyNicOptions:
2611 #
2612 # Create a new Network Interface Card.
2613 #
2614 # @netdev: #optional id of -netdev to connect to
2615 #
2616 # @macaddr: #optional MAC address
2617 #
2618 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2619 #
2620 # @addr: #optional PCI device address
2621 #
2622 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2623 #
2624 # Since: 1.2
2625 ##
2626 { 'struct': 'NetLegacyNicOptions',
2627   'data': {
2628     '*netdev':  'str',
2629     '*macaddr': 'str',
2630     '*model':   'str',
2631     '*addr':    'str',
2632     '*vectors': 'uint32' } }
2633
2634 ##
2635 # @String:
2636 #
2637 # A fat type wrapping 'str', to be embedded in lists.
2638 #
2639 # Since: 1.2
2640 ##
2641 { 'struct': 'String',
2642   'data': {
2643     'str': 'str' } }
2644
2645 ##
2646 # @NetdevUserOptions:
2647 #
2648 # Use the user mode network stack which requires no administrator privilege to
2649 # run.
2650 #
2651 # @hostname: #optional client hostname reported by the builtin DHCP server
2652 #
2653 # @restrict: #optional isolate the guest from the host
2654 #
2655 # @ipv4: #optional whether to support IPv4, default true for enabled
2656 #        (since 2.6)
2657 #
2658 # @ipv6: #optional whether to support IPv6, default true for enabled
2659 #        (since 2.6)
2660 #
2661 # @ip: #optional legacy parameter, use net= instead
2662 #
2663 # @net: #optional IP network address that the guest will see, in the
2664 #       form addr[/netmask] The netmask is optional, and can be
2665 #       either in the form a.b.c.d or as a number of valid top-most
2666 #       bits. Default is 10.0.2.0/24.
2667 #
2668 # @host: #optional guest-visible address of the host
2669 #
2670 # @tftp: #optional root directory of the built-in TFTP server
2671 #
2672 # @bootfile: #optional BOOTP filename, for use with tftp=
2673 #
2674 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2675 #             assign
2676 #
2677 # @dns: #optional guest-visible address of the virtual nameserver
2678 #
2679 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2680 #             to the guest
2681 #
2682 # @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since
2683 #               2.6). The network prefix is given in the usual
2684 #               hexadecimal IPv6 address notation.
2685 #
2686 # @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64)
2687 #                  (since 2.6)
2688 #
2689 # @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6)
2690 #
2691 # @ipv6-dns: #optional guest-visible IPv6 address of the virtual
2692 #            nameserver (since 2.6)
2693 #
2694 # @smb: #optional root directory of the built-in SMB server
2695 #
2696 # @smbserver: #optional IP address of the built-in SMB server
2697 #
2698 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2699 #           endpoints
2700 #
2701 # @guestfwd: #optional forward guest TCP connections
2702 #
2703 # Since: 1.2
2704 ##
2705 { 'struct': 'NetdevUserOptions',
2706   'data': {
2707     '*hostname':  'str',
2708     '*restrict':  'bool',
2709     '*ipv4':      'bool',
2710     '*ipv6':      'bool',
2711     '*ip':        'str',
2712     '*net':       'str',
2713     '*host':      'str',
2714     '*tftp':      'str',
2715     '*bootfile':  'str',
2716     '*dhcpstart': 'str',
2717     '*dns':       'str',
2718     '*dnssearch': ['String'],
2719     '*ipv6-prefix':      'str',
2720     '*ipv6-prefixlen':   'int',
2721     '*ipv6-host':        'str',
2722     '*ipv6-dns':         'str',
2723     '*smb':       'str',
2724     '*smbserver': 'str',
2725     '*hostfwd':   ['String'],
2726     '*guestfwd':  ['String'] } }
2727
2728 ##
2729 # @NetdevTapOptions:
2730 #
2731 # Connect the host TAP network interface name to the VLAN.
2732 #
2733 # @ifname: #optional interface name
2734 #
2735 # @fd: #optional file descriptor of an already opened tap
2736 #
2737 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2738 # tap
2739 #
2740 # @script: #optional script to initialize the interface
2741 #
2742 # @downscript: #optional script to shut down the interface
2743 #
2744 # @br: #optional bridge name (since 2.8)
2745 #
2746 # @helper: #optional command to execute to configure bridge
2747 #
2748 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2749 #
2750 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2751 #
2752 # @vhost: #optional enable vhost-net network accelerator
2753 #
2754 # @vhostfd: #optional file descriptor of an already opened vhost net device
2755 #
2756 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2757 # devices
2758 #
2759 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2760 #
2761 # @queues: #optional number of queues to be created for multiqueue capable tap
2762 #
2763 # @poll-us: #optional maximum number of microseconds that could
2764 # be spent on busy polling for tap (since 2.7)
2765 #
2766 # Since: 1.2
2767 ##
2768 { 'struct': 'NetdevTapOptions',
2769   'data': {
2770     '*ifname':     'str',
2771     '*fd':         'str',
2772     '*fds':        'str',
2773     '*script':     'str',
2774     '*downscript': 'str',
2775     '*br':         'str',
2776     '*helper':     'str',
2777     '*sndbuf':     'size',
2778     '*vnet_hdr':   'bool',
2779     '*vhost':      'bool',
2780     '*vhostfd':    'str',
2781     '*vhostfds':   'str',
2782     '*vhostforce': 'bool',
2783     '*queues':     'uint32',
2784     '*poll-us':    'uint32'} }
2785
2786 ##
2787 # @NetdevSocketOptions:
2788 #
2789 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2790 # socket connection.
2791 #
2792 # @fd: #optional file descriptor of an already opened socket
2793 #
2794 # @listen: #optional port number, and optional hostname, to listen on
2795 #
2796 # @connect: #optional port number, and optional hostname, to connect to
2797 #
2798 # @mcast: #optional UDP multicast address and port number
2799 #
2800 # @localaddr: #optional source address and port for multicast and udp packets
2801 #
2802 # @udp: #optional UDP unicast address and port number
2803 #
2804 # Since: 1.2
2805 ##
2806 { 'struct': 'NetdevSocketOptions',
2807   'data': {
2808     '*fd':        'str',
2809     '*listen':    'str',
2810     '*connect':   'str',
2811     '*mcast':     'str',
2812     '*localaddr': 'str',
2813     '*udp':       'str' } }
2814
2815 ##
2816 # @NetdevL2TPv3Options:
2817 #
2818 # Connect the VLAN to Ethernet over L2TPv3 Static tunnel
2819 #
2820 # @src: source address
2821 #
2822 # @dst: destination address
2823 #
2824 # @srcport: #optional source port - mandatory for udp, optional for ip
2825 #
2826 # @dstport: #optional destination port - mandatory for udp, optional for ip
2827 #
2828 # @ipv6: #optional - force the use of ipv6
2829 #
2830 # @udp: #optional - use the udp version of l2tpv3 encapsulation
2831 #
2832 # @cookie64: #optional - use 64 bit coookies
2833 #
2834 # @counter: #optional have sequence counter
2835 #
2836 # @pincounter: #optional pin sequence counter to zero -
2837 #              workaround for buggy implementations or
2838 #              networks with packet reorder
2839 #
2840 # @txcookie: #optional 32 or 64 bit transmit cookie
2841 #
2842 # @rxcookie: #optional 32 or 64 bit receive cookie
2843 #
2844 # @txsession: 32 bit transmit session
2845 #
2846 # @rxsession: #optional 32 bit receive session - if not specified
2847 #             set to the same value as transmit
2848 #
2849 # @offset: #optional additional offset - allows the insertion of
2850 #          additional application-specific data before the packet payload
2851 #
2852 # Since: 2.1
2853 ##
2854 { 'struct': 'NetdevL2TPv3Options',
2855   'data': {
2856     'src':          'str',
2857     'dst':          'str',
2858     '*srcport':     'str',
2859     '*dstport':     'str',
2860     '*ipv6':        'bool',
2861     '*udp':         'bool',
2862     '*cookie64':    'bool',
2863     '*counter':     'bool',
2864     '*pincounter':  'bool',
2865     '*txcookie':    'uint64',
2866     '*rxcookie':    'uint64',
2867     'txsession':    'uint32',
2868     '*rxsession':   'uint32',
2869     '*offset':      'uint32' } }
2870
2871 ##
2872 # @NetdevVdeOptions:
2873 #
2874 # Connect the VLAN to a vde switch running on the host.
2875 #
2876 # @sock: #optional socket path
2877 #
2878 # @port: #optional port number
2879 #
2880 # @group: #optional group owner of socket
2881 #
2882 # @mode: #optional permissions for socket
2883 #
2884 # Since: 1.2
2885 ##
2886 { 'struct': 'NetdevVdeOptions',
2887   'data': {
2888     '*sock':  'str',
2889     '*port':  'uint16',
2890     '*group': 'str',
2891     '*mode':  'uint16' } }
2892
2893 ##
2894 # @NetdevDumpOptions:
2895 #
2896 # Dump VLAN network traffic to a file.
2897 #
2898 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2899 # suffixes.
2900 #
2901 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2902 #
2903 # Since: 1.2
2904 ##
2905 { 'struct': 'NetdevDumpOptions',
2906   'data': {
2907     '*len':  'size',
2908     '*file': 'str' } }
2909
2910 ##
2911 # @NetdevBridgeOptions:
2912 #
2913 # Connect a host TAP network interface to a host bridge device.
2914 #
2915 # @br: #optional bridge name
2916 #
2917 # @helper: #optional command to execute to configure bridge
2918 #
2919 # Since: 1.2
2920 ##
2921 { 'struct': 'NetdevBridgeOptions',
2922   'data': {
2923     '*br':     'str',
2924     '*helper': 'str' } }
2925
2926 ##
2927 # @NetdevHubPortOptions:
2928 #
2929 # Connect two or more net clients through a software hub.
2930 #
2931 # @hubid: hub identifier number
2932 #
2933 # Since: 1.2
2934 ##
2935 { 'struct': 'NetdevHubPortOptions',
2936   'data': {
2937     'hubid':     'int32' } }
2938
2939 ##
2940 # @NetdevNetmapOptions:
2941 #
2942 # Connect a client to a netmap-enabled NIC or to a VALE switch port
2943 #
2944 # @ifname: Either the name of an existing network interface supported by
2945 #          netmap, or the name of a VALE port (created on the fly).
2946 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
2947 #          YYY are non-negative integers. XXX identifies a switch and
2948 #          YYY identifies a port of the switch. VALE ports having the
2949 #          same XXX are therefore connected to the same switch.
2950 #
2951 # @devname: #optional path of the netmap device (default: '/dev/netmap').
2952 #
2953 # Since: 2.0
2954 ##
2955 { 'struct': 'NetdevNetmapOptions',
2956   'data': {
2957     'ifname':     'str',
2958     '*devname':    'str' } }
2959
2960 ##
2961 # @NetdevVhostUserOptions:
2962 #
2963 # Vhost-user network backend
2964 #
2965 # @chardev: name of a unix socket chardev
2966 #
2967 # @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false).
2968 #
2969 # @queues: #optional number of queues to be created for multiqueue vhost-user
2970 #          (default: 1) (Since 2.5)
2971 #
2972 # Since: 2.1
2973 ##
2974 { 'struct': 'NetdevVhostUserOptions',
2975   'data': {
2976     'chardev':        'str',
2977     '*vhostforce':    'bool',
2978     '*queues':        'int' } }
2979
2980 ##
2981 # @NetClientDriver:
2982 #
2983 # Available netdev drivers.
2984 #
2985 # Since: 2.7
2986 ##
2987 { 'enum': 'NetClientDriver',
2988   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
2989             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
2990
2991 ##
2992 # @Netdev:
2993 #
2994 # Captures the configuration of a network device.
2995 #
2996 # @id: identifier for monitor commands.
2997 #
2998 # @type: Specify the driver used for interpreting remaining arguments.
2999 #
3000 # Since: 1.2
3001 #
3002 # 'l2tpv3' - since 2.1
3003 ##
3004 { 'union': 'Netdev',
3005   'base': { 'id': 'str', 'type': 'NetClientDriver' },
3006   'discriminator': 'type',
3007   'data': {
3008     'none':     'NetdevNoneOptions',
3009     'nic':      'NetLegacyNicOptions',
3010     'user':     'NetdevUserOptions',
3011     'tap':      'NetdevTapOptions',
3012     'l2tpv3':   'NetdevL2TPv3Options',
3013     'socket':   'NetdevSocketOptions',
3014     'vde':      'NetdevVdeOptions',
3015     'dump':     'NetdevDumpOptions',
3016     'bridge':   'NetdevBridgeOptions',
3017     'hubport':  'NetdevHubPortOptions',
3018     'netmap':   'NetdevNetmapOptions',
3019     'vhost-user': 'NetdevVhostUserOptions' } }
3020
3021 ##
3022 # @NetLegacy:
3023 #
3024 # Captures the configuration of a network device; legacy.
3025 #
3026 # @vlan: #optional vlan number
3027 #
3028 # @id: #optional identifier for monitor commands
3029 #
3030 # @name: #optional identifier for monitor commands, ignored if @id is present
3031 #
3032 # @opts: device type specific properties (legacy)
3033 #
3034 # Since: 1.2
3035 ##
3036 { 'struct': 'NetLegacy',
3037   'data': {
3038     '*vlan': 'int32',
3039     '*id':   'str',
3040     '*name': 'str',
3041     'opts':  'NetLegacyOptions' } }
3042
3043 ##
3044 # @NetLegacyOptions:
3045 #
3046 # Like Netdev, but for use only by the legacy command line options
3047 #
3048 # Since: 1.2
3049 ##
3050 { 'union': 'NetLegacyOptions',
3051   'data': {
3052     'none':     'NetdevNoneOptions',
3053     'nic':      'NetLegacyNicOptions',
3054     'user':     'NetdevUserOptions',
3055     'tap':      'NetdevTapOptions',
3056     'l2tpv3':   'NetdevL2TPv3Options',
3057     'socket':   'NetdevSocketOptions',
3058     'vde':      'NetdevVdeOptions',
3059     'dump':     'NetdevDumpOptions',
3060     'bridge':   'NetdevBridgeOptions',
3061     'netmap':   'NetdevNetmapOptions',
3062     'vhost-user': 'NetdevVhostUserOptions' } }
3063
3064 ##
3065 # @NetFilterDirection:
3066 #
3067 # Indicates whether a netfilter is attached to a netdev's transmit queue or
3068 # receive queue or both.
3069 #
3070 # @all: the filter is attached both to the receive and the transmit
3071 #       queue of the netdev (default).
3072 #
3073 # @rx: the filter is attached to the receive queue of the netdev,
3074 #      where it will receive packets sent to the netdev.
3075 #
3076 # @tx: the filter is attached to the transmit queue of the netdev,
3077 #      where it will receive packets sent by the netdev.
3078 #
3079 # Since: 2.5
3080 ##
3081 { 'enum': 'NetFilterDirection',
3082   'data': [ 'all', 'rx', 'tx' ] }
3083
3084 ##
3085 # @InetSocketAddress:
3086 #
3087 # Captures a socket address or address range in the Internet namespace.
3088 #
3089 # @host: host part of the address
3090 #
3091 # @port: port part of the address, or lowest port if @to is present
3092 #
3093 # @to: highest port to try
3094 #
3095 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3096 #        #optional
3097 #
3098 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3099 #        #optional
3100 #
3101 # Since: 1.3
3102 ##
3103 { 'struct': 'InetSocketAddress',
3104   'data': {
3105     'host': 'str',
3106     'port': 'str',
3107     '*to': 'uint16',
3108     '*ipv4': 'bool',
3109     '*ipv6': 'bool' } }
3110
3111 ##
3112 # @UnixSocketAddress:
3113 #
3114 # Captures a socket address in the local ("Unix socket") namespace.
3115 #
3116 # @path: filesystem path to use
3117 #
3118 # Since: 1.3
3119 ##
3120 { 'struct': 'UnixSocketAddress',
3121   'data': {
3122     'path': 'str' } }
3123
3124 ##
3125 # @VsockSocketAddress:
3126 #
3127 # Captures a socket address in the vsock namespace.
3128 #
3129 # @cid: unique host identifier
3130 # @port: port
3131 #
3132 # Note: string types are used to allow for possible future hostname or
3133 # service resolution support.
3134 #
3135 # Since: 2.8
3136 ##
3137 { 'struct': 'VsockSocketAddress',
3138   'data': {
3139     'cid': 'str',
3140     'port': 'str' } }
3141
3142 ##
3143 # @SocketAddress:
3144 #
3145 # Captures the address of a socket, which could also be a named file descriptor
3146 #
3147 # Since: 1.3
3148 ##
3149 { 'union': 'SocketAddress',
3150   'data': {
3151     'inet': 'InetSocketAddress',
3152     'unix': 'UnixSocketAddress',
3153     'vsock': 'VsockSocketAddress',
3154     'fd': 'String' } }
3155
3156 ##
3157 # @getfd:
3158 #
3159 # Receive a file descriptor via SCM rights and assign it a name
3160 #
3161 # @fdname: file descriptor name
3162 #
3163 # Returns: Nothing on success
3164 #
3165 # Since: 0.14.0
3166 #
3167 # Notes: If @fdname already exists, the file descriptor assigned to
3168 #        it will be closed and replaced by the received file
3169 #        descriptor.
3170 #        The 'closefd' command can be used to explicitly close the
3171 #        file descriptor when it is no longer needed.
3172 ##
3173 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3174
3175 ##
3176 # @closefd:
3177 #
3178 # Close a file descriptor previously passed via SCM rights
3179 #
3180 # @fdname: file descriptor name
3181 #
3182 # Returns: Nothing on success
3183 #
3184 # Since: 0.14.0
3185 ##
3186 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3187
3188 ##
3189 # @MachineInfo:
3190 #
3191 # Information describing a machine.
3192 #
3193 # @name: the name of the machine
3194 #
3195 # @alias: #optional an alias for the machine name
3196 #
3197 # @is-default: #optional whether the machine is default
3198 #
3199 # @cpu-max: maximum number of CPUs supported by the machine type
3200 #           (since 1.5.0)
3201 #
3202 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
3203 #
3204 # Since: 1.2.0
3205 ##
3206 { 'struct': 'MachineInfo',
3207   'data': { 'name': 'str', '*alias': 'str',
3208             '*is-default': 'bool', 'cpu-max': 'int',
3209             'hotpluggable-cpus': 'bool'} }
3210
3211 ##
3212 # @query-machines:
3213 #
3214 # Return a list of supported machines
3215 #
3216 # Returns: a list of MachineInfo
3217 #
3218 # Since: 1.2.0
3219 ##
3220 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3221
3222 ##
3223 # @CpuDefinitionInfo:
3224 #
3225 # Virtual CPU definition.
3226 #
3227 # @name: the name of the CPU definition
3228 #
3229 # @migration-safe: #optional whether a CPU definition can be safely used for
3230 #                  migration in combination with a QEMU compatibility machine
3231 #                  when migrating between different QMU versions and between
3232 #                  hosts with different sets of (hardware or software)
3233 #                  capabilities. If not provided, information is not available
3234 #                  and callers should not assume the CPU definition to be
3235 #                  migration-safe. (since 2.8)
3236 #
3237 # @static: whether a CPU definition is static and will not change depending on
3238 #          QEMU version, machine type, machine options and accelerator options.
3239 #          A static model is always migration-safe. (since 2.8)
3240 #
3241 # @unavailable-features: #optional List of properties that prevent
3242 #                        the CPU model from running in the current
3243 #                        host. (since 2.8)
3244 #
3245 # @unavailable-features is a list of QOM property names that
3246 # represent CPU model attributes that prevent the CPU from running.
3247 # If the QOM property is read-only, that means there's no known
3248 # way to make the CPU model run in the current host. Implementations
3249 # that choose not to provide specific information return the
3250 # property name "type".
3251 # If the property is read-write, it means that it MAY be possible
3252 # to run the CPU model in the current host if that property is
3253 # changed. Management software can use it as hints to suggest or
3254 # choose an alternative for the user, or just to generate meaningful
3255 # error messages explaining why the CPU model can't be used.
3256 # If @unavailable-features is an empty list, the CPU model is
3257 # runnable using the current host and machine-type.
3258 # If @unavailable-features is not present, runnability
3259 # information for the CPU is not available.
3260 #
3261 # Since: 1.2.0
3262 ##
3263 { 'struct': 'CpuDefinitionInfo',
3264   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
3265             '*unavailable-features': [ 'str' ] } }
3266
3267 ##
3268 # @query-cpu-definitions:
3269 #
3270 # Return a list of supported virtual CPU definitions
3271 #
3272 # Returns: a list of CpuDefInfo
3273 #
3274 # Since: 1.2.0
3275 ##
3276 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3277
3278 ##
3279 # @CpuModelInfo:
3280 #
3281 # Virtual CPU model.
3282 #
3283 # A CPU model consists of the name of a CPU definition, to which
3284 # delta changes are applied (e.g. features added/removed). Most magic values
3285 # that an architecture might require should be hidden behind the name.
3286 # However, if required, architectures can expose relevant properties.
3287 #
3288 # @name: the name of the CPU definition the model is based on
3289 # @props: #optional a dictionary of QOM properties to be applied
3290 #
3291 # Since: 2.8.0
3292 ##
3293 { 'struct': 'CpuModelInfo',
3294   'data': { 'name': 'str',
3295             '*props': 'any' } }
3296
3297 ##
3298 # @CpuModelExpansionType:
3299 #
3300 # An enumeration of CPU model expansion types.
3301 #
3302 # @static: Expand to a static CPU model, a combination of a static base
3303 #          model name and property delta changes. As the static base model will
3304 #          never change, the expanded CPU model will be the same, independant of
3305 #          independent of QEMU version, machine type, machine options, and
3306 #          accelerator options. Therefore, the resulting model can be used by
3307 #          tooling without having to specify a compatibility machine - e.g. when
3308 #          displaying the "host" model. static CPU models are migration-safe.
3309 #
3310 # @full: Expand all properties. The produced model is not guaranteed to be
3311 #        migration-safe, but allows tooling to get an insight and work with
3312 #        model details.
3313 #
3314 # Since: 2.8.0
3315 ##
3316 { 'enum': 'CpuModelExpansionType',
3317   'data': [ 'static', 'full' ] }
3318
3319
3320 ##
3321 # @CpuModelExpansionInfo:
3322 #
3323 # The result of a cpu model expansion.
3324 #
3325 # @model: the expanded CpuModelInfo.
3326 #
3327 # Since: 2.8.0
3328 ##
3329 { 'struct': 'CpuModelExpansionInfo',
3330   'data': { 'model': 'CpuModelInfo' } }
3331
3332
3333 ##
3334 # @query-cpu-model-expansion:
3335 #
3336 # Expands a given CPU model (or a combination of CPU model + additional options)
3337 # to different granularities, allowing tooling to get an understanding what a
3338 # specific CPU model looks like in QEMU under a certain configuration.
3339 #
3340 # This interface can be used to query the "host" CPU model.
3341 #
3342 # The data returned by this command may be affected by:
3343 #
3344 # * QEMU version: CPU models may look different depending on the QEMU version.
3345 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3346 # * machine-type: CPU model  may look different depending on the machine-type.
3347 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3348 # * machine options (including accelerator): in some architectures, CPU models
3349 #   may look different depending on machine and accelerator options. (Except for
3350 #   CPU models reported as "static" in query-cpu-definitions.)
3351 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3352 #   global properties may affect expansion of CPU models. Using
3353 #   query-cpu-model-expansion while using these is not advised.
3354 #
3355 # Some architectures may not support all expansion types. s390x supports
3356 # "full" and "static".
3357 #
3358 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
3359 #          not supported, if the model cannot be expanded, if the model contains
3360 #          an unknown CPU definition name, unknown properties or properties
3361 #          with a wrong type. Also returns an error if an expansion type is
3362 #          not supported.
3363 #
3364 # Since: 2.8.0
3365 ##
3366 { 'command': 'query-cpu-model-expansion',
3367   'data': { 'type': 'CpuModelExpansionType',
3368             'model': 'CpuModelInfo' },
3369   'returns': 'CpuModelExpansionInfo' }
3370
3371 ##
3372 # @CpuModelCompareResult:
3373 #
3374 # An enumeration of CPU model comparation results. The result is usually
3375 # calculated using e.g. CPU features or CPU generations.
3376 #
3377 # @incompatible: If model A is incompatible to model B, model A is not
3378 #                guaranteed to run where model B runs and the other way around.
3379 #
3380 # @identical: If model A is identical to model B, model A is guaranteed to run
3381 #             where model B runs and the other way around.
3382 #
3383 # @superset: If model A is a superset of model B, model B is guaranteed to run
3384 #            where model A runs. There are no guarantees about the other way.
3385 #
3386 # @subset: If model A is a subset of model B, model A is guaranteed to run
3387 #          where model B runs. There are no guarantees about the other way.
3388 #
3389 # Since: 2.8.0
3390 ##
3391 { 'enum': 'CpuModelCompareResult',
3392   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
3393
3394 ##
3395 # @CpuModelCompareInfo:
3396 #
3397 # The result of a CPU model comparison.
3398 #
3399 # @result: The result of the compare operation.
3400 # @responsible-properties: List of properties that led to the comparison result
3401 #                          not being identical.
3402 #
3403 # @responsible-properties is a list of QOM property names that led to
3404 # both CPUs not being detected as identical. For identical models, this
3405 # list is empty.
3406 # If a QOM property is read-only, that means there's no known way to make the
3407 # CPU models identical. If the special property name "type" is included, the
3408 # models are by definition not identical and cannot be made identical.
3409 #
3410 # Since: 2.8.0
3411 ##
3412 { 'struct': 'CpuModelCompareInfo',
3413   'data': {'result': 'CpuModelCompareResult',
3414            'responsible-properties': ['str']
3415           }
3416 }
3417
3418 ##
3419 # @query-cpu-model-comparison:
3420 #
3421 # Compares two CPU models, returning how they compare in a specific
3422 # configuration. The results indicates how both models compare regarding
3423 # runnability. This result can be used by tooling to make decisions if a
3424 # certain CPU model will run in a certain configuration or if a compatible
3425 # CPU model has to be created by baselining.
3426 #
3427 # Usually, a CPU model is compared against the maximum possible CPU model
3428 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
3429 # model is identical or a subset, it will run in that configuration.
3430 #
3431 # The result returned by this command may be affected by:
3432 #
3433 # * QEMU version: CPU models may look different depending on the QEMU version.
3434 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3435 # * machine-type: CPU model may look different depending on the machine-type.
3436 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3437 # * machine options (including accelerator): in some architectures, CPU models
3438 #   may look different depending on machine and accelerator options. (Except for
3439 #   CPU models reported as "static" in query-cpu-definitions.)
3440 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3441 #   global properties may affect expansion of CPU models. Using
3442 #   query-cpu-model-expansion while using these is not advised.
3443 #
3444 # Some architectures may not support comparing CPU models. s390x supports
3445 # comparing CPU models.
3446 #
3447 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
3448 #          not supported, if a model cannot be used, if a model contains
3449 #          an unknown cpu definition name, unknown properties or properties
3450 #          with wrong types.
3451 #
3452 # Since: 2.8.0
3453 ##
3454 { 'command': 'query-cpu-model-comparison',
3455   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
3456   'returns': 'CpuModelCompareInfo' }
3457
3458 ##
3459 # @CpuModelBaselineInfo:
3460 #
3461 # The result of a CPU model baseline.
3462 #
3463 # @model: the baselined CpuModelInfo.
3464 #
3465 # Since: 2.8.0
3466 ##
3467 { 'struct': 'CpuModelBaselineInfo',
3468   'data': { 'model': 'CpuModelInfo' } }
3469
3470 ##
3471 # @query-cpu-model-baseline:
3472 #
3473 # Baseline two CPU models, creating a compatible third model. The created
3474 # model will always be a static, migration-safe CPU model (see "static"
3475 # CPU model expansion for details).
3476 #
3477 # This interface can be used by tooling to create a compatible CPU model out
3478 # two CPU models. The created CPU model will be identical to or a subset of
3479 # both CPU models when comparing them. Therefore, the created CPU model is
3480 # guaranteed to run where the given CPU models run.
3481 #
3482 # The result returned by this command may be affected by:
3483 #
3484 # * QEMU version: CPU models may look different depending on the QEMU version.
3485 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3486 # * machine-type: CPU model may look different depending on the machine-type.
3487 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
3488 # * machine options (including accelerator): in some architectures, CPU models
3489 #   may look different depending on machine and accelerator options. (Except for
3490 #   CPU models reported as "static" in query-cpu-definitions.)
3491 # * "-cpu" arguments and global properties: arguments to the -cpu option and
3492 #   global properties may affect expansion of CPU models. Using
3493 #   query-cpu-model-expansion while using these is not advised.
3494 #
3495 # Some architectures may not support baselining CPU models. s390x supports
3496 # baselining CPU models.
3497 #
3498 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
3499 #          not supported, if a model cannot be used, if a model contains
3500 #          an unknown cpu definition name, unknown properties or properties
3501 #          with wrong types.
3502 #
3503 # Since: 2.8.0
3504 ##
3505 { 'command': 'query-cpu-model-baseline',
3506   'data': { 'modela': 'CpuModelInfo',
3507             'modelb': 'CpuModelInfo' },
3508   'returns': 'CpuModelBaselineInfo' }
3509
3510 ##
3511 # @AddfdInfo:
3512 #
3513 # Information about a file descriptor that was added to an fd set.
3514 #
3515 # @fdset-id: The ID of the fd set that @fd was added to.
3516 #
3517 # @fd: The file descriptor that was received via SCM rights and
3518 #      added to the fd set.
3519 #
3520 # Since: 1.2.0
3521 ##
3522 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3523
3524 ##
3525 # @add-fd:
3526 #
3527 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3528 #
3529 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3530 #
3531 # @opaque: #optional A free-form string that can be used to describe the fd.
3532 #
3533 # Returns: @AddfdInfo on success
3534 #          If file descriptor was not received, FdNotSupplied
3535 #          If @fdset-id is a negative value, InvalidParameterValue
3536 #
3537 # Notes: The list of fd sets is shared by all monitor connections.
3538 #
3539 #        If @fdset-id is not specified, a new fd set will be created.
3540 #
3541 # Since: 1.2.0
3542 ##
3543 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3544   'returns': 'AddfdInfo' }
3545
3546 ##
3547 # @remove-fd:
3548 #
3549 # Remove a file descriptor from an fd set.
3550 #
3551 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3552 #
3553 # @fd: #optional The file descriptor that is to be removed.
3554 #
3555 # Returns: Nothing on success
3556 #          If @fdset-id or @fd is not found, FdNotFound
3557 #
3558 # Since: 1.2.0
3559 #
3560 # Notes: The list of fd sets is shared by all monitor connections.
3561 #
3562 #        If @fd is not specified, all file descriptors in @fdset-id
3563 #        will be removed.
3564 ##
3565 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3566
3567 ##
3568 # @FdsetFdInfo:
3569 #
3570 # Information about a file descriptor that belongs to an fd set.
3571 #
3572 # @fd: The file descriptor value.
3573 #
3574 # @opaque: #optional A free-form string that can be used to describe the fd.
3575 #
3576 # Since: 1.2.0
3577 ##
3578 { 'struct': 'FdsetFdInfo',
3579   'data': {'fd': 'int', '*opaque': 'str'} }
3580
3581 ##
3582 # @FdsetInfo:
3583 #
3584 # Information about an fd set.
3585 #
3586 # @fdset-id: The ID of the fd set.
3587 #
3588 # @fds: A list of file descriptors that belong to this fd set.
3589 #
3590 # Since: 1.2.0
3591 ##
3592 { 'struct': 'FdsetInfo',
3593   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3594
3595 ##
3596 # @query-fdsets:
3597 #
3598 # Return information describing all fd sets.
3599 #
3600 # Returns: A list of @FdsetInfo
3601 #
3602 # Since: 1.2.0
3603 #
3604 # Note: The list of fd sets is shared by all monitor connections.
3605 #
3606 ##
3607 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3608
3609 ##
3610 # @TargetInfo:
3611 #
3612 # Information describing the QEMU target.
3613 #
3614 # @arch: the target architecture (eg "x86_64", "i386", etc)
3615 #
3616 # Since: 1.2.0
3617 ##
3618 { 'struct': 'TargetInfo',
3619   'data': { 'arch': 'str' } }
3620
3621 ##
3622 # @query-target:
3623 #
3624 # Return information about the target for this QEMU
3625 #
3626 # Returns: TargetInfo
3627 #
3628 # Since: 1.2.0
3629 ##
3630 { 'command': 'query-target', 'returns': 'TargetInfo' }
3631
3632 ##
3633 # @QKeyCode:
3634 #
3635 # @unmapped: since 2.0
3636 # @pause: since 2.0
3637 # @ro: since 2.4
3638 # @kp_comma: since 2.4
3639 # @kp_equals: since 2.6
3640 # @power: since 2.6
3641 #
3642 # An enumeration of key name.
3643 #
3644 # This is used by the send-key command.
3645 #
3646 # Since: 1.3.0
3647 #
3648 ##
3649 { 'enum': 'QKeyCode',
3650   'data': [ 'unmapped',
3651             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3652             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3653             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3654             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3655             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3656             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3657             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3658             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3659             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3660             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3661             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3662             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3663             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3664             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3665             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
3666             'kp_comma', 'kp_equals', 'power' ] }
3667
3668 ##
3669 # @KeyValue:
3670 #
3671 # Represents a keyboard key.
3672 #
3673 # Since: 1.3.0
3674 ##
3675 { 'union': 'KeyValue',
3676   'data': {
3677     'number': 'int',
3678     'qcode': 'QKeyCode' } }
3679
3680 ##
3681 # @send-key:
3682 #
3683 # Send keys to guest.
3684 #
3685 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3686 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3687 #        directly to the guest, while @KeyValue.qcode must be a valid
3688 #        @QKeyCode value
3689 #
3690 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3691 #             to 100
3692 #
3693 # Returns: Nothing on success
3694 #          If key is unknown or redundant, InvalidParameter
3695 #
3696 # Since: 1.3.0
3697 #
3698 ##
3699 { 'command': 'send-key',
3700   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3701
3702 ##
3703 # @screendump:
3704 #
3705 # Write a PPM of the VGA screen to a file.
3706 #
3707 # @filename: the path of a new PPM file to store the image
3708 #
3709 # Returns: Nothing on success
3710 #
3711 # Since: 0.14.0
3712 ##
3713 { 'command': 'screendump', 'data': {'filename': 'str'} }
3714
3715
3716 ##
3717 # @ChardevCommon:
3718 #
3719 # Configuration shared across all chardev backends
3720 #
3721 # @logfile: #optional The name of a logfile to save output
3722 # @logappend: #optional true to append instead of truncate
3723 #             (default to false to truncate)
3724 #
3725 # Since: 2.6
3726 ##
3727 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
3728                                        '*logappend': 'bool' } }
3729
3730 ##
3731 # @ChardevFile:
3732 #
3733 # Configuration info for file chardevs.
3734 #
3735 # @in:  #optional The name of the input file
3736 # @out: The name of the output file
3737 # @append: #optional Open the file in append mode (default false to
3738 #          truncate) (Since 2.6)
3739 #
3740 # Since: 1.4
3741 ##
3742 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
3743                                    'out' : 'str',
3744                                    '*append': 'bool' },
3745   'base': 'ChardevCommon' }
3746
3747 ##
3748 # @ChardevHostdev:
3749 #
3750 # Configuration info for device and pipe chardevs.
3751 #
3752 # @device: The name of the special file for the device,
3753 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3754 #
3755 # Since: 1.4
3756 ##
3757 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
3758   'base': 'ChardevCommon' }
3759
3760 ##
3761 # @ChardevSocket:
3762 #
3763 # Configuration info for (stream) socket chardevs.
3764 #
3765 # @addr: socket address to listen on (server=true)
3766 #        or connect to (server=false)
3767 # @tls-creds: #optional the ID of the TLS credentials object (since 2.6)
3768 # @server: #optional create server socket (default: true)
3769 # @wait: #optional wait for incoming connection on server
3770 #        sockets (default: false).
3771 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3772 # @telnet: #optional enable telnet protocol on server
3773 #          sockets (default: false)
3774 # @reconnect: #optional For a client socket, if a socket is disconnected,
3775 #          then attempt a reconnect after the given number of seconds.
3776 #          Setting this to zero disables this function. (default: 0)
3777 #          (Since: 2.2)
3778 #
3779 # Since: 1.4
3780 ##
3781 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddress',
3782                                      '*tls-creds'  : 'str',
3783                                      '*server'    : 'bool',
3784                                      '*wait'      : 'bool',
3785                                      '*nodelay'   : 'bool',
3786                                      '*telnet'    : 'bool',
3787                                      '*reconnect' : 'int' },
3788   'base': 'ChardevCommon' }
3789
3790 ##
3791 # @ChardevUdp:
3792 #
3793 # Configuration info for datagram socket chardevs.
3794 #
3795 # @remote: remote address
3796 # @local: #optional local address
3797 #
3798 # Since: 1.5
3799 ##
3800 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3801                                   '*local' : 'SocketAddress' },
3802   'base': 'ChardevCommon' }
3803
3804 ##
3805 # @ChardevMux:
3806 #
3807 # Configuration info for mux chardevs.
3808 #
3809 # @chardev: name of the base chardev.
3810 #
3811 # Since: 1.5
3812 ##
3813 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
3814   'base': 'ChardevCommon' }
3815
3816 ##
3817 # @ChardevStdio:
3818 #
3819 # Configuration info for stdio chardevs.
3820 #
3821 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3822 #          be delivered to qemu.  Default: true in -nographic mode,
3823 #          false otherwise.
3824 #
3825 # Since: 1.5
3826 ##
3827 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
3828   'base': 'ChardevCommon' }
3829
3830
3831 ##
3832 # @ChardevSpiceChannel:
3833 #
3834 # Configuration info for spice vm channel chardevs.
3835 #
3836 # @type: kind of channel (for example vdagent).
3837 #
3838 # Since: 1.5
3839 ##
3840 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
3841   'base': 'ChardevCommon' }
3842
3843 ##
3844 # @ChardevSpicePort:
3845 #
3846 # Configuration info for spice port chardevs.
3847 #
3848 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3849 #
3850 # Since: 1.5
3851 ##
3852 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
3853   'base': 'ChardevCommon' }
3854
3855 ##
3856 # @ChardevVC:
3857 #
3858 # Configuration info for virtual console chardevs.
3859 #
3860 # @width:  console width,  in pixels
3861 # @height: console height, in pixels
3862 # @cols:   console width,  in chars
3863 # @rows:   console height, in chars
3864 #
3865 # Since: 1.5
3866 ##
3867 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
3868                                  '*height' : 'int',
3869                                  '*cols'   : 'int',
3870                                  '*rows'   : 'int' },
3871   'base': 'ChardevCommon' }
3872
3873 ##
3874 # @ChardevRingbuf:
3875 #
3876 # Configuration info for ring buffer chardevs.
3877 #
3878 # @size: #optional ring buffer size, must be power of two, default is 65536
3879 #
3880 # Since: 1.5
3881 ##
3882 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
3883   'base': 'ChardevCommon' }
3884
3885 ##
3886 # @ChardevBackend:
3887 #
3888 # Configuration info for the new chardev backend.
3889 #
3890 # Since: 1.4 (testdev since 2.2)
3891 ##
3892 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3893                                        'serial' : 'ChardevHostdev',
3894                                        'parallel': 'ChardevHostdev',
3895                                        'pipe'   : 'ChardevHostdev',
3896                                        'socket' : 'ChardevSocket',
3897                                        'udp'    : 'ChardevUdp',
3898                                        'pty'    : 'ChardevCommon',
3899                                        'null'   : 'ChardevCommon',
3900                                        'mux'    : 'ChardevMux',
3901                                        'msmouse': 'ChardevCommon',
3902                                        'braille': 'ChardevCommon',
3903                                        'testdev': 'ChardevCommon',
3904                                        'stdio'  : 'ChardevStdio',
3905                                        'console': 'ChardevCommon',
3906                                        'spicevmc' : 'ChardevSpiceChannel',
3907                                        'spiceport' : 'ChardevSpicePort',
3908                                        'vc'     : 'ChardevVC',
3909                                        'ringbuf': 'ChardevRingbuf',
3910                                        # next one is just for compatibility
3911                                        'memory' : 'ChardevRingbuf' } }
3912
3913 ##
3914 # @ChardevReturn:
3915 #
3916 # Return info about the chardev backend just created.
3917 #
3918 # @pty: #optional name of the slave pseudoterminal device, present if
3919 #       and only if a chardev of type 'pty' was created
3920 #
3921 # Since: 1.4
3922 ##
3923 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3924
3925 ##
3926 # @chardev-add:
3927 #
3928 # Add a character device backend
3929 #
3930 # @id: the chardev's ID, must be unique
3931 # @backend: backend type and parameters
3932 #
3933 # Returns: ChardevReturn.
3934 #
3935 # Since: 1.4
3936 ##
3937 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3938                                      'backend' : 'ChardevBackend' },
3939   'returns': 'ChardevReturn' }
3940
3941 ##
3942 # @chardev-remove:
3943 #
3944 # Remove a character device backend
3945 #
3946 # @id: the chardev's ID, must exist and not be in use
3947 #
3948 # Returns: Nothing on success
3949 #
3950 # Since: 1.4
3951 ##
3952 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3953
3954 ##
3955 # @TpmModel:
3956 #
3957 # An enumeration of TPM models
3958 #
3959 # @tpm-tis: TPM TIS model
3960 #
3961 # Since: 1.5
3962 ##
3963 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3964
3965 ##
3966 # @query-tpm-models:
3967 #
3968 # Return a list of supported TPM models
3969 #
3970 # Returns: a list of TpmModel
3971 #
3972 # Since: 1.5
3973 ##
3974 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3975
3976 ##
3977 # @TpmType:
3978 #
3979 # An enumeration of TPM types
3980 #
3981 # @passthrough: TPM passthrough type
3982 #
3983 # Since: 1.5
3984 ##
3985 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3986
3987 ##
3988 # @query-tpm-types:
3989 #
3990 # Return a list of supported TPM types
3991 #
3992 # Returns: a list of TpmType
3993 #
3994 # Since: 1.5
3995 ##
3996 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3997
3998 ##
3999 # @TPMPassthroughOptions:
4000 #
4001 # Information about the TPM passthrough type
4002 #
4003 # @path: #optional string describing the path used for accessing the TPM device
4004 #
4005 # @cancel-path: #optional string showing the TPM's sysfs cancel file
4006 #               for cancellation of TPM commands while they are executing
4007 #
4008 # Since: 1.5
4009 ##
4010 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
4011                                              '*cancel-path' : 'str'} }
4012
4013 ##
4014 # @TpmTypeOptions:
4015 #
4016 # A union referencing different TPM backend types' configuration options
4017 #
4018 # @type: 'passthrough' The configuration options for the TPM passthrough type
4019 #
4020 # Since: 1.5
4021 ##
4022 { 'union': 'TpmTypeOptions',
4023    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
4024
4025 ##
4026 # @TPMInfo:
4027 #
4028 # Information about the TPM
4029 #
4030 # @id: The Id of the TPM
4031 #
4032 # @model: The TPM frontend model
4033 #
4034 # @options: The TPM (backend) type configuration options
4035 #
4036 # Since: 1.5
4037 ##
4038 { 'struct': 'TPMInfo',
4039   'data': {'id': 'str',
4040            'model': 'TpmModel',
4041            'options': 'TpmTypeOptions' } }
4042
4043 ##
4044 # @query-tpm:
4045 #
4046 # Return information about the TPM device
4047 #
4048 # Returns: @TPMInfo on success
4049 #
4050 # Since: 1.5
4051 ##
4052 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
4053
4054 ##
4055 # @AcpiTableOptions:
4056 #
4057 # Specify an ACPI table on the command line to load.
4058 #
4059 # At most one of @file and @data can be specified. The list of files specified
4060 # by any one of them is loaded and concatenated in order. If both are omitted,
4061 # @data is implied.
4062 #
4063 # Other fields / optargs can be used to override fields of the generic ACPI
4064 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
4065 # Description Table Header. If a header field is not overridden, then the
4066 # corresponding value from the concatenated blob is used (in case of @file), or
4067 # it is filled in with a hard-coded value (in case of @data).
4068 #
4069 # String fields are copied into the matching ACPI member from lowest address
4070 # upwards, and silently truncated / NUL-padded to length.
4071 #
4072 # @sig: #optional table signature / identifier (4 bytes)
4073 #
4074 # @rev: #optional table revision number (dependent on signature, 1 byte)
4075 #
4076 # @oem_id: #optional OEM identifier (6 bytes)
4077 #
4078 # @oem_table_id: #optional OEM table identifier (8 bytes)
4079 #
4080 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
4081 #
4082 # @asl_compiler_id: #optional identifier of the utility that created the table
4083 #                   (4 bytes)
4084 #
4085 # @asl_compiler_rev: #optional revision number of the utility that created the
4086 #                    table (4 bytes)
4087 #
4088 # @file: #optional colon (:) separated list of pathnames to load and
4089 #        concatenate as table data. The resultant binary blob is expected to
4090 #        have an ACPI table header. At least one file is required. This field
4091 #        excludes @data.
4092 #
4093 # @data: #optional colon (:) separated list of pathnames to load and
4094 #        concatenate as table data. The resultant binary blob must not have an
4095 #        ACPI table header. At least one file is required. This field excludes
4096 #        @file.
4097 #
4098 # Since: 1.5
4099 ##
4100 { 'struct': 'AcpiTableOptions',
4101   'data': {
4102     '*sig':               'str',
4103     '*rev':               'uint8',
4104     '*oem_id':            'str',
4105     '*oem_table_id':      'str',
4106     '*oem_rev':           'uint32',
4107     '*asl_compiler_id':   'str',
4108     '*asl_compiler_rev':  'uint32',
4109     '*file':              'str',
4110     '*data':              'str' }}
4111
4112 ##
4113 # @CommandLineParameterType:
4114 #
4115 # Possible types for an option parameter.
4116 #
4117 # @string: accepts a character string
4118 #
4119 # @boolean: accepts "on" or "off"
4120 #
4121 # @number: accepts a number
4122 #
4123 # @size: accepts a number followed by an optional suffix (K)ilo,
4124 #        (M)ega, (G)iga, (T)era
4125 #
4126 # Since: 1.5
4127 ##
4128 { 'enum': 'CommandLineParameterType',
4129   'data': ['string', 'boolean', 'number', 'size'] }
4130
4131 ##
4132 # @CommandLineParameterInfo:
4133 #
4134 # Details about a single parameter of a command line option.
4135 #
4136 # @name: parameter name
4137 #
4138 # @type: parameter @CommandLineParameterType
4139 #
4140 # @help: #optional human readable text string, not suitable for parsing.
4141 #
4142 # @default: #optional default value string (since 2.1)
4143 #
4144 # Since: 1.5
4145 ##
4146 { 'struct': 'CommandLineParameterInfo',
4147   'data': { 'name': 'str',
4148             'type': 'CommandLineParameterType',
4149             '*help': 'str',
4150             '*default': 'str' } }
4151
4152 ##
4153 # @CommandLineOptionInfo:
4154 #
4155 # Details about a command line option, including its list of parameter details
4156 #
4157 # @option: option name
4158 #
4159 # @parameters: an array of @CommandLineParameterInfo
4160 #
4161 # Since: 1.5
4162 ##
4163 { 'struct': 'CommandLineOptionInfo',
4164   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4165
4166 ##
4167 # @query-command-line-options:
4168 #
4169 # Query command line option schema.
4170 #
4171 # @option: #optional option name
4172 #
4173 # Returns: list of @CommandLineOptionInfo for all options (or for the given
4174 #          @option).  Returns an error if the given @option doesn't exist.
4175 #
4176 # Since: 1.5
4177 ##
4178 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
4179  'returns': ['CommandLineOptionInfo'] }
4180
4181 ##
4182 # @X86CPURegister32:
4183 #
4184 # A X86 32-bit register
4185 #
4186 # Since: 1.5
4187 ##
4188 { 'enum': 'X86CPURegister32',
4189   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4190
4191 ##
4192 # @X86CPUFeatureWordInfo:
4193 #
4194 # Information about a X86 CPU feature word
4195 #
4196 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4197 #
4198 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4199 #                   feature word
4200 #
4201 # @cpuid-register: Output register containing the feature bits
4202 #
4203 # @features: value of output register, containing the feature bits
4204 #
4205 # Since: 1.5
4206 ##
4207 { 'struct': 'X86CPUFeatureWordInfo',
4208   'data': { 'cpuid-input-eax': 'int',
4209             '*cpuid-input-ecx': 'int',
4210             'cpuid-register': 'X86CPURegister32',
4211             'features': 'int' } }
4212
4213 ##
4214 # @DummyForceArrays:
4215 #
4216 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
4217 #
4218 # Since: 2.5
4219 ##
4220 { 'struct': 'DummyForceArrays',
4221   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
4222
4223
4224 ##
4225 # @RxState:
4226 #
4227 # Packets receiving state
4228 #
4229 # @normal: filter assigned packets according to the mac-table
4230 #
4231 # @none: don't receive any assigned packet
4232 #
4233 # @all: receive all assigned packets
4234 #
4235 # Since: 1.6
4236 ##
4237 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4238
4239 ##
4240 # @RxFilterInfo:
4241 #
4242 # Rx-filter information for a NIC.
4243 #
4244 # @name: net client name
4245 #
4246 # @promiscuous: whether promiscuous mode is enabled
4247 #
4248 # @multicast: multicast receive state
4249 #
4250 # @unicast: unicast receive state
4251 #
4252 # @vlan: vlan receive state (Since 2.0)
4253 #
4254 # @broadcast-allowed: whether to receive broadcast
4255 #
4256 # @multicast-overflow: multicast table is overflowed or not
4257 #
4258 # @unicast-overflow: unicast table is overflowed or not
4259 #
4260 # @main-mac: the main macaddr string
4261 #
4262 # @vlan-table: a list of active vlan id
4263 #
4264 # @unicast-table: a list of unicast macaddr string
4265 #
4266 # @multicast-table: a list of multicast macaddr string
4267 #
4268 # Since: 1.6
4269 ##
4270 { 'struct': 'RxFilterInfo',
4271   'data': {
4272     'name':               'str',
4273     'promiscuous':        'bool',
4274     'multicast':          'RxState',
4275     'unicast':            'RxState',
4276     'vlan':               'RxState',
4277     'broadcast-allowed':  'bool',
4278     'multicast-overflow': 'bool',
4279     'unicast-overflow':   'bool',
4280     'main-mac':           'str',
4281     'vlan-table':         ['int'],
4282     'unicast-table':      ['str'],
4283     'multicast-table':    ['str'] }}
4284
4285 ##
4286 # @query-rx-filter:
4287 #
4288 # Return rx-filter information for all NICs (or for the given NIC).
4289 #
4290 # @name: #optional net client name
4291 #
4292 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4293 #          Returns an error if the given @name doesn't exist, or given
4294 #          NIC doesn't support rx-filter querying, or given net client
4295 #          isn't a NIC.
4296 #
4297 # Since: 1.6
4298 ##
4299 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4300   'returns': ['RxFilterInfo'] }
4301
4302 ##
4303 # @InputButton:
4304 #
4305 # Button of a pointer input device (mouse, tablet).
4306 #
4307 # Since: 2.0
4308 ##
4309 { 'enum'  : 'InputButton',
4310   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down' ] }
4311
4312 ##
4313 # @InputAxis:
4314 #
4315 # Position axis of a pointer input device (mouse, tablet).
4316 #
4317 # Since: 2.0
4318 ##
4319 { 'enum'  : 'InputAxis',
4320   'data'  : [ 'x', 'y' ] }
4321
4322 ##
4323 # @InputKeyEvent:
4324 #
4325 # Keyboard input event.
4326 #
4327 # @key:    Which key this event is for.
4328 # @down:   True for key-down and false for key-up events.
4329 #
4330 # Since: 2.0
4331 ##
4332 { 'struct'  : 'InputKeyEvent',
4333   'data'  : { 'key'     : 'KeyValue',
4334               'down'    : 'bool' } }
4335
4336 ##
4337 # @InputBtnEvent:
4338 #
4339 # Pointer button input event.
4340 #
4341 # @button: Which button this event is for.
4342 # @down:   True for key-down and false for key-up events.
4343 #
4344 # Since: 2.0
4345 ##
4346 { 'struct'  : 'InputBtnEvent',
4347   'data'  : { 'button'  : 'InputButton',
4348               'down'    : 'bool' } }
4349
4350 ##
4351 # @InputMoveEvent:
4352 #
4353 # Pointer motion input event.
4354 #
4355 # @axis:   Which axis is referenced by @value.
4356 # @value:  Pointer position.  For absolute coordinates the
4357 #          valid range is 0 -> 0x7ffff
4358 #
4359 # Since: 2.0
4360 ##
4361 { 'struct'  : 'InputMoveEvent',
4362   'data'  : { 'axis'    : 'InputAxis',
4363               'value'   : 'int' } }
4364
4365 ##
4366 # @InputEvent:
4367 #
4368 # Input event union.
4369 #
4370 # @type: the input type, one of:
4371 #  - 'key': Input event of Keyboard
4372 #  - 'btn': Input event of pointer buttons
4373 #  - 'rel': Input event of relative pointer motion
4374 #  - 'abs': Input event of absolute pointer motion
4375 #
4376 # Since: 2.0
4377 ##
4378 { 'union' : 'InputEvent',
4379   'data'  : { 'key'     : 'InputKeyEvent',
4380               'btn'     : 'InputBtnEvent',
4381               'rel'     : 'InputMoveEvent',
4382               'abs'     : 'InputMoveEvent' } }
4383
4384 ##
4385 # @input-send-event:
4386 #
4387 # Send input event(s) to guest.
4388 #
4389 # @device: #optional display device to send event(s) to.
4390 # @head: #optional head to send event(s) to, in case the
4391 #        display device supports multiple scanouts.
4392 # @events: List of InputEvent union.
4393 #
4394 # Returns: Nothing on success.
4395 #
4396 # The @display and @head parameters can be used to send the input
4397 # event to specific input devices in case (a) multiple input devices
4398 # of the same kind are added to the virtual machine and (b) you have
4399 # configured input routing (see docs/multiseat.txt) for those input
4400 # devices.  The parameters work exactly like the device and head
4401 # properties of input devices.  If @device is missing, only devices
4402 # that have no input routing config are admissible.  If @device is
4403 # specified, both input devices with and without input routing config
4404 # are admissible, but devices with input routing config take
4405 # precedence.
4406 #
4407 # Since: 2.6
4408 ##
4409 { 'command': 'input-send-event',
4410   'data': { '*device': 'str',
4411             '*head'  : 'int',
4412             'events' : [ 'InputEvent' ] } }
4413
4414 ##
4415 # @NumaOptions:
4416 #
4417 # A discriminated record of NUMA options. (for OptsVisitor)
4418 #
4419 # Since: 2.1
4420 ##
4421 { 'union': 'NumaOptions',
4422   'data': {
4423     'node': 'NumaNodeOptions' }}
4424
4425 ##
4426 # @NumaNodeOptions:
4427 #
4428 # Create a guest NUMA node. (for OptsVisitor)
4429 #
4430 # @nodeid: #optional NUMA node ID (increase by 1 from 0 if omitted)
4431 #
4432 # @cpus: #optional VCPUs belonging to this node (assign VCPUS round-robin
4433 #         if omitted)
4434 #
4435 # @mem: #optional memory size of this node; mutually exclusive with @memdev.
4436 #       Equally divide total memory among nodes if both @mem and @memdev are
4437 #       omitted.
4438 #
4439 # @memdev: #optional memory backend object.  If specified for one node,
4440 #          it must be specified for all nodes.
4441 #
4442 # Since: 2.1
4443 ##
4444 { 'struct': 'NumaNodeOptions',
4445   'data': {
4446    '*nodeid': 'uint16',
4447    '*cpus':   ['uint16'],
4448    '*mem':    'size',
4449    '*memdev': 'str' }}
4450
4451 ##
4452 # @HostMemPolicy:
4453 #
4454 # Host memory policy types
4455 #
4456 # @default: restore default policy, remove any nondefault policy
4457 #
4458 # @preferred: set the preferred host nodes for allocation
4459 #
4460 # @bind: a strict policy that restricts memory allocation to the
4461 #        host nodes specified
4462 #
4463 # @interleave: memory allocations are interleaved across the set
4464 #              of host nodes specified
4465 #
4466 # Since: 2.1
4467 ##
4468 { 'enum': 'HostMemPolicy',
4469   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
4470
4471 ##
4472 # @Memdev:
4473 #
4474 # Information about memory backend
4475 #
4476 # @size: memory backend size
4477 #
4478 # @merge: enables or disables memory merge support
4479 #
4480 # @dump: includes memory backend's memory in a core dump or not
4481 #
4482 # @prealloc: enables or disables memory preallocation
4483 #
4484 # @host-nodes: host nodes for its memory policy
4485 #
4486 # @policy: memory policy of memory backend
4487 #
4488 # Since: 2.1
4489 ##
4490 { 'struct': 'Memdev',
4491   'data': {
4492     'size':       'size',
4493     'merge':      'bool',
4494     'dump':       'bool',
4495     'prealloc':   'bool',
4496     'host-nodes': ['uint16'],
4497     'policy':     'HostMemPolicy' }}
4498
4499 ##
4500 # @query-memdev:
4501 #
4502 # Returns information for all memory backends.
4503 #
4504 # Returns: a list of @Memdev.
4505 #
4506 # Since: 2.1
4507 ##
4508 { 'command': 'query-memdev', 'returns': ['Memdev'] }
4509
4510 ##
4511 # @PCDIMMDeviceInfo:
4512 #
4513 # PCDIMMDevice state information
4514 #
4515 # @id: #optional device's ID
4516 #
4517 # @addr: physical address, where device is mapped
4518 #
4519 # @size: size of memory that the device provides
4520 #
4521 # @slot: slot number at which device is plugged in
4522 #
4523 # @node: NUMA node number where device is plugged in
4524 #
4525 # @memdev: memory backend linked with device
4526 #
4527 # @hotplugged: true if device was hotplugged
4528 #
4529 # @hotpluggable: true if device if could be added/removed while machine is running
4530 #
4531 # Since: 2.1
4532 ##
4533 { 'struct': 'PCDIMMDeviceInfo',
4534   'data': { '*id': 'str',
4535             'addr': 'int',
4536             'size': 'int',
4537             'slot': 'int',
4538             'node': 'int',
4539             'memdev': 'str',
4540             'hotplugged': 'bool',
4541             'hotpluggable': 'bool'
4542           }
4543 }
4544
4545 ##
4546 # @MemoryDeviceInfo:
4547 #
4548 # Union containing information about a memory device
4549 #
4550 # Since: 2.1
4551 ##
4552 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
4553
4554 ##
4555 # @query-memory-devices:
4556 #
4557 # Lists available memory devices and their state
4558 #
4559 # Since: 2.1
4560 ##
4561 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
4562
4563 ##
4564 # @ACPISlotType:
4565 #
4566 # @DIMM: memory slot
4567 # @CPU: logical CPU slot (since 2.7)
4568 ##
4569 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
4570
4571 ##
4572 # @ACPIOSTInfo:
4573 #
4574 # OSPM Status Indication for a device
4575 # For description of possible values of @source and @status fields
4576 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
4577 #
4578 # @device: #optional device ID associated with slot
4579 #
4580 # @slot: slot ID, unique per slot of a given @slot-type
4581 #
4582 # @slot-type: type of the slot
4583 #
4584 # @source: an integer containing the source event
4585 #
4586 # @status: an integer containing the status code
4587 #
4588 # Since: 2.1
4589 ##
4590 { 'struct': 'ACPIOSTInfo',
4591   'data'  : { '*device': 'str',
4592               'slot': 'str',
4593               'slot-type': 'ACPISlotType',
4594               'source': 'int',
4595               'status': 'int' } }
4596
4597 ##
4598 # @query-acpi-ospm-status:
4599 #
4600 # Lists ACPI OSPM status of ACPI device objects,
4601 # which might be reported via _OST method
4602 #
4603 # Since: 2.1
4604 ##
4605 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
4606
4607 ##
4608 # @WatchdogExpirationAction:
4609 #
4610 # An enumeration of the actions taken when the watchdog device's timer is
4611 # expired
4612 #
4613 # @reset: system resets
4614 #
4615 # @shutdown: system shutdown, note that it is similar to @powerdown, which
4616 #            tries to set to system status and notify guest
4617 #
4618 # @poweroff: system poweroff, the emulator program exits
4619 #
4620 # @pause: system pauses, similar to @stop
4621 #
4622 # @debug: system enters debug state
4623 #
4624 # @none: nothing is done
4625 #
4626 # @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
4627 #              VCPUS on x86) (since 2.4)
4628 #
4629 # Since: 2.1
4630 ##
4631 { 'enum': 'WatchdogExpirationAction',
4632   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
4633             'inject-nmi' ] }
4634
4635 ##
4636 # @IoOperationType:
4637 #
4638 # An enumeration of the I/O operation types
4639 #
4640 # @read: read operation
4641 #
4642 # @write: write operation
4643 #
4644 # Since: 2.1
4645 ##
4646 { 'enum': 'IoOperationType',
4647   'data': [ 'read', 'write' ] }
4648
4649 ##
4650 # @GuestPanicAction:
4651 #
4652 # An enumeration of the actions taken when guest OS panic is detected
4653 #
4654 # @pause: system pauses
4655 #
4656 # Since: 2.1 (poweroff since 2.8)
4657 ##
4658 { 'enum': 'GuestPanicAction',
4659   'data': [ 'pause', 'poweroff' ] }
4660
4661 ##
4662 # @rtc-reset-reinjection:
4663 #
4664 # This command will reset the RTC interrupt reinjection backlog.
4665 # Can be used if another mechanism to synchronize guest time
4666 # is in effect, for example QEMU guest agent's guest-set-time
4667 # command.
4668 #
4669 # Since: 2.1
4670 ##
4671 { 'command': 'rtc-reset-reinjection' }
4672
4673 # Rocker ethernet network switch
4674 { 'include': 'qapi/rocker.json' }
4675
4676 ##
4677 # @ReplayMode:
4678 #
4679 # Mode of the replay subsystem.
4680 #
4681 # @none: normal execution mode. Replay or record are not enabled.
4682 #
4683 # @record: record mode. All non-deterministic data is written into the
4684 #          replay log.
4685 #
4686 # @play: replay mode. Non-deterministic data required for system execution
4687 #        is read from the log.
4688 #
4689 # Since: 2.5
4690 ##
4691 { 'enum': 'ReplayMode',
4692   'data': [ 'none', 'record', 'play' ] }
4693
4694 ##
4695 # @xen-load-devices-state:
4696 #
4697 # Load the state of all devices from file. The RAM and the block devices
4698 # of the VM are not loaded by this command.
4699 #
4700 # @filename: the file to load the state of the devices from as binary
4701 # data. See xen-save-devices-state.txt for a description of the binary
4702 # format.
4703 #
4704 # Since: 2.7
4705 ##
4706 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
4707
4708 ##
4709 # @GICCapability:
4710 #
4711 # The struct describes capability for a specific GIC (Generic
4712 # Interrupt Controller) version. These bits are not only decided by
4713 # QEMU/KVM software version, but also decided by the hardware that
4714 # the program is running upon.
4715 #
4716 # @version:  version of GIC to be described. Currently, only 2 and 3
4717 #            are supported.
4718 #
4719 # @emulated: whether current QEMU/hardware supports emulated GIC
4720 #            device in user space.
4721 #
4722 # @kernel:   whether current QEMU/hardware supports hardware
4723 #            accelerated GIC device in kernel.
4724 #
4725 # Since: 2.6
4726 ##
4727 { 'struct': 'GICCapability',
4728   'data': { 'version': 'int',
4729             'emulated': 'bool',
4730             'kernel': 'bool' } }
4731
4732 ##
4733 # @query-gic-capabilities:
4734 #
4735 # This command is ARM-only. It will return a list of GICCapability
4736 # objects that describe its capability bits.
4737 #
4738 # Returns: a list of GICCapability objects.
4739 #
4740 # Since: 2.6
4741 ##
4742 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
4743
4744 ##
4745 # @CpuInstanceProperties:
4746 #
4747 # List of properties to be used for hotplugging a CPU instance,
4748 # it should be passed by management with device_add command when
4749 # a CPU is being hotplugged.
4750 #
4751 # Note: currently there are 4 properties that could be present
4752 # but management should be prepared to pass through other
4753 # properties with device_add command to allow for future
4754 # interface extension. This also requires the filed names to be kept in
4755 # sync with the properties passed to -device/device_add.
4756 #
4757 # @node-id: #optional NUMA node ID the CPU belongs to
4758 # @socket-id: #optional socket number within node/board the CPU belongs to
4759 # @core-id: #optional core number within socket the CPU belongs to
4760 # @thread-id: #optional thread number within core the CPU belongs to
4761 #
4762 # Since: 2.7
4763 ##
4764 { 'struct': 'CpuInstanceProperties',
4765   'data': { '*node-id': 'int',
4766             '*socket-id': 'int',
4767             '*core-id': 'int',
4768             '*thread-id': 'int'
4769   }
4770 }
4771
4772 ##
4773 # @HotpluggableCPU:
4774 #
4775 # @type: CPU object type for usage with device_add command
4776 # @props: list of properties to be used for hotplugging CPU
4777 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
4778 # @qom-path: #optional link to existing CPU object if CPU is present or
4779 #            omitted if CPU is not present.
4780 #
4781 # Since: 2.7
4782 ##
4783 { 'struct': 'HotpluggableCPU',
4784   'data': { 'type': 'str',
4785             'vcpus-count': 'int',
4786             'props': 'CpuInstanceProperties',
4787             '*qom-path': 'str'
4788           }
4789 }
4790
4791 ##
4792 # @query-hotpluggable-cpus:
4793 #
4794 # Returns: a list of HotpluggableCPU objects.
4795 #
4796 # Since: 2.7
4797 ##
4798 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }