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