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