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