block-core.json 187 KB

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