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