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