]> git.proxmox.com Git - qemu.git/blame - qapi-schema.json
qapi: convert add_client
[qemu.git] / qapi-schema.json
CommitLineData
e3193601
AL
1# -*- Mode: Python -*-
2#
3# QAPI Schema
48a32bed 4
dcafd323
LC
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# @MigrationExpected: the requested operation can't be fulfilled because a
26# migration process is expected
27#
28# Since: 1.2
29##
30{ 'enum': 'ErrorClass',
31 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
32 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap',
33 'MigrationExpected' ] }
34
b224e5e2
LC
35##
36# @add_client
37#
38# Allow client connections for VNC, Spice and socket based
39# character devices to be passed in to QEMU via SCM_RIGHTS.
40#
41# @protocol: protocol name. Valid names are "vnc", "spice" or the
42# name of a character device (eg. from -chardev id=XXXX)
43#
44# @fdname: file descriptor name previously passed via 'getfd' command
45#
46# @skipauth: #optional whether to skip authentication. Only applies
47# to "vnc" and "spice" protocols
48#
49# @tls: #optional whether to perform TLS. Only applies to the "spice"
50# protocol
51#
52# Returns: nothing on success.
53#
54# Since: 0.14.0
55##
56{ 'command': 'add_client',
57 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
58 '*tls': 'bool' } }
59
48a32bed
AL
60##
61# @NameInfo:
62#
63# Guest name information.
64#
65# @name: #optional The name of the guest
66#
67# Since 0.14.0
68##
69{ 'type': 'NameInfo', 'data': {'*name': 'str'} }
70
71##
72# @query-name:
73#
74# Return the name information of a guest.
75#
76# Returns: @NameInfo of the guest
77#
78# Since 0.14.0
79##
80{ 'command': 'query-name', 'returns': 'NameInfo' }
b9c15f16
LC
81
82##
83# @VersionInfo:
84#
85# A description of QEMU's version.
86#
87# @qemu.major: The major version of QEMU
88#
89# @qemu.minor: The minor version of QEMU
90#
91# @qemu.micro: The micro version of QEMU. By current convention, a micro
92# version of 50 signifies a development branch. A micro version
93# greater than or equal to 90 signifies a release candidate for
94# the next minor version. A micro version of less than 50
95# signifies a stable release.
96#
97# @package: QEMU will always set this field to an empty string. Downstream
98# versions of QEMU should set this to a non-empty string. The
99# exact format depends on the downstream however it highly
100# recommended that a unique name is used.
101#
102# Since: 0.14.0
103##
104{ 'type': 'VersionInfo',
105 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
106 'package': 'str'} }
107
108##
109# @query-version:
110#
111# Returns the current version of QEMU.
112#
113# Returns: A @VersionInfo object describing the current version of QEMU.
114#
115# Since: 0.14.0
116##
117{ 'command': 'query-version', 'returns': 'VersionInfo' }
292a2602
LC
118
119##
120# @KvmInfo:
121#
122# Information about support for KVM acceleration
123#
124# @enabled: true if KVM acceleration is active
125#
126# @present: true if KVM acceleration is built into this executable
127#
128# Since: 0.14.0
129##
130{ 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
131
132##
133# @query-kvm:
134#
135# Returns information about KVM acceleration
136#
137# Returns: @KvmInfo
138#
139# Since: 0.14.0
140##
141{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
142
1fa9a5e4
LC
143##
144# @RunState
145#
6932a69b 146# An enumeration of VM run states.
1fa9a5e4
LC
147#
148# @debug: QEMU is running on a debugger
149#
0a24c7b1
LC
150# @finish-migrate: guest is paused to finish the migration process
151#
1fa9a5e4
LC
152# @inmigrate: guest is paused waiting for an incoming migration
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#
1fa9a5e4
LC
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#
ad02b96a
LC
174# @suspended: guest is suspended (ACPI S3)
175#
1fa9a5e4
LC
176# @watchdog: the watchdog action is configured to pause and has been triggered
177##
178{ 'enum': 'RunState',
179 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
180 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
ad02b96a 181 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
1fa9a5e4 182
c249ee68
BC
183##
184# @SnapshotInfo
185#
186# @id: unique snapshot id
187#
188# @name: user chosen name
189#
190# @vm-state-size: size of the VM state
191#
192# @date-sec: UTC date of the snapshot in seconds
193#
194# @date-nsec: fractional part in nano seconds to be used with date-sec
195#
196# @vm-clock-sec: VM clock relative to boot in seconds
197#
198# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
199#
200# Since: 1.3
201#
202##
203
204{ 'type': 'SnapshotInfo',
205 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
206 'date-sec': 'int', 'date-nsec': 'int',
207 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
208
209##
210# @ImageInfo:
211#
212# Information about a QEMU image file
213#
214# @filename: name of the image file
215#
216# @format: format of the image file
217#
218# @virtual-size: maximum capacity in bytes of the image
219#
220# @actual-size: #optional actual size on disk in bytes of the image
221#
222# @dirty-flag: #optional true if image is not cleanly closed
223#
224# @cluster-size: #optional size of a cluster in bytes
225#
226# @encrypted: #optional true if the image is encrypted
227#
228# @backing-filename: #optional name of the backing file
229#
230# @full-backing-filename: #optional full path of the backing file
231#
232# @backing-filename-format: #optional the format of the backing file
233#
234# @snapshots: #optional list of VM snapshots
235#
236# Since: 1.3
237#
238##
239
240{ 'type': 'ImageInfo',
241 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
242 '*actual-size': 'int', 'virtual-size': 'int',
243 '*cluster-size': 'int', '*encrypted': 'bool',
244 '*backing-filename': 'str', '*full-backing-filename': 'str',
245 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'] } }
246
1fa9a5e4
LC
247##
248# @StatusInfo:
249#
250# Information about VCPU run state
251#
252# @running: true if all VCPUs are runnable, false if not runnable
253#
254# @singlestep: true if VCPUs are in single-step mode
255#
256# @status: the virtual machine @RunState
257#
258# Since: 0.14.0
259#
260# Notes: @singlestep is enabled through the GDB stub
261##
262{ 'type': 'StatusInfo',
263 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
264
265##
266# @query-status:
267#
268# Query the run status of all VCPUs
269#
270# Returns: @StatusInfo reflecting all VCPUs
271#
272# Since: 0.14.0
273##
274{ 'command': 'query-status', 'returns': 'StatusInfo' }
275
efab767e
LC
276##
277# @UuidInfo:
278#
279# Guest UUID information.
280#
281# @UUID: the UUID of the guest
282#
283# Since: 0.14.0
284#
285# Notes: If no UUID was specified for the guest, a null UUID is returned.
286##
287{ 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
288
289##
290# @query-uuid:
291#
292# Query the guest UUID information.
293#
294# Returns: The @UuidInfo for the guest
295#
296# Since 0.14.0
297##
298{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
299
c5a415a0
LC
300##
301# @ChardevInfo:
302#
303# Information about a character device.
304#
305# @label: the label of the character device
306#
307# @filename: the filename of the character device
308#
309# Notes: @filename is encoded using the QEMU command line character device
310# encoding. See the QEMU man page for details.
311#
312# Since: 0.14.0
313##
314{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
315
316##
317# @query-chardev:
318#
319# Returns information about current character devices.
320#
321# Returns: a list of @ChardevInfo
322#
323# Since: 0.14.0
324##
325{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
aa9b79bc
LC
326
327##
328# @CommandInfo:
329#
330# Information about a QMP command
331#
332# @name: The command name
333#
334# Since: 0.14.0
335##
336{ 'type': 'CommandInfo', 'data': {'name': 'str'} }
337
338##
339# @query-commands:
340#
341# Return a list of supported QMP commands by this server
342#
343# Returns: A list of @CommandInfo for all supported commands
344#
345# Since: 0.14.0
346##
347{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
348
4860853d
DB
349##
350# @EventInfo:
351#
352# Information about a QMP event
353#
354# @name: The event name
355#
356# Since: 1.2.0
357##
358{ 'type': 'EventInfo', 'data': {'name': 'str'} }
359
360##
361# @query-events:
362#
363# Return a list of supported QMP events by this server
364#
365# Returns: A list of @EventInfo for all supported events
366#
367# Since: 1.2.0
368##
369{ 'command': 'query-events', 'returns': ['EventInfo'] }
370
791e7c82
LC
371##
372# @MigrationStats
373#
374# Detailed migration status.
375#
376# @transferred: amount of bytes already transferred to the target VM
377#
378# @remaining: amount of bytes remaining to be transferred to the target VM
379#
380# @total: total amount of bytes involved in the migration process
381#
004d4c10
OW
382# @duplicate: number of duplicate pages (since 1.2)
383#
384# @normal : number of normal pages (since 1.2)
385#
386# @normal-bytes : number of normal bytes sent (since 1.2)
387#
388# Since: 0.14.0
791e7c82
LC
389##
390{ 'type': 'MigrationStats',
d5f8a570 391 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
7aa939af 392 'duplicate': 'int', 'normal': 'int', 'normal-bytes': 'int' } }
791e7c82 393
f36d55af
OW
394##
395# @XBZRLECacheStats
396#
397# Detailed XBZRLE migration cache statistics
398#
399# @cache-size: XBZRLE cache size
400#
401# @bytes: amount of bytes already transferred to the target VM
402#
403# @pages: amount of pages transferred to the target VM
404#
405# @cache-miss: number of cache miss
406#
407# @overflow: number of overflows
408#
409# Since: 1.2
410##
411{ 'type': 'XBZRLECacheStats',
412 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
413 'cache-miss': 'int', 'overflow': 'int' } }
414
791e7c82
LC
415##
416# @MigrationInfo
417#
418# Information about current migration process.
419#
420# @status: #optional string describing the current migration status.
421# As of 0.14.0 this can be 'active', 'completed', 'failed' or
422# 'cancelled'. If this field is not returned, no migration process
423# has been initiated
424#
d5f8a570
JQ
425# @ram: #optional @MigrationStats containing detailed migration
426# status, only returned if status is 'active' or
427# 'completed'. 'comppleted' (since 1.2)
791e7c82
LC
428#
429# @disk: #optional @MigrationStats containing detailed disk migration
430# status, only returned if status is 'active' and it is a block
431# migration
432#
f36d55af
OW
433# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
434# migration statistics, only returned if XBZRLE feature is on and
435# status is 'active' or 'completed' (since 1.2)
436#
7aa939af
JQ
437# @total-time: #optional total amount of milliseconds since migration started.
438# If migration has ended, it returns the total migration
439# time. (since 1.2)
440#
791e7c82
LC
441# Since: 0.14.0
442##
443{ 'type': 'MigrationInfo',
444 'data': {'*status': 'str', '*ram': 'MigrationStats',
f36d55af 445 '*disk': 'MigrationStats',
7aa939af
JQ
446 '*xbzrle-cache': 'XBZRLECacheStats',
447 '*total-time': 'int'} }
791e7c82
LC
448
449##
450# @query-migrate
451#
452# Returns information about current migration process.
453#
454# Returns: @MigrationInfo
455#
456# Since: 0.14.0
457##
458{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
459
bbf6da32
OW
460##
461# @MigrationCapability
462#
463# Migration capabilities enumeration
464#
465# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
466# This feature allows us to minimize migration traffic for certain work
467# loads, by sending compressed difference of the pages
468#
469# Since: 1.2
470##
471{ 'enum': 'MigrationCapability',
472 'data': ['xbzrle'] }
473
474##
475# @MigrationCapabilityStatus
476#
477# Migration capability information
478#
479# @capability: capability enum
480#
481# @state: capability state bool
482#
483# Since: 1.2
484##
485{ 'type': 'MigrationCapabilityStatus',
486 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
487
488##
00458433
OW
489# @migrate-set-capabilities
490#
491# Enable/Disable the following migration capabilities (like xbzrle)
492#
493# @capabilities: json array of capability modifications to make
494#
495# Since: 1.2
496##
497{ 'command': 'migrate-set-capabilities',
498 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
499
500##
bbf6da32
OW
501# @query-migrate-capabilities
502#
503# Returns information about the current migration capabilities status
504#
505# Returns: @MigrationCapabilitiesStatus
506#
507# Since: 1.2
508##
509{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
510
e235cec3
LC
511##
512# @MouseInfo:
513#
514# Information about a mouse device.
515#
516# @name: the name of the mouse device
517#
518# @index: the index of the mouse device
519#
520# @current: true if this device is currently receiving mouse events
521#
522# @absolute: true if this device supports absolute coordinates as input
523#
524# Since: 0.14.0
525##
526{ 'type': 'MouseInfo',
527 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
528 'absolute': 'bool'} }
529
530##
531# @query-mice:
532#
533# Returns information about each active mouse device
534#
535# Returns: a list of @MouseInfo for each device
536#
537# Since: 0.14.0
538##
539{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
540
de0b36b6
LC
541##
542# @CpuInfo:
543#
544# Information about a virtual CPU
545#
546# @CPU: the index of the virtual CPU
547#
548# @current: this only exists for backwards compatible and should be ignored
b80e560b 549#
de0b36b6
LC
550# @halted: true if the virtual CPU is in the halt state. Halt usually refers
551# to a processor specific low power mode.
552#
553# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
554# pointer.
555# If the target is Sparc, this is the PC component of the
556# instruction pointer.
557#
558# @nip: #optional If the target is PPC, the instruction pointer
559#
560# @npc: #optional If the target is Sparc, the NPC component of the instruction
561# pointer
562#
563# @PC: #optional If the target is MIPS, the instruction pointer
564#
565# @thread_id: ID of the underlying host thread
566#
567# Since: 0.14.0
568#
569# Notes: @halted is a transient state that changes frequently. By the time the
570# data is sent to the client, the guest may no longer be halted.
571##
572{ 'type': 'CpuInfo',
573 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
574 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
575
576##
577# @query-cpus:
578#
579# Returns a list of information about each virtual CPU.
580#
581# Returns: a list of @CpuInfo for each virtual CPU
582#
583# Since: 0.14.0
584##
585{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
586
b2023818
LC
587##
588# @BlockDeviceInfo:
589#
590# Information about the backing device for a block device.
591#
592# @file: the filename of the backing device
593#
594# @ro: true if the backing device was open read-only
595#
596# @drv: the name of the block format used to open the backing device. As of
597# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
598# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
599# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
600# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
601#
602# @backing_file: #optional the name of the backing file (for copy-on-write)
603#
2e3e3317
BC
604# @backing_file_depth: number of files in the backing file chain (since: 1.2)
605#
b2023818
LC
606# @encrypted: true if the backing device is encrypted
607#
c75a1a8a
LC
608# @encryption_key_missing: true if the backing device is encrypted but an
609# valid encryption key is missing
610#
727f005e
ZYW
611# @bps: total throughput limit in bytes per second is specified
612#
613# @bps_rd: read throughput limit in bytes per second is specified
614#
615# @bps_wr: write throughput limit in bytes per second is specified
616#
617# @iops: total I/O operations per second is specified
618#
619# @iops_rd: read I/O operations per second is specified
620#
621# @iops_wr: write I/O operations per second is specified
622#
b2023818
LC
623# Since: 0.14.0
624#
625# Notes: This interface is only found in @BlockInfo.
626##
627{ 'type': 'BlockDeviceInfo',
628 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
2e3e3317 629 '*backing_file': 'str', 'backing_file_depth': 'int',
c75a1a8a
LC
630 'encrypted': 'bool', 'encryption_key_missing': 'bool',
631 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
632 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
b2023818
LC
633
634##
635# @BlockDeviceIoStatus:
636#
637# An enumeration of block device I/O status.
638#
639# @ok: The last I/O operation has succeeded
640#
641# @failed: The last I/O operation has failed
642#
643# @nospace: The last I/O operation has failed due to a no-space condition
644#
645# Since: 1.0
646##
647{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
648
649##
650# @BlockInfo:
651#
652# Block device information. This structure describes a virtual device and
653# the backing device associated with it.
654#
655# @device: The device name associated with the virtual device.
656#
657# @type: This field is returned only for compatibility reasons, it should
658# not be used (always returns 'unknown')
659#
660# @removable: True if the device supports removable media.
661#
662# @locked: True if the guest has locked this device from having its media
663# removed
664#
665# @tray_open: #optional True if the device has a tray and it is open
666# (only present if removable is true)
667#
668# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
669# supports it and the VM is configured to stop on errors
670#
671# @inserted: #optional @BlockDeviceInfo describing the device if media is
672# present
673#
674# Since: 0.14.0
675##
676{ 'type': 'BlockInfo',
677 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
678 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
679 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
680
681##
682# @query-block:
683#
684# Get a list of BlockInfo for all virtual block devices.
685#
686# Returns: a list of @BlockInfo describing each virtual block device
687#
688# Since: 0.14.0
689##
690{ 'command': 'query-block', 'returns': ['BlockInfo'] }
691
f11f57e4
LC
692##
693# @BlockDeviceStats:
694#
695# Statistics of a virtual block device or a block backing device.
696#
697# @rd_bytes: The number of bytes read by the device.
698#
699# @wr_bytes: The number of bytes written by the device.
700#
701# @rd_operations: The number of read operations performed by the device.
702#
703# @wr_operations: The number of write operations performed by the device.
704#
705# @flush_operations: The number of cache flush operations performed by the
706# device (since 0.15.0)
707#
708# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
709# (since 0.15.0).
710#
711# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
712#
713# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
714#
715# @wr_highest_offset: The offset after the greatest byte written to the
716# device. The intended use of this information is for
717# growable sparse files (like qcow2) that are used on top
718# of a physical device.
719#
720# Since: 0.14.0
721##
722{ 'type': 'BlockDeviceStats',
723 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
724 'wr_operations': 'int', 'flush_operations': 'int',
725 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
726 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
727
728##
729# @BlockStats:
730#
731# Statistics of a virtual block device or a block backing device.
732#
733# @device: #optional If the stats are for a virtual block device, the name
734# corresponding to the virtual block device.
735#
736# @stats: A @BlockDeviceStats for the device.
737#
738# @parent: #optional This may point to the backing block device if this is a
739# a virtual block device. If it's a backing block, this will point
740# to the backing file is one is present.
741#
742# Since: 0.14.0
743##
744{ 'type': 'BlockStats',
745 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
746 '*parent': 'BlockStats'} }
747
748##
749# @query-blockstats:
750#
751# Query the @BlockStats for all virtual block devices.
752#
753# Returns: A list of @BlockStats for each virtual block devices.
754#
755# Since: 0.14.0
756##
757{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
758
2b54aa87
LC
759##
760# @VncClientInfo:
761#
762# Information about a connected VNC client.
763#
764# @host: The host name of the client. QEMU tries to resolve this to a DNS name
765# when possible.
766#
767# @family: 'ipv6' if the client is connected via IPv6 and TCP
768# 'ipv4' if the client is connected via IPv4 and TCP
769# 'unix' if the client is connected via a unix domain socket
770# 'unknown' otherwise
771#
772# @service: The service name of the client's port. This may depends on the
773# host system's service database so symbolic names should not be
774# relied on.
775#
776# @x509_dname: #optional If x509 authentication is in use, the Distinguished
777# Name of the client.
778#
779# @sasl_username: #optional If SASL authentication is in use, the SASL username
780# used for authentication.
781#
782# Since: 0.14.0
783##
784{ 'type': 'VncClientInfo',
785 'data': {'host': 'str', 'family': 'str', 'service': 'str',
786 '*x509_dname': 'str', '*sasl_username': 'str'} }
787
788##
789# @VncInfo:
790#
791# Information about the VNC session.
792#
793# @enabled: true if the VNC server is enabled, false otherwise
794#
795# @host: #optional The hostname the VNC server is bound to. This depends on
796# the name resolution on the host and may be an IP address.
797#
798# @family: #optional 'ipv6' if the host is listening for IPv6 connections
799# 'ipv4' if the host is listening for IPv4 connections
800# 'unix' if the host is listening on a unix domain socket
801# 'unknown' otherwise
802#
803# @service: #optional The service name of the server's port. This may depends
804# on the host system's service database so symbolic names should not
805# be relied on.
806#
807# @auth: #optional the current authentication type used by the server
808# 'none' if no authentication is being used
809# 'vnc' if VNC authentication is being used
810# 'vencrypt+plain' if VEncrypt is used with plain text authentication
811# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
812# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
813# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
814# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
815# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
816# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
817# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
818# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
819#
820# @clients: a list of @VncClientInfo of all currently connected clients
821#
822# Since: 0.14.0
823##
824{ 'type': 'VncInfo',
825 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
826 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
827
828##
829# @query-vnc:
830#
831# Returns information about the current VNC server
832#
833# Returns: @VncInfo
2b54aa87
LC
834#
835# Since: 0.14.0
836##
837{ 'command': 'query-vnc', 'returns': 'VncInfo' }
838
d1f29646
LC
839##
840# @SpiceChannel
841#
842# Information about a SPICE client channel.
843#
844# @host: The host name of the client. QEMU tries to resolve this to a DNS name
845# when possible.
846#
847# @family: 'ipv6' if the client is connected via IPv6 and TCP
848# 'ipv4' if the client is connected via IPv4 and TCP
849# 'unix' if the client is connected via a unix domain socket
850# 'unknown' otherwise
851#
852# @port: The client's port number.
853#
854# @connection-id: SPICE connection id number. All channels with the same id
855# belong to the same SPICE session.
856#
419e1bdf
AL
857# @connection-type: SPICE channel type number. "1" is the main control
858# channel, filter for this one if you want to track spice
859# sessions only
d1f29646 860#
419e1bdf
AL
861# @channel-id: SPICE channel ID number. Usually "0", might be different when
862# multiple channels of the same type exist, such as multiple
d1f29646
LC
863# display channels in a multihead setup
864#
865# @tls: true if the channel is encrypted, false otherwise.
866#
867# Since: 0.14.0
868##
869{ 'type': 'SpiceChannel',
870 'data': {'host': 'str', 'family': 'str', 'port': 'str',
871 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
872 'tls': 'bool'} }
873
4efee029
AL
874##
875# @SpiceQueryMouseMode
876#
6932a69b 877# An enumeration of Spice mouse states.
4efee029
AL
878#
879# @client: Mouse cursor position is determined by the client.
880#
881# @server: Mouse cursor position is determined by the server.
882#
883# @unknown: No information is available about mouse mode used by
884# the spice server.
885#
886# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
887#
888# Since: 1.1
889##
890{ 'enum': 'SpiceQueryMouseMode',
891 'data': [ 'client', 'server', 'unknown' ] }
892
d1f29646
LC
893##
894# @SpiceInfo
895#
896# Information about the SPICE session.
b80e560b 897#
d1f29646
LC
898# @enabled: true if the SPICE server is enabled, false otherwise
899#
61c4efe2
YH
900# @migrated: true if the last guest migration completed and spice
901# migration had completed as well. false otherwise.
902#
d1f29646
LC
903# @host: #optional The hostname the SPICE server is bound to. This depends on
904# the name resolution on the host and may be an IP address.
905#
906# @port: #optional The SPICE server's port number.
907#
908# @compiled-version: #optional SPICE server version.
909#
910# @tls-port: #optional The SPICE server's TLS port number.
911#
912# @auth: #optional the current authentication type used by the server
419e1bdf
AL
913# 'none' if no authentication is being used
914# 'spice' uses SASL or direct TLS authentication, depending on command
915# line options
d1f29646 916#
4efee029
AL
917# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
918# be determined by the client or the server, or unknown if spice
919# server doesn't provide this information.
920#
921# Since: 1.1
922#
d1f29646
LC
923# @channels: a list of @SpiceChannel for each active spice channel
924#
925# Since: 0.14.0
926##
927{ 'type': 'SpiceInfo',
61c4efe2 928 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
d1f29646 929 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
4efee029 930 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
d1f29646
LC
931
932##
933# @query-spice
934#
935# Returns information about the current SPICE server
936#
937# Returns: @SpiceInfo
938#
939# Since: 0.14.0
940##
941{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
942
96637bcd
LC
943##
944# @BalloonInfo:
945#
946# Information about the guest balloon device.
947#
948# @actual: the number of bytes the balloon currently contains
949#
950# @mem_swapped_in: #optional number of pages swapped in within the guest
951#
952# @mem_swapped_out: #optional number of pages swapped out within the guest
953#
954# @major_page_faults: #optional number of major page faults within the guest
955#
956# @minor_page_faults: #optional number of minor page faults within the guest
957#
958# @free_mem: #optional amount of memory (in bytes) free in the guest
959#
960# @total_mem: #optional amount of memory (in bytes) visible to the guest
961#
962# Since: 0.14.0
963#
964# Notes: all current versions of QEMU do not fill out optional information in
965# this structure.
966##
967{ 'type': 'BalloonInfo',
968 'data': {'actual': 'int', '*mem_swapped_in': 'int',
969 '*mem_swapped_out': 'int', '*major_page_faults': 'int',
970 '*minor_page_faults': 'int', '*free_mem': 'int',
971 '*total_mem': 'int'} }
972
973##
974# @query-balloon:
975#
976# Return information about the balloon device.
977#
978# Returns: @BalloonInfo on success
979# If the balloon driver is enabled but not functional because the KVM
980# kernel module cannot support it, KvmMissingCap
981# If no balloon device is present, DeviceNotActive
982#
983# Since: 0.14.0
984##
985{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
986
79627472
LC
987##
988# @PciMemoryRange:
989#
990# A PCI device memory region
991#
992# @base: the starting address (guest physical)
993#
994# @limit: the ending address (guest physical)
995#
996# Since: 0.14.0
997##
998{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
999
1000##
1001# @PciMemoryRegion
1002#
1003# Information about a PCI device I/O region.
1004#
1005# @bar: the index of the Base Address Register for this region
1006#
1007# @type: 'io' if the region is a PIO region
1008# 'memory' if the region is a MMIO region
1009#
1010# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1011#
1012# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1013#
1014# Since: 0.14.0
1015##
1016{ 'type': 'PciMemoryRegion',
1017 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1018 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1019
1020##
1021# @PciBridgeInfo:
1022#
1023# Information about a PCI Bridge device
1024#
1025# @bus.number: primary bus interface number. This should be the number of the
1026# bus the device resides on.
1027#
1028# @bus.secondary: secondary bus interface number. This is the number of the
1029# main bus for the bridge
1030#
1031# @bus.subordinate: This is the highest number bus that resides below the
1032# bridge.
1033#
1034# @bus.io_range: The PIO range for all devices on this bridge
1035#
1036# @bus.memory_range: The MMIO range for all devices on this bridge
1037#
1038# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1039# this bridge
1040#
1041# @devices: a list of @PciDeviceInfo for each device on this bridge
1042#
1043# Since: 0.14.0
1044##
1045{ 'type': 'PciBridgeInfo',
1046 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1047 'io_range': 'PciMemoryRange',
1048 'memory_range': 'PciMemoryRange',
1049 'prefetchable_range': 'PciMemoryRange' },
1050 '*devices': ['PciDeviceInfo']} }
1051
1052##
1053# @PciDeviceInfo:
1054#
1055# Information about a PCI device
1056#
1057# @bus: the bus number of the device
1058#
1059# @slot: the slot the device is located in
1060#
1061# @function: the function of the slot used by the device
1062#
1063# @class_info.desc: #optional a string description of the device's class
1064#
1065# @class_info.class: the class code of the device
1066#
1067# @id.device: the PCI device id
1068#
1069# @id.vendor: the PCI vendor id
1070#
1071# @irq: #optional if an IRQ is assigned to the device, the IRQ number
1072#
1073# @qdev_id: the device name of the PCI device
1074#
1075# @pci_bridge: if the device is a PCI bridge, the bridge information
1076#
1077# @regions: a list of the PCI I/O regions associated with the device
1078#
1079# Notes: the contents of @class_info.desc are not stable and should only be
1080# treated as informational.
1081#
1082# Since: 0.14.0
1083##
1084{ 'type': 'PciDeviceInfo',
1085 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1086 'class_info': {'*desc': 'str', 'class': 'int'},
1087 'id': {'device': 'int', 'vendor': 'int'},
1088 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1089 'regions': ['PciMemoryRegion']} }
1090
1091##
1092# @PciInfo:
1093#
1094# Information about a PCI bus
1095#
1096# @bus: the bus index
1097#
1098# @devices: a list of devices on this bus
1099#
1100# Since: 0.14.0
1101##
1102{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1103
1104##
1105# @query-pci:
1106#
1107# Return information about the PCI bus topology of the guest.
1108#
1109# Returns: a list of @PciInfo for each PCI bus
1110#
1111# Since: 0.14.0
1112##
1113{ 'command': 'query-pci', 'returns': ['PciInfo'] }
1114
fb5458cd
SH
1115##
1116# @BlockJobInfo:
1117#
1118# Information about a long-running block device operation.
1119#
1120# @type: the job type ('stream' for image streaming)
1121#
1122# @device: the block device name
1123#
1124# @len: the maximum progress value
1125#
1126# @offset: the current progress value
1127#
1128# @speed: the rate limit, bytes per second
1129#
1130# Since: 1.1
1131##
1132{ 'type': 'BlockJobInfo',
1133 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1134 'offset': 'int', 'speed': 'int'} }
1135
1136##
1137# @query-block-jobs:
1138#
1139# Return information about long-running block device operations.
1140#
1141# Returns: a list of @BlockJobInfo for each active block job
1142#
1143# Since: 1.1
1144##
1145{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1146
7a7f325e
LC
1147##
1148# @quit:
1149#
1150# This command will cause the QEMU process to exit gracefully. While every
1151# attempt is made to send the QMP response before terminating, this is not
1152# guaranteed. When using this interface, a premature EOF would not be
1153# unexpected.
1154#
1155# Since: 0.14.0
1156##
1157{ 'command': 'quit' }
5f158f21
LC
1158
1159##
1160# @stop:
1161#
1162# Stop all guest VCPU execution.
1163#
1164# Since: 0.14.0
1165#
1166# Notes: This function will succeed even if the guest is already in the stopped
1167# state
1168##
1169{ 'command': 'stop' }
38d22653
LC
1170
1171##
1172# @system_reset:
1173#
1174# Performs a hard reset of a guest.
1175#
1176# Since: 0.14.0
1177##
1178{ 'command': 'system_reset' }
5bc465e4
LC
1179
1180##
1181# @system_powerdown:
1182#
1183# Requests that a guest perform a powerdown operation.
1184#
1185# Since: 0.14.0
1186#
1187# Notes: A guest may or may not respond to this command. This command
1188# returning does not indicate that a guest has accepted the request or
1189# that it has shut down. Many guests will respond to this command by
1190# prompting the user in some way.
1191##
1192{ 'command': 'system_powerdown' }
755f1968
LC
1193
1194##
1195# @cpu:
1196#
1197# This command is a nop that is only provided for the purposes of compatibility.
1198#
1199# Since: 0.14.0
1200#
1201# Notes: Do not use this command.
1202##
1203{ 'command': 'cpu', 'data': {'index': 'int'} }
0cfd6a9a
LC
1204
1205##
1206# @memsave:
1207#
1208# Save a portion of guest memory to a file.
1209#
1210# @val: the virtual address of the guest to start from
1211#
1212# @size: the size of memory region to save
1213#
1214# @filename: the file to save the memory to as binary data
1215#
1216# @cpu-index: #optional the index of the virtual CPU to use for translating the
1217# virtual address (defaults to CPU 0)
1218#
1219# Returns: Nothing on success
0cfd6a9a
LC
1220#
1221# Since: 0.14.0
1222#
1223# Notes: Errors were not reliably returned until 1.1
1224##
1225{ 'command': 'memsave',
1226 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
6d3962bf
LC
1227
1228##
1229# @pmemsave:
1230#
1231# Save a portion of guest physical memory to a file.
1232#
1233# @val: the physical address of the guest to start from
1234#
1235# @size: the size of memory region to save
1236#
1237# @filename: the file to save the memory to as binary data
1238#
1239# Returns: Nothing on success
6d3962bf
LC
1240#
1241# Since: 0.14.0
1242#
1243# Notes: Errors were not reliably returned until 1.1
1244##
1245{ 'command': 'pmemsave',
1246 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
e42e818b
LC
1247
1248##
1249# @cont:
1250#
1251# Resume guest VCPU execution.
1252#
1253# Since: 0.14.0
1254#
1255# Returns: If successful, nothing
1256# If the QEMU is waiting for an incoming migration, MigrationExpected
1257# If QEMU was started with an encrypted block device and a key has
1258# not yet been set, DeviceEncrypted.
1259#
1260# Notes: This command will succeed if the guest is currently running.
1261##
1262{ 'command': 'cont' }
1263
9b9df25a
GH
1264##
1265# @system_wakeup:
1266#
1267# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1268#
1269# Since: 1.1
1270#
1271# Returns: nothing.
1272##
1273{ 'command': 'system_wakeup' }
1274
ab49ab5c
LC
1275##
1276# @inject-nmi:
1277#
1278# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1279#
1280# Returns: If successful, nothing
ab49ab5c
LC
1281#
1282# Since: 0.14.0
1283#
1284# Notes: Only x86 Virtual Machines support this command.
1285##
1286{ 'command': 'inject-nmi' }
4b37156c
LC
1287
1288##
1289# @set_link:
1290#
1291# Sets the link status of a virtual network adapter.
1292#
1293# @name: the device name of the virtual network adapter
1294#
1295# @up: true to set the link status to be up
1296#
1297# Returns: Nothing on success
1298# If @name is not a valid network device, DeviceNotFound
1299#
1300# Since: 0.14.0
1301#
1302# Notes: Not all network adapters support setting link status. This command
1303# will succeed even if the network adapter does not support link status
1304# notification.
1305##
1306{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
a4dea8a9
LC
1307
1308##
1309# @block_passwd:
1310#
1311# This command sets the password of a block device that has not been open
1312# with a password and requires one.
1313#
1314# The two cases where this can happen are a block device is created through
1315# QEMU's initial command line or a block device is changed through the legacy
1316# @change interface.
1317#
1318# In the event that the block device is created through the initial command
1319# line, the VM will start in the stopped state regardless of whether '-S' is
1320# used. The intention is for a management tool to query the block devices to
1321# determine which ones are encrypted, set the passwords with this command, and
1322# then start the guest with the @cont command.
1323#
1324# @device: the name of the device to set the password on
1325#
1326# @password: the password to use for the device
1327#
1328# Returns: nothing on success
1329# If @device is not a valid block device, DeviceNotFound
1330# If @device is not encrypted, DeviceNotEncrypted
a4dea8a9
LC
1331#
1332# Notes: Not all block formats support encryption and some that do are not
1333# able to validate that a password is correct. Disk corruption may
1334# occur if an invalid password is specified.
1335#
1336# Since: 0.14.0
1337##
1338{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
d72f3264
LC
1339
1340##
1341# @balloon:
1342#
1343# Request the balloon driver to change its balloon size.
1344#
1345# @value: the target size of the balloon in bytes
1346#
1347# Returns: Nothing on success
1348# If the balloon driver is enabled but not functional because the KVM
1349# kernel module cannot support it, KvmMissingCap
1350# If no balloon device is present, DeviceNotActive
1351#
1352# Notes: This command just issues a request to the guest. When it returns,
1353# the balloon size may not have changed. A guest can change the balloon
1354# size independent of this command.
1355#
1356# Since: 0.14.0
1357##
1358{ 'command': 'balloon', 'data': {'value': 'int'} }
5e7caacb
LC
1359
1360##
1361# @block_resize
1362#
1363# Resize a block image while a guest is running.
1364#
1365# @device: the name of the device to get the image resized
1366#
1367# @size: new image size in bytes
1368#
1369# Returns: nothing on success
1370# If @device is not a valid block device, DeviceNotFound
5e7caacb
LC
1371#
1372# Since: 0.14.0
1373##
1374{ 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
6106e249 1375
8802d1fd 1376##
bc8b094f
PB
1377# @NewImageMode
1378#
1379# An enumeration that tells QEMU how to set the backing file path in
1380# a new image file.
1381#
1382# @existing: QEMU should look for an existing image file.
1383#
1384# @absolute-paths: QEMU should create a new image with absolute paths
1385# for the backing file.
1386#
1387# Since: 1.1
1388##
1389{ 'enum': 'NewImageMode'
1390 'data': [ 'existing', 'absolute-paths' ] }
1391
8802d1fd 1392##
52e7c241 1393# @BlockdevSnapshot
8802d1fd
JC
1394#
1395# @device: the name of the device to generate the snapshot from.
1396#
1397# @snapshot-file: the target of the new image. A new file will be created.
1398#
1399# @format: #optional the format of the snapshot image, default is 'qcow2'.
6cc2a415
PB
1400#
1401# @mode: #optional whether and how QEMU should create a new image, default is
1402# 'absolute-paths'.
8802d1fd 1403##
52e7c241 1404{ 'type': 'BlockdevSnapshot',
bc8b094f
PB
1405 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1406 '*mode': 'NewImageMode' } }
8802d1fd
JC
1407
1408##
52e7c241 1409# @BlockdevAction
8802d1fd 1410#
52e7c241
PB
1411# A discriminated record of operations that can be performed with
1412# @transaction.
8802d1fd 1413##
52e7c241
PB
1414{ 'union': 'BlockdevAction',
1415 'data': {
1416 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1417 } }
8802d1fd
JC
1418
1419##
52e7c241 1420# @transaction
8802d1fd 1421#
52e7c241
PB
1422# Atomically operate on a group of one or more block devices. If
1423# any operation fails, then the entire set of actions will be
1424# abandoned and the appropriate error returned. The only operation
1425# supported is currently blockdev-snapshot-sync.
8802d1fd
JC
1426#
1427# List of:
52e7c241 1428# @BlockdevAction: information needed for the device snapshot
8802d1fd
JC
1429#
1430# Returns: nothing on success
1431# If @device is not a valid block device, DeviceNotFound
8802d1fd 1432#
52e7c241
PB
1433# Note: The transaction aborts on the first failure. Therefore, there will
1434# be only one device or snapshot file returned in an error condition, and
1435# subsequent actions will not have been attempted.
1436#
1437# Since 1.1
8802d1fd 1438##
52e7c241
PB
1439{ 'command': 'transaction',
1440 'data': { 'actions': [ 'BlockdevAction' ] } }
8802d1fd 1441
6106e249
LC
1442##
1443# @blockdev-snapshot-sync
1444#
1445# Generates a synchronous snapshot of a block device.
1446#
1447# @device: the name of the device to generate the snapshot from.
1448#
1449# @snapshot-file: the target of the new image. If the file exists, or if it
1450# is a device, the snapshot will be created in the existing
1451# file/device. If does not exist, a new file will be created.
1452#
1453# @format: #optional the format of the snapshot image, default is 'qcow2'.
1454#
6cc2a415
PB
1455# @mode: #optional whether and how QEMU should create a new image, default is
1456# 'absolute-paths'.
1457#
6106e249
LC
1458# Returns: nothing on success
1459# If @device is not a valid block device, DeviceNotFound
6106e249 1460#
6106e249
LC
1461# Since 0.14.0
1462##
1463{ 'command': 'blockdev-snapshot-sync',
6cc2a415
PB
1464 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1465 '*mode': 'NewImageMode'} }
d51a67b4
LC
1466
1467##
1468# @human-monitor-command:
1469#
1470# Execute a command on the human monitor and return the output.
1471#
1472# @command-line: the command to execute in the human monitor
1473#
1474# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1475#
1476# Returns: the output of the command as a string
1477#
1478# Since: 0.14.0
1479#
1480# Notes: This command only exists as a stop-gap. It's use is highly
1481# discouraged. The semantics of this command are not guaranteed.
1482#
1483# Known limitations:
1484#
1485# o This command is stateless, this means that commands that depend
1486# on state information (such as getfd) might not work
1487#
1488# o Commands that prompt the user for data (eg. 'cont' when the block
1489# device is encrypted) don't currently work
1490##
1491{ 'command': 'human-monitor-command',
1492 'data': {'command-line': 'str', '*cpu-index': 'int'},
b80e560b 1493 'returns': 'str' }
6cdedb07
LC
1494
1495##
1496# @migrate_cancel
1497#
1498# Cancel the current executing migration process.
1499#
1500# Returns: nothing on success
1501#
1502# Notes: This command succeeds even if there is no migration process running.
1503#
1504# Since: 0.14.0
1505##
1506{ 'command': 'migrate_cancel' }
4f0a993b
LC
1507
1508##
1509# @migrate_set_downtime
1510#
1511# Set maximum tolerated downtime for migration.
1512#
1513# @value: maximum downtime in seconds
1514#
1515# Returns: nothing on success
1516#
1517# Since: 0.14.0
1518##
1519{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
3dc85383
LC
1520
1521##
1522# @migrate_set_speed
1523#
1524# Set maximum speed for migration.
1525#
1526# @value: maximum speed in bytes.
1527#
1528# Returns: nothing on success
1529#
1530# Notes: A value lesser than zero will be automatically round up to zero.
1531#
1532# Since: 0.14.0
1533##
1534{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
b4b12c62 1535
9e1ba4cc
OW
1536##
1537# @migrate-set-cache-size
1538#
1539# Set XBZRLE cache size
1540#
1541# @value: cache size in bytes
1542#
1543# The size will be rounded down to the nearest power of 2.
1544# The cache size can be modified before and during ongoing migration
1545#
1546# Returns: nothing on success
1547#
1548# Since: 1.2
1549##
1550{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1551
1552##
1553# @query-migrate-cache-size
1554#
1555# query XBZRLE cache size
1556#
1557# Returns: XBZRLE cache size in bytes
1558#
1559# Since: 1.2
1560##
1561{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
1562
b4b12c62 1563##
d03ee401 1564# @ObjectPropertyInfo:
b4b12c62
AL
1565#
1566# @name: the name of the property
1567#
1568# @type: the type of the property. This will typically come in one of four
1569# forms:
1570#
1571# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1572# These types are mapped to the appropriate JSON type.
1573#
1574# 2) A legacy type in the form 'legacy<subtype>' where subtype is the
1575# legacy qdev typename. These types are always treated as strings.
1576#
1577# 3) A child type in the form 'child<subtype>' where subtype is a qdev
1578# device type name. Child properties create the composition tree.
1579#
1580# 4) A link type in the form 'link<subtype>' where subtype is a qdev
1581# device type name. Link properties form the device model graph.
1582#
51920820 1583# Since: 1.2
b4b12c62 1584##
57c9fafe 1585{ 'type': 'ObjectPropertyInfo',
b4b12c62
AL
1586 'data': { 'name': 'str', 'type': 'str' } }
1587
1588##
1589# @qom-list:
1590#
57c9fafe 1591# This command will list any properties of a object given a path in the object
b4b12c62
AL
1592# model.
1593#
57c9fafe 1594# @path: the path within the object model. See @qom-get for a description of
b4b12c62
AL
1595# this parameter.
1596#
57c9fafe
AL
1597# Returns: a list of @ObjectPropertyInfo that describe the properties of the
1598# object.
b4b12c62 1599#
51920820 1600# Since: 1.2
b4b12c62
AL
1601##
1602{ 'command': 'qom-list',
1603 'data': { 'path': 'str' },
57c9fafe 1604 'returns': [ 'ObjectPropertyInfo' ] }
eb6e8ea5
AL
1605
1606##
1607# @qom-get:
1608#
57c9fafe 1609# This command will get a property from a object model path and return the
eb6e8ea5
AL
1610# value.
1611#
57c9fafe 1612# @path: The path within the object model. There are two forms of supported
eb6e8ea5
AL
1613# paths--absolute and partial paths.
1614#
57c9fafe 1615# Absolute paths are derived from the root object and can follow child<>
eb6e8ea5
AL
1616# or link<> properties. Since they can follow link<> properties, they
1617# can be arbitrarily long. Absolute paths look like absolute filenames
1618# and are prefixed with a leading slash.
1619#
1620# Partial paths look like relative filenames. They do not begin
1621# with a prefix. The matching rules for partial paths are subtle but
57c9fafe 1622# designed to make specifying objects easy. At each level of the
eb6e8ea5
AL
1623# composition tree, the partial path is matched as an absolute path.
1624# The first match is not returned. At least two matches are searched
1625# for. A successful result is only returned if only one match is
1626# found. If more than one match is found, a flag is return to
1627# indicate that the match was ambiguous.
1628#
1629# @property: The property name to read
1630#
1631# Returns: The property value. The type depends on the property type. legacy<>
1632# properties are returned as #str. child<> and link<> properties are
1633# returns as #str pathnames. All integer property types (u8, u16, etc)
1634# are returned as #int.
1635#
51920820 1636# Since: 1.2
eb6e8ea5
AL
1637##
1638{ 'command': 'qom-get',
1639 'data': { 'path': 'str', 'property': 'str' },
1640 'returns': 'visitor',
1641 'gen': 'no' }
1642
1643##
1644# @qom-set:
1645#
57c9fafe 1646# This command will set a property from a object model path.
eb6e8ea5
AL
1647#
1648# @path: see @qom-get for a description of this parameter
1649#
1650# @property: the property name to set
1651#
1652# @value: a value who's type is appropriate for the property type. See @qom-get
1653# for a description of type mapping.
1654#
51920820 1655# Since: 1.2
eb6e8ea5
AL
1656##
1657{ 'command': 'qom-set',
1658 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1659 'gen': 'no' }
fbf796fd
LC
1660
1661##
1662# @set_password:
1663#
1664# Sets the password of a remote display session.
1665#
1666# @protocol: `vnc' to modify the VNC server password
1667# `spice' to modify the Spice server password
1668#
1669# @password: the new password
1670#
1671# @connected: #optional how to handle existing clients when changing the
b80e560b 1672# password. If nothing is specified, defaults to `keep'
fbf796fd
LC
1673# `fail' to fail the command if clients are connected
1674# `disconnect' to disconnect existing clients
1675# `keep' to maintain existing clients
1676#
1677# Returns: Nothing on success
1678# If Spice is not enabled, DeviceNotFound
fbf796fd
LC
1679#
1680# Since: 0.14.0
1681##
1682{ 'command': 'set_password',
1683 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
9ad5372d
LC
1684
1685##
1686# @expire_password:
1687#
1688# Expire the password of a remote display server.
1689#
1690# @protocol: the name of the remote display protocol `vnc' or `spice'
1691#
1692# @time: when to expire the password.
1693# `now' to expire the password immediately
1694# `never' to cancel password expiration
1695# `+INT' where INT is the number of seconds from now (integer)
1696# `INT' where INT is the absolute time in seconds
1697#
1698# Returns: Nothing on success
1699# If @protocol is `spice' and Spice is not active, DeviceNotFound
9ad5372d
LC
1700#
1701# Since: 0.14.0
1702#
1703# Notes: Time is relative to the server and currently there is no way to
1704# coordinate server time with client time. It is not recommended to
1705# use the absolute time version of the @time parameter unless you're
1706# sure you are on the same machine as the QEMU instance.
1707##
1708{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
c245b6a3
LC
1709
1710##
1711# @eject:
1712#
1713# Ejects a device from a removable drive.
1714#
1715# @device: The name of the device
1716#
1717# @force: @optional If true, eject regardless of whether the drive is locked.
1718# If not specified, the default value is false.
1719#
1720# Returns: Nothing on success
1721# If @device is not a valid block device, DeviceNotFound
c245b6a3
LC
1722#
1723# Notes: Ejecting a device will no media results in success
1724#
1725# Since: 0.14.0
1726##
1727{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
270b243f
LC
1728
1729##
1730# @change-vnc-password:
1731#
1732# Change the VNC server password.
1733#
1734# @target: the new password to use with VNC authentication
1735#
1736# Since: 1.1
1737#
1738# Notes: An empty password in this command will set the password to the empty
1739# string. Existing clients are unaffected by executing this command.
1740##
1741{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
333a96ec
LC
1742
1743##
1744# @change:
1745#
1746# This command is multiple commands multiplexed together.
1747#
1748# @device: This is normally the name of a block device but it may also be 'vnc'.
1749# when it's 'vnc', then sub command depends on @target
1750#
1751# @target: If @device is a block device, then this is the new filename.
1752# If @device is 'vnc', then if the value 'password' selects the vnc
1753# change password command. Otherwise, this specifies a new server URI
1754# address to listen to for VNC connections.
1755#
1756# @arg: If @device is a block device, then this is an optional format to open
1757# the device with.
1758# If @device is 'vnc' and @target is 'password', this is the new VNC
1759# password to set. If this argument is an empty string, then no future
1760# logins will be allowed.
1761#
1762# Returns: Nothing on success.
1763# If @device is not a valid block device, DeviceNotFound
333a96ec
LC
1764# If the new block device is encrypted, DeviceEncrypted. Note that
1765# if this error is returned, the device has been opened successfully
1766# and an additional call to @block_passwd is required to set the
1767# device's password. The behavior of reads and writes to the block
1768# device between when these calls are executed is undefined.
1769#
1770# Notes: It is strongly recommended that this interface is not used especially
1771# for changing block devices.
1772#
1773# Since: 0.14.0
1774##
1775{ 'command': 'change',
1776 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
80047da5
LC
1777
1778##
1779# @block_set_io_throttle:
1780#
1781# Change I/O throttle limits for a block drive.
1782#
1783# @device: The name of the device
1784#
1785# @bps: total throughput limit in bytes per second
1786#
1787# @bps_rd: read throughput limit in bytes per second
1788#
1789# @bps_wr: write throughput limit in bytes per second
1790#
1791# @iops: total I/O operations per second
1792#
1793# @ops_rd: read I/O operations per second
1794#
1795# @iops_wr: write I/O operations per second
1796#
1797# Returns: Nothing on success
1798# If @device is not a valid block device, DeviceNotFound
80047da5
LC
1799#
1800# Since: 1.1
b80e560b 1801##
80047da5
LC
1802{ 'command': 'block_set_io_throttle',
1803 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1804 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
12bd451f 1805
db58f9c0
SH
1806##
1807# @block-stream:
12bd451f
SH
1808#
1809# Copy data from a backing file into a block device.
1810#
1811# The block streaming operation is performed in the background until the entire
1812# backing file has been copied. This command returns immediately once streaming
1813# has started. The status of ongoing block streaming operations can be checked
1814# with query-block-jobs. The operation can be stopped before it has completed
db58f9c0 1815# using the block-job-cancel command.
12bd451f
SH
1816#
1817# If a base file is specified then sectors are not copied from that base file and
1818# its backing chain. When streaming completes the image file will have the base
1819# file as its backing file. This can be used to stream a subset of the backing
1820# file chain instead of flattening the entire image.
1821#
1822# On successful completion the image file is updated to drop the backing file
1823# and the BLOCK_JOB_COMPLETED event is emitted.
1824#
1825# @device: the device name
1826#
1827# @base: #optional the common backing file name
1828#
c83c66c3
SH
1829# @speed: #optional the maximum speed, in bytes per second
1830#
12bd451f 1831# Returns: Nothing on success
12bd451f 1832# If @device does not exist, DeviceNotFound
12bd451f
SH
1833#
1834# Since: 1.1
1835##
c83c66c3
SH
1836{ 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1837 '*speed': 'int' } }
2d47c6e9
SH
1838
1839##
db58f9c0 1840# @block-job-set-speed:
2d47c6e9
SH
1841#
1842# Set maximum speed for a background block operation.
1843#
1844# This command can only be issued when there is an active block job.
1845#
1846# Throttling can be disabled by setting the speed to 0.
1847#
1848# @device: the device name
1849#
c83c66c3
SH
1850# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1851# Defaults to 0.
2d47c6e9
SH
1852#
1853# Returns: Nothing on success
05290d80 1854# If no background operation is active on this device, DeviceNotActive
2d47c6e9
SH
1855#
1856# Since: 1.1
1857##
db58f9c0 1858{ 'command': 'block-job-set-speed',
882ec7ce 1859 'data': { 'device': 'str', 'speed': 'int' } }
370521a1
SH
1860
1861##
db58f9c0 1862# @block-job-cancel:
370521a1 1863#
05290d80 1864# Stop an active background block operation.
370521a1 1865#
05290d80 1866# This command returns immediately after marking the active background block
370521a1
SH
1867# operation for cancellation. It is an error to call this command if no
1868# operation is in progress.
1869#
1870# The operation will cancel as soon as possible and then emit the
1871# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1872# enumerated using query-block-jobs.
1873#
05290d80
PB
1874# For streaming, the image file retains its backing file unless the streaming
1875# operation happens to complete just as it is being cancelled. A new streaming
1876# operation can be started at a later time to finish copying all data from the
1877# backing file.
370521a1
SH
1878#
1879# @device: the device name
1880#
1881# Returns: Nothing on success
05290d80 1882# If no background operation is active on this device, DeviceNotActive
370521a1
SH
1883#
1884# Since: 1.1
1885##
db58f9c0 1886{ 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
5eeee3fa
AL
1887
1888##
1889# @ObjectTypeInfo:
1890#
1891# This structure describes a search result from @qom-list-types
1892#
1893# @name: the type name found in the search
1894#
1895# Since: 1.1
1896#
1897# Notes: This command is experimental and may change syntax in future releases.
1898##
1899{ 'type': 'ObjectTypeInfo',
1900 'data': { 'name': 'str' } }
1901
1902##
1903# @qom-list-types:
1904#
1905# This command will return a list of types given search parameters
1906#
1907# @implements: if specified, only return types that implement this type name
1908#
1909# @abstract: if true, include abstract types in the results
1910#
1911# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1912#
1913# Since: 1.1
5eeee3fa
AL
1914##
1915{ 'command': 'qom-list-types',
1916 'data': { '*implements': 'str', '*abstract': 'bool' },
1917 'returns': [ 'ObjectTypeInfo' ] }
e1c37d0e 1918
1daa31b9
AL
1919##
1920# @DevicePropertyInfo:
1921#
1922# Information about device properties.
1923#
1924# @name: the name of the property
1925# @type: the typename of the property
1926#
1927# Since: 1.2
1928##
1929{ 'type': 'DevicePropertyInfo',
1930 'data': { 'name': 'str', 'type': 'str' } }
1931
1932##
1933# @device-list-properties:
1934#
1935# List properties associated with a device.
1936#
1937# @typename: the type name of a device
1938#
1939# Returns: a list of DevicePropertyInfo describing a devices properties
1940#
1941# Since: 1.2
1942##
1943{ 'command': 'device-list-properties',
1944 'data': { 'typename': 'str'},
1945 'returns': [ 'DevicePropertyInfo' ] }
1946
e1c37d0e
LC
1947##
1948# @migrate
1949#
1950# Migrates the current running guest to another Virtual Machine.
1951#
1952# @uri: the Uniform Resource Identifier of the destination VM
1953#
1954# @blk: #optional do block migration (full disk copy)
1955#
1956# @inc: #optional incremental disk copy migration
1957#
1958# @detach: this argument exists only for compatibility reasons and
1959# is ignored by QEMU
1960#
1961# Returns: nothing on success
1962#
1963# Since: 0.14.0
1964##
1965{ 'command': 'migrate',
1966 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
33cf629a 1967
a7ae8355
SS
1968# @xen-save-devices-state:
1969#
1970# Save the state of all devices to file. The RAM and the block devices
1971# of the VM are not saved by this command.
1972#
1973# @filename: the file to save the state of the devices to as binary
1974# data. See xen-save-devices-state.txt for a description of the binary
1975# format.
1976#
1977# Returns: Nothing on success
a7ae8355
SS
1978#
1979# Since: 1.1
1980##
1981{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
a15fef21
LC
1982
1983##
1984# @device_del:
1985#
1986# Remove a device from a guest
1987#
1988# @id: the name of the device
1989#
1990# Returns: Nothing on success
1991# If @id is not a valid device, DeviceNotFound
a15fef21
LC
1992#
1993# Notes: When this command completes, the device may not be removed from the
1994# guest. Hot removal is an operation that requires guest cooperation.
1995# This command merely requests that the guest begin the hot removal
1996# process.
1997#
1998# Since: 0.14.0
1999##
2000{ 'command': 'device_del', 'data': {'id': 'str'} }
783e9b48
WC
2001
2002##
2003# @dump-guest-memory
2004#
2005# Dump guest's memory to vmcore. It is a synchronous operation that can take
2006# very long depending on the amount of guest memory. This command is only
f5b0d93b
LC
2007# supported on i386 and x86_64.
2008#
2009# @paging: if true, do paging to get guest's memory mapping. This allows
2010# using gdb to process the core file. However, setting @paging to false
2011# may be desirable because of two reasons:
2012#
2013# 1. The guest may be in a catastrophic state or can have corrupted
2014# memory, which cannot be trusted
2015# 2. The guest can be in real-mode even if paging is enabled. For example,
2016# the guest uses ACPI to sleep, and ACPI sleep state goes in real-mode
2017#
783e9b48 2018# @protocol: the filename or file descriptor of the vmcore. The supported
f5b0d93b
LC
2019# protocols are:
2020#
783e9b48
WC
2021# 1. file: the protocol starts with "file:", and the following string is
2022# the file's path.
2023# 2. fd: the protocol starts with "fd:", and the following string is the
2024# fd's name.
f5b0d93b 2025#
783e9b48 2026# @begin: #optional if specified, the starting physical address.
f5b0d93b 2027#
783e9b48 2028# @length: #optional if specified, the memory size, in bytes. If you don't
f5b0d93b 2029# want to dump all guest's memory, please specify the start @begin and @length
783e9b48
WC
2030#
2031# Returns: nothing on success
783e9b48
WC
2032#
2033# Since: 1.2
2034##
2035{ 'command': 'dump-guest-memory',
2036 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2037 '*length': 'int' } }
928059a3
LC
2038##
2039# @netdev_add:
2040#
2041# Add a network backend.
2042#
2043# @type: the type of network backend. Current valid values are 'user', 'tap',
2044# 'vde', 'socket', 'dump' and 'bridge'
2045#
2046# @id: the name of the new network backend
2047#
2048# @props: #optional a list of properties to be passed to the backend in
2049# the format 'name=value', like 'ifname=tap0,script=no'
2050#
2051# Notes: The semantics of @props is not well defined. Future commands will be
2052# introduced that provide stronger typing for backend creation.
2053#
2054# Since: 0.14.0
2055#
2056# Returns: Nothing on success
2057# If @type is not a valid network backend, DeviceNotFound
928059a3
LC
2058##
2059{ 'command': 'netdev_add',
2060 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2061 'gen': 'no' }
5f964155
LC
2062
2063##
2064# @netdev_del:
2065#
2066# Remove a network backend.
2067#
2068# @id: the name of the network backend to remove
2069#
2070# Returns: Nothing on success
2071# If @id is not a valid network backend, DeviceNotFound
2072#
2073# Since: 0.14.0
2074##
2075{ 'command': 'netdev_del', 'data': {'id': 'str'} }
208c9d1b 2076
14aa0c2d
LE
2077##
2078# @NetdevNoneOptions
2079#
2080# Use it alone to have zero network devices.
2081#
2082# Since 1.2
2083##
2084{ 'type': 'NetdevNoneOptions',
2085 'data': { } }
2086
2087##
2088# @NetLegacyNicOptions
2089#
2090# Create a new Network Interface Card.
2091#
2092# @netdev: #optional id of -netdev to connect to
2093#
2094# @macaddr: #optional MAC address
2095#
2096# @model: #optional device model (e1000, rtl8139, virtio etc.)
2097#
2098# @addr: #optional PCI device address
2099#
2100# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2101#
2102# Since 1.2
2103##
2104{ 'type': 'NetLegacyNicOptions',
2105 'data': {
2106 '*netdev': 'str',
2107 '*macaddr': 'str',
2108 '*model': 'str',
2109 '*addr': 'str',
2110 '*vectors': 'uint32' } }
2111
2112##
2113# @String
2114#
2115# A fat type wrapping 'str', to be embedded in lists.
2116#
2117# Since 1.2
2118##
2119{ 'type': 'String',
2120 'data': {
2121 'str': 'str' } }
2122
2123##
2124# @NetdevUserOptions
2125#
2126# Use the user mode network stack which requires no administrator privilege to
2127# run.
2128#
2129# @hostname: #optional client hostname reported by the builtin DHCP server
2130#
2131# @restrict: #optional isolate the guest from the host
2132#
2133# @ip: #optional legacy parameter, use net= instead
2134#
2135# @net: #optional IP address and optional netmask
2136#
2137# @host: #optional guest-visible address of the host
2138#
2139# @tftp: #optional root directory of the built-in TFTP server
2140#
2141# @bootfile: #optional BOOTP filename, for use with tftp=
2142#
2143# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2144# assign
2145#
2146# @dns: #optional guest-visible address of the virtual nameserver
2147#
2148# @smb: #optional root directory of the built-in SMB server
2149#
2150# @smbserver: #optional IP address of the built-in SMB server
2151#
2152# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2153# endpoints
2154#
2155# @guestfwd: #optional forward guest TCP connections
2156#
2157# Since 1.2
2158##
2159{ 'type': 'NetdevUserOptions',
2160 'data': {
2161 '*hostname': 'str',
2162 '*restrict': 'bool',
2163 '*ip': 'str',
2164 '*net': 'str',
2165 '*host': 'str',
2166 '*tftp': 'str',
2167 '*bootfile': 'str',
2168 '*dhcpstart': 'str',
2169 '*dns': 'str',
2170 '*smb': 'str',
2171 '*smbserver': 'str',
2172 '*hostfwd': ['String'],
2173 '*guestfwd': ['String'] } }
2174
2175##
2176# @NetdevTapOptions
2177#
2178# Connect the host TAP network interface name to the VLAN.
2179#
2180# @ifname: #optional interface name
2181#
2182# @fd: #optional file descriptor of an already opened tap
2183#
2184# @script: #optional script to initialize the interface
2185#
2186# @downscript: #optional script to shut down the interface
2187#
2188# @helper: #optional command to execute to configure bridge
2189#
2190# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2191#
2192# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2193#
2194# @vhost: #optional enable vhost-net network accelerator
2195#
2196# @vhostfd: #optional file descriptor of an already opened vhost net device
2197#
2198# @vhostforce: #optional vhost on for non-MSIX virtio guests
2199#
2200# Since 1.2
2201##
2202{ 'type': 'NetdevTapOptions',
2203 'data': {
2204 '*ifname': 'str',
2205 '*fd': 'str',
2206 '*script': 'str',
2207 '*downscript': 'str',
2208 '*helper': 'str',
2209 '*sndbuf': 'size',
2210 '*vnet_hdr': 'bool',
2211 '*vhost': 'bool',
2212 '*vhostfd': 'str',
2213 '*vhostforce': 'bool' } }
2214
2215##
2216# @NetdevSocketOptions
2217#
2218# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2219# socket connection.
2220#
2221# @fd: #optional file descriptor of an already opened socket
2222#
2223# @listen: #optional port number, and optional hostname, to listen on
2224#
2225# @connect: #optional port number, and optional hostname, to connect to
2226#
2227# @mcast: #optional UDP multicast address and port number
2228#
2229# @localaddr: #optional source address and port for multicast and udp packets
2230#
2231# @udp: #optional UDP unicast address and port number
2232#
2233# Since 1.2
2234##
2235{ 'type': 'NetdevSocketOptions',
2236 'data': {
2237 '*fd': 'str',
2238 '*listen': 'str',
2239 '*connect': 'str',
2240 '*mcast': 'str',
2241 '*localaddr': 'str',
2242 '*udp': 'str' } }
2243
2244##
2245# @NetdevVdeOptions
2246#
2247# Connect the VLAN to a vde switch running on the host.
2248#
2249# @sock: #optional socket path
2250#
2251# @port: #optional port number
2252#
2253# @group: #optional group owner of socket
2254#
2255# @mode: #optional permissions for socket
2256#
2257# Since 1.2
2258##
2259{ 'type': 'NetdevVdeOptions',
2260 'data': {
2261 '*sock': 'str',
2262 '*port': 'uint16',
2263 '*group': 'str',
2264 '*mode': 'uint16' } }
2265
2266##
2267# @NetdevDumpOptions
2268#
2269# Dump VLAN network traffic to a file.
2270#
2271# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2272# suffixes.
2273#
2274# @file: #optional dump file path (default is qemu-vlan0.pcap)
2275#
2276# Since 1.2
2277##
2278{ 'type': 'NetdevDumpOptions',
2279 'data': {
2280 '*len': 'size',
2281 '*file': 'str' } }
2282
2283##
2284# @NetdevBridgeOptions
2285#
2286# Connect a host TAP network interface to a host bridge device.
2287#
2288# @br: #optional bridge name
2289#
2290# @helper: #optional command to execute to configure bridge
2291#
2292# Since 1.2
2293##
2294{ 'type': 'NetdevBridgeOptions',
2295 'data': {
2296 '*br': 'str',
2297 '*helper': 'str' } }
2298
f6c874e3
SH
2299##
2300# @NetdevHubPortOptions
2301#
2302# Connect two or more net clients through a software hub.
2303#
2304# @hubid: hub identifier number
2305#
2306# Since 1.2
2307##
2308{ 'type': 'NetdevHubPortOptions',
2309 'data': {
2310 'hubid': 'int32' } }
2311
14aa0c2d
LE
2312##
2313# @NetClientOptions
2314#
2315# A discriminated record of network device traits.
2316#
2317# Since 1.2
2318##
2319{ 'union': 'NetClientOptions',
2320 'data': {
f6c874e3
SH
2321 'none': 'NetdevNoneOptions',
2322 'nic': 'NetLegacyNicOptions',
2323 'user': 'NetdevUserOptions',
2324 'tap': 'NetdevTapOptions',
2325 'socket': 'NetdevSocketOptions',
2326 'vde': 'NetdevVdeOptions',
2327 'dump': 'NetdevDumpOptions',
2328 'bridge': 'NetdevBridgeOptions',
2329 'hubport': 'NetdevHubPortOptions' } }
14aa0c2d
LE
2330
2331##
2332# @NetLegacy
2333#
2334# Captures the configuration of a network device; legacy.
2335#
2336# @vlan: #optional vlan number
2337#
2338# @id: #optional identifier for monitor commands
2339#
2340# @name: #optional identifier for monitor commands, ignored if @id is present
2341#
2342# @opts: device type specific properties (legacy)
2343#
2344# Since 1.2
2345##
2346{ 'type': 'NetLegacy',
2347 'data': {
2348 '*vlan': 'int32',
2349 '*id': 'str',
2350 '*name': 'str',
2351 'opts': 'NetClientOptions' } }
2352
2353##
2354# @Netdev
2355#
2356# Captures the configuration of a network device.
2357#
2358# @id: identifier for monitor commands.
2359#
2360# @opts: device type specific properties
2361#
2362# Since 1.2
2363##
2364{ 'type': 'Netdev',
2365 'data': {
2366 'id': 'str',
2367 'opts': 'NetClientOptions' } }
2368
208c9d1b
CB
2369##
2370# @getfd:
2371#
2372# Receive a file descriptor via SCM rights and assign it a name
2373#
2374# @fdname: file descriptor name
2375#
2376# Returns: Nothing on success
208c9d1b
CB
2377#
2378# Since: 0.14.0
2379#
2380# Notes: If @fdname already exists, the file descriptor assigned to
2381# it will be closed and replaced by the received file
2382# descriptor.
2383# The 'closefd' command can be used to explicitly close the
2384# file descriptor when it is no longer needed.
2385##
2386{ 'command': 'getfd', 'data': {'fdname': 'str'} }
2387
2388##
2389# @closefd:
2390#
2391# Close a file descriptor previously passed via SCM rights
2392#
2393# @fdname: file descriptor name
2394#
2395# Returns: Nothing on success
208c9d1b
CB
2396#
2397# Since: 0.14.0
2398##
2399{ 'command': 'closefd', 'data': {'fdname': 'str'} }
01d3c80d
AL
2400
2401##
2402# @MachineInfo:
2403#
2404# Information describing a machine.
2405#
2406# @name: the name of the machine
2407#
2408# @alias: #optional an alias for the machine name
2409#
2410# @default: #optional whether the machine is default
2411#
2412# Since: 1.2.0
2413##
2414{ 'type': 'MachineInfo',
2415 'data': { 'name': 'str', '*alias': 'str',
2416 '*is-default': 'bool' } }
2417
2418##
2419# @query-machines:
2420#
2421# Return a list of supported machines
2422#
2423# Returns: a list of MachineInfo
2424#
2425# Since: 1.2.0
2426##
2427{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
e4e31c63
AL
2428
2429##
2430# @CpuDefinitionInfo:
2431#
2432# Virtual CPU definition.
2433#
2434# @name: the name of the CPU definition
2435#
2436# Since: 1.2.0
2437##
2438{ 'type': 'CpuDefinitionInfo',
2439 'data': { 'name': 'str' } }
2440
2441##
2442# @query-cpu-definitions:
2443#
2444# Return a list of supported virtual CPU definitions
2445#
2446# Returns: a list of CpuDefInfo
2447#
2448# Since: 1.2.0
2449##
2450{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
ba1c048a
CB
2451
2452# @AddfdInfo:
2453#
2454# Information about a file descriptor that was added to an fd set.
2455#
2456# @fdset-id: The ID of the fd set that @fd was added to.
2457#
2458# @fd: The file descriptor that was received via SCM rights and
2459# added to the fd set.
2460#
2461# Since: 1.2.0
2462##
2463{ 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2464
2465##
2466# @add-fd:
2467#
2468# Add a file descriptor, that was passed via SCM rights, to an fd set.
2469#
2470# @fdset-id: #optional The ID of the fd set to add the file descriptor to.
2471#
2472# @opaque: #optional A free-form string that can be used to describe the fd.
2473#
2474# Returns: @AddfdInfo on success
2475# If file descriptor was not received, FdNotSupplied
2476# If @fdset-id does not exist, InvalidParameterValue
2477#
2478# Notes: The list of fd sets is shared by all monitor connections.
2479#
2480# If @fdset-id is not specified, a new fd set will be created.
2481#
2482# Since: 1.2.0
2483##
2484{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2485 'returns': 'AddfdInfo' }
2486
2487##
2488# @remove-fd:
2489#
2490# Remove a file descriptor from an fd set.
2491#
2492# @fdset-id: The ID of the fd set that the file descriptor belongs to.
2493#
2494# @fd: #optional The file descriptor that is to be removed.
2495#
2496# Returns: Nothing on success
2497# If @fdset-id or @fd is not found, FdNotFound
2498#
2499# Since: 1.2.0
2500#
2501# Notes: The list of fd sets is shared by all monitor connections.
2502#
2503# If @fd is not specified, all file descriptors in @fdset-id
2504# will be removed.
2505##
2506{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2507
2508##
2509# @FdsetFdInfo:
2510#
2511# Information about a file descriptor that belongs to an fd set.
2512#
2513# @fd: The file descriptor value.
2514#
2515# @opaque: #optional A free-form string that can be used to describe the fd.
2516#
2517# Since: 1.2.0
2518##
2519{ 'type': 'FdsetFdInfo',
2520 'data': {'fd': 'int', '*opaque': 'str'} }
2521
2522##
2523# @FdsetInfo:
2524#
2525# Information about an fd set.
2526#
2527# @fdset-id: The ID of the fd set.
2528#
2529# @fds: A list of file descriptors that belong to this fd set.
2530#
2531# Since: 1.2.0
2532##
2533{ 'type': 'FdsetInfo',
2534 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2535
2536##
2537# @query-fdsets:
2538#
2539# Return information describing all fd sets.
2540#
2541# Returns: A list of @FdsetInfo
2542#
2543# Since: 1.2.0
2544#
2545# Note: The list of fd sets is shared by all monitor connections.
2546#
2547##
2548{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
99afc91d
DB
2549
2550##
2551# @TargetType
2552#
2553# Target CPU emulation type
2554#
2555# These parameters correspond to the softmmu binary CPU name that is currently
2556# running.
2557#
2558# Since: 1.2.0
2559##
2560{ 'enum': 'TargetType',
2561 'data': [ 'alpha', 'arm', 'cris', 'i386', 'lm32', 'm68k', 'microblazeel',
2562 'microblaze', 'mips64el', 'mips64', 'mipsel', 'mips', 'or32',
2563 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb', 'sh4', 'sparc64',
2564 'sparc', 'unicore32', 'x86_64', 'xtensaeb', 'xtensa' ] }
2565
2566##
2567# @TargetInfo:
2568#
2569# Information describing the QEMU target.
2570#
2571# @arch: the target architecture (eg "x86_64", "i386", etc)
2572#
2573# Since: 1.2.0
2574##
2575{ 'type': 'TargetInfo',
2576 'data': { 'arch': 'TargetType' } }
2577
2578##
2579# @query-target:
2580#
2581# Return information about the target for this QEMU
2582#
2583# Returns: TargetInfo
2584#
2585# Since: 1.2.0
2586##
2587{ 'command': 'query-target', 'returns': 'TargetInfo' }
411656f4
AK
2588
2589##
2590# @QKeyCode:
2591#
2592# An enumeration of key name.
2593#
2594# This is used by the send-key command.
2595#
2596# Since: 1.3.0
2597##
2598{ 'enum': 'QKeyCode',
2599 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
2600 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
2601 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
2602 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
2603 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
2604 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
2605 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
2606 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
2607 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
2608 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
2609 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
2610 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
2611 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
2612 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
2613 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
e4c8f004
AK
2614
2615##
2616# @send-key:
2617#
2618# Send keys to guest.
2619#
2620# @keys: key sequence. 'keys' is the name of the key. Use a JSON array to
2621# press several keys simultaneously.
2622#
2623# @hold-time: #optional time to delay key up events, milliseconds. Defaults
2624# to 100
2625#
2626# Returns: Nothing on success
2627# If key is unknown or redundant, InvalidParameter
2628#
2629# Since: 1.3.0
2630#
2631##
2632{ 'command': 'send-key',
2633 'data': { 'keys': ['QKeyCode'], '*hold-time': 'int' } }
ad39cf6d
LC
2634
2635##
2636# @screendump:
2637#
2638# Write a PPM of the VGA screen to a file.
2639#
2640# @filename: the path of a new PPM file to store the image
2641#
2642# Returns: Nothing on success
2643#
2644# Since: 0.14.0
2645##
2646{ 'command': 'screendump', 'data': {'filename': 'str'} }