2
0

block-core.json 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725
  1. # -*- Mode: Python -*-
  2. ##
  3. # == QAPI block core definitions (vm unrelated)
  4. ##
  5. # QAPI common definitions
  6. { 'include': 'common.json' }
  7. ##
  8. # @SnapshotInfo:
  9. #
  10. # @id: unique snapshot id
  11. #
  12. # @name: user chosen name
  13. #
  14. # @vm-state-size: size of the VM state
  15. #
  16. # @date-sec: UTC date of the snapshot in seconds
  17. #
  18. # @date-nsec: fractional part in nano seconds to be used with date-sec
  19. #
  20. # @vm-clock-sec: VM clock relative to boot in seconds
  21. #
  22. # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
  23. #
  24. # Since: 1.3
  25. #
  26. ##
  27. { 'struct': 'SnapshotInfo',
  28. 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
  29. 'date-sec': 'int', 'date-nsec': 'int',
  30. 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
  31. ##
  32. # @ImageInfoSpecificQCow2:
  33. #
  34. # @compat: compatibility level
  35. #
  36. # @lazy-refcounts: on or off; only valid for compat >= 1.1
  37. #
  38. # @corrupt: true if the image has been marked corrupt; only valid for
  39. # compat >= 1.1 (since 2.2)
  40. #
  41. # @refcount-bits: width of a refcount entry in bits (since 2.3)
  42. #
  43. # Since: 1.7
  44. ##
  45. { 'struct': 'ImageInfoSpecificQCow2',
  46. 'data': {
  47. 'compat': 'str',
  48. '*lazy-refcounts': 'bool',
  49. '*corrupt': 'bool',
  50. 'refcount-bits': 'int'
  51. } }
  52. ##
  53. # @ImageInfoSpecificVmdk:
  54. #
  55. # @create-type: The create type of VMDK image
  56. #
  57. # @cid: Content id of image
  58. #
  59. # @parent-cid: Parent VMDK image's cid
  60. #
  61. # @extents: List of extent files
  62. #
  63. # Since: 1.7
  64. ##
  65. { 'struct': 'ImageInfoSpecificVmdk',
  66. 'data': {
  67. 'create-type': 'str',
  68. 'cid': 'int',
  69. 'parent-cid': 'int',
  70. 'extents': ['ImageInfo']
  71. } }
  72. ##
  73. # @ImageInfoSpecific:
  74. #
  75. # A discriminated record of image format specific information structures.
  76. #
  77. # Since: 1.7
  78. ##
  79. { 'union': 'ImageInfoSpecific',
  80. 'data': {
  81. 'qcow2': 'ImageInfoSpecificQCow2',
  82. 'vmdk': 'ImageInfoSpecificVmdk',
  83. # If we need to add block driver specific parameters for
  84. # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
  85. # to define a ImageInfoSpecificLUKS
  86. 'luks': 'QCryptoBlockInfoLUKS'
  87. } }
  88. ##
  89. # @ImageInfo:
  90. #
  91. # Information about a QEMU image file
  92. #
  93. # @filename: name of the image file
  94. #
  95. # @format: format of the image file
  96. #
  97. # @virtual-size: maximum capacity in bytes of the image
  98. #
  99. # @actual-size: actual size on disk in bytes of the image
  100. #
  101. # @dirty-flag: true if image is not cleanly closed
  102. #
  103. # @cluster-size: size of a cluster in bytes
  104. #
  105. # @encrypted: true if the image is encrypted
  106. #
  107. # @compressed: true if the image is compressed (Since 1.7)
  108. #
  109. # @backing-filename: name of the backing file
  110. #
  111. # @full-backing-filename: full path of the backing file
  112. #
  113. # @backing-filename-format: the format of the backing file
  114. #
  115. # @snapshots: list of VM snapshots
  116. #
  117. # @backing-image: info of the backing image (since 1.6)
  118. #
  119. # @format-specific: structure supplying additional format-specific
  120. # information (since 1.7)
  121. #
  122. # Since: 1.3
  123. #
  124. ##
  125. { 'struct': 'ImageInfo',
  126. 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
  127. '*actual-size': 'int', 'virtual-size': 'int',
  128. '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
  129. '*backing-filename': 'str', '*full-backing-filename': 'str',
  130. '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
  131. '*backing-image': 'ImageInfo',
  132. '*format-specific': 'ImageInfoSpecific' } }
  133. ##
  134. # @ImageCheck:
  135. #
  136. # Information about a QEMU image file check
  137. #
  138. # @filename: name of the image file checked
  139. #
  140. # @format: format of the image file checked
  141. #
  142. # @check-errors: number of unexpected errors occurred during check
  143. #
  144. # @image-end-offset: offset (in bytes) where the image ends, this
  145. # field is present if the driver for the image format
  146. # supports it
  147. #
  148. # @corruptions: number of corruptions found during the check if any
  149. #
  150. # @leaks: number of leaks found during the check if any
  151. #
  152. # @corruptions-fixed: number of corruptions fixed during the check
  153. # if any
  154. #
  155. # @leaks-fixed: number of leaks fixed during the check if any
  156. #
  157. # @total-clusters: total number of clusters, this field is present
  158. # if the driver for the image format supports it
  159. #
  160. # @allocated-clusters: total number of allocated clusters, this
  161. # field is present if the driver for the image format
  162. # supports it
  163. #
  164. # @fragmented-clusters: total number of fragmented clusters, this
  165. # field is present if the driver for the image format
  166. # supports it
  167. #
  168. # @compressed-clusters: total number of compressed clusters, this
  169. # field is present if the driver for the image format
  170. # supports it
  171. #
  172. # Since: 1.4
  173. #
  174. ##
  175. { 'struct': 'ImageCheck',
  176. 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
  177. '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
  178. '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
  179. '*total-clusters': 'int', '*allocated-clusters': 'int',
  180. '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
  181. ##
  182. # @MapEntry:
  183. #
  184. # Mapping information from a virtual block range to a host file range
  185. #
  186. # @start: the start byte of the mapped virtual range
  187. #
  188. # @length: the number of bytes of the mapped virtual range
  189. #
  190. # @data: whether the mapped range has data
  191. #
  192. # @zero: whether the virtual blocks are zeroed
  193. #
  194. # @depth: the depth of the mapping
  195. #
  196. # @offset: the offset in file that the virtual sectors are mapped to
  197. #
  198. # @filename: filename that is referred to by @offset
  199. #
  200. # Since: 2.6
  201. #
  202. ##
  203. { 'struct': 'MapEntry',
  204. 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
  205. 'zero': 'bool', 'depth': 'int', '*offset': 'int',
  206. '*filename': 'str' } }
  207. ##
  208. # @BlockdevCacheInfo:
  209. #
  210. # Cache mode information for a block device
  211. #
  212. # @writeback: true if writeback mode is enabled
  213. # @direct: true if the host page cache is bypassed (O_DIRECT)
  214. # @no-flush: true if flush requests are ignored for the device
  215. #
  216. # Since: 2.3
  217. ##
  218. { 'struct': 'BlockdevCacheInfo',
  219. 'data': { 'writeback': 'bool',
  220. 'direct': 'bool',
  221. 'no-flush': 'bool' } }
  222. ##
  223. # @BlockDeviceInfo:
  224. #
  225. # Information about the backing device for a block device.
  226. #
  227. # @file: the filename of the backing device
  228. #
  229. # @node-name: the name of the block driver node (Since 2.0)
  230. #
  231. # @ro: true if the backing device was open read-only
  232. #
  233. # @drv: the name of the block format used to open the backing device. As of
  234. # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
  235. # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
  236. # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
  237. # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
  238. # 2.2: 'archipelago' added, 'cow' dropped
  239. # 2.3: 'host_floppy' deprecated
  240. # 2.5: 'host_floppy' dropped
  241. # 2.6: 'luks' added
  242. # 2.8: 'replication' added, 'tftp' dropped
  243. # 2.9: 'archipelago' dropped
  244. #
  245. # @backing_file: the name of the backing file (for copy-on-write)
  246. #
  247. # @backing_file_depth: number of files in the backing file chain (since: 1.2)
  248. #
  249. # @encrypted: true if the backing device is encrypted
  250. #
  251. # @encryption_key_missing: true if the backing device is encrypted but an
  252. # valid encryption key is missing
  253. #
  254. # @detect_zeroes: detect and optimize zero writes (Since 2.1)
  255. #
  256. # @bps: total throughput limit in bytes per second is specified
  257. #
  258. # @bps_rd: read throughput limit in bytes per second is specified
  259. #
  260. # @bps_wr: write throughput limit in bytes per second is specified
  261. #
  262. # @iops: total I/O operations per second is specified
  263. #
  264. # @iops_rd: read I/O operations per second is specified
  265. #
  266. # @iops_wr: write I/O operations per second is specified
  267. #
  268. # @image: the info of image used (since: 1.6)
  269. #
  270. # @bps_max: total throughput limit during bursts,
  271. # in bytes (Since 1.7)
  272. #
  273. # @bps_rd_max: read throughput limit during bursts,
  274. # in bytes (Since 1.7)
  275. #
  276. # @bps_wr_max: write throughput limit during bursts,
  277. # in bytes (Since 1.7)
  278. #
  279. # @iops_max: total I/O operations per second during bursts,
  280. # in bytes (Since 1.7)
  281. #
  282. # @iops_rd_max: read I/O operations per second during bursts,
  283. # in bytes (Since 1.7)
  284. #
  285. # @iops_wr_max: write I/O operations per second during bursts,
  286. # in bytes (Since 1.7)
  287. #
  288. # @bps_max_length: maximum length of the @bps_max burst
  289. # period, in seconds. (Since 2.6)
  290. #
  291. # @bps_rd_max_length: maximum length of the @bps_rd_max
  292. # burst period, in seconds. (Since 2.6)
  293. #
  294. # @bps_wr_max_length: maximum length of the @bps_wr_max
  295. # burst period, in seconds. (Since 2.6)
  296. #
  297. # @iops_max_length: maximum length of the @iops burst
  298. # period, in seconds. (Since 2.6)
  299. #
  300. # @iops_rd_max_length: maximum length of the @iops_rd_max
  301. # burst period, in seconds. (Since 2.6)
  302. #
  303. # @iops_wr_max_length: maximum length of the @iops_wr_max
  304. # burst period, in seconds. (Since 2.6)
  305. #
  306. # @iops_size: an I/O size in bytes (Since 1.7)
  307. #
  308. # @group: throttle group name (Since 2.4)
  309. #
  310. # @cache: the cache mode used for the block device (since: 2.3)
  311. #
  312. # @write_threshold: configured write threshold for the device.
  313. # 0 if disabled. (Since 2.3)
  314. #
  315. # Since: 0.14.0
  316. #
  317. ##
  318. { 'struct': 'BlockDeviceInfo',
  319. 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
  320. '*backing_file': 'str', 'backing_file_depth': 'int',
  321. 'encrypted': 'bool', 'encryption_key_missing': 'bool',
  322. 'detect_zeroes': 'BlockdevDetectZeroesOptions',
  323. 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
  324. 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
  325. 'image': 'ImageInfo',
  326. '*bps_max': 'int', '*bps_rd_max': 'int',
  327. '*bps_wr_max': 'int', '*iops_max': 'int',
  328. '*iops_rd_max': 'int', '*iops_wr_max': 'int',
  329. '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
  330. '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
  331. '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
  332. '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
  333. 'write_threshold': 'int' } }
  334. ##
  335. # @BlockDeviceIoStatus:
  336. #
  337. # An enumeration of block device I/O status.
  338. #
  339. # @ok: The last I/O operation has succeeded
  340. #
  341. # @failed: The last I/O operation has failed
  342. #
  343. # @nospace: The last I/O operation has failed due to a no-space condition
  344. #
  345. # Since: 1.0
  346. ##
  347. { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
  348. ##
  349. # @BlockDeviceMapEntry:
  350. #
  351. # Entry in the metadata map of the device (returned by "qemu-img map")
  352. #
  353. # @start: Offset in the image of the first byte described by this entry
  354. # (in bytes)
  355. #
  356. # @length: Length of the range described by this entry (in bytes)
  357. #
  358. # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
  359. # before reaching one for which the range is allocated. The value is
  360. # in the range 0 to the depth of the image chain - 1.
  361. #
  362. # @zero: the sectors in this range read as zeros
  363. #
  364. # @data: reading the image will actually read data from a file (in particular,
  365. # if @offset is present this means that the sectors are not simply
  366. # preallocated, but contain actual data in raw format)
  367. #
  368. # @offset: if present, the image file stores the data for this range in
  369. # raw format at the given offset.
  370. #
  371. # Since: 1.7
  372. ##
  373. { 'struct': 'BlockDeviceMapEntry',
  374. 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
  375. 'data': 'bool', '*offset': 'int' } }
  376. ##
  377. # @DirtyBitmapStatus:
  378. #
  379. # An enumeration of possible states that a dirty bitmap can report to the user.
  380. #
  381. # @frozen: The bitmap is currently in-use by a backup operation or block job,
  382. # and is immutable.
  383. #
  384. # @disabled: The bitmap is currently in-use by an internal operation and is
  385. # read-only. It can still be deleted.
  386. #
  387. # @active: The bitmap is actively monitoring for new writes, and can be cleared,
  388. # deleted, or used for backup operations.
  389. #
  390. # Since: 2.4
  391. ##
  392. { 'enum': 'DirtyBitmapStatus',
  393. 'data': ['active', 'disabled', 'frozen'] }
  394. ##
  395. # @BlockDirtyInfo:
  396. #
  397. # Block dirty bitmap information.
  398. #
  399. # @name: the name of the dirty bitmap (Since 2.4)
  400. #
  401. # @count: number of dirty bytes according to the dirty bitmap
  402. #
  403. # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
  404. #
  405. # @status: current status of the dirty bitmap (since 2.4)
  406. #
  407. # Since: 1.3
  408. ##
  409. { 'struct': 'BlockDirtyInfo',
  410. 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
  411. 'status': 'DirtyBitmapStatus'} }
  412. ##
  413. # @BlockInfo:
  414. #
  415. # Block device information. This structure describes a virtual device and
  416. # the backing device associated with it.
  417. #
  418. # @device: The device name associated with the virtual device.
  419. #
  420. # @type: This field is returned only for compatibility reasons, it should
  421. # not be used (always returns 'unknown')
  422. #
  423. # @removable: True if the device supports removable media.
  424. #
  425. # @locked: True if the guest has locked this device from having its media
  426. # removed
  427. #
  428. # @tray_open: True if the device's tray is open
  429. # (only present if it has a tray)
  430. #
  431. # @dirty-bitmaps: dirty bitmaps information (only present if the
  432. # driver has one or more dirty bitmaps) (Since 2.0)
  433. #
  434. # @io-status: @BlockDeviceIoStatus. Only present if the device
  435. # supports it and the VM is configured to stop on errors
  436. # (supported device models: virtio-blk, IDE, SCSI except
  437. # scsi-generic)
  438. #
  439. # @inserted: @BlockDeviceInfo describing the device if media is
  440. # present
  441. #
  442. # Since: 0.14.0
  443. ##
  444. { 'struct': 'BlockInfo',
  445. 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
  446. 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
  447. '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
  448. '*dirty-bitmaps': ['BlockDirtyInfo'] } }
  449. ##
  450. # @query-block:
  451. #
  452. # Get a list of BlockInfo for all virtual block devices.
  453. #
  454. # Returns: a list of @BlockInfo describing each virtual block device
  455. #
  456. # Since: 0.14.0
  457. #
  458. # Example:
  459. #
  460. # -> { "execute": "query-block" }
  461. # <- {
  462. # "return":[
  463. # {
  464. # "io-status": "ok",
  465. # "device":"ide0-hd0",
  466. # "locked":false,
  467. # "removable":false,
  468. # "inserted":{
  469. # "ro":false,
  470. # "drv":"qcow2",
  471. # "encrypted":false,
  472. # "file":"disks/test.qcow2",
  473. # "backing_file_depth":1,
  474. # "bps":1000000,
  475. # "bps_rd":0,
  476. # "bps_wr":0,
  477. # "iops":1000000,
  478. # "iops_rd":0,
  479. # "iops_wr":0,
  480. # "bps_max": 8000000,
  481. # "bps_rd_max": 0,
  482. # "bps_wr_max": 0,
  483. # "iops_max": 0,
  484. # "iops_rd_max": 0,
  485. # "iops_wr_max": 0,
  486. # "iops_size": 0,
  487. # "detect_zeroes": "on",
  488. # "write_threshold": 0,
  489. # "image":{
  490. # "filename":"disks/test.qcow2",
  491. # "format":"qcow2",
  492. # "virtual-size":2048000,
  493. # "backing_file":"base.qcow2",
  494. # "full-backing-filename":"disks/base.qcow2",
  495. # "backing-filename-format":"qcow2",
  496. # "snapshots":[
  497. # {
  498. # "id": "1",
  499. # "name": "snapshot1",
  500. # "vm-state-size": 0,
  501. # "date-sec": 10000200,
  502. # "date-nsec": 12,
  503. # "vm-clock-sec": 206,
  504. # "vm-clock-nsec": 30
  505. # }
  506. # ],
  507. # "backing-image":{
  508. # "filename":"disks/base.qcow2",
  509. # "format":"qcow2",
  510. # "virtual-size":2048000
  511. # }
  512. # }
  513. # },
  514. # "type":"unknown"
  515. # },
  516. # {
  517. # "io-status": "ok",
  518. # "device":"ide1-cd0",
  519. # "locked":false,
  520. # "removable":true,
  521. # "type":"unknown"
  522. # },
  523. # {
  524. # "device":"floppy0",
  525. # "locked":false,
  526. # "removable":true,
  527. # "type":"unknown"
  528. # },
  529. # {
  530. # "device":"sd0",
  531. # "locked":false,
  532. # "removable":true,
  533. # "type":"unknown"
  534. # }
  535. # ]
  536. # }
  537. #
  538. ##
  539. { 'command': 'query-block', 'returns': ['BlockInfo'] }
  540. ##
  541. # @BlockDeviceTimedStats:
  542. #
  543. # Statistics of a block device during a given interval of time.
  544. #
  545. # @interval_length: Interval used for calculating the statistics,
  546. # in seconds.
  547. #
  548. # @min_rd_latency_ns: Minimum latency of read operations in the
  549. # defined interval, in nanoseconds.
  550. #
  551. # @min_wr_latency_ns: Minimum latency of write operations in the
  552. # defined interval, in nanoseconds.
  553. #
  554. # @min_flush_latency_ns: Minimum latency of flush operations in the
  555. # defined interval, in nanoseconds.
  556. #
  557. # @max_rd_latency_ns: Maximum latency of read operations in the
  558. # defined interval, in nanoseconds.
  559. #
  560. # @max_wr_latency_ns: Maximum latency of write operations in the
  561. # defined interval, in nanoseconds.
  562. #
  563. # @max_flush_latency_ns: Maximum latency of flush operations in the
  564. # defined interval, in nanoseconds.
  565. #
  566. # @avg_rd_latency_ns: Average latency of read operations in the
  567. # defined interval, in nanoseconds.
  568. #
  569. # @avg_wr_latency_ns: Average latency of write operations in the
  570. # defined interval, in nanoseconds.
  571. #
  572. # @avg_flush_latency_ns: Average latency of flush operations in the
  573. # defined interval, in nanoseconds.
  574. #
  575. # @avg_rd_queue_depth: Average number of pending read operations
  576. # in the defined interval.
  577. #
  578. # @avg_wr_queue_depth: Average number of pending write operations
  579. # in the defined interval.
  580. #
  581. # Since: 2.5
  582. ##
  583. { 'struct': 'BlockDeviceTimedStats',
  584. 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
  585. 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
  586. 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
  587. 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
  588. 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
  589. 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
  590. ##
  591. # @BlockDeviceStats:
  592. #
  593. # Statistics of a virtual block device or a block backing device.
  594. #
  595. # @rd_bytes: The number of bytes read by the device.
  596. #
  597. # @wr_bytes: The number of bytes written by the device.
  598. #
  599. # @rd_operations: The number of read operations performed by the device.
  600. #
  601. # @wr_operations: The number of write operations performed by the device.
  602. #
  603. # @flush_operations: The number of cache flush operations performed by the
  604. # device (since 0.15.0)
  605. #
  606. # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
  607. # (since 0.15.0).
  608. #
  609. # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
  610. #
  611. # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
  612. #
  613. # @wr_highest_offset: The offset after the greatest byte written to the
  614. # device. The intended use of this information is for
  615. # growable sparse files (like qcow2) that are used on top
  616. # of a physical device.
  617. #
  618. # @rd_merged: Number of read requests that have been merged into another
  619. # request (Since 2.3).
  620. #
  621. # @wr_merged: Number of write requests that have been merged into another
  622. # request (Since 2.3).
  623. #
  624. # @idle_time_ns: Time since the last I/O operation, in
  625. # nanoseconds. If the field is absent it means that
  626. # there haven't been any operations yet (Since 2.5).
  627. #
  628. # @failed_rd_operations: The number of failed read operations
  629. # performed by the device (Since 2.5)
  630. #
  631. # @failed_wr_operations: The number of failed write operations
  632. # performed by the device (Since 2.5)
  633. #
  634. # @failed_flush_operations: The number of failed flush operations
  635. # performed by the device (Since 2.5)
  636. #
  637. # @invalid_rd_operations: The number of invalid read operations
  638. # performed by the device (Since 2.5)
  639. #
  640. # @invalid_wr_operations: The number of invalid write operations
  641. # performed by the device (Since 2.5)
  642. #
  643. # @invalid_flush_operations: The number of invalid flush operations
  644. # performed by the device (Since 2.5)
  645. #
  646. # @account_invalid: Whether invalid operations are included in the
  647. # last access statistics (Since 2.5)
  648. #
  649. # @account_failed: Whether failed operations are included in the
  650. # latency and last access statistics (Since 2.5)
  651. #
  652. # @timed_stats: Statistics specific to the set of previously defined
  653. # intervals of time (Since 2.5)
  654. #
  655. # Since: 0.14.0
  656. ##
  657. { 'struct': 'BlockDeviceStats',
  658. 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
  659. 'wr_operations': 'int', 'flush_operations': 'int',
  660. 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
  661. 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
  662. 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
  663. 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
  664. 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
  665. 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
  666. 'account_invalid': 'bool', 'account_failed': 'bool',
  667. 'timed_stats': ['BlockDeviceTimedStats'] } }
  668. ##
  669. # @BlockStats:
  670. #
  671. # Statistics of a virtual block device or a block backing device.
  672. #
  673. # @device: If the stats are for a virtual block device, the name
  674. # corresponding to the virtual block device.
  675. #
  676. # @node-name: The node name of the device. (Since 2.3)
  677. #
  678. # @stats: A @BlockDeviceStats for the device.
  679. #
  680. # @parent: This describes the file block device if it has one.
  681. # Contains recursively the statistics of the underlying
  682. # protocol (e.g. the host file for a qcow2 image). If there is
  683. # no underlying protocol, this field is omitted
  684. #
  685. # @backing: This describes the backing block device if it has one.
  686. # (Since 2.0)
  687. #
  688. # Since: 0.14.0
  689. ##
  690. { 'struct': 'BlockStats',
  691. 'data': {'*device': 'str', '*node-name': 'str',
  692. 'stats': 'BlockDeviceStats',
  693. '*parent': 'BlockStats',
  694. '*backing': 'BlockStats'} }
  695. ##
  696. # @query-blockstats:
  697. #
  698. # Query the @BlockStats for all virtual block devices.
  699. #
  700. # @query-nodes: If true, the command will query all the block nodes
  701. # that have a node name, in a list which will include "parent"
  702. # information, but not "backing".
  703. # If false or omitted, the behavior is as before - query all the
  704. # device backends, recursively including their "parent" and
  705. # "backing". (Since 2.3)
  706. #
  707. # Returns: A list of @BlockStats for each virtual block devices.
  708. #
  709. # Since: 0.14.0
  710. #
  711. # Example:
  712. #
  713. # -> { "execute": "query-blockstats" }
  714. # <- {
  715. # "return":[
  716. # {
  717. # "device":"ide0-hd0",
  718. # "parent":{
  719. # "stats":{
  720. # "wr_highest_offset":3686448128,
  721. # "wr_bytes":9786368,
  722. # "wr_operations":751,
  723. # "rd_bytes":122567168,
  724. # "rd_operations":36772
  725. # "wr_total_times_ns":313253456
  726. # "rd_total_times_ns":3465673657
  727. # "flush_total_times_ns":49653
  728. # "flush_operations":61,
  729. # "rd_merged":0,
  730. # "wr_merged":0,
  731. # "idle_time_ns":2953431879,
  732. # "account_invalid":true,
  733. # "account_failed":false
  734. # }
  735. # },
  736. # "stats":{
  737. # "wr_highest_offset":2821110784,
  738. # "wr_bytes":9786368,
  739. # "wr_operations":692,
  740. # "rd_bytes":122739200,
  741. # "rd_operations":36604
  742. # "flush_operations":51,
  743. # "wr_total_times_ns":313253456
  744. # "rd_total_times_ns":3465673657
  745. # "flush_total_times_ns":49653,
  746. # "rd_merged":0,
  747. # "wr_merged":0,
  748. # "idle_time_ns":2953431879,
  749. # "account_invalid":true,
  750. # "account_failed":false
  751. # }
  752. # },
  753. # {
  754. # "device":"ide1-cd0",
  755. # "stats":{
  756. # "wr_highest_offset":0,
  757. # "wr_bytes":0,
  758. # "wr_operations":0,
  759. # "rd_bytes":0,
  760. # "rd_operations":0
  761. # "flush_operations":0,
  762. # "wr_total_times_ns":0
  763. # "rd_total_times_ns":0
  764. # "flush_total_times_ns":0,
  765. # "rd_merged":0,
  766. # "wr_merged":0,
  767. # "account_invalid":false,
  768. # "account_failed":false
  769. # }
  770. # },
  771. # {
  772. # "device":"floppy0",
  773. # "stats":{
  774. # "wr_highest_offset":0,
  775. # "wr_bytes":0,
  776. # "wr_operations":0,
  777. # "rd_bytes":0,
  778. # "rd_operations":0
  779. # "flush_operations":0,
  780. # "wr_total_times_ns":0
  781. # "rd_total_times_ns":0
  782. # "flush_total_times_ns":0,
  783. # "rd_merged":0,
  784. # "wr_merged":0,
  785. # "account_invalid":false,
  786. # "account_failed":false
  787. # }
  788. # },
  789. # {
  790. # "device":"sd0",
  791. # "stats":{
  792. # "wr_highest_offset":0,
  793. # "wr_bytes":0,
  794. # "wr_operations":0,
  795. # "rd_bytes":0,
  796. # "rd_operations":0
  797. # "flush_operations":0,
  798. # "wr_total_times_ns":0
  799. # "rd_total_times_ns":0
  800. # "flush_total_times_ns":0,
  801. # "rd_merged":0,
  802. # "wr_merged":0,
  803. # "account_invalid":false,
  804. # "account_failed":false
  805. # }
  806. # }
  807. # ]
  808. # }
  809. #
  810. ##
  811. { 'command': 'query-blockstats',
  812. 'data': { '*query-nodes': 'bool' },
  813. 'returns': ['BlockStats'] }
  814. ##
  815. # @BlockdevOnError:
  816. #
  817. # An enumeration of possible behaviors for errors on I/O operations.
  818. # The exact meaning depends on whether the I/O was initiated by a guest
  819. # or by a block job
  820. #
  821. # @report: for guest operations, report the error to the guest;
  822. # for jobs, cancel the job
  823. #
  824. # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
  825. # or BLOCK_JOB_ERROR)
  826. #
  827. # @enospc: same as @stop on ENOSPC, same as @report otherwise.
  828. #
  829. # @stop: for guest operations, stop the virtual machine;
  830. # for jobs, pause the job
  831. #
  832. # @auto: inherit the error handling policy of the backend (since: 2.7)
  833. #
  834. # Since: 1.3
  835. ##
  836. { 'enum': 'BlockdevOnError',
  837. 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
  838. ##
  839. # @MirrorSyncMode:
  840. #
  841. # An enumeration of possible behaviors for the initial synchronization
  842. # phase of storage mirroring.
  843. #
  844. # @top: copies data in the topmost image to the destination
  845. #
  846. # @full: copies data from all images to the destination
  847. #
  848. # @none: only copy data written from now on
  849. #
  850. # @incremental: only copy data described by the dirty bitmap. Since: 2.4
  851. #
  852. # Since: 1.3
  853. ##
  854. { 'enum': 'MirrorSyncMode',
  855. 'data': ['top', 'full', 'none', 'incremental'] }
  856. ##
  857. # @BlockJobType:
  858. #
  859. # Type of a block job.
  860. #
  861. # @commit: block commit job type, see "block-commit"
  862. #
  863. # @stream: block stream job type, see "block-stream"
  864. #
  865. # @mirror: drive mirror job type, see "drive-mirror"
  866. #
  867. # @backup: drive backup job type, see "drive-backup"
  868. #
  869. # Since: 1.7
  870. ##
  871. { 'enum': 'BlockJobType',
  872. 'data': ['commit', 'stream', 'mirror', 'backup'] }
  873. ##
  874. # @BlockJobInfo:
  875. #
  876. # Information about a long-running block device operation.
  877. #
  878. # @type: the job type ('stream' for image streaming)
  879. #
  880. # @device: The job identifier. Originally the device name but other
  881. # values are allowed since QEMU 2.7
  882. #
  883. # @len: the maximum progress value
  884. #
  885. # @busy: false if the job is known to be in a quiescent state, with
  886. # no pending I/O. Since 1.3.
  887. #
  888. # @paused: whether the job is paused or, if @busy is true, will
  889. # pause itself as soon as possible. Since 1.3.
  890. #
  891. # @offset: the current progress value
  892. #
  893. # @speed: the rate limit, bytes per second
  894. #
  895. # @io-status: the status of the job (since 1.3)
  896. #
  897. # @ready: true if the job may be completed (since 2.2)
  898. #
  899. # Since: 1.1
  900. ##
  901. { 'struct': 'BlockJobInfo',
  902. 'data': {'type': 'str', 'device': 'str', 'len': 'int',
  903. 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
  904. 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
  905. ##
  906. # @query-block-jobs:
  907. #
  908. # Return information about long-running block device operations.
  909. #
  910. # Returns: a list of @BlockJobInfo for each active block job
  911. #
  912. # Since: 1.1
  913. ##
  914. { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
  915. ##
  916. # @block_passwd:
  917. #
  918. # This command sets the password of a block device that has not been open
  919. # with a password and requires one.
  920. #
  921. # The two cases where this can happen are a block device is created through
  922. # QEMU's initial command line or a block device is changed through the legacy
  923. # @change interface.
  924. #
  925. # In the event that the block device is created through the initial command
  926. # line, the VM will start in the stopped state regardless of whether '-S' is
  927. # used. The intention is for a management tool to query the block devices to
  928. # determine which ones are encrypted, set the passwords with this command, and
  929. # then start the guest with the @cont command.
  930. #
  931. # Either @device or @node-name must be set but not both.
  932. #
  933. # @device: the name of the block backend device to set the password on
  934. #
  935. # @node-name: graph node name to set the password on (Since 2.0)
  936. #
  937. # @password: the password to use for the device
  938. #
  939. # Returns: nothing on success
  940. # If @device is not a valid block device, DeviceNotFound
  941. # If @device is not encrypted, DeviceNotEncrypted
  942. #
  943. # Notes: Not all block formats support encryption and some that do are not
  944. # able to validate that a password is correct. Disk corruption may
  945. # occur if an invalid password is specified.
  946. #
  947. # Since: 0.14.0
  948. #
  949. # Example:
  950. #
  951. # -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
  952. # "password": "12345" } }
  953. # <- { "return": {} }
  954. #
  955. ##
  956. { 'command': 'block_passwd', 'data': {'*device': 'str',
  957. '*node-name': 'str', 'password': 'str'} }
  958. ##
  959. # @block_resize:
  960. #
  961. # Resize a block image while a guest is running.
  962. #
  963. # Either @device or @node-name must be set but not both.
  964. #
  965. # @device: the name of the device to get the image resized
  966. #
  967. # @node-name: graph node name to get the image resized (Since 2.0)
  968. #
  969. # @size: new image size in bytes
  970. #
  971. # Returns: nothing on success
  972. # If @device is not a valid block device, DeviceNotFound
  973. #
  974. # Since: 0.14.0
  975. #
  976. # Example:
  977. #
  978. # -> { "execute": "block_resize",
  979. # "arguments": { "device": "scratch", "size": 1073741824 } }
  980. # <- { "return": {} }
  981. #
  982. ##
  983. { 'command': 'block_resize', 'data': { '*device': 'str',
  984. '*node-name': 'str',
  985. 'size': 'int' }}
  986. ##
  987. # @NewImageMode:
  988. #
  989. # An enumeration that tells QEMU how to set the backing file path in
  990. # a new image file.
  991. #
  992. # @existing: QEMU should look for an existing image file.
  993. #
  994. # @absolute-paths: QEMU should create a new image with absolute paths
  995. # for the backing file. If there is no backing file available, the new
  996. # image will not be backed either.
  997. #
  998. # Since: 1.1
  999. ##
  1000. { 'enum': 'NewImageMode',
  1001. 'data': [ 'existing', 'absolute-paths' ] }
  1002. ##
  1003. # @BlockdevSnapshotSync:
  1004. #
  1005. # Either @device or @node-name must be set but not both.
  1006. #
  1007. # @device: the name of the device to generate the snapshot from.
  1008. #
  1009. # @node-name: graph node name to generate the snapshot from (Since 2.0)
  1010. #
  1011. # @snapshot-file: the target of the new image. If the file exists, or
  1012. # if it is a device, the snapshot will be created in the existing
  1013. # file/device. Otherwise, a new file will be created.
  1014. #
  1015. # @snapshot-node-name: the graph node name of the new image (Since 2.0)
  1016. #
  1017. # @format: the format of the snapshot image, default is 'qcow2'.
  1018. #
  1019. # @mode: whether and how QEMU should create a new image, default is
  1020. # 'absolute-paths'.
  1021. ##
  1022. { 'struct': 'BlockdevSnapshotSync',
  1023. 'data': { '*device': 'str', '*node-name': 'str',
  1024. 'snapshot-file': 'str', '*snapshot-node-name': 'str',
  1025. '*format': 'str', '*mode': 'NewImageMode' } }
  1026. ##
  1027. # @BlockdevSnapshot:
  1028. #
  1029. # @node: device or node name that will have a snapshot created.
  1030. #
  1031. # @overlay: reference to the existing block device that will become
  1032. # the overlay of @node, as part of creating the snapshot.
  1033. # It must not have a current backing file (this can be
  1034. # achieved by passing "backing": "" to blockdev-add).
  1035. #
  1036. # Since: 2.5
  1037. ##
  1038. { 'struct': 'BlockdevSnapshot',
  1039. 'data': { 'node': 'str', 'overlay': 'str' } }
  1040. ##
  1041. # @DriveBackup:
  1042. #
  1043. # @job-id: identifier for the newly-created block job. If
  1044. # omitted, the device name will be used. (Since 2.7)
  1045. #
  1046. # @device: the device name or node-name of a root node which should be copied.
  1047. #
  1048. # @target: the target of the new image. If the file exists, or if it
  1049. # is a device, the existing file/device will be used as the new
  1050. # destination. If it does not exist, a new file will be created.
  1051. #
  1052. # @format: the format of the new destination, default is to
  1053. # probe if @mode is 'existing', else the format of the source
  1054. #
  1055. # @sync: what parts of the disk image should be copied to the destination
  1056. # (all the disk, only the sectors allocated in the topmost image, from a
  1057. # dirty bitmap, or only new I/O).
  1058. #
  1059. # @mode: whether and how QEMU should create a new image, default is
  1060. # 'absolute-paths'.
  1061. #
  1062. # @speed: the maximum speed, in bytes per second
  1063. #
  1064. # @bitmap: the name of dirty bitmap if sync is "incremental".
  1065. # Must be present if sync is "incremental", must NOT be present
  1066. # otherwise. (Since 2.4)
  1067. #
  1068. # @compress: true to compress data, if the target format supports it.
  1069. # (default: false) (since 2.8)
  1070. #
  1071. # @on-source-error: the action to take on an error on the source,
  1072. # default 'report'. 'stop' and 'enospc' can only be used
  1073. # if the block device supports io-status (see BlockInfo).
  1074. #
  1075. # @on-target-error: the action to take on an error on the target,
  1076. # default 'report' (no limitations, since this applies to
  1077. # a different block device than @device).
  1078. #
  1079. # Note: @on-source-error and @on-target-error only affect background
  1080. # I/O. If an error occurs during a guest write request, the device's
  1081. # rerror/werror actions will be used.
  1082. #
  1083. # Since: 1.6
  1084. ##
  1085. { 'struct': 'DriveBackup',
  1086. 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
  1087. '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
  1088. '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
  1089. '*on-source-error': 'BlockdevOnError',
  1090. '*on-target-error': 'BlockdevOnError' } }
  1091. ##
  1092. # @BlockdevBackup:
  1093. #
  1094. # @job-id: identifier for the newly-created block job. If
  1095. # omitted, the device name will be used. (Since 2.7)
  1096. #
  1097. # @device: the device name or node-name of a root node which should be copied.
  1098. #
  1099. # @target: the device name or node-name of the backup target node.
  1100. #
  1101. # @sync: what parts of the disk image should be copied to the destination
  1102. # (all the disk, only the sectors allocated in the topmost image, or
  1103. # only new I/O).
  1104. #
  1105. # @speed: the maximum speed, in bytes per second. The default is 0,
  1106. # for unlimited.
  1107. #
  1108. # @compress: true to compress data, if the target format supports it.
  1109. # (default: false) (since 2.8)
  1110. #
  1111. # @on-source-error: the action to take on an error on the source,
  1112. # default 'report'. 'stop' and 'enospc' can only be used
  1113. # if the block device supports io-status (see BlockInfo).
  1114. #
  1115. # @on-target-error: the action to take on an error on the target,
  1116. # default 'report' (no limitations, since this applies to
  1117. # a different block device than @device).
  1118. #
  1119. # Note: @on-source-error and @on-target-error only affect background
  1120. # I/O. If an error occurs during a guest write request, the device's
  1121. # rerror/werror actions will be used.
  1122. #
  1123. # Since: 2.3
  1124. ##
  1125. { 'struct': 'BlockdevBackup',
  1126. 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
  1127. 'sync': 'MirrorSyncMode',
  1128. '*speed': 'int',
  1129. '*compress': 'bool',
  1130. '*on-source-error': 'BlockdevOnError',
  1131. '*on-target-error': 'BlockdevOnError' } }
  1132. ##
  1133. # @blockdev-snapshot-sync:
  1134. #
  1135. # Generates a synchronous snapshot of a block device.
  1136. #
  1137. # For the arguments, see the documentation of BlockdevSnapshotSync.
  1138. #
  1139. # Returns: nothing on success
  1140. # If @device is not a valid block device, DeviceNotFound
  1141. #
  1142. # Since: 0.14.0
  1143. #
  1144. # Example:
  1145. #
  1146. # -> { "execute": "blockdev-snapshot-sync",
  1147. # "arguments": { "device": "ide-hd0",
  1148. # "snapshot-file":
  1149. # "/some/place/my-image",
  1150. # "format": "qcow2" } }
  1151. # <- { "return": {} }
  1152. #
  1153. ##
  1154. { 'command': 'blockdev-snapshot-sync',
  1155. 'data': 'BlockdevSnapshotSync' }
  1156. ##
  1157. # @blockdev-snapshot:
  1158. #
  1159. # Generates a snapshot of a block device.
  1160. #
  1161. # Create a snapshot, by installing 'node' as the backing image of
  1162. # 'overlay'. Additionally, if 'node' is associated with a block
  1163. # device, the block device changes to using 'overlay' as its new active
  1164. # image.
  1165. #
  1166. # For the arguments, see the documentation of BlockdevSnapshot.
  1167. #
  1168. # Since: 2.5
  1169. #
  1170. # Example:
  1171. #
  1172. # -> { "execute": "blockdev-add",
  1173. # "arguments": { "driver": "qcow2",
  1174. # "node-name": "node1534",
  1175. # "file": { "driver": "file",
  1176. # "filename": "hd1.qcow2" },
  1177. # "backing": "" } }
  1178. #
  1179. # <- { "return": {} }
  1180. #
  1181. # -> { "execute": "blockdev-snapshot",
  1182. # "arguments": { "node": "ide-hd0",
  1183. # "overlay": "node1534" } }
  1184. # <- { "return": {} }
  1185. #
  1186. ##
  1187. { 'command': 'blockdev-snapshot',
  1188. 'data': 'BlockdevSnapshot' }
  1189. ##
  1190. # @change-backing-file:
  1191. #
  1192. # Change the backing file in the image file metadata. This does not
  1193. # cause QEMU to reopen the image file to reparse the backing filename
  1194. # (it may, however, perform a reopen to change permissions from
  1195. # r/o -> r/w -> r/o, if needed). The new backing file string is written
  1196. # into the image file metadata, and the QEMU internal strings are
  1197. # updated.
  1198. #
  1199. # @image-node-name: The name of the block driver state node of the
  1200. # image to modify. The "device" argument is used
  1201. # to verify "image-node-name" is in the chain
  1202. # described by "device".
  1203. #
  1204. # @device: The device name or node-name of the root node that owns
  1205. # image-node-name.
  1206. #
  1207. # @backing-file: The string to write as the backing file. This
  1208. # string is not validated, so care should be taken
  1209. # when specifying the string or the image chain may
  1210. # not be able to be reopened again.
  1211. #
  1212. # Returns: Nothing on success
  1213. #
  1214. # If "device" does not exist or cannot be determined, DeviceNotFound
  1215. #
  1216. # Since: 2.1
  1217. ##
  1218. { 'command': 'change-backing-file',
  1219. 'data': { 'device': 'str', 'image-node-name': 'str',
  1220. 'backing-file': 'str' } }
  1221. ##
  1222. # @block-commit:
  1223. #
  1224. # Live commit of data from overlay image nodes into backing nodes - i.e.,
  1225. # writes data between 'top' and 'base' into 'base'.
  1226. #
  1227. # @job-id: identifier for the newly-created block job. If
  1228. # omitted, the device name will be used. (Since 2.7)
  1229. #
  1230. # @device: the device name or node-name of a root node
  1231. #
  1232. # @base: The file name of the backing image to write data into.
  1233. # If not specified, this is the deepest backing image.
  1234. #
  1235. # @top: The file name of the backing image within the image chain,
  1236. # which contains the topmost data to be committed down. If
  1237. # not specified, this is the active layer.
  1238. #
  1239. # @backing-file: The backing file string to write into the overlay
  1240. # image of 'top'. If 'top' is the active layer,
  1241. # specifying a backing file string is an error. This
  1242. # filename is not validated.
  1243. #
  1244. # If a pathname string is such that it cannot be
  1245. # resolved by QEMU, that means that subsequent QMP or
  1246. # HMP commands must use node-names for the image in
  1247. # question, as filename lookup methods will fail.
  1248. #
  1249. # If not specified, QEMU will automatically determine
  1250. # the backing file string to use, or error out if
  1251. # there is no obvious choice. Care should be taken
  1252. # when specifying the string, to specify a valid
  1253. # filename or protocol.
  1254. # (Since 2.1)
  1255. #
  1256. # If top == base, that is an error.
  1257. # If top == active, the job will not be completed by itself,
  1258. # user needs to complete the job with the block-job-complete
  1259. # command after getting the ready event. (Since 2.0)
  1260. #
  1261. # If the base image is smaller than top, then the base image
  1262. # will be resized to be the same size as top. If top is
  1263. # smaller than the base image, the base will not be
  1264. # truncated. If you want the base image size to match the
  1265. # size of the smaller top, you can safely truncate it
  1266. # yourself once the commit operation successfully completes.
  1267. #
  1268. # @speed: the maximum speed, in bytes per second
  1269. #
  1270. # @filter-node-name: the node name that should be assigned to the
  1271. # filter driver that the commit job inserts into the graph
  1272. # above @top. If this option is not given, a node name is
  1273. # autogenerated. (Since: 2.9)
  1274. #
  1275. # Returns: Nothing on success
  1276. # If commit or stream is already active on this device, DeviceInUse
  1277. # If @device does not exist, DeviceNotFound
  1278. # If image commit is not supported by this device, NotSupported
  1279. # If @base or @top is invalid, a generic error is returned
  1280. # If @speed is invalid, InvalidParameter
  1281. #
  1282. # Since: 1.3
  1283. #
  1284. # Example:
  1285. #
  1286. # -> { "execute": "block-commit",
  1287. # "arguments": { "device": "virtio0",
  1288. # "top": "/tmp/snap1.qcow2" } }
  1289. # <- { "return": {} }
  1290. #
  1291. ##
  1292. { 'command': 'block-commit',
  1293. 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
  1294. '*backing-file': 'str', '*speed': 'int',
  1295. '*filter-node-name': 'str' } }
  1296. ##
  1297. # @drive-backup:
  1298. #
  1299. # Start a point-in-time copy of a block device to a new destination. The
  1300. # status of ongoing drive-backup operations can be checked with
  1301. # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
  1302. # The operation can be stopped before it has completed using the
  1303. # block-job-cancel command.
  1304. #
  1305. # Returns: nothing on success
  1306. # If @device is not a valid block device, GenericError
  1307. #
  1308. # Since: 1.6
  1309. #
  1310. # Example:
  1311. #
  1312. # -> { "execute": "drive-backup",
  1313. # "arguments": { "device": "drive0",
  1314. # "sync": "full",
  1315. # "target": "backup.img" } }
  1316. # <- { "return": {} }
  1317. #
  1318. ##
  1319. { 'command': 'drive-backup', 'boxed': true,
  1320. 'data': 'DriveBackup' }
  1321. ##
  1322. # @blockdev-backup:
  1323. #
  1324. # Start a point-in-time copy of a block device to a new destination. The
  1325. # status of ongoing blockdev-backup operations can be checked with
  1326. # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
  1327. # The operation can be stopped before it has completed using the
  1328. # block-job-cancel command.
  1329. #
  1330. # Returns: nothing on success
  1331. # If @device is not a valid block device, DeviceNotFound
  1332. #
  1333. # Since: 2.3
  1334. #
  1335. # Example:
  1336. # -> { "execute": "blockdev-backup",
  1337. # "arguments": { "device": "src-id",
  1338. # "sync": "full",
  1339. # "target": "tgt-id" } }
  1340. # <- { "return": {} }
  1341. #
  1342. ##
  1343. { 'command': 'blockdev-backup', 'boxed': true,
  1344. 'data': 'BlockdevBackup' }
  1345. ##
  1346. # @query-named-block-nodes:
  1347. #
  1348. # Get the named block driver list
  1349. #
  1350. # Returns: the list of BlockDeviceInfo
  1351. #
  1352. # Since: 2.0
  1353. #
  1354. # Example:
  1355. #
  1356. # -> { "execute": "query-named-block-nodes" }
  1357. # <- { "return": [ { "ro":false,
  1358. # "drv":"qcow2",
  1359. # "encrypted":false,
  1360. # "file":"disks/test.qcow2",
  1361. # "node-name": "my-node",
  1362. # "backing_file_depth":1,
  1363. # "bps":1000000,
  1364. # "bps_rd":0,
  1365. # "bps_wr":0,
  1366. # "iops":1000000,
  1367. # "iops_rd":0,
  1368. # "iops_wr":0,
  1369. # "bps_max": 8000000,
  1370. # "bps_rd_max": 0,
  1371. # "bps_wr_max": 0,
  1372. # "iops_max": 0,
  1373. # "iops_rd_max": 0,
  1374. # "iops_wr_max": 0,
  1375. # "iops_size": 0,
  1376. # "write_threshold": 0,
  1377. # "image":{
  1378. # "filename":"disks/test.qcow2",
  1379. # "format":"qcow2",
  1380. # "virtual-size":2048000,
  1381. # "backing_file":"base.qcow2",
  1382. # "full-backing-filename":"disks/base.qcow2",
  1383. # "backing-filename-format":"qcow2",
  1384. # "snapshots":[
  1385. # {
  1386. # "id": "1",
  1387. # "name": "snapshot1",
  1388. # "vm-state-size": 0,
  1389. # "date-sec": 10000200,
  1390. # "date-nsec": 12,
  1391. # "vm-clock-sec": 206,
  1392. # "vm-clock-nsec": 30
  1393. # }
  1394. # ],
  1395. # "backing-image":{
  1396. # "filename":"disks/base.qcow2",
  1397. # "format":"qcow2",
  1398. # "virtual-size":2048000
  1399. # }
  1400. # } } ] }
  1401. #
  1402. ##
  1403. { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
  1404. ##
  1405. # @drive-mirror:
  1406. #
  1407. # Start mirroring a block device's writes to a new destination. target
  1408. # specifies the target of the new image. If the file exists, or if it
  1409. # is a device, it will be used as the new destination for writes. If
  1410. # it does not exist, a new file will be created. format specifies the
  1411. # format of the mirror image, default is to probe if mode='existing',
  1412. # else the format of the source.
  1413. #
  1414. # Returns: nothing on success
  1415. # If @device is not a valid block device, GenericError
  1416. #
  1417. # Since: 1.3
  1418. #
  1419. # Example:
  1420. #
  1421. # -> { "execute": "drive-mirror",
  1422. # "arguments": { "device": "ide-hd0",
  1423. # "target": "/some/place/my-image",
  1424. # "sync": "full",
  1425. # "format": "qcow2" } }
  1426. # <- { "return": {} }
  1427. #
  1428. ##
  1429. { 'command': 'drive-mirror', 'boxed': true,
  1430. 'data': 'DriveMirror' }
  1431. ##
  1432. # @DriveMirror:
  1433. #
  1434. # A set of parameters describing drive mirror setup.
  1435. #
  1436. # @job-id: identifier for the newly-created block job. If
  1437. # omitted, the device name will be used. (Since 2.7)
  1438. #
  1439. # @device: the device name or node-name of a root node whose writes should be
  1440. # mirrored.
  1441. #
  1442. # @target: the target of the new image. If the file exists, or if it
  1443. # is a device, the existing file/device will be used as the new
  1444. # destination. If it does not exist, a new file will be created.
  1445. #
  1446. # @format: the format of the new destination, default is to
  1447. # probe if @mode is 'existing', else the format of the source
  1448. #
  1449. # @node-name: the new block driver state node name in the graph
  1450. # (Since 2.1)
  1451. #
  1452. # @replaces: with sync=full graph node name to be replaced by the new
  1453. # image when a whole image copy is done. This can be used to repair
  1454. # broken Quorum files. (Since 2.1)
  1455. #
  1456. # @mode: whether and how QEMU should create a new image, default is
  1457. # 'absolute-paths'.
  1458. #
  1459. # @speed: the maximum speed, in bytes per second
  1460. #
  1461. # @sync: what parts of the disk image should be copied to the destination
  1462. # (all the disk, only the sectors allocated in the topmost image, or
  1463. # only new I/O).
  1464. #
  1465. # @granularity: granularity of the dirty bitmap, default is 64K
  1466. # if the image format doesn't have clusters, 4K if the clusters
  1467. # are smaller than that, else the cluster size. Must be a
  1468. # power of 2 between 512 and 64M (since 1.4).
  1469. #
  1470. # @buf-size: maximum amount of data in flight from source to
  1471. # target (since 1.4).
  1472. #
  1473. # @on-source-error: the action to take on an error on the source,
  1474. # default 'report'. 'stop' and 'enospc' can only be used
  1475. # if the block device supports io-status (see BlockInfo).
  1476. #
  1477. # @on-target-error: the action to take on an error on the target,
  1478. # default 'report' (no limitations, since this applies to
  1479. # a different block device than @device).
  1480. # @unmap: Whether to try to unmap target sectors where source has
  1481. # only zero. If true, and target unallocated sectors will read as zero,
  1482. # target image sectors will be unmapped; otherwise, zeroes will be
  1483. # written. Both will result in identical contents.
  1484. # Default is true. (Since 2.4)
  1485. #
  1486. # Since: 1.3
  1487. ##
  1488. { 'struct': 'DriveMirror',
  1489. 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
  1490. '*format': 'str', '*node-name': 'str', '*replaces': 'str',
  1491. 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
  1492. '*speed': 'int', '*granularity': 'uint32',
  1493. '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
  1494. '*on-target-error': 'BlockdevOnError',
  1495. '*unmap': 'bool' } }
  1496. ##
  1497. # @BlockDirtyBitmap:
  1498. #
  1499. # @node: name of device/node which the bitmap is tracking
  1500. #
  1501. # @name: name of the dirty bitmap
  1502. #
  1503. # Since: 2.4
  1504. ##
  1505. { 'struct': 'BlockDirtyBitmap',
  1506. 'data': { 'node': 'str', 'name': 'str' } }
  1507. ##
  1508. # @BlockDirtyBitmapAdd:
  1509. #
  1510. # @node: name of device/node which the bitmap is tracking
  1511. #
  1512. # @name: name of the dirty bitmap
  1513. #
  1514. # @granularity: the bitmap granularity, default is 64k for
  1515. # block-dirty-bitmap-add
  1516. #
  1517. # Since: 2.4
  1518. ##
  1519. { 'struct': 'BlockDirtyBitmapAdd',
  1520. 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32' } }
  1521. ##
  1522. # @block-dirty-bitmap-add:
  1523. #
  1524. # Create a dirty bitmap with a name on the node, and start tracking the writes.
  1525. #
  1526. # Returns: nothing on success
  1527. # If @node is not a valid block device or node, DeviceNotFound
  1528. # If @name is already taken, GenericError with an explanation
  1529. #
  1530. # Since: 2.4
  1531. #
  1532. # Example:
  1533. #
  1534. # -> { "execute": "block-dirty-bitmap-add",
  1535. # "arguments": { "node": "drive0", "name": "bitmap0" } }
  1536. # <- { "return": {} }
  1537. #
  1538. ##
  1539. { 'command': 'block-dirty-bitmap-add',
  1540. 'data': 'BlockDirtyBitmapAdd' }
  1541. ##
  1542. # @block-dirty-bitmap-remove:
  1543. #
  1544. # Stop write tracking and remove the dirty bitmap that was created
  1545. # with block-dirty-bitmap-add.
  1546. #
  1547. # Returns: nothing on success
  1548. # If @node is not a valid block device or node, DeviceNotFound
  1549. # If @name is not found, GenericError with an explanation
  1550. # if @name is frozen by an operation, GenericError
  1551. #
  1552. # Since: 2.4
  1553. #
  1554. # Example:
  1555. #
  1556. # -> { "execute": "block-dirty-bitmap-remove",
  1557. # "arguments": { "node": "drive0", "name": "bitmap0" } }
  1558. # <- { "return": {} }
  1559. #
  1560. ##
  1561. { 'command': 'block-dirty-bitmap-remove',
  1562. 'data': 'BlockDirtyBitmap' }
  1563. ##
  1564. # @block-dirty-bitmap-clear:
  1565. #
  1566. # Clear (reset) a dirty bitmap on the device, so that an incremental
  1567. # backup from this point in time forward will only backup clusters
  1568. # modified after this clear operation.
  1569. #
  1570. # Returns: nothing on success
  1571. # If @node is not a valid block device, DeviceNotFound
  1572. # If @name is not found, GenericError with an explanation
  1573. #
  1574. # Since: 2.4
  1575. #
  1576. # Example:
  1577. #
  1578. # -> { "execute": "block-dirty-bitmap-clear",
  1579. # "arguments": { "node": "drive0", "name": "bitmap0" } }
  1580. # <- { "return": {} }
  1581. #
  1582. ##
  1583. { 'command': 'block-dirty-bitmap-clear',
  1584. 'data': 'BlockDirtyBitmap' }
  1585. ##
  1586. # @blockdev-mirror:
  1587. #
  1588. # Start mirroring a block device's writes to a new destination.
  1589. #
  1590. # @job-id: identifier for the newly-created block job. If
  1591. # omitted, the device name will be used. (Since 2.7)
  1592. #
  1593. # @device: The device name or node-name of a root node whose writes should be
  1594. # mirrored.
  1595. #
  1596. # @target: the id or node-name of the block device to mirror to. This mustn't be
  1597. # attached to guest.
  1598. #
  1599. # @replaces: with sync=full graph node name to be replaced by the new
  1600. # image when a whole image copy is done. This can be used to repair
  1601. # broken Quorum files.
  1602. #
  1603. # @speed: the maximum speed, in bytes per second
  1604. #
  1605. # @sync: what parts of the disk image should be copied to the destination
  1606. # (all the disk, only the sectors allocated in the topmost image, or
  1607. # only new I/O).
  1608. #
  1609. # @granularity: granularity of the dirty bitmap, default is 64K
  1610. # if the image format doesn't have clusters, 4K if the clusters
  1611. # are smaller than that, else the cluster size. Must be a
  1612. # power of 2 between 512 and 64M
  1613. #
  1614. # @buf-size: maximum amount of data in flight from source to
  1615. # target
  1616. #
  1617. # @on-source-error: the action to take on an error on the source,
  1618. # default 'report'. 'stop' and 'enospc' can only be used
  1619. # if the block device supports io-status (see BlockInfo).
  1620. #
  1621. # @on-target-error: the action to take on an error on the target,
  1622. # default 'report' (no limitations, since this applies to
  1623. # a different block device than @device).
  1624. #
  1625. # @filter-node-name: the node name that should be assigned to the
  1626. # filter driver that the mirror job inserts into the graph
  1627. # above @device. If this option is not given, a node name is
  1628. # autogenerated. (Since: 2.9)
  1629. #
  1630. # Returns: nothing on success.
  1631. #
  1632. # Since: 2.6
  1633. #
  1634. # Example:
  1635. #
  1636. # -> { "execute": "blockdev-mirror",
  1637. # "arguments": { "device": "ide-hd0",
  1638. # "target": "target0",
  1639. # "sync": "full" } }
  1640. # <- { "return": {} }
  1641. #
  1642. ##
  1643. { 'command': 'blockdev-mirror',
  1644. 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
  1645. '*replaces': 'str',
  1646. 'sync': 'MirrorSyncMode',
  1647. '*speed': 'int', '*granularity': 'uint32',
  1648. '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
  1649. '*on-target-error': 'BlockdevOnError',
  1650. '*filter-node-name': 'str' } }
  1651. ##
  1652. # @block_set_io_throttle:
  1653. #
  1654. # Change I/O throttle limits for a block drive.
  1655. #
  1656. # Since QEMU 2.4, each device with I/O limits is member of a throttle
  1657. # group.
  1658. #
  1659. # If two or more devices are members of the same group, the limits
  1660. # will apply to the combined I/O of the whole group in a round-robin
  1661. # fashion. Therefore, setting new I/O limits to a device will affect
  1662. # the whole group.
  1663. #
  1664. # The name of the group can be specified using the 'group' parameter.
  1665. # If the parameter is unset, it is assumed to be the current group of
  1666. # that device. If it's not in any group yet, the name of the device
  1667. # will be used as the name for its group.
  1668. #
  1669. # The 'group' parameter can also be used to move a device to a
  1670. # different group. In this case the limits specified in the parameters
  1671. # will be applied to the new group only.
  1672. #
  1673. # I/O limits can be disabled by setting all of them to 0. In this case
  1674. # the device will be removed from its group and the rest of its
  1675. # members will not be affected. The 'group' parameter is ignored.
  1676. #
  1677. # Returns: Nothing on success
  1678. # If @device is not a valid block device, DeviceNotFound
  1679. #
  1680. # Since: 1.1
  1681. #
  1682. # Example:
  1683. #
  1684. # -> { "execute": "block_set_io_throttle",
  1685. # "arguments": { "id": "ide0-1-0",
  1686. # "bps": 1000000,
  1687. # "bps_rd": 0,
  1688. # "bps_wr": 0,
  1689. # "iops": 0,
  1690. # "iops_rd": 0,
  1691. # "iops_wr": 0,
  1692. # "bps_max": 8000000,
  1693. # "bps_rd_max": 0,
  1694. # "bps_wr_max": 0,
  1695. # "iops_max": 0,
  1696. # "iops_rd_max": 0,
  1697. # "iops_wr_max": 0,
  1698. # "bps_max_length": 60,
  1699. # "iops_size": 0 } }
  1700. # <- { "return": {} }
  1701. ##
  1702. { 'command': 'block_set_io_throttle', 'boxed': true,
  1703. 'data': 'BlockIOThrottle' }
  1704. ##
  1705. # @BlockIOThrottle:
  1706. #
  1707. # A set of parameters describing block throttling.
  1708. #
  1709. # @device: Block device name (deprecated, use @id instead)
  1710. #
  1711. # @id: The name or QOM path of the guest device (since: 2.8)
  1712. #
  1713. # @bps: total throughput limit in bytes per second
  1714. #
  1715. # @bps_rd: read throughput limit in bytes per second
  1716. #
  1717. # @bps_wr: write throughput limit in bytes per second
  1718. #
  1719. # @iops: total I/O operations per second
  1720. #
  1721. # @iops_rd: read I/O operations per second
  1722. #
  1723. # @iops_wr: write I/O operations per second
  1724. #
  1725. # @bps_max: total throughput limit during bursts,
  1726. # in bytes (Since 1.7)
  1727. #
  1728. # @bps_rd_max: read throughput limit during bursts,
  1729. # in bytes (Since 1.7)
  1730. #
  1731. # @bps_wr_max: write throughput limit during bursts,
  1732. # in bytes (Since 1.7)
  1733. #
  1734. # @iops_max: total I/O operations per second during bursts,
  1735. # in bytes (Since 1.7)
  1736. #
  1737. # @iops_rd_max: read I/O operations per second during bursts,
  1738. # in bytes (Since 1.7)
  1739. #
  1740. # @iops_wr_max: write I/O operations per second during bursts,
  1741. # in bytes (Since 1.7)
  1742. #
  1743. # @bps_max_length: maximum length of the @bps_max burst
  1744. # period, in seconds. It must only
  1745. # be set if @bps_max is set as well.
  1746. # Defaults to 1. (Since 2.6)
  1747. #
  1748. # @bps_rd_max_length: maximum length of the @bps_rd_max
  1749. # burst period, in seconds. It must only
  1750. # be set if @bps_rd_max is set as well.
  1751. # Defaults to 1. (Since 2.6)
  1752. #
  1753. # @bps_wr_max_length: maximum length of the @bps_wr_max
  1754. # burst period, in seconds. It must only
  1755. # be set if @bps_wr_max is set as well.
  1756. # Defaults to 1. (Since 2.6)
  1757. #
  1758. # @iops_max_length: maximum length of the @iops burst
  1759. # period, in seconds. It must only
  1760. # be set if @iops_max is set as well.
  1761. # Defaults to 1. (Since 2.6)
  1762. #
  1763. # @iops_rd_max_length: maximum length of the @iops_rd_max
  1764. # burst period, in seconds. It must only
  1765. # be set if @iops_rd_max is set as well.
  1766. # Defaults to 1. (Since 2.6)
  1767. #
  1768. # @iops_wr_max_length: maximum length of the @iops_wr_max
  1769. # burst period, in seconds. It must only
  1770. # be set if @iops_wr_max is set as well.
  1771. # Defaults to 1. (Since 2.6)
  1772. #
  1773. # @iops_size: an I/O size in bytes (Since 1.7)
  1774. #
  1775. # @group: throttle group name (Since 2.4)
  1776. #
  1777. # Since: 1.1
  1778. ##
  1779. { 'struct': 'BlockIOThrottle',
  1780. 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
  1781. 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
  1782. '*bps_max': 'int', '*bps_rd_max': 'int',
  1783. '*bps_wr_max': 'int', '*iops_max': 'int',
  1784. '*iops_rd_max': 'int', '*iops_wr_max': 'int',
  1785. '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
  1786. '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
  1787. '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
  1788. '*iops_size': 'int', '*group': 'str' } }
  1789. ##
  1790. # @block-stream:
  1791. #
  1792. # Copy data from a backing file into a block device.
  1793. #
  1794. # The block streaming operation is performed in the background until the entire
  1795. # backing file has been copied. This command returns immediately once streaming
  1796. # has started. The status of ongoing block streaming operations can be checked
  1797. # with query-block-jobs. The operation can be stopped before it has completed
  1798. # using the block-job-cancel command.
  1799. #
  1800. # The node that receives the data is called the top image, can be located in
  1801. # any part of the chain (but always above the base image; see below) and can be
  1802. # specified using its device or node name. Earlier qemu versions only allowed
  1803. # 'device' to name the top level node; presence of the 'base-node' parameter
  1804. # during introspection can be used as a witness of the enhanced semantics
  1805. # of 'device'.
  1806. #
  1807. # If a base file is specified then sectors are not copied from that base file and
  1808. # its backing chain. When streaming completes the image file will have the base
  1809. # file as its backing file. This can be used to stream a subset of the backing
  1810. # file chain instead of flattening the entire image.
  1811. #
  1812. # On successful completion the image file is updated to drop the backing file
  1813. # and the BLOCK_JOB_COMPLETED event is emitted.
  1814. #
  1815. # @job-id: identifier for the newly-created block job. If
  1816. # omitted, the device name will be used. (Since 2.7)
  1817. #
  1818. # @device: the device or node name of the top image
  1819. #
  1820. # @base: the common backing file name.
  1821. # It cannot be set if @base-node is also set.
  1822. #
  1823. # @base-node: the node name of the backing file.
  1824. # It cannot be set if @base is also set. (Since 2.8)
  1825. #
  1826. # @backing-file: The backing file string to write into the top
  1827. # image. This filename is not validated.
  1828. #
  1829. # If a pathname string is such that it cannot be
  1830. # resolved by QEMU, that means that subsequent QMP or
  1831. # HMP commands must use node-names for the image in
  1832. # question, as filename lookup methods will fail.
  1833. #
  1834. # If not specified, QEMU will automatically determine
  1835. # the backing file string to use, or error out if there
  1836. # is no obvious choice. Care should be taken when
  1837. # specifying the string, to specify a valid filename or
  1838. # protocol.
  1839. # (Since 2.1)
  1840. #
  1841. # @speed: the maximum speed, in bytes per second
  1842. #
  1843. # @on-error: the action to take on an error (default report).
  1844. # 'stop' and 'enospc' can only be used if the block device
  1845. # supports io-status (see BlockInfo). Since 1.3.
  1846. #
  1847. # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
  1848. #
  1849. # Since: 1.1
  1850. #
  1851. # Example:
  1852. #
  1853. # -> { "execute": "block-stream",
  1854. # "arguments": { "device": "virtio0",
  1855. # "base": "/tmp/master.qcow2" } }
  1856. # <- { "return": {} }
  1857. #
  1858. ##
  1859. { 'command': 'block-stream',
  1860. 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
  1861. '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
  1862. '*on-error': 'BlockdevOnError' } }
  1863. ##
  1864. # @block-job-set-speed:
  1865. #
  1866. # Set maximum speed for a background block operation.
  1867. #
  1868. # This command can only be issued when there is an active block job.
  1869. #
  1870. # Throttling can be disabled by setting the speed to 0.
  1871. #
  1872. # @device: The job identifier. This used to be a device name (hence
  1873. # the name of the parameter), but since QEMU 2.7 it can have
  1874. # other values.
  1875. #
  1876. # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
  1877. # Defaults to 0.
  1878. #
  1879. # Returns: Nothing on success
  1880. # If no background operation is active on this device, DeviceNotActive
  1881. #
  1882. # Since: 1.1
  1883. ##
  1884. { 'command': 'block-job-set-speed',
  1885. 'data': { 'device': 'str', 'speed': 'int' } }
  1886. ##
  1887. # @block-job-cancel:
  1888. #
  1889. # Stop an active background block operation.
  1890. #
  1891. # This command returns immediately after marking the active background block
  1892. # operation for cancellation. It is an error to call this command if no
  1893. # operation is in progress.
  1894. #
  1895. # The operation will cancel as soon as possible and then emit the
  1896. # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
  1897. # enumerated using query-block-jobs.
  1898. #
  1899. # For streaming, the image file retains its backing file unless the streaming
  1900. # operation happens to complete just as it is being cancelled. A new streaming
  1901. # operation can be started at a later time to finish copying all data from the
  1902. # backing file.
  1903. #
  1904. # @device: The job identifier. This used to be a device name (hence
  1905. # the name of the parameter), but since QEMU 2.7 it can have
  1906. # other values.
  1907. #
  1908. # @force: whether to allow cancellation of a paused job (default
  1909. # false). Since 1.3.
  1910. #
  1911. # Returns: Nothing on success
  1912. # If no background operation is active on this device, DeviceNotActive
  1913. #
  1914. # Since: 1.1
  1915. ##
  1916. { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
  1917. ##
  1918. # @block-job-pause:
  1919. #
  1920. # Pause an active background block operation.
  1921. #
  1922. # This command returns immediately after marking the active background block
  1923. # operation for pausing. It is an error to call this command if no
  1924. # operation is in progress. Pausing an already paused job has no cumulative
  1925. # effect; a single block-job-resume command will resume the job.
  1926. #
  1927. # The operation will pause as soon as possible. No event is emitted when
  1928. # the operation is actually paused. Cancelling a paused job automatically
  1929. # resumes it.
  1930. #
  1931. # @device: The job identifier. This used to be a device name (hence
  1932. # the name of the parameter), but since QEMU 2.7 it can have
  1933. # other values.
  1934. #
  1935. # Returns: Nothing on success
  1936. # If no background operation is active on this device, DeviceNotActive
  1937. #
  1938. # Since: 1.3
  1939. ##
  1940. { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
  1941. ##
  1942. # @block-job-resume:
  1943. #
  1944. # Resume an active background block operation.
  1945. #
  1946. # This command returns immediately after resuming a paused background block
  1947. # operation. It is an error to call this command if no operation is in
  1948. # progress. Resuming an already running job is not an error.
  1949. #
  1950. # This command also clears the error status of the job.
  1951. #
  1952. # @device: The job identifier. This used to be a device name (hence
  1953. # the name of the parameter), but since QEMU 2.7 it can have
  1954. # other values.
  1955. #
  1956. # Returns: Nothing on success
  1957. # If no background operation is active on this device, DeviceNotActive
  1958. #
  1959. # Since: 1.3
  1960. ##
  1961. { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
  1962. ##
  1963. # @block-job-complete:
  1964. #
  1965. # Manually trigger completion of an active background block operation. This
  1966. # is supported for drive mirroring, where it also switches the device to
  1967. # write to the target path only. The ability to complete is signaled with
  1968. # a BLOCK_JOB_READY event.
  1969. #
  1970. # This command completes an active background block operation synchronously.
  1971. # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
  1972. # is not defined. Note that if an I/O error occurs during the processing of
  1973. # this command: 1) the command itself will fail; 2) the error will be processed
  1974. # according to the rerror/werror arguments that were specified when starting
  1975. # the operation.
  1976. #
  1977. # A cancelled or paused job cannot be completed.
  1978. #
  1979. # @device: The job identifier. This used to be a device name (hence
  1980. # the name of the parameter), but since QEMU 2.7 it can have
  1981. # other values.
  1982. #
  1983. # Returns: Nothing on success
  1984. # If no background operation is active on this device, DeviceNotActive
  1985. #
  1986. # Since: 1.3
  1987. ##
  1988. { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
  1989. ##
  1990. # @BlockdevDiscardOptions:
  1991. #
  1992. # Determines how to handle discard requests.
  1993. #
  1994. # @ignore: Ignore the request
  1995. # @unmap: Forward as an unmap request
  1996. #
  1997. # Since: 2.9
  1998. ##
  1999. { 'enum': 'BlockdevDiscardOptions',
  2000. 'data': [ 'ignore', 'unmap' ] }
  2001. ##
  2002. # @BlockdevDetectZeroesOptions:
  2003. #
  2004. # Describes the operation mode for the automatic conversion of plain
  2005. # zero writes by the OS to driver specific optimized zero write commands.
  2006. #
  2007. # @off: Disabled (default)
  2008. # @on: Enabled
  2009. # @unmap: Enabled and even try to unmap blocks if possible. This requires
  2010. # also that @BlockdevDiscardOptions is set to unmap for this device.
  2011. #
  2012. # Since: 2.1
  2013. ##
  2014. { 'enum': 'BlockdevDetectZeroesOptions',
  2015. 'data': [ 'off', 'on', 'unmap' ] }
  2016. ##
  2017. # @BlockdevAioOptions:
  2018. #
  2019. # Selects the AIO backend to handle I/O requests
  2020. #
  2021. # @threads: Use qemu's thread pool
  2022. # @native: Use native AIO backend (only Linux and Windows)
  2023. #
  2024. # Since: 2.9
  2025. ##
  2026. { 'enum': 'BlockdevAioOptions',
  2027. 'data': [ 'threads', 'native' ] }
  2028. ##
  2029. # @BlockdevCacheOptions:
  2030. #
  2031. # Includes cache-related options for block devices
  2032. #
  2033. # @direct: enables use of O_DIRECT (bypass the host page cache;
  2034. # default: false)
  2035. # @no-flush: ignore any flush requests for the device (default:
  2036. # false)
  2037. #
  2038. # Since: 2.9
  2039. ##
  2040. { 'struct': 'BlockdevCacheOptions',
  2041. 'data': { '*direct': 'bool',
  2042. '*no-flush': 'bool' } }
  2043. ##
  2044. # @BlockdevDriver:
  2045. #
  2046. # Drivers that are supported in block device operations.
  2047. #
  2048. # @vxhs: Since 2.10
  2049. #
  2050. # Since: 2.9
  2051. ##
  2052. { 'enum': 'BlockdevDriver',
  2053. 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
  2054. 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
  2055. 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
  2056. 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed',
  2057. 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
  2058. 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
  2059. ##
  2060. # @BlockdevOptionsFile:
  2061. #
  2062. # Driver specific block device options for the file backend.
  2063. #
  2064. # @filename: path to the image file
  2065. # @aio: AIO backend (default: threads) (since: 2.8)
  2066. # @locking: whether to enable file locking. If set to 'auto', only enable
  2067. # when Open File Descriptor (OFD) locking API is available
  2068. # (default: auto, since 2.10)
  2069. #
  2070. # Since: 2.9
  2071. ##
  2072. { 'struct': 'BlockdevOptionsFile',
  2073. 'data': { 'filename': 'str',
  2074. '*locking': 'OnOffAuto',
  2075. '*aio': 'BlockdevAioOptions' } }
  2076. ##
  2077. # @BlockdevOptionsNull:
  2078. #
  2079. # Driver specific block device options for the null backend.
  2080. #
  2081. # @size: size of the device in bytes.
  2082. # @latency-ns: emulated latency (in nanoseconds) in processing
  2083. # requests. Default to zero which completes requests immediately.
  2084. # (Since 2.4)
  2085. #
  2086. # Since: 2.9
  2087. ##
  2088. { 'struct': 'BlockdevOptionsNull',
  2089. 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
  2090. ##
  2091. # @BlockdevOptionsVVFAT:
  2092. #
  2093. # Driver specific block device options for the vvfat protocol.
  2094. #
  2095. # @dir: directory to be exported as FAT image
  2096. # @fat-type: FAT type: 12, 16 or 32
  2097. # @floppy: whether to export a floppy image (true) or
  2098. # partitioned hard disk (false; default)
  2099. # @label: set the volume label, limited to 11 bytes. FAT16 and
  2100. # FAT32 traditionally have some restrictions on labels, which are
  2101. # ignored by most operating systems. Defaults to "QEMU VVFAT".
  2102. # (since 2.4)
  2103. # @rw: whether to allow write operations (default: false)
  2104. #
  2105. # Since: 2.9
  2106. ##
  2107. { 'struct': 'BlockdevOptionsVVFAT',
  2108. 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
  2109. '*label': 'str', '*rw': 'bool' } }
  2110. ##
  2111. # @BlockdevOptionsGenericFormat:
  2112. #
  2113. # Driver specific block device options for image format that have no option
  2114. # besides their data source.
  2115. #
  2116. # @file: reference to or definition of the data source block device
  2117. #
  2118. # Since: 2.9
  2119. ##
  2120. { 'struct': 'BlockdevOptionsGenericFormat',
  2121. 'data': { 'file': 'BlockdevRef' } }
  2122. ##
  2123. # @BlockdevOptionsLUKS:
  2124. #
  2125. # Driver specific block device options for LUKS.
  2126. #
  2127. # @key-secret: the ID of a QCryptoSecret object providing
  2128. # the decryption key (since 2.6). Mandatory except when
  2129. # doing a metadata-only probe of the image.
  2130. #
  2131. # Since: 2.9
  2132. ##
  2133. { 'struct': 'BlockdevOptionsLUKS',
  2134. 'base': 'BlockdevOptionsGenericFormat',
  2135. 'data': { '*key-secret': 'str' } }
  2136. ##
  2137. # @BlockdevOptionsGenericCOWFormat:
  2138. #
  2139. # Driver specific block device options for image format that have no option
  2140. # besides their data source and an optional backing file.
  2141. #
  2142. # @backing: reference to or definition of the backing file block
  2143. # device (if missing, taken from the image file content). It is
  2144. # allowed to pass an empty string here in order to disable the
  2145. # default backing file.
  2146. #
  2147. # Since: 2.9
  2148. ##
  2149. { 'struct': 'BlockdevOptionsGenericCOWFormat',
  2150. 'base': 'BlockdevOptionsGenericFormat',
  2151. 'data': { '*backing': 'BlockdevRef' } }
  2152. ##
  2153. # @Qcow2OverlapCheckMode:
  2154. #
  2155. # General overlap check modes.
  2156. #
  2157. # @none: Do not perform any checks
  2158. #
  2159. # @constant: Perform only checks which can be done in constant time and
  2160. # without reading anything from disk
  2161. #
  2162. # @cached: Perform only checks which can be done without reading anything
  2163. # from disk
  2164. #
  2165. # @all: Perform all available overlap checks
  2166. #
  2167. # Since: 2.9
  2168. ##
  2169. { 'enum': 'Qcow2OverlapCheckMode',
  2170. 'data': [ 'none', 'constant', 'cached', 'all' ] }
  2171. ##
  2172. # @Qcow2OverlapCheckFlags:
  2173. #
  2174. # Structure of flags for each metadata structure. Setting a field to 'true'
  2175. # makes qemu guard that structure against unintended overwriting. The default
  2176. # value is chosen according to the template given.
  2177. #
  2178. # @template: Specifies a template mode which can be adjusted using the other
  2179. # flags, defaults to 'cached'
  2180. #
  2181. # Since: 2.9
  2182. ##
  2183. { 'struct': 'Qcow2OverlapCheckFlags',
  2184. 'data': { '*template': 'Qcow2OverlapCheckMode',
  2185. '*main-header': 'bool',
  2186. '*active-l1': 'bool',
  2187. '*active-l2': 'bool',
  2188. '*refcount-table': 'bool',
  2189. '*refcount-block': 'bool',
  2190. '*snapshot-table': 'bool',
  2191. '*inactive-l1': 'bool',
  2192. '*inactive-l2': 'bool' } }
  2193. ##
  2194. # @Qcow2OverlapChecks:
  2195. #
  2196. # Specifies which metadata structures should be guarded against unintended
  2197. # overwriting.
  2198. #
  2199. # @flags: set of flags for separate specification of each metadata structure
  2200. # type
  2201. #
  2202. # @mode: named mode which chooses a specific set of flags
  2203. #
  2204. # Since: 2.9
  2205. ##
  2206. { 'alternate': 'Qcow2OverlapChecks',
  2207. 'data': { 'flags': 'Qcow2OverlapCheckFlags',
  2208. 'mode': 'Qcow2OverlapCheckMode' } }
  2209. ##
  2210. # @BlockdevOptionsQcow2:
  2211. #
  2212. # Driver specific block device options for qcow2.
  2213. #
  2214. # @lazy-refcounts: whether to enable the lazy refcounts
  2215. # feature (default is taken from the image file)
  2216. #
  2217. # @pass-discard-request: whether discard requests to the qcow2
  2218. # device should be forwarded to the data source
  2219. #
  2220. # @pass-discard-snapshot: whether discard requests for the data source
  2221. # should be issued when a snapshot operation (e.g.
  2222. # deleting a snapshot) frees clusters in the qcow2 file
  2223. #
  2224. # @pass-discard-other: whether discard requests for the data source
  2225. # should be issued on other occasions where a cluster
  2226. # gets freed
  2227. #
  2228. # @overlap-check: which overlap checks to perform for writes
  2229. # to the image, defaults to 'cached' (since 2.2)
  2230. #
  2231. # @cache-size: the maximum total size of the L2 table and
  2232. # refcount block caches in bytes (since 2.2)
  2233. #
  2234. # @l2-cache-size: the maximum size of the L2 table cache in
  2235. # bytes (since 2.2)
  2236. #
  2237. # @refcount-cache-size: the maximum size of the refcount block cache
  2238. # in bytes (since 2.2)
  2239. #
  2240. # @cache-clean-interval: clean unused entries in the L2 and refcount
  2241. # caches. The interval is in seconds. The default value
  2242. # is 0 and it disables this feature (since 2.5)
  2243. #
  2244. # Since: 2.9
  2245. ##
  2246. { 'struct': 'BlockdevOptionsQcow2',
  2247. 'base': 'BlockdevOptionsGenericCOWFormat',
  2248. 'data': { '*lazy-refcounts': 'bool',
  2249. '*pass-discard-request': 'bool',
  2250. '*pass-discard-snapshot': 'bool',
  2251. '*pass-discard-other': 'bool',
  2252. '*overlap-check': 'Qcow2OverlapChecks',
  2253. '*cache-size': 'int',
  2254. '*l2-cache-size': 'int',
  2255. '*refcount-cache-size': 'int',
  2256. '*cache-clean-interval': 'int' } }
  2257. ##
  2258. # @BlockdevOptionsSsh:
  2259. #
  2260. # @server: host address
  2261. #
  2262. # @path: path to the image on the host
  2263. #
  2264. # @user: user as which to connect, defaults to current
  2265. # local user name
  2266. #
  2267. # TODO: Expose the host_key_check option in QMP
  2268. #
  2269. # Since: 2.9
  2270. ##
  2271. { 'struct': 'BlockdevOptionsSsh',
  2272. 'data': { 'server': 'InetSocketAddress',
  2273. 'path': 'str',
  2274. '*user': 'str' } }
  2275. ##
  2276. # @BlkdebugEvent:
  2277. #
  2278. # Trigger events supported by blkdebug.
  2279. #
  2280. # Since: 2.9
  2281. ##
  2282. { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
  2283. 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
  2284. 'l1_grow_activate_table', 'l2_load', 'l2_update',
  2285. 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
  2286. 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
  2287. 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
  2288. 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
  2289. 'refblock_load', 'refblock_update', 'refblock_update_part',
  2290. 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
  2291. 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
  2292. 'refblock_alloc_switch_table', 'cluster_alloc',
  2293. 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
  2294. 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
  2295. 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
  2296. 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
  2297. ##
  2298. # @BlkdebugInjectErrorOptions:
  2299. #
  2300. # Describes a single error injection for blkdebug.
  2301. #
  2302. # @event: trigger event
  2303. #
  2304. # @state: the state identifier blkdebug needs to be in to
  2305. # actually trigger the event; defaults to "any"
  2306. #
  2307. # @errno: error identifier (errno) to be returned; defaults to
  2308. # EIO
  2309. #
  2310. # @sector: specifies the sector index which has to be affected
  2311. # in order to actually trigger the event; defaults to "any
  2312. # sector"
  2313. #
  2314. # @once: disables further events after this one has been
  2315. # triggered; defaults to false
  2316. #
  2317. # @immediately: fail immediately; defaults to false
  2318. #
  2319. # Since: 2.9
  2320. ##
  2321. { 'struct': 'BlkdebugInjectErrorOptions',
  2322. 'data': { 'event': 'BlkdebugEvent',
  2323. '*state': 'int',
  2324. '*errno': 'int',
  2325. '*sector': 'int',
  2326. '*once': 'bool',
  2327. '*immediately': 'bool' } }
  2328. ##
  2329. # @BlkdebugSetStateOptions:
  2330. #
  2331. # Describes a single state-change event for blkdebug.
  2332. #
  2333. # @event: trigger event
  2334. #
  2335. # @state: the current state identifier blkdebug needs to be in;
  2336. # defaults to "any"
  2337. #
  2338. # @new_state: the state identifier blkdebug is supposed to assume if
  2339. # this event is triggered
  2340. #
  2341. # Since: 2.9
  2342. ##
  2343. { 'struct': 'BlkdebugSetStateOptions',
  2344. 'data': { 'event': 'BlkdebugEvent',
  2345. '*state': 'int',
  2346. 'new_state': 'int' } }
  2347. ##
  2348. # @BlockdevOptionsBlkdebug:
  2349. #
  2350. # Driver specific block device options for blkdebug.
  2351. #
  2352. # @image: underlying raw block device (or image file)
  2353. #
  2354. # @config: filename of the configuration file
  2355. #
  2356. # @align: required alignment for requests in bytes, must be
  2357. # positive power of 2, or 0 for default
  2358. #
  2359. # @max-transfer: maximum size for I/O transfers in bytes, must be
  2360. # positive multiple of @align and of the underlying
  2361. # file's request alignment (but need not be a power of
  2362. # 2), or 0 for default (since 2.10)
  2363. #
  2364. # @opt-write-zero: preferred alignment for write zero requests in bytes,
  2365. # must be positive multiple of @align and of the
  2366. # underlying file's request alignment (but need not be a
  2367. # power of 2), or 0 for default (since 2.10)
  2368. #
  2369. # @max-write-zero: maximum size for write zero requests in bytes, must be
  2370. # positive multiple of @align, of @opt-write-zero, and of
  2371. # the underlying file's request alignment (but need not
  2372. # be a power of 2), or 0 for default (since 2.10)
  2373. #
  2374. # @opt-discard: preferred alignment for discard requests in bytes, must
  2375. # be positive multiple of @align and of the underlying
  2376. # file's request alignment (but need not be a power of
  2377. # 2), or 0 for default (since 2.10)
  2378. #
  2379. # @max-discard: maximum size for discard requests in bytes, must be
  2380. # positive multiple of @align, of @opt-discard, and of
  2381. # the underlying file's request alignment (but need not
  2382. # be a power of 2), or 0 for default (since 2.10)
  2383. #
  2384. # @inject-error: array of error injection descriptions
  2385. #
  2386. # @set-state: array of state-change descriptions
  2387. #
  2388. # Since: 2.9
  2389. ##
  2390. { 'struct': 'BlockdevOptionsBlkdebug',
  2391. 'data': { 'image': 'BlockdevRef',
  2392. '*config': 'str',
  2393. '*align': 'int', '*max-transfer': 'int32',
  2394. '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
  2395. '*opt-discard': 'int32', '*max-discard': 'int32',
  2396. '*inject-error': ['BlkdebugInjectErrorOptions'],
  2397. '*set-state': ['BlkdebugSetStateOptions'] } }
  2398. ##
  2399. # @BlockdevOptionsBlkverify:
  2400. #
  2401. # Driver specific block device options for blkverify.
  2402. #
  2403. # @test: block device to be tested
  2404. #
  2405. # @raw: raw image used for verification
  2406. #
  2407. # Since: 2.9
  2408. ##
  2409. { 'struct': 'BlockdevOptionsBlkverify',
  2410. 'data': { 'test': 'BlockdevRef',
  2411. 'raw': 'BlockdevRef' } }
  2412. ##
  2413. # @QuorumReadPattern:
  2414. #
  2415. # An enumeration of quorum read patterns.
  2416. #
  2417. # @quorum: read all the children and do a quorum vote on reads
  2418. #
  2419. # @fifo: read only from the first child that has not failed
  2420. #
  2421. # Since: 2.9
  2422. ##
  2423. { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
  2424. ##
  2425. # @BlockdevOptionsQuorum:
  2426. #
  2427. # Driver specific block device options for Quorum
  2428. #
  2429. # @blkverify: true if the driver must print content mismatch
  2430. # set to false by default
  2431. #
  2432. # @children: the children block devices to use
  2433. #
  2434. # @vote-threshold: the vote limit under which a read will fail
  2435. #
  2436. # @rewrite-corrupted: rewrite corrupted data when quorum is reached
  2437. # (Since 2.1)
  2438. #
  2439. # @read-pattern: choose read pattern and set to quorum by default
  2440. # (Since 2.2)
  2441. #
  2442. # Since: 2.9
  2443. ##
  2444. { 'struct': 'BlockdevOptionsQuorum',
  2445. 'data': { '*blkverify': 'bool',
  2446. 'children': [ 'BlockdevRef' ],
  2447. 'vote-threshold': 'int',
  2448. '*rewrite-corrupted': 'bool',
  2449. '*read-pattern': 'QuorumReadPattern' } }
  2450. ##
  2451. # @BlockdevOptionsGluster:
  2452. #
  2453. # Driver specific block device options for Gluster
  2454. #
  2455. # @volume: name of gluster volume where VM image resides
  2456. #
  2457. # @path: absolute path to image file in gluster volume
  2458. #
  2459. # @server: gluster servers description
  2460. #
  2461. # @debug: libgfapi log level (default '4' which is Error)
  2462. # (Since 2.8)
  2463. #
  2464. # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
  2465. #
  2466. # Since: 2.9
  2467. ##
  2468. { 'struct': 'BlockdevOptionsGluster',
  2469. 'data': { 'volume': 'str',
  2470. 'path': 'str',
  2471. 'server': ['SocketAddress'],
  2472. '*debug': 'int',
  2473. '*logfile': 'str' } }
  2474. ##
  2475. # @IscsiTransport:
  2476. #
  2477. # An enumeration of libiscsi transport types
  2478. #
  2479. # Since: 2.9
  2480. ##
  2481. { 'enum': 'IscsiTransport',
  2482. 'data': [ 'tcp', 'iser' ] }
  2483. ##
  2484. # @IscsiHeaderDigest:
  2485. #
  2486. # An enumeration of header digests supported by libiscsi
  2487. #
  2488. # Since: 2.9
  2489. ##
  2490. { 'enum': 'IscsiHeaderDigest',
  2491. 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
  2492. 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
  2493. ##
  2494. # @BlockdevOptionsIscsi:
  2495. #
  2496. # @transport: The iscsi transport type
  2497. #
  2498. # @portal: The address of the iscsi portal
  2499. #
  2500. # @target: The target iqn name
  2501. #
  2502. # @lun: LUN to connect to. Defaults to 0.
  2503. #
  2504. # @user: User name to log in with. If omitted, no CHAP
  2505. # authentication is performed.
  2506. #
  2507. # @password-secret: The ID of a QCryptoSecret object providing
  2508. # the password for the login. This option is required if
  2509. # @user is specified.
  2510. #
  2511. # @initiator-name: The iqn name we want to identify to the target
  2512. # as. If this option is not specified, an initiator name is
  2513. # generated automatically.
  2514. #
  2515. # @header-digest: The desired header digest. Defaults to
  2516. # none-crc32c.
  2517. #
  2518. # @timeout: Timeout in seconds after which a request will
  2519. # timeout. 0 means no timeout and is the default.
  2520. #
  2521. # Driver specific block device options for iscsi
  2522. #
  2523. # Since: 2.9
  2524. ##
  2525. { 'struct': 'BlockdevOptionsIscsi',
  2526. 'data': { 'transport': 'IscsiTransport',
  2527. 'portal': 'str',
  2528. 'target': 'str',
  2529. '*lun': 'int',
  2530. '*user': 'str',
  2531. '*password-secret': 'str',
  2532. '*initiator-name': 'str',
  2533. '*header-digest': 'IscsiHeaderDigest',
  2534. '*timeout': 'int' } }
  2535. ##
  2536. # @BlockdevOptionsRbd:
  2537. #
  2538. # @pool: Ceph pool name.
  2539. #
  2540. # @image: Image name in the Ceph pool.
  2541. #
  2542. # @conf: path to Ceph configuration file. Values
  2543. # in the configuration file will be overridden by
  2544. # options specified via QAPI.
  2545. #
  2546. # @snapshot: Ceph snapshot name.
  2547. #
  2548. # @user: Ceph id name.
  2549. #
  2550. # @server: Monitor host address and port. This maps
  2551. # to the "mon_host" Ceph option.
  2552. #
  2553. # Since: 2.9
  2554. ##
  2555. { 'struct': 'BlockdevOptionsRbd',
  2556. 'data': { 'pool': 'str',
  2557. 'image': 'str',
  2558. '*conf': 'str',
  2559. '*snapshot': 'str',
  2560. '*user': 'str',
  2561. '*server': ['InetSocketAddressBase'] } }
  2562. ##
  2563. # @BlockdevOptionsSheepdog:
  2564. #
  2565. # Driver specific block device options for sheepdog
  2566. #
  2567. # @vdi: Virtual disk image name
  2568. # @server: The Sheepdog server to connect to
  2569. # @snap-id: Snapshot ID
  2570. # @tag: Snapshot tag name
  2571. #
  2572. # Only one of @snap-id and @tag may be present.
  2573. #
  2574. # Since: 2.9
  2575. ##
  2576. { 'struct': 'BlockdevOptionsSheepdog',
  2577. 'data': { 'server': 'SocketAddress',
  2578. 'vdi': 'str',
  2579. '*snap-id': 'uint32',
  2580. '*tag': 'str' } }
  2581. ##
  2582. # @ReplicationMode:
  2583. #
  2584. # An enumeration of replication modes.
  2585. #
  2586. # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
  2587. #
  2588. # @secondary: Secondary mode, receive the vm's state from primary QEMU.
  2589. #
  2590. # Since: 2.9
  2591. ##
  2592. { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
  2593. ##
  2594. # @BlockdevOptionsReplication:
  2595. #
  2596. # Driver specific block device options for replication
  2597. #
  2598. # @mode: the replication mode
  2599. #
  2600. # @top-id: In secondary mode, node name or device ID of the root
  2601. # node who owns the replication node chain. Must not be given in
  2602. # primary mode.
  2603. #
  2604. # Since: 2.9
  2605. ##
  2606. { 'struct': 'BlockdevOptionsReplication',
  2607. 'base': 'BlockdevOptionsGenericFormat',
  2608. 'data': { 'mode': 'ReplicationMode',
  2609. '*top-id': 'str' } }
  2610. ##
  2611. # @NFSTransport:
  2612. #
  2613. # An enumeration of NFS transport types
  2614. #
  2615. # @inet: TCP transport
  2616. #
  2617. # Since: 2.9
  2618. ##
  2619. { 'enum': 'NFSTransport',
  2620. 'data': [ 'inet' ] }
  2621. ##
  2622. # @NFSServer:
  2623. #
  2624. # Captures the address of the socket
  2625. #
  2626. # @type: transport type used for NFS (only TCP supported)
  2627. #
  2628. # @host: host address for NFS server
  2629. #
  2630. # Since: 2.9
  2631. ##
  2632. { 'struct': 'NFSServer',
  2633. 'data': { 'type': 'NFSTransport',
  2634. 'host': 'str' } }
  2635. ##
  2636. # @BlockdevOptionsNfs:
  2637. #
  2638. # Driver specific block device option for NFS
  2639. #
  2640. # @server: host address
  2641. #
  2642. # @path: path of the image on the host
  2643. #
  2644. # @user: UID value to use when talking to the
  2645. # server (defaults to 65534 on Windows and getuid()
  2646. # on unix)
  2647. #
  2648. # @group: GID value to use when talking to the
  2649. # server (defaults to 65534 on Windows and getgid()
  2650. # in unix)
  2651. #
  2652. # @tcp-syn-count: number of SYNs during the session
  2653. # establishment (defaults to libnfs default)
  2654. #
  2655. # @readahead-size: set the readahead size in bytes (defaults
  2656. # to libnfs default)
  2657. #
  2658. # @page-cache-size: set the pagecache size in bytes (defaults
  2659. # to libnfs default)
  2660. #
  2661. # @debug: set the NFS debug level (max 2) (defaults
  2662. # to libnfs default)
  2663. #
  2664. # Since: 2.9
  2665. ##
  2666. { 'struct': 'BlockdevOptionsNfs',
  2667. 'data': { 'server': 'NFSServer',
  2668. 'path': 'str',
  2669. '*user': 'int',
  2670. '*group': 'int',
  2671. '*tcp-syn-count': 'int',
  2672. '*readahead-size': 'int',
  2673. '*page-cache-size': 'int',
  2674. '*debug': 'int' } }
  2675. ##
  2676. # @BlockdevOptionsCurlBase:
  2677. #
  2678. # Driver specific block device options shared by all protocols supported by the
  2679. # curl backend.
  2680. #
  2681. # @url: URL of the image file
  2682. #
  2683. # @readahead: Size of the read-ahead cache; must be a multiple of
  2684. # 512 (defaults to 256 kB)
  2685. #
  2686. # @timeout: Timeout for connections, in seconds (defaults to 5)
  2687. #
  2688. # @username: Username for authentication (defaults to none)
  2689. #
  2690. # @password-secret: ID of a QCryptoSecret object providing a password
  2691. # for authentication (defaults to no password)
  2692. #
  2693. # @proxy-username: Username for proxy authentication (defaults to none)
  2694. #
  2695. # @proxy-password-secret: ID of a QCryptoSecret object providing a password
  2696. # for proxy authentication (defaults to no password)
  2697. #
  2698. # Since: 2.9
  2699. ##
  2700. { 'struct': 'BlockdevOptionsCurlBase',
  2701. 'data': { 'url': 'str',
  2702. '*readahead': 'int',
  2703. '*timeout': 'int',
  2704. '*username': 'str',
  2705. '*password-secret': 'str',
  2706. '*proxy-username': 'str',
  2707. '*proxy-password-secret': 'str' } }
  2708. ##
  2709. # @BlockdevOptionsCurlHttp:
  2710. #
  2711. # Driver specific block device options for HTTP connections over the curl
  2712. # backend. URLs must start with "http://".
  2713. #
  2714. # @cookie: List of cookies to set; format is
  2715. # "name1=content1; name2=content2;" as explained by
  2716. # CURLOPT_COOKIE(3). Defaults to no cookies.
  2717. #
  2718. # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
  2719. # secure way. See @cookie for the format. (since 2.10)
  2720. #
  2721. # Since: 2.9
  2722. ##
  2723. { 'struct': 'BlockdevOptionsCurlHttp',
  2724. 'base': 'BlockdevOptionsCurlBase',
  2725. 'data': { '*cookie': 'str',
  2726. '*cookie-secret': 'str'} }
  2727. ##
  2728. # @BlockdevOptionsCurlHttps:
  2729. #
  2730. # Driver specific block device options for HTTPS connections over the curl
  2731. # backend. URLs must start with "https://".
  2732. #
  2733. # @cookie: List of cookies to set; format is
  2734. # "name1=content1; name2=content2;" as explained by
  2735. # CURLOPT_COOKIE(3). Defaults to no cookies.
  2736. #
  2737. # @sslverify: Whether to verify the SSL certificate's validity (defaults to
  2738. # true)
  2739. #
  2740. # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
  2741. # secure way. See @cookie for the format. (since 2.10)
  2742. #
  2743. # Since: 2.9
  2744. ##
  2745. { 'struct': 'BlockdevOptionsCurlHttps',
  2746. 'base': 'BlockdevOptionsCurlBase',
  2747. 'data': { '*cookie': 'str',
  2748. '*sslverify': 'bool',
  2749. '*cookie-secret': 'str'} }
  2750. ##
  2751. # @BlockdevOptionsCurlFtp:
  2752. #
  2753. # Driver specific block device options for FTP connections over the curl
  2754. # backend. URLs must start with "ftp://".
  2755. #
  2756. # Since: 2.9
  2757. ##
  2758. { 'struct': 'BlockdevOptionsCurlFtp',
  2759. 'base': 'BlockdevOptionsCurlBase',
  2760. 'data': { } }
  2761. ##
  2762. # @BlockdevOptionsCurlFtps:
  2763. #
  2764. # Driver specific block device options for FTPS connections over the curl
  2765. # backend. URLs must start with "ftps://".
  2766. #
  2767. # @sslverify: Whether to verify the SSL certificate's validity (defaults to
  2768. # true)
  2769. #
  2770. # Since: 2.9
  2771. ##
  2772. { 'struct': 'BlockdevOptionsCurlFtps',
  2773. 'base': 'BlockdevOptionsCurlBase',
  2774. 'data': { '*sslverify': 'bool' } }
  2775. ##
  2776. # @BlockdevOptionsNbd:
  2777. #
  2778. # Driver specific block device options for NBD.
  2779. #
  2780. # @server: NBD server address
  2781. #
  2782. # @export: export name
  2783. #
  2784. # @tls-creds: TLS credentials ID
  2785. #
  2786. # Since: 2.9
  2787. ##
  2788. { 'struct': 'BlockdevOptionsNbd',
  2789. 'data': { 'server': 'SocketAddress',
  2790. '*export': 'str',
  2791. '*tls-creds': 'str' } }
  2792. ##
  2793. # @BlockdevOptionsRaw:
  2794. #
  2795. # Driver specific block device options for the raw driver.
  2796. #
  2797. # @offset: position where the block device starts
  2798. # @size: the assumed size of the device
  2799. #
  2800. # Since: 2.9
  2801. ##
  2802. { 'struct': 'BlockdevOptionsRaw',
  2803. 'base': 'BlockdevOptionsGenericFormat',
  2804. 'data': { '*offset': 'int', '*size': 'int' } }
  2805. ##
  2806. # @BlockdevOptionsVxHS:
  2807. #
  2808. # Driver specific block device options for VxHS
  2809. #
  2810. # @vdisk-id: UUID of VxHS volume
  2811. # @server: vxhs server IP, port
  2812. # @tls-creds: TLS credentials ID
  2813. #
  2814. # Since: 2.10
  2815. ##
  2816. { 'struct': 'BlockdevOptionsVxHS',
  2817. 'data': { 'vdisk-id': 'str',
  2818. 'server': 'InetSocketAddressBase',
  2819. '*tls-creds': 'str' } }
  2820. ##
  2821. # @BlockdevOptions:
  2822. #
  2823. # Options for creating a block device. Many options are available for all
  2824. # block devices, independent of the block driver:
  2825. #
  2826. # @driver: block driver name
  2827. # @node-name: the node name of the new node (Since 2.0).
  2828. # This option is required on the top level of blockdev-add.
  2829. # @discard: discard-related options (default: ignore)
  2830. # @cache: cache-related options
  2831. # @read-only: whether the block device should be read-only
  2832. # (default: false)
  2833. # @detect-zeroes: detect and optimize zero writes (Since 2.1)
  2834. # (default: off)
  2835. # @force-share: force share all permission on added nodes.
  2836. # Requires read-only=true. (Since 2.10)
  2837. #
  2838. # Remaining options are determined by the block driver.
  2839. #
  2840. # Since: 2.9
  2841. ##
  2842. { 'union': 'BlockdevOptions',
  2843. 'base': { 'driver': 'BlockdevDriver',
  2844. '*node-name': 'str',
  2845. '*discard': 'BlockdevDiscardOptions',
  2846. '*cache': 'BlockdevCacheOptions',
  2847. '*read-only': 'bool',
  2848. '*force-share': 'bool',
  2849. '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
  2850. 'discriminator': 'driver',
  2851. 'data': {
  2852. 'blkdebug': 'BlockdevOptionsBlkdebug',
  2853. 'blkverify': 'BlockdevOptionsBlkverify',
  2854. 'bochs': 'BlockdevOptionsGenericFormat',
  2855. 'cloop': 'BlockdevOptionsGenericFormat',
  2856. 'dmg': 'BlockdevOptionsGenericFormat',
  2857. 'file': 'BlockdevOptionsFile',
  2858. 'ftp': 'BlockdevOptionsCurlFtp',
  2859. 'ftps': 'BlockdevOptionsCurlFtps',
  2860. 'gluster': 'BlockdevOptionsGluster',
  2861. 'host_cdrom': 'BlockdevOptionsFile',
  2862. 'host_device':'BlockdevOptionsFile',
  2863. 'http': 'BlockdevOptionsCurlHttp',
  2864. 'https': 'BlockdevOptionsCurlHttps',
  2865. 'iscsi': 'BlockdevOptionsIscsi',
  2866. 'luks': 'BlockdevOptionsLUKS',
  2867. 'nbd': 'BlockdevOptionsNbd',
  2868. 'nfs': 'BlockdevOptionsNfs',
  2869. 'null-aio': 'BlockdevOptionsNull',
  2870. 'null-co': 'BlockdevOptionsNull',
  2871. 'parallels': 'BlockdevOptionsGenericFormat',
  2872. 'qcow2': 'BlockdevOptionsQcow2',
  2873. 'qcow': 'BlockdevOptionsGenericCOWFormat',
  2874. 'qed': 'BlockdevOptionsGenericCOWFormat',
  2875. 'quorum': 'BlockdevOptionsQuorum',
  2876. 'raw': 'BlockdevOptionsRaw',
  2877. 'rbd': 'BlockdevOptionsRbd',
  2878. 'replication':'BlockdevOptionsReplication',
  2879. 'sheepdog': 'BlockdevOptionsSheepdog',
  2880. 'ssh': 'BlockdevOptionsSsh',
  2881. 'vdi': 'BlockdevOptionsGenericFormat',
  2882. 'vhdx': 'BlockdevOptionsGenericFormat',
  2883. 'vmdk': 'BlockdevOptionsGenericCOWFormat',
  2884. 'vpc': 'BlockdevOptionsGenericFormat',
  2885. 'vvfat': 'BlockdevOptionsVVFAT',
  2886. 'vxhs': 'BlockdevOptionsVxHS'
  2887. } }
  2888. ##
  2889. # @BlockdevRef:
  2890. #
  2891. # Reference to a block device.
  2892. #
  2893. # @definition: defines a new block device inline
  2894. # @reference: references the ID of an existing block device. An
  2895. # empty string means that no block device should be
  2896. # referenced.
  2897. #
  2898. # Since: 2.9
  2899. ##
  2900. { 'alternate': 'BlockdevRef',
  2901. 'data': { 'definition': 'BlockdevOptions',
  2902. 'reference': 'str' } }
  2903. ##
  2904. # @blockdev-add:
  2905. #
  2906. # Creates a new block device. If the @id option is given at the top level, a
  2907. # BlockBackend will be created; otherwise, @node-name is mandatory at the top
  2908. # level and no BlockBackend will be created.
  2909. #
  2910. # Since: 2.9
  2911. #
  2912. # Example:
  2913. #
  2914. # 1.
  2915. # -> { "execute": "blockdev-add",
  2916. # "arguments": {
  2917. # "driver": "qcow2",
  2918. # "node-name": "test1",
  2919. # "file": {
  2920. # "driver": "file",
  2921. # "filename": "test.qcow2"
  2922. # }
  2923. # }
  2924. # }
  2925. # <- { "return": {} }
  2926. #
  2927. # 2.
  2928. # -> { "execute": "blockdev-add",
  2929. # "arguments": {
  2930. # "driver": "qcow2",
  2931. # "node-name": "node0",
  2932. # "discard": "unmap",
  2933. # "cache": {
  2934. # "direct": true
  2935. # },
  2936. # "file": {
  2937. # "driver": "file",
  2938. # "filename": "/tmp/test.qcow2"
  2939. # },
  2940. # "backing": {
  2941. # "driver": "raw",
  2942. # "file": {
  2943. # "driver": "file",
  2944. # "filename": "/dev/fdset/4"
  2945. # }
  2946. # }
  2947. # }
  2948. # }
  2949. #
  2950. # <- { "return": {} }
  2951. #
  2952. ##
  2953. { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
  2954. ##
  2955. # @blockdev-del:
  2956. #
  2957. # Deletes a block device that has been added using blockdev-add.
  2958. # The command will fail if the node is attached to a device or is
  2959. # otherwise being used.
  2960. #
  2961. # @node-name: Name of the graph node to delete.
  2962. #
  2963. # Since: 2.9
  2964. #
  2965. # Example:
  2966. #
  2967. # -> { "execute": "blockdev-add",
  2968. # "arguments": {
  2969. # "driver": "qcow2",
  2970. # "node-name": "node0",
  2971. # "file": {
  2972. # "driver": "file",
  2973. # "filename": "test.qcow2"
  2974. # }
  2975. # }
  2976. # }
  2977. # <- { "return": {} }
  2978. #
  2979. # -> { "execute": "blockdev-del",
  2980. # "arguments": { "node-name": "node0" }
  2981. # }
  2982. # <- { "return": {} }
  2983. #
  2984. ##
  2985. { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
  2986. ##
  2987. # @blockdev-open-tray:
  2988. #
  2989. # Opens a block device's tray. If there is a block driver state tree inserted as
  2990. # a medium, it will become inaccessible to the guest (but it will remain
  2991. # associated to the block device, so closing the tray will make it accessible
  2992. # again).
  2993. #
  2994. # If the tray was already open before, this will be a no-op.
  2995. #
  2996. # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
  2997. # which no such event will be generated, these include:
  2998. # - if the guest has locked the tray, @force is false and the guest does not
  2999. # respond to the eject request
  3000. # - if the BlockBackend denoted by @device does not have a guest device attached
  3001. # to it
  3002. # - if the guest device does not have an actual tray
  3003. #
  3004. # @device: Block device name (deprecated, use @id instead)
  3005. #
  3006. # @id: The name or QOM path of the guest device (since: 2.8)
  3007. #
  3008. # @force: if false (the default), an eject request will be sent to
  3009. # the guest if it has locked the tray (and the tray will not be opened
  3010. # immediately); if true, the tray will be opened regardless of whether
  3011. # it is locked
  3012. #
  3013. # Since: 2.5
  3014. #
  3015. # Example:
  3016. #
  3017. # -> { "execute": "blockdev-open-tray",
  3018. # "arguments": { "id": "ide0-1-0" } }
  3019. #
  3020. # <- { "timestamp": { "seconds": 1418751016,
  3021. # "microseconds": 716996 },
  3022. # "event": "DEVICE_TRAY_MOVED",
  3023. # "data": { "device": "ide1-cd0",
  3024. # "id": "ide0-1-0",
  3025. # "tray-open": true } }
  3026. #
  3027. # <- { "return": {} }
  3028. #
  3029. ##
  3030. { 'command': 'blockdev-open-tray',
  3031. 'data': { '*device': 'str',
  3032. '*id': 'str',
  3033. '*force': 'bool' } }
  3034. ##
  3035. # @blockdev-close-tray:
  3036. #
  3037. # Closes a block device's tray. If there is a block driver state tree associated
  3038. # with the block device (which is currently ejected), that tree will be loaded
  3039. # as the medium.
  3040. #
  3041. # If the tray was already closed before, this will be a no-op.
  3042. #
  3043. # @device: Block device name (deprecated, use @id instead)
  3044. #
  3045. # @id: The name or QOM path of the guest device (since: 2.8)
  3046. #
  3047. # Since: 2.5
  3048. #
  3049. # Example:
  3050. #
  3051. # -> { "execute": "blockdev-close-tray",
  3052. # "arguments": { "id": "ide0-1-0" } }
  3053. #
  3054. # <- { "timestamp": { "seconds": 1418751345,
  3055. # "microseconds": 272147 },
  3056. # "event": "DEVICE_TRAY_MOVED",
  3057. # "data": { "device": "ide1-cd0",
  3058. # "id": "ide0-1-0",
  3059. # "tray-open": false } }
  3060. #
  3061. # <- { "return": {} }
  3062. #
  3063. ##
  3064. { 'command': 'blockdev-close-tray',
  3065. 'data': { '*device': 'str',
  3066. '*id': 'str' } }
  3067. ##
  3068. # @x-blockdev-remove-medium:
  3069. #
  3070. # Removes a medium (a block driver state tree) from a block device. That block
  3071. # device's tray must currently be open (unless there is no attached guest
  3072. # device).
  3073. #
  3074. # If the tray is open and there is no medium inserted, this will be a no-op.
  3075. #
  3076. # @device: Block device name (deprecated, use @id instead)
  3077. #
  3078. # @id: The name or QOM path of the guest device (since: 2.8)
  3079. #
  3080. # Note: This command is still a work in progress and is considered experimental.
  3081. # Stay away from it unless you want to help with its development.
  3082. #
  3083. # Since: 2.5
  3084. #
  3085. # Example:
  3086. #
  3087. # -> { "execute": "x-blockdev-remove-medium",
  3088. # "arguments": { "id": "ide0-1-0" } }
  3089. #
  3090. # <- { "error": { "class": "GenericError",
  3091. # "desc": "Tray of device 'ide0-1-0' is not open" } }
  3092. #
  3093. # -> { "execute": "blockdev-open-tray",
  3094. # "arguments": { "id": "ide0-1-0" } }
  3095. #
  3096. # <- { "timestamp": { "seconds": 1418751627,
  3097. # "microseconds": 549958 },
  3098. # "event": "DEVICE_TRAY_MOVED",
  3099. # "data": { "device": "ide1-cd0",
  3100. # "id": "ide0-1-0",
  3101. # "tray-open": true } }
  3102. #
  3103. # <- { "return": {} }
  3104. #
  3105. # -> { "execute": "x-blockdev-remove-medium",
  3106. # "arguments": { "id": "ide0-1-0" } }
  3107. #
  3108. # <- { "return": {} }
  3109. #
  3110. ##
  3111. { 'command': 'x-blockdev-remove-medium',
  3112. 'data': { '*device': 'str',
  3113. '*id': 'str' } }
  3114. ##
  3115. # @x-blockdev-insert-medium:
  3116. #
  3117. # Inserts a medium (a block driver state tree) into a block device. That block
  3118. # device's tray must currently be open (unless there is no attached guest
  3119. # device) and there must be no medium inserted already.
  3120. #
  3121. # @device: Block device name (deprecated, use @id instead)
  3122. #
  3123. # @id: The name or QOM path of the guest device (since: 2.8)
  3124. #
  3125. # @node-name: name of a node in the block driver state graph
  3126. #
  3127. # Note: This command is still a work in progress and is considered experimental.
  3128. # Stay away from it unless you want to help with its development.
  3129. #
  3130. # Since: 2.5
  3131. #
  3132. # Example:
  3133. #
  3134. # -> { "execute": "blockdev-add",
  3135. # "arguments": {
  3136. # "node-name": "node0",
  3137. # "driver": "raw",
  3138. # "file": { "driver": "file",
  3139. # "filename": "fedora.iso" } } }
  3140. # <- { "return": {} }
  3141. #
  3142. # -> { "execute": "x-blockdev-insert-medium",
  3143. # "arguments": { "id": "ide0-1-0",
  3144. # "node-name": "node0" } }
  3145. #
  3146. # <- { "return": {} }
  3147. #
  3148. ##
  3149. { 'command': 'x-blockdev-insert-medium',
  3150. 'data': { '*device': 'str',
  3151. '*id': 'str',
  3152. 'node-name': 'str'} }
  3153. ##
  3154. # @BlockdevChangeReadOnlyMode:
  3155. #
  3156. # Specifies the new read-only mode of a block device subject to the
  3157. # @blockdev-change-medium command.
  3158. #
  3159. # @retain: Retains the current read-only mode
  3160. #
  3161. # @read-only: Makes the device read-only
  3162. #
  3163. # @read-write: Makes the device writable
  3164. #
  3165. # Since: 2.3
  3166. #
  3167. ##
  3168. { 'enum': 'BlockdevChangeReadOnlyMode',
  3169. 'data': ['retain', 'read-only', 'read-write'] }
  3170. ##
  3171. # @blockdev-change-medium:
  3172. #
  3173. # Changes the medium inserted into a block device by ejecting the current medium
  3174. # and loading a new image file which is inserted as the new medium (this command
  3175. # combines blockdev-open-tray, x-blockdev-remove-medium,
  3176. # x-blockdev-insert-medium and blockdev-close-tray).
  3177. #
  3178. # @device: Block device name (deprecated, use @id instead)
  3179. #
  3180. # @id: The name or QOM path of the guest device
  3181. # (since: 2.8)
  3182. #
  3183. # @filename: filename of the new image to be loaded
  3184. #
  3185. # @format: format to open the new image with (defaults to
  3186. # the probed format)
  3187. #
  3188. # @read-only-mode: change the read-only mode of the device; defaults
  3189. # to 'retain'
  3190. #
  3191. # Since: 2.5
  3192. #
  3193. # Examples:
  3194. #
  3195. # 1. Change a removable medium
  3196. #
  3197. # -> { "execute": "blockdev-change-medium",
  3198. # "arguments": { "id": "ide0-1-0",
  3199. # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
  3200. # "format": "raw" } }
  3201. # <- { "return": {} }
  3202. #
  3203. # 2. Load a read-only medium into a writable drive
  3204. #
  3205. # -> { "execute": "blockdev-change-medium",
  3206. # "arguments": { "id": "floppyA",
  3207. # "filename": "/srv/images/ro.img",
  3208. # "format": "raw",
  3209. # "read-only-mode": "retain" } }
  3210. #
  3211. # <- { "error":
  3212. # { "class": "GenericError",
  3213. # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
  3214. #
  3215. # -> { "execute": "blockdev-change-medium",
  3216. # "arguments": { "id": "floppyA",
  3217. # "filename": "/srv/images/ro.img",
  3218. # "format": "raw",
  3219. # "read-only-mode": "read-only" } }
  3220. #
  3221. # <- { "return": {} }
  3222. #
  3223. ##
  3224. { 'command': 'blockdev-change-medium',
  3225. 'data': { '*device': 'str',
  3226. '*id': 'str',
  3227. 'filename': 'str',
  3228. '*format': 'str',
  3229. '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
  3230. ##
  3231. # @BlockErrorAction:
  3232. #
  3233. # An enumeration of action that has been taken when a DISK I/O occurs
  3234. #
  3235. # @ignore: error has been ignored
  3236. #
  3237. # @report: error has been reported to the device
  3238. #
  3239. # @stop: error caused VM to be stopped
  3240. #
  3241. # Since: 2.1
  3242. ##
  3243. { 'enum': 'BlockErrorAction',
  3244. 'data': [ 'ignore', 'report', 'stop' ] }
  3245. ##
  3246. # @BLOCK_IMAGE_CORRUPTED:
  3247. #
  3248. # Emitted when a disk image is being marked corrupt. The image can be
  3249. # identified by its device or node name. The 'device' field is always
  3250. # present for compatibility reasons, but it can be empty ("") if the
  3251. # image does not have a device name associated.
  3252. #
  3253. # @device: device name. This is always present for compatibility
  3254. # reasons, but it can be empty ("") if the image does not
  3255. # have a device name associated.
  3256. #
  3257. # @node-name: node name (Since: 2.4)
  3258. #
  3259. # @msg: informative message for human consumption, such as the kind of
  3260. # corruption being detected. It should not be parsed by machine as it is
  3261. # not guaranteed to be stable
  3262. #
  3263. # @offset: if the corruption resulted from an image access, this is
  3264. # the host's access offset into the image
  3265. #
  3266. # @size: if the corruption resulted from an image access, this is
  3267. # the access size
  3268. #
  3269. # @fatal: if set, the image is marked corrupt and therefore unusable after this
  3270. # event and must be repaired (Since 2.2; before, every
  3271. # BLOCK_IMAGE_CORRUPTED event was fatal)
  3272. #
  3273. # Note: If action is "stop", a STOP event will eventually follow the
  3274. # BLOCK_IO_ERROR event.
  3275. #
  3276. # Example:
  3277. #
  3278. # <- { "event": "BLOCK_IMAGE_CORRUPTED",
  3279. # "data": { "device": "ide0-hd0", "node-name": "node0",
  3280. # "msg": "Prevented active L1 table overwrite", "offset": 196608,
  3281. # "size": 65536 },
  3282. # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
  3283. #
  3284. # Since: 1.7
  3285. ##
  3286. { 'event': 'BLOCK_IMAGE_CORRUPTED',
  3287. 'data': { 'device' : 'str',
  3288. '*node-name' : 'str',
  3289. 'msg' : 'str',
  3290. '*offset' : 'int',
  3291. '*size' : 'int',
  3292. 'fatal' : 'bool' } }
  3293. ##
  3294. # @BLOCK_IO_ERROR:
  3295. #
  3296. # Emitted when a disk I/O error occurs
  3297. #
  3298. # @device: device name. This is always present for compatibility
  3299. # reasons, but it can be empty ("") if the image does not
  3300. # have a device name associated.
  3301. #
  3302. # @node-name: node name. Note that errors may be reported for the root node
  3303. # that is directly attached to a guest device rather than for the
  3304. # node where the error occurred. (Since: 2.8)
  3305. #
  3306. # @operation: I/O operation
  3307. #
  3308. # @action: action that has been taken
  3309. #
  3310. # @nospace: true if I/O error was caused due to a no-space
  3311. # condition. This key is only present if query-block's
  3312. # io-status is present, please see query-block documentation
  3313. # for more information (since: 2.2)
  3314. #
  3315. # @reason: human readable string describing the error cause.
  3316. # (This field is a debugging aid for humans, it should not
  3317. # be parsed by applications) (since: 2.2)
  3318. #
  3319. # Note: If action is "stop", a STOP event will eventually follow the
  3320. # BLOCK_IO_ERROR event
  3321. #
  3322. # Since: 0.13.0
  3323. #
  3324. # Example:
  3325. #
  3326. # <- { "event": "BLOCK_IO_ERROR",
  3327. # "data": { "device": "ide0-hd1",
  3328. # "node-name": "#block212",
  3329. # "operation": "write",
  3330. # "action": "stop" },
  3331. # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
  3332. #
  3333. ##
  3334. { 'event': 'BLOCK_IO_ERROR',
  3335. 'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
  3336. 'action': 'BlockErrorAction', '*nospace': 'bool',
  3337. 'reason': 'str' } }
  3338. ##
  3339. # @BLOCK_JOB_COMPLETED:
  3340. #
  3341. # Emitted when a block job has completed
  3342. #
  3343. # @type: job type
  3344. #
  3345. # @device: The job identifier. Originally the device name but other
  3346. # values are allowed since QEMU 2.7
  3347. #
  3348. # @len: maximum progress value
  3349. #
  3350. # @offset: current progress value. On success this is equal to len.
  3351. # On failure this is less than len
  3352. #
  3353. # @speed: rate limit, bytes per second
  3354. #
  3355. # @error: error message. Only present on failure. This field
  3356. # contains a human-readable error message. There are no semantics
  3357. # other than that streaming has failed and clients should not try to
  3358. # interpret the error string
  3359. #
  3360. # Since: 1.1
  3361. #
  3362. # Example:
  3363. #
  3364. # <- { "event": "BLOCK_JOB_COMPLETED",
  3365. # "data": { "type": "stream", "device": "virtio-disk0",
  3366. # "len": 10737418240, "offset": 10737418240,
  3367. # "speed": 0 },
  3368. # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
  3369. #
  3370. ##
  3371. { 'event': 'BLOCK_JOB_COMPLETED',
  3372. 'data': { 'type' : 'BlockJobType',
  3373. 'device': 'str',
  3374. 'len' : 'int',
  3375. 'offset': 'int',
  3376. 'speed' : 'int',
  3377. '*error': 'str' } }
  3378. ##
  3379. # @BLOCK_JOB_CANCELLED:
  3380. #
  3381. # Emitted when a block job has been cancelled
  3382. #
  3383. # @type: job type
  3384. #
  3385. # @device: The job identifier. Originally the device name but other
  3386. # values are allowed since QEMU 2.7
  3387. #
  3388. # @len: maximum progress value
  3389. #
  3390. # @offset: current progress value. On success this is equal to len.
  3391. # On failure this is less than len
  3392. #
  3393. # @speed: rate limit, bytes per second
  3394. #
  3395. # Since: 1.1
  3396. #
  3397. # Example:
  3398. #
  3399. # <- { "event": "BLOCK_JOB_CANCELLED",
  3400. # "data": { "type": "stream", "device": "virtio-disk0",
  3401. # "len": 10737418240, "offset": 134217728,
  3402. # "speed": 0 },
  3403. # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
  3404. #
  3405. ##
  3406. { 'event': 'BLOCK_JOB_CANCELLED',
  3407. 'data': { 'type' : 'BlockJobType',
  3408. 'device': 'str',
  3409. 'len' : 'int',
  3410. 'offset': 'int',
  3411. 'speed' : 'int' } }
  3412. ##
  3413. # @BLOCK_JOB_ERROR:
  3414. #
  3415. # Emitted when a block job encounters an error
  3416. #
  3417. # @device: The job identifier. Originally the device name but other
  3418. # values are allowed since QEMU 2.7
  3419. #
  3420. # @operation: I/O operation
  3421. #
  3422. # @action: action that has been taken
  3423. #
  3424. # Since: 1.3
  3425. #
  3426. # Example:
  3427. #
  3428. # <- { "event": "BLOCK_JOB_ERROR",
  3429. # "data": { "device": "ide0-hd1",
  3430. # "operation": "write",
  3431. # "action": "stop" },
  3432. # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
  3433. #
  3434. ##
  3435. { 'event': 'BLOCK_JOB_ERROR',
  3436. 'data': { 'device' : 'str',
  3437. 'operation': 'IoOperationType',
  3438. 'action' : 'BlockErrorAction' } }
  3439. ##
  3440. # @BLOCK_JOB_READY:
  3441. #
  3442. # Emitted when a block job is ready to complete
  3443. #
  3444. # @type: job type
  3445. #
  3446. # @device: The job identifier. Originally the device name but other
  3447. # values are allowed since QEMU 2.7
  3448. #
  3449. # @len: maximum progress value
  3450. #
  3451. # @offset: current progress value. On success this is equal to len.
  3452. # On failure this is less than len
  3453. #
  3454. # @speed: rate limit, bytes per second
  3455. #
  3456. # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
  3457. # event
  3458. #
  3459. # Since: 1.3
  3460. #
  3461. # Example:
  3462. #
  3463. # <- { "event": "BLOCK_JOB_READY",
  3464. # "data": { "device": "drive0", "type": "mirror", "speed": 0,
  3465. # "len": 2097152, "offset": 2097152 }
  3466. # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
  3467. #
  3468. ##
  3469. { 'event': 'BLOCK_JOB_READY',
  3470. 'data': { 'type' : 'BlockJobType',
  3471. 'device': 'str',
  3472. 'len' : 'int',
  3473. 'offset': 'int',
  3474. 'speed' : 'int' } }
  3475. ##
  3476. # @PreallocMode:
  3477. #
  3478. # Preallocation mode of QEMU image file
  3479. #
  3480. # @off: no preallocation
  3481. # @metadata: preallocate only for metadata
  3482. # @falloc: like @full preallocation but allocate disk space by
  3483. # posix_fallocate() rather than writing zeros.
  3484. # @full: preallocate all data by writing zeros to device to ensure disk
  3485. # space is really available. @full preallocation also sets up
  3486. # metadata correctly.
  3487. #
  3488. # Since: 2.2
  3489. ##
  3490. { 'enum': 'PreallocMode',
  3491. 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
  3492. ##
  3493. # @BLOCK_WRITE_THRESHOLD:
  3494. #
  3495. # Emitted when writes on block device reaches or exceeds the
  3496. # configured write threshold. For thin-provisioned devices, this
  3497. # means the device should be extended to avoid pausing for
  3498. # disk exhaustion.
  3499. # The event is one shot. Once triggered, it needs to be
  3500. # re-registered with another block-set-write-threshold command.
  3501. #
  3502. # @node-name: graph node name on which the threshold was exceeded.
  3503. #
  3504. # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
  3505. #
  3506. # @write-threshold: last configured threshold, in bytes.
  3507. #
  3508. # Since: 2.3
  3509. ##
  3510. { 'event': 'BLOCK_WRITE_THRESHOLD',
  3511. 'data': { 'node-name': 'str',
  3512. 'amount-exceeded': 'uint64',
  3513. 'write-threshold': 'uint64' } }
  3514. ##
  3515. # @block-set-write-threshold:
  3516. #
  3517. # Change the write threshold for a block drive. An event will be
  3518. # delivered if a write to this block drive crosses the configured
  3519. # threshold. The threshold is an offset, thus must be
  3520. # non-negative. Default is no write threshold. Setting the threshold
  3521. # to zero disables it.
  3522. #
  3523. # This is useful to transparently resize thin-provisioned drives without
  3524. # the guest OS noticing.
  3525. #
  3526. # @node-name: graph node name on which the threshold must be set.
  3527. #
  3528. # @write-threshold: configured threshold for the block device, bytes.
  3529. # Use 0 to disable the threshold.
  3530. #
  3531. # Since: 2.3
  3532. #
  3533. # Example:
  3534. #
  3535. # -> { "execute": "block-set-write-threshold",
  3536. # "arguments": { "node-name": "mydev",
  3537. # "write-threshold": 17179869184 } }
  3538. # <- { "return": {} }
  3539. #
  3540. ##
  3541. { 'command': 'block-set-write-threshold',
  3542. 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
  3543. ##
  3544. # @x-blockdev-change:
  3545. #
  3546. # Dynamically reconfigure the block driver state graph. It can be used
  3547. # to add, remove, insert or replace a graph node. Currently only the
  3548. # Quorum driver implements this feature to add or remove its child. This
  3549. # is useful to fix a broken quorum child.
  3550. #
  3551. # If @node is specified, it will be inserted under @parent. @child
  3552. # may not be specified in this case. If both @parent and @child are
  3553. # specified but @node is not, @child will be detached from @parent.
  3554. #
  3555. # @parent: the id or name of the parent node.
  3556. #
  3557. # @child: the name of a child under the given parent node.
  3558. #
  3559. # @node: the name of the node that will be added.
  3560. #
  3561. # Note: this command is experimental, and its API is not stable. It
  3562. # does not support all kinds of operations, all kinds of children, nor
  3563. # all block drivers.
  3564. #
  3565. # Warning: The data in a new quorum child MUST be consistent with that of
  3566. # the rest of the array.
  3567. #
  3568. # Since: 2.7
  3569. #
  3570. # Example:
  3571. #
  3572. # 1. Add a new node to a quorum
  3573. # -> { "execute": "blockdev-add",
  3574. # "arguments": {
  3575. # "driver": "raw",
  3576. # "node-name": "new_node",
  3577. # "file": { "driver": "file",
  3578. # "filename": "test.raw" } } }
  3579. # <- { "return": {} }
  3580. # -> { "execute": "x-blockdev-change",
  3581. # "arguments": { "parent": "disk1",
  3582. # "node": "new_node" } }
  3583. # <- { "return": {} }
  3584. #
  3585. # 2. Delete a quorum's node
  3586. # -> { "execute": "x-blockdev-change",
  3587. # "arguments": { "parent": "disk1",
  3588. # "child": "children.1" } }
  3589. # <- { "return": {} }
  3590. #
  3591. ##
  3592. { 'command': 'x-blockdev-change',
  3593. 'data' : { 'parent': 'str',
  3594. '*child': 'str',
  3595. '*node': 'str' } }