1# -*- Mode: Python -*- 2# vim: filetype=python 3 4## 5# == Block core (VM unrelated) 6## 7 8{ 'include': 'common.json' } 9{ 'include': 'crypto.json' } 10{ 'include': 'job.json' } 11{ 'include': 'sockets.json' } 12 13## 14# @SnapshotInfo: 15# 16# @id: unique snapshot id 17# 18# @name: user chosen name 19# 20# @vm-state-size: size of the VM state 21# 22# @date-sec: UTC date of the snapshot in seconds 23# 24# @date-nsec: fractional part in nano seconds to be used with date-sec 25# 26# @vm-clock-sec: VM clock relative to boot in seconds 27# 28# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec 29# 30# @icount: Current instruction count. Appears when execution record/replay 31# is enabled. Used for "time-traveling" to match the moment 32# in the recorded execution with the snapshots. This counter may 33# be obtained through @query-replay command (since 5.2) 34# 35# Since: 1.3 36# 37## 38{ 'struct': 'SnapshotInfo', 39 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int', 40 'date-sec': 'int', 'date-nsec': 'int', 41 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int', 42 '*icount': 'int' } } 43 44## 45# @ImageInfoSpecificQCow2EncryptionBase: 46# 47# @format: The encryption format 48# 49# Since: 2.10 50## 51{ 'struct': 'ImageInfoSpecificQCow2EncryptionBase', 52 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}} 53 54## 55# @ImageInfoSpecificQCow2Encryption: 56# 57# Since: 2.10 58## 59{ 'union': 'ImageInfoSpecificQCow2Encryption', 60 'base': 'ImageInfoSpecificQCow2EncryptionBase', 61 'discriminator': 'format', 62 'data': { 'luks': 'QCryptoBlockInfoLUKS' } } 63 64## 65# @ImageInfoSpecificQCow2: 66# 67# @compat: compatibility level 68# 69# @data-file: the filename of the external data file that is stored in the 70# image and used as a default for opening the image (since: 4.0) 71# 72# @data-file-raw: True if the external data file must stay valid as a 73# standalone (read-only) raw image without looking at qcow2 74# metadata (since: 4.0) 75# 76# @extended-l2: true if the image has extended L2 entries; only valid for 77# compat >= 1.1 (since 5.2) 78# 79# @lazy-refcounts: on or off; only valid for compat >= 1.1 80# 81# @corrupt: true if the image has been marked corrupt; only valid for 82# compat >= 1.1 (since 2.2) 83# 84# @refcount-bits: width of a refcount entry in bits (since 2.3) 85# 86# @encrypt: details about encryption parameters; only set if image 87# is encrypted (since 2.10) 88# 89# @bitmaps: A list of qcow2 bitmap details (since 4.0) 90# 91# @compression-type: the image cluster compression method (since 5.1) 92# 93# Since: 1.7 94## 95{ 'struct': 'ImageInfoSpecificQCow2', 96 'data': { 97 'compat': 'str', 98 '*data-file': 'str', 99 '*data-file-raw': 'bool', 100 '*extended-l2': 'bool', 101 '*lazy-refcounts': 'bool', 102 '*corrupt': 'bool', 103 'refcount-bits': 'int', 104 '*encrypt': 'ImageInfoSpecificQCow2Encryption', 105 '*bitmaps': ['Qcow2BitmapInfo'], 106 'compression-type': 'Qcow2CompressionType' 107 } } 108 109## 110# @ImageInfoSpecificVmdk: 111# 112# @create-type: The create type of VMDK image 113# 114# @cid: Content id of image 115# 116# @parent-cid: Parent VMDK image's cid 117# 118# @extents: List of extent files 119# 120# Since: 1.7 121## 122{ 'struct': 'ImageInfoSpecificVmdk', 123 'data': { 124 'create-type': 'str', 125 'cid': 'int', 126 'parent-cid': 'int', 127 'extents': ['ImageInfo'] 128 } } 129 130## 131# @ImageInfoSpecificRbd: 132# 133# @encryption-format: Image encryption format 134# 135# Since: 6.1 136## 137{ 'struct': 'ImageInfoSpecificRbd', 138 'data': { 139 '*encryption-format': 'RbdImageEncryptionFormat' 140 } } 141 142## 143# @ImageInfoSpecificKind: 144# 145# @luks: Since 2.7 146# @rbd: Since 6.1 147# 148# Since: 1.7 149## 150{ 'enum': 'ImageInfoSpecificKind', 151 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd' ] } 152 153## 154# @ImageInfoSpecificQCow2Wrapper: 155# 156# Since: 1.7 157## 158{ 'struct': 'ImageInfoSpecificQCow2Wrapper', 159 'data': { 'data': 'ImageInfoSpecificQCow2' } } 160 161## 162# @ImageInfoSpecificVmdkWrapper: 163# 164# Since: 6.1 165## 166{ 'struct': 'ImageInfoSpecificVmdkWrapper', 167 'data': { 'data': 'ImageInfoSpecificVmdk' } } 168 169## 170# @ImageInfoSpecificLUKSWrapper: 171# 172# Since: 2.7 173## 174{ 'struct': 'ImageInfoSpecificLUKSWrapper', 175 'data': { 'data': 'QCryptoBlockInfoLUKS' } } 176# If we need to add block driver specific parameters for 177# LUKS in future, then we'll subclass QCryptoBlockInfoLUKS 178# to define a ImageInfoSpecificLUKS 179 180## 181# @ImageInfoSpecificRbdWrapper: 182# 183# Since: 6.1 184## 185{ 'struct': 'ImageInfoSpecificRbdWrapper', 186 'data': { 'data': 'ImageInfoSpecificRbd' } } 187 188## 189# @ImageInfoSpecific: 190# 191# A discriminated record of image format specific information structures. 192# 193# Since: 1.7 194## 195{ 'union': 'ImageInfoSpecific', 196 'base': { 'type': 'ImageInfoSpecificKind' }, 197 'discriminator': 'type', 198 'data': { 199 'qcow2': 'ImageInfoSpecificQCow2Wrapper', 200 'vmdk': 'ImageInfoSpecificVmdkWrapper', 201 'luks': 'ImageInfoSpecificLUKSWrapper', 202 'rbd': 'ImageInfoSpecificRbdWrapper' 203 } } 204 205## 206# @ImageInfo: 207# 208# Information about a QEMU image file 209# 210# @filename: name of the image file 211# 212# @format: format of the image file 213# 214# @virtual-size: maximum capacity in bytes of the image 215# 216# @actual-size: actual size on disk in bytes of the image 217# 218# @dirty-flag: true if image is not cleanly closed 219# 220# @cluster-size: size of a cluster in bytes 221# 222# @encrypted: true if the image is encrypted 223# 224# @compressed: true if the image is compressed (Since 1.7) 225# 226# @backing-filename: name of the backing file 227# 228# @full-backing-filename: full path of the backing file 229# 230# @backing-filename-format: the format of the backing file 231# 232# @snapshots: list of VM snapshots 233# 234# @backing-image: info of the backing image (since 1.6) 235# 236# @format-specific: structure supplying additional format-specific 237# information (since 1.7) 238# 239# Since: 1.3 240## 241{ 'struct': 'ImageInfo', 242 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool', 243 '*actual-size': 'int', 'virtual-size': 'int', 244 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool', 245 '*backing-filename': 'str', '*full-backing-filename': 'str', 246 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'], 247 '*backing-image': 'ImageInfo', 248 '*format-specific': 'ImageInfoSpecific' } } 249 250## 251# @ImageCheck: 252# 253# Information about a QEMU image file check 254# 255# @filename: name of the image file checked 256# 257# @format: format of the image file checked 258# 259# @check-errors: number of unexpected errors occurred during check 260# 261# @image-end-offset: offset (in bytes) where the image ends, this 262# field is present if the driver for the image format 263# supports it 264# 265# @corruptions: number of corruptions found during the check if any 266# 267# @leaks: number of leaks found during the check if any 268# 269# @corruptions-fixed: number of corruptions fixed during the check 270# if any 271# 272# @leaks-fixed: number of leaks fixed during the check if any 273# 274# @total-clusters: total number of clusters, this field is present 275# if the driver for the image format supports it 276# 277# @allocated-clusters: total number of allocated clusters, this 278# field is present if the driver for the image format 279# supports it 280# 281# @fragmented-clusters: total number of fragmented clusters, this 282# field is present if the driver for the image format 283# supports it 284# 285# @compressed-clusters: total number of compressed clusters, this 286# field is present if the driver for the image format 287# supports it 288# 289# Since: 1.4 290## 291{ 'struct': 'ImageCheck', 292 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int', 293 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int', 294 '*corruptions-fixed': 'int', '*leaks-fixed': 'int', 295 '*total-clusters': 'int', '*allocated-clusters': 'int', 296 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } } 297 298## 299# @MapEntry: 300# 301# Mapping information from a virtual block range to a host file range 302# 303# @start: virtual (guest) offset of the first byte described by this 304# entry 305# 306# @length: the number of bytes of the mapped virtual range 307# 308# @data: reading the image will actually read data from a file (in 309# particular, if @offset is present this means that the sectors 310# are not simply preallocated, but contain actual data in raw 311# format) 312# 313# @zero: whether the virtual blocks read as zeroes 314# 315# @depth: number of layers (0 = top image, 1 = top image's backing 316# file, ..., n - 1 = bottom image (where n is the number of 317# images in the chain)) before reaching one for which the 318# range is allocated 319# 320# @present: true if this layer provides the data, false if adding a backing 321# layer could impact this region (since 6.1) 322# 323# @offset: if present, the image file stores the data for this range 324# in raw format at the given (host) offset 325# 326# @filename: filename that is referred to by @offset 327# 328# Since: 2.6 329## 330{ 'struct': 'MapEntry', 331 'data': {'start': 'int', 'length': 'int', 'data': 'bool', 332 'zero': 'bool', 'depth': 'int', 'present': 'bool', 333 '*offset': 'int', '*filename': 'str' } } 334 335## 336# @BlockdevCacheInfo: 337# 338# Cache mode information for a block device 339# 340# @writeback: true if writeback mode is enabled 341# @direct: true if the host page cache is bypassed (O_DIRECT) 342# @no-flush: true if flush requests are ignored for the device 343# 344# Since: 2.3 345## 346{ 'struct': 'BlockdevCacheInfo', 347 'data': { 'writeback': 'bool', 348 'direct': 'bool', 349 'no-flush': 'bool' } } 350 351## 352# @BlockDeviceInfo: 353# 354# Information about the backing device for a block device. 355# 356# @file: the filename of the backing device 357# 358# @node-name: the name of the block driver node (Since 2.0) 359# 360# @ro: true if the backing device was open read-only 361# 362# @drv: the name of the block format used to open the backing device. As of 363# 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg', 364# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device', 365# 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow', 366# 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat' 367# 2.2: 'archipelago' added, 'cow' dropped 368# 2.3: 'host_floppy' deprecated 369# 2.5: 'host_floppy' dropped 370# 2.6: 'luks' added 371# 2.8: 'replication' added, 'tftp' dropped 372# 2.9: 'archipelago' dropped 373# 374# @backing_file: the name of the backing file (for copy-on-write) 375# 376# @backing_file_depth: number of files in the backing file chain (since: 1.2) 377# 378# @encrypted: true if the backing device is encrypted 379# 380# @detect_zeroes: detect and optimize zero writes (Since 2.1) 381# 382# @bps: total throughput limit in bytes per second is specified 383# 384# @bps_rd: read throughput limit in bytes per second is specified 385# 386# @bps_wr: write throughput limit in bytes per second is specified 387# 388# @iops: total I/O operations per second is specified 389# 390# @iops_rd: read I/O operations per second is specified 391# 392# @iops_wr: write I/O operations per second is specified 393# 394# @image: the info of image used (since: 1.6) 395# 396# @bps_max: total throughput limit during bursts, 397# in bytes (Since 1.7) 398# 399# @bps_rd_max: read throughput limit during bursts, 400# in bytes (Since 1.7) 401# 402# @bps_wr_max: write throughput limit during bursts, 403# in bytes (Since 1.7) 404# 405# @iops_max: total I/O operations per second during bursts, 406# in bytes (Since 1.7) 407# 408# @iops_rd_max: read I/O operations per second during bursts, 409# in bytes (Since 1.7) 410# 411# @iops_wr_max: write I/O operations per second during bursts, 412# in bytes (Since 1.7) 413# 414# @bps_max_length: maximum length of the @bps_max burst 415# period, in seconds. (Since 2.6) 416# 417# @bps_rd_max_length: maximum length of the @bps_rd_max 418# burst period, in seconds. (Since 2.6) 419# 420# @bps_wr_max_length: maximum length of the @bps_wr_max 421# burst period, in seconds. (Since 2.6) 422# 423# @iops_max_length: maximum length of the @iops burst 424# period, in seconds. (Since 2.6) 425# 426# @iops_rd_max_length: maximum length of the @iops_rd_max 427# burst period, in seconds. (Since 2.6) 428# 429# @iops_wr_max_length: maximum length of the @iops_wr_max 430# burst period, in seconds. (Since 2.6) 431# 432# @iops_size: an I/O size in bytes (Since 1.7) 433# 434# @group: throttle group name (Since 2.4) 435# 436# @cache: the cache mode used for the block device (since: 2.3) 437# 438# @write_threshold: configured write threshold for the device. 439# 0 if disabled. (Since 2.3) 440# 441# @dirty-bitmaps: dirty bitmaps information (only present if node 442# has one or more dirty bitmaps) (Since 4.2) 443# 444# Since: 0.14 445## 446{ 'struct': 'BlockDeviceInfo', 447 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str', 448 '*backing_file': 'str', 'backing_file_depth': 'int', 449 'encrypted': 'bool', 450 'detect_zeroes': 'BlockdevDetectZeroesOptions', 451 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', 452 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', 453 'image': 'ImageInfo', 454 '*bps_max': 'int', '*bps_rd_max': 'int', 455 '*bps_wr_max': 'int', '*iops_max': 'int', 456 '*iops_rd_max': 'int', '*iops_wr_max': 'int', 457 '*bps_max_length': 'int', '*bps_rd_max_length': 'int', 458 '*bps_wr_max_length': 'int', '*iops_max_length': 'int', 459 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int', 460 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo', 461 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } } 462 463## 464# @BlockDeviceIoStatus: 465# 466# An enumeration of block device I/O status. 467# 468# @ok: The last I/O operation has succeeded 469# 470# @failed: The last I/O operation has failed 471# 472# @nospace: The last I/O operation has failed due to a no-space condition 473# 474# Since: 1.0 475## 476{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] } 477 478## 479# @BlockDirtyInfo: 480# 481# Block dirty bitmap information. 482# 483# @name: the name of the dirty bitmap (Since 2.4) 484# 485# @count: number of dirty bytes according to the dirty bitmap 486# 487# @granularity: granularity of the dirty bitmap in bytes (since 1.4) 488# 489# @recording: true if the bitmap is recording new writes from the guest. 490# Replaces ``active`` and ``disabled`` statuses. (since 4.0) 491# 492# @busy: true if the bitmap is in-use by some operation (NBD or jobs) 493# and cannot be modified via QMP or used by another operation. 494# Replaces ``locked`` and ``frozen`` statuses. (since 4.0) 495# 496# @persistent: true if the bitmap was stored on disk, is scheduled to be stored 497# on disk, or both. (since 4.0) 498# 499# @inconsistent: true if this is a persistent bitmap that was improperly 500# stored. Implies @persistent to be true; @recording and 501# @busy to be false. This bitmap cannot be used. To remove 502# it, use @block-dirty-bitmap-remove. (Since 4.0) 503# 504# Since: 1.3 505## 506{ 'struct': 'BlockDirtyInfo', 507 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32', 508 'recording': 'bool', 'busy': 'bool', 509 'persistent': 'bool', '*inconsistent': 'bool' } } 510 511## 512# @Qcow2BitmapInfoFlags: 513# 514# An enumeration of flags that a bitmap can report to the user. 515# 516# @in-use: This flag is set by any process actively modifying the qcow2 file, 517# and cleared when the updated bitmap is flushed to the qcow2 image. 518# The presence of this flag in an offline image means that the bitmap 519# was not saved correctly after its last usage, and may contain 520# inconsistent data. 521# 522# @auto: The bitmap must reflect all changes of the virtual disk by any 523# application that would write to this qcow2 file. 524# 525# Since: 4.0 526## 527{ 'enum': 'Qcow2BitmapInfoFlags', 528 'data': ['in-use', 'auto'] } 529 530## 531# @Qcow2BitmapInfo: 532# 533# Qcow2 bitmap information. 534# 535# @name: the name of the bitmap 536# 537# @granularity: granularity of the bitmap in bytes 538# 539# @flags: flags of the bitmap 540# 541# Since: 4.0 542## 543{ 'struct': 'Qcow2BitmapInfo', 544 'data': {'name': 'str', 'granularity': 'uint32', 545 'flags': ['Qcow2BitmapInfoFlags'] } } 546 547## 548# @BlockLatencyHistogramInfo: 549# 550# Block latency histogram. 551# 552# @boundaries: list of interval boundary values in nanoseconds, all greater 553# than zero and in ascending order. 554# For example, the list [10, 50, 100] produces the following 555# histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf). 556# 557# @bins: list of io request counts corresponding to histogram intervals. 558# len(@bins) = len(@boundaries) + 1 559# For the example above, @bins may be something like [3, 1, 5, 2], 560# and corresponding histogram looks like: 561# 562# :: 563# 564# 5| * 565# 4| * 566# 3| * * 567# 2| * * * 568# 1| * * * * 569# +------------------ 570# 10 50 100 571# 572# Since: 4.0 573## 574{ 'struct': 'BlockLatencyHistogramInfo', 575 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } } 576 577## 578# @BlockInfo: 579# 580# Block device information. This structure describes a virtual device and 581# the backing device associated with it. 582# 583# @device: The device name associated with the virtual device. 584# 585# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block 586# device. (since 2.10) 587# 588# @type: This field is returned only for compatibility reasons, it should 589# not be used (always returns 'unknown') 590# 591# @removable: True if the device supports removable media. 592# 593# @locked: True if the guest has locked this device from having its media 594# removed 595# 596# @tray_open: True if the device's tray is open 597# (only present if it has a tray) 598# 599# @io-status: @BlockDeviceIoStatus. Only present if the device 600# supports it and the VM is configured to stop on errors 601# (supported device models: virtio-blk, IDE, SCSI except 602# scsi-generic) 603# 604# @inserted: @BlockDeviceInfo describing the device if media is 605# present 606# 607# Since: 0.14 608## 609{ 'struct': 'BlockInfo', 610 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool', 611 'locked': 'bool', '*inserted': 'BlockDeviceInfo', 612 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } } 613 614## 615# @BlockMeasureInfo: 616# 617# Image file size calculation information. This structure describes the size 618# requirements for creating a new image file. 619# 620# The size requirements depend on the new image file format. File size always 621# equals virtual disk size for the 'raw' format, even for sparse POSIX files. 622# Compact formats such as 'qcow2' represent unallocated and zero regions 623# efficiently so file size may be smaller than virtual disk size. 624# 625# The values are upper bounds that are guaranteed to fit the new image file. 626# Subsequent modification, such as internal snapshot or further bitmap 627# creation, may require additional space and is not covered here. 628# 629# @required: Size required for a new image file, in bytes, when copying just 630# allocated guest-visible contents. 631# 632# @fully-allocated: Image file size, in bytes, once data has been written 633# to all sectors, when copying just guest-visible contents. 634# 635# @bitmaps: Additional size required if all the top-level bitmap metadata 636# in the source image were to be copied to the destination, 637# present only when source and destination both support 638# persistent bitmaps. (since 5.1) 639# 640# Since: 2.10 641## 642{ 'struct': 'BlockMeasureInfo', 643 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} } 644 645## 646# @query-block: 647# 648# Get a list of BlockInfo for all virtual block devices. 649# 650# Returns: a list of @BlockInfo describing each virtual block device. Filter 651# nodes that were created implicitly are skipped over. 652# 653# Since: 0.14 654# 655# Example: 656# 657# -> { "execute": "query-block" } 658# <- { 659# "return":[ 660# { 661# "io-status": "ok", 662# "device":"ide0-hd0", 663# "locked":false, 664# "removable":false, 665# "inserted":{ 666# "ro":false, 667# "drv":"qcow2", 668# "encrypted":false, 669# "file":"disks/test.qcow2", 670# "backing_file_depth":1, 671# "bps":1000000, 672# "bps_rd":0, 673# "bps_wr":0, 674# "iops":1000000, 675# "iops_rd":0, 676# "iops_wr":0, 677# "bps_max": 8000000, 678# "bps_rd_max": 0, 679# "bps_wr_max": 0, 680# "iops_max": 0, 681# "iops_rd_max": 0, 682# "iops_wr_max": 0, 683# "iops_size": 0, 684# "detect_zeroes": "on", 685# "write_threshold": 0, 686# "image":{ 687# "filename":"disks/test.qcow2", 688# "format":"qcow2", 689# "virtual-size":2048000, 690# "backing_file":"base.qcow2", 691# "full-backing-filename":"disks/base.qcow2", 692# "backing-filename-format":"qcow2", 693# "snapshots":[ 694# { 695# "id": "1", 696# "name": "snapshot1", 697# "vm-state-size": 0, 698# "date-sec": 10000200, 699# "date-nsec": 12, 700# "vm-clock-sec": 206, 701# "vm-clock-nsec": 30 702# } 703# ], 704# "backing-image":{ 705# "filename":"disks/base.qcow2", 706# "format":"qcow2", 707# "virtual-size":2048000 708# } 709# } 710# }, 711# "qdev": "ide_disk", 712# "type":"unknown" 713# }, 714# { 715# "io-status": "ok", 716# "device":"ide1-cd0", 717# "locked":false, 718# "removable":true, 719# "qdev": "/machine/unattached/device[23]", 720# "tray_open": false, 721# "type":"unknown" 722# }, 723# { 724# "device":"floppy0", 725# "locked":false, 726# "removable":true, 727# "qdev": "/machine/unattached/device[20]", 728# "type":"unknown" 729# }, 730# { 731# "device":"sd0", 732# "locked":false, 733# "removable":true, 734# "type":"unknown" 735# } 736# ] 737# } 738# 739## 740{ 'command': 'query-block', 'returns': ['BlockInfo'] } 741 742## 743# @BlockDeviceTimedStats: 744# 745# Statistics of a block device during a given interval of time. 746# 747# @interval_length: Interval used for calculating the statistics, 748# in seconds. 749# 750# @min_rd_latency_ns: Minimum latency of read operations in the 751# defined interval, in nanoseconds. 752# 753# @min_wr_latency_ns: Minimum latency of write operations in the 754# defined interval, in nanoseconds. 755# 756# @min_flush_latency_ns: Minimum latency of flush operations in the 757# defined interval, in nanoseconds. 758# 759# @max_rd_latency_ns: Maximum latency of read operations in the 760# defined interval, in nanoseconds. 761# 762# @max_wr_latency_ns: Maximum latency of write operations in the 763# defined interval, in nanoseconds. 764# 765# @max_flush_latency_ns: Maximum latency of flush operations in the 766# defined interval, in nanoseconds. 767# 768# @avg_rd_latency_ns: Average latency of read operations in the 769# defined interval, in nanoseconds. 770# 771# @avg_wr_latency_ns: Average latency of write operations in the 772# defined interval, in nanoseconds. 773# 774# @avg_flush_latency_ns: Average latency of flush operations in the 775# defined interval, in nanoseconds. 776# 777# @avg_rd_queue_depth: Average number of pending read operations 778# in the defined interval. 779# 780# @avg_wr_queue_depth: Average number of pending write operations 781# in the defined interval. 782# 783# Since: 2.5 784## 785{ 'struct': 'BlockDeviceTimedStats', 786 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int', 787 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int', 788 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int', 789 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int', 790 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int', 791 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } } 792 793## 794# @BlockDeviceStats: 795# 796# Statistics of a virtual block device or a block backing device. 797# 798# @rd_bytes: The number of bytes read by the device. 799# 800# @wr_bytes: The number of bytes written by the device. 801# 802# @unmap_bytes: The number of bytes unmapped by the device (Since 4.2) 803# 804# @rd_operations: The number of read operations performed by the device. 805# 806# @wr_operations: The number of write operations performed by the device. 807# 808# @flush_operations: The number of cache flush operations performed by the 809# device (since 0.15) 810# 811# @unmap_operations: The number of unmap operations performed by the device 812# (Since 4.2) 813# 814# @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15). 815# 816# @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15). 817# 818# @flush_total_time_ns: Total time spent on cache flushes in nanoseconds 819# (since 0.15). 820# 821# @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds 822# (Since 4.2) 823# 824# @wr_highest_offset: The offset after the greatest byte written to the 825# device. The intended use of this information is for 826# growable sparse files (like qcow2) that are used on top 827# of a physical device. 828# 829# @rd_merged: Number of read requests that have been merged into another 830# request (Since 2.3). 831# 832# @wr_merged: Number of write requests that have been merged into another 833# request (Since 2.3). 834# 835# @unmap_merged: Number of unmap requests that have been merged into another 836# request (Since 4.2) 837# 838# @idle_time_ns: Time since the last I/O operation, in 839# nanoseconds. If the field is absent it means that 840# there haven't been any operations yet (Since 2.5). 841# 842# @failed_rd_operations: The number of failed read operations 843# performed by the device (Since 2.5) 844# 845# @failed_wr_operations: The number of failed write operations 846# performed by the device (Since 2.5) 847# 848# @failed_flush_operations: The number of failed flush operations 849# performed by the device (Since 2.5) 850# 851# @failed_unmap_operations: The number of failed unmap operations performed 852# by the device (Since 4.2) 853# 854# @invalid_rd_operations: The number of invalid read operations 855# performed by the device (Since 2.5) 856# 857# @invalid_wr_operations: The number of invalid write operations 858# performed by the device (Since 2.5) 859# 860# @invalid_flush_operations: The number of invalid flush operations 861# performed by the device (Since 2.5) 862# 863# @invalid_unmap_operations: The number of invalid unmap operations performed 864# by the device (Since 4.2) 865# 866# @account_invalid: Whether invalid operations are included in the 867# last access statistics (Since 2.5) 868# 869# @account_failed: Whether failed operations are included in the 870# latency and last access statistics (Since 2.5) 871# 872# @timed_stats: Statistics specific to the set of previously defined 873# intervals of time (Since 2.5) 874# 875# @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0) 876# 877# @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0) 878# 879# @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0) 880# 881# Since: 0.14 882## 883{ 'struct': 'BlockDeviceStats', 884 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int', 885 'rd_operations': 'int', 'wr_operations': 'int', 886 'flush_operations': 'int', 'unmap_operations': 'int', 887 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int', 888 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int', 889 'wr_highest_offset': 'int', 890 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int', 891 '*idle_time_ns': 'int', 892 'failed_rd_operations': 'int', 'failed_wr_operations': 'int', 893 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int', 894 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int', 895 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int', 896 'account_invalid': 'bool', 'account_failed': 'bool', 897 'timed_stats': ['BlockDeviceTimedStats'], 898 '*rd_latency_histogram': 'BlockLatencyHistogramInfo', 899 '*wr_latency_histogram': 'BlockLatencyHistogramInfo', 900 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } } 901 902## 903# @BlockStatsSpecificFile: 904# 905# File driver statistics 906# 907# @discard-nb-ok: The number of successful discard operations performed by 908# the driver. 909# 910# @discard-nb-failed: The number of failed discard operations performed by 911# the driver. 912# 913# @discard-bytes-ok: The number of bytes discarded by the driver. 914# 915# Since: 4.2 916## 917{ 'struct': 'BlockStatsSpecificFile', 918 'data': { 919 'discard-nb-ok': 'uint64', 920 'discard-nb-failed': 'uint64', 921 'discard-bytes-ok': 'uint64' } } 922 923## 924# @BlockStatsSpecificNvme: 925# 926# NVMe driver statistics 927# 928# @completion-errors: The number of completion errors. 929# 930# @aligned-accesses: The number of aligned accesses performed by 931# the driver. 932# 933# @unaligned-accesses: The number of unaligned accesses performed by 934# the driver. 935# 936# Since: 5.2 937## 938{ 'struct': 'BlockStatsSpecificNvme', 939 'data': { 940 'completion-errors': 'uint64', 941 'aligned-accesses': 'uint64', 942 'unaligned-accesses': 'uint64' } } 943 944## 945# @BlockStatsSpecific: 946# 947# Block driver specific statistics 948# 949# Since: 4.2 950## 951{ 'union': 'BlockStatsSpecific', 952 'base': { 'driver': 'BlockdevDriver' }, 953 'discriminator': 'driver', 954 'data': { 955 'file': 'BlockStatsSpecificFile', 956 'host_device': { 'type': 'BlockStatsSpecificFile', 957 'if': 'HAVE_HOST_BLOCK_DEVICE' }, 958 'nvme': 'BlockStatsSpecificNvme' } } 959 960## 961# @BlockStats: 962# 963# Statistics of a virtual block device or a block backing device. 964# 965# @device: If the stats are for a virtual block device, the name 966# corresponding to the virtual block device. 967# 968# @node-name: The node name of the device. (Since 2.3) 969# 970# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block 971# device. (since 3.0) 972# 973# @stats: A @BlockDeviceStats for the device. 974# 975# @driver-specific: Optional driver-specific stats. (Since 4.2) 976# 977# @parent: This describes the file block device if it has one. 978# Contains recursively the statistics of the underlying 979# protocol (e.g. the host file for a qcow2 image). If there is 980# no underlying protocol, this field is omitted 981# 982# @backing: This describes the backing block device if it has one. 983# (Since 2.0) 984# 985# Since: 0.14 986## 987{ 'struct': 'BlockStats', 988 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str', 989 'stats': 'BlockDeviceStats', 990 '*driver-specific': 'BlockStatsSpecific', 991 '*parent': 'BlockStats', 992 '*backing': 'BlockStats'} } 993 994## 995# @query-blockstats: 996# 997# Query the @BlockStats for all virtual block devices. 998# 999# @query-nodes: If true, the command will query all the block nodes 1000# that have a node name, in a list which will include "parent" 1001# information, but not "backing". 1002# If false or omitted, the behavior is as before - query all the 1003# device backends, recursively including their "parent" and 1004# "backing". Filter nodes that were created implicitly are 1005# skipped over in this mode. (Since 2.3) 1006# 1007# Returns: A list of @BlockStats for each virtual block devices. 1008# 1009# Since: 0.14 1010# 1011# Example: 1012# 1013# -> { "execute": "query-blockstats" } 1014# <- { 1015# "return":[ 1016# { 1017# "device":"ide0-hd0", 1018# "parent":{ 1019# "stats":{ 1020# "wr_highest_offset":3686448128, 1021# "wr_bytes":9786368, 1022# "wr_operations":751, 1023# "rd_bytes":122567168, 1024# "rd_operations":36772 1025# "wr_total_times_ns":313253456 1026# "rd_total_times_ns":3465673657 1027# "flush_total_times_ns":49653 1028# "flush_operations":61, 1029# "rd_merged":0, 1030# "wr_merged":0, 1031# "idle_time_ns":2953431879, 1032# "account_invalid":true, 1033# "account_failed":false 1034# } 1035# }, 1036# "stats":{ 1037# "wr_highest_offset":2821110784, 1038# "wr_bytes":9786368, 1039# "wr_operations":692, 1040# "rd_bytes":122739200, 1041# "rd_operations":36604 1042# "flush_operations":51, 1043# "wr_total_times_ns":313253456 1044# "rd_total_times_ns":3465673657 1045# "flush_total_times_ns":49653, 1046# "rd_merged":0, 1047# "wr_merged":0, 1048# "idle_time_ns":2953431879, 1049# "account_invalid":true, 1050# "account_failed":false 1051# }, 1052# "qdev": "/machine/unattached/device[23]" 1053# }, 1054# { 1055# "device":"ide1-cd0", 1056# "stats":{ 1057# "wr_highest_offset":0, 1058# "wr_bytes":0, 1059# "wr_operations":0, 1060# "rd_bytes":0, 1061# "rd_operations":0 1062# "flush_operations":0, 1063# "wr_total_times_ns":0 1064# "rd_total_times_ns":0 1065# "flush_total_times_ns":0, 1066# "rd_merged":0, 1067# "wr_merged":0, 1068# "account_invalid":false, 1069# "account_failed":false 1070# }, 1071# "qdev": "/machine/unattached/device[24]" 1072# }, 1073# { 1074# "device":"floppy0", 1075# "stats":{ 1076# "wr_highest_offset":0, 1077# "wr_bytes":0, 1078# "wr_operations":0, 1079# "rd_bytes":0, 1080# "rd_operations":0 1081# "flush_operations":0, 1082# "wr_total_times_ns":0 1083# "rd_total_times_ns":0 1084# "flush_total_times_ns":0, 1085# "rd_merged":0, 1086# "wr_merged":0, 1087# "account_invalid":false, 1088# "account_failed":false 1089# }, 1090# "qdev": "/machine/unattached/device[16]" 1091# }, 1092# { 1093# "device":"sd0", 1094# "stats":{ 1095# "wr_highest_offset":0, 1096# "wr_bytes":0, 1097# "wr_operations":0, 1098# "rd_bytes":0, 1099# "rd_operations":0 1100# "flush_operations":0, 1101# "wr_total_times_ns":0 1102# "rd_total_times_ns":0 1103# "flush_total_times_ns":0, 1104# "rd_merged":0, 1105# "wr_merged":0, 1106# "account_invalid":false, 1107# "account_failed":false 1108# } 1109# } 1110# ] 1111# } 1112# 1113## 1114{ 'command': 'query-blockstats', 1115 'data': { '*query-nodes': 'bool' }, 1116 'returns': ['BlockStats'] } 1117 1118## 1119# @BlockdevOnError: 1120# 1121# An enumeration of possible behaviors for errors on I/O operations. 1122# The exact meaning depends on whether the I/O was initiated by a guest 1123# or by a block job 1124# 1125# @report: for guest operations, report the error to the guest; 1126# for jobs, cancel the job 1127# 1128# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR 1129# or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry 1130# the failing request later and may still complete successfully. The 1131# stream block job continues to stream and will complete with an 1132# error. 1133# 1134# @enospc: same as @stop on ENOSPC, same as @report otherwise. 1135# 1136# @stop: for guest operations, stop the virtual machine; 1137# for jobs, pause the job 1138# 1139# @auto: inherit the error handling policy of the backend (since: 2.7) 1140# 1141# Since: 1.3 1142## 1143{ 'enum': 'BlockdevOnError', 1144 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] } 1145 1146## 1147# @MirrorSyncMode: 1148# 1149# An enumeration of possible behaviors for the initial synchronization 1150# phase of storage mirroring. 1151# 1152# @top: copies data in the topmost image to the destination 1153# 1154# @full: copies data from all images to the destination 1155# 1156# @none: only copy data written from now on 1157# 1158# @incremental: only copy data described by the dirty bitmap. (since: 2.4) 1159# 1160# @bitmap: only copy data described by the dirty bitmap. (since: 4.2) 1161# Behavior on completion is determined by the BitmapSyncMode. 1162# 1163# Since: 1.3 1164## 1165{ 'enum': 'MirrorSyncMode', 1166 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] } 1167 1168## 1169# @BitmapSyncMode: 1170# 1171# An enumeration of possible behaviors for the synchronization of a bitmap 1172# when used for data copy operations. 1173# 1174# @on-success: The bitmap is only synced when the operation is successful. 1175# This is the behavior always used for 'INCREMENTAL' backups. 1176# 1177# @never: The bitmap is never synchronized with the operation, and is 1178# treated solely as a read-only manifest of blocks to copy. 1179# 1180# @always: The bitmap is always synchronized with the operation, 1181# regardless of whether or not the operation was successful. 1182# 1183# Since: 4.2 1184## 1185{ 'enum': 'BitmapSyncMode', 1186 'data': ['on-success', 'never', 'always'] } 1187 1188## 1189# @MirrorCopyMode: 1190# 1191# An enumeration whose values tell the mirror block job when to 1192# trigger writes to the target. 1193# 1194# @background: copy data in background only. 1195# 1196# @write-blocking: when data is written to the source, write it 1197# (synchronously) to the target as well. In 1198# addition, data is copied in background just like in 1199# @background mode. 1200# 1201# Since: 3.0 1202## 1203{ 'enum': 'MirrorCopyMode', 1204 'data': ['background', 'write-blocking'] } 1205 1206## 1207# @BlockJobInfo: 1208# 1209# Information about a long-running block device operation. 1210# 1211# @type: the job type ('stream' for image streaming) 1212# 1213# @device: The job identifier. Originally the device name but other 1214# values are allowed since QEMU 2.7 1215# 1216# @len: Estimated @offset value at the completion of the job. This value can 1217# arbitrarily change while the job is running, in both directions. 1218# 1219# @offset: Progress made until now. The unit is arbitrary and the value can 1220# only meaningfully be used for the ratio of @offset to @len. The 1221# value is monotonically increasing. 1222# 1223# @busy: false if the job is known to be in a quiescent state, with 1224# no pending I/O. Since 1.3. 1225# 1226# @paused: whether the job is paused or, if @busy is true, will 1227# pause itself as soon as possible. Since 1.3. 1228# 1229# @speed: the rate limit, bytes per second 1230# 1231# @io-status: the status of the job (since 1.3) 1232# 1233# @ready: true if the job may be completed (since 2.2) 1234# 1235# @status: Current job state/status (since 2.12) 1236# 1237# @auto-finalize: Job will finalize itself when PENDING, moving to 1238# the CONCLUDED state. (since 2.12) 1239# 1240# @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL 1241# state and disappearing from the query list. (since 2.12) 1242# 1243# @error: Error information if the job did not complete successfully. 1244# Not set if the job completed successfully. (since 2.12.1) 1245# 1246# Since: 1.1 1247## 1248{ 'struct': 'BlockJobInfo', 1249 'data': {'type': 'str', 'device': 'str', 'len': 'int', 1250 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int', 1251 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool', 1252 'status': 'JobStatus', 1253 'auto-finalize': 'bool', 'auto-dismiss': 'bool', 1254 '*error': 'str' } } 1255 1256## 1257# @query-block-jobs: 1258# 1259# Return information about long-running block device operations. 1260# 1261# Returns: a list of @BlockJobInfo for each active block job 1262# 1263# Since: 1.1 1264## 1265{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] } 1266 1267## 1268# @block_resize: 1269# 1270# Resize a block image while a guest is running. 1271# 1272# Either @device or @node-name must be set but not both. 1273# 1274# @device: the name of the device to get the image resized 1275# 1276# @node-name: graph node name to get the image resized (Since 2.0) 1277# 1278# @size: new image size in bytes 1279# 1280# Returns: - nothing on success 1281# - If @device is not a valid block device, DeviceNotFound 1282# 1283# Since: 0.14 1284# 1285# Example: 1286# 1287# -> { "execute": "block_resize", 1288# "arguments": { "device": "scratch", "size": 1073741824 } } 1289# <- { "return": {} } 1290# 1291## 1292{ 'command': 'block_resize', 1293 'data': { '*device': 'str', 1294 '*node-name': 'str', 1295 'size': 'int' }, 1296 'coroutine': true } 1297 1298## 1299# @NewImageMode: 1300# 1301# An enumeration that tells QEMU how to set the backing file path in 1302# a new image file. 1303# 1304# @existing: QEMU should look for an existing image file. 1305# 1306# @absolute-paths: QEMU should create a new image with absolute paths 1307# for the backing file. If there is no backing file available, the new 1308# image will not be backed either. 1309# 1310# Since: 1.1 1311## 1312{ 'enum': 'NewImageMode', 1313 'data': [ 'existing', 'absolute-paths' ] } 1314 1315## 1316# @BlockdevSnapshotSync: 1317# 1318# Either @device or @node-name must be set but not both. 1319# 1320# @device: the name of the device to take a snapshot of. 1321# 1322# @node-name: graph node name to generate the snapshot from (Since 2.0) 1323# 1324# @snapshot-file: the target of the new overlay image. If the file 1325# exists, or if it is a device, the overlay will be created in the 1326# existing file/device. Otherwise, a new file will be created. 1327# 1328# @snapshot-node-name: the graph node name of the new image (Since 2.0) 1329# 1330# @format: the format of the overlay image, default is 'qcow2'. 1331# 1332# @mode: whether and how QEMU should create a new image, default is 1333# 'absolute-paths'. 1334## 1335{ 'struct': 'BlockdevSnapshotSync', 1336 'data': { '*device': 'str', '*node-name': 'str', 1337 'snapshot-file': 'str', '*snapshot-node-name': 'str', 1338 '*format': 'str', '*mode': 'NewImageMode' } } 1339 1340## 1341# @BlockdevSnapshot: 1342# 1343# @node: device or node name that will have a snapshot taken. 1344# 1345# @overlay: reference to the existing block device that will become 1346# the overlay of @node, as part of taking the snapshot. 1347# It must not have a current backing file (this can be 1348# achieved by passing "backing": null to blockdev-add). 1349# 1350# Since: 2.5 1351## 1352{ 'struct': 'BlockdevSnapshot', 1353 'data': { 'node': 'str', 'overlay': 'str' } } 1354 1355## 1356# @BackupPerf: 1357# 1358# Optional parameters for backup. These parameters don't affect 1359# functionality, but may significantly affect performance. 1360# 1361# @use-copy-range: Use copy offloading. Default false. 1362# 1363# @max-workers: Maximum number of parallel requests for the sustained background 1364# copying process. Doesn't influence copy-before-write operations. 1365# Default 64. 1366# 1367# @max-chunk: Maximum request length for the sustained background copying 1368# process. Doesn't influence copy-before-write operations. 1369# 0 means unlimited. If max-chunk is non-zero then it should not be 1370# less than job cluster size which is calculated as maximum of 1371# target image cluster size and 64k. Default 0. 1372# 1373# Since: 6.0 1374## 1375{ 'struct': 'BackupPerf', 1376 'data': { '*use-copy-range': 'bool', 1377 '*max-workers': 'int', '*max-chunk': 'int64' } } 1378 1379## 1380# @BackupCommon: 1381# 1382# @job-id: identifier for the newly-created block job. If 1383# omitted, the device name will be used. (Since 2.7) 1384# 1385# @device: the device name or node-name of a root node which should be copied. 1386# 1387# @sync: what parts of the disk image should be copied to the destination 1388# (all the disk, only the sectors allocated in the topmost image, from a 1389# dirty bitmap, or only new I/O). 1390# 1391# @speed: the maximum speed, in bytes per second. The default is 0, 1392# for unlimited. 1393# 1394# @bitmap: The name of a dirty bitmap to use. 1395# Must be present if sync is "bitmap" or "incremental". 1396# Can be present if sync is "full" or "top". 1397# Must not be present otherwise. 1398# (Since 2.4 (drive-backup), 3.1 (blockdev-backup)) 1399# 1400# @bitmap-mode: Specifies the type of data the bitmap should contain after 1401# the operation concludes. 1402# Must be present if a bitmap was provided, 1403# Must NOT be present otherwise. (Since 4.2) 1404# 1405# @compress: true to compress data, if the target format supports it. 1406# (default: false) (since 2.8) 1407# 1408# @on-source-error: the action to take on an error on the source, 1409# default 'report'. 'stop' and 'enospc' can only be used 1410# if the block device supports io-status (see BlockInfo). 1411# 1412# @on-target-error: the action to take on an error on the target, 1413# default 'report' (no limitations, since this applies to 1414# a different block device than @device). 1415# 1416# @auto-finalize: When false, this job will wait in a PENDING state after it has 1417# finished its work, waiting for @block-job-finalize before 1418# making any block graph changes. 1419# When true, this job will automatically 1420# perform its abort or commit actions. 1421# Defaults to true. (Since 2.12) 1422# 1423# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it 1424# has completely ceased all work, and awaits @block-job-dismiss. 1425# When true, this job will automatically disappear from the query 1426# list without user intervention. 1427# Defaults to true. (Since 2.12) 1428# 1429# @filter-node-name: the node name that should be assigned to the 1430# filter driver that the backup job inserts into the graph 1431# above node specified by @drive. If this option is not given, 1432# a node name is autogenerated. (Since: 4.2) 1433# 1434# @x-perf: Performance options. (Since 6.0) 1435# 1436# Features: 1437# @unstable: Member @x-perf is experimental. 1438# 1439# Note: @on-source-error and @on-target-error only affect background 1440# I/O. If an error occurs during a guest write request, the device's 1441# rerror/werror actions will be used. 1442# 1443# Since: 4.2 1444## 1445{ 'struct': 'BackupCommon', 1446 'data': { '*job-id': 'str', 'device': 'str', 1447 'sync': 'MirrorSyncMode', '*speed': 'int', 1448 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode', 1449 '*compress': 'bool', 1450 '*on-source-error': 'BlockdevOnError', 1451 '*on-target-error': 'BlockdevOnError', 1452 '*auto-finalize': 'bool', '*auto-dismiss': 'bool', 1453 '*filter-node-name': 'str', 1454 '*x-perf': { 'type': 'BackupPerf', 1455 'features': [ 'unstable' ] } } } 1456 1457## 1458# @DriveBackup: 1459# 1460# @target: the target of the new image. If the file exists, or if it 1461# is a device, the existing file/device will be used as the new 1462# destination. If it does not exist, a new file will be created. 1463# 1464# @format: the format of the new destination, default is to 1465# probe if @mode is 'existing', else the format of the source 1466# 1467# @mode: whether and how QEMU should create a new image, default is 1468# 'absolute-paths'. 1469# 1470# Since: 1.6 1471## 1472{ 'struct': 'DriveBackup', 1473 'base': 'BackupCommon', 1474 'data': { 'target': 'str', 1475 '*format': 'str', 1476 '*mode': 'NewImageMode' } } 1477 1478## 1479# @BlockdevBackup: 1480# 1481# @target: the device name or node-name of the backup target node. 1482# 1483# Since: 2.3 1484## 1485{ 'struct': 'BlockdevBackup', 1486 'base': 'BackupCommon', 1487 'data': { 'target': 'str' } } 1488 1489## 1490# @blockdev-snapshot-sync: 1491# 1492# Takes a synchronous snapshot of a block device. 1493# 1494# For the arguments, see the documentation of BlockdevSnapshotSync. 1495# 1496# Returns: - nothing on success 1497# - If @device is not a valid block device, DeviceNotFound 1498# 1499# Since: 0.14 1500# 1501# Example: 1502# 1503# -> { "execute": "blockdev-snapshot-sync", 1504# "arguments": { "device": "ide-hd0", 1505# "snapshot-file": 1506# "/some/place/my-image", 1507# "format": "qcow2" } } 1508# <- { "return": {} } 1509# 1510## 1511{ 'command': 'blockdev-snapshot-sync', 1512 'data': 'BlockdevSnapshotSync' } 1513 1514## 1515# @blockdev-snapshot: 1516# 1517# Takes a snapshot of a block device. 1518# 1519# Take a snapshot, by installing 'node' as the backing image of 1520# 'overlay'. Additionally, if 'node' is associated with a block 1521# device, the block device changes to using 'overlay' as its new active 1522# image. 1523# 1524# For the arguments, see the documentation of BlockdevSnapshot. 1525# 1526# Features: 1527# @allow-write-only-overlay: If present, the check whether this operation is safe 1528# was relaxed so that it can be used to change 1529# backing file of a destination of a blockdev-mirror. 1530# (since 5.0) 1531# 1532# Since: 2.5 1533# 1534# Example: 1535# 1536# -> { "execute": "blockdev-add", 1537# "arguments": { "driver": "qcow2", 1538# "node-name": "node1534", 1539# "file": { "driver": "file", 1540# "filename": "hd1.qcow2" }, 1541# "backing": null } } 1542# 1543# <- { "return": {} } 1544# 1545# -> { "execute": "blockdev-snapshot", 1546# "arguments": { "node": "ide-hd0", 1547# "overlay": "node1534" } } 1548# <- { "return": {} } 1549# 1550## 1551{ 'command': 'blockdev-snapshot', 1552 'data': 'BlockdevSnapshot', 1553 'features': [ 'allow-write-only-overlay' ] } 1554 1555## 1556# @change-backing-file: 1557# 1558# Change the backing file in the image file metadata. This does not 1559# cause QEMU to reopen the image file to reparse the backing filename 1560# (it may, however, perform a reopen to change permissions from 1561# r/o -> r/w -> r/o, if needed). The new backing file string is written 1562# into the image file metadata, and the QEMU internal strings are 1563# updated. 1564# 1565# @image-node-name: The name of the block driver state node of the 1566# image to modify. The "device" argument is used 1567# to verify "image-node-name" is in the chain 1568# described by "device". 1569# 1570# @device: The device name or node-name of the root node that owns 1571# image-node-name. 1572# 1573# @backing-file: The string to write as the backing file. This 1574# string is not validated, so care should be taken 1575# when specifying the string or the image chain may 1576# not be able to be reopened again. 1577# 1578# Returns: - Nothing on success 1579# - If "device" does not exist or cannot be determined, DeviceNotFound 1580# 1581# Since: 2.1 1582## 1583{ 'command': 'change-backing-file', 1584 'data': { 'device': 'str', 'image-node-name': 'str', 1585 'backing-file': 'str' } } 1586 1587## 1588# @block-commit: 1589# 1590# Live commit of data from overlay image nodes into backing nodes - i.e., 1591# writes data between 'top' and 'base' into 'base'. 1592# 1593# If top == base, that is an error. 1594# If top has no overlays on top of it, or if it is in use by a writer, 1595# the job will not be completed by itself. The user needs to complete 1596# the job with the block-job-complete command after getting the ready 1597# event. (Since 2.0) 1598# 1599# If the base image is smaller than top, then the base image will be 1600# resized to be the same size as top. If top is smaller than the base 1601# image, the base will not be truncated. If you want the base image 1602# size to match the size of the smaller top, you can safely truncate 1603# it yourself once the commit operation successfully completes. 1604# 1605# @job-id: identifier for the newly-created block job. If 1606# omitted, the device name will be used. (Since 2.7) 1607# 1608# @device: the device name or node-name of a root node 1609# 1610# @base-node: The node name of the backing image to write data into. 1611# If not specified, this is the deepest backing image. 1612# (since: 3.1) 1613# 1614# @base: Same as @base-node, except that it is a file name rather than a node 1615# name. This must be the exact filename string that was used to open the 1616# node; other strings, even if addressing the same file, are not 1617# accepted 1618# 1619# @top-node: The node name of the backing image within the image chain 1620# which contains the topmost data to be committed down. If 1621# not specified, this is the active layer. (since: 3.1) 1622# 1623# @top: Same as @top-node, except that it is a file name rather than a node 1624# name. This must be the exact filename string that was used to open the 1625# node; other strings, even if addressing the same file, are not 1626# accepted 1627# 1628# @backing-file: The backing file string to write into the overlay 1629# image of 'top'. If 'top' does not have an overlay 1630# image, or if 'top' is in use by a writer, specifying 1631# a backing file string is an error. 1632# 1633# This filename is not validated. If a pathname string 1634# is such that it cannot be resolved by QEMU, that 1635# means that subsequent QMP or HMP commands must use 1636# node-names for the image in question, as filename 1637# lookup methods will fail. 1638# 1639# If not specified, QEMU will automatically determine 1640# the backing file string to use, or error out if 1641# there is no obvious choice. Care should be taken 1642# when specifying the string, to specify a valid 1643# filename or protocol. 1644# (Since 2.1) 1645# 1646# @speed: the maximum speed, in bytes per second 1647# 1648# @on-error: the action to take on an error. 'ignore' means that the request 1649# should be retried. (default: report; Since: 5.0) 1650# 1651# @filter-node-name: the node name that should be assigned to the 1652# filter driver that the commit job inserts into the graph 1653# above @top. If this option is not given, a node name is 1654# autogenerated. (Since: 2.9) 1655# 1656# @auto-finalize: When false, this job will wait in a PENDING state after it has 1657# finished its work, waiting for @block-job-finalize before 1658# making any block graph changes. 1659# When true, this job will automatically 1660# perform its abort or commit actions. 1661# Defaults to true. (Since 3.1) 1662# 1663# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it 1664# has completely ceased all work, and awaits @block-job-dismiss. 1665# When true, this job will automatically disappear from the query 1666# list without user intervention. 1667# Defaults to true. (Since 3.1) 1668# 1669# Features: 1670# @deprecated: Members @base and @top are deprecated. Use @base-node 1671# and @top-node instead. 1672# 1673# Returns: - Nothing on success 1674# - If @device does not exist, DeviceNotFound 1675# - Any other error returns a GenericError. 1676# 1677# Since: 1.3 1678# 1679# Example: 1680# 1681# -> { "execute": "block-commit", 1682# "arguments": { "device": "virtio0", 1683# "top": "/tmp/snap1.qcow2" } } 1684# <- { "return": {} } 1685# 1686## 1687{ 'command': 'block-commit', 1688 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str', 1689 '*base': { 'type': 'str', 'features': [ 'deprecated' ] }, 1690 '*top-node': 'str', 1691 '*top': { 'type': 'str', 'features': [ 'deprecated' ] }, 1692 '*backing-file': 'str', '*speed': 'int', 1693 '*on-error': 'BlockdevOnError', 1694 '*filter-node-name': 'str', 1695 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } 1696 1697## 1698# @drive-backup: 1699# 1700# Start a point-in-time copy of a block device to a new destination. The 1701# status of ongoing drive-backup operations can be checked with 1702# query-block-jobs where the BlockJobInfo.type field has the value 'backup'. 1703# The operation can be stopped before it has completed using the 1704# block-job-cancel command. 1705# 1706# Features: 1707# @deprecated: This command is deprecated. Use @blockdev-backup instead. 1708# 1709# Returns: - nothing on success 1710# - If @device is not a valid block device, GenericError 1711# 1712# Since: 1.6 1713# 1714# Example: 1715# 1716# -> { "execute": "drive-backup", 1717# "arguments": { "device": "drive0", 1718# "sync": "full", 1719# "target": "backup.img" } } 1720# <- { "return": {} } 1721# 1722## 1723{ 'command': 'drive-backup', 'boxed': true, 1724 'data': 'DriveBackup', 'features': ['deprecated'] } 1725 1726## 1727# @blockdev-backup: 1728# 1729# Start a point-in-time copy of a block device to a new destination. The 1730# status of ongoing blockdev-backup operations can be checked with 1731# query-block-jobs where the BlockJobInfo.type field has the value 'backup'. 1732# The operation can be stopped before it has completed using the 1733# block-job-cancel command. 1734# 1735# Returns: - nothing on success 1736# - If @device is not a valid block device, DeviceNotFound 1737# 1738# Since: 2.3 1739# 1740# Example: 1741# 1742# -> { "execute": "blockdev-backup", 1743# "arguments": { "device": "src-id", 1744# "sync": "full", 1745# "target": "tgt-id" } } 1746# <- { "return": {} } 1747# 1748## 1749{ 'command': 'blockdev-backup', 'boxed': true, 1750 'data': 'BlockdevBackup' } 1751 1752## 1753# @query-named-block-nodes: 1754# 1755# Get the named block driver list 1756# 1757# @flat: Omit the nested data about backing image ("backing-image" key) if true. 1758# Default is false (Since 5.0) 1759# 1760# Returns: the list of BlockDeviceInfo 1761# 1762# Since: 2.0 1763# 1764# Example: 1765# 1766# -> { "execute": "query-named-block-nodes" } 1767# <- { "return": [ { "ro":false, 1768# "drv":"qcow2", 1769# "encrypted":false, 1770# "file":"disks/test.qcow2", 1771# "node-name": "my-node", 1772# "backing_file_depth":1, 1773# "detect_zeroes":"off", 1774# "bps":1000000, 1775# "bps_rd":0, 1776# "bps_wr":0, 1777# "iops":1000000, 1778# "iops_rd":0, 1779# "iops_wr":0, 1780# "bps_max": 8000000, 1781# "bps_rd_max": 0, 1782# "bps_wr_max": 0, 1783# "iops_max": 0, 1784# "iops_rd_max": 0, 1785# "iops_wr_max": 0, 1786# "iops_size": 0, 1787# "write_threshold": 0, 1788# "image":{ 1789# "filename":"disks/test.qcow2", 1790# "format":"qcow2", 1791# "virtual-size":2048000, 1792# "backing_file":"base.qcow2", 1793# "full-backing-filename":"disks/base.qcow2", 1794# "backing-filename-format":"qcow2", 1795# "snapshots":[ 1796# { 1797# "id": "1", 1798# "name": "snapshot1", 1799# "vm-state-size": 0, 1800# "date-sec": 10000200, 1801# "date-nsec": 12, 1802# "vm-clock-sec": 206, 1803# "vm-clock-nsec": 30 1804# } 1805# ], 1806# "backing-image":{ 1807# "filename":"disks/base.qcow2", 1808# "format":"qcow2", 1809# "virtual-size":2048000 1810# } 1811# } } ] } 1812# 1813## 1814{ 'command': 'query-named-block-nodes', 1815 'returns': [ 'BlockDeviceInfo' ], 1816 'data': { '*flat': 'bool' } } 1817 1818## 1819# @XDbgBlockGraphNodeType: 1820# 1821# @block-backend: corresponds to BlockBackend 1822# 1823# @block-job: corresponds to BlockJob 1824# 1825# @block-driver: corresponds to BlockDriverState 1826# 1827# Since: 4.0 1828## 1829{ 'enum': 'XDbgBlockGraphNodeType', 1830 'data': [ 'block-backend', 'block-job', 'block-driver' ] } 1831 1832## 1833# @XDbgBlockGraphNode: 1834# 1835# @id: Block graph node identifier. This @id is generated only for 1836# x-debug-query-block-graph and does not relate to any other identifiers in 1837# Qemu. 1838# 1839# @type: Type of graph node. Can be one of block-backend, block-job or 1840# block-driver-state. 1841# 1842# @name: Human readable name of the node. Corresponds to node-name for 1843# block-driver-state nodes; is not guaranteed to be unique in the whole 1844# graph (with block-jobs and block-backends). 1845# 1846# Since: 4.0 1847## 1848{ 'struct': 'XDbgBlockGraphNode', 1849 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } } 1850 1851## 1852# @BlockPermission: 1853# 1854# Enum of base block permissions. 1855# 1856# @consistent-read: A user that has the "permission" of consistent reads is 1857# guaranteed that their view of the contents of the block 1858# device is complete and self-consistent, representing the 1859# contents of a disk at a specific point. 1860# For most block devices (including their backing files) this 1861# is true, but the property cannot be maintained in a few 1862# situations like for intermediate nodes of a commit block 1863# job. 1864# 1865# @write: This permission is required to change the visible disk contents. 1866# 1867# @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is 1868# both enough and required for writes to the block node when 1869# the caller promises that the visible disk content doesn't 1870# change. 1871# As the BLK_PERM_WRITE permission is strictly stronger, 1872# either is sufficient to perform an unchanging write. 1873# 1874# @resize: This permission is required to change the size of a block node. 1875# 1876# Since: 4.0 1877## 1878{ 'enum': 'BlockPermission', 1879 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] } 1880 1881## 1882# @XDbgBlockGraphEdge: 1883# 1884# Block Graph edge description for x-debug-query-block-graph. 1885# 1886# @parent: parent id 1887# 1888# @child: child id 1889# 1890# @name: name of the relation (examples are 'file' and 'backing') 1891# 1892# @perm: granted permissions for the parent operating on the child 1893# 1894# @shared-perm: permissions that can still be granted to other users of the 1895# child while it is still attached to this parent 1896# 1897# Since: 4.0 1898## 1899{ 'struct': 'XDbgBlockGraphEdge', 1900 'data': { 'parent': 'uint64', 'child': 'uint64', 1901 'name': 'str', 'perm': [ 'BlockPermission' ], 1902 'shared-perm': [ 'BlockPermission' ] } } 1903 1904## 1905# @XDbgBlockGraph: 1906# 1907# Block Graph - list of nodes and list of edges. 1908# 1909# Since: 4.0 1910## 1911{ 'struct': 'XDbgBlockGraph', 1912 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } } 1913 1914## 1915# @x-debug-query-block-graph: 1916# 1917# Get the block graph. 1918# 1919# Features: 1920# @unstable: This command is meant for debugging. 1921# 1922# Since: 4.0 1923## 1924{ 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph', 1925 'features': [ 'unstable' ] } 1926 1927## 1928# @drive-mirror: 1929# 1930# Start mirroring a block device's writes to a new destination. target 1931# specifies the target of the new image. If the file exists, or if it 1932# is a device, it will be used as the new destination for writes. If 1933# it does not exist, a new file will be created. format specifies the 1934# format of the mirror image, default is to probe if mode='existing', 1935# else the format of the source. 1936# 1937# Returns: - nothing on success 1938# - If @device is not a valid block device, GenericError 1939# 1940# Since: 1.3 1941# 1942# Example: 1943# 1944# -> { "execute": "drive-mirror", 1945# "arguments": { "device": "ide-hd0", 1946# "target": "/some/place/my-image", 1947# "sync": "full", 1948# "format": "qcow2" } } 1949# <- { "return": {} } 1950# 1951## 1952{ 'command': 'drive-mirror', 'boxed': true, 1953 'data': 'DriveMirror' } 1954 1955## 1956# @DriveMirror: 1957# 1958# A set of parameters describing drive mirror setup. 1959# 1960# @job-id: identifier for the newly-created block job. If 1961# omitted, the device name will be used. (Since 2.7) 1962# 1963# @device: the device name or node-name of a root node whose writes should be 1964# mirrored. 1965# 1966# @target: the target of the new image. If the file exists, or if it 1967# is a device, the existing file/device will be used as the new 1968# destination. If it does not exist, a new file will be created. 1969# 1970# @format: the format of the new destination, default is to 1971# probe if @mode is 'existing', else the format of the source 1972# 1973# @node-name: the new block driver state node name in the graph 1974# (Since 2.1) 1975# 1976# @replaces: with sync=full graph node name to be replaced by the new 1977# image when a whole image copy is done. This can be used to repair 1978# broken Quorum files. By default, @device is replaced, although 1979# implicitly created filters on it are kept. (Since 2.1) 1980# 1981# @mode: whether and how QEMU should create a new image, default is 1982# 'absolute-paths'. 1983# 1984# @speed: the maximum speed, in bytes per second 1985# 1986# @sync: what parts of the disk image should be copied to the destination 1987# (all the disk, only the sectors allocated in the topmost image, or 1988# only new I/O). 1989# 1990# @granularity: granularity of the dirty bitmap, default is 64K 1991# if the image format doesn't have clusters, 4K if the clusters 1992# are smaller than that, else the cluster size. Must be a 1993# power of 2 between 512 and 64M (since 1.4). 1994# 1995# @buf-size: maximum amount of data in flight from source to 1996# target (since 1.4). 1997# 1998# @on-source-error: the action to take on an error on the source, 1999# default 'report'. 'stop' and 'enospc' can only be used 2000# if the block device supports io-status (see BlockInfo). 2001# 2002# @on-target-error: the action to take on an error on the target, 2003# default 'report' (no limitations, since this applies to 2004# a different block device than @device). 2005# 2006# @unmap: Whether to try to unmap target sectors where source has 2007# only zero. If true, and target unallocated sectors will read as zero, 2008# target image sectors will be unmapped; otherwise, zeroes will be 2009# written. Both will result in identical contents. 2010# Default is true. (Since 2.4) 2011# 2012# @copy-mode: when to copy data to the destination; defaults to 'background' 2013# (Since: 3.0) 2014# 2015# @auto-finalize: When false, this job will wait in a PENDING state after it has 2016# finished its work, waiting for @block-job-finalize before 2017# making any block graph changes. 2018# When true, this job will automatically 2019# perform its abort or commit actions. 2020# Defaults to true. (Since 3.1) 2021# 2022# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it 2023# has completely ceased all work, and awaits @block-job-dismiss. 2024# When true, this job will automatically disappear from the query 2025# list without user intervention. 2026# Defaults to true. (Since 3.1) 2027# 2028# Since: 1.3 2029## 2030{ 'struct': 'DriveMirror', 2031 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', 2032 '*format': 'str', '*node-name': 'str', '*replaces': 'str', 2033 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', 2034 '*speed': 'int', '*granularity': 'uint32', 2035 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', 2036 '*on-target-error': 'BlockdevOnError', 2037 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode', 2038 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } 2039 2040## 2041# @BlockDirtyBitmap: 2042# 2043# @node: name of device/node which the bitmap is tracking 2044# 2045# @name: name of the dirty bitmap 2046# 2047# Since: 2.4 2048## 2049{ 'struct': 'BlockDirtyBitmap', 2050 'data': { 'node': 'str', 'name': 'str' } } 2051 2052## 2053# @BlockDirtyBitmapAdd: 2054# 2055# @node: name of device/node which the bitmap is tracking 2056# 2057# @name: name of the dirty bitmap (must be less than 1024 bytes) 2058# 2059# @granularity: the bitmap granularity, default is 64k for 2060# block-dirty-bitmap-add 2061# 2062# @persistent: the bitmap is persistent, i.e. it will be saved to the 2063# corresponding block device image file on its close. For now only 2064# Qcow2 disks support persistent bitmaps. Default is false for 2065# block-dirty-bitmap-add. (Since: 2.10) 2066# 2067# @disabled: the bitmap is created in the disabled state, which means that 2068# it will not track drive changes. The bitmap may be enabled with 2069# block-dirty-bitmap-enable. Default is false. (Since: 4.0) 2070# 2071# Since: 2.4 2072## 2073{ 'struct': 'BlockDirtyBitmapAdd', 2074 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32', 2075 '*persistent': 'bool', '*disabled': 'bool' } } 2076 2077## 2078# @BlockDirtyBitmapOrStr: 2079# 2080# @local: name of the bitmap, attached to the same node as target bitmap. 2081# 2082# @external: bitmap with specified node 2083# 2084# Since: 4.1 2085## 2086{ 'alternate': 'BlockDirtyBitmapOrStr', 2087 'data': { 'local': 'str', 2088 'external': 'BlockDirtyBitmap' } } 2089 2090## 2091# @BlockDirtyBitmapMerge: 2092# 2093# @node: name of device/node which the @target bitmap is tracking 2094# 2095# @target: name of the destination dirty bitmap 2096# 2097# @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully 2098# specified BlockDirtyBitmap elements. The latter are supported 2099# since 4.1. 2100# 2101# Since: 4.0 2102## 2103{ 'struct': 'BlockDirtyBitmapMerge', 2104 'data': { 'node': 'str', 'target': 'str', 2105 'bitmaps': ['BlockDirtyBitmapOrStr'] } } 2106 2107## 2108# @block-dirty-bitmap-add: 2109# 2110# Create a dirty bitmap with a name on the node, and start tracking the writes. 2111# 2112# Returns: - nothing on success 2113# - If @node is not a valid block device or node, DeviceNotFound 2114# - If @name is already taken, GenericError with an explanation 2115# 2116# Since: 2.4 2117# 2118# Example: 2119# 2120# -> { "execute": "block-dirty-bitmap-add", 2121# "arguments": { "node": "drive0", "name": "bitmap0" } } 2122# <- { "return": {} } 2123# 2124## 2125{ 'command': 'block-dirty-bitmap-add', 2126 'data': 'BlockDirtyBitmapAdd' } 2127 2128## 2129# @block-dirty-bitmap-remove: 2130# 2131# Stop write tracking and remove the dirty bitmap that was created 2132# with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its 2133# storage too. 2134# 2135# Returns: - nothing on success 2136# - If @node is not a valid block device or node, DeviceNotFound 2137# - If @name is not found, GenericError with an explanation 2138# - if @name is frozen by an operation, GenericError 2139# 2140# Since: 2.4 2141# 2142# Example: 2143# 2144# -> { "execute": "block-dirty-bitmap-remove", 2145# "arguments": { "node": "drive0", "name": "bitmap0" } } 2146# <- { "return": {} } 2147# 2148## 2149{ 'command': 'block-dirty-bitmap-remove', 2150 'data': 'BlockDirtyBitmap' } 2151 2152## 2153# @block-dirty-bitmap-clear: 2154# 2155# Clear (reset) a dirty bitmap on the device, so that an incremental 2156# backup from this point in time forward will only backup clusters 2157# modified after this clear operation. 2158# 2159# Returns: - nothing on success 2160# - If @node is not a valid block device, DeviceNotFound 2161# - If @name is not found, GenericError with an explanation 2162# 2163# Since: 2.4 2164# 2165# Example: 2166# 2167# -> { "execute": "block-dirty-bitmap-clear", 2168# "arguments": { "node": "drive0", "name": "bitmap0" } } 2169# <- { "return": {} } 2170# 2171## 2172{ 'command': 'block-dirty-bitmap-clear', 2173 'data': 'BlockDirtyBitmap' } 2174 2175## 2176# @block-dirty-bitmap-enable: 2177# 2178# Enables a dirty bitmap so that it will begin tracking disk changes. 2179# 2180# Returns: - nothing on success 2181# - If @node is not a valid block device, DeviceNotFound 2182# - If @name is not found, GenericError with an explanation 2183# 2184# Since: 4.0 2185# 2186# Example: 2187# 2188# -> { "execute": "block-dirty-bitmap-enable", 2189# "arguments": { "node": "drive0", "name": "bitmap0" } } 2190# <- { "return": {} } 2191# 2192## 2193{ 'command': 'block-dirty-bitmap-enable', 2194 'data': 'BlockDirtyBitmap' } 2195 2196## 2197# @block-dirty-bitmap-disable: 2198# 2199# Disables a dirty bitmap so that it will stop tracking disk changes. 2200# 2201# Returns: - nothing on success 2202# - If @node is not a valid block device, DeviceNotFound 2203# - If @name is not found, GenericError with an explanation 2204# 2205# Since: 4.0 2206# 2207# Example: 2208# 2209# -> { "execute": "block-dirty-bitmap-disable", 2210# "arguments": { "node": "drive0", "name": "bitmap0" } } 2211# <- { "return": {} } 2212# 2213## 2214{ 'command': 'block-dirty-bitmap-disable', 2215 'data': 'BlockDirtyBitmap' } 2216 2217## 2218# @block-dirty-bitmap-merge: 2219# 2220# Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap. 2221# Dirty bitmaps in @bitmaps will be unchanged, except if it also appears 2222# as the @target bitmap. Any bits already set in @target will still be 2223# set after the merge, i.e., this operation does not clear the target. 2224# On error, @target is unchanged. 2225# 2226# The resulting bitmap will count as dirty any clusters that were dirty in any 2227# of the source bitmaps. This can be used to achieve backup checkpoints, or in 2228# simpler usages, to copy bitmaps. 2229# 2230# Returns: - nothing on success 2231# - If @node is not a valid block device, DeviceNotFound 2232# - If any bitmap in @bitmaps or @target is not found, GenericError 2233# - If any of the bitmaps have different sizes or granularities, 2234# GenericError 2235# 2236# Since: 4.0 2237# 2238# Example: 2239# 2240# -> { "execute": "block-dirty-bitmap-merge", 2241# "arguments": { "node": "drive0", "target": "bitmap0", 2242# "bitmaps": ["bitmap1"] } } 2243# <- { "return": {} } 2244# 2245## 2246{ 'command': 'block-dirty-bitmap-merge', 2247 'data': 'BlockDirtyBitmapMerge' } 2248 2249## 2250# @BlockDirtyBitmapSha256: 2251# 2252# SHA256 hash of dirty bitmap data 2253# 2254# @sha256: ASCII representation of SHA256 bitmap hash 2255# 2256# Since: 2.10 2257## 2258{ 'struct': 'BlockDirtyBitmapSha256', 2259 'data': {'sha256': 'str'} } 2260 2261## 2262# @x-debug-block-dirty-bitmap-sha256: 2263# 2264# Get bitmap SHA256. 2265# 2266# Features: 2267# @unstable: This command is meant for debugging. 2268# 2269# Returns: - BlockDirtyBitmapSha256 on success 2270# - If @node is not a valid block device, DeviceNotFound 2271# - If @name is not found or if hashing has failed, GenericError with an 2272# explanation 2273# 2274# Since: 2.10 2275## 2276{ 'command': 'x-debug-block-dirty-bitmap-sha256', 2277 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256', 2278 'features': [ 'unstable' ] } 2279 2280## 2281# @blockdev-mirror: 2282# 2283# Start mirroring a block device's writes to a new destination. 2284# 2285# @job-id: identifier for the newly-created block job. If 2286# omitted, the device name will be used. (Since 2.7) 2287# 2288# @device: The device name or node-name of a root node whose writes should be 2289# mirrored. 2290# 2291# @target: the id or node-name of the block device to mirror to. This mustn't be 2292# attached to guest. 2293# 2294# @replaces: with sync=full graph node name to be replaced by the new 2295# image when a whole image copy is done. This can be used to repair 2296# broken Quorum files. By default, @device is replaced, although 2297# implicitly created filters on it are kept. 2298# 2299# @speed: the maximum speed, in bytes per second 2300# 2301# @sync: what parts of the disk image should be copied to the destination 2302# (all the disk, only the sectors allocated in the topmost image, or 2303# only new I/O). 2304# 2305# @granularity: granularity of the dirty bitmap, default is 64K 2306# if the image format doesn't have clusters, 4K if the clusters 2307# are smaller than that, else the cluster size. Must be a 2308# power of 2 between 512 and 64M 2309# 2310# @buf-size: maximum amount of data in flight from source to 2311# target 2312# 2313# @on-source-error: the action to take on an error on the source, 2314# default 'report'. 'stop' and 'enospc' can only be used 2315# if the block device supports io-status (see BlockInfo). 2316# 2317# @on-target-error: the action to take on an error on the target, 2318# default 'report' (no limitations, since this applies to 2319# a different block device than @device). 2320# 2321# @filter-node-name: the node name that should be assigned to the 2322# filter driver that the mirror job inserts into the graph 2323# above @device. If this option is not given, a node name is 2324# autogenerated. (Since: 2.9) 2325# 2326# @copy-mode: when to copy data to the destination; defaults to 'background' 2327# (Since: 3.0) 2328# 2329# @auto-finalize: When false, this job will wait in a PENDING state after it has 2330# finished its work, waiting for @block-job-finalize before 2331# making any block graph changes. 2332# When true, this job will automatically 2333# perform its abort or commit actions. 2334# Defaults to true. (Since 3.1) 2335# 2336# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it 2337# has completely ceased all work, and awaits @block-job-dismiss. 2338# When true, this job will automatically disappear from the query 2339# list without user intervention. 2340# Defaults to true. (Since 3.1) 2341# 2342# Returns: nothing on success. 2343# 2344# Since: 2.6 2345# 2346# Example: 2347# 2348# -> { "execute": "blockdev-mirror", 2349# "arguments": { "device": "ide-hd0", 2350# "target": "target0", 2351# "sync": "full" } } 2352# <- { "return": {} } 2353# 2354## 2355{ 'command': 'blockdev-mirror', 2356 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', 2357 '*replaces': 'str', 2358 'sync': 'MirrorSyncMode', 2359 '*speed': 'int', '*granularity': 'uint32', 2360 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', 2361 '*on-target-error': 'BlockdevOnError', 2362 '*filter-node-name': 'str', 2363 '*copy-mode': 'MirrorCopyMode', 2364 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } 2365 2366## 2367# @BlockIOThrottle: 2368# 2369# A set of parameters describing block throttling. 2370# 2371# @device: Block device name 2372# 2373# @id: The name or QOM path of the guest device (since: 2.8) 2374# 2375# @bps: total throughput limit in bytes per second 2376# 2377# @bps_rd: read throughput limit in bytes per second 2378# 2379# @bps_wr: write throughput limit in bytes per second 2380# 2381# @iops: total I/O operations per second 2382# 2383# @iops_rd: read I/O operations per second 2384# 2385# @iops_wr: write I/O operations per second 2386# 2387# @bps_max: total throughput limit during bursts, 2388# in bytes (Since 1.7) 2389# 2390# @bps_rd_max: read throughput limit during bursts, 2391# in bytes (Since 1.7) 2392# 2393# @bps_wr_max: write throughput limit during bursts, 2394# in bytes (Since 1.7) 2395# 2396# @iops_max: total I/O operations per second during bursts, 2397# in bytes (Since 1.7) 2398# 2399# @iops_rd_max: read I/O operations per second during bursts, 2400# in bytes (Since 1.7) 2401# 2402# @iops_wr_max: write I/O operations per second during bursts, 2403# in bytes (Since 1.7) 2404# 2405# @bps_max_length: maximum length of the @bps_max burst 2406# period, in seconds. It must only 2407# be set if @bps_max is set as well. 2408# Defaults to 1. (Since 2.6) 2409# 2410# @bps_rd_max_length: maximum length of the @bps_rd_max 2411# burst period, in seconds. It must only 2412# be set if @bps_rd_max is set as well. 2413# Defaults to 1. (Since 2.6) 2414# 2415# @bps_wr_max_length: maximum length of the @bps_wr_max 2416# burst period, in seconds. It must only 2417# be set if @bps_wr_max is set as well. 2418# Defaults to 1. (Since 2.6) 2419# 2420# @iops_max_length: maximum length of the @iops burst 2421# period, in seconds. It must only 2422# be set if @iops_max is set as well. 2423# Defaults to 1. (Since 2.6) 2424# 2425# @iops_rd_max_length: maximum length of the @iops_rd_max 2426# burst period, in seconds. It must only 2427# be set if @iops_rd_max is set as well. 2428# Defaults to 1. (Since 2.6) 2429# 2430# @iops_wr_max_length: maximum length of the @iops_wr_max 2431# burst period, in seconds. It must only 2432# be set if @iops_wr_max is set as well. 2433# Defaults to 1. (Since 2.6) 2434# 2435# @iops_size: an I/O size in bytes (Since 1.7) 2436# 2437# @group: throttle group name (Since 2.4) 2438# 2439# Features: 2440# @deprecated: Member @device is deprecated. Use @id instead. 2441# 2442# Since: 1.1 2443## 2444{ 'struct': 'BlockIOThrottle', 2445 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] }, 2446 '*id': 'str', 'bps': 'int', 'bps_rd': 'int', 2447 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', 2448 '*bps_max': 'int', '*bps_rd_max': 'int', 2449 '*bps_wr_max': 'int', '*iops_max': 'int', 2450 '*iops_rd_max': 'int', '*iops_wr_max': 'int', 2451 '*bps_max_length': 'int', '*bps_rd_max_length': 'int', 2452 '*bps_wr_max_length': 'int', '*iops_max_length': 'int', 2453 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int', 2454 '*iops_size': 'int', '*group': 'str' } } 2455 2456## 2457# @ThrottleLimits: 2458# 2459# Limit parameters for throttling. 2460# Since some limit combinations are illegal, limits should always be set in one 2461# transaction. All fields are optional. When setting limits, if a field is 2462# missing the current value is not changed. 2463# 2464# @iops-total: limit total I/O operations per second 2465# @iops-total-max: I/O operations burst 2466# @iops-total-max-length: length of the iops-total-max burst period, in seconds 2467# It must only be set if @iops-total-max is set as well. 2468# @iops-read: limit read operations per second 2469# @iops-read-max: I/O operations read burst 2470# @iops-read-max-length: length of the iops-read-max burst period, in seconds 2471# It must only be set if @iops-read-max is set as well. 2472# @iops-write: limit write operations per second 2473# @iops-write-max: I/O operations write burst 2474# @iops-write-max-length: length of the iops-write-max burst period, in seconds 2475# It must only be set if @iops-write-max is set as well. 2476# @bps-total: limit total bytes per second 2477# @bps-total-max: total bytes burst 2478# @bps-total-max-length: length of the bps-total-max burst period, in seconds. 2479# It must only be set if @bps-total-max is set as well. 2480# @bps-read: limit read bytes per second 2481# @bps-read-max: total bytes read burst 2482# @bps-read-max-length: length of the bps-read-max burst period, in seconds 2483# It must only be set if @bps-read-max is set as well. 2484# @bps-write: limit write bytes per second 2485# @bps-write-max: total bytes write burst 2486# @bps-write-max-length: length of the bps-write-max burst period, in seconds 2487# It must only be set if @bps-write-max is set as well. 2488# @iops-size: when limiting by iops max size of an I/O in bytes 2489# 2490# Since: 2.11 2491## 2492{ 'struct': 'ThrottleLimits', 2493 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int', 2494 '*iops-total-max-length' : 'int', '*iops-read' : 'int', 2495 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int', 2496 '*iops-write' : 'int', '*iops-write-max' : 'int', 2497 '*iops-write-max-length' : 'int', '*bps-total' : 'int', 2498 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int', 2499 '*bps-read' : 'int', '*bps-read-max' : 'int', 2500 '*bps-read-max-length' : 'int', '*bps-write' : 'int', 2501 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int', 2502 '*iops-size' : 'int' } } 2503 2504## 2505# @ThrottleGroupProperties: 2506# 2507# Properties for throttle-group objects. 2508# 2509# @limits: limits to apply for this throttle group 2510# 2511# Features: 2512# @unstable: All members starting with x- are aliases for the same key 2513# without x- in the @limits object. This is not a stable 2514# interface and may be removed or changed incompatibly in 2515# the future. Use @limits for a supported stable 2516# interface. 2517# 2518# Since: 2.11 2519## 2520{ 'struct': 'ThrottleGroupProperties', 2521 'data': { '*limits': 'ThrottleLimits', 2522 '*x-iops-total': { 'type': 'int', 2523 'features': [ 'unstable' ] }, 2524 '*x-iops-total-max': { 'type': 'int', 2525 'features': [ 'unstable' ] }, 2526 '*x-iops-total-max-length': { 'type': 'int', 2527 'features': [ 'unstable' ] }, 2528 '*x-iops-read': { 'type': 'int', 2529 'features': [ 'unstable' ] }, 2530 '*x-iops-read-max': { 'type': 'int', 2531 'features': [ 'unstable' ] }, 2532 '*x-iops-read-max-length': { 'type': 'int', 2533 'features': [ 'unstable' ] }, 2534 '*x-iops-write': { 'type': 'int', 2535 'features': [ 'unstable' ] }, 2536 '*x-iops-write-max': { 'type': 'int', 2537 'features': [ 'unstable' ] }, 2538 '*x-iops-write-max-length': { 'type': 'int', 2539 'features': [ 'unstable' ] }, 2540 '*x-bps-total': { 'type': 'int', 2541 'features': [ 'unstable' ] }, 2542 '*x-bps-total-max': { 'type': 'int', 2543 'features': [ 'unstable' ] }, 2544 '*x-bps-total-max-length': { 'type': 'int', 2545 'features': [ 'unstable' ] }, 2546 '*x-bps-read': { 'type': 'int', 2547 'features': [ 'unstable' ] }, 2548 '*x-bps-read-max': { 'type': 'int', 2549 'features': [ 'unstable' ] }, 2550 '*x-bps-read-max-length': { 'type': 'int', 2551 'features': [ 'unstable' ] }, 2552 '*x-bps-write': { 'type': 'int', 2553 'features': [ 'unstable' ] }, 2554 '*x-bps-write-max': { 'type': 'int', 2555 'features': [ 'unstable' ] }, 2556 '*x-bps-write-max-length': { 'type': 'int', 2557 'features': [ 'unstable' ] }, 2558 '*x-iops-size': { 'type': 'int', 2559 'features': [ 'unstable' ] } } } 2560 2561## 2562# @block-stream: 2563# 2564# Copy data from a backing file into a block device. 2565# 2566# The block streaming operation is performed in the background until the entire 2567# backing file has been copied. This command returns immediately once streaming 2568# has started. The status of ongoing block streaming operations can be checked 2569# with query-block-jobs. The operation can be stopped before it has completed 2570# using the block-job-cancel command. 2571# 2572# The node that receives the data is called the top image, can be located in 2573# any part of the chain (but always above the base image; see below) and can be 2574# specified using its device or node name. Earlier qemu versions only allowed 2575# 'device' to name the top level node; presence of the 'base-node' parameter 2576# during introspection can be used as a witness of the enhanced semantics 2577# of 'device'. 2578# 2579# If a base file is specified then sectors are not copied from that base file and 2580# its backing chain. This can be used to stream a subset of the backing file 2581# chain instead of flattening the entire image. 2582# When streaming completes the image file will have the base file as its backing 2583# file, unless that node was changed while the job was running. In that case, 2584# base's parent's backing (or filtered, whichever exists) child (i.e., base at 2585# the beginning of the job) will be the new backing file. 2586# 2587# On successful completion the image file is updated to drop the backing file 2588# and the BLOCK_JOB_COMPLETED event is emitted. 2589# 2590# In case @device is a filter node, block-stream modifies the first non-filter 2591# overlay node below it to point to the new backing node instead of modifying 2592# @device itself. 2593# 2594# @job-id: identifier for the newly-created block job. If 2595# omitted, the device name will be used. (Since 2.7) 2596# 2597# @device: the device or node name of the top image 2598# 2599# @base: the common backing file name. 2600# It cannot be set if @base-node or @bottom is also set. 2601# 2602# @base-node: the node name of the backing file. 2603# It cannot be set if @base or @bottom is also set. (Since 2.8) 2604# 2605# @bottom: the last node in the chain that should be streamed into 2606# top. It cannot be set if @base or @base-node is also set. 2607# It cannot be filter node. (Since 6.0) 2608# 2609# @backing-file: The backing file string to write into the top 2610# image. This filename is not validated. 2611# 2612# If a pathname string is such that it cannot be 2613# resolved by QEMU, that means that subsequent QMP or 2614# HMP commands must use node-names for the image in 2615# question, as filename lookup methods will fail. 2616# 2617# If not specified, QEMU will automatically determine 2618# the backing file string to use, or error out if there 2619# is no obvious choice. Care should be taken when 2620# specifying the string, to specify a valid filename or 2621# protocol. 2622# (Since 2.1) 2623# 2624# @speed: the maximum speed, in bytes per second 2625# 2626# @on-error: the action to take on an error (default report). 2627# 'stop' and 'enospc' can only be used if the block device 2628# supports io-status (see BlockInfo). Since 1.3. 2629# 2630# @filter-node-name: the node name that should be assigned to the 2631# filter driver that the stream job inserts into the graph 2632# above @device. If this option is not given, a node name is 2633# autogenerated. (Since: 6.0) 2634# 2635# @auto-finalize: When false, this job will wait in a PENDING state after it has 2636# finished its work, waiting for @block-job-finalize before 2637# making any block graph changes. 2638# When true, this job will automatically 2639# perform its abort or commit actions. 2640# Defaults to true. (Since 3.1) 2641# 2642# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it 2643# has completely ceased all work, and awaits @block-job-dismiss. 2644# When true, this job will automatically disappear from the query 2645# list without user intervention. 2646# Defaults to true. (Since 3.1) 2647# 2648# Returns: - Nothing on success. 2649# - If @device does not exist, DeviceNotFound. 2650# 2651# Since: 1.1 2652# 2653# Example: 2654# 2655# -> { "execute": "block-stream", 2656# "arguments": { "device": "virtio0", 2657# "base": "/tmp/master.qcow2" } } 2658# <- { "return": {} } 2659# 2660## 2661{ 'command': 'block-stream', 2662 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', 2663 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str', 2664 '*speed': 'int', '*on-error': 'BlockdevOnError', 2665 '*filter-node-name': 'str', 2666 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } 2667 2668## 2669# @block-job-set-speed: 2670# 2671# Set maximum speed for a background block operation. 2672# 2673# This command can only be issued when there is an active block job. 2674# 2675# Throttling can be disabled by setting the speed to 0. 2676# 2677# @device: The job identifier. This used to be a device name (hence 2678# the name of the parameter), but since QEMU 2.7 it can have 2679# other values. 2680# 2681# @speed: the maximum speed, in bytes per second, or 0 for unlimited. 2682# Defaults to 0. 2683# 2684# Returns: - Nothing on success 2685# - If no background operation is active on this device, DeviceNotActive 2686# 2687# Since: 1.1 2688## 2689{ 'command': 'block-job-set-speed', 2690 'data': { 'device': 'str', 'speed': 'int' } } 2691 2692## 2693# @block-job-cancel: 2694# 2695# Stop an active background block operation. 2696# 2697# This command returns immediately after marking the active background block 2698# operation for cancellation. It is an error to call this command if no 2699# operation is in progress. 2700# 2701# The operation will cancel as soon as possible and then emit the 2702# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when 2703# enumerated using query-block-jobs. 2704# 2705# Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated 2706# (via the event BLOCK_JOB_READY) that the source and destination are 2707# synchronized, then the event triggered by this command changes to 2708# BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the 2709# destination now has a point-in-time copy tied to the time of the cancellation. 2710# 2711# For streaming, the image file retains its backing file unless the streaming 2712# operation happens to complete just as it is being cancelled. A new streaming 2713# operation can be started at a later time to finish copying all data from the 2714# backing file. 2715# 2716# @device: The job identifier. This used to be a device name (hence 2717# the name of the parameter), but since QEMU 2.7 it can have 2718# other values. 2719# 2720# @force: If true, and the job has already emitted the event BLOCK_JOB_READY, 2721# abandon the job immediately (even if it is paused) instead of waiting 2722# for the destination to complete its final synchronization (since 1.3) 2723# 2724# Returns: - Nothing on success 2725# - If no background operation is active on this device, DeviceNotActive 2726# 2727# Since: 1.1 2728## 2729{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } } 2730 2731## 2732# @block-job-pause: 2733# 2734# Pause an active background block operation. 2735# 2736# This command returns immediately after marking the active background block 2737# operation for pausing. It is an error to call this command if no 2738# operation is in progress or if the job is already paused. 2739# 2740# The operation will pause as soon as possible. No event is emitted when 2741# the operation is actually paused. Cancelling a paused job automatically 2742# resumes it. 2743# 2744# @device: The job identifier. This used to be a device name (hence 2745# the name of the parameter), but since QEMU 2.7 it can have 2746# other values. 2747# 2748# Returns: - Nothing on success 2749# - If no background operation is active on this device, DeviceNotActive 2750# 2751# Since: 1.3 2752## 2753{ 'command': 'block-job-pause', 'data': { 'device': 'str' } } 2754 2755## 2756# @block-job-resume: 2757# 2758# Resume an active background block operation. 2759# 2760# This command returns immediately after resuming a paused background block 2761# operation. It is an error to call this command if no operation is in 2762# progress or if the job is not paused. 2763# 2764# This command also clears the error status of the job. 2765# 2766# @device: The job identifier. This used to be a device name (hence 2767# the name of the parameter), but since QEMU 2.7 it can have 2768# other values. 2769# 2770# Returns: - Nothing on success 2771# - If no background operation is active on this device, DeviceNotActive 2772# 2773# Since: 1.3 2774## 2775{ 'command': 'block-job-resume', 'data': { 'device': 'str' } } 2776 2777## 2778# @block-job-complete: 2779# 2780# Manually trigger completion of an active background block operation. This 2781# is supported for drive mirroring, where it also switches the device to 2782# write to the target path only. The ability to complete is signaled with 2783# a BLOCK_JOB_READY event. 2784# 2785# This command completes an active background block operation synchronously. 2786# The ordering of this command's return with the BLOCK_JOB_COMPLETED event 2787# is not defined. Note that if an I/O error occurs during the processing of 2788# this command: 1) the command itself will fail; 2) the error will be processed 2789# according to the rerror/werror arguments that were specified when starting 2790# the operation. 2791# 2792# A cancelled or paused job cannot be completed. 2793# 2794# @device: The job identifier. This used to be a device name (hence 2795# the name of the parameter), but since QEMU 2.7 it can have 2796# other values. 2797# 2798# Returns: - Nothing on success 2799# - If no background operation is active on this device, DeviceNotActive 2800# 2801# Since: 1.3 2802## 2803{ 'command': 'block-job-complete', 'data': { 'device': 'str' } } 2804 2805## 2806# @block-job-dismiss: 2807# 2808# For jobs that have already concluded, remove them from the block-job-query 2809# list. This command only needs to be run for jobs which were started with 2810# QEMU 2.12+ job lifetime management semantics. 2811# 2812# This command will refuse to operate on any job that has not yet reached 2813# its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the 2814# BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need 2815# to be used as appropriate. 2816# 2817# @id: The job identifier. 2818# 2819# Returns: Nothing on success 2820# 2821# Since: 2.12 2822## 2823{ 'command': 'block-job-dismiss', 'data': { 'id': 'str' } } 2824 2825## 2826# @block-job-finalize: 2827# 2828# Once a job that has manual=true reaches the pending state, it can be 2829# instructed to finalize any graph changes and do any necessary cleanup 2830# via this command. 2831# For jobs in a transaction, instructing one job to finalize will force 2832# ALL jobs in the transaction to finalize, so it is only necessary to instruct 2833# a single member job to finalize. 2834# 2835# @id: The job identifier. 2836# 2837# Returns: Nothing on success 2838# 2839# Since: 2.12 2840## 2841{ 'command': 'block-job-finalize', 'data': { 'id': 'str' } } 2842 2843## 2844# @BlockdevDiscardOptions: 2845# 2846# Determines how to handle discard requests. 2847# 2848# @ignore: Ignore the request 2849# @unmap: Forward as an unmap request 2850# 2851# Since: 2.9 2852## 2853{ 'enum': 'BlockdevDiscardOptions', 2854 'data': [ 'ignore', 'unmap' ] } 2855 2856## 2857# @BlockdevDetectZeroesOptions: 2858# 2859# Describes the operation mode for the automatic conversion of plain 2860# zero writes by the OS to driver specific optimized zero write commands. 2861# 2862# @off: Disabled (default) 2863# @on: Enabled 2864# @unmap: Enabled and even try to unmap blocks if possible. This requires 2865# also that @BlockdevDiscardOptions is set to unmap for this device. 2866# 2867# Since: 2.1 2868## 2869{ 'enum': 'BlockdevDetectZeroesOptions', 2870 'data': [ 'off', 'on', 'unmap' ] } 2871 2872## 2873# @BlockdevAioOptions: 2874# 2875# Selects the AIO backend to handle I/O requests 2876# 2877# @threads: Use qemu's thread pool 2878# @native: Use native AIO backend (only Linux and Windows) 2879# @io_uring: Use linux io_uring (since 5.0) 2880# 2881# Since: 2.9 2882## 2883{ 'enum': 'BlockdevAioOptions', 2884 'data': [ 'threads', 'native', 2885 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] } 2886 2887## 2888# @BlockdevCacheOptions: 2889# 2890# Includes cache-related options for block devices 2891# 2892# @direct: enables use of O_DIRECT (bypass the host page cache; 2893# default: false) 2894# @no-flush: ignore any flush requests for the device (default: 2895# false) 2896# 2897# Since: 2.9 2898## 2899{ 'struct': 'BlockdevCacheOptions', 2900 'data': { '*direct': 'bool', 2901 '*no-flush': 'bool' } } 2902 2903## 2904# @BlockdevDriver: 2905# 2906# Drivers that are supported in block device operations. 2907# 2908# @throttle: Since 2.11 2909# @nvme: Since 2.12 2910# @copy-on-read: Since 3.0 2911# @blklogwrites: Since 3.0 2912# @blkreplay: Since 4.2 2913# @compress: Since 5.0 2914# @copy-before-write: Since 6.2 2915# @snapshot-access: Since 7.0 2916# 2917# Since: 2.9 2918## 2919{ 'enum': 'BlockdevDriver', 2920 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs', 2921 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg', 2922 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster', 2923 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' }, 2924 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' }, 2925 'http', 'https', 'iscsi', 2926 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 2927 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', 2928 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' }, 2929 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } 2930 2931## 2932# @BlockdevOptionsFile: 2933# 2934# Driver specific block device options for the file backend. 2935# 2936# @filename: path to the image file 2937# @pr-manager: the id for the object that will handle persistent reservations 2938# for this device (default: none, forward the commands via SG_IO; 2939# since 2.11) 2940# @aio: AIO backend (default: threads) (since: 2.8) 2941# @aio-max-batch: maximum number of requests to batch together into a single 2942# submission in the AIO backend. The smallest value between 2943# this and the aio-max-batch value of the IOThread object is 2944# chosen. 2945# 0 means that the AIO backend will handle it automatically. 2946# (default: 0, since 6.2) 2947# @locking: whether to enable file locking. If set to 'auto', only enable 2948# when Open File Descriptor (OFD) locking API is available 2949# (default: auto, since 2.10) 2950# @drop-cache: invalidate page cache during live migration. This prevents 2951# stale data on the migration destination with cache.direct=off. 2952# Currently only supported on Linux hosts. 2953# (default: on, since: 4.0) 2954# @x-check-cache-dropped: whether to check that page cache was dropped on live 2955# migration. May cause noticeable delays if the image 2956# file is large, do not use in production. 2957# (default: off) (since: 3.0) 2958# 2959# Features: 2960# @dynamic-auto-read-only: If present, enabled auto-read-only means that the 2961# driver will open the image read-only at first, 2962# dynamically reopen the image file read-write when 2963# the first writer is attached to the node and reopen 2964# read-only when the last writer is detached. This 2965# allows giving QEMU write permissions only on demand 2966# when an operation actually needs write access. 2967# @unstable: Member x-check-cache-dropped is meant for debugging. 2968# 2969# Since: 2.9 2970## 2971{ 'struct': 'BlockdevOptionsFile', 2972 'data': { 'filename': 'str', 2973 '*pr-manager': 'str', 2974 '*locking': 'OnOffAuto', 2975 '*aio': 'BlockdevAioOptions', 2976 '*aio-max-batch': 'int', 2977 '*drop-cache': {'type': 'bool', 2978 'if': 'CONFIG_LINUX'}, 2979 '*x-check-cache-dropped': { 'type': 'bool', 2980 'features': [ 'unstable' ] } }, 2981 'features': [ { 'name': 'dynamic-auto-read-only', 2982 'if': 'CONFIG_POSIX' } ] } 2983 2984## 2985# @BlockdevOptionsNull: 2986# 2987# Driver specific block device options for the null backend. 2988# 2989# @size: size of the device in bytes. 2990# @latency-ns: emulated latency (in nanoseconds) in processing 2991# requests. Default to zero which completes requests immediately. 2992# (Since 2.4) 2993# @read-zeroes: if true, reads from the device produce zeroes; if false, the 2994# buffer is left unchanged. (default: false; since: 4.1) 2995# 2996# Since: 2.9 2997## 2998{ 'struct': 'BlockdevOptionsNull', 2999 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } } 3000 3001## 3002# @BlockdevOptionsNVMe: 3003# 3004# Driver specific block device options for the NVMe backend. 3005# 3006# @device: PCI controller address of the NVMe device in 3007# format hhhh:bb:ss.f (host:bus:slot.function) 3008# @namespace: namespace number of the device, starting from 1. 3009# 3010# Note that the PCI @device must have been unbound from any host 3011# kernel driver before instructing QEMU to add the blockdev. 3012# 3013# Since: 2.12 3014## 3015{ 'struct': 'BlockdevOptionsNVMe', 3016 'data': { 'device': 'str', 'namespace': 'int' } } 3017 3018## 3019# @BlockdevOptionsVVFAT: 3020# 3021# Driver specific block device options for the vvfat protocol. 3022# 3023# @dir: directory to be exported as FAT image 3024# @fat-type: FAT type: 12, 16 or 32 3025# @floppy: whether to export a floppy image (true) or 3026# partitioned hard disk (false; default) 3027# @label: set the volume label, limited to 11 bytes. FAT16 and 3028# FAT32 traditionally have some restrictions on labels, which are 3029# ignored by most operating systems. Defaults to "QEMU VVFAT". 3030# (since 2.4) 3031# @rw: whether to allow write operations (default: false) 3032# 3033# Since: 2.9 3034## 3035{ 'struct': 'BlockdevOptionsVVFAT', 3036 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool', 3037 '*label': 'str', '*rw': 'bool' } } 3038 3039## 3040# @BlockdevOptionsGenericFormat: 3041# 3042# Driver specific block device options for image format that have no option 3043# besides their data source. 3044# 3045# @file: reference to or definition of the data source block device 3046# 3047# Since: 2.9 3048## 3049{ 'struct': 'BlockdevOptionsGenericFormat', 3050 'data': { 'file': 'BlockdevRef' } } 3051 3052## 3053# @BlockdevOptionsLUKS: 3054# 3055# Driver specific block device options for LUKS. 3056# 3057# @key-secret: the ID of a QCryptoSecret object providing 3058# the decryption key (since 2.6). Mandatory except when 3059# doing a metadata-only probe of the image. 3060# 3061# Since: 2.9 3062## 3063{ 'struct': 'BlockdevOptionsLUKS', 3064 'base': 'BlockdevOptionsGenericFormat', 3065 'data': { '*key-secret': 'str' } } 3066 3067## 3068# @BlockdevOptionsGenericCOWFormat: 3069# 3070# Driver specific block device options for image format that have no option 3071# besides their data source and an optional backing file. 3072# 3073# @backing: reference to or definition of the backing file block 3074# device, null disables the backing file entirely. 3075# Defaults to the backing file stored the image file. 3076# 3077# Since: 2.9 3078## 3079{ 'struct': 'BlockdevOptionsGenericCOWFormat', 3080 'base': 'BlockdevOptionsGenericFormat', 3081 'data': { '*backing': 'BlockdevRefOrNull' } } 3082 3083## 3084# @Qcow2OverlapCheckMode: 3085# 3086# General overlap check modes. 3087# 3088# @none: Do not perform any checks 3089# 3090# @constant: Perform only checks which can be done in constant time and 3091# without reading anything from disk 3092# 3093# @cached: Perform only checks which can be done without reading anything 3094# from disk 3095# 3096# @all: Perform all available overlap checks 3097# 3098# Since: 2.9 3099## 3100{ 'enum': 'Qcow2OverlapCheckMode', 3101 'data': [ 'none', 'constant', 'cached', 'all' ] } 3102 3103## 3104# @Qcow2OverlapCheckFlags: 3105# 3106# Structure of flags for each metadata structure. Setting a field to 'true' 3107# makes qemu guard that structure against unintended overwriting. The default 3108# value is chosen according to the template given. 3109# 3110# @template: Specifies a template mode which can be adjusted using the other 3111# flags, defaults to 'cached' 3112# 3113# @bitmap-directory: since 3.0 3114# 3115# Since: 2.9 3116## 3117{ 'struct': 'Qcow2OverlapCheckFlags', 3118 'data': { '*template': 'Qcow2OverlapCheckMode', 3119 '*main-header': 'bool', 3120 '*active-l1': 'bool', 3121 '*active-l2': 'bool', 3122 '*refcount-table': 'bool', 3123 '*refcount-block': 'bool', 3124 '*snapshot-table': 'bool', 3125 '*inactive-l1': 'bool', 3126 '*inactive-l2': 'bool', 3127 '*bitmap-directory': 'bool' } } 3128 3129## 3130# @Qcow2OverlapChecks: 3131# 3132# Specifies which metadata structures should be guarded against unintended 3133# overwriting. 3134# 3135# @flags: set of flags for separate specification of each metadata structure 3136# type 3137# 3138# @mode: named mode which chooses a specific set of flags 3139# 3140# Since: 2.9 3141## 3142{ 'alternate': 'Qcow2OverlapChecks', 3143 'data': { 'flags': 'Qcow2OverlapCheckFlags', 3144 'mode': 'Qcow2OverlapCheckMode' } } 3145 3146## 3147# @BlockdevQcowEncryptionFormat: 3148# 3149# @aes: AES-CBC with plain64 initialization vectors 3150# 3151# Since: 2.10 3152## 3153{ 'enum': 'BlockdevQcowEncryptionFormat', 3154 'data': [ 'aes' ] } 3155 3156## 3157# @BlockdevQcowEncryption: 3158# 3159# Since: 2.10 3160## 3161{ 'union': 'BlockdevQcowEncryption', 3162 'base': { 'format': 'BlockdevQcowEncryptionFormat' }, 3163 'discriminator': 'format', 3164 'data': { 'aes': 'QCryptoBlockOptionsQCow' } } 3165 3166## 3167# @BlockdevOptionsQcow: 3168# 3169# Driver specific block device options for qcow. 3170# 3171# @encrypt: Image decryption options. Mandatory for 3172# encrypted images, except when doing a metadata-only 3173# probe of the image. 3174# 3175# Since: 2.10 3176## 3177{ 'struct': 'BlockdevOptionsQcow', 3178 'base': 'BlockdevOptionsGenericCOWFormat', 3179 'data': { '*encrypt': 'BlockdevQcowEncryption' } } 3180 3181## 3182# @BlockdevQcow2EncryptionFormat: 3183# 3184# @aes: AES-CBC with plain64 initialization vectors 3185# 3186# Since: 2.10 3187## 3188{ 'enum': 'BlockdevQcow2EncryptionFormat', 3189 'data': [ 'aes', 'luks' ] } 3190 3191## 3192# @BlockdevQcow2Encryption: 3193# 3194# Since: 2.10 3195## 3196{ 'union': 'BlockdevQcow2Encryption', 3197 'base': { 'format': 'BlockdevQcow2EncryptionFormat' }, 3198 'discriminator': 'format', 3199 'data': { 'aes': 'QCryptoBlockOptionsQCow', 3200 'luks': 'QCryptoBlockOptionsLUKS'} } 3201 3202## 3203# @BlockdevOptionsPreallocate: 3204# 3205# Filter driver intended to be inserted between format and protocol node 3206# and do preallocation in protocol node on write. 3207# 3208# @prealloc-align: on preallocation, align file length to this number, 3209# default 1048576 (1M) 3210# 3211# @prealloc-size: how much to preallocate, default 134217728 (128M) 3212# 3213# Since: 6.0 3214## 3215{ 'struct': 'BlockdevOptionsPreallocate', 3216 'base': 'BlockdevOptionsGenericFormat', 3217 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } } 3218 3219## 3220# @BlockdevOptionsQcow2: 3221# 3222# Driver specific block device options for qcow2. 3223# 3224# @lazy-refcounts: whether to enable the lazy refcounts 3225# feature (default is taken from the image file) 3226# 3227# @pass-discard-request: whether discard requests to the qcow2 3228# device should be forwarded to the data source 3229# 3230# @pass-discard-snapshot: whether discard requests for the data source 3231# should be issued when a snapshot operation (e.g. 3232# deleting a snapshot) frees clusters in the qcow2 file 3233# 3234# @pass-discard-other: whether discard requests for the data source 3235# should be issued on other occasions where a cluster 3236# gets freed 3237# 3238# @overlap-check: which overlap checks to perform for writes 3239# to the image, defaults to 'cached' (since 2.2) 3240# 3241# @cache-size: the maximum total size of the L2 table and 3242# refcount block caches in bytes (since 2.2) 3243# 3244# @l2-cache-size: the maximum size of the L2 table cache in 3245# bytes (since 2.2) 3246# 3247# @l2-cache-entry-size: the size of each entry in the L2 cache in 3248# bytes. It must be a power of two between 512 3249# and the cluster size. The default value is 3250# the cluster size (since 2.12) 3251# 3252# @refcount-cache-size: the maximum size of the refcount block cache 3253# in bytes (since 2.2) 3254# 3255# @cache-clean-interval: clean unused entries in the L2 and refcount 3256# caches. The interval is in seconds. The default value 3257# is 600 on supporting platforms, and 0 on other 3258# platforms. 0 disables this feature. (since 2.5) 3259# 3260# @encrypt: Image decryption options. Mandatory for 3261# encrypted images, except when doing a metadata-only 3262# probe of the image. (since 2.10) 3263# 3264# @data-file: reference to or definition of the external data file. 3265# This may only be specified for images that require an 3266# external data file. If it is not specified for such 3267# an image, the data file name is loaded from the image 3268# file. (since 4.0) 3269# 3270# Since: 2.9 3271## 3272{ 'struct': 'BlockdevOptionsQcow2', 3273 'base': 'BlockdevOptionsGenericCOWFormat', 3274 'data': { '*lazy-refcounts': 'bool', 3275 '*pass-discard-request': 'bool', 3276 '*pass-discard-snapshot': 'bool', 3277 '*pass-discard-other': 'bool', 3278 '*overlap-check': 'Qcow2OverlapChecks', 3279 '*cache-size': 'int', 3280 '*l2-cache-size': 'int', 3281 '*l2-cache-entry-size': 'int', 3282 '*refcount-cache-size': 'int', 3283 '*cache-clean-interval': 'int', 3284 '*encrypt': 'BlockdevQcow2Encryption', 3285 '*data-file': 'BlockdevRef' } } 3286 3287## 3288# @SshHostKeyCheckMode: 3289# 3290# @none: Don't check the host key at all 3291# @hash: Compare the host key with a given hash 3292# @known_hosts: Check the host key against the known_hosts file 3293# 3294# Since: 2.12 3295## 3296{ 'enum': 'SshHostKeyCheckMode', 3297 'data': [ 'none', 'hash', 'known_hosts' ] } 3298 3299## 3300# @SshHostKeyCheckHashType: 3301# 3302# @md5: The given hash is an md5 hash 3303# @sha1: The given hash is an sha1 hash 3304# @sha256: The given hash is an sha256 hash 3305# 3306# Since: 2.12 3307## 3308{ 'enum': 'SshHostKeyCheckHashType', 3309 'data': [ 'md5', 'sha1', 'sha256' ] } 3310 3311## 3312# @SshHostKeyHash: 3313# 3314# @type: The hash algorithm used for the hash 3315# @hash: The expected hash value 3316# 3317# Since: 2.12 3318## 3319{ 'struct': 'SshHostKeyHash', 3320 'data': { 'type': 'SshHostKeyCheckHashType', 3321 'hash': 'str' }} 3322 3323## 3324# @SshHostKeyCheck: 3325# 3326# Since: 2.12 3327## 3328{ 'union': 'SshHostKeyCheck', 3329 'base': { 'mode': 'SshHostKeyCheckMode' }, 3330 'discriminator': 'mode', 3331 'data': { 'hash': 'SshHostKeyHash' } } 3332 3333## 3334# @BlockdevOptionsSsh: 3335# 3336# @server: host address 3337# 3338# @path: path to the image on the host 3339# 3340# @user: user as which to connect, defaults to current 3341# local user name 3342# 3343# @host-key-check: Defines how and what to check the host key against 3344# (default: known_hosts) 3345# 3346# Since: 2.9 3347## 3348{ 'struct': 'BlockdevOptionsSsh', 3349 'data': { 'server': 'InetSocketAddress', 3350 'path': 'str', 3351 '*user': 'str', 3352 '*host-key-check': 'SshHostKeyCheck' } } 3353 3354## 3355# @BlkdebugEvent: 3356# 3357# Trigger events supported by blkdebug. 3358# 3359# @l1_shrink_write_table: write zeros to the l1 table to shrink image. 3360# (since 2.11) 3361# 3362# @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11) 3363# 3364# @cor_write: a write due to copy-on-read (since 2.11) 3365# 3366# @cluster_alloc_space: an allocation of file space for a cluster (since 4.1) 3367# 3368# @none: triggers once at creation of the blkdebug node (since 4.1) 3369# 3370# Since: 2.9 3371## 3372{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG', 3373 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table', 3374 'l1_grow_activate_table', 'l2_load', 'l2_update', 3375 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write', 3376 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio', 3377 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read', 3378 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update', 3379 'refblock_load', 'refblock_update', 'refblock_update_part', 3380 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write', 3381 'refblock_alloc_write_blocks', 'refblock_alloc_write_table', 3382 'refblock_alloc_switch_table', 'cluster_alloc', 3383 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os', 3384 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head', 3385 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev', 3386 'pwritev_zero', 'pwritev_done', 'empty_image_prepare', 3387 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters', 3388 'cor_write', 'cluster_alloc_space', 'none'] } 3389 3390## 3391# @BlkdebugIOType: 3392# 3393# Kinds of I/O that blkdebug can inject errors in. 3394# 3395# @read: .bdrv_co_preadv() 3396# 3397# @write: .bdrv_co_pwritev() 3398# 3399# @write-zeroes: .bdrv_co_pwrite_zeroes() 3400# 3401# @discard: .bdrv_co_pdiscard() 3402# 3403# @flush: .bdrv_co_flush_to_disk() 3404# 3405# @block-status: .bdrv_co_block_status() 3406# 3407# Since: 4.1 3408## 3409{ 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE', 3410 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush', 3411 'block-status' ] } 3412 3413## 3414# @BlkdebugInjectErrorOptions: 3415# 3416# Describes a single error injection for blkdebug. 3417# 3418# @event: trigger event 3419# 3420# @state: the state identifier blkdebug needs to be in to 3421# actually trigger the event; defaults to "any" 3422# 3423# @iotype: the type of I/O operations on which this error should 3424# be injected; defaults to "all read, write, 3425# write-zeroes, discard, and flush operations" 3426# (since: 4.1) 3427# 3428# @errno: error identifier (errno) to be returned; defaults to 3429# EIO 3430# 3431# @sector: specifies the sector index which has to be affected 3432# in order to actually trigger the event; defaults to "any 3433# sector" 3434# 3435# @once: disables further events after this one has been 3436# triggered; defaults to false 3437# 3438# @immediately: fail immediately; defaults to false 3439# 3440# Since: 2.9 3441## 3442{ 'struct': 'BlkdebugInjectErrorOptions', 3443 'data': { 'event': 'BlkdebugEvent', 3444 '*state': 'int', 3445 '*iotype': 'BlkdebugIOType', 3446 '*errno': 'int', 3447 '*sector': 'int', 3448 '*once': 'bool', 3449 '*immediately': 'bool' } } 3450 3451## 3452# @BlkdebugSetStateOptions: 3453# 3454# Describes a single state-change event for blkdebug. 3455# 3456# @event: trigger event 3457# 3458# @state: the current state identifier blkdebug needs to be in; 3459# defaults to "any" 3460# 3461# @new_state: the state identifier blkdebug is supposed to assume if 3462# this event is triggered 3463# 3464# Since: 2.9 3465## 3466{ 'struct': 'BlkdebugSetStateOptions', 3467 'data': { 'event': 'BlkdebugEvent', 3468 '*state': 'int', 3469 'new_state': 'int' } } 3470 3471## 3472# @BlockdevOptionsBlkdebug: 3473# 3474# Driver specific block device options for blkdebug. 3475# 3476# @image: underlying raw block device (or image file) 3477# 3478# @config: filename of the configuration file 3479# 3480# @align: required alignment for requests in bytes, must be 3481# positive power of 2, or 0 for default 3482# 3483# @max-transfer: maximum size for I/O transfers in bytes, must be 3484# positive multiple of @align and of the underlying 3485# file's request alignment (but need not be a power of 3486# 2), or 0 for default (since 2.10) 3487# 3488# @opt-write-zero: preferred alignment for write zero requests in bytes, 3489# must be positive multiple of @align and of the 3490# underlying file's request alignment (but need not be a 3491# power of 2), or 0 for default (since 2.10) 3492# 3493# @max-write-zero: maximum size for write zero requests in bytes, must be 3494# positive multiple of @align, of @opt-write-zero, and of 3495# the underlying file's request alignment (but need not 3496# be a power of 2), or 0 for default (since 2.10) 3497# 3498# @opt-discard: preferred alignment for discard requests in bytes, must 3499# be positive multiple of @align and of the underlying 3500# file's request alignment (but need not be a power of 3501# 2), or 0 for default (since 2.10) 3502# 3503# @max-discard: maximum size for discard requests in bytes, must be 3504# positive multiple of @align, of @opt-discard, and of 3505# the underlying file's request alignment (but need not 3506# be a power of 2), or 0 for default (since 2.10) 3507# 3508# @inject-error: array of error injection descriptions 3509# 3510# @set-state: array of state-change descriptions 3511# 3512# @take-child-perms: Permissions to take on @image in addition to what 3513# is necessary anyway (which depends on how the 3514# blkdebug node is used). Defaults to none. 3515# (since 5.0) 3516# 3517# @unshare-child-perms: Permissions not to share on @image in addition 3518# to what cannot be shared anyway (which depends 3519# on how the blkdebug node is used). Defaults 3520# to none. (since 5.0) 3521# 3522# Since: 2.9 3523## 3524{ 'struct': 'BlockdevOptionsBlkdebug', 3525 'data': { 'image': 'BlockdevRef', 3526 '*config': 'str', 3527 '*align': 'int', '*max-transfer': 'int32', 3528 '*opt-write-zero': 'int32', '*max-write-zero': 'int32', 3529 '*opt-discard': 'int32', '*max-discard': 'int32', 3530 '*inject-error': ['BlkdebugInjectErrorOptions'], 3531 '*set-state': ['BlkdebugSetStateOptions'], 3532 '*take-child-perms': ['BlockPermission'], 3533 '*unshare-child-perms': ['BlockPermission'] } } 3534 3535## 3536# @BlockdevOptionsBlklogwrites: 3537# 3538# Driver specific block device options for blklogwrites. 3539# 3540# @file: block device 3541# 3542# @log: block device used to log writes to @file 3543# 3544# @log-sector-size: sector size used in logging writes to @file, determines 3545# granularity of offsets and sizes of writes (default: 512) 3546# 3547# @log-append: append to an existing log (default: false) 3548# 3549# @log-super-update-interval: interval of write requests after which the log 3550# super block is updated to disk (default: 4096) 3551# 3552# Since: 3.0 3553## 3554{ 'struct': 'BlockdevOptionsBlklogwrites', 3555 'data': { 'file': 'BlockdevRef', 3556 'log': 'BlockdevRef', 3557 '*log-sector-size': 'uint32', 3558 '*log-append': 'bool', 3559 '*log-super-update-interval': 'uint64' } } 3560 3561## 3562# @BlockdevOptionsBlkverify: 3563# 3564# Driver specific block device options for blkverify. 3565# 3566# @test: block device to be tested 3567# 3568# @raw: raw image used for verification 3569# 3570# Since: 2.9 3571## 3572{ 'struct': 'BlockdevOptionsBlkverify', 3573 'data': { 'test': 'BlockdevRef', 3574 'raw': 'BlockdevRef' } } 3575 3576## 3577# @BlockdevOptionsBlkreplay: 3578# 3579# Driver specific block device options for blkreplay. 3580# 3581# @image: disk image which should be controlled with blkreplay 3582# 3583# Since: 4.2 3584## 3585{ 'struct': 'BlockdevOptionsBlkreplay', 3586 'data': { 'image': 'BlockdevRef' } } 3587 3588## 3589# @QuorumReadPattern: 3590# 3591# An enumeration of quorum read patterns. 3592# 3593# @quorum: read all the children and do a quorum vote on reads 3594# 3595# @fifo: read only from the first child that has not failed 3596# 3597# Since: 2.9 3598## 3599{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] } 3600 3601## 3602# @BlockdevOptionsQuorum: 3603# 3604# Driver specific block device options for Quorum 3605# 3606# @blkverify: true if the driver must print content mismatch 3607# set to false by default 3608# 3609# @children: the children block devices to use 3610# 3611# @vote-threshold: the vote limit under which a read will fail 3612# 3613# @rewrite-corrupted: rewrite corrupted data when quorum is reached 3614# (Since 2.1) 3615# 3616# @read-pattern: choose read pattern and set to quorum by default 3617# (Since 2.2) 3618# 3619# Since: 2.9 3620## 3621{ 'struct': 'BlockdevOptionsQuorum', 3622 'data': { '*blkverify': 'bool', 3623 'children': [ 'BlockdevRef' ], 3624 'vote-threshold': 'int', 3625 '*rewrite-corrupted': 'bool', 3626 '*read-pattern': 'QuorumReadPattern' } } 3627 3628## 3629# @BlockdevOptionsGluster: 3630# 3631# Driver specific block device options for Gluster 3632# 3633# @volume: name of gluster volume where VM image resides 3634# 3635# @path: absolute path to image file in gluster volume 3636# 3637# @server: gluster servers description 3638# 3639# @debug: libgfapi log level (default '4' which is Error) 3640# (Since 2.8) 3641# 3642# @logfile: libgfapi log file (default /dev/stderr) (Since 2.8) 3643# 3644# Since: 2.9 3645## 3646{ 'struct': 'BlockdevOptionsGluster', 3647 'data': { 'volume': 'str', 3648 'path': 'str', 3649 'server': ['SocketAddress'], 3650 '*debug': 'int', 3651 '*logfile': 'str' } } 3652 3653## 3654# @IscsiTransport: 3655# 3656# An enumeration of libiscsi transport types 3657# 3658# Since: 2.9 3659## 3660{ 'enum': 'IscsiTransport', 3661 'data': [ 'tcp', 'iser' ] } 3662 3663## 3664# @IscsiHeaderDigest: 3665# 3666# An enumeration of header digests supported by libiscsi 3667# 3668# Since: 2.9 3669## 3670{ 'enum': 'IscsiHeaderDigest', 3671 'prefix': 'QAPI_ISCSI_HEADER_DIGEST', 3672 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] } 3673 3674## 3675# @BlockdevOptionsIscsi: 3676# 3677# @transport: The iscsi transport type 3678# 3679# @portal: The address of the iscsi portal 3680# 3681# @target: The target iqn name 3682# 3683# @lun: LUN to connect to. Defaults to 0. 3684# 3685# @user: User name to log in with. If omitted, no CHAP 3686# authentication is performed. 3687# 3688# @password-secret: The ID of a QCryptoSecret object providing 3689# the password for the login. This option is required if 3690# @user is specified. 3691# 3692# @initiator-name: The iqn name we want to identify to the target 3693# as. If this option is not specified, an initiator name is 3694# generated automatically. 3695# 3696# @header-digest: The desired header digest. Defaults to 3697# none-crc32c. 3698# 3699# @timeout: Timeout in seconds after which a request will 3700# timeout. 0 means no timeout and is the default. 3701# 3702# Driver specific block device options for iscsi 3703# 3704# Since: 2.9 3705## 3706{ 'struct': 'BlockdevOptionsIscsi', 3707 'data': { 'transport': 'IscsiTransport', 3708 'portal': 'str', 3709 'target': 'str', 3710 '*lun': 'int', 3711 '*user': 'str', 3712 '*password-secret': 'str', 3713 '*initiator-name': 'str', 3714 '*header-digest': 'IscsiHeaderDigest', 3715 '*timeout': 'int' } } 3716 3717## 3718# @RbdAuthMode: 3719# 3720# Since: 3.0 3721## 3722{ 'enum': 'RbdAuthMode', 3723 'data': [ 'cephx', 'none' ] } 3724 3725## 3726# @RbdImageEncryptionFormat: 3727# 3728# Since: 6.1 3729## 3730{ 'enum': 'RbdImageEncryptionFormat', 3731 'data': [ 'luks', 'luks2' ] } 3732 3733## 3734# @RbdEncryptionOptionsLUKSBase: 3735# 3736# @key-secret: ID of a QCryptoSecret object providing a passphrase 3737# for unlocking the encryption 3738# 3739# Since: 6.1 3740## 3741{ 'struct': 'RbdEncryptionOptionsLUKSBase', 3742 'data': { 'key-secret': 'str' } } 3743 3744## 3745# @RbdEncryptionCreateOptionsLUKSBase: 3746# 3747# @cipher-alg: The encryption algorithm 3748# 3749# Since: 6.1 3750## 3751{ 'struct': 'RbdEncryptionCreateOptionsLUKSBase', 3752 'base': 'RbdEncryptionOptionsLUKSBase', 3753 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } } 3754 3755## 3756# @RbdEncryptionOptionsLUKS: 3757# 3758# Since: 6.1 3759## 3760{ 'struct': 'RbdEncryptionOptionsLUKS', 3761 'base': 'RbdEncryptionOptionsLUKSBase', 3762 'data': { } } 3763 3764## 3765# @RbdEncryptionOptionsLUKS2: 3766# 3767# Since: 6.1 3768## 3769{ 'struct': 'RbdEncryptionOptionsLUKS2', 3770 'base': 'RbdEncryptionOptionsLUKSBase', 3771 'data': { } } 3772 3773## 3774# @RbdEncryptionCreateOptionsLUKS: 3775# 3776# Since: 6.1 3777## 3778{ 'struct': 'RbdEncryptionCreateOptionsLUKS', 3779 'base': 'RbdEncryptionCreateOptionsLUKSBase', 3780 'data': { } } 3781 3782## 3783# @RbdEncryptionCreateOptionsLUKS2: 3784# 3785# Since: 6.1 3786## 3787{ 'struct': 'RbdEncryptionCreateOptionsLUKS2', 3788 'base': 'RbdEncryptionCreateOptionsLUKSBase', 3789 'data': { } } 3790 3791## 3792# @RbdEncryptionOptions: 3793# 3794# Since: 6.1 3795## 3796{ 'union': 'RbdEncryptionOptions', 3797 'base': { 'format': 'RbdImageEncryptionFormat' }, 3798 'discriminator': 'format', 3799 'data': { 'luks': 'RbdEncryptionOptionsLUKS', 3800 'luks2': 'RbdEncryptionOptionsLUKS2' } } 3801 3802## 3803# @RbdEncryptionCreateOptions: 3804# 3805# Since: 6.1 3806## 3807{ 'union': 'RbdEncryptionCreateOptions', 3808 'base': { 'format': 'RbdImageEncryptionFormat' }, 3809 'discriminator': 'format', 3810 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS', 3811 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } } 3812 3813## 3814# @BlockdevOptionsRbd: 3815# 3816# @pool: Ceph pool name. 3817# 3818# @namespace: Rados namespace name in the Ceph pool. (Since 5.0) 3819# 3820# @image: Image name in the Ceph pool. 3821# 3822# @conf: path to Ceph configuration file. Values 3823# in the configuration file will be overridden by 3824# options specified via QAPI. 3825# 3826# @snapshot: Ceph snapshot name. 3827# 3828# @encrypt: Image encryption options. (Since 6.1) 3829# 3830# @user: Ceph id name. 3831# 3832# @auth-client-required: Acceptable authentication modes. 3833# This maps to Ceph configuration option 3834# "auth_client_required". (Since 3.0) 3835# 3836# @key-secret: ID of a QCryptoSecret object providing a key 3837# for cephx authentication. 3838# This maps to Ceph configuration option 3839# "key". (Since 3.0) 3840# 3841# @server: Monitor host address and port. This maps 3842# to the "mon_host" Ceph option. 3843# 3844# Since: 2.9 3845## 3846{ 'struct': 'BlockdevOptionsRbd', 3847 'data': { 'pool': 'str', 3848 '*namespace': 'str', 3849 'image': 'str', 3850 '*conf': 'str', 3851 '*snapshot': 'str', 3852 '*encrypt': 'RbdEncryptionOptions', 3853 '*user': 'str', 3854 '*auth-client-required': ['RbdAuthMode'], 3855 '*key-secret': 'str', 3856 '*server': ['InetSocketAddressBase'] } } 3857 3858## 3859# @ReplicationMode: 3860# 3861# An enumeration of replication modes. 3862# 3863# @primary: Primary mode, the vm's state will be sent to secondary QEMU. 3864# 3865# @secondary: Secondary mode, receive the vm's state from primary QEMU. 3866# 3867# Since: 2.9 3868## 3869{ 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ], 3870 'if': 'CONFIG_REPLICATION' } 3871 3872## 3873# @BlockdevOptionsReplication: 3874# 3875# Driver specific block device options for replication 3876# 3877# @mode: the replication mode 3878# 3879# @top-id: In secondary mode, node name or device ID of the root 3880# node who owns the replication node chain. Must not be given in 3881# primary mode. 3882# 3883# Since: 2.9 3884## 3885{ 'struct': 'BlockdevOptionsReplication', 3886 'base': 'BlockdevOptionsGenericFormat', 3887 'data': { 'mode': 'ReplicationMode', 3888 '*top-id': 'str' }, 3889 'if': 'CONFIG_REPLICATION' } 3890 3891## 3892# @NFSTransport: 3893# 3894# An enumeration of NFS transport types 3895# 3896# @inet: TCP transport 3897# 3898# Since: 2.9 3899## 3900{ 'enum': 'NFSTransport', 3901 'data': [ 'inet' ] } 3902 3903## 3904# @NFSServer: 3905# 3906# Captures the address of the socket 3907# 3908# @type: transport type used for NFS (only TCP supported) 3909# 3910# @host: host address for NFS server 3911# 3912# Since: 2.9 3913## 3914{ 'struct': 'NFSServer', 3915 'data': { 'type': 'NFSTransport', 3916 'host': 'str' } } 3917 3918## 3919# @BlockdevOptionsNfs: 3920# 3921# Driver specific block device option for NFS 3922# 3923# @server: host address 3924# 3925# @path: path of the image on the host 3926# 3927# @user: UID value to use when talking to the 3928# server (defaults to 65534 on Windows and getuid() 3929# on unix) 3930# 3931# @group: GID value to use when talking to the 3932# server (defaults to 65534 on Windows and getgid() 3933# in unix) 3934# 3935# @tcp-syn-count: number of SYNs during the session 3936# establishment (defaults to libnfs default) 3937# 3938# @readahead-size: set the readahead size in bytes (defaults 3939# to libnfs default) 3940# 3941# @page-cache-size: set the pagecache size in bytes (defaults 3942# to libnfs default) 3943# 3944# @debug: set the NFS debug level (max 2) (defaults 3945# to libnfs default) 3946# 3947# Since: 2.9 3948## 3949{ 'struct': 'BlockdevOptionsNfs', 3950 'data': { 'server': 'NFSServer', 3951 'path': 'str', 3952 '*user': 'int', 3953 '*group': 'int', 3954 '*tcp-syn-count': 'int', 3955 '*readahead-size': 'int', 3956 '*page-cache-size': 'int', 3957 '*debug': 'int' } } 3958 3959## 3960# @BlockdevOptionsCurlBase: 3961# 3962# Driver specific block device options shared by all protocols supported by the 3963# curl backend. 3964# 3965# @url: URL of the image file 3966# 3967# @readahead: Size of the read-ahead cache; must be a multiple of 3968# 512 (defaults to 256 kB) 3969# 3970# @timeout: Timeout for connections, in seconds (defaults to 5) 3971# 3972# @username: Username for authentication (defaults to none) 3973# 3974# @password-secret: ID of a QCryptoSecret object providing a password 3975# for authentication (defaults to no password) 3976# 3977# @proxy-username: Username for proxy authentication (defaults to none) 3978# 3979# @proxy-password-secret: ID of a QCryptoSecret object providing a password 3980# for proxy authentication (defaults to no password) 3981# 3982# Since: 2.9 3983## 3984{ 'struct': 'BlockdevOptionsCurlBase', 3985 'data': { 'url': 'str', 3986 '*readahead': 'int', 3987 '*timeout': 'int', 3988 '*username': 'str', 3989 '*password-secret': 'str', 3990 '*proxy-username': 'str', 3991 '*proxy-password-secret': 'str' } } 3992 3993## 3994# @BlockdevOptionsCurlHttp: 3995# 3996# Driver specific block device options for HTTP connections over the curl 3997# backend. URLs must start with "http://". 3998# 3999# @cookie: List of cookies to set; format is 4000# "name1=content1; name2=content2;" as explained by 4001# CURLOPT_COOKIE(3). Defaults to no cookies. 4002# 4003# @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a 4004# secure way. See @cookie for the format. (since 2.10) 4005# 4006# Since: 2.9 4007## 4008{ 'struct': 'BlockdevOptionsCurlHttp', 4009 'base': 'BlockdevOptionsCurlBase', 4010 'data': { '*cookie': 'str', 4011 '*cookie-secret': 'str'} } 4012 4013## 4014# @BlockdevOptionsCurlHttps: 4015# 4016# Driver specific block device options for HTTPS connections over the curl 4017# backend. URLs must start with "https://". 4018# 4019# @cookie: List of cookies to set; format is 4020# "name1=content1; name2=content2;" as explained by 4021# CURLOPT_COOKIE(3). Defaults to no cookies. 4022# 4023# @sslverify: Whether to verify the SSL certificate's validity (defaults to 4024# true) 4025# 4026# @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a 4027# secure way. See @cookie for the format. (since 2.10) 4028# 4029# Since: 2.9 4030## 4031{ 'struct': 'BlockdevOptionsCurlHttps', 4032 'base': 'BlockdevOptionsCurlBase', 4033 'data': { '*cookie': 'str', 4034 '*sslverify': 'bool', 4035 '*cookie-secret': 'str'} } 4036 4037## 4038# @BlockdevOptionsCurlFtp: 4039# 4040# Driver specific block device options for FTP connections over the curl 4041# backend. URLs must start with "ftp://". 4042# 4043# Since: 2.9 4044## 4045{ 'struct': 'BlockdevOptionsCurlFtp', 4046 'base': 'BlockdevOptionsCurlBase', 4047 'data': { } } 4048 4049## 4050# @BlockdevOptionsCurlFtps: 4051# 4052# Driver specific block device options for FTPS connections over the curl 4053# backend. URLs must start with "ftps://". 4054# 4055# @sslverify: Whether to verify the SSL certificate's validity (defaults to 4056# true) 4057# 4058# Since: 2.9 4059## 4060{ 'struct': 'BlockdevOptionsCurlFtps', 4061 'base': 'BlockdevOptionsCurlBase', 4062 'data': { '*sslverify': 'bool' } } 4063 4064## 4065# @BlockdevOptionsNbd: 4066# 4067# Driver specific block device options for NBD. 4068# 4069# @server: NBD server address 4070# 4071# @export: export name 4072# 4073# @tls-creds: TLS credentials ID 4074# 4075# @tls-hostname: TLS hostname override for certificate validation (Since 7.0) 4076# 4077# @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME" 4078# or "qemu:allocation-depth" to query in place of the 4079# traditional "base:allocation" block status (see 4080# NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and 4081# yes, naming this option x-context would have made 4082# more sense) (since 3.0) 4083# 4084# @reconnect-delay: On an unexpected disconnect, the nbd client tries to 4085# connect again until succeeding or encountering a serious 4086# error. During the first @reconnect-delay seconds, all 4087# requests are paused and will be rerun on a successful 4088# reconnect. After that time, any delayed requests and all 4089# future requests before a successful reconnect will 4090# immediately fail. Default 0 (Since 4.2) 4091# 4092# @open-timeout: In seconds. If zero, the nbd driver tries the connection 4093# only once, and fails to open if the connection fails. 4094# If non-zero, the nbd driver will repeat connection attempts 4095# until successful or until @open-timeout seconds have elapsed. 4096# Default 0 (Since 7.0) 4097# 4098# Features: 4099# @unstable: Member @x-dirty-bitmap is experimental. 4100# 4101# Since: 2.9 4102## 4103{ 'struct': 'BlockdevOptionsNbd', 4104 'data': { 'server': 'SocketAddress', 4105 '*export': 'str', 4106 '*tls-creds': 'str', 4107 '*tls-hostname': 'str', 4108 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] }, 4109 '*reconnect-delay': 'uint32', 4110 '*open-timeout': 'uint32' } } 4111 4112## 4113# @BlockdevOptionsRaw: 4114# 4115# Driver specific block device options for the raw driver. 4116# 4117# @offset: position where the block device starts 4118# @size: the assumed size of the device 4119# 4120# Since: 2.9 4121## 4122{ 'struct': 'BlockdevOptionsRaw', 4123 'base': 'BlockdevOptionsGenericFormat', 4124 'data': { '*offset': 'int', '*size': 'int' } } 4125 4126## 4127# @BlockdevOptionsThrottle: 4128# 4129# Driver specific block device options for the throttle driver 4130# 4131# @throttle-group: the name of the throttle-group object to use. It 4132# must already exist. 4133# @file: reference to or definition of the data source block device 4134# 4135# Since: 2.11 4136## 4137{ 'struct': 'BlockdevOptionsThrottle', 4138 'data': { 'throttle-group': 'str', 4139 'file' : 'BlockdevRef' 4140 } } 4141 4142## 4143# @BlockdevOptionsCor: 4144# 4145# Driver specific block device options for the copy-on-read driver. 4146# 4147# @bottom: The name of a non-filter node (allocation-bearing layer) that 4148# limits the COR operations in the backing chain (inclusive), so 4149# that no data below this node will be copied by this filter. 4150# If option is absent, the limit is not applied, so that data 4151# from all backing layers may be copied. 4152# 4153# Since: 6.0 4154## 4155{ 'struct': 'BlockdevOptionsCor', 4156 'base': 'BlockdevOptionsGenericFormat', 4157 'data': { '*bottom': 'str' } } 4158 4159## 4160# @BlockdevOptionsCbw: 4161# 4162# Driver specific block device options for the copy-before-write driver, 4163# which does so called copy-before-write operations: when data is 4164# written to the filter, the filter first reads corresponding blocks 4165# from its file child and copies them to @target child. After successfully 4166# copying, the write request is propagated to file child. If copying 4167# fails, the original write request is failed too and no data is written 4168# to file child. 4169# 4170# @target: The target for copy-before-write operations. 4171# 4172# @bitmap: If specified, copy-before-write filter will do 4173# copy-before-write operations only for dirty regions of the 4174# bitmap. Bitmap size must be equal to length of file and 4175# target child of the filter. Note also, that bitmap is used 4176# only to initialize internal bitmap of the process, so further 4177# modifications (or removing) of specified bitmap doesn't 4178# influence the filter. (Since 7.0) 4179# 4180# Since: 6.2 4181## 4182{ 'struct': 'BlockdevOptionsCbw', 4183 'base': 'BlockdevOptionsGenericFormat', 4184 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap' } } 4185 4186## 4187# @BlockdevOptions: 4188# 4189# Options for creating a block device. Many options are available for all 4190# block devices, independent of the block driver: 4191# 4192# @driver: block driver name 4193# @node-name: the node name of the new node (Since 2.0). 4194# This option is required on the top level of blockdev-add. 4195# Valid node names start with an alphabetic character and may 4196# contain only alphanumeric characters, '-', '.' and '_'. Their 4197# maximum length is 31 characters. 4198# @discard: discard-related options (default: ignore) 4199# @cache: cache-related options 4200# @read-only: whether the block device should be read-only (default: false). 4201# Note that some block drivers support only read-only access, 4202# either generally or in certain configurations. In this case, 4203# the default value does not work and the option must be 4204# specified explicitly. 4205# @auto-read-only: if true and @read-only is false, QEMU may automatically 4206# decide not to open the image read-write as requested, but 4207# fall back to read-only instead (and switch between the modes 4208# later), e.g. depending on whether the image file is writable 4209# or whether a writing user is attached to the node 4210# (default: false, since 3.1) 4211# @detect-zeroes: detect and optimize zero writes (Since 2.1) 4212# (default: off) 4213# @force-share: force share all permission on added nodes. 4214# Requires read-only=true. (Since 2.10) 4215# 4216# Remaining options are determined by the block driver. 4217# 4218# Since: 2.9 4219## 4220{ 'union': 'BlockdevOptions', 4221 'base': { 'driver': 'BlockdevDriver', 4222 '*node-name': 'str', 4223 '*discard': 'BlockdevDiscardOptions', 4224 '*cache': 'BlockdevCacheOptions', 4225 '*read-only': 'bool', 4226 '*auto-read-only': 'bool', 4227 '*force-share': 'bool', 4228 '*detect-zeroes': 'BlockdevDetectZeroesOptions' }, 4229 'discriminator': 'driver', 4230 'data': { 4231 'blkdebug': 'BlockdevOptionsBlkdebug', 4232 'blklogwrites':'BlockdevOptionsBlklogwrites', 4233 'blkverify': 'BlockdevOptionsBlkverify', 4234 'blkreplay': 'BlockdevOptionsBlkreplay', 4235 'bochs': 'BlockdevOptionsGenericFormat', 4236 'cloop': 'BlockdevOptionsGenericFormat', 4237 'compress': 'BlockdevOptionsGenericFormat', 4238 'copy-before-write':'BlockdevOptionsCbw', 4239 'copy-on-read':'BlockdevOptionsCor', 4240 'dmg': 'BlockdevOptionsGenericFormat', 4241 'file': 'BlockdevOptionsFile', 4242 'ftp': 'BlockdevOptionsCurlFtp', 4243 'ftps': 'BlockdevOptionsCurlFtps', 4244 'gluster': 'BlockdevOptionsGluster', 4245 'host_cdrom': { 'type': 'BlockdevOptionsFile', 4246 'if': 'HAVE_HOST_BLOCK_DEVICE' }, 4247 'host_device': { 'type': 'BlockdevOptionsFile', 4248 'if': 'HAVE_HOST_BLOCK_DEVICE' }, 4249 'http': 'BlockdevOptionsCurlHttp', 4250 'https': 'BlockdevOptionsCurlHttps', 4251 'iscsi': 'BlockdevOptionsIscsi', 4252 'luks': 'BlockdevOptionsLUKS', 4253 'nbd': 'BlockdevOptionsNbd', 4254 'nfs': 'BlockdevOptionsNfs', 4255 'null-aio': 'BlockdevOptionsNull', 4256 'null-co': 'BlockdevOptionsNull', 4257 'nvme': 'BlockdevOptionsNVMe', 4258 'parallels': 'BlockdevOptionsGenericFormat', 4259 'preallocate':'BlockdevOptionsPreallocate', 4260 'qcow2': 'BlockdevOptionsQcow2', 4261 'qcow': 'BlockdevOptionsQcow', 4262 'qed': 'BlockdevOptionsGenericCOWFormat', 4263 'quorum': 'BlockdevOptionsQuorum', 4264 'raw': 'BlockdevOptionsRaw', 4265 'rbd': 'BlockdevOptionsRbd', 4266 'replication': { 'type': 'BlockdevOptionsReplication', 4267 'if': 'CONFIG_REPLICATION' }, 4268 'snapshot-access': 'BlockdevOptionsGenericFormat', 4269 'ssh': 'BlockdevOptionsSsh', 4270 'throttle': 'BlockdevOptionsThrottle', 4271 'vdi': 'BlockdevOptionsGenericFormat', 4272 'vhdx': 'BlockdevOptionsGenericFormat', 4273 'vmdk': 'BlockdevOptionsGenericCOWFormat', 4274 'vpc': 'BlockdevOptionsGenericFormat', 4275 'vvfat': 'BlockdevOptionsVVFAT' 4276 } } 4277 4278## 4279# @BlockdevRef: 4280# 4281# Reference to a block device. 4282# 4283# @definition: defines a new block device inline 4284# @reference: references the ID of an existing block device 4285# 4286# Since: 2.9 4287## 4288{ 'alternate': 'BlockdevRef', 4289 'data': { 'definition': 'BlockdevOptions', 4290 'reference': 'str' } } 4291 4292## 4293# @BlockdevRefOrNull: 4294# 4295# Reference to a block device. 4296# 4297# @definition: defines a new block device inline 4298# @reference: references the ID of an existing block device. 4299# An empty string means that no block device should 4300# be referenced. Deprecated; use null instead. 4301# @null: No block device should be referenced (since 2.10) 4302# 4303# Since: 2.9 4304## 4305{ 'alternate': 'BlockdevRefOrNull', 4306 'data': { 'definition': 'BlockdevOptions', 4307 'reference': 'str', 4308 'null': 'null' } } 4309 4310## 4311# @blockdev-add: 4312# 4313# Creates a new block device. 4314# 4315# Since: 2.9 4316# 4317# Example: 4318# 4319# 1. 4320# -> { "execute": "blockdev-add", 4321# "arguments": { 4322# "driver": "qcow2", 4323# "node-name": "test1", 4324# "file": { 4325# "driver": "file", 4326# "filename": "test.qcow2" 4327# } 4328# } 4329# } 4330# <- { "return": {} } 4331# 4332# 2. 4333# -> { "execute": "blockdev-add", 4334# "arguments": { 4335# "driver": "qcow2", 4336# "node-name": "node0", 4337# "discard": "unmap", 4338# "cache": { 4339# "direct": true 4340# }, 4341# "file": { 4342# "driver": "file", 4343# "filename": "/tmp/test.qcow2" 4344# }, 4345# "backing": { 4346# "driver": "raw", 4347# "file": { 4348# "driver": "file", 4349# "filename": "/dev/fdset/4" 4350# } 4351# } 4352# } 4353# } 4354# 4355# <- { "return": {} } 4356# 4357## 4358{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true } 4359 4360## 4361# @blockdev-reopen: 4362# 4363# Reopens one or more block devices using the given set of options. 4364# Any option not specified will be reset to its default value regardless 4365# of its previous status. If an option cannot be changed or a particular 4366# driver does not support reopening then the command will return an 4367# error. All devices in the list are reopened in one transaction, so 4368# if one of them fails then the whole transaction is cancelled. 4369# 4370# The command receives a list of block devices to reopen. For each one 4371# of them, the top-level @node-name option (from BlockdevOptions) must be 4372# specified and is used to select the block device to be reopened. 4373# Other @node-name options must be either omitted or set to the 4374# current name of the appropriate node. This command won't change any 4375# node name and any attempt to do it will result in an error. 4376# 4377# In the case of options that refer to child nodes, the behavior of 4378# this command depends on the value: 4379# 4380# 1) A set of options (BlockdevOptions): the child is reopened with 4381# the specified set of options. 4382# 4383# 2) A reference to the current child: the child is reopened using 4384# its existing set of options. 4385# 4386# 3) A reference to a different node: the current child is replaced 4387# with the specified one. 4388# 4389# 4) NULL: the current child (if any) is detached. 4390# 4391# Options (1) and (2) are supported in all cases. Option (3) is 4392# supported for @file and @backing, and option (4) for @backing only. 4393# 4394# Unlike with blockdev-add, the @backing option must always be present 4395# unless the node being reopened does not have a backing file and its 4396# image does not have a default backing file name as part of its 4397# metadata. 4398# 4399# Since: 6.1 4400## 4401{ 'command': 'blockdev-reopen', 4402 'data': { 'options': ['BlockdevOptions'] } } 4403 4404## 4405# @blockdev-del: 4406# 4407# Deletes a block device that has been added using blockdev-add. 4408# The command will fail if the node is attached to a device or is 4409# otherwise being used. 4410# 4411# @node-name: Name of the graph node to delete. 4412# 4413# Since: 2.9 4414# 4415# Example: 4416# 4417# -> { "execute": "blockdev-add", 4418# "arguments": { 4419# "driver": "qcow2", 4420# "node-name": "node0", 4421# "file": { 4422# "driver": "file", 4423# "filename": "test.qcow2" 4424# } 4425# } 4426# } 4427# <- { "return": {} } 4428# 4429# -> { "execute": "blockdev-del", 4430# "arguments": { "node-name": "node0" } 4431# } 4432# <- { "return": {} } 4433# 4434## 4435{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' } } 4436 4437## 4438# @BlockdevCreateOptionsFile: 4439# 4440# Driver specific image creation options for file. 4441# 4442# @filename: Filename for the new image file 4443# @size: Size of the virtual disk in bytes 4444# @preallocation: Preallocation mode for the new image (default: off; 4445# allowed values: off, 4446# falloc (if CONFIG_POSIX_FALLOCATE), 4447# full (if CONFIG_POSIX)) 4448# @nocow: Turn off copy-on-write (valid only on btrfs; default: off) 4449# @extent-size-hint: Extent size hint to add to the image file; 0 for not 4450# adding an extent size hint (default: 1 MB, since 5.1) 4451# 4452# Since: 2.12 4453## 4454{ 'struct': 'BlockdevCreateOptionsFile', 4455 'data': { 'filename': 'str', 4456 'size': 'size', 4457 '*preallocation': 'PreallocMode', 4458 '*nocow': 'bool', 4459 '*extent-size-hint': 'size'} } 4460 4461## 4462# @BlockdevCreateOptionsGluster: 4463# 4464# Driver specific image creation options for gluster. 4465# 4466# @location: Where to store the new image file 4467# @size: Size of the virtual disk in bytes 4468# @preallocation: Preallocation mode for the new image (default: off; 4469# allowed values: off, 4470# falloc (if CONFIG_GLUSTERFS_FALLOCATE), 4471# full (if CONFIG_GLUSTERFS_ZEROFILL)) 4472# 4473# Since: 2.12 4474## 4475{ 'struct': 'BlockdevCreateOptionsGluster', 4476 'data': { 'location': 'BlockdevOptionsGluster', 4477 'size': 'size', 4478 '*preallocation': 'PreallocMode' } } 4479 4480## 4481# @BlockdevCreateOptionsLUKS: 4482# 4483# Driver specific image creation options for LUKS. 4484# 4485# @file: Node to create the image format on 4486# @size: Size of the virtual disk in bytes 4487# @preallocation: Preallocation mode for the new image 4488# (since: 4.2) 4489# (default: off; allowed values: off, metadata, falloc, full) 4490# 4491# Since: 2.12 4492## 4493{ 'struct': 'BlockdevCreateOptionsLUKS', 4494 'base': 'QCryptoBlockCreateOptionsLUKS', 4495 'data': { 'file': 'BlockdevRef', 4496 'size': 'size', 4497 '*preallocation': 'PreallocMode' } } 4498 4499## 4500# @BlockdevCreateOptionsNfs: 4501# 4502# Driver specific image creation options for NFS. 4503# 4504# @location: Where to store the new image file 4505# @size: Size of the virtual disk in bytes 4506# 4507# Since: 2.12 4508## 4509{ 'struct': 'BlockdevCreateOptionsNfs', 4510 'data': { 'location': 'BlockdevOptionsNfs', 4511 'size': 'size' } } 4512 4513## 4514# @BlockdevCreateOptionsParallels: 4515# 4516# Driver specific image creation options for parallels. 4517# 4518# @file: Node to create the image format on 4519# @size: Size of the virtual disk in bytes 4520# @cluster-size: Cluster size in bytes (default: 1 MB) 4521# 4522# Since: 2.12 4523## 4524{ 'struct': 'BlockdevCreateOptionsParallels', 4525 'data': { 'file': 'BlockdevRef', 4526 'size': 'size', 4527 '*cluster-size': 'size' } } 4528 4529## 4530# @BlockdevCreateOptionsQcow: 4531# 4532# Driver specific image creation options for qcow. 4533# 4534# @file: Node to create the image format on 4535# @size: Size of the virtual disk in bytes 4536# @backing-file: File name of the backing file if a backing file 4537# should be used 4538# @encrypt: Encryption options if the image should be encrypted 4539# 4540# Since: 2.12 4541## 4542{ 'struct': 'BlockdevCreateOptionsQcow', 4543 'data': { 'file': 'BlockdevRef', 4544 'size': 'size', 4545 '*backing-file': 'str', 4546 '*encrypt': 'QCryptoBlockCreateOptions' } } 4547 4548## 4549# @BlockdevQcow2Version: 4550# 4551# @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2) 4552# @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3) 4553# 4554# Since: 2.12 4555## 4556{ 'enum': 'BlockdevQcow2Version', 4557 'data': [ 'v2', 'v3' ] } 4558 4559## 4560# @Qcow2CompressionType: 4561# 4562# Compression type used in qcow2 image file 4563# 4564# @zlib: zlib compression, see <http://zlib.net/> 4565# @zstd: zstd compression, see <http://github.com/facebook/zstd> 4566# 4567# Since: 5.1 4568## 4569{ 'enum': 'Qcow2CompressionType', 4570 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] } 4571 4572## 4573# @BlockdevCreateOptionsQcow2: 4574# 4575# Driver specific image creation options for qcow2. 4576# 4577# @file: Node to create the image format on 4578# @data-file: Node to use as an external data file in which all guest 4579# data is stored so that only metadata remains in the qcow2 4580# file (since: 4.0) 4581# @data-file-raw: True if the external data file must stay valid as a 4582# standalone (read-only) raw image without looking at qcow2 4583# metadata (default: false; since: 4.0) 4584# @extended-l2: True to make the image have extended L2 entries 4585# (default: false; since 5.2) 4586# @size: Size of the virtual disk in bytes 4587# @version: Compatibility level (default: v3) 4588# @backing-file: File name of the backing file if a backing file 4589# should be used 4590# @backing-fmt: Name of the block driver to use for the backing file 4591# @encrypt: Encryption options if the image should be encrypted 4592# @cluster-size: qcow2 cluster size in bytes (default: 65536) 4593# @preallocation: Preallocation mode for the new image (default: off; 4594# allowed values: off, falloc, full, metadata) 4595# @lazy-refcounts: True if refcounts may be updated lazily (default: off) 4596# @refcount-bits: Width of reference counts in bits (default: 16) 4597# @compression-type: The image cluster compression method 4598# (default: zlib, since 5.1) 4599# 4600# Since: 2.12 4601## 4602{ 'struct': 'BlockdevCreateOptionsQcow2', 4603 'data': { 'file': 'BlockdevRef', 4604 '*data-file': 'BlockdevRef', 4605 '*data-file-raw': 'bool', 4606 '*extended-l2': 'bool', 4607 'size': 'size', 4608 '*version': 'BlockdevQcow2Version', 4609 '*backing-file': 'str', 4610 '*backing-fmt': 'BlockdevDriver', 4611 '*encrypt': 'QCryptoBlockCreateOptions', 4612 '*cluster-size': 'size', 4613 '*preallocation': 'PreallocMode', 4614 '*lazy-refcounts': 'bool', 4615 '*refcount-bits': 'int', 4616 '*compression-type':'Qcow2CompressionType' } } 4617 4618## 4619# @BlockdevCreateOptionsQed: 4620# 4621# Driver specific image creation options for qed. 4622# 4623# @file: Node to create the image format on 4624# @size: Size of the virtual disk in bytes 4625# @backing-file: File name of the backing file if a backing file 4626# should be used 4627# @backing-fmt: Name of the block driver to use for the backing file 4628# @cluster-size: Cluster size in bytes (default: 65536) 4629# @table-size: L1/L2 table size (in clusters) 4630# 4631# Since: 2.12 4632## 4633{ 'struct': 'BlockdevCreateOptionsQed', 4634 'data': { 'file': 'BlockdevRef', 4635 'size': 'size', 4636 '*backing-file': 'str', 4637 '*backing-fmt': 'BlockdevDriver', 4638 '*cluster-size': 'size', 4639 '*table-size': 'int' } } 4640 4641## 4642# @BlockdevCreateOptionsRbd: 4643# 4644# Driver specific image creation options for rbd/Ceph. 4645# 4646# @location: Where to store the new image file. This location cannot 4647# point to a snapshot. 4648# @size: Size of the virtual disk in bytes 4649# @cluster-size: RBD object size 4650# @encrypt: Image encryption options. (Since 6.1) 4651# 4652# Since: 2.12 4653## 4654{ 'struct': 'BlockdevCreateOptionsRbd', 4655 'data': { 'location': 'BlockdevOptionsRbd', 4656 'size': 'size', 4657 '*cluster-size' : 'size', 4658 '*encrypt' : 'RbdEncryptionCreateOptions' } } 4659 4660## 4661# @BlockdevVmdkSubformat: 4662# 4663# Subformat options for VMDK images 4664# 4665# @monolithicSparse: Single file image with sparse cluster allocation 4666# 4667# @monolithicFlat: Single flat data image and a descriptor file 4668# 4669# @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent 4670# files, in addition to a descriptor file 4671# 4672# @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent 4673# files, in addition to a descriptor file 4674# 4675# @streamOptimized: Single file image sparse cluster allocation, optimized 4676# for streaming over network. 4677# 4678# Since: 4.0 4679## 4680{ 'enum': 'BlockdevVmdkSubformat', 4681 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse', 4682 'twoGbMaxExtentFlat', 'streamOptimized'] } 4683 4684## 4685# @BlockdevVmdkAdapterType: 4686# 4687# Adapter type info for VMDK images 4688# 4689# Since: 4.0 4690## 4691{ 'enum': 'BlockdevVmdkAdapterType', 4692 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] } 4693 4694## 4695# @BlockdevCreateOptionsVmdk: 4696# 4697# Driver specific image creation options for VMDK. 4698# 4699# @file: Where to store the new image file. This refers to the image 4700# file for monolithcSparse and streamOptimized format, or the 4701# descriptor file for other formats. 4702# @size: Size of the virtual disk in bytes 4703# @extents: Where to store the data extents. Required for monolithcFlat, 4704# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For 4705# monolithicFlat, only one entry is required; for 4706# twoGbMaxExtent* formats, the number of entries required is 4707# calculated as extent_number = virtual_size / 2GB. Providing 4708# more extents than will be used is an error. 4709# @subformat: The subformat of the VMDK image. Default: "monolithicSparse". 4710# @backing-file: The path of backing file. Default: no backing file is used. 4711# @adapter-type: The adapter type used to fill in the descriptor. Default: ide. 4712# @hwversion: Hardware version. The meaningful options are "4" or "6". 4713# Default: "4". 4714# @toolsversion: VMware guest tools version. 4715# Default: "2147483647" (Since 6.2) 4716# @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats. 4717# Default: false. 4718# 4719# Since: 4.0 4720## 4721{ 'struct': 'BlockdevCreateOptionsVmdk', 4722 'data': { 'file': 'BlockdevRef', 4723 'size': 'size', 4724 '*extents': ['BlockdevRef'], 4725 '*subformat': 'BlockdevVmdkSubformat', 4726 '*backing-file': 'str', 4727 '*adapter-type': 'BlockdevVmdkAdapterType', 4728 '*hwversion': 'str', 4729 '*toolsversion': 'str', 4730 '*zeroed-grain': 'bool' } } 4731 4732## 4733# @BlockdevCreateOptionsSsh: 4734# 4735# Driver specific image creation options for SSH. 4736# 4737# @location: Where to store the new image file 4738# @size: Size of the virtual disk in bytes 4739# 4740# Since: 2.12 4741## 4742{ 'struct': 'BlockdevCreateOptionsSsh', 4743 'data': { 'location': 'BlockdevOptionsSsh', 4744 'size': 'size' } } 4745 4746## 4747# @BlockdevCreateOptionsVdi: 4748# 4749# Driver specific image creation options for VDI. 4750# 4751# @file: Node to create the image format on 4752# @size: Size of the virtual disk in bytes 4753# @preallocation: Preallocation mode for the new image (default: off; 4754# allowed values: off, metadata) 4755# 4756# Since: 2.12 4757## 4758{ 'struct': 'BlockdevCreateOptionsVdi', 4759 'data': { 'file': 'BlockdevRef', 4760 'size': 'size', 4761 '*preallocation': 'PreallocMode' } } 4762 4763## 4764# @BlockdevVhdxSubformat: 4765# 4766# @dynamic: Growing image file 4767# @fixed: Preallocated fixed-size image file 4768# 4769# Since: 2.12 4770## 4771{ 'enum': 'BlockdevVhdxSubformat', 4772 'data': [ 'dynamic', 'fixed' ] } 4773 4774## 4775# @BlockdevCreateOptionsVhdx: 4776# 4777# Driver specific image creation options for vhdx. 4778# 4779# @file: Node to create the image format on 4780# @size: Size of the virtual disk in bytes 4781# @log-size: Log size in bytes, must be a multiple of 1 MB 4782# (default: 1 MB) 4783# @block-size: Block size in bytes, must be a multiple of 1 MB and not 4784# larger than 256 MB (default: automatically choose a block 4785# size depending on the image size) 4786# @subformat: vhdx subformat (default: dynamic) 4787# @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard, 4788# but default. Do not set to 'off' when using 'qemu-img 4789# convert' with subformat=dynamic. 4790# 4791# Since: 2.12 4792## 4793{ 'struct': 'BlockdevCreateOptionsVhdx', 4794 'data': { 'file': 'BlockdevRef', 4795 'size': 'size', 4796 '*log-size': 'size', 4797 '*block-size': 'size', 4798 '*subformat': 'BlockdevVhdxSubformat', 4799 '*block-state-zero': 'bool' } } 4800 4801## 4802# @BlockdevVpcSubformat: 4803# 4804# @dynamic: Growing image file 4805# @fixed: Preallocated fixed-size image file 4806# 4807# Since: 2.12 4808## 4809{ 'enum': 'BlockdevVpcSubformat', 4810 'data': [ 'dynamic', 'fixed' ] } 4811 4812## 4813# @BlockdevCreateOptionsVpc: 4814# 4815# Driver specific image creation options for vpc (VHD). 4816# 4817# @file: Node to create the image format on 4818# @size: Size of the virtual disk in bytes 4819# @subformat: vhdx subformat (default: dynamic) 4820# @force-size: Force use of the exact byte size instead of rounding to the 4821# next size that can be represented in CHS geometry 4822# (default: false) 4823# 4824# Since: 2.12 4825## 4826{ 'struct': 'BlockdevCreateOptionsVpc', 4827 'data': { 'file': 'BlockdevRef', 4828 'size': 'size', 4829 '*subformat': 'BlockdevVpcSubformat', 4830 '*force-size': 'bool' } } 4831 4832## 4833# @BlockdevCreateOptions: 4834# 4835# Options for creating an image format on a given node. 4836# 4837# @driver: block driver to create the image format 4838# 4839# Since: 2.12 4840## 4841{ 'union': 'BlockdevCreateOptions', 4842 'base': { 4843 'driver': 'BlockdevDriver' }, 4844 'discriminator': 'driver', 4845 'data': { 4846 'file': 'BlockdevCreateOptionsFile', 4847 'gluster': 'BlockdevCreateOptionsGluster', 4848 'luks': 'BlockdevCreateOptionsLUKS', 4849 'nfs': 'BlockdevCreateOptionsNfs', 4850 'parallels': 'BlockdevCreateOptionsParallels', 4851 'qcow': 'BlockdevCreateOptionsQcow', 4852 'qcow2': 'BlockdevCreateOptionsQcow2', 4853 'qed': 'BlockdevCreateOptionsQed', 4854 'rbd': 'BlockdevCreateOptionsRbd', 4855 'ssh': 'BlockdevCreateOptionsSsh', 4856 'vdi': 'BlockdevCreateOptionsVdi', 4857 'vhdx': 'BlockdevCreateOptionsVhdx', 4858 'vmdk': 'BlockdevCreateOptionsVmdk', 4859 'vpc': 'BlockdevCreateOptionsVpc' 4860 } } 4861 4862## 4863# @blockdev-create: 4864# 4865# Starts a job to create an image format on a given node. The job is 4866# automatically finalized, but a manual job-dismiss is required. 4867# 4868# @job-id: Identifier for the newly created job. 4869# 4870# @options: Options for the image creation. 4871# 4872# Since: 3.0 4873## 4874{ 'command': 'blockdev-create', 4875 'data': { 'job-id': 'str', 4876 'options': 'BlockdevCreateOptions' } } 4877 4878## 4879# @BlockdevAmendOptionsLUKS: 4880# 4881# Driver specific image amend options for LUKS. 4882# 4883# Since: 5.1 4884## 4885{ 'struct': 'BlockdevAmendOptionsLUKS', 4886 'base': 'QCryptoBlockAmendOptionsLUKS', 4887 'data': { } 4888} 4889 4890## 4891# @BlockdevAmendOptionsQcow2: 4892# 4893# Driver specific image amend options for qcow2. 4894# For now, only encryption options can be amended 4895# 4896# @encrypt Encryption options to be amended 4897# 4898# Since: 5.1 4899## 4900{ 'struct': 'BlockdevAmendOptionsQcow2', 4901 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } } 4902 4903## 4904# @BlockdevAmendOptions: 4905# 4906# Options for amending an image format 4907# 4908# @driver: Block driver of the node to amend. 4909# 4910# Since: 5.1 4911## 4912{ 'union': 'BlockdevAmendOptions', 4913 'base': { 4914 'driver': 'BlockdevDriver' }, 4915 'discriminator': 'driver', 4916 'data': { 4917 'luks': 'BlockdevAmendOptionsLUKS', 4918 'qcow2': 'BlockdevAmendOptionsQcow2' } } 4919 4920## 4921# @x-blockdev-amend: 4922# 4923# Starts a job to amend format specific options of an existing open block device 4924# The job is automatically finalized, but a manual job-dismiss is required. 4925# 4926# @job-id: Identifier for the newly created job. 4927# 4928# @node-name: Name of the block node to work on 4929# 4930# @options: Options (driver specific) 4931# 4932# @force: Allow unsafe operations, format specific 4933# For luks that allows erase of the last active keyslot 4934# (permanent loss of data), 4935# and replacement of an active keyslot 4936# (possible loss of data if IO error happens) 4937# 4938# Features: 4939# @unstable: This command is experimental. 4940# 4941# Since: 5.1 4942## 4943{ 'command': 'x-blockdev-amend', 4944 'data': { 'job-id': 'str', 4945 'node-name': 'str', 4946 'options': 'BlockdevAmendOptions', 4947 '*force': 'bool' }, 4948 'features': [ 'unstable' ] } 4949 4950## 4951# @BlockErrorAction: 4952# 4953# An enumeration of action that has been taken when a DISK I/O occurs 4954# 4955# @ignore: error has been ignored 4956# 4957# @report: error has been reported to the device 4958# 4959# @stop: error caused VM to be stopped 4960# 4961# Since: 2.1 4962## 4963{ 'enum': 'BlockErrorAction', 4964 'data': [ 'ignore', 'report', 'stop' ] } 4965 4966## 4967# @BLOCK_IMAGE_CORRUPTED: 4968# 4969# Emitted when a disk image is being marked corrupt. The image can be 4970# identified by its device or node name. The 'device' field is always 4971# present for compatibility reasons, but it can be empty ("") if the 4972# image does not have a device name associated. 4973# 4974# @device: device name. This is always present for compatibility 4975# reasons, but it can be empty ("") if the image does not 4976# have a device name associated. 4977# 4978# @node-name: node name (Since: 2.4) 4979# 4980# @msg: informative message for human consumption, such as the kind of 4981# corruption being detected. It should not be parsed by machine as it is 4982# not guaranteed to be stable 4983# 4984# @offset: if the corruption resulted from an image access, this is 4985# the host's access offset into the image 4986# 4987# @size: if the corruption resulted from an image access, this is 4988# the access size 4989# 4990# @fatal: if set, the image is marked corrupt and therefore unusable after this 4991# event and must be repaired (Since 2.2; before, every 4992# BLOCK_IMAGE_CORRUPTED event was fatal) 4993# 4994# Note: If action is "stop", a STOP event will eventually follow the 4995# BLOCK_IO_ERROR event. 4996# 4997# Example: 4998# 4999# <- { "event": "BLOCK_IMAGE_CORRUPTED", 5000# "data": { "device": "", "node-name": "drive", "fatal": false, 5001# "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" }, 5002# "timestamp": { "seconds": 1648243240, "microseconds": 906060 } } 5003# 5004# Since: 1.7 5005## 5006{ 'event': 'BLOCK_IMAGE_CORRUPTED', 5007 'data': { 'device' : 'str', 5008 '*node-name' : 'str', 5009 'msg' : 'str', 5010 '*offset' : 'int', 5011 '*size' : 'int', 5012 'fatal' : 'bool' } } 5013 5014## 5015# @BLOCK_IO_ERROR: 5016# 5017# Emitted when a disk I/O error occurs 5018# 5019# @device: device name. This is always present for compatibility 5020# reasons, but it can be empty ("") if the image does not 5021# have a device name associated. 5022# 5023# @node-name: node name. Note that errors may be reported for the root node 5024# that is directly attached to a guest device rather than for the 5025# node where the error occurred. The node name is not present if 5026# the drive is empty. (Since: 2.8) 5027# 5028# @operation: I/O operation 5029# 5030# @action: action that has been taken 5031# 5032# @nospace: true if I/O error was caused due to a no-space 5033# condition. This key is only present if query-block's 5034# io-status is present, please see query-block documentation 5035# for more information (since: 2.2) 5036# 5037# @reason: human readable string describing the error cause. 5038# (This field is a debugging aid for humans, it should not 5039# be parsed by applications) (since: 2.2) 5040# 5041# Note: If action is "stop", a STOP event will eventually follow the 5042# BLOCK_IO_ERROR event 5043# 5044# Since: 0.13 5045# 5046# Example: 5047# 5048# <- { "event": "BLOCK_IO_ERROR", 5049# "data": { "device": "ide0-hd1", 5050# "node-name": "#block212", 5051# "operation": "write", 5052# "action": "stop", 5053# "reason": "No space left on device" }, 5054# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } 5055# 5056## 5057{ 'event': 'BLOCK_IO_ERROR', 5058 'data': { 'device': 'str', '*node-name': 'str', 5059 'operation': 'IoOperationType', 5060 'action': 'BlockErrorAction', '*nospace': 'bool', 5061 'reason': 'str' } } 5062 5063## 5064# @BLOCK_JOB_COMPLETED: 5065# 5066# Emitted when a block job has completed 5067# 5068# @type: job type 5069# 5070# @device: The job identifier. Originally the device name but other 5071# values are allowed since QEMU 2.7 5072# 5073# @len: maximum progress value 5074# 5075# @offset: current progress value. On success this is equal to len. 5076# On failure this is less than len 5077# 5078# @speed: rate limit, bytes per second 5079# 5080# @error: error message. Only present on failure. This field 5081# contains a human-readable error message. There are no semantics 5082# other than that streaming has failed and clients should not try to 5083# interpret the error string 5084# 5085# Since: 1.1 5086# 5087# Example: 5088# 5089# <- { "event": "BLOCK_JOB_COMPLETED", 5090# "data": { "type": "stream", "device": "virtio-disk0", 5091# "len": 10737418240, "offset": 10737418240, 5092# "speed": 0 }, 5093# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } 5094# 5095## 5096{ 'event': 'BLOCK_JOB_COMPLETED', 5097 'data': { 'type' : 'JobType', 5098 'device': 'str', 5099 'len' : 'int', 5100 'offset': 'int', 5101 'speed' : 'int', 5102 '*error': 'str' } } 5103 5104## 5105# @BLOCK_JOB_CANCELLED: 5106# 5107# Emitted when a block job has been cancelled 5108# 5109# @type: job type 5110# 5111# @device: The job identifier. Originally the device name but other 5112# values are allowed since QEMU 2.7 5113# 5114# @len: maximum progress value 5115# 5116# @offset: current progress value. On success this is equal to len. 5117# On failure this is less than len 5118# 5119# @speed: rate limit, bytes per second 5120# 5121# Since: 1.1 5122# 5123# Example: 5124# 5125# <- { "event": "BLOCK_JOB_CANCELLED", 5126# "data": { "type": "stream", "device": "virtio-disk0", 5127# "len": 10737418240, "offset": 134217728, 5128# "speed": 0 }, 5129# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } 5130# 5131## 5132{ 'event': 'BLOCK_JOB_CANCELLED', 5133 'data': { 'type' : 'JobType', 5134 'device': 'str', 5135 'len' : 'int', 5136 'offset': 'int', 5137 'speed' : 'int' } } 5138 5139## 5140# @BLOCK_JOB_ERROR: 5141# 5142# Emitted when a block job encounters an error 5143# 5144# @device: The job identifier. Originally the device name but other 5145# values are allowed since QEMU 2.7 5146# 5147# @operation: I/O operation 5148# 5149# @action: action that has been taken 5150# 5151# Since: 1.3 5152# 5153# Example: 5154# 5155# <- { "event": "BLOCK_JOB_ERROR", 5156# "data": { "device": "ide0-hd1", 5157# "operation": "write", 5158# "action": "stop" }, 5159# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } 5160# 5161## 5162{ 'event': 'BLOCK_JOB_ERROR', 5163 'data': { 'device' : 'str', 5164 'operation': 'IoOperationType', 5165 'action' : 'BlockErrorAction' } } 5166 5167## 5168# @BLOCK_JOB_READY: 5169# 5170# Emitted when a block job is ready to complete 5171# 5172# @type: job type 5173# 5174# @device: The job identifier. Originally the device name but other 5175# values are allowed since QEMU 2.7 5176# 5177# @len: maximum progress value 5178# 5179# @offset: current progress value. On success this is equal to len. 5180# On failure this is less than len 5181# 5182# @speed: rate limit, bytes per second 5183# 5184# Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR 5185# event 5186# 5187# Since: 1.3 5188# 5189# Example: 5190# 5191# <- { "event": "BLOCK_JOB_READY", 5192# "data": { "device": "drive0", "type": "mirror", "speed": 0, 5193# "len": 2097152, "offset": 2097152 } 5194# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } 5195# 5196## 5197{ 'event': 'BLOCK_JOB_READY', 5198 'data': { 'type' : 'JobType', 5199 'device': 'str', 5200 'len' : 'int', 5201 'offset': 'int', 5202 'speed' : 'int' } } 5203 5204## 5205# @BLOCK_JOB_PENDING: 5206# 5207# Emitted when a block job is awaiting explicit authorization to finalize graph 5208# changes via @block-job-finalize. If this job is part of a transaction, it will 5209# not emit this event until the transaction has converged first. 5210# 5211# @type: job type 5212# 5213# @id: The job identifier. 5214# 5215# Since: 2.12 5216# 5217# Example: 5218# 5219# <- { "event": "BLOCK_JOB_PENDING", 5220# "data": { "type": "mirror", "id": "backup_1" }, 5221# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } 5222# 5223## 5224{ 'event': 'BLOCK_JOB_PENDING', 5225 'data': { 'type' : 'JobType', 5226 'id' : 'str' } } 5227 5228## 5229# @PreallocMode: 5230# 5231# Preallocation mode of QEMU image file 5232# 5233# @off: no preallocation 5234# @metadata: preallocate only for metadata 5235# @falloc: like @full preallocation but allocate disk space by 5236# posix_fallocate() rather than writing data. 5237# @full: preallocate all data by writing it to the device to ensure 5238# disk space is really available. This data may or may not be 5239# zero, depending on the image format and storage. 5240# @full preallocation also sets up metadata correctly. 5241# 5242# Since: 2.2 5243## 5244{ 'enum': 'PreallocMode', 5245 'data': [ 'off', 'metadata', 'falloc', 'full' ] } 5246 5247## 5248# @BLOCK_WRITE_THRESHOLD: 5249# 5250# Emitted when writes on block device reaches or exceeds the 5251# configured write threshold. For thin-provisioned devices, this 5252# means the device should be extended to avoid pausing for 5253# disk exhaustion. 5254# The event is one shot. Once triggered, it needs to be 5255# re-registered with another block-set-write-threshold command. 5256# 5257# @node-name: graph node name on which the threshold was exceeded. 5258# 5259# @amount-exceeded: amount of data which exceeded the threshold, in bytes. 5260# 5261# @write-threshold: last configured threshold, in bytes. 5262# 5263# Since: 2.3 5264## 5265{ 'event': 'BLOCK_WRITE_THRESHOLD', 5266 'data': { 'node-name': 'str', 5267 'amount-exceeded': 'uint64', 5268 'write-threshold': 'uint64' } } 5269 5270## 5271# @block-set-write-threshold: 5272# 5273# Change the write threshold for a block drive. An event will be 5274# delivered if a write to this block drive crosses the configured 5275# threshold. The threshold is an offset, thus must be 5276# non-negative. Default is no write threshold. Setting the threshold 5277# to zero disables it. 5278# 5279# This is useful to transparently resize thin-provisioned drives without 5280# the guest OS noticing. 5281# 5282# @node-name: graph node name on which the threshold must be set. 5283# 5284# @write-threshold: configured threshold for the block device, bytes. 5285# Use 0 to disable the threshold. 5286# 5287# Since: 2.3 5288# 5289# Example: 5290# 5291# -> { "execute": "block-set-write-threshold", 5292# "arguments": { "node-name": "mydev", 5293# "write-threshold": 17179869184 } } 5294# <- { "return": {} } 5295# 5296## 5297{ 'command': 'block-set-write-threshold', 5298 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } } 5299 5300## 5301# @x-blockdev-change: 5302# 5303# Dynamically reconfigure the block driver state graph. It can be used 5304# to add, remove, insert or replace a graph node. Currently only the 5305# Quorum driver implements this feature to add or remove its child. This 5306# is useful to fix a broken quorum child. 5307# 5308# If @node is specified, it will be inserted under @parent. @child 5309# may not be specified in this case. If both @parent and @child are 5310# specified but @node is not, @child will be detached from @parent. 5311# 5312# @parent: the id or name of the parent node. 5313# 5314# @child: the name of a child under the given parent node. 5315# 5316# @node: the name of the node that will be added. 5317# 5318# Features: 5319# @unstable: This command is experimental, and its API is not stable. It 5320# does not support all kinds of operations, all kinds of 5321# children, nor all block drivers. 5322# 5323# FIXME Removing children from a quorum node means introducing 5324# gaps in the child indices. This cannot be represented in the 5325# 'children' list of BlockdevOptionsQuorum, as returned by 5326# .bdrv_refresh_filename(). 5327# 5328# Warning: The data in a new quorum child MUST be consistent 5329# with that of the rest of the array. 5330# 5331# Since: 2.7 5332# 5333# Example: 5334# 5335# 1. Add a new node to a quorum 5336# -> { "execute": "blockdev-add", 5337# "arguments": { 5338# "driver": "raw", 5339# "node-name": "new_node", 5340# "file": { "driver": "file", 5341# "filename": "test.raw" } } } 5342# <- { "return": {} } 5343# -> { "execute": "x-blockdev-change", 5344# "arguments": { "parent": "disk1", 5345# "node": "new_node" } } 5346# <- { "return": {} } 5347# 5348# 2. Delete a quorum's node 5349# -> { "execute": "x-blockdev-change", 5350# "arguments": { "parent": "disk1", 5351# "child": "children.1" } } 5352# <- { "return": {} } 5353# 5354## 5355{ 'command': 'x-blockdev-change', 5356 'data' : { 'parent': 'str', 5357 '*child': 'str', 5358 '*node': 'str' }, 5359 'features': [ 'unstable' ] } 5360 5361## 5362# @x-blockdev-set-iothread: 5363# 5364# Move @node and its children into the @iothread. If @iothread is null then 5365# move @node and its children into the main loop. 5366# 5367# The node must not be attached to a BlockBackend. 5368# 5369# @node-name: the name of the block driver node 5370# 5371# @iothread: the name of the IOThread object or null for the main loop 5372# 5373# @force: true if the node and its children should be moved when a BlockBackend 5374# is already attached 5375# 5376# Features: 5377# @unstable: This command is experimental and intended for test cases that 5378# need control over IOThreads only. 5379# 5380# Since: 2.12 5381# 5382# Example: 5383# 5384# 1. Move a node into an IOThread 5385# -> { "execute": "x-blockdev-set-iothread", 5386# "arguments": { "node-name": "disk1", 5387# "iothread": "iothread0" } } 5388# <- { "return": {} } 5389# 5390# 2. Move a node into the main loop 5391# -> { "execute": "x-blockdev-set-iothread", 5392# "arguments": { "node-name": "disk1", 5393# "iothread": null } } 5394# <- { "return": {} } 5395# 5396## 5397{ 'command': 'x-blockdev-set-iothread', 5398 'data' : { 'node-name': 'str', 5399 'iothread': 'StrOrNull', 5400 '*force': 'bool' }, 5401 'features': [ 'unstable' ] } 5402 5403## 5404# @QuorumOpType: 5405# 5406# An enumeration of the quorum operation types 5407# 5408# @read: read operation 5409# 5410# @write: write operation 5411# 5412# @flush: flush operation 5413# 5414# Since: 2.6 5415## 5416{ 'enum': 'QuorumOpType', 5417 'data': [ 'read', 'write', 'flush' ] } 5418 5419## 5420# @QUORUM_FAILURE: 5421# 5422# Emitted by the Quorum block driver if it fails to establish a quorum 5423# 5424# @reference: device name if defined else node name 5425# 5426# @sector-num: number of the first sector of the failed read operation 5427# 5428# @sectors-count: failed read operation sector count 5429# 5430# Note: This event is rate-limited. 5431# 5432# Since: 2.0 5433# 5434# Example: 5435# 5436# <- { "event": "QUORUM_FAILURE", 5437# "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 }, 5438# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } 5439# 5440## 5441{ 'event': 'QUORUM_FAILURE', 5442 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } } 5443 5444## 5445# @QUORUM_REPORT_BAD: 5446# 5447# Emitted to report a corruption of a Quorum file 5448# 5449# @type: quorum operation type (Since 2.6) 5450# 5451# @error: error message. Only present on failure. This field 5452# contains a human-readable error message. There are no semantics other 5453# than that the block layer reported an error and clients should not 5454# try to interpret the error string. 5455# 5456# @node-name: the graph node name of the block driver state 5457# 5458# @sector-num: number of the first sector of the failed read operation 5459# 5460# @sectors-count: failed read operation sector count 5461# 5462# Note: This event is rate-limited. 5463# 5464# Since: 2.0 5465# 5466# Example: 5467# 5468# 1. Read operation 5469# 5470# { "event": "QUORUM_REPORT_BAD", 5471# "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5, 5472# "type": "read" }, 5473# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } 5474# 5475# 2. Flush operation 5476# 5477# { "event": "QUORUM_REPORT_BAD", 5478# "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120, 5479# "type": "flush", "error": "Broken pipe" }, 5480# "timestamp": { "seconds": 1456406829, "microseconds": 291763 } } 5481# 5482## 5483{ 'event': 'QUORUM_REPORT_BAD', 5484 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str', 5485 'sector-num': 'int', 'sectors-count': 'int' } } 5486 5487## 5488# @BlockdevSnapshotInternal: 5489# 5490# @device: the device name or node-name of a root node to generate the snapshot 5491# from 5492# 5493# @name: the name of the internal snapshot to be created 5494# 5495# Notes: In transaction, if @name is empty, or any snapshot matching @name 5496# exists, the operation will fail. Only some image formats support it, 5497# for example, qcow2, and rbd. 5498# 5499# Since: 1.7 5500## 5501{ 'struct': 'BlockdevSnapshotInternal', 5502 'data': { 'device': 'str', 'name': 'str' } } 5503 5504## 5505# @blockdev-snapshot-internal-sync: 5506# 5507# Synchronously take an internal snapshot of a block device, when the 5508# format of the image used supports it. If the name is an empty 5509# string, or a snapshot with name already exists, the operation will 5510# fail. 5511# 5512# For the arguments, see the documentation of BlockdevSnapshotInternal. 5513# 5514# Returns: - nothing on success 5515# - If @device is not a valid block device, GenericError 5516# - If any snapshot matching @name exists, or @name is empty, 5517# GenericError 5518# - If the format of the image used does not support it, 5519# BlockFormatFeatureNotSupported 5520# 5521# Since: 1.7 5522# 5523# Example: 5524# 5525# -> { "execute": "blockdev-snapshot-internal-sync", 5526# "arguments": { "device": "ide-hd0", 5527# "name": "snapshot0" } 5528# } 5529# <- { "return": {} } 5530# 5531## 5532{ 'command': 'blockdev-snapshot-internal-sync', 5533 'data': 'BlockdevSnapshotInternal' } 5534 5535## 5536# @blockdev-snapshot-delete-internal-sync: 5537# 5538# Synchronously delete an internal snapshot of a block device, when the format 5539# of the image used support it. The snapshot is identified by name or id or 5540# both. One of the name or id is required. Return SnapshotInfo for the 5541# successfully deleted snapshot. 5542# 5543# @device: the device name or node-name of a root node to delete the snapshot 5544# from 5545# 5546# @id: optional the snapshot's ID to be deleted 5547# 5548# @name: optional the snapshot's name to be deleted 5549# 5550# Returns: - SnapshotInfo on success 5551# - If @device is not a valid block device, GenericError 5552# - If snapshot not found, GenericError 5553# - If the format of the image used does not support it, 5554# BlockFormatFeatureNotSupported 5555# - If @id and @name are both not specified, GenericError 5556# 5557# Since: 1.7 5558# 5559# Example: 5560# 5561# -> { "execute": "blockdev-snapshot-delete-internal-sync", 5562# "arguments": { "device": "ide-hd0", 5563# "name": "snapshot0" } 5564# } 5565# <- { "return": { 5566# "id": "1", 5567# "name": "snapshot0", 5568# "vm-state-size": 0, 5569# "date-sec": 1000012, 5570# "date-nsec": 10, 5571# "vm-clock-sec": 100, 5572# "vm-clock-nsec": 20, 5573# "icount": 220414 5574# } 5575# } 5576# 5577## 5578{ 'command': 'blockdev-snapshot-delete-internal-sync', 5579 'data': { 'device': 'str', '*id': 'str', '*name': 'str'}, 5580 'returns': 'SnapshotInfo' } 5581