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