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