]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/block-core.json
blockjob: Fix recent BLOCK_JOB_READY regression
[mirror_qemu.git] / qapi / block-core.json
CommitLineData
5db15096
BC
1# -*- Mode: Python -*-
2#
3# QAPI block core definitions (vm unrelated)
4
5# QAPI common definitions
6{ 'include': 'common.json' }
1ad166b6
BC
7
8##
9# @SnapshotInfo
10#
11# @id: unique snapshot id
12#
13# @name: user chosen name
14#
15# @vm-state-size: size of the VM state
16#
17# @date-sec: UTC date of the snapshot in seconds
18#
19# @date-nsec: fractional part in nano seconds to be used with date-sec
20#
21# @vm-clock-sec: VM clock relative to boot in seconds
22#
23# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
24#
25# Since: 1.3
26#
27##
28
29{ 'type': 'SnapshotInfo',
30 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
31 'date-sec': 'int', 'date-nsec': 'int',
32 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
33
34##
35# @ImageInfoSpecificQCow2:
36#
37# @compat: compatibility level
38#
39# @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
40#
41# Since: 1.7
42##
43{ 'type': 'ImageInfoSpecificQCow2',
44 'data': {
45 'compat': 'str',
46 '*lazy-refcounts': 'bool'
47 } }
48
49##
50# @ImageInfoSpecificVmdk:
51#
52# @create-type: The create type of VMDK image
53#
54# @cid: Content id of image
55#
56# @parent-cid: Parent VMDK image's cid
57#
58# @extents: List of extent files
59#
60# Since: 1.7
61##
62{ 'type': 'ImageInfoSpecificVmdk',
63 'data': {
64 'create-type': 'str',
65 'cid': 'int',
66 'parent-cid': 'int',
67 'extents': ['ImageInfo']
68 } }
69
70##
71# @ImageInfoSpecific:
72#
73# A discriminated record of image format specific information structures.
74#
75# Since: 1.7
76##
77
78{ 'union': 'ImageInfoSpecific',
79 'data': {
80 'qcow2': 'ImageInfoSpecificQCow2',
81 'vmdk': 'ImageInfoSpecificVmdk'
82 } }
83
84##
85# @ImageInfo:
86#
87# Information about a QEMU image file
88#
89# @filename: name of the image file
90#
91# @format: format of the image file
92#
93# @virtual-size: maximum capacity in bytes of the image
94#
95# @actual-size: #optional actual size on disk in bytes of the image
96#
97# @dirty-flag: #optional true if image is not cleanly closed
98#
99# @cluster-size: #optional size of a cluster in bytes
100#
101# @encrypted: #optional true if the image is encrypted
102#
103# @compressed: #optional true if the image is compressed (Since 1.7)
104#
105# @backing-filename: #optional name of the backing file
106#
107# @full-backing-filename: #optional full path of the backing file
108#
109# @backing-filename-format: #optional the format of the backing file
110#
111# @snapshots: #optional list of VM snapshots
112#
113# @backing-image: #optional info of the backing image (since 1.6)
114#
115# @format-specific: #optional structure supplying additional format-specific
116# information (since 1.7)
117#
118# Since: 1.3
119#
120##
121
122{ 'type': 'ImageInfo',
123 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
124 '*actual-size': 'int', 'virtual-size': 'int',
125 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
126 '*backing-filename': 'str', '*full-backing-filename': 'str',
127 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
128 '*backing-image': 'ImageInfo',
129 '*format-specific': 'ImageInfoSpecific' } }
130
131##
132# @ImageCheck:
133#
134# Information about a QEMU image file check
135#
136# @filename: name of the image file checked
137#
138# @format: format of the image file checked
139#
140# @check-errors: number of unexpected errors occurred during check
141#
142# @image-end-offset: #optional offset (in bytes) where the image ends, this
143# field is present if the driver for the image format
144# supports it
145#
146# @corruptions: #optional number of corruptions found during the check if any
147#
148# @leaks: #optional number of leaks found during the check if any
149#
150# @corruptions-fixed: #optional number of corruptions fixed during the check
151# if any
152#
153# @leaks-fixed: #optional number of leaks fixed during the check if any
154#
155# @total-clusters: #optional total number of clusters, this field is present
156# if the driver for the image format supports it
157#
158# @allocated-clusters: #optional total number of allocated clusters, this
159# field is present if the driver for the image format
160# supports it
161#
162# @fragmented-clusters: #optional total number of fragmented clusters, this
163# field is present if the driver for the image format
164# supports it
165#
166# @compressed-clusters: #optional total number of compressed clusters, this
167# field is present if the driver for the image format
168# supports it
169#
170# Since: 1.4
171#
172##
173
174{ 'type': 'ImageCheck',
175 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
176 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
177 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
178 '*total-clusters': 'int', '*allocated-clusters': 'int',
179 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
180
181##
182# @BlockDeviceInfo:
183#
184# Information about the backing device for a block device.
185#
186# @file: the filename of the backing device
187#
188# @node-name: #optional the name of the block driver node (Since 2.0)
189#
190# @ro: true if the backing device was open read-only
191#
192# @drv: the name of the block format used to open the backing device. As of
193# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
194# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
195# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
196# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
197#
198# @backing_file: #optional the name of the backing file (for copy-on-write)
199#
200# @backing_file_depth: number of files in the backing file chain (since: 1.2)
201#
202# @encrypted: true if the backing device is encrypted
203#
204# @encryption_key_missing: true if the backing device is encrypted but an
205# valid encryption key is missing
206#
207# @detect_zeroes: detect and optimize zero writes (Since 2.1)
208#
209# @bps: total throughput limit in bytes per second is specified
210#
211# @bps_rd: read throughput limit in bytes per second is specified
212#
213# @bps_wr: write throughput limit in bytes per second is specified
214#
215# @iops: total I/O operations per second is specified
216#
217# @iops_rd: read I/O operations per second is specified
218#
219# @iops_wr: write I/O operations per second is specified
220#
221# @image: the info of image used (since: 1.6)
222#
223# @bps_max: #optional total max in bytes (Since 1.7)
224#
225# @bps_rd_max: #optional read max in bytes (Since 1.7)
226#
227# @bps_wr_max: #optional write max in bytes (Since 1.7)
228#
229# @iops_max: #optional total I/O operations max (Since 1.7)
230#
231# @iops_rd_max: #optional read I/O operations max (Since 1.7)
232#
233# @iops_wr_max: #optional write I/O operations max (Since 1.7)
234#
235# @iops_size: #optional an I/O size in bytes (Since 1.7)
236#
237# Since: 0.14.0
238#
239##
240{ 'type': 'BlockDeviceInfo',
241 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
242 '*backing_file': 'str', 'backing_file_depth': 'int',
243 'encrypted': 'bool', 'encryption_key_missing': 'bool',
244 'detect_zeroes': 'BlockdevDetectZeroesOptions',
245 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
246 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
247 'image': 'ImageInfo',
248 '*bps_max': 'int', '*bps_rd_max': 'int',
249 '*bps_wr_max': 'int', '*iops_max': 'int',
250 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
251 '*iops_size': 'int' } }
252
253##
254# @BlockDeviceIoStatus:
255#
256# An enumeration of block device I/O status.
257#
258# @ok: The last I/O operation has succeeded
259#
260# @failed: The last I/O operation has failed
261#
262# @nospace: The last I/O operation has failed due to a no-space condition
263#
264# Since: 1.0
265##
266{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
267
268##
269# @BlockDeviceMapEntry:
270#
271# Entry in the metadata map of the device (returned by "qemu-img map")
272#
273# @start: Offset in the image of the first byte described by this entry
274# (in bytes)
275#
276# @length: Length of the range described by this entry (in bytes)
277#
278# @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
279# before reaching one for which the range is allocated. The value is
280# in the range 0 to the depth of the image chain - 1.
281#
282# @zero: the sectors in this range read as zeros
283#
284# @data: reading the image will actually read data from a file (in particular,
285# if @offset is present this means that the sectors are not simply
286# preallocated, but contain actual data in raw format)
287#
288# @offset: if present, the image file stores the data for this range in
289# raw format at the given offset.
290#
291# Since 1.7
292##
293{ 'type': 'BlockDeviceMapEntry',
294 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
295 'data': 'bool', '*offset': 'int' } }
296
297##
298# @BlockDirtyInfo:
299#
300# Block dirty bitmap information.
301#
302# @count: number of dirty bytes according to the dirty bitmap
303#
304# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
305#
306# Since: 1.3
307##
308{ 'type': 'BlockDirtyInfo',
309 'data': {'count': 'int', 'granularity': 'int'} }
310
311##
312# @BlockInfo:
313#
314# Block device information. This structure describes a virtual device and
315# the backing device associated with it.
316#
317# @device: The device name associated with the virtual device.
318#
319# @type: This field is returned only for compatibility reasons, it should
320# not be used (always returns 'unknown')
321#
322# @removable: True if the device supports removable media.
323#
324# @locked: True if the guest has locked this device from having its media
325# removed
326#
327# @tray_open: #optional True if the device has a tray and it is open
328# (only present if removable is true)
329#
330# @dirty-bitmaps: #optional dirty bitmaps information (only present if the
331# driver has one or more dirty bitmaps) (Since 2.0)
332#
333# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
334# supports it and the VM is configured to stop on errors
335#
336# @inserted: #optional @BlockDeviceInfo describing the device if media is
337# present
338#
339# Since: 0.14.0
340##
341{ 'type': 'BlockInfo',
342 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
343 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
344 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
345 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
346
347##
348# @query-block:
349#
350# Get a list of BlockInfo for all virtual block devices.
351#
352# Returns: a list of @BlockInfo describing each virtual block device
353#
354# Since: 0.14.0
355##
356{ 'command': 'query-block', 'returns': ['BlockInfo'] }
357
358##
359# @BlockDeviceStats:
360#
361# Statistics of a virtual block device or a block backing device.
362#
363# @rd_bytes: The number of bytes read by the device.
364#
365# @wr_bytes: The number of bytes written by the device.
366#
367# @rd_operations: The number of read operations performed by the device.
368#
369# @wr_operations: The number of write operations performed by the device.
370#
371# @flush_operations: The number of cache flush operations performed by the
372# device (since 0.15.0)
373#
374# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
375# (since 0.15.0).
376#
377# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
378#
379# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
380#
381# @wr_highest_offset: The offset after the greatest byte written to the
382# device. The intended use of this information is for
383# growable sparse files (like qcow2) that are used on top
384# of a physical device.
385#
386# Since: 0.14.0
387##
388{ 'type': 'BlockDeviceStats',
389 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
390 'wr_operations': 'int', 'flush_operations': 'int',
391 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
392 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
393
394##
395# @BlockStats:
396#
397# Statistics of a virtual block device or a block backing device.
398#
399# @device: #optional If the stats are for a virtual block device, the name
400# corresponding to the virtual block device.
401#
402# @stats: A @BlockDeviceStats for the device.
403#
404# @parent: #optional This describes the file block device if it has one.
405#
406# @backing: #optional This describes the backing block device if it has one.
407# (Since 2.0)
408#
409# Since: 0.14.0
410##
411{ 'type': 'BlockStats',
412 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
413 '*parent': 'BlockStats',
414 '*backing': 'BlockStats'} }
415
416##
417# @query-blockstats:
418#
419# Query the @BlockStats for all virtual block devices.
420#
421# Returns: A list of @BlockStats for each virtual block devices.
422#
423# Since: 0.14.0
424##
425{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
426
427##
428# @BlockdevOnError:
429#
430# An enumeration of possible behaviors for errors on I/O operations.
431# The exact meaning depends on whether the I/O was initiated by a guest
432# or by a block job
433#
434# @report: for guest operations, report the error to the guest;
435# for jobs, cancel the job
436#
437# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
438# or BLOCK_JOB_ERROR)
439#
440# @enospc: same as @stop on ENOSPC, same as @report otherwise.
441#
442# @stop: for guest operations, stop the virtual machine;
443# for jobs, pause the job
444#
445# Since: 1.3
446##
447{ 'enum': 'BlockdevOnError',
448 'data': ['report', 'ignore', 'enospc', 'stop'] }
449
450##
451# @MirrorSyncMode:
452#
453# An enumeration of possible behaviors for the initial synchronization
454# phase of storage mirroring.
455#
456# @top: copies data in the topmost image to the destination
457#
458# @full: copies data from all images to the destination
459#
460# @none: only copy data written from now on
461#
462# Since: 1.3
463##
464{ 'enum': 'MirrorSyncMode',
465 'data': ['top', 'full', 'none'] }
466
467##
468# @BlockJobType:
469#
470# Type of a block job.
471#
472# @commit: block commit job type, see "block-commit"
473#
474# @stream: block stream job type, see "block-stream"
475#
476# @mirror: drive mirror job type, see "drive-mirror"
477#
478# @backup: drive backup job type, see "drive-backup"
479#
480# Since: 1.7
481##
482{ 'enum': 'BlockJobType',
483 'data': ['commit', 'stream', 'mirror', 'backup'] }
484
485##
486# @BlockJobInfo:
487#
488# Information about a long-running block device operation.
489#
490# @type: the job type ('stream' for image streaming)
491#
492# @device: the block device name
493#
494# @len: the maximum progress value
495#
496# @busy: false if the job is known to be in a quiescent state, with
497# no pending I/O. Since 1.3.
498#
499# @paused: whether the job is paused or, if @busy is true, will
500# pause itself as soon as possible. Since 1.3.
501#
502# @offset: the current progress value
503#
504# @speed: the rate limit, bytes per second
505#
506# @io-status: the status of the job (since 1.3)
507#
508# Since: 1.1
509##
510{ 'type': 'BlockJobInfo',
511 'data': {'type': 'str', 'device': 'str', 'len': 'int',
512 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
513 'io-status': 'BlockDeviceIoStatus'} }
514
515##
516# @query-block-jobs:
517#
518# Return information about long-running block device operations.
519#
520# Returns: a list of @BlockJobInfo for each active block job
521#
522# Since: 1.1
523##
524{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
525
526##
527# @block_passwd:
528#
529# This command sets the password of a block device that has not been open
530# with a password and requires one.
531#
532# The two cases where this can happen are a block device is created through
533# QEMU's initial command line or a block device is changed through the legacy
534# @change interface.
535#
536# In the event that the block device is created through the initial command
537# line, the VM will start in the stopped state regardless of whether '-S' is
538# used. The intention is for a management tool to query the block devices to
539# determine which ones are encrypted, set the passwords with this command, and
540# then start the guest with the @cont command.
541#
542# Either @device or @node-name must be set but not both.
543#
544# @device: #optional the name of the block backend device to set the password on
545#
546# @node-name: #optional graph node name to set the password on (Since 2.0)
547#
548# @password: the password to use for the device
549#
550# Returns: nothing on success
551# If @device is not a valid block device, DeviceNotFound
552# If @device is not encrypted, DeviceNotEncrypted
553#
554# Notes: Not all block formats support encryption and some that do are not
555# able to validate that a password is correct. Disk corruption may
556# occur if an invalid password is specified.
557#
558# Since: 0.14.0
559##
560{ 'command': 'block_passwd', 'data': {'*device': 'str',
561 '*node-name': 'str', 'password': 'str'} }
562
563##
564# @block_resize
565#
566# Resize a block image while a guest is running.
567#
568# Either @device or @node-name must be set but not both.
569#
570# @device: #optional the name of the device to get the image resized
571#
572# @node-name: #optional graph node name to get the image resized (Since 2.0)
573#
574# @size: new image size in bytes
575#
576# Returns: nothing on success
577# If @device is not a valid block device, DeviceNotFound
578#
579# Since: 0.14.0
580##
581{ 'command': 'block_resize', 'data': { '*device': 'str',
582 '*node-name': 'str',
583 'size': 'int' }}
584
585##
586# @NewImageMode
587#
588# An enumeration that tells QEMU how to set the backing file path in
589# a new image file.
590#
591# @existing: QEMU should look for an existing image file.
592#
593# @absolute-paths: QEMU should create a new image with absolute paths
594# for the backing file. If there is no backing file available, the new
595# image will not be backed either.
596#
597# Since: 1.1
598##
599{ 'enum': 'NewImageMode',
600 'data': [ 'existing', 'absolute-paths' ] }
601
602##
603# @BlockdevSnapshot
604#
605# Either @device or @node-name must be set but not both.
606#
607# @device: #optional the name of the device to generate the snapshot from.
608#
609# @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
610#
611# @snapshot-file: the target of the new image. A new file will be created.
612#
613# @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
614#
615# @format: #optional the format of the snapshot image, default is 'qcow2'.
616#
617# @mode: #optional whether and how QEMU should create a new image, default is
618# 'absolute-paths'.
619##
620{ 'type': 'BlockdevSnapshot',
621 'data': { '*device': 'str', '*node-name': 'str',
622 'snapshot-file': 'str', '*snapshot-node-name': 'str',
623 '*format': 'str', '*mode': 'NewImageMode' } }
624
625##
626# @DriveBackup
627#
628# @device: the name of the device which should be copied.
629#
630# @target: the target of the new image. If the file exists, or if it
631# is a device, the existing file/device will be used as the new
632# destination. If it does not exist, a new file will be created.
633#
634# @format: #optional the format of the new destination, default is to
635# probe if @mode is 'existing', else the format of the source
636#
637# @sync: what parts of the disk image should be copied to the destination
638# (all the disk, only the sectors allocated in the topmost image, or
639# only new I/O).
640#
641# @mode: #optional whether and how QEMU should create a new image, default is
642# 'absolute-paths'.
643#
644# @speed: #optional the maximum speed, in bytes per second
645#
646# @on-source-error: #optional the action to take on an error on the source,
647# default 'report'. 'stop' and 'enospc' can only be used
648# if the block device supports io-status (see BlockInfo).
649#
650# @on-target-error: #optional the action to take on an error on the target,
651# default 'report' (no limitations, since this applies to
652# a different block device than @device).
653#
654# Note that @on-source-error and @on-target-error only affect background I/O.
655# If an error occurs during a guest write request, the device's rerror/werror
656# actions will be used.
657#
658# Since: 1.6
659##
660{ 'type': 'DriveBackup',
661 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
662 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
663 '*speed': 'int',
664 '*on-source-error': 'BlockdevOnError',
665 '*on-target-error': 'BlockdevOnError' } }
666
667##
668# @blockdev-snapshot-sync
669#
670# Generates a synchronous snapshot of a block device.
671#
672# For the arguments, see the documentation of BlockdevSnapshot.
673#
674# Returns: nothing on success
675# If @device is not a valid block device, DeviceNotFound
676#
677# Since 0.14.0
678##
679{ 'command': 'blockdev-snapshot-sync',
680 'data': 'BlockdevSnapshot' }
681
682##
683# @block-commit
684#
685# Live commit of data from overlay image nodes into backing nodes - i.e.,
686# writes data between 'top' and 'base' into 'base'.
687#
688# @device: the name of the device
689#
690# @base: #optional The file name of the backing image to write data into.
691# If not specified, this is the deepest backing image
692#
693# @top: The file name of the backing image within the image chain,
694# which contains the topmost data to be committed down.
695#
696# If top == base, that is an error.
697# If top == active, the job will not be completed by itself,
698# user needs to complete the job with the block-job-complete
699# command after getting the ready event. (Since 2.0)
700#
701# If the base image is smaller than top, then the base image
702# will be resized to be the same size as top. If top is
703# smaller than the base image, the base will not be
704# truncated. If you want the base image size to match the
705# size of the smaller top, you can safely truncate it
706# yourself once the commit operation successfully completes.
707#
708#
709# @speed: #optional the maximum speed, in bytes per second
710#
711# Returns: Nothing on success
712# If commit or stream is already active on this device, DeviceInUse
713# If @device does not exist, DeviceNotFound
714# If image commit is not supported by this device, NotSupported
715# If @base or @top is invalid, a generic error is returned
716# If @speed is invalid, InvalidParameter
717#
718# Since: 1.3
719#
720##
721{ 'command': 'block-commit',
722 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
723 '*speed': 'int' } }
724
725##
726# @drive-backup
727#
728# Start a point-in-time copy of a block device to a new destination. The
729# status of ongoing drive-backup operations can be checked with
730# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
731# The operation can be stopped before it has completed using the
732# block-job-cancel command.
733#
734# For the arguments, see the documentation of DriveBackup.
735#
736# Returns: nothing on success
737# If @device is not a valid block device, DeviceNotFound
738#
739# Since 1.6
740##
741{ 'command': 'drive-backup', 'data': 'DriveBackup' }
742
743##
744# @query-named-block-nodes
745#
746# Get the named block driver list
747#
748# Returns: the list of BlockDeviceInfo
749#
750# Since 2.0
751##
752{ 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
753
754##
755# @drive-mirror
756#
757# Start mirroring a block device's writes to a new destination.
758#
759# @device: the name of the device whose writes should be mirrored.
760#
761# @target: the target of the new image. If the file exists, or if it
762# is a device, the existing file/device will be used as the new
763# destination. If it does not exist, a new file will be created.
764#
765# @format: #optional the format of the new destination, default is to
766# probe if @mode is 'existing', else the format of the source
767#
4c828dc6
BC
768# @node-name: #optional the new block driver state node name in the graph
769# (Since 2.1)
770#
1ad166b6
BC
771# @mode: #optional whether and how QEMU should create a new image, default is
772# 'absolute-paths'.
773#
774# @speed: #optional the maximum speed, in bytes per second
775#
776# @sync: what parts of the disk image should be copied to the destination
777# (all the disk, only the sectors allocated in the topmost image, or
778# only new I/O).
779#
780# @granularity: #optional granularity of the dirty bitmap, default is 64K
781# if the image format doesn't have clusters, 4K if the clusters
782# are smaller than that, else the cluster size. Must be a
783# power of 2 between 512 and 64M (since 1.4).
784#
785# @buf-size: #optional maximum amount of data in flight from source to
786# target (since 1.4).
787#
788# @on-source-error: #optional the action to take on an error on the source,
789# default 'report'. 'stop' and 'enospc' can only be used
790# if the block device supports io-status (see BlockInfo).
791#
792# @on-target-error: #optional the action to take on an error on the target,
793# default 'report' (no limitations, since this applies to
794# a different block device than @device).
795#
796# Returns: nothing on success
797# If @device is not a valid block device, DeviceNotFound
798#
799# Since 1.3
800##
801{ 'command': 'drive-mirror',
802 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
4c828dc6 803 '*node-name': 'str',
1ad166b6
BC
804 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
805 '*speed': 'int', '*granularity': 'uint32',
806 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
807 '*on-target-error': 'BlockdevOnError' } }
808
809##
810# @block_set_io_throttle:
811#
812# Change I/O throttle limits for a block drive.
813#
814# @device: The name of the device
815#
816# @bps: total throughput limit in bytes per second
817#
818# @bps_rd: read throughput limit in bytes per second
819#
820# @bps_wr: write throughput limit in bytes per second
821#
822# @iops: total I/O operations per second
823#
824# @ops_rd: read I/O operations per second
825#
826# @iops_wr: write I/O operations per second
827#
828# @bps_max: #optional total max in bytes (Since 1.7)
829#
830# @bps_rd_max: #optional read max in bytes (Since 1.7)
831#
832# @bps_wr_max: #optional write max in bytes (Since 1.7)
833#
834# @iops_max: #optional total I/O operations max (Since 1.7)
835#
836# @iops_rd_max: #optional read I/O operations max (Since 1.7)
837#
838# @iops_wr_max: #optional write I/O operations max (Since 1.7)
839#
840# @iops_size: #optional an I/O size in bytes (Since 1.7)
841#
842# Returns: Nothing on success
843# If @device is not a valid block device, DeviceNotFound
844#
845# Since: 1.1
846##
847{ 'command': 'block_set_io_throttle',
848 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
849 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
850 '*bps_max': 'int', '*bps_rd_max': 'int',
851 '*bps_wr_max': 'int', '*iops_max': 'int',
852 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
853 '*iops_size': 'int' } }
854
855##
856# @block-stream:
857#
858# Copy data from a backing file into a block device.
859#
860# The block streaming operation is performed in the background until the entire
861# backing file has been copied. This command returns immediately once streaming
862# has started. The status of ongoing block streaming operations can be checked
863# with query-block-jobs. The operation can be stopped before it has completed
864# using the block-job-cancel command.
865#
866# If a base file is specified then sectors are not copied from that base file and
867# its backing chain. When streaming completes the image file will have the base
868# file as its backing file. This can be used to stream a subset of the backing
869# file chain instead of flattening the entire image.
870#
871# On successful completion the image file is updated to drop the backing file
872# and the BLOCK_JOB_COMPLETED event is emitted.
873#
874# @device: the device name
875#
876# @base: #optional the common backing file name
877#
878# @speed: #optional the maximum speed, in bytes per second
879#
880# @on-error: #optional the action to take on an error (default report).
881# 'stop' and 'enospc' can only be used if the block device
882# supports io-status (see BlockInfo). Since 1.3.
883#
884# Returns: Nothing on success
885# If @device does not exist, DeviceNotFound
886#
887# Since: 1.1
888##
889{ 'command': 'block-stream',
890 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
891 '*on-error': 'BlockdevOnError' } }
892
893##
894# @block-job-set-speed:
895#
896# Set maximum speed for a background block operation.
897#
898# This command can only be issued when there is an active block job.
899#
900# Throttling can be disabled by setting the speed to 0.
901#
902# @device: the device name
903#
904# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
905# Defaults to 0.
906#
907# Returns: Nothing on success
908# If no background operation is active on this device, DeviceNotActive
909#
910# Since: 1.1
911##
912{ 'command': 'block-job-set-speed',
913 'data': { 'device': 'str', 'speed': 'int' } }
914
915##
916# @block-job-cancel:
917#
918# Stop an active background block operation.
919#
920# This command returns immediately after marking the active background block
921# operation for cancellation. It is an error to call this command if no
922# operation is in progress.
923#
924# The operation will cancel as soon as possible and then emit the
925# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
926# enumerated using query-block-jobs.
927#
928# For streaming, the image file retains its backing file unless the streaming
929# operation happens to complete just as it is being cancelled. A new streaming
930# operation can be started at a later time to finish copying all data from the
931# backing file.
932#
933# @device: the device name
934#
935# @force: #optional whether to allow cancellation of a paused job (default
936# false). Since 1.3.
937#
938# Returns: Nothing on success
939# If no background operation is active on this device, DeviceNotActive
940#
941# Since: 1.1
942##
943{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
944
945##
946# @block-job-pause:
947#
948# Pause an active background block operation.
949#
950# This command returns immediately after marking the active background block
951# operation for pausing. It is an error to call this command if no
952# operation is in progress. Pausing an already paused job has no cumulative
953# effect; a single block-job-resume command will resume the job.
954#
955# The operation will pause as soon as possible. No event is emitted when
956# the operation is actually paused. Cancelling a paused job automatically
957# resumes it.
958#
959# @device: the device name
960#
961# Returns: Nothing on success
962# If no background operation is active on this device, DeviceNotActive
963#
964# Since: 1.3
965##
966{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
967
968##
969# @block-job-resume:
970#
971# Resume an active background block operation.
972#
973# This command returns immediately after resuming a paused background block
974# operation. It is an error to call this command if no operation is in
975# progress. Resuming an already running job is not an error.
976#
977# This command also clears the error status of the job.
978#
979# @device: the device name
980#
981# Returns: Nothing on success
982# If no background operation is active on this device, DeviceNotActive
983#
984# Since: 1.3
985##
986{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
987
988##
989# @block-job-complete:
990#
991# Manually trigger completion of an active background block operation. This
992# is supported for drive mirroring, where it also switches the device to
993# write to the target path only. The ability to complete is signaled with
994# a BLOCK_JOB_READY event.
995#
996# This command completes an active background block operation synchronously.
997# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
998# is not defined. Note that if an I/O error occurs during the processing of
999# this command: 1) the command itself will fail; 2) the error will be processed
1000# according to the rerror/werror arguments that were specified when starting
1001# the operation.
1002#
1003# A cancelled or paused job cannot be completed.
1004#
1005# @device: the device name
1006#
1007# Returns: Nothing on success
1008# If no background operation is active on this device, DeviceNotActive
1009#
1010# Since: 1.3
1011##
1012{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
1013
1014##
1015# @BlockdevDiscardOptions
1016#
1017# Determines how to handle discard requests.
1018#
1019# @ignore: Ignore the request
1020# @unmap: Forward as an unmap request
1021#
1022# Since: 1.7
1023##
1024{ 'enum': 'BlockdevDiscardOptions',
1025 'data': [ 'ignore', 'unmap' ] }
1026
1027##
1028# @BlockdevDetectZeroesOptions
1029#
1030# Describes the operation mode for the automatic conversion of plain
1031# zero writes by the OS to driver specific optimized zero write commands.
1032#
1033# @off: Disabled (default)
1034# @on: Enabled
1035# @unmap: Enabled and even try to unmap blocks if possible. This requires
1036# also that @BlockdevDiscardOptions is set to unmap for this device.
1037#
1038# Since: 2.1
1039##
1040{ 'enum': 'BlockdevDetectZeroesOptions',
1041 'data': [ 'off', 'on', 'unmap' ] }
1042
1043##
1044# @BlockdevAioOptions
1045#
1046# Selects the AIO backend to handle I/O requests
1047#
1048# @threads: Use qemu's thread pool
1049# @native: Use native AIO backend (only Linux and Windows)
1050#
1051# Since: 1.7
1052##
1053{ 'enum': 'BlockdevAioOptions',
1054 'data': [ 'threads', 'native' ] }
1055
1056##
1057# @BlockdevCacheOptions
1058#
1059# Includes cache-related options for block devices
1060#
1061# @writeback: #optional enables writeback mode for any caches (default: true)
1062# @direct: #optional enables use of O_DIRECT (bypass the host page cache;
1063# default: false)
1064# @no-flush: #optional ignore any flush requests for the device (default:
1065# false)
1066#
1067# Since: 1.7
1068##
1069{ 'type': 'BlockdevCacheOptions',
1070 'data': { '*writeback': 'bool',
1071 '*direct': 'bool',
1072 '*no-flush': 'bool' } }
1073
1074##
1075# @BlockdevDriver
1076#
1077# Drivers that are supported in block device operations.
1078#
1079# @host_device, @host_cdrom, @host_floppy: Since 2.1
1080#
1081# Since: 2.0
1082##
1083{ 'enum': 'BlockdevDriver',
1084 'data': [ 'file', 'host_device', 'host_cdrom', 'host_floppy',
1085 'http', 'https', 'ftp', 'ftps', 'tftp', 'vvfat', 'blkdebug',
1086 'blkverify', 'bochs', 'cloop', 'cow', 'dmg', 'parallels', 'qcow',
1087 'qcow2', 'qed', 'raw', 'vdi', 'vhdx', 'vmdk', 'vpc', 'quorum' ] }
1088
1089##
1090# @BlockdevOptionsBase
1091#
1092# Options that are available for all block devices, independent of the block
1093# driver.
1094#
1095# @driver: block driver name
1096# @id: #optional id by which the new block device can be referred to.
1097# This is a required option on the top level of blockdev-add, and
1098# currently not allowed on any other level.
1099# @node-name: #optional the name of a block driver state node (Since 2.0)
1100# @discard: #optional discard-related options (default: ignore)
1101# @cache: #optional cache-related options
1102# @aio: #optional AIO backend (default: threads)
1103# @rerror: #optional how to handle read errors on the device
1104# (default: report)
1105# @werror: #optional how to handle write errors on the device
1106# (default: enospc)
1107# @read-only: #optional whether the block device should be read-only
1108# (default: false)
1109# @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
1110# (default: off)
1111#
1112# Since: 1.7
1113##
1114{ 'type': 'BlockdevOptionsBase',
1115 'data': { 'driver': 'BlockdevDriver',
1116 '*id': 'str',
1117 '*node-name': 'str',
1118 '*discard': 'BlockdevDiscardOptions',
1119 '*cache': 'BlockdevCacheOptions',
1120 '*aio': 'BlockdevAioOptions',
1121 '*rerror': 'BlockdevOnError',
1122 '*werror': 'BlockdevOnError',
1123 '*read-only': 'bool',
1124 '*detect-zeroes': 'BlockdevDetectZeroesOptions' } }
1125
1126##
1127# @BlockdevOptionsFile
1128#
1129# Driver specific block device options for the file backend and similar
1130# protocols.
1131#
1132# @filename: path to the image file
1133#
1134# Since: 1.7
1135##
1136{ 'type': 'BlockdevOptionsFile',
1137 'data': { 'filename': 'str' } }
1138
1139##
1140# @BlockdevOptionsVVFAT
1141#
1142# Driver specific block device options for the vvfat protocol.
1143#
1144# @dir: directory to be exported as FAT image
1145# @fat-type: #optional FAT type: 12, 16 or 32
1146# @floppy: #optional whether to export a floppy image (true) or
1147# partitioned hard disk (false; default)
1148# @rw: #optional whether to allow write operations (default: false)
1149#
1150# Since: 1.7
1151##
1152{ 'type': 'BlockdevOptionsVVFAT',
1153 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
1154 '*rw': 'bool' } }
1155
1156##
1157# @BlockdevOptionsGenericFormat
1158#
1159# Driver specific block device options for image format that have no option
1160# besides their data source.
1161#
1162# @file: reference to or definition of the data source block device
1163#
1164# Since: 1.7
1165##
1166{ 'type': 'BlockdevOptionsGenericFormat',
1167 'data': { 'file': 'BlockdevRef' } }
1168
1169##
1170# @BlockdevOptionsGenericCOWFormat
1171#
1172# Driver specific block device options for image format that have no option
1173# besides their data source and an optional backing file.
1174#
1175# @backing: #optional reference to or definition of the backing file block
1176# device (if missing, taken from the image file content). It is
1177# allowed to pass an empty string here in order to disable the
1178# default backing file.
1179#
1180# Since: 1.7
1181##
1182{ 'type': 'BlockdevOptionsGenericCOWFormat',
1183 'base': 'BlockdevOptionsGenericFormat',
1184 'data': { '*backing': 'BlockdevRef' } }
1185
1186##
1187# @BlockdevOptionsQcow2
1188#
1189# Driver specific block device options for qcow2.
1190#
1191# @lazy-refcounts: #optional whether to enable the lazy refcounts
1192# feature (default is taken from the image file)
1193#
1194# @pass-discard-request: #optional whether discard requests to the qcow2
1195# device should be forwarded to the data source
1196#
1197# @pass-discard-snapshot: #optional whether discard requests for the data source
1198# should be issued when a snapshot operation (e.g.
1199# deleting a snapshot) frees clusters in the qcow2 file
1200#
1201# @pass-discard-other: #optional whether discard requests for the data source
1202# should be issued on other occasions where a cluster
1203# gets freed
1204#
1205# Since: 1.7
1206##
1207{ 'type': 'BlockdevOptionsQcow2',
1208 'base': 'BlockdevOptionsGenericCOWFormat',
1209 'data': { '*lazy-refcounts': 'bool',
1210 '*pass-discard-request': 'bool',
1211 '*pass-discard-snapshot': 'bool',
1212 '*pass-discard-other': 'bool' } }
1213
1214##
1215# @BlkdebugEvent
1216#
1217# Trigger events supported by blkdebug.
1218##
1219{ 'enum': 'BlkdebugEvent',
1220 'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
1221 'l1_grow.activate_table', 'l2_load', 'l2_update',
1222 'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
1223 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
1224 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
1225 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
1226 'refblock_load', 'refblock_update', 'refblock_update_part',
1227 'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
1228 'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
1229 'refblock_alloc.switch_table', 'cluster_alloc',
1230 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
1231 'flush_to_disk' ] }
1232
1233##
1234# @BlkdebugInjectErrorOptions
1235#
1236# Describes a single error injection for blkdebug.
1237#
1238# @event: trigger event
1239#
1240# @state: #optional the state identifier blkdebug needs to be in to
1241# actually trigger the event; defaults to "any"
1242#
1243# @errno: #optional error identifier (errno) to be returned; defaults to
1244# EIO
1245#
1246# @sector: #optional specifies the sector index which has to be affected
1247# in order to actually trigger the event; defaults to "any
1248# sector"
1249#
1250# @once: #optional disables further events after this one has been
1251# triggered; defaults to false
1252#
1253# @immediately: #optional fail immediately; defaults to false
1254#
1255# Since: 2.0
1256##
1257{ 'type': 'BlkdebugInjectErrorOptions',
1258 'data': { 'event': 'BlkdebugEvent',
1259 '*state': 'int',
1260 '*errno': 'int',
1261 '*sector': 'int',
1262 '*once': 'bool',
1263 '*immediately': 'bool' } }
1264
1265##
1266# @BlkdebugSetStateOptions
1267#
1268# Describes a single state-change event for blkdebug.
1269#
1270# @event: trigger event
1271#
1272# @state: #optional the current state identifier blkdebug needs to be in;
1273# defaults to "any"
1274#
1275# @new_state: the state identifier blkdebug is supposed to assume if
1276# this event is triggered
1277#
1278# Since: 2.0
1279##
1280{ 'type': 'BlkdebugSetStateOptions',
1281 'data': { 'event': 'BlkdebugEvent',
1282 '*state': 'int',
1283 'new_state': 'int' } }
1284
1285##
1286# @BlockdevOptionsBlkdebug
1287#
1288# Driver specific block device options for blkdebug.
1289#
1290# @image: underlying raw block device (or image file)
1291#
1292# @config: #optional filename of the configuration file
1293#
1294# @align: #optional required alignment for requests in bytes
1295#
1296# @inject-error: #optional array of error injection descriptions
1297#
1298# @set-state: #optional array of state-change descriptions
1299#
1300# Since: 2.0
1301##
1302{ 'type': 'BlockdevOptionsBlkdebug',
1303 'data': { 'image': 'BlockdevRef',
1304 '*config': 'str',
1305 '*align': 'int',
1306 '*inject-error': ['BlkdebugInjectErrorOptions'],
1307 '*set-state': ['BlkdebugSetStateOptions'] } }
1308
1309##
1310# @BlockdevOptionsBlkverify
1311#
1312# Driver specific block device options for blkverify.
1313#
1314# @test: block device to be tested
1315#
1316# @raw: raw image used for verification
1317#
1318# Since: 2.0
1319##
1320{ 'type': 'BlockdevOptionsBlkverify',
1321 'data': { 'test': 'BlockdevRef',
1322 'raw': 'BlockdevRef' } }
1323
1324##
1325# @BlockdevOptionsQuorum
1326#
1327# Driver specific block device options for Quorum
1328#
1329# @blkverify: #optional true if the driver must print content mismatch
1330# set to false by default
1331#
1332# @children: the children block devices to use
1333#
1334# @vote-threshold: the vote limit under which a read will fail
1335#
cf29a570
BC
1336# @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached
1337# (Since 2.1)
1338#
1ad166b6
BC
1339# Since: 2.0
1340##
1341{ 'type': 'BlockdevOptionsQuorum',
1342 'data': { '*blkverify': 'bool',
1343 'children': [ 'BlockdevRef' ],
cf29a570 1344 'vote-threshold': 'int', '*rewrite-corrupted': 'bool' } }
1ad166b6
BC
1345
1346##
1347# @BlockdevOptions
1348#
1349# Options for creating a block device.
1350#
1351# Since: 1.7
1352##
1353{ 'union': 'BlockdevOptions',
1354 'base': 'BlockdevOptionsBase',
1355 'discriminator': 'driver',
1356 'data': {
1357 'file': 'BlockdevOptionsFile',
1358 'host_device':'BlockdevOptionsFile',
1359 'host_cdrom': 'BlockdevOptionsFile',
1360 'host_floppy':'BlockdevOptionsFile',
1361 'http': 'BlockdevOptionsFile',
1362 'https': 'BlockdevOptionsFile',
1363 'ftp': 'BlockdevOptionsFile',
1364 'ftps': 'BlockdevOptionsFile',
1365 'tftp': 'BlockdevOptionsFile',
1366# TODO gluster: Wait for structured options
1367# TODO iscsi: Wait for structured options
1368# TODO nbd: Should take InetSocketAddress for 'host'?
1369# TODO nfs: Wait for structured options
1370# TODO rbd: Wait for structured options
1371# TODO sheepdog: Wait for structured options
1372# TODO ssh: Should take InetSocketAddress for 'host'?
1373 'vvfat': 'BlockdevOptionsVVFAT',
1374 'blkdebug': 'BlockdevOptionsBlkdebug',
1375 'blkverify': 'BlockdevOptionsBlkverify',
1376 'bochs': 'BlockdevOptionsGenericFormat',
1377 'cloop': 'BlockdevOptionsGenericFormat',
1378 'cow': 'BlockdevOptionsGenericCOWFormat',
1379 'dmg': 'BlockdevOptionsGenericFormat',
1380 'parallels': 'BlockdevOptionsGenericFormat',
1381 'qcow': 'BlockdevOptionsGenericCOWFormat',
1382 'qcow2': 'BlockdevOptionsQcow2',
1383 'qed': 'BlockdevOptionsGenericCOWFormat',
1384 'raw': 'BlockdevOptionsGenericFormat',
1385 'vdi': 'BlockdevOptionsGenericFormat',
1386 'vhdx': 'BlockdevOptionsGenericFormat',
1387 'vmdk': 'BlockdevOptionsGenericCOWFormat',
1388 'vpc': 'BlockdevOptionsGenericFormat',
1389 'quorum': 'BlockdevOptionsQuorum'
1390 } }
1391
1392##
1393# @BlockdevRef
1394#
1395# Reference to a block device.
1396#
1397# @definition: defines a new block device inline
1398# @reference: references the ID of an existing block device. An
1399# empty string means that no block device should be
1400# referenced.
1401#
1402# Since: 1.7
1403##
1404{ 'union': 'BlockdevRef',
1405 'discriminator': {},
1406 'data': { 'definition': 'BlockdevOptions',
1407 'reference': 'str' } }
1408
1409##
1410# @blockdev-add:
1411#
1412# Creates a new block device.
1413#
1414# @options: block device options for the new device
1415#
1416# Since: 1.7
1417##
1418{ 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
1419
a589569f
WX
1420
1421##
1422# @BlockErrorAction
1423#
1424# An enumeration of action that has been taken when a DISK I/O occurs
1425#
1426# @ignore: error has been ignored
1427#
1428# @report: error has been reported to the device
1429#
1430# @stop: error caused VM to be stopped
1431#
1432# Since: 2.1
1433##
1434{ 'enum': 'BlockErrorAction',
1435 'data': [ 'ignore', 'report', 'stop' ] }
5a2d2cbd
WX
1436
1437
c120f0fa
WX
1438##
1439# @BLOCK_IMAGE_CORRUPTED
1440#
1441# Emitted when a disk image is being marked corrupt
1442#
1443# @device: device name
1444#
1445# @msg: informative message for human consumption, such as the kind of
1446# corruption being detected
1447#
1448# @offset: #optional, if the corruption resulted from an image access, this is
1449# the access offset into the image
1450#
1451# @size: #optional, if the corruption resulted from an image access, this is
1452# the access size
1453#
1454# Since: 1.7
1455##
1456{ 'event': 'BLOCK_IMAGE_CORRUPTED',
1457 'data': { 'device' : 'str',
1458 'msg' : 'str',
1459 '*offset': 'int',
1460 '*size' : 'int' } }
1461
5a2d2cbd
WX
1462##
1463# @BLOCK_IO_ERROR
1464#
1465# Emitted when a disk I/O error occurs
1466#
1467# @device: device name
1468#
1469# @operation: I/O operation
1470#
1471# @action: action that has been taken
1472#
1473# Note: If action is "stop", a STOP event will eventually follow the
1474# BLOCK_IO_ERROR event
1475#
1476# Since: 0.13.0
1477##
1478{ 'event': 'BLOCK_IO_ERROR',
1479 'data': { 'device': 'str', 'operation': 'IoOperationType',
1480 'action': 'BlockErrorAction' } }
1481
bcada37b
WX
1482##
1483# @BLOCK_JOB_COMPLETED
1484#
1485# Emitted when a block job has completed
1486#
1487# @type: job type
1488#
1489# @device: device name
1490#
1491# @len: maximum progress value
1492#
1493# @offset: current progress value. On success this is equal to len.
1494# On failure this is less than len
1495#
1496# @speed: rate limit, bytes per second
1497#
1498# @error: #optional, error message. Only present on failure. This field
1499# contains a human-readable error message. There are no semantics
1500# other than that streaming has failed and clients should not try to
1501# interpret the error string
1502#
1503# Since: 1.1
1504##
1505{ 'event': 'BLOCK_JOB_COMPLETED',
1506 'data': { 'type' : 'BlockJobType',
1507 'device': 'str',
1508 'len' : 'int',
1509 'offset': 'int',
1510 'speed' : 'int',
1511 '*error': 'str' } }
1512
1513##
1514# @BLOCK_JOB_CANCELLED
1515#
1516# Emitted when a block job has been cancelled
1517#
1518# @type: job type
1519#
1520# @device: device name
1521#
1522# @len: maximum progress value
1523#
1524# @offset: current progress value. On success this is equal to len.
1525# On failure this is less than len
1526#
1527# @speed: rate limit, bytes per second
1528#
1529# Since: 1.1
1530##
1531{ 'event': 'BLOCK_JOB_CANCELLED',
1532 'data': { 'type' : 'BlockJobType',
1533 'device': 'str',
1534 'len' : 'int',
1535 'offset': 'int',
1536 'speed' : 'int' } }
1537
5a2d2cbd
WX
1538##
1539# @BLOCK_JOB_ERROR
1540#
1541# Emitted when a block job encounters an error
1542#
1543# @device: device name
1544#
1545# @operation: I/O operation
1546#
1547# @action: action that has been taken
1548#
1549# Since: 1.3
1550##
1551{ 'event': 'BLOCK_JOB_ERROR',
1552 'data': { 'device' : 'str',
1553 'operation': 'IoOperationType',
1554 'action' : 'BlockdevOnError' } }
bcada37b
WX
1555
1556##
1557# @BLOCK_JOB_READY
1558#
1559# Emitted when a block job is ready to complete
1560#
518848a2
MA
1561# @type: job type
1562#
bcada37b
WX
1563# @device: device name
1564#
518848a2
MA
1565# @len: maximum progress value
1566#
1567# @offset: current progress value. On success this is equal to len.
1568# On failure this is less than len
1569#
1570# @speed: rate limit, bytes per second
1571#
bcada37b
WX
1572# Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
1573# event
1574#
1575# Since: 1.3
1576##
1577{ 'event': 'BLOCK_JOB_READY',
518848a2
MA
1578 'data': { 'type' : 'BlockJobType',
1579 'device': 'str',
1580 'len' : 'int',
1581 'offset': 'int',
1582 'speed' : 'int' } }