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