blob: 145eca8855cbbb798b164b2c6cae1471e24e194a [file] [log] [blame]
Anthony Liguorie3193602011-09-02 12:34:47 -05001# -*- Mode: Python -*-
2#
3# QAPI Schema
Anthony Liguori48a32be2011-09-02 12:34:48 -05004
5##
Luiz Capitulinodcafd322012-07-27 09:34:50 -03006# @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#
Luiz Capitulinodcafd322012-07-27 09:34:50 -030025# Since: 1.2
26##
27{ 'enum': 'ErrorClass',
28 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
Paolo Bonzini1e998142012-10-23 14:54:21 +020029 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
Luiz Capitulinodcafd322012-07-27 09:34:50 -030030
31##
Luiz Capitulinob224e5e2012-09-13 16:52:20 -030032# @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##
Anthony Liguori48a32be2011-09-02 12:34:48 -050057# @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' }
Luiz Capitulinob9c15f12011-08-26 17:38:13 -030077
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' }
Luiz Capitulino292a2602011-09-12 15:10:53 -0300114
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
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300139##
140# @RunState
141#
Lei Li6932a692012-08-23 13:14:25 +0800142# An enumeration of VM run states.
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300143#
144# @debug: QEMU is running on a debugger
145#
Luiz Capitulino0a24c7b2012-04-27 13:16:41 -0300146# @finish-migrate: guest is paused to finish the migration process
147#
Paolo Bonzini1e998142012-10-23 14:54:21 +0200148# @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.
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300153#
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#
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300166# @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#
Luiz Capitulinoad02b962012-04-27 13:33:36 -0300174# @suspended: guest is suspended (ACPI S3)
175#
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300176# @watchdog: the watchdog action is configured to pause and has been triggered
Hu Taoede085b2013-04-26 11:24:40 +0800177#
178# @guest-panicked: guest has been panicked as a result of guest OS panic
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300179##
180{ 'enum': 'RunState',
181 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
182 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
Hu Taoede085b2013-04-26 11:24:40 +0800183 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
184 'guest-panicked' ] }
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300185
186##
Benoît Canetc249ee62012-09-05 13:09:01 +0200187# @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# @ImageInfo:
214#
215# Information about a QEMU image file
216#
217# @filename: name of the image file
218#
219# @format: format of the image file
220#
221# @virtual-size: maximum capacity in bytes of the image
222#
223# @actual-size: #optional actual size on disk in bytes of the image
224#
225# @dirty-flag: #optional true if image is not cleanly closed
226#
227# @cluster-size: #optional size of a cluster in bytes
228#
229# @encrypted: #optional true if the image is encrypted
230#
231# @backing-filename: #optional name of the backing file
232#
233# @full-backing-filename: #optional full path of the backing file
234#
235# @backing-filename-format: #optional the format of the backing file
236#
237# @snapshots: #optional list of VM snapshots
238#
Wenchao Xia553a7e82013-06-06 12:27:59 +0800239# @backing-image: #optional info of the backing image (since 1.6)
240#
Benoît Canetc249ee62012-09-05 13:09:01 +0200241# Since: 1.3
242#
243##
244
245{ 'type': 'ImageInfo',
246 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
247 '*actual-size': 'int', 'virtual-size': 'int',
248 '*cluster-size': 'int', '*encrypted': 'bool',
249 '*backing-filename': 'str', '*full-backing-filename': 'str',
Wenchao Xia553a7e82013-06-06 12:27:59 +0800250 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
251 '*backing-image': 'ImageInfo' } }
Benoît Canetc249ee62012-09-05 13:09:01 +0200252
253##
Federico Simoncelli8599ea42013-01-28 06:59:47 -0500254# @ImageCheck:
255#
256# Information about a QEMU image file check
257#
258# @filename: name of the image file checked
259#
260# @format: format of the image file checked
261#
262# @check-errors: number of unexpected errors occurred during check
263#
264# @image-end-offset: #optional offset (in bytes) where the image ends, this
265# field is present if the driver for the image format
266# supports it
267#
268# @corruptions: #optional number of corruptions found during the check if any
269#
270# @leaks: #optional number of leaks found during the check if any
271#
272# @corruptions-fixed: #optional number of corruptions fixed during the check
273# if any
274#
275# @leaks-fixed: #optional number of leaks fixed during the check if any
276#
277# @total-clusters: #optional total number of clusters, this field is present
278# if the driver for the image format supports it
279#
280# @allocated-clusters: #optional total number of allocated clusters, this
281# field is present if the driver for the image format
282# supports it
283#
284# @fragmented-clusters: #optional total number of fragmented clusters, this
285# field is present if the driver for the image format
286# supports it
287#
Stefan Hajnoczie6439d72013-02-07 17:15:04 +0100288# @compressed-clusters: #optional total number of compressed clusters, this
289# field is present if the driver for the image format
290# supports it
291#
Federico Simoncelli8599ea42013-01-28 06:59:47 -0500292# Since: 1.4
293#
294##
295
296{ 'type': 'ImageCheck',
297 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
298 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
299 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
300 '*total-clusters': 'int', '*allocated-clusters': 'int',
Stefan Hajnoczie6439d72013-02-07 17:15:04 +0100301 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
Federico Simoncelli8599ea42013-01-28 06:59:47 -0500302
303##
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300304# @StatusInfo:
305#
306# Information about VCPU run state
307#
308# @running: true if all VCPUs are runnable, false if not runnable
309#
310# @singlestep: true if VCPUs are in single-step mode
311#
312# @status: the virtual machine @RunState
313#
314# Since: 0.14.0
315#
316# Notes: @singlestep is enabled through the GDB stub
317##
318{ 'type': 'StatusInfo',
319 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
320
321##
322# @query-status:
323#
324# Query the run status of all VCPUs
325#
326# Returns: @StatusInfo reflecting all VCPUs
327#
328# Since: 0.14.0
329##
330{ 'command': 'query-status', 'returns': 'StatusInfo' }
331
Luiz Capitulinoefab7672011-09-13 17:16:25 -0300332##
333# @UuidInfo:
334#
335# Guest UUID information.
336#
337# @UUID: the UUID of the guest
338#
339# Since: 0.14.0
340#
341# Notes: If no UUID was specified for the guest, a null UUID is returned.
342##
343{ 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
344
345##
346# @query-uuid:
347#
348# Query the guest UUID information.
349#
350# Returns: The @UuidInfo for the guest
351#
352# Since 0.14.0
353##
354{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
355
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -0300356##
357# @ChardevInfo:
358#
359# Information about a character device.
360#
361# @label: the label of the character device
362#
363# @filename: the filename of the character device
364#
365# Notes: @filename is encoded using the QEMU command line character device
366# encoding. See the QEMU man page for details.
367#
368# Since: 0.14.0
369##
370{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
371
372##
373# @query-chardev:
374#
375# Returns information about current character devices.
376#
377# Returns: a list of @ChardevInfo
378#
379# Since: 0.14.0
380##
381{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -0300382
383##
Lei Li1f590cf2013-01-25 00:03:20 +0800384# @DataFormat:
385#
386# An enumeration of data format.
387#
Markus Armbruster3949e592013-02-06 21:27:24 +0100388# @utf8: Data is a UTF-8 string (RFC 3629)
Lei Li1f590cf2013-01-25 00:03:20 +0800389#
Markus Armbruster3949e592013-02-06 21:27:24 +0100390# @base64: Data is Base64 encoded binary (RFC 3548)
Lei Li1f590cf2013-01-25 00:03:20 +0800391#
392# Since: 1.4
393##
Amos Kongad0f1712013-06-19 17:23:27 +0800394{ 'enum': 'DataFormat',
Lei Li1f590cf2013-01-25 00:03:20 +0800395 'data': [ 'utf8', 'base64' ] }
396
397##
Markus Armbruster3949e592013-02-06 21:27:24 +0100398# @ringbuf-write:
Lei Li1f590cf2013-01-25 00:03:20 +0800399#
Markus Armbruster3949e592013-02-06 21:27:24 +0100400# Write to a ring buffer character device.
Lei Li1f590cf2013-01-25 00:03:20 +0800401#
Markus Armbruster3949e592013-02-06 21:27:24 +0100402# @device: the ring buffer character device name
Lei Li1f590cf2013-01-25 00:03:20 +0800403#
Markus Armbruster3949e592013-02-06 21:27:24 +0100404# @data: data to write
Lei Li1f590cf2013-01-25 00:03:20 +0800405#
Markus Armbruster3949e592013-02-06 21:27:24 +0100406# @format: #optional data encoding (default 'utf8').
407# - base64: data must be base64 encoded text. Its binary
408# decoding gets written.
409# Bug: invalid base64 is currently not rejected.
410# Whitespace *is* invalid.
411# - utf8: data's UTF-8 encoding is written
412# - data itself is always Unicode regardless of format, like
413# any other string.
Lei Li1f590cf2013-01-25 00:03:20 +0800414#
415# Returns: Nothing on success
Lei Li1f590cf2013-01-25 00:03:20 +0800416#
417# Since: 1.4
418##
Markus Armbruster3949e592013-02-06 21:27:24 +0100419{ 'command': 'ringbuf-write',
Markus Armbruster82e59a62013-02-06 21:27:14 +0100420 'data': {'device': 'str', 'data': 'str',
Lei Li1f590cf2013-01-25 00:03:20 +0800421 '*format': 'DataFormat'} }
422
423##
Markus Armbruster3949e592013-02-06 21:27:24 +0100424# @ringbuf-read:
Lei Li49b6d722013-01-25 00:03:21 +0800425#
Markus Armbruster3949e592013-02-06 21:27:24 +0100426# Read from a ring buffer character device.
Lei Li49b6d722013-01-25 00:03:21 +0800427#
Markus Armbruster3949e592013-02-06 21:27:24 +0100428# @device: the ring buffer character device name
Lei Li49b6d722013-01-25 00:03:21 +0800429#
Markus Armbruster3949e592013-02-06 21:27:24 +0100430# @size: how many bytes to read at most
Lei Li49b6d722013-01-25 00:03:21 +0800431#
Markus Armbruster3949e592013-02-06 21:27:24 +0100432# @format: #optional data encoding (default 'utf8').
433# - base64: the data read is returned in base64 encoding.
434# - utf8: the data read is interpreted as UTF-8.
435# Bug: can screw up when the buffer contains invalid UTF-8
436# sequences, NUL characters, after the ring buffer lost
437# data, and when reading stops because the size limit is
438# reached.
439# - The return value is always Unicode regardless of format,
440# like any other string.
Lei Li49b6d722013-01-25 00:03:21 +0800441#
Markus Armbruster3ab651f2013-02-06 21:27:15 +0100442# Returns: data read from the device
Lei Li49b6d722013-01-25 00:03:21 +0800443#
444# Since: 1.4
445##
Markus Armbruster3949e592013-02-06 21:27:24 +0100446{ 'command': 'ringbuf-read',
Lei Li49b6d722013-01-25 00:03:21 +0800447 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
Markus Armbruster3ab651f2013-02-06 21:27:15 +0100448 'returns': 'str' }
Lei Li49b6d722013-01-25 00:03:21 +0800449
450##
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -0300451# @CommandInfo:
452#
453# Information about a QMP command
454#
455# @name: The command name
456#
457# Since: 0.14.0
458##
459{ 'type': 'CommandInfo', 'data': {'name': 'str'} }
460
461##
462# @query-commands:
463#
464# Return a list of supported QMP commands by this server
465#
466# Returns: A list of @CommandInfo for all supported commands
467#
468# Since: 0.14.0
469##
470{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
471
Luiz Capitulino7a7f3252011-09-15 14:20:28 -0300472##
Daniel P. Berrange48608532012-05-21 17:59:51 +0100473# @EventInfo:
474#
475# Information about a QMP event
476#
477# @name: The event name
478#
479# Since: 1.2.0
480##
481{ 'type': 'EventInfo', 'data': {'name': 'str'} }
482
483##
484# @query-events:
485#
486# Return a list of supported QMP events by this server
487#
488# Returns: A list of @EventInfo for all supported events
489#
490# Since: 1.2.0
491##
492{ 'command': 'query-events', 'returns': ['EventInfo'] }
493
494##
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300495# @MigrationStats
496#
497# Detailed migration status.
498#
499# @transferred: amount of bytes already transferred to the target VM
500#
501# @remaining: amount of bytes remaining to be transferred to the target VM
502#
503# @total: total amount of bytes involved in the migration process
504#
Peter Lievenf1c72792013-03-26 10:58:37 +0100505# @duplicate: number of duplicate (zero) pages (since 1.2)
506#
507# @skipped: number of skipped zero pages (since 1.5)
Orit Wasserman004d4c12012-08-06 21:42:56 +0300508#
509# @normal : number of normal pages (since 1.2)
510#
Juan Quintela8d017192012-08-13 12:31:25 +0200511# @normal-bytes: number of normal bytes sent (since 1.2)
512#
513# @dirty-pages-rate: number of pages dirtied by second by the
514# guest (since 1.3)
Orit Wasserman004d4c12012-08-06 21:42:56 +0300515#
Michael R. Hines7e114f82013-06-25 21:35:30 -0400516# @mbps: throughput in megabits/sec. (since 1.6)
517#
Orit Wasserman004d4c12012-08-06 21:42:56 +0300518# Since: 0.14.0
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300519##
520{ 'type': 'MigrationStats',
Juan Quintelad5f8a572012-05-21 22:01:07 +0200521 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
Peter Lievenf1c72792013-03-26 10:58:37 +0100522 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
Michael R. Hines7e114f82013-06-25 21:35:30 -0400523 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
524 'mbps' : 'number' } }
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300525
526##
Orit Wassermanf36d55a2012-08-06 21:42:57 +0300527# @XBZRLECacheStats
528#
529# Detailed XBZRLE migration cache statistics
530#
531# @cache-size: XBZRLE cache size
532#
533# @bytes: amount of bytes already transferred to the target VM
534#
535# @pages: amount of pages transferred to the target VM
536#
537# @cache-miss: number of cache miss
538#
539# @overflow: number of overflows
540#
541# Since: 1.2
542##
543{ 'type': 'XBZRLECacheStats',
544 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
545 'cache-miss': 'int', 'overflow': 'int' } }
546
547##
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300548# @MigrationInfo
549#
550# Information about current migration process.
551#
552# @status: #optional string describing the current migration status.
553# As of 0.14.0 this can be 'active', 'completed', 'failed' or
554# 'cancelled'. If this field is not returned, no migration process
555# has been initiated
556#
Juan Quintelad5f8a572012-05-21 22:01:07 +0200557# @ram: #optional @MigrationStats containing detailed migration
558# status, only returned if status is 'active' or
559# 'completed'. 'comppleted' (since 1.2)
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300560#
561# @disk: #optional @MigrationStats containing detailed disk migration
562# status, only returned if status is 'active' and it is a block
563# migration
564#
Orit Wassermanf36d55a2012-08-06 21:42:57 +0300565# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
566# migration statistics, only returned if XBZRLE feature is on and
567# status is 'active' or 'completed' (since 1.2)
568#
Juan Quintela7aa939a2012-08-18 13:17:10 +0200569# @total-time: #optional total amount of milliseconds since migration started.
570# If migration has ended, it returns the total migration
571# time. (since 1.2)
572#
Juan Quintela9c5a9fc2012-08-13 09:35:16 +0200573# @downtime: #optional only present when migration finishes correctly
574# total downtime in milliseconds for the guest.
575# (since 1.3)
576#
Juan Quintela2c52ddf2012-08-13 09:53:12 +0200577# @expected-downtime: #optional only present while migration is active
578# expected downtime in milliseconds for the guest in last walk
579# of the dirty bitmap. (since 1.3)
580#
Michael R. Hinesed4fbd12013-07-22 10:01:58 -0400581# @setup-time: #optional amount of setup time in milliseconds _before_ the
582# iterations begin but _after_ the QMP command is issued. This is designed
583# to provide an accounting of any activities (such as RDMA pinning) which
584# may be expensive, but do not actually occur during the iterative
585# migration rounds themselves. (since 1.6)
586#
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300587# Since: 0.14.0
588##
589{ 'type': 'MigrationInfo',
590 'data': {'*status': 'str', '*ram': 'MigrationStats',
Orit Wassermanf36d55a2012-08-06 21:42:57 +0300591 '*disk': 'MigrationStats',
Juan Quintela7aa939a2012-08-18 13:17:10 +0200592 '*xbzrle-cache': 'XBZRLECacheStats',
Juan Quintela9c5a9fc2012-08-13 09:35:16 +0200593 '*total-time': 'int',
Juan Quintela2c52ddf2012-08-13 09:53:12 +0200594 '*expected-downtime': 'int',
Michael R. Hinesed4fbd12013-07-22 10:01:58 -0400595 '*downtime': 'int',
596 '*setup-time': 'int'} }
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300597
598##
599# @query-migrate
600#
601# Returns information about current migration process.
602#
603# Returns: @MigrationInfo
604#
605# Since: 0.14.0
606##
607{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
608
609##
Orit Wassermanbbf6da32012-08-06 21:42:47 +0300610# @MigrationCapability
611#
612# Migration capabilities enumeration
613#
614# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
615# This feature allows us to minimize migration traffic for certain work
616# loads, by sending compressed difference of the pages
617#
Michael R. Hines60d92222013-06-25 21:35:36 -0400618# @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
619# mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
620# Disabled by default. Experimental: may (or may not) be renamed after
621# further testing is complete. (since 1.6)
622#
Peter Lieven323004a2013-07-18 09:48:50 +0200623# @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
624# essentially saves 1MB of zeroes per block on the wire. Enabling requires
625# source and target VM to support this feature. To enable it is sufficient
626# to enable the capability on the source VM. The feature is disabled by
627# default. (since 1.6)
628#
Juan Quintela9781c372013-07-23 15:21:09 +0200629# @auto-converge: If enabled, QEMU will automatically throttle down the guest
630# to speed up convergence of RAM migration. (since 1.6)
631#
Orit Wassermanbbf6da32012-08-06 21:42:47 +0300632# Since: 1.2
633##
634{ 'enum': 'MigrationCapability',
Peter Lieven323004a2013-07-18 09:48:50 +0200635 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
Orit Wassermanbbf6da32012-08-06 21:42:47 +0300636
637##
638# @MigrationCapabilityStatus
639#
640# Migration capability information
641#
642# @capability: capability enum
643#
644# @state: capability state bool
645#
646# Since: 1.2
647##
648{ 'type': 'MigrationCapabilityStatus',
649 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
650
651##
Orit Wasserman00458432012-08-06 21:42:48 +0300652# @migrate-set-capabilities
653#
654# Enable/Disable the following migration capabilities (like xbzrle)
655#
656# @capabilities: json array of capability modifications to make
657#
658# Since: 1.2
659##
660{ 'command': 'migrate-set-capabilities',
661 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
662
663##
Orit Wassermanbbf6da32012-08-06 21:42:47 +0300664# @query-migrate-capabilities
665#
666# Returns information about the current migration capabilities status
667#
668# Returns: @MigrationCapabilitiesStatus
669#
670# Since: 1.2
671##
672{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
673
674##
Luiz Capitulinoe235cec2011-09-21 15:29:55 -0300675# @MouseInfo:
676#
677# Information about a mouse device.
678#
679# @name: the name of the mouse device
680#
681# @index: the index of the mouse device
682#
683# @current: true if this device is currently receiving mouse events
684#
685# @absolute: true if this device supports absolute coordinates as input
686#
687# Since: 0.14.0
688##
689{ 'type': 'MouseInfo',
690 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
691 'absolute': 'bool'} }
692
693##
694# @query-mice:
695#
696# Returns information about each active mouse device
697#
698# Returns: a list of @MouseInfo for each device
699#
700# Since: 0.14.0
701##
702{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
703
704##
Luiz Capitulinode0b36b2011-09-21 16:38:35 -0300705# @CpuInfo:
706#
707# Information about a virtual CPU
708#
709# @CPU: the index of the virtual CPU
710#
711# @current: this only exists for backwards compatible and should be ignored
Laszlo Ersekb80e5602012-07-17 16:17:10 +0200712#
Luiz Capitulinode0b36b2011-09-21 16:38:35 -0300713# @halted: true if the virtual CPU is in the halt state. Halt usually refers
714# to a processor specific low power mode.
715#
716# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
717# pointer.
718# If the target is Sparc, this is the PC component of the
719# instruction pointer.
720#
721# @nip: #optional If the target is PPC, the instruction pointer
722#
723# @npc: #optional If the target is Sparc, the NPC component of the instruction
724# pointer
725#
726# @PC: #optional If the target is MIPS, the instruction pointer
727#
728# @thread_id: ID of the underlying host thread
729#
730# Since: 0.14.0
731#
732# Notes: @halted is a transient state that changes frequently. By the time the
733# data is sent to the client, the guest may no longer be halted.
734##
735{ 'type': 'CpuInfo',
736 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
737 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
738
739##
740# @query-cpus:
741#
742# Returns a list of information about each virtual CPU.
743#
744# Returns: a list of @CpuInfo for each virtual CPU
745#
746# Since: 0.14.0
747##
748{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
749
750##
Luiz Capitulinob2023812011-09-21 17:16:47 -0300751# @BlockDeviceInfo:
752#
753# Information about the backing device for a block device.
754#
755# @file: the filename of the backing device
756#
757# @ro: true if the backing device was open read-only
758#
759# @drv: the name of the block format used to open the backing device. As of
760# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
761# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
762# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
763# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
764#
765# @backing_file: #optional the name of the backing file (for copy-on-write)
766#
Benoît Canet2e3e3312012-08-02 10:22:48 +0200767# @backing_file_depth: number of files in the backing file chain (since: 1.2)
768#
Luiz Capitulinob2023812011-09-21 17:16:47 -0300769# @encrypted: true if the backing device is encrypted
770#
Luiz Capitulinoc75a1a82012-07-26 20:28:44 -0300771# @encryption_key_missing: true if the backing device is encrypted but an
772# valid encryption key is missing
773#
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800774# @bps: total throughput limit in bytes per second is specified
775#
776# @bps_rd: read throughput limit in bytes per second is specified
777#
778# @bps_wr: write throughput limit in bytes per second is specified
779#
780# @iops: total I/O operations per second is specified
781#
782# @iops_rd: read I/O operations per second is specified
783#
784# @iops_wr: write I/O operations per second is specified
785#
Wenchao Xia553a7e82013-06-06 12:27:59 +0800786# @image: the info of image used (since: 1.6)
787#
Benoît Canet3e9fab62013-09-02 14:14:40 +0200788# @bps_max: #optional total max in bytes (Since 1.7)
789#
790# @bps_rd_max: #optional read max in bytes (Since 1.7)
791#
792# @bps_wr_max: #optional write max in bytes (Since 1.7)
793#
794# @iops_max: #optional total I/O operations max (Since 1.7)
795#
796# @iops_rd_max: #optional read I/O operations max (Since 1.7)
797#
798# @iops_wr_max: #optional write I/O operations max (Since 1.7)
799#
Benoît Canet2024c1d2013-09-02 14:14:41 +0200800# @iops_size: #optional an I/O size in bytes (Since 1.7)
801#
Luiz Capitulinob2023812011-09-21 17:16:47 -0300802# Since: 0.14.0
803#
804# Notes: This interface is only found in @BlockInfo.
805##
806{ 'type': 'BlockDeviceInfo',
807 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
Benoît Canet2e3e3312012-08-02 10:22:48 +0200808 '*backing_file': 'str', 'backing_file_depth': 'int',
Luiz Capitulinoc75a1a82012-07-26 20:28:44 -0300809 'encrypted': 'bool', 'encryption_key_missing': 'bool',
810 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
Wenchao Xia553a7e82013-06-06 12:27:59 +0800811 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
Benoît Canet3e9fab62013-09-02 14:14:40 +0200812 'image': 'ImageInfo',
813 '*bps_max': 'int', '*bps_rd_max': 'int',
814 '*bps_wr_max': 'int', '*iops_max': 'int',
Benoît Canet2024c1d2013-09-02 14:14:41 +0200815 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
816 '*iops_size': 'int' } }
Luiz Capitulinob2023812011-09-21 17:16:47 -0300817
818##
819# @BlockDeviceIoStatus:
820#
821# An enumeration of block device I/O status.
822#
823# @ok: The last I/O operation has succeeded
824#
825# @failed: The last I/O operation has failed
826#
827# @nospace: The last I/O operation has failed due to a no-space condition
828#
829# Since: 1.0
830##
831{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
832
833##
Paolo Bonzinifacd6e22013-09-04 19:00:34 +0200834# @BlockDeviceMapEntry:
835#
836# Entry in the metadata map of the device (returned by "qemu-img map")
837#
838# @start: Offset in the image of the first byte described by this entry
839# (in bytes)
840#
841# @length: Length of the range described by this entry (in bytes)
842#
843# @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
844# before reaching one for which the range is allocated. The value is
845# in the range 0 to the depth of the image chain - 1.
846#
847# @zero: the sectors in this range read as zeros
848#
849# @data: reading the image will actually read data from a file (in particular,
850# if @offset is present this means that the sectors are not simply
851# preallocated, but contain actual data in raw format)
852#
853# @offset: if present, the image file stores the data for this range in
854# raw format at the given offset.
855#
856# Since 1.7
857##
858{ 'type': 'BlockDeviceMapEntry',
859 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
860 'data': 'bool', '*offset': 'int' } }
861
862##
Paolo Bonzinib9a9b3a2012-08-01 15:23:44 +0200863# @BlockDirtyInfo:
864#
865# Block dirty bitmap information.
866#
867# @count: number of dirty bytes according to the dirty bitmap
868#
Paolo Bonzini50717e92013-01-21 17:09:45 +0100869# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
870#
Paolo Bonzinib9a9b3a2012-08-01 15:23:44 +0200871# Since: 1.3
872##
873{ 'type': 'BlockDirtyInfo',
Paolo Bonzini50717e92013-01-21 17:09:45 +0100874 'data': {'count': 'int', 'granularity': 'int'} }
Paolo Bonzinib9a9b3a2012-08-01 15:23:44 +0200875
876##
Luiz Capitulinob2023812011-09-21 17:16:47 -0300877# @BlockInfo:
878#
879# Block device information. This structure describes a virtual device and
880# the backing device associated with it.
881#
882# @device: The device name associated with the virtual device.
883#
884# @type: This field is returned only for compatibility reasons, it should
885# not be used (always returns 'unknown')
886#
887# @removable: True if the device supports removable media.
888#
889# @locked: True if the guest has locked this device from having its media
890# removed
891#
892# @tray_open: #optional True if the device has a tray and it is open
893# (only present if removable is true)
894#
Paolo Bonzinib9a9b3a2012-08-01 15:23:44 +0200895# @dirty: #optional dirty bitmap information (only present if the dirty
896# bitmap is enabled)
897#
Luiz Capitulinob2023812011-09-21 17:16:47 -0300898# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
899# supports it and the VM is configured to stop on errors
900#
901# @inserted: #optional @BlockDeviceInfo describing the device if media is
902# present
903#
904# Since: 0.14.0
905##
906{ 'type': 'BlockInfo',
907 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
908 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
Paolo Bonzinib9a9b3a2012-08-01 15:23:44 +0200909 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
910 '*dirty': 'BlockDirtyInfo' } }
Luiz Capitulinob2023812011-09-21 17:16:47 -0300911
912##
913# @query-block:
914#
915# Get a list of BlockInfo for all virtual block devices.
916#
917# Returns: a list of @BlockInfo describing each virtual block device
918#
919# Since: 0.14.0
920##
921{ 'command': 'query-block', 'returns': ['BlockInfo'] }
922
923##
Luiz Capitulinof11f57e2011-09-22 15:56:36 -0300924# @BlockDeviceStats:
925#
926# Statistics of a virtual block device or a block backing device.
927#
928# @rd_bytes: The number of bytes read by the device.
929#
930# @wr_bytes: The number of bytes written by the device.
931#
932# @rd_operations: The number of read operations performed by the device.
933#
934# @wr_operations: The number of write operations performed by the device.
935#
936# @flush_operations: The number of cache flush operations performed by the
937# device (since 0.15.0)
938#
939# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
940# (since 0.15.0).
941#
942# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
943#
944# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
945#
946# @wr_highest_offset: The offset after the greatest byte written to the
947# device. The intended use of this information is for
948# growable sparse files (like qcow2) that are used on top
949# of a physical device.
950#
951# Since: 0.14.0
952##
953{ 'type': 'BlockDeviceStats',
954 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
955 'wr_operations': 'int', 'flush_operations': 'int',
956 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
957 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
958
959##
960# @BlockStats:
961#
962# Statistics of a virtual block device or a block backing device.
963#
964# @device: #optional If the stats are for a virtual block device, the name
965# corresponding to the virtual block device.
966#
967# @stats: A @BlockDeviceStats for the device.
968#
969# @parent: #optional This may point to the backing block device if this is a
970# a virtual block device. If it's a backing block, this will point
971# to the backing file is one is present.
972#
973# Since: 0.14.0
974##
975{ 'type': 'BlockStats',
976 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
977 '*parent': 'BlockStats'} }
978
979##
980# @query-blockstats:
981#
982# Query the @BlockStats for all virtual block devices.
983#
984# Returns: A list of @BlockStats for each virtual block devices.
985#
986# Since: 0.14.0
987##
988{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
989
990##
Luiz Capitulino2b54aa82011-10-17 16:41:22 -0200991# @VncClientInfo:
992#
993# Information about a connected VNC client.
994#
995# @host: The host name of the client. QEMU tries to resolve this to a DNS name
996# when possible.
997#
998# @family: 'ipv6' if the client is connected via IPv6 and TCP
999# 'ipv4' if the client is connected via IPv4 and TCP
1000# 'unix' if the client is connected via a unix domain socket
1001# 'unknown' otherwise
1002#
1003# @service: The service name of the client's port. This may depends on the
1004# host system's service database so symbolic names should not be
1005# relied on.
1006#
1007# @x509_dname: #optional If x509 authentication is in use, the Distinguished
1008# Name of the client.
1009#
1010# @sasl_username: #optional If SASL authentication is in use, the SASL username
1011# used for authentication.
1012#
1013# Since: 0.14.0
1014##
1015{ 'type': 'VncClientInfo',
1016 'data': {'host': 'str', 'family': 'str', 'service': 'str',
1017 '*x509_dname': 'str', '*sasl_username': 'str'} }
1018
1019##
1020# @VncInfo:
1021#
1022# Information about the VNC session.
1023#
1024# @enabled: true if the VNC server is enabled, false otherwise
1025#
1026# @host: #optional The hostname the VNC server is bound to. This depends on
1027# the name resolution on the host and may be an IP address.
1028#
1029# @family: #optional 'ipv6' if the host is listening for IPv6 connections
1030# 'ipv4' if the host is listening for IPv4 connections
1031# 'unix' if the host is listening on a unix domain socket
1032# 'unknown' otherwise
1033#
1034# @service: #optional The service name of the server's port. This may depends
1035# on the host system's service database so symbolic names should not
1036# be relied on.
1037#
1038# @auth: #optional the current authentication type used by the server
1039# 'none' if no authentication is being used
1040# 'vnc' if VNC authentication is being used
1041# 'vencrypt+plain' if VEncrypt is used with plain text authentication
1042# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1043# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1044# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1045# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1046# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1047# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1048# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1049# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1050#
1051# @clients: a list of @VncClientInfo of all currently connected clients
1052#
1053# Since: 0.14.0
1054##
1055{ 'type': 'VncInfo',
1056 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1057 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1058
1059##
1060# @query-vnc:
1061#
1062# Returns information about the current VNC server
1063#
1064# Returns: @VncInfo
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02001065#
1066# Since: 0.14.0
1067##
1068{ 'command': 'query-vnc', 'returns': 'VncInfo' }
1069
1070##
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001071# @SpiceChannel
1072#
1073# Information about a SPICE client channel.
1074#
1075# @host: The host name of the client. QEMU tries to resolve this to a DNS name
1076# when possible.
1077#
1078# @family: 'ipv6' if the client is connected via IPv6 and TCP
1079# 'ipv4' if the client is connected via IPv4 and TCP
1080# 'unix' if the client is connected via a unix domain socket
1081# 'unknown' otherwise
1082#
1083# @port: The client's port number.
1084#
1085# @connection-id: SPICE connection id number. All channels with the same id
1086# belong to the same SPICE session.
1087#
Alon Levy419e1bd2012-03-05 15:13:27 +02001088# @connection-type: SPICE channel type number. "1" is the main control
1089# channel, filter for this one if you want to track spice
1090# sessions only
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001091#
Alon Levy419e1bd2012-03-05 15:13:27 +02001092# @channel-id: SPICE channel ID number. Usually "0", might be different when
1093# multiple channels of the same type exist, such as multiple
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001094# display channels in a multihead setup
1095#
1096# @tls: true if the channel is encrypted, false otherwise.
1097#
1098# Since: 0.14.0
1099##
1100{ 'type': 'SpiceChannel',
1101 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1102 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1103 'tls': 'bool'} }
1104
1105##
Alon Levy4efee022012-03-29 23:23:14 +02001106# @SpiceQueryMouseMode
1107#
Lei Li6932a692012-08-23 13:14:25 +08001108# An enumeration of Spice mouse states.
Alon Levy4efee022012-03-29 23:23:14 +02001109#
1110# @client: Mouse cursor position is determined by the client.
1111#
1112# @server: Mouse cursor position is determined by the server.
1113#
1114# @unknown: No information is available about mouse mode used by
1115# the spice server.
1116#
1117# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1118#
1119# Since: 1.1
1120##
1121{ 'enum': 'SpiceQueryMouseMode',
1122 'data': [ 'client', 'server', 'unknown' ] }
1123
1124##
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001125# @SpiceInfo
1126#
1127# Information about the SPICE session.
Laszlo Ersekb80e5602012-07-17 16:17:10 +02001128#
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001129# @enabled: true if the SPICE server is enabled, false otherwise
1130#
Yonit Halperin61c4efe2012-08-21 11:51:58 +03001131# @migrated: true if the last guest migration completed and spice
1132# migration had completed as well. false otherwise.
1133#
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001134# @host: #optional The hostname the SPICE server is bound to. This depends on
1135# the name resolution on the host and may be an IP address.
1136#
1137# @port: #optional The SPICE server's port number.
1138#
1139# @compiled-version: #optional SPICE server version.
1140#
1141# @tls-port: #optional The SPICE server's TLS port number.
1142#
1143# @auth: #optional the current authentication type used by the server
Alon Levy419e1bd2012-03-05 15:13:27 +02001144# 'none' if no authentication is being used
1145# 'spice' uses SASL or direct TLS authentication, depending on command
1146# line options
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001147#
Alon Levy4efee022012-03-29 23:23:14 +02001148# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1149# be determined by the client or the server, or unknown if spice
1150# server doesn't provide this information.
1151#
1152# Since: 1.1
1153#
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001154# @channels: a list of @SpiceChannel for each active spice channel
1155#
1156# Since: 0.14.0
1157##
1158{ 'type': 'SpiceInfo',
Yonit Halperin61c4efe2012-08-21 11:51:58 +03001159 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001160 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
Alon Levy4efee022012-03-29 23:23:14 +02001161 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001162
1163##
1164# @query-spice
1165#
1166# Returns information about the current SPICE server
1167#
1168# Returns: @SpiceInfo
1169#
1170# Since: 0.14.0
1171##
1172{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
1173
1174##
Luiz Capitulino96637bc2011-10-21 11:41:37 -02001175# @BalloonInfo:
1176#
1177# Information about the guest balloon device.
1178#
1179# @actual: the number of bytes the balloon currently contains
1180#
Luiz Capitulino96637bc2011-10-21 11:41:37 -02001181# Since: 0.14.0
1182#
Luiz Capitulino96637bc2011-10-21 11:41:37 -02001183##
Luiz Capitulino01ceb972012-12-03 15:56:41 -02001184{ 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
Luiz Capitulino96637bc2011-10-21 11:41:37 -02001185
1186##
1187# @query-balloon:
1188#
1189# Return information about the balloon device.
1190#
1191# Returns: @BalloonInfo on success
1192# If the balloon driver is enabled but not functional because the KVM
1193# kernel module cannot support it, KvmMissingCap
1194# If no balloon device is present, DeviceNotActive
1195#
1196# Since: 0.14.0
1197##
1198{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1199
1200##
Luiz Capitulino79627472011-10-21 14:15:33 -02001201# @PciMemoryRange:
1202#
1203# A PCI device memory region
1204#
1205# @base: the starting address (guest physical)
1206#
1207# @limit: the ending address (guest physical)
1208#
1209# Since: 0.14.0
1210##
1211{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1212
1213##
1214# @PciMemoryRegion
1215#
1216# Information about a PCI device I/O region.
1217#
1218# @bar: the index of the Base Address Register for this region
1219#
1220# @type: 'io' if the region is a PIO region
1221# 'memory' if the region is a MMIO region
1222#
1223# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1224#
1225# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1226#
1227# Since: 0.14.0
1228##
1229{ 'type': 'PciMemoryRegion',
1230 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1231 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1232
1233##
1234# @PciBridgeInfo:
1235#
1236# Information about a PCI Bridge device
1237#
1238# @bus.number: primary bus interface number. This should be the number of the
1239# bus the device resides on.
1240#
1241# @bus.secondary: secondary bus interface number. This is the number of the
1242# main bus for the bridge
1243#
1244# @bus.subordinate: This is the highest number bus that resides below the
1245# bridge.
1246#
1247# @bus.io_range: The PIO range for all devices on this bridge
1248#
1249# @bus.memory_range: The MMIO range for all devices on this bridge
1250#
1251# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1252# this bridge
1253#
1254# @devices: a list of @PciDeviceInfo for each device on this bridge
1255#
1256# Since: 0.14.0
1257##
1258{ 'type': 'PciBridgeInfo',
1259 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1260 'io_range': 'PciMemoryRange',
1261 'memory_range': 'PciMemoryRange',
1262 'prefetchable_range': 'PciMemoryRange' },
1263 '*devices': ['PciDeviceInfo']} }
1264
1265##
1266# @PciDeviceInfo:
1267#
1268# Information about a PCI device
1269#
1270# @bus: the bus number of the device
1271#
1272# @slot: the slot the device is located in
1273#
1274# @function: the function of the slot used by the device
1275#
1276# @class_info.desc: #optional a string description of the device's class
1277#
1278# @class_info.class: the class code of the device
1279#
1280# @id.device: the PCI device id
1281#
1282# @id.vendor: the PCI vendor id
1283#
1284# @irq: #optional if an IRQ is assigned to the device, the IRQ number
1285#
1286# @qdev_id: the device name of the PCI device
1287#
1288# @pci_bridge: if the device is a PCI bridge, the bridge information
1289#
1290# @regions: a list of the PCI I/O regions associated with the device
1291#
1292# Notes: the contents of @class_info.desc are not stable and should only be
1293# treated as informational.
1294#
1295# Since: 0.14.0
1296##
1297{ 'type': 'PciDeviceInfo',
1298 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1299 'class_info': {'*desc': 'str', 'class': 'int'},
1300 'id': {'device': 'int', 'vendor': 'int'},
1301 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1302 'regions': ['PciMemoryRegion']} }
1303
1304##
1305# @PciInfo:
1306#
1307# Information about a PCI bus
1308#
1309# @bus: the bus index
1310#
1311# @devices: a list of devices on this bus
1312#
1313# Since: 0.14.0
1314##
1315{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1316
1317##
1318# @query-pci:
1319#
1320# Return information about the PCI bus topology of the guest.
1321#
1322# Returns: a list of @PciInfo for each PCI bus
1323#
1324# Since: 0.14.0
1325##
1326{ 'command': 'query-pci', 'returns': ['PciInfo'] }
1327
1328##
Paolo Bonzini92aa5c62012-09-28 17:22:55 +02001329# @BlockdevOnError:
1330#
1331# An enumeration of possible behaviors for errors on I/O operations.
1332# The exact meaning depends on whether the I/O was initiated by a guest
1333# or by a block job
1334#
1335# @report: for guest operations, report the error to the guest;
1336# for jobs, cancel the job
1337#
1338# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1339# or BLOCK_JOB_ERROR)
1340#
1341# @enospc: same as @stop on ENOSPC, same as @report otherwise.
1342#
1343# @stop: for guest operations, stop the virtual machine;
1344# for jobs, pause the job
1345#
1346# Since: 1.3
1347##
1348{ 'enum': 'BlockdevOnError',
1349 'data': ['report', 'ignore', 'enospc', 'stop'] }
1350
1351##
Paolo Bonzini893f7eb2012-10-18 16:49:23 +02001352# @MirrorSyncMode:
1353#
1354# An enumeration of possible behaviors for the initial synchronization
1355# phase of storage mirroring.
1356#
1357# @top: copies data in the topmost image to the destination
1358#
1359# @full: copies data from all images to the destination
1360#
1361# @none: only copy data written from now on
1362#
1363# Since: 1.3
1364##
1365{ 'enum': 'MirrorSyncMode',
1366 'data': ['top', 'full', 'none'] }
1367
1368##
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00001369# @BlockJobInfo:
1370#
1371# Information about a long-running block device operation.
1372#
1373# @type: the job type ('stream' for image streaming)
1374#
1375# @device: the block device name
1376#
1377# @len: the maximum progress value
1378#
Paolo Bonzini8d658832012-09-28 17:22:49 +02001379# @busy: false if the job is known to be in a quiescent state, with
1380# no pending I/O. Since 1.3.
1381#
Paolo Bonzini8acc72a2012-09-28 17:22:50 +02001382# @paused: whether the job is paused or, if @busy is true, will
1383# pause itself as soon as possible. Since 1.3.
1384#
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00001385# @offset: the current progress value
1386#
1387# @speed: the rate limit, bytes per second
1388#
Paolo Bonzini32c81a42012-09-28 17:22:58 +02001389# @io-status: the status of the job (since 1.3)
1390#
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00001391# Since: 1.1
1392##
1393{ 'type': 'BlockJobInfo',
1394 'data': {'type': 'str', 'device': 'str', 'len': 'int',
Paolo Bonzini32c81a42012-09-28 17:22:58 +02001395 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1396 'io-status': 'BlockDeviceIoStatus'} }
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00001397
1398##
1399# @query-block-jobs:
1400#
1401# Return information about long-running block device operations.
1402#
1403# Returns: a list of @BlockJobInfo for each active block job
1404#
1405# Since: 1.1
1406##
1407{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1408
1409##
Luiz Capitulino7a7f3252011-09-15 14:20:28 -03001410# @quit:
1411#
1412# This command will cause the QEMU process to exit gracefully. While every
1413# attempt is made to send the QMP response before terminating, this is not
1414# guaranteed. When using this interface, a premature EOF would not be
1415# unexpected.
1416#
1417# Since: 0.14.0
1418##
1419{ 'command': 'quit' }
Luiz Capitulino5f158f22011-09-15 14:34:39 -03001420
1421##
1422# @stop:
1423#
1424# Stop all guest VCPU execution.
1425#
1426# Since: 0.14.0
1427#
1428# Notes: This function will succeed even if the guest is already in the stopped
Paolo Bonzini1e998142012-10-23 14:54:21 +02001429# state. In "inmigrate" state, it will ensure that the guest
1430# remains paused once migration finishes, as if the -S option was
1431# passed on the command line.
Luiz Capitulino5f158f22011-09-15 14:34:39 -03001432##
1433{ 'command': 'stop' }
Luiz Capitulino38d22652011-09-15 14:41:46 -03001434
1435##
1436# @system_reset:
1437#
1438# Performs a hard reset of a guest.
1439#
1440# Since: 0.14.0
1441##
1442{ 'command': 'system_reset' }
Luiz Capitulino5bc465e2011-09-28 11:06:15 -03001443
1444##
1445# @system_powerdown:
1446#
1447# Requests that a guest perform a powerdown operation.
1448#
1449# Since: 0.14.0
1450#
1451# Notes: A guest may or may not respond to this command. This command
1452# returning does not indicate that a guest has accepted the request or
1453# that it has shut down. Many guests will respond to this command by
1454# prompting the user in some way.
1455##
1456{ 'command': 'system_powerdown' }
Luiz Capitulino755f1962011-10-06 14:31:39 -03001457
1458##
1459# @cpu:
1460#
1461# This command is a nop that is only provided for the purposes of compatibility.
1462#
1463# Since: 0.14.0
1464#
1465# Notes: Do not use this command.
1466##
1467{ 'command': 'cpu', 'data': {'index': 'int'} }
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -02001468
1469##
Igor Mammedov69ca3ea2013-04-30 15:41:25 +02001470# @cpu-add
1471#
1472# Adds CPU with specified ID
1473#
1474# @id: ID of CPU to be created, valid values [0..max_cpus)
1475#
1476# Returns: Nothing on success
1477#
1478# Since 1.5
1479##
1480{ 'command': 'cpu-add', 'data': {'id': 'int'} }
1481
1482##
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -02001483# @memsave:
1484#
1485# Save a portion of guest memory to a file.
1486#
1487# @val: the virtual address of the guest to start from
1488#
1489# @size: the size of memory region to save
1490#
1491# @filename: the file to save the memory to as binary data
1492#
1493# @cpu-index: #optional the index of the virtual CPU to use for translating the
1494# virtual address (defaults to CPU 0)
1495#
1496# Returns: Nothing on success
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -02001497#
1498# Since: 0.14.0
1499#
1500# Notes: Errors were not reliably returned until 1.1
1501##
1502{ 'command': 'memsave',
1503 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
Luiz Capitulino6d3962b2011-11-22 17:26:46 -02001504
1505##
1506# @pmemsave:
1507#
1508# Save a portion of guest physical memory to a file.
1509#
1510# @val: the physical address of the guest to start from
1511#
1512# @size: the size of memory region to save
1513#
1514# @filename: the file to save the memory to as binary data
1515#
1516# Returns: Nothing on success
Luiz Capitulino6d3962b2011-11-22 17:26:46 -02001517#
1518# Since: 0.14.0
1519#
1520# Notes: Errors were not reliably returned until 1.1
1521##
1522{ 'command': 'pmemsave',
1523 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
Luiz Capitulinoe42e8182011-11-22 17:58:31 -02001524
1525##
1526# @cont:
1527#
1528# Resume guest VCPU execution.
1529#
1530# Since: 0.14.0
1531#
1532# Returns: If successful, nothing
Luiz Capitulinoe42e8182011-11-22 17:58:31 -02001533# If QEMU was started with an encrypted block device and a key has
1534# not yet been set, DeviceEncrypted.
1535#
Paolo Bonzini1e998142012-10-23 14:54:21 +02001536# Notes: This command will succeed if the guest is currently running. It
1537# will also succeed if the guest is in the "inmigrate" state; in
1538# this case, the effect of the command is to make sure the guest
1539# starts once migration finishes, removing the effect of the -S
1540# command line option if it was passed.
Luiz Capitulinoe42e8182011-11-22 17:58:31 -02001541##
1542{ 'command': 'cont' }
1543
Luiz Capitulinoab49ab52011-11-23 12:55:53 -02001544##
Gerd Hoffmann9b9df252012-02-23 13:45:21 +01001545# @system_wakeup:
1546#
1547# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1548#
1549# Since: 1.1
1550#
1551# Returns: nothing.
1552##
1553{ 'command': 'system_wakeup' }
1554
1555##
Luiz Capitulinoab49ab52011-11-23 12:55:53 -02001556# @inject-nmi:
1557#
1558# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1559#
1560# Returns: If successful, nothing
Luiz Capitulinoab49ab52011-11-23 12:55:53 -02001561#
1562# Since: 0.14.0
1563#
1564# Notes: Only x86 Virtual Machines support this command.
1565##
1566{ 'command': 'inject-nmi' }
Luiz Capitulino4b371562011-11-23 13:11:55 -02001567
1568##
1569# @set_link:
1570#
1571# Sets the link status of a virtual network adapter.
1572#
1573# @name: the device name of the virtual network adapter
1574#
1575# @up: true to set the link status to be up
1576#
1577# Returns: Nothing on success
1578# If @name is not a valid network device, DeviceNotFound
1579#
1580# Since: 0.14.0
1581#
1582# Notes: Not all network adapters support setting link status. This command
1583# will succeed even if the network adapter does not support link status
1584# notification.
1585##
1586{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -02001587
1588##
1589# @block_passwd:
1590#
1591# This command sets the password of a block device that has not been open
1592# with a password and requires one.
1593#
1594# The two cases where this can happen are a block device is created through
1595# QEMU's initial command line or a block device is changed through the legacy
1596# @change interface.
1597#
1598# In the event that the block device is created through the initial command
1599# line, the VM will start in the stopped state regardless of whether '-S' is
1600# used. The intention is for a management tool to query the block devices to
1601# determine which ones are encrypted, set the passwords with this command, and
1602# then start the guest with the @cont command.
1603#
1604# @device: the name of the device to set the password on
1605#
1606# @password: the password to use for the device
1607#
1608# Returns: nothing on success
1609# If @device is not a valid block device, DeviceNotFound
1610# If @device is not encrypted, DeviceNotEncrypted
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -02001611#
1612# Notes: Not all block formats support encryption and some that do are not
1613# able to validate that a password is correct. Disk corruption may
1614# occur if an invalid password is specified.
1615#
1616# Since: 0.14.0
1617##
1618{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
Luiz Capitulinod72f3262011-11-25 14:38:09 -02001619
1620##
1621# @balloon:
1622#
1623# Request the balloon driver to change its balloon size.
1624#
1625# @value: the target size of the balloon in bytes
1626#
1627# Returns: Nothing on success
1628# If the balloon driver is enabled but not functional because the KVM
1629# kernel module cannot support it, KvmMissingCap
1630# If no balloon device is present, DeviceNotActive
1631#
1632# Notes: This command just issues a request to the guest. When it returns,
1633# the balloon size may not have changed. A guest can change the balloon
1634# size independent of this command.
1635#
1636# Since: 0.14.0
1637##
1638{ 'command': 'balloon', 'data': {'value': 'int'} }
Luiz Capitulino5e7caac2011-11-25 14:57:10 -02001639
1640##
1641# @block_resize
1642#
1643# Resize a block image while a guest is running.
1644#
1645# @device: the name of the device to get the image resized
1646#
1647# @size: new image size in bytes
1648#
1649# Returns: nothing on success
1650# If @device is not a valid block device, DeviceNotFound
Luiz Capitulino5e7caac2011-11-25 14:57:10 -02001651#
1652# Since: 0.14.0
1653##
1654{ 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
Luiz Capitulino6106e242011-11-25 16:15:19 -02001655
1656##
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001657# @NewImageMode
1658#
1659# An enumeration that tells QEMU how to set the backing file path in
1660# a new image file.
1661#
1662# @existing: QEMU should look for an existing image file.
1663#
1664# @absolute-paths: QEMU should create a new image with absolute paths
1665# for the backing file.
1666#
1667# Since: 1.1
1668##
Amos Kongad0f1712013-06-19 17:23:27 +08001669{ 'enum': 'NewImageMode',
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001670 'data': [ 'existing', 'absolute-paths' ] }
1671
1672##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001673# @BlockdevSnapshot
Jeff Cody8802d1f2012-02-28 15:54:06 -05001674#
1675# @device: the name of the device to generate the snapshot from.
1676#
1677# @snapshot-file: the target of the new image. A new file will be created.
1678#
1679# @format: #optional the format of the snapshot image, default is 'qcow2'.
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001680#
1681# @mode: #optional whether and how QEMU should create a new image, default is
Paolo Bonzini8bde9b62012-09-26 16:34:29 +02001682# 'absolute-paths'.
Jeff Cody8802d1f2012-02-28 15:54:06 -05001683##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001684{ 'type': 'BlockdevSnapshot',
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001685 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1686 '*mode': 'NewImageMode' } }
Jeff Cody8802d1f2012-02-28 15:54:06 -05001687
1688##
Wenchao Xiabbe86012013-09-11 14:04:34 +08001689# @BlockdevSnapshotInternal
1690#
1691# @device: the name of the device to generate the snapshot from
1692#
1693# @name: the name of the internal snapshot to be created
1694#
1695# Notes: In transaction, if @name is empty, or any snapshot matching @name
1696# exists, the operation will fail. Only some image formats support it,
1697# for example, qcow2, rbd, and sheepdog.
1698#
1699# Since: 1.7
1700##
1701{ 'type': 'BlockdevSnapshotInternal',
1702 'data': { 'device': 'str', 'name': 'str' } }
1703
1704##
Stefan Hajnoczi3037f362013-06-24 17:13:17 +02001705# @DriveBackup
1706#
1707# @device: the name of the device which should be copied.
1708#
1709# @target: the target of the new image. If the file exists, or if it
1710# is a device, the existing file/device will be used as the new
1711# destination. If it does not exist, a new file will be created.
1712#
1713# @format: #optional the format of the new destination, default is to
1714# probe if @mode is 'existing', else the format of the source
1715#
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001716# @sync: what parts of the disk image should be copied to the destination
1717# (all the disk, only the sectors allocated in the topmost image, or
1718# only new I/O).
1719#
Stefan Hajnoczi3037f362013-06-24 17:13:17 +02001720# @mode: #optional whether and how QEMU should create a new image, default is
1721# 'absolute-paths'.
1722#
1723# @speed: #optional the maximum speed, in bytes per second
1724#
1725# @on-source-error: #optional the action to take on an error on the source,
1726# default 'report'. 'stop' and 'enospc' can only be used
1727# if the block device supports io-status (see BlockInfo).
1728#
1729# @on-target-error: #optional the action to take on an error on the target,
1730# default 'report' (no limitations, since this applies to
1731# a different block device than @device).
1732#
1733# Note that @on-source-error and @on-target-error only affect background I/O.
1734# If an error occurs during a guest write request, the device's rerror/werror
1735# actions will be used.
1736#
1737# Since: 1.6
1738##
1739{ 'type': 'DriveBackup',
1740 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001741 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1742 '*speed': 'int',
Stefan Hajnoczi3037f362013-06-24 17:13:17 +02001743 '*on-source-error': 'BlockdevOnError',
1744 '*on-target-error': 'BlockdevOnError' } }
1745
1746##
Stefan Hajnoczi78b18b72013-06-24 17:13:18 +02001747# @Abort
1748#
1749# This action can be used to test transaction failure.
1750#
1751# Since: 1.6
1752###
1753{ 'type': 'Abort',
1754 'data': { } }
1755
1756##
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001757# @TransactionAction
Jeff Cody8802d1f2012-02-28 15:54:06 -05001758#
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001759# A discriminated record of operations that can be performed with
1760# @transaction.
1761##
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001762{ 'union': 'TransactionAction',
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001763 'data': {
Stefan Hajnoczi3037f362013-06-24 17:13:17 +02001764 'blockdev-snapshot-sync': 'BlockdevSnapshot',
Stefan Hajnoczi78b18b72013-06-24 17:13:18 +02001765 'drive-backup': 'DriveBackup',
Wenchao Xiabbe86012013-09-11 14:04:34 +08001766 'abort': 'Abort',
1767 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001768 } }
1769
1770##
1771# @transaction
1772#
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001773# Executes a number of transactionable QMP commands atomically. If any
1774# operation fails, then the entire set of actions will be abandoned and the
1775# appropriate error returned.
Jeff Cody8802d1f2012-02-28 15:54:06 -05001776#
1777# List of:
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001778# @TransactionAction: information needed for the respective operation
Jeff Cody8802d1f2012-02-28 15:54:06 -05001779#
1780# Returns: nothing on success
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001781# Errors depend on the operations of the transaction
Jeff Cody8802d1f2012-02-28 15:54:06 -05001782#
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001783# Note: The transaction aborts on the first failure. Therefore, there will be
1784# information on only one failed operation returned in an error condition, and
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001785# subsequent actions will not have been attempted.
1786#
1787# Since 1.1
Jeff Cody8802d1f2012-02-28 15:54:06 -05001788##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001789{ 'command': 'transaction',
Kevin Wolfc8a83e82013-05-13 10:43:43 +02001790 'data': { 'actions': [ 'TransactionAction' ] } }
Jeff Cody8802d1f2012-02-28 15:54:06 -05001791
1792##
Luiz Capitulino6106e242011-11-25 16:15:19 -02001793# @blockdev-snapshot-sync
1794#
1795# Generates a synchronous snapshot of a block device.
1796#
Kevin Wolf852ad1a2013-07-01 16:31:52 +02001797# For the arguments, see the documentation of BlockdevSnapshot.
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001798#
Luiz Capitulino6106e242011-11-25 16:15:19 -02001799# Returns: nothing on success
1800# If @device is not a valid block device, DeviceNotFound
Luiz Capitulino6106e242011-11-25 16:15:19 -02001801#
Luiz Capitulino6106e242011-11-25 16:15:19 -02001802# Since 0.14.0
1803##
1804{ 'command': 'blockdev-snapshot-sync',
Kevin Wolf852ad1a2013-07-01 16:31:52 +02001805 'data': 'BlockdevSnapshot' }
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02001806
1807##
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001808# @blockdev-snapshot-internal-sync
1809#
1810# Synchronously take an internal snapshot of a block device, when the format
1811# of the image used supports it.
1812#
1813# For the arguments, see the documentation of BlockdevSnapshotInternal.
1814#
1815# Returns: nothing on success
1816# If @device is not a valid block device, DeviceNotFound
1817# If any snapshot matching @name exists, or @name is empty,
1818# GenericError
1819# If the format of the image used does not support it,
1820# BlockFormatFeatureNotSupported
1821#
1822# Since 1.7
1823##
1824{ 'command': 'blockdev-snapshot-internal-sync',
1825 'data': 'BlockdevSnapshotInternal' }
1826
1827##
Wenchao Xia44e3e052013-09-11 14:04:36 +08001828# @blockdev-snapshot-delete-internal-sync
1829#
1830# Synchronously delete an internal snapshot of a block device, when the format
1831# of the image used support it. The snapshot is identified by name or id or
1832# both. One of the name or id is required. Return SnapshotInfo for the
1833# successfully deleted snapshot.
1834#
1835# @device: the name of the device to delete the snapshot from
1836#
1837# @id: optional the snapshot's ID to be deleted
1838#
1839# @name: optional the snapshot's name to be deleted
1840#
1841# Returns: SnapshotInfo on success
1842# If @device is not a valid block device, DeviceNotFound
1843# If snapshot not found, GenericError
1844# If the format of the image used does not support it,
1845# BlockFormatFeatureNotSupported
1846# If @id and @name are both not specified, GenericError
1847#
1848# Since 1.7
1849##
1850{ 'command': 'blockdev-snapshot-delete-internal-sync',
1851 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1852 'returns': 'SnapshotInfo' }
1853
1854##
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02001855# @human-monitor-command:
1856#
1857# Execute a command on the human monitor and return the output.
1858#
1859# @command-line: the command to execute in the human monitor
1860#
1861# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1862#
1863# Returns: the output of the command as a string
1864#
1865# Since: 0.14.0
1866#
1867# Notes: This command only exists as a stop-gap. It's use is highly
1868# discouraged. The semantics of this command are not guaranteed.
1869#
1870# Known limitations:
1871#
1872# o This command is stateless, this means that commands that depend
1873# on state information (such as getfd) might not work
1874#
1875# o Commands that prompt the user for data (eg. 'cont' when the block
1876# device is encrypted) don't currently work
1877##
1878{ 'command': 'human-monitor-command',
1879 'data': {'command-line': 'str', '*cpu-index': 'int'},
Laszlo Ersekb80e5602012-07-17 16:17:10 +02001880 'returns': 'str' }
Luiz Capitulino6cdedb02011-11-27 22:54:09 -02001881
1882##
Jeff Codyed61fc12012-09-27 13:29:16 -04001883# @block-commit
1884#
1885# Live commit of data from overlay image nodes into backing nodes - i.e.,
1886# writes data between 'top' and 'base' into 'base'.
1887#
1888# @device: the name of the device
1889#
1890# @base: #optional The file name of the backing image to write data into.
1891# If not specified, this is the deepest backing image
1892#
1893# @top: The file name of the backing image within the image chain,
1894# which contains the topmost data to be committed down.
1895# Note, the active layer as 'top' is currently unsupported.
1896#
1897# If top == base, that is an error.
1898#
1899#
1900# @speed: #optional the maximum speed, in bytes per second
1901#
1902# Returns: Nothing on success
1903# If commit or stream is already active on this device, DeviceInUse
1904# If @device does not exist, DeviceNotFound
1905# If image commit is not supported by this device, NotSupported
1906# If @base or @top is invalid, a generic error is returned
1907# If @top is the active layer, or omitted, a generic error is returned
1908# If @speed is invalid, InvalidParameter
1909#
1910# Since: 1.3
1911#
1912##
1913{ 'command': 'block-commit',
1914 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1915 '*speed': 'int' } }
1916
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001917##
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001918# @drive-backup
1919#
1920# Start a point-in-time copy of a block device to a new destination. The
1921# status of ongoing drive-backup operations can be checked with
1922# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1923# The operation can be stopped before it has completed using the
1924# block-job-cancel command.
1925#
Kevin Wolff53cae52013-07-09 10:05:35 +02001926# For the arguments, see the documentation of DriveBackup.
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001927#
1928# Returns: nothing on success
1929# If @device is not a valid block device, DeviceNotFound
1930#
1931# Since 1.6
1932##
Kevin Wolff53cae52013-07-09 10:05:35 +02001933{ 'command': 'drive-backup', 'data': 'DriveBackup' }
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001934
1935##
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001936# @drive-mirror
1937#
1938# Start mirroring a block device's writes to a new destination.
1939#
1940# @device: the name of the device whose writes should be mirrored.
1941#
1942# @target: the target of the new image. If the file exists, or if it
1943# is a device, the existing file/device will be used as the new
1944# destination. If it does not exist, a new file will be created.
1945#
1946# @format: #optional the format of the new destination, default is to
1947# probe if @mode is 'existing', else the format of the source
1948#
1949# @mode: #optional whether and how QEMU should create a new image, default is
1950# 'absolute-paths'.
1951#
1952# @speed: #optional the maximum speed, in bytes per second
1953#
1954# @sync: what parts of the disk image should be copied to the destination
1955# (all the disk, only the sectors allocated in the topmost image, or
1956# only new I/O).
1957#
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001958# @granularity: #optional granularity of the dirty bitmap, default is 64K
1959# if the image format doesn't have clusters, 4K if the clusters
1960# are smaller than that, else the cluster size. Must be a
1961# power of 2 between 512 and 64M (since 1.4).
1962#
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001963# @buf-size: #optional maximum amount of data in flight from source to
1964# target (since 1.4).
1965#
Paolo Bonzinib952b552012-10-18 16:49:28 +02001966# @on-source-error: #optional the action to take on an error on the source,
1967# default 'report'. 'stop' and 'enospc' can only be used
1968# if the block device supports io-status (see BlockInfo).
1969#
1970# @on-target-error: #optional the action to take on an error on the target,
1971# default 'report' (no limitations, since this applies to
1972# a different block device than @device).
1973#
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001974# Returns: nothing on success
1975# If @device is not a valid block device, DeviceNotFound
1976#
1977# Since 1.3
1978##
1979{ 'command': 'drive-mirror',
1980 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1981 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001982 '*speed': 'int', '*granularity': 'uint32',
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001983 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
Paolo Bonzinib952b552012-10-18 16:49:28 +02001984 '*on-target-error': 'BlockdevOnError' } }
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001985
1986##
Luiz Capitulino6cdedb02011-11-27 22:54:09 -02001987# @migrate_cancel
1988#
1989# Cancel the current executing migration process.
1990#
1991# Returns: nothing on success
1992#
1993# Notes: This command succeeds even if there is no migration process running.
1994#
1995# Since: 0.14.0
1996##
1997{ 'command': 'migrate_cancel' }
Luiz Capitulino4f0a9932011-11-27 23:18:01 -02001998
1999##
2000# @migrate_set_downtime
2001#
2002# Set maximum tolerated downtime for migration.
2003#
2004# @value: maximum downtime in seconds
2005#
2006# Returns: nothing on success
2007#
2008# Since: 0.14.0
2009##
2010{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
Luiz Capitulino3dc85382011-11-28 11:59:37 -02002011
2012##
2013# @migrate_set_speed
2014#
2015# Set maximum speed for migration.
2016#
2017# @value: maximum speed in bytes.
2018#
2019# Returns: nothing on success
2020#
2021# Notes: A value lesser than zero will be automatically round up to zero.
2022#
2023# Since: 0.14.0
2024##
2025{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002026
2027##
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +03002028# @migrate-set-cache-size
2029#
2030# Set XBZRLE cache size
2031#
2032# @value: cache size in bytes
2033#
2034# The size will be rounded down to the nearest power of 2.
2035# The cache size can be modified before and during ongoing migration
2036#
2037# Returns: nothing on success
2038#
2039# Since: 1.2
2040##
2041{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2042
2043##
2044# @query-migrate-cache-size
2045#
2046# query XBZRLE cache size
2047#
2048# Returns: XBZRLE cache size in bytes
2049#
2050# Since: 1.2
2051##
2052{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
2053
2054##
Alon Levyd03ee402012-03-05 15:13:28 +02002055# @ObjectPropertyInfo:
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002056#
2057# @name: the name of the property
2058#
2059# @type: the type of the property. This will typically come in one of four
2060# forms:
2061#
2062# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2063# These types are mapped to the appropriate JSON type.
2064#
2065# 2) A legacy type in the form 'legacy<subtype>' where subtype is the
2066# legacy qdev typename. These types are always treated as strings.
2067#
2068# 3) A child type in the form 'child<subtype>' where subtype is a qdev
2069# device type name. Child properties create the composition tree.
2070#
2071# 4) A link type in the form 'link<subtype>' where subtype is a qdev
2072# device type name. Link properties form the device model graph.
2073#
Anthony Liguori51920822012-08-10 11:04:10 -05002074# Since: 1.2
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002075##
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002076{ 'type': 'ObjectPropertyInfo',
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002077 'data': { 'name': 'str', 'type': 'str' } }
2078
2079##
2080# @qom-list:
2081#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002082# This command will list any properties of a object given a path in the object
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002083# model.
2084#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002085# @path: the path within the object model. See @qom-get for a description of
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002086# this parameter.
2087#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002088# Returns: a list of @ObjectPropertyInfo that describe the properties of the
2089# object.
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002090#
Anthony Liguori51920822012-08-10 11:04:10 -05002091# Since: 1.2
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002092##
2093{ 'command': 'qom-list',
2094 'data': { 'path': 'str' },
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002095 'returns': [ 'ObjectPropertyInfo' ] }
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002096
2097##
2098# @qom-get:
2099#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002100# This command will get a property from a object model path and return the
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002101# value.
2102#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002103# @path: The path within the object model. There are two forms of supported
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002104# paths--absolute and partial paths.
2105#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002106# Absolute paths are derived from the root object and can follow child<>
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002107# or link<> properties. Since they can follow link<> properties, they
2108# can be arbitrarily long. Absolute paths look like absolute filenames
2109# and are prefixed with a leading slash.
2110#
2111# Partial paths look like relative filenames. They do not begin
2112# with a prefix. The matching rules for partial paths are subtle but
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002113# designed to make specifying objects easy. At each level of the
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002114# composition tree, the partial path is matched as an absolute path.
2115# The first match is not returned. At least two matches are searched
2116# for. A successful result is only returned if only one match is
2117# found. If more than one match is found, a flag is return to
2118# indicate that the match was ambiguous.
2119#
2120# @property: The property name to read
2121#
2122# Returns: The property value. The type depends on the property type. legacy<>
2123# properties are returned as #str. child<> and link<> properties are
2124# returns as #str pathnames. All integer property types (u8, u16, etc)
2125# are returned as #int.
2126#
Anthony Liguori51920822012-08-10 11:04:10 -05002127# Since: 1.2
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002128##
2129{ 'command': 'qom-get',
2130 'data': { 'path': 'str', 'property': 'str' },
2131 'returns': 'visitor',
2132 'gen': 'no' }
2133
2134##
2135# @qom-set:
2136#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06002137# This command will set a property from a object model path.
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002138#
2139# @path: see @qom-get for a description of this parameter
2140#
2141# @property: the property name to set
2142#
2143# @value: a value who's type is appropriate for the property type. See @qom-get
2144# for a description of type mapping.
2145#
Anthony Liguori51920822012-08-10 11:04:10 -05002146# Since: 1.2
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002147##
2148{ 'command': 'qom-set',
2149 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2150 'gen': 'no' }
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02002151
2152##
2153# @set_password:
2154#
2155# Sets the password of a remote display session.
2156#
2157# @protocol: `vnc' to modify the VNC server password
2158# `spice' to modify the Spice server password
2159#
2160# @password: the new password
2161#
2162# @connected: #optional how to handle existing clients when changing the
Laszlo Ersekb80e5602012-07-17 16:17:10 +02002163# password. If nothing is specified, defaults to `keep'
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02002164# `fail' to fail the command if clients are connected
2165# `disconnect' to disconnect existing clients
2166# `keep' to maintain existing clients
2167#
2168# Returns: Nothing on success
2169# If Spice is not enabled, DeviceNotFound
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02002170#
2171# Since: 0.14.0
2172##
2173{ 'command': 'set_password',
2174 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
Luiz Capitulino9ad53722011-12-07 11:47:57 -02002175
2176##
2177# @expire_password:
2178#
2179# Expire the password of a remote display server.
2180#
2181# @protocol: the name of the remote display protocol `vnc' or `spice'
2182#
2183# @time: when to expire the password.
2184# `now' to expire the password immediately
2185# `never' to cancel password expiration
2186# `+INT' where INT is the number of seconds from now (integer)
2187# `INT' where INT is the absolute time in seconds
2188#
2189# Returns: Nothing on success
2190# If @protocol is `spice' and Spice is not active, DeviceNotFound
Luiz Capitulino9ad53722011-12-07 11:47:57 -02002191#
2192# Since: 0.14.0
2193#
2194# Notes: Time is relative to the server and currently there is no way to
2195# coordinate server time with client time. It is not recommended to
2196# use the absolute time version of the @time parameter unless you're
2197# sure you are on the same machine as the QEMU instance.
2198##
2199{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
Luiz Capitulinoc245b6a2011-12-07 16:02:36 -02002200
2201##
2202# @eject:
2203#
2204# Ejects a device from a removable drive.
2205#
2206# @device: The name of the device
2207#
2208# @force: @optional If true, eject regardless of whether the drive is locked.
2209# If not specified, the default value is false.
2210#
2211# Returns: Nothing on success
2212# If @device is not a valid block device, DeviceNotFound
Luiz Capitulinoc245b6a2011-12-07 16:02:36 -02002213#
2214# Notes: Ejecting a device will no media results in success
2215#
2216# Since: 0.14.0
2217##
2218{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
Luiz Capitulino270b2432011-12-08 11:45:55 -02002219
2220##
2221# @change-vnc-password:
2222#
2223# Change the VNC server password.
2224#
2225# @target: the new password to use with VNC authentication
2226#
2227# Since: 1.1
2228#
2229# Notes: An empty password in this command will set the password to the empty
2230# string. Existing clients are unaffected by executing this command.
2231##
2232{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
Luiz Capitulino333a96e2011-12-08 11:13:50 -02002233
2234##
2235# @change:
2236#
2237# This command is multiple commands multiplexed together.
2238#
2239# @device: This is normally the name of a block device but it may also be 'vnc'.
2240# when it's 'vnc', then sub command depends on @target
2241#
2242# @target: If @device is a block device, then this is the new filename.
2243# If @device is 'vnc', then if the value 'password' selects the vnc
2244# change password command. Otherwise, this specifies a new server URI
2245# address to listen to for VNC connections.
2246#
2247# @arg: If @device is a block device, then this is an optional format to open
2248# the device with.
2249# If @device is 'vnc' and @target is 'password', this is the new VNC
2250# password to set. If this argument is an empty string, then no future
2251# logins will be allowed.
2252#
2253# Returns: Nothing on success.
2254# If @device is not a valid block device, DeviceNotFound
Luiz Capitulino333a96e2011-12-08 11:13:50 -02002255# If the new block device is encrypted, DeviceEncrypted. Note that
2256# if this error is returned, the device has been opened successfully
2257# and an additional call to @block_passwd is required to set the
2258# device's password. The behavior of reads and writes to the block
2259# device between when these calls are executed is undefined.
2260#
2261# Notes: It is strongly recommended that this interface is not used especially
2262# for changing block devices.
2263#
2264# Since: 0.14.0
2265##
2266{ 'command': 'change',
2267 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
Luiz Capitulino80047da2011-12-14 16:49:14 -02002268
2269##
2270# @block_set_io_throttle:
2271#
2272# Change I/O throttle limits for a block drive.
2273#
2274# @device: The name of the device
2275#
2276# @bps: total throughput limit in bytes per second
2277#
2278# @bps_rd: read throughput limit in bytes per second
2279#
2280# @bps_wr: write throughput limit in bytes per second
2281#
2282# @iops: total I/O operations per second
2283#
2284# @ops_rd: read I/O operations per second
2285#
2286# @iops_wr: write I/O operations per second
2287#
Benoît Canet3e9fab62013-09-02 14:14:40 +02002288# @bps_max: #optional total max in bytes (Since 1.7)
2289#
2290# @bps_rd_max: #optional read max in bytes (Since 1.7)
2291#
2292# @bps_wr_max: #optional write max in bytes (Since 1.7)
2293#
2294# @iops_max: #optional total I/O operations max (Since 1.7)
2295#
2296# @iops_rd_max: #optional read I/O operations max (Since 1.7)
2297#
2298# @iops_wr_max: #optional write I/O operations max (Since 1.7)
2299#
Benoît Canet2024c1d2013-09-02 14:14:41 +02002300# @iops_size: #optional an I/O size in bytes (Since 1.7)
2301#
Luiz Capitulino80047da2011-12-14 16:49:14 -02002302# Returns: Nothing on success
2303# If @device is not a valid block device, DeviceNotFound
Luiz Capitulino80047da2011-12-14 16:49:14 -02002304#
2305# Since: 1.1
Laszlo Ersekb80e5602012-07-17 16:17:10 +02002306##
Luiz Capitulino80047da2011-12-14 16:49:14 -02002307{ 'command': 'block_set_io_throttle',
2308 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
Benoît Canet3e9fab62013-09-02 14:14:40 +02002309 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2310 '*bps_max': 'int', '*bps_rd_max': 'int',
2311 '*bps_wr_max': 'int', '*iops_max': 'int',
Benoît Canet2024c1d2013-09-02 14:14:41 +02002312 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2313 '*iops_size': 'int' } }
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00002314
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01002315##
2316# @block-stream:
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00002317#
2318# Copy data from a backing file into a block device.
2319#
2320# The block streaming operation is performed in the background until the entire
2321# backing file has been copied. This command returns immediately once streaming
2322# has started. The status of ongoing block streaming operations can be checked
2323# with query-block-jobs. The operation can be stopped before it has completed
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01002324# using the block-job-cancel command.
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00002325#
2326# If a base file is specified then sectors are not copied from that base file and
2327# its backing chain. When streaming completes the image file will have the base
2328# file as its backing file. This can be used to stream a subset of the backing
2329# file chain instead of flattening the entire image.
2330#
2331# On successful completion the image file is updated to drop the backing file
2332# and the BLOCK_JOB_COMPLETED event is emitted.
2333#
2334# @device: the device name
2335#
2336# @base: #optional the common backing file name
2337#
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +01002338# @speed: #optional the maximum speed, in bytes per second
2339#
Paolo Bonzini1d809092012-09-28 17:22:59 +02002340# @on-error: #optional the action to take on an error (default report).
2341# 'stop' and 'enospc' can only be used if the block device
2342# supports io-status (see BlockInfo). Since 1.3.
2343#
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00002344# Returns: Nothing on success
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00002345# If @device does not exist, DeviceNotFound
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00002346#
2347# Since: 1.1
2348##
Paolo Bonzini1d809092012-09-28 17:22:59 +02002349{ 'command': 'block-stream',
2350 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2351 '*on-error': 'BlockdevOnError' } }
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00002352
2353##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01002354# @block-job-set-speed:
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00002355#
2356# Set maximum speed for a background block operation.
2357#
2358# This command can only be issued when there is an active block job.
2359#
2360# Throttling can be disabled by setting the speed to 0.
2361#
2362# @device: the device name
2363#
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +01002364# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2365# Defaults to 0.
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00002366#
2367# Returns: Nothing on success
Paolo Bonzini05290d82012-07-24 13:03:39 +02002368# If no background operation is active on this device, DeviceNotActive
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00002369#
2370# Since: 1.1
2371##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01002372{ 'command': 'block-job-set-speed',
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01002373 'data': { 'device': 'str', 'speed': 'int' } }
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002374
2375##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01002376# @block-job-cancel:
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002377#
Paolo Bonzini05290d82012-07-24 13:03:39 +02002378# Stop an active background block operation.
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002379#
Paolo Bonzini05290d82012-07-24 13:03:39 +02002380# This command returns immediately after marking the active background block
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002381# operation for cancellation. It is an error to call this command if no
2382# operation is in progress.
2383#
2384# The operation will cancel as soon as possible and then emit the
2385# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2386# enumerated using query-block-jobs.
2387#
Paolo Bonzini05290d82012-07-24 13:03:39 +02002388# For streaming, the image file retains its backing file unless the streaming
2389# operation happens to complete just as it is being cancelled. A new streaming
2390# operation can be started at a later time to finish copying all data from the
2391# backing file.
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002392#
2393# @device: the device name
2394#
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02002395# @force: #optional whether to allow cancellation of a paused job (default
2396# false). Since 1.3.
2397#
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002398# Returns: Nothing on success
Paolo Bonzini05290d82012-07-24 13:03:39 +02002399# If no background operation is active on this device, DeviceNotActive
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00002400#
2401# Since: 1.1
2402##
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02002403{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2404
2405##
2406# @block-job-pause:
2407#
2408# Pause an active background block operation.
2409#
2410# This command returns immediately after marking the active background block
2411# operation for pausing. It is an error to call this command if no
2412# operation is in progress. Pausing an already paused job has no cumulative
2413# effect; a single block-job-resume command will resume the job.
2414#
2415# The operation will pause as soon as possible. No event is emitted when
2416# the operation is actually paused. Cancelling a paused job automatically
2417# resumes it.
2418#
2419# @device: the device name
2420#
2421# Returns: Nothing on success
2422# If no background operation is active on this device, DeviceNotActive
2423#
2424# Since: 1.3
2425##
2426{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2427
2428##
2429# @block-job-resume:
2430#
2431# Resume an active background block operation.
2432#
2433# This command returns immediately after resuming a paused background block
2434# operation. It is an error to call this command if no operation is in
2435# progress. Resuming an already running job is not an error.
2436#
Paolo Bonzini32c81a42012-09-28 17:22:58 +02002437# This command also clears the error status of the job.
2438#
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02002439# @device: the device name
2440#
2441# Returns: Nothing on success
2442# If no background operation is active on this device, DeviceNotActive
2443#
2444# Since: 1.3
2445##
2446{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06002447
2448##
Paolo Bonziniaeae8832012-10-18 16:49:21 +02002449# @block-job-complete:
2450#
2451# Manually trigger completion of an active background block operation. This
2452# is supported for drive mirroring, where it also switches the device to
Paolo Bonzinia66a2a32012-07-23 15:15:47 +02002453# write to the target path only. The ability to complete is signaled with
2454# a BLOCK_JOB_READY event.
Paolo Bonziniaeae8832012-10-18 16:49:21 +02002455#
2456# This command completes an active background block operation synchronously.
2457# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2458# is not defined. Note that if an I/O error occurs during the processing of
2459# this command: 1) the command itself will fail; 2) the error will be processed
2460# according to the rerror/werror arguments that were specified when starting
2461# the operation.
2462#
2463# A cancelled or paused job cannot be completed.
2464#
2465# @device: the device name
2466#
2467# Returns: Nothing on success
2468# If no background operation is active on this device, DeviceNotActive
2469#
2470# Since: 1.3
2471##
2472{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2473
2474##
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06002475# @ObjectTypeInfo:
2476#
2477# This structure describes a search result from @qom-list-types
2478#
2479# @name: the type name found in the search
2480#
2481# Since: 1.1
2482#
2483# Notes: This command is experimental and may change syntax in future releases.
2484##
2485{ 'type': 'ObjectTypeInfo',
2486 'data': { 'name': 'str' } }
2487
2488##
2489# @qom-list-types:
2490#
2491# This command will return a list of types given search parameters
2492#
2493# @implements: if specified, only return types that implement this type name
2494#
2495# @abstract: if true, include abstract types in the results
2496#
2497# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2498#
2499# Since: 1.1
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06002500##
2501{ 'command': 'qom-list-types',
2502 'data': { '*implements': 'str', '*abstract': 'bool' },
2503 'returns': [ 'ObjectTypeInfo' ] }
Luiz Capitulinoe1c37d02011-12-05 14:48:01 -02002504
2505##
Anthony Liguori1daa31b2012-08-10 11:04:09 -05002506# @DevicePropertyInfo:
2507#
2508# Information about device properties.
2509#
2510# @name: the name of the property
2511# @type: the typename of the property
2512#
2513# Since: 1.2
2514##
2515{ 'type': 'DevicePropertyInfo',
2516 'data': { 'name': 'str', 'type': 'str' } }
2517
2518##
2519# @device-list-properties:
2520#
2521# List properties associated with a device.
2522#
2523# @typename: the type name of a device
2524#
2525# Returns: a list of DevicePropertyInfo describing a devices properties
2526#
2527# Since: 1.2
2528##
2529{ 'command': 'device-list-properties',
2530 'data': { 'typename': 'str'},
2531 'returns': [ 'DevicePropertyInfo' ] }
2532
2533##
Luiz Capitulinoe1c37d02011-12-05 14:48:01 -02002534# @migrate
2535#
2536# Migrates the current running guest to another Virtual Machine.
2537#
2538# @uri: the Uniform Resource Identifier of the destination VM
2539#
2540# @blk: #optional do block migration (full disk copy)
2541#
2542# @inc: #optional incremental disk copy migration
2543#
2544# @detach: this argument exists only for compatibility reasons and
2545# is ignored by QEMU
2546#
2547# Returns: nothing on success
2548#
2549# Since: 0.14.0
2550##
2551{ 'command': 'migrate',
2552 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
Anthony Liguori33cf6292012-03-19 13:39:42 -05002553
Stefano Stabellinia7ae8352012-01-25 12:24:51 +00002554# @xen-save-devices-state:
2555#
2556# Save the state of all devices to file. The RAM and the block devices
2557# of the VM are not saved by this command.
2558#
2559# @filename: the file to save the state of the devices to as binary
2560# data. See xen-save-devices-state.txt for a description of the binary
2561# format.
2562#
2563# Returns: Nothing on success
Stefano Stabellinia7ae8352012-01-25 12:24:51 +00002564#
2565# Since: 1.1
2566##
2567{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
Luiz Capitulinoa15fef22012-03-29 12:38:50 -03002568
2569##
Anthony PERARD39f42432012-10-03 13:48:19 +00002570# @xen-set-global-dirty-log
2571#
2572# Enable or disable the global dirty log mode.
2573#
2574# @enable: true to enable, false to disable.
2575#
2576# Returns: nothing
2577#
2578# Since: 1.3
2579##
2580{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2581
2582##
Luiz Capitulinoa15fef22012-03-29 12:38:50 -03002583# @device_del:
2584#
2585# Remove a device from a guest
2586#
2587# @id: the name of the device
2588#
2589# Returns: Nothing on success
2590# If @id is not a valid device, DeviceNotFound
Luiz Capitulinoa15fef22012-03-29 12:38:50 -03002591#
2592# Notes: When this command completes, the device may not be removed from the
2593# guest. Hot removal is an operation that requires guest cooperation.
2594# This command merely requests that the guest begin the hot removal
Michael S. Tsirkin0402a5d2013-03-06 14:58:59 +02002595# process. Completion of the device removal process is signaled with a
2596# DEVICE_DELETED event. Guest reset will automatically complete removal
2597# for all devices.
Luiz Capitulinoa15fef22012-03-29 12:38:50 -03002598#
2599# Since: 0.14.0
2600##
2601{ 'command': 'device_del', 'data': {'id': 'str'} }
Wen Congyang783e9b42012-05-07 12:10:47 +08002602
2603##
2604# @dump-guest-memory
2605#
2606# Dump guest's memory to vmcore. It is a synchronous operation that can take
2607# very long depending on the amount of guest memory. This command is only
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002608# supported on i386 and x86_64.
Wen Congyang783e9b42012-05-07 12:10:47 +08002609#
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002610# @paging: if true, do paging to get guest's memory mapping. This allows
Luiz Capitulinod6911802012-09-21 13:10:58 -03002611# using gdb to process the core file.
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002612#
Luiz Capitulinod6911802012-09-21 13:10:58 -03002613# IMPORTANT: this option can make QEMU allocate several gigabytes
2614# of RAM. This can happen for a large guest, or a
2615# malicious guest pretending to be large.
2616#
2617# Also, paging=true has the following limitations:
2618#
2619# 1. The guest may be in a catastrophic state or can have corrupted
2620# memory, which cannot be trusted
2621# 2. The guest can be in real-mode even if paging is enabled. For
2622# example, the guest uses ACPI to sleep, and ACPI sleep state
2623# goes in real-mode
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002624#
Wen Congyang783e9b42012-05-07 12:10:47 +08002625# @protocol: the filename or file descriptor of the vmcore. The supported
Luiz Capitulinod6911802012-09-21 13:10:58 -03002626# protocols are:
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002627#
Luiz Capitulinod6911802012-09-21 13:10:58 -03002628# 1. file: the protocol starts with "file:", and the following
2629# string is the file's path.
2630# 2. fd: the protocol starts with "fd:", and the following string
2631# is the fd's name.
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002632#
Wen Congyang783e9b42012-05-07 12:10:47 +08002633# @begin: #optional if specified, the starting physical address.
Luiz Capitulinof5b0d932012-06-28 11:59:15 -03002634#
Wen Congyang783e9b42012-05-07 12:10:47 +08002635# @length: #optional if specified, the memory size, in bytes. If you don't
Luiz Capitulinod6911802012-09-21 13:10:58 -03002636# want to dump all guest's memory, please specify the start @begin
2637# and @length
Wen Congyang783e9b42012-05-07 12:10:47 +08002638#
2639# Returns: nothing on success
Wen Congyang783e9b42012-05-07 12:10:47 +08002640#
2641# Since: 1.2
2642##
2643{ 'command': 'dump-guest-memory',
2644 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2645 '*length': 'int' } }
Luiz Capitulinod6911802012-09-21 13:10:58 -03002646
Luiz Capitulino928059a2012-04-18 17:34:15 -03002647##
2648# @netdev_add:
2649#
2650# Add a network backend.
2651#
2652# @type: the type of network backend. Current valid values are 'user', 'tap',
2653# 'vde', 'socket', 'dump' and 'bridge'
2654#
2655# @id: the name of the new network backend
2656#
2657# @props: #optional a list of properties to be passed to the backend in
2658# the format 'name=value', like 'ifname=tap0,script=no'
2659#
2660# Notes: The semantics of @props is not well defined. Future commands will be
2661# introduced that provide stronger typing for backend creation.
2662#
2663# Since: 0.14.0
2664#
2665# Returns: Nothing on success
2666# If @type is not a valid network backend, DeviceNotFound
Luiz Capitulino928059a2012-04-18 17:34:15 -03002667##
2668{ 'command': 'netdev_add',
2669 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2670 'gen': 'no' }
Luiz Capitulino5f964152012-04-16 14:36:32 -03002671
2672##
2673# @netdev_del:
2674#
2675# Remove a network backend.
2676#
2677# @id: the name of the network backend to remove
2678#
2679# Returns: Nothing on success
2680# If @id is not a valid network backend, DeviceNotFound
2681#
2682# Since: 0.14.0
2683##
2684{ 'command': 'netdev_del', 'data': {'id': 'str'} }
Corey Bryant208c9d12012-06-22 14:36:09 -04002685
2686##
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002687# @NetdevNoneOptions
2688#
2689# Use it alone to have zero network devices.
2690#
2691# Since 1.2
2692##
2693{ 'type': 'NetdevNoneOptions',
2694 'data': { } }
2695
2696##
2697# @NetLegacyNicOptions
2698#
2699# Create a new Network Interface Card.
2700#
2701# @netdev: #optional id of -netdev to connect to
2702#
2703# @macaddr: #optional MAC address
2704#
2705# @model: #optional device model (e1000, rtl8139, virtio etc.)
2706#
2707# @addr: #optional PCI device address
2708#
2709# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2710#
2711# Since 1.2
2712##
2713{ 'type': 'NetLegacyNicOptions',
2714 'data': {
2715 '*netdev': 'str',
2716 '*macaddr': 'str',
2717 '*model': 'str',
2718 '*addr': 'str',
2719 '*vectors': 'uint32' } }
2720
2721##
2722# @String
2723#
2724# A fat type wrapping 'str', to be embedded in lists.
2725#
2726# Since 1.2
2727##
2728{ 'type': 'String',
2729 'data': {
2730 'str': 'str' } }
2731
2732##
2733# @NetdevUserOptions
2734#
2735# Use the user mode network stack which requires no administrator privilege to
2736# run.
2737#
2738# @hostname: #optional client hostname reported by the builtin DHCP server
2739#
2740# @restrict: #optional isolate the guest from the host
2741#
2742# @ip: #optional legacy parameter, use net= instead
2743#
2744# @net: #optional IP address and optional netmask
2745#
2746# @host: #optional guest-visible address of the host
2747#
2748# @tftp: #optional root directory of the built-in TFTP server
2749#
2750# @bootfile: #optional BOOTP filename, for use with tftp=
2751#
2752# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2753# assign
2754#
2755# @dns: #optional guest-visible address of the virtual nameserver
2756#
Klaus Stengel63d29602012-10-27 19:53:39 +02002757# @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2758# to the guest
2759#
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002760# @smb: #optional root directory of the built-in SMB server
2761#
2762# @smbserver: #optional IP address of the built-in SMB server
2763#
2764# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2765# endpoints
2766#
2767# @guestfwd: #optional forward guest TCP connections
2768#
2769# Since 1.2
2770##
2771{ 'type': 'NetdevUserOptions',
2772 'data': {
2773 '*hostname': 'str',
2774 '*restrict': 'bool',
2775 '*ip': 'str',
2776 '*net': 'str',
2777 '*host': 'str',
2778 '*tftp': 'str',
2779 '*bootfile': 'str',
2780 '*dhcpstart': 'str',
2781 '*dns': 'str',
Klaus Stengel63d29602012-10-27 19:53:39 +02002782 '*dnssearch': ['String'],
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002783 '*smb': 'str',
2784 '*smbserver': 'str',
2785 '*hostfwd': ['String'],
2786 '*guestfwd': ['String'] } }
2787
2788##
2789# @NetdevTapOptions
2790#
2791# Connect the host TAP network interface name to the VLAN.
2792#
2793# @ifname: #optional interface name
2794#
2795# @fd: #optional file descriptor of an already opened tap
2796#
Jason Wang2ca81ba2013-02-20 18:04:01 +08002797# @fds: #optional multiple file descriptors of already opened multiqueue capable
2798# tap
2799#
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002800# @script: #optional script to initialize the interface
2801#
2802# @downscript: #optional script to shut down the interface
2803#
2804# @helper: #optional command to execute to configure bridge
2805#
2806# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2807#
2808# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2809#
2810# @vhost: #optional enable vhost-net network accelerator
2811#
2812# @vhostfd: #optional file descriptor of an already opened vhost net device
2813#
Jason Wang2ca81ba2013-02-20 18:04:01 +08002814# @vhostfds: #optional file descriptors of multiple already opened vhost net
2815# devices
2816#
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002817# @vhostforce: #optional vhost on for non-MSIX virtio guests
2818#
Jason Wangec396012013-02-22 22:57:52 +08002819# @queues: #optional number of queues to be created for multiqueue capable tap
2820#
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002821# Since 1.2
2822##
2823{ 'type': 'NetdevTapOptions',
2824 'data': {
2825 '*ifname': 'str',
2826 '*fd': 'str',
Jason Wang264986e2013-01-30 19:12:34 +08002827 '*fds': 'str',
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002828 '*script': 'str',
2829 '*downscript': 'str',
2830 '*helper': 'str',
2831 '*sndbuf': 'size',
2832 '*vnet_hdr': 'bool',
2833 '*vhost': 'bool',
2834 '*vhostfd': 'str',
Jason Wang264986e2013-01-30 19:12:34 +08002835 '*vhostfds': 'str',
2836 '*vhostforce': 'bool',
2837 '*queues': 'uint32'} }
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002838
2839##
2840# @NetdevSocketOptions
2841#
2842# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2843# socket connection.
2844#
2845# @fd: #optional file descriptor of an already opened socket
2846#
2847# @listen: #optional port number, and optional hostname, to listen on
2848#
2849# @connect: #optional port number, and optional hostname, to connect to
2850#
2851# @mcast: #optional UDP multicast address and port number
2852#
2853# @localaddr: #optional source address and port for multicast and udp packets
2854#
2855# @udp: #optional UDP unicast address and port number
2856#
2857# Since 1.2
2858##
2859{ 'type': 'NetdevSocketOptions',
2860 'data': {
2861 '*fd': 'str',
2862 '*listen': 'str',
2863 '*connect': 'str',
2864 '*mcast': 'str',
2865 '*localaddr': 'str',
2866 '*udp': 'str' } }
2867
2868##
2869# @NetdevVdeOptions
2870#
2871# Connect the VLAN to a vde switch running on the host.
2872#
2873# @sock: #optional socket path
2874#
2875# @port: #optional port number
2876#
2877# @group: #optional group owner of socket
2878#
2879# @mode: #optional permissions for socket
2880#
2881# Since 1.2
2882##
2883{ 'type': 'NetdevVdeOptions',
2884 'data': {
2885 '*sock': 'str',
2886 '*port': 'uint16',
2887 '*group': 'str',
2888 '*mode': 'uint16' } }
2889
2890##
2891# @NetdevDumpOptions
2892#
2893# Dump VLAN network traffic to a file.
2894#
2895# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2896# suffixes.
2897#
2898# @file: #optional dump file path (default is qemu-vlan0.pcap)
2899#
2900# Since 1.2
2901##
2902{ 'type': 'NetdevDumpOptions',
2903 'data': {
2904 '*len': 'size',
2905 '*file': 'str' } }
2906
2907##
2908# @NetdevBridgeOptions
2909#
2910# Connect a host TAP network interface to a host bridge device.
2911#
2912# @br: #optional bridge name
2913#
2914# @helper: #optional command to execute to configure bridge
2915#
2916# Since 1.2
2917##
2918{ 'type': 'NetdevBridgeOptions',
2919 'data': {
2920 '*br': 'str',
2921 '*helper': 'str' } }
2922
2923##
Stefan Hajnoczif6c874e2012-07-24 16:35:04 +01002924# @NetdevHubPortOptions
2925#
2926# Connect two or more net clients through a software hub.
2927#
2928# @hubid: hub identifier number
2929#
2930# Since 1.2
2931##
2932{ 'type': 'NetdevHubPortOptions',
2933 'data': {
2934 'hubid': 'int32' } }
2935
2936##
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002937# @NetClientOptions
2938#
2939# A discriminated record of network device traits.
2940#
2941# Since 1.2
2942##
2943{ 'union': 'NetClientOptions',
2944 'data': {
Stefan Hajnoczif6c874e2012-07-24 16:35:04 +01002945 'none': 'NetdevNoneOptions',
2946 'nic': 'NetLegacyNicOptions',
2947 'user': 'NetdevUserOptions',
2948 'tap': 'NetdevTapOptions',
2949 'socket': 'NetdevSocketOptions',
2950 'vde': 'NetdevVdeOptions',
2951 'dump': 'NetdevDumpOptions',
2952 'bridge': 'NetdevBridgeOptions',
2953 'hubport': 'NetdevHubPortOptions' } }
Laszlo Ersek14aa0c22012-07-17 16:17:11 +02002954
2955##
2956# @NetLegacy
2957#
2958# Captures the configuration of a network device; legacy.
2959#
2960# @vlan: #optional vlan number
2961#
2962# @id: #optional identifier for monitor commands
2963#
2964# @name: #optional identifier for monitor commands, ignored if @id is present
2965#
2966# @opts: device type specific properties (legacy)
2967#
2968# Since 1.2
2969##
2970{ 'type': 'NetLegacy',
2971 'data': {
2972 '*vlan': 'int32',
2973 '*id': 'str',
2974 '*name': 'str',
2975 'opts': 'NetClientOptions' } }
2976
2977##
2978# @Netdev
2979#
2980# Captures the configuration of a network device.
2981#
2982# @id: identifier for monitor commands.
2983#
2984# @opts: device type specific properties
2985#
2986# Since 1.2
2987##
2988{ 'type': 'Netdev',
2989 'data': {
2990 'id': 'str',
2991 'opts': 'NetClientOptions' } }
2992
2993##
Paolo Bonzini5be8c752012-09-19 14:03:35 +02002994# @InetSocketAddress
2995#
2996# Captures a socket address or address range in the Internet namespace.
2997#
2998# @host: host part of the address
2999#
3000# @port: port part of the address, or lowest port if @to is present
3001#
3002# @to: highest port to try
3003#
3004# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3005# #optional
3006#
3007# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3008# #optional
3009#
3010# Since 1.3
3011##
3012{ 'type': 'InetSocketAddress',
3013 'data': {
3014 'host': 'str',
3015 'port': 'str',
3016 '*to': 'uint16',
3017 '*ipv4': 'bool',
3018 '*ipv6': 'bool' } }
3019
3020##
3021# @UnixSocketAddress
3022#
3023# Captures a socket address in the local ("Unix socket") namespace.
3024#
3025# @path: filesystem path to use
3026#
3027# Since 1.3
3028##
3029{ 'type': 'UnixSocketAddress',
3030 'data': {
3031 'path': 'str' } }
3032
3033##
3034# @SocketAddress
3035#
3036# Captures the address of a socket, which could also be a named file descriptor
3037#
3038# Since 1.3
3039##
3040{ 'union': 'SocketAddress',
3041 'data': {
3042 'inet': 'InetSocketAddress',
3043 'unix': 'UnixSocketAddress',
3044 'fd': 'String' } }
3045
3046##
Corey Bryant208c9d12012-06-22 14:36:09 -04003047# @getfd:
3048#
3049# Receive a file descriptor via SCM rights and assign it a name
3050#
3051# @fdname: file descriptor name
3052#
3053# Returns: Nothing on success
Corey Bryant208c9d12012-06-22 14:36:09 -04003054#
3055# Since: 0.14.0
3056#
3057# Notes: If @fdname already exists, the file descriptor assigned to
3058# it will be closed and replaced by the received file
3059# descriptor.
3060# The 'closefd' command can be used to explicitly close the
3061# file descriptor when it is no longer needed.
3062##
3063{ 'command': 'getfd', 'data': {'fdname': 'str'} }
3064
3065##
3066# @closefd:
3067#
3068# Close a file descriptor previously passed via SCM rights
3069#
3070# @fdname: file descriptor name
3071#
3072# Returns: Nothing on success
Corey Bryant208c9d12012-06-22 14:36:09 -04003073#
3074# Since: 0.14.0
3075##
3076{ 'command': 'closefd', 'data': {'fdname': 'str'} }
Anthony Liguori01d3c802012-08-10 11:04:11 -05003077
3078##
3079# @MachineInfo:
3080#
3081# Information describing a machine.
3082#
3083# @name: the name of the machine
3084#
3085# @alias: #optional an alias for the machine name
3086#
3087# @default: #optional whether the machine is default
3088#
Michal Novotnyc72e7682013-04-08 18:21:02 +02003089# @cpu-max: maximum number of CPUs supported by the machine type
3090# (since 1.5.0)
3091#
Anthony Liguori01d3c802012-08-10 11:04:11 -05003092# Since: 1.2.0
3093##
3094{ 'type': 'MachineInfo',
3095 'data': { 'name': 'str', '*alias': 'str',
Michal Novotnyc72e7682013-04-08 18:21:02 +02003096 '*is-default': 'bool', 'cpu-max': 'int' } }
Anthony Liguori01d3c802012-08-10 11:04:11 -05003097
3098##
3099# @query-machines:
3100#
3101# Return a list of supported machines
3102#
3103# Returns: a list of MachineInfo
3104#
3105# Since: 1.2.0
3106##
3107{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003108
3109##
3110# @CpuDefinitionInfo:
3111#
3112# Virtual CPU definition.
3113#
3114# @name: the name of the CPU definition
3115#
3116# Since: 1.2.0
3117##
3118{ 'type': 'CpuDefinitionInfo',
3119 'data': { 'name': 'str' } }
3120
3121##
3122# @query-cpu-definitions:
3123#
3124# Return a list of supported virtual CPU definitions
3125#
3126# Returns: a list of CpuDefInfo
3127#
3128# Since: 1.2.0
3129##
3130{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
Corey Bryantba1c0482012-08-14 16:43:43 -04003131
3132# @AddfdInfo:
3133#
3134# Information about a file descriptor that was added to an fd set.
3135#
3136# @fdset-id: The ID of the fd set that @fd was added to.
3137#
3138# @fd: The file descriptor that was received via SCM rights and
3139# added to the fd set.
3140#
3141# Since: 1.2.0
3142##
3143{ 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3144
3145##
3146# @add-fd:
3147#
3148# Add a file descriptor, that was passed via SCM rights, to an fd set.
3149#
3150# @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3151#
3152# @opaque: #optional A free-form string that can be used to describe the fd.
3153#
3154# Returns: @AddfdInfo on success
3155# If file descriptor was not received, FdNotSupplied
Corey Bryant9ac54af2012-10-18 15:19:31 -04003156# If @fdset-id is a negative value, InvalidParameterValue
Corey Bryantba1c0482012-08-14 16:43:43 -04003157#
3158# Notes: The list of fd sets is shared by all monitor connections.
3159#
3160# If @fdset-id is not specified, a new fd set will be created.
3161#
3162# Since: 1.2.0
3163##
3164{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3165 'returns': 'AddfdInfo' }
3166
3167##
3168# @remove-fd:
3169#
3170# Remove a file descriptor from an fd set.
3171#
3172# @fdset-id: The ID of the fd set that the file descriptor belongs to.
3173#
3174# @fd: #optional The file descriptor that is to be removed.
3175#
3176# Returns: Nothing on success
3177# If @fdset-id or @fd is not found, FdNotFound
3178#
3179# Since: 1.2.0
3180#
3181# Notes: The list of fd sets is shared by all monitor connections.
3182#
3183# If @fd is not specified, all file descriptors in @fdset-id
3184# will be removed.
3185##
3186{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3187
3188##
3189# @FdsetFdInfo:
3190#
3191# Information about a file descriptor that belongs to an fd set.
3192#
3193# @fd: The file descriptor value.
3194#
3195# @opaque: #optional A free-form string that can be used to describe the fd.
3196#
3197# Since: 1.2.0
3198##
3199{ 'type': 'FdsetFdInfo',
3200 'data': {'fd': 'int', '*opaque': 'str'} }
3201
3202##
3203# @FdsetInfo:
3204#
3205# Information about an fd set.
3206#
3207# @fdset-id: The ID of the fd set.
3208#
3209# @fds: A list of file descriptors that belong to this fd set.
3210#
3211# Since: 1.2.0
3212##
3213{ 'type': 'FdsetInfo',
3214 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3215
3216##
3217# @query-fdsets:
3218#
3219# Return information describing all fd sets.
3220#
3221# Returns: A list of @FdsetInfo
3222#
3223# Since: 1.2.0
3224#
3225# Note: The list of fd sets is shared by all monitor connections.
3226#
3227##
3228{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003229
3230##
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003231# @TargetInfo:
3232#
3233# Information describing the QEMU target.
3234#
3235# @arch: the target architecture (eg "x86_64", "i386", etc)
3236#
3237# Since: 1.2.0
3238##
3239{ 'type': 'TargetInfo',
Paolo Bonzinic02a9552013-06-04 14:45:28 +02003240 'data': { 'arch': 'str' } }
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003241
3242##
3243# @query-target:
3244#
3245# Return information about the target for this QEMU
3246#
3247# Returns: TargetInfo
3248#
3249# Since: 1.2.0
3250##
3251{ 'command': 'query-target', 'returns': 'TargetInfo' }
Amos Kong411656f2012-08-31 10:56:24 +08003252
3253##
3254# @QKeyCode:
3255#
3256# An enumeration of key name.
3257#
3258# This is used by the send-key command.
3259#
3260# Since: 1.3.0
3261##
3262{ 'enum': 'QKeyCode',
3263 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3264 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3265 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3266 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3267 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3268 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3269 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3270 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3271 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3272 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3273 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3274 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3275 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3276 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3277 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
Amos Konge4c8f002012-08-31 10:56:26 +08003278
3279##
Luiz Capitulino9f328972012-09-20 14:19:47 -03003280# @KeyValue
3281#
3282# Represents a keyboard key.
3283#
3284# Since: 1.3.0
3285##
3286{ 'union': 'KeyValue',
3287 'data': {
3288 'number': 'int',
3289 'qcode': 'QKeyCode' } }
3290
3291##
Amos Konge4c8f002012-08-31 10:56:26 +08003292# @send-key:
3293#
3294# Send keys to guest.
3295#
Luiz Capitulino9f328972012-09-20 14:19:47 -03003296# @keys: An array of @KeyValue elements. All @KeyValues in this array are
3297# simultaneously sent to the guest. A @KeyValue.number value is sent
3298# directly to the guest, while @KeyValue.qcode must be a valid
3299# @QKeyCode value
Amos Konge4c8f002012-08-31 10:56:26 +08003300#
3301# @hold-time: #optional time to delay key up events, milliseconds. Defaults
3302# to 100
3303#
3304# Returns: Nothing on success
3305# If key is unknown or redundant, InvalidParameter
3306#
3307# Since: 1.3.0
3308#
3309##
3310{ 'command': 'send-key',
Luiz Capitulino9f328972012-09-20 14:19:47 -03003311 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
Luiz Capitulinoad39cf62012-05-24 13:48:23 -03003312
3313##
3314# @screendump:
3315#
3316# Write a PPM of the VGA screen to a file.
3317#
3318# @filename: the path of a new PPM file to store the image
3319#
3320# Returns: Nothing on success
3321#
3322# Since: 0.14.0
3323##
3324{ 'command': 'screendump', 'data': {'filename': 'str'} }
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003325
3326##
3327# @nbd-server-start:
3328#
3329# Start an NBD server listening on the given host and port. Block
3330# devices can then be exported using @nbd-server-add. The NBD
3331# server will present them as named exports; for example, another
3332# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3333#
3334# @addr: Address on which to listen.
3335#
3336# Returns: error if the server is already running.
3337#
3338# Since: 1.3.0
3339##
3340{ 'command': 'nbd-server-start',
3341 'data': { 'addr': 'SocketAddress' } }
3342
3343##
3344# @nbd-server-add:
3345#
3346# Export a device to QEMU's embedded NBD server.
3347#
3348# @device: Block device to be exported
3349#
3350# @writable: Whether clients should be able to write to the device via the
3351# NBD connection (default false). #optional
3352#
3353# Returns: error if the device is already marked for export.
3354#
3355# Since: 1.3.0
3356##
3357{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3358
3359##
3360# @nbd-server-stop:
3361#
3362# Stop QEMU's embedded NBD server, and unregister all devices previously
3363# added via @nbd-server-add.
3364#
3365# Since: 1.3.0
3366##
3367{ 'command': 'nbd-server-stop' }
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003368
3369##
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003370# @ChardevFile:
3371#
3372# Configuration info for file chardevs.
3373#
3374# @in: #optional The name of the input file
3375# @out: The name of the output file
3376#
3377# Since: 1.4
3378##
3379{ 'type': 'ChardevFile', 'data': { '*in' : 'str',
3380 'out' : 'str' } }
3381
3382##
Markus Armbrusterd36b2b92013-02-13 15:54:16 +01003383# @ChardevHostdev:
Gerd Hoffmannd59044e2012-12-19 13:50:29 +01003384#
Gerd Hoffmann548cbb32013-02-25 11:50:55 +01003385# Configuration info for device and pipe chardevs.
Gerd Hoffmannd59044e2012-12-19 13:50:29 +01003386#
3387# @device: The name of the special file for the device,
3388# i.e. /dev/ttyS0 on Unix or COM1: on Windows
3389# @type: What kind of device this is.
3390#
3391# Since: 1.4
3392##
Markus Armbrusterd36b2b92013-02-13 15:54:16 +01003393{ 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
Gerd Hoffmannd59044e2012-12-19 13:50:29 +01003394
3395##
Gerd Hoffmannf6bd5d62012-12-20 13:53:12 +01003396# @ChardevSocket:
3397#
Gerd Hoffmann3ecc0592013-02-27 14:10:47 +01003398# Configuration info for (stream) socket chardevs.
Gerd Hoffmannf6bd5d62012-12-20 13:53:12 +01003399#
3400# @addr: socket address to listen on (server=true)
3401# or connect to (server=false)
3402# @server: #optional create server socket (default: true)
Gerd Hoffmannef993ba2013-06-24 08:39:50 +02003403# @wait: #optional wait for incoming connection on server
3404# sockets (default: false).
Gerd Hoffmannf6bd5d62012-12-20 13:53:12 +01003405# @nodelay: #optional set TCP_NODELAY socket option (default: false)
Gerd Hoffmannef993ba2013-06-24 08:39:50 +02003406# @telnet: #optional enable telnet protocol on server
3407# sockets (default: false)
Gerd Hoffmannf6bd5d62012-12-20 13:53:12 +01003408#
3409# Since: 1.4
3410##
3411{ 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3412 '*server' : 'bool',
3413 '*wait' : 'bool',
3414 '*nodelay' : 'bool',
3415 '*telnet' : 'bool' } }
3416
3417##
Lei Li08d0ab32013-05-20 14:51:03 +08003418# @ChardevUdp:
Gerd Hoffmann3ecc0592013-02-27 14:10:47 +01003419#
3420# Configuration info for datagram socket chardevs.
3421#
3422# @remote: remote address
3423# @local: #optional local address
3424#
3425# Since: 1.5
3426##
Lei Li08d0ab32013-05-20 14:51:03 +08003427{ 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3428 '*local' : 'SocketAddress' } }
Gerd Hoffmann3ecc0592013-02-27 14:10:47 +01003429
3430##
Gerd Hoffmannedb2fb32013-02-21 16:16:42 +01003431# @ChardevMux:
3432#
3433# Configuration info for mux chardevs.
3434#
3435# @chardev: name of the base chardev.
3436#
3437# Since: 1.5
3438##
3439{ 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3440
3441##
Gerd Hoffmann7c358032013-02-21 12:34:58 +01003442# @ChardevStdio:
3443#
3444# Configuration info for stdio chardevs.
3445#
3446# @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3447# be delivered to qemu. Default: true in -nographic mode,
3448# false otherwise.
3449#
3450# Since: 1.5
3451##
3452{ 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3453
3454##
Gerd Hoffmanncd153e22013-02-25 12:39:06 +01003455# @ChardevSpiceChannel:
3456#
3457# Configuration info for spice vm channel chardevs.
3458#
3459# @type: kind of channel (for example vdagent).
3460#
3461# Since: 1.5
3462##
3463{ 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3464
3465##
3466# @ChardevSpicePort:
3467#
3468# Configuration info for spice port chardevs.
3469#
3470# @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3471#
3472# Since: 1.5
3473##
3474{ 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3475
3476##
Gerd Hoffmann702ec692013-02-25 15:52:32 +01003477# @ChardevVC:
3478#
3479# Configuration info for virtual console chardevs.
3480#
3481# @width: console width, in pixels
3482# @height: console height, in pixels
3483# @cols: console width, in chars
3484# @rows: console height, in chars
3485#
3486# Since: 1.5
3487##
3488{ 'type': 'ChardevVC', 'data': { '*width' : 'int',
3489 '*height' : 'int',
3490 '*cols' : 'int',
3491 '*rows' : 'int' } }
3492
3493##
Markus Armbruster4f573782013-07-26 16:44:32 +02003494# @ChardevRingbuf:
Gerd Hoffmann1da48c62013-02-26 16:21:11 +01003495#
Markus Armbruster3a1da422013-07-26 16:44:34 +02003496# Configuration info for ring buffer chardevs.
Gerd Hoffmann1da48c62013-02-26 16:21:11 +01003497#
Markus Armbruster3a1da422013-07-26 16:44:34 +02003498# @size: #optional ring buffer size, must be power of two, default is 65536
Gerd Hoffmann1da48c62013-02-26 16:21:11 +01003499#
3500# Since: 1.5
3501##
Markus Armbruster4f573782013-07-26 16:44:32 +02003502{ 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
Gerd Hoffmann1da48c62013-02-26 16:21:11 +01003503
3504##
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003505# @ChardevBackend:
3506#
3507# Configuration info for the new chardev backend.
3508#
3509# Since: 1.4
3510##
3511{ 'type': 'ChardevDummy', 'data': { } }
3512
Gerd Hoffmannf6bd5d62012-12-20 13:53:12 +01003513{ 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
Markus Armbrusterd36b2b92013-02-13 15:54:16 +01003514 'serial' : 'ChardevHostdev',
3515 'parallel': 'ChardevHostdev',
Gerd Hoffmann548cbb32013-02-25 11:50:55 +01003516 'pipe' : 'ChardevHostdev',
Gerd Hoffmannf6bd5d62012-12-20 13:53:12 +01003517 'socket' : 'ChardevSocket',
Lei Li08d0ab32013-05-20 14:51:03 +08003518 'udp' : 'ChardevUdp',
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003519 'pty' : 'ChardevDummy',
Gerd Hoffmannedb2fb32013-02-21 16:16:42 +01003520 'null' : 'ChardevDummy',
Gerd Hoffmannf5a51ca2013-02-21 11:58:44 +01003521 'mux' : 'ChardevMux',
Gerd Hoffmann2d572862013-02-21 12:56:10 +01003522 'msmouse': 'ChardevDummy',
Gerd Hoffmann7c358032013-02-21 12:34:58 +01003523 'braille': 'ChardevDummy',
Gerd Hoffmannd9ac3742013-02-25 11:48:06 +01003524 'stdio' : 'ChardevStdio',
Gerd Hoffmanncd153e22013-02-25 12:39:06 +01003525 'console': 'ChardevDummy',
3526 'spicevmc' : 'ChardevSpiceChannel',
Gerd Hoffmann702ec692013-02-25 15:52:32 +01003527 'spiceport' : 'ChardevSpicePort',
Gerd Hoffmann1da48c62013-02-26 16:21:11 +01003528 'vc' : 'ChardevVC',
Markus Armbruster3a1da422013-07-26 16:44:34 +02003529 'ringbuf': 'ChardevRingbuf',
3530 # next one is just for compatibility
Markus Armbruster4f573782013-07-26 16:44:32 +02003531 'memory' : 'ChardevRingbuf' } }
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003532
3533##
3534# @ChardevReturn:
3535#
3536# Return info about the chardev backend just created.
3537#
Markus Armbruster58fa4322013-02-11 18:05:48 +01003538# @pty: #optional name of the slave pseudoterminal device, present if
3539# and only if a chardev of type 'pty' was created
3540#
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003541# Since: 1.4
3542##
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003543{ 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003544
3545##
3546# @chardev-add:
3547#
Markus Armbruster58fa4322013-02-11 18:05:48 +01003548# Add a character device backend
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003549#
3550# @id: the chardev's ID, must be unique
3551# @backend: backend type and parameters
3552#
Markus Armbruster58fa4322013-02-11 18:05:48 +01003553# Returns: ChardevReturn.
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003554#
3555# Since: 1.4
3556##
3557{ 'command': 'chardev-add', 'data': {'id' : 'str',
3558 'backend' : 'ChardevBackend' },
3559 'returns': 'ChardevReturn' }
3560
3561##
3562# @chardev-remove:
3563#
Markus Armbruster58fa4322013-02-11 18:05:48 +01003564# Remove a character device backend
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003565#
3566# @id: the chardev's ID, must exist and not be in use
3567#
3568# Returns: Nothing on success
3569#
3570# Since: 1.4
3571##
3572{ 'command': 'chardev-remove', 'data': {'id': 'str'} }
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003573
3574##
3575# @TpmModel:
3576#
3577# An enumeration of TPM models
3578#
3579# @tpm-tis: TPM TIS model
3580#
3581# Since: 1.5
3582##
3583{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3584
3585##
3586# @query-tpm-models:
3587#
3588# Return a list of supported TPM models
3589#
3590# Returns: a list of TpmModel
3591#
3592# Since: 1.5
3593##
3594{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3595
3596##
3597# @TpmType:
3598#
3599# An enumeration of TPM types
3600#
3601# @passthrough: TPM passthrough type
3602#
3603# Since: 1.5
3604##
3605{ 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3606
3607##
3608# @query-tpm-types:
3609#
3610# Return a list of supported TPM types
3611#
3612# Returns: a list of TpmType
3613#
3614# Since: 1.5
3615##
3616{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3617
3618##
3619# @TPMPassthroughOptions:
3620#
3621# Information about the TPM passthrough type
3622#
3623# @path: #optional string describing the path used for accessing the TPM device
3624#
3625# @cancel-path: #optional string showing the TPM's sysfs cancel file
3626# for cancellation of TPM commands while they are executing
3627#
3628# Since: 1.5
3629##
3630{ 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3631 '*cancel-path' : 'str'} }
3632
3633##
3634# @TpmTypeOptions:
3635#
3636# A union referencing different TPM backend types' configuration options
3637#
Corey Bryant88ca7bc2013-03-20 12:34:48 -04003638# @passthrough: The configuration options for the TPM passthrough type
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003639#
3640# Since: 1.5
3641##
3642{ 'union': 'TpmTypeOptions',
Corey Bryant88ca7bc2013-03-20 12:34:48 -04003643 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003644
3645##
3646# @TpmInfo:
3647#
3648# Information about the TPM
3649#
3650# @id: The Id of the TPM
3651#
3652# @model: The TPM frontend model
3653#
Corey Bryant88ca7bc2013-03-20 12:34:48 -04003654# @options: The TPM (backend) type configuration options
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003655#
3656# Since: 1.5
3657##
3658{ 'type': 'TPMInfo',
3659 'data': {'id': 'str',
3660 'model': 'TpmModel',
Corey Bryant88ca7bc2013-03-20 12:34:48 -04003661 'options': 'TpmTypeOptions' } }
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003662
3663##
3664# @query-tpm:
3665#
3666# Return information about the TPM device
3667#
3668# Returns: @TPMInfo on success
3669#
3670# Since: 1.5
3671##
3672{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }
Laszlo Ersek8ccbad52013-03-21 00:23:16 +01003673
3674##
3675# @AcpiTableOptions
3676#
3677# Specify an ACPI table on the command line to load.
3678#
3679# At most one of @file and @data can be specified. The list of files specified
3680# by any one of them is loaded and concatenated in order. If both are omitted,
3681# @data is implied.
3682#
3683# Other fields / optargs can be used to override fields of the generic ACPI
3684# table header; refer to the ACPI specification 5.0, section 5.2.6 System
3685# Description Table Header. If a header field is not overridden, then the
3686# corresponding value from the concatenated blob is used (in case of @file), or
3687# it is filled in with a hard-coded value (in case of @data).
3688#
3689# String fields are copied into the matching ACPI member from lowest address
3690# upwards, and silently truncated / NUL-padded to length.
3691#
3692# @sig: #optional table signature / identifier (4 bytes)
3693#
3694# @rev: #optional table revision number (dependent on signature, 1 byte)
3695#
3696# @oem_id: #optional OEM identifier (6 bytes)
3697#
3698# @oem_table_id: #optional OEM table identifier (8 bytes)
3699#
3700# @oem_rev: #optional OEM-supplied revision number (4 bytes)
3701#
3702# @asl_compiler_id: #optional identifier of the utility that created the table
3703# (4 bytes)
3704#
3705# @asl_compiler_rev: #optional revision number of the utility that created the
3706# table (4 bytes)
3707#
3708# @file: #optional colon (:) separated list of pathnames to load and
3709# concatenate as table data. The resultant binary blob is expected to
3710# have an ACPI table header. At least one file is required. This field
3711# excludes @data.
3712#
3713# @data: #optional colon (:) separated list of pathnames to load and
3714# concatenate as table data. The resultant binary blob must not have an
3715# ACPI table header. At least one file is required. This field excludes
3716# @file.
3717#
3718# Since 1.5
3719##
3720{ 'type': 'AcpiTableOptions',
3721 'data': {
3722 '*sig': 'str',
3723 '*rev': 'uint8',
3724 '*oem_id': 'str',
3725 '*oem_table_id': 'str',
3726 '*oem_rev': 'uint32',
3727 '*asl_compiler_id': 'str',
3728 '*asl_compiler_rev': 'uint32',
3729 '*file': 'str',
3730 '*data': 'str' }}
Amos Kong1f8f9872013-04-25 17:50:35 +08003731
3732##
3733# @CommandLineParameterType:
3734#
3735# Possible types for an option parameter.
3736#
3737# @string: accepts a character string
3738#
3739# @boolean: accepts "on" or "off"
3740#
3741# @number: accepts a number
3742#
3743# @size: accepts a number followed by an optional suffix (K)ilo,
3744# (M)ega, (G)iga, (T)era
3745#
3746# Since 1.5
3747##
3748{ 'enum': 'CommandLineParameterType',
3749 'data': ['string', 'boolean', 'number', 'size'] }
3750
3751##
3752# @CommandLineParameterInfo:
3753#
3754# Details about a single parameter of a command line option.
3755#
3756# @name: parameter name
3757#
3758# @type: parameter @CommandLineParameterType
3759#
3760# @help: #optional human readable text string, not suitable for parsing.
3761#
3762# Since 1.5
3763##
3764{ 'type': 'CommandLineParameterInfo',
3765 'data': { 'name': 'str',
3766 'type': 'CommandLineParameterType',
3767 '*help': 'str' } }
3768
3769##
3770# @CommandLineOptionInfo:
3771#
3772# Details about a command line option, including its list of parameter details
3773#
3774# @option: option name
3775#
3776# @parameters: an array of @CommandLineParameterInfo
3777#
3778# Since 1.5
3779##
3780{ 'type': 'CommandLineOptionInfo',
3781 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3782
3783##
3784# @query-command-line-options:
3785#
3786# Query command line option schema.
3787#
3788# @option: #optional option name
3789#
3790# Returns: list of @CommandLineOptionInfo for all options (or for the given
3791# @option). Returns an error if the given @option doesn't exist.
3792#
3793# Since 1.5
3794##
3795{'command': 'query-command-line-options', 'data': { '*option': 'str' },
3796 'returns': ['CommandLineOptionInfo'] }
Eduardo Habkost8e8aba52013-05-06 13:20:07 -03003797
3798##
3799# @X86CPURegister32
3800#
3801# A X86 32-bit register
3802#
3803# Since: 1.5
3804##
3805{ 'enum': 'X86CPURegister32',
3806 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3807
3808##
3809# @X86CPUFeatureWordInfo
3810#
3811# Information about a X86 CPU feature word
3812#
3813# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3814#
3815# @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3816# feature word
3817#
3818# @cpuid-register: Output register containing the feature bits
3819#
3820# @features: value of output register, containing the feature bits
3821#
3822# Since: 1.5
3823##
3824{ 'type': 'X86CPUFeatureWordInfo',
3825 'data': { 'cpuid-input-eax': 'int',
3826 '*cpuid-input-ecx': 'int',
3827 'cpuid-register': 'X86CPURegister32',
3828 'features': 'int' } }
Amos Kongb1be4282013-06-14 15:45:52 +08003829
3830##
3831# @RxState:
3832#
3833# Packets receiving state
3834#
3835# @normal: filter assigned packets according to the mac-table
3836#
3837# @none: don't receive any assigned packet
3838#
3839# @all: receive all assigned packets
3840#
3841# Since: 1.6
3842##
3843{ 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3844
3845##
3846# @RxFilterInfo:
3847#
3848# Rx-filter information for a NIC.
3849#
3850# @name: net client name
3851#
3852# @promiscuous: whether promiscuous mode is enabled
3853#
3854# @multicast: multicast receive state
3855#
3856# @unicast: unicast receive state
3857#
3858# @broadcast-allowed: whether to receive broadcast
3859#
3860# @multicast-overflow: multicast table is overflowed or not
3861#
3862# @unicast-overflow: unicast table is overflowed or not
3863#
3864# @main-mac: the main macaddr string
3865#
3866# @vlan-table: a list of active vlan id
3867#
3868# @unicast-table: a list of unicast macaddr string
3869#
3870# @multicast-table: a list of multicast macaddr string
3871#
3872# Since 1.6
3873##
3874
3875{ 'type': 'RxFilterInfo',
3876 'data': {
3877 'name': 'str',
3878 'promiscuous': 'bool',
3879 'multicast': 'RxState',
3880 'unicast': 'RxState',
3881 'broadcast-allowed': 'bool',
3882 'multicast-overflow': 'bool',
3883 'unicast-overflow': 'bool',
3884 'main-mac': 'str',
3885 'vlan-table': ['int'],
3886 'unicast-table': ['str'],
3887 'multicast-table': ['str'] }}
3888
3889##
3890# @query-rx-filter:
3891#
3892# Return rx-filter information for all NICs (or for the given NIC).
3893#
3894# @name: #optional net client name
3895#
3896# Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3897# Returns an error if the given @name doesn't exist, or given
3898# NIC doesn't support rx-filter querying, or given net client
3899# isn't a NIC.
3900#
3901# Since: 1.6
3902##
3903{ 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3904 'returns': ['RxFilterInfo'] }