2
0

qmp-commands.hx 100 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757
  1. HXCOMM QMP dispatch table and documentation
  2. HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
  3. HXCOMM does not show up in the other formats.
  4. SQMP
  5. QMP Supported Commands
  6. ----------------------
  7. This document describes all commands currently supported by QMP.
  8. Most of the time their usage is exactly the same as in the user Monitor, this
  9. means that any other document which also describe commands (the manpage,
  10. QEMU's manual, etc) can and should be consulted.
  11. QMP has two types of commands: regular and query commands. Regular commands
  12. usually change the Virtual Machine's state someway, while query commands just
  13. return information. The sections below are divided accordingly.
  14. It's important to observe that all communication examples are formatted in
  15. a reader-friendly way, so that they're easier to understand. However, in real
  16. protocol usage, they're emitted as a single line.
  17. Also, the following notation is used to denote data flow:
  18. -> data issued by the Client
  19. <- Server data response
  20. Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
  21. information on the Server command and response formats.
  22. NOTE: This document is temporary and will be replaced soon.
  23. 1. Stability Considerations
  24. ===========================
  25. The current QMP command set (described in this file) may be useful for a
  26. number of use cases, however it's limited and several commands have bad
  27. defined semantics, specially with regard to command completion.
  28. These problems are going to be solved incrementally in the next QEMU releases
  29. and we're going to establish a deprecation policy for badly defined commands.
  30. If you're planning to adopt QMP, please observe the following:
  31. 1. The deprecation policy will take effect and be documented soon, please
  32. check the documentation of each used command as soon as a new release of
  33. QEMU is available
  34. 2. DO NOT rely on anything which is not explicit documented
  35. 3. Errors, in special, are not documented. Applications should NOT check
  36. for specific errors classes or data (it's strongly recommended to only
  37. check for the "error" key)
  38. 2. Regular Commands
  39. ===================
  40. Server's responses in the examples below are always a success response, please
  41. refer to the QMP specification for more details on error responses.
  42. EQMP
  43. {
  44. .name = "quit",
  45. .args_type = "",
  46. .mhandler.cmd_new = qmp_marshal_input_quit,
  47. },
  48. SQMP
  49. quit
  50. ----
  51. Quit the emulator.
  52. Arguments: None.
  53. Example:
  54. -> { "execute": "quit" }
  55. <- { "return": {} }
  56. EQMP
  57. {
  58. .name = "eject",
  59. .args_type = "force:-f,device:B",
  60. .mhandler.cmd_new = qmp_marshal_input_eject,
  61. },
  62. SQMP
  63. eject
  64. -----
  65. Eject a removable medium.
  66. Arguments:
  67. - force: force ejection (json-bool, optional)
  68. - device: device name (json-string)
  69. Example:
  70. -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
  71. <- { "return": {} }
  72. Note: The "force" argument defaults to false.
  73. EQMP
  74. {
  75. .name = "change",
  76. .args_type = "device:B,target:F,arg:s?",
  77. .mhandler.cmd_new = qmp_marshal_input_change,
  78. },
  79. SQMP
  80. change
  81. ------
  82. Change a removable medium or VNC configuration.
  83. Arguments:
  84. - "device": device name (json-string)
  85. - "target": filename or item (json-string)
  86. - "arg": additional argument (json-string, optional)
  87. Examples:
  88. 1. Change a removable medium
  89. -> { "execute": "change",
  90. "arguments": { "device": "ide1-cd0",
  91. "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
  92. <- { "return": {} }
  93. 2. Change VNC password
  94. -> { "execute": "change",
  95. "arguments": { "device": "vnc", "target": "password",
  96. "arg": "foobar1" } }
  97. <- { "return": {} }
  98. EQMP
  99. {
  100. .name = "screendump",
  101. .args_type = "filename:F",
  102. .mhandler.cmd_new = qmp_marshal_input_screendump,
  103. },
  104. SQMP
  105. screendump
  106. ----------
  107. Save screen into PPM image.
  108. Arguments:
  109. - "filename": file path (json-string)
  110. Example:
  111. -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
  112. <- { "return": {} }
  113. EQMP
  114. {
  115. .name = "stop",
  116. .args_type = "",
  117. .mhandler.cmd_new = qmp_marshal_input_stop,
  118. },
  119. SQMP
  120. stop
  121. ----
  122. Stop the emulator.
  123. Arguments: None.
  124. Example:
  125. -> { "execute": "stop" }
  126. <- { "return": {} }
  127. EQMP
  128. {
  129. .name = "cont",
  130. .args_type = "",
  131. .mhandler.cmd_new = qmp_marshal_input_cont,
  132. },
  133. SQMP
  134. cont
  135. ----
  136. Resume emulation.
  137. Arguments: None.
  138. Example:
  139. -> { "execute": "cont" }
  140. <- { "return": {} }
  141. EQMP
  142. {
  143. .name = "system_wakeup",
  144. .args_type = "",
  145. .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
  146. },
  147. SQMP
  148. system_wakeup
  149. -------------
  150. Wakeup guest from suspend.
  151. Arguments: None.
  152. Example:
  153. -> { "execute": "system_wakeup" }
  154. <- { "return": {} }
  155. EQMP
  156. {
  157. .name = "system_reset",
  158. .args_type = "",
  159. .mhandler.cmd_new = qmp_marshal_input_system_reset,
  160. },
  161. SQMP
  162. system_reset
  163. ------------
  164. Reset the system.
  165. Arguments: None.
  166. Example:
  167. -> { "execute": "system_reset" }
  168. <- { "return": {} }
  169. EQMP
  170. {
  171. .name = "system_powerdown",
  172. .args_type = "",
  173. .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
  174. },
  175. SQMP
  176. system_powerdown
  177. ----------------
  178. Send system power down event.
  179. Arguments: None.
  180. Example:
  181. -> { "execute": "system_powerdown" }
  182. <- { "return": {} }
  183. EQMP
  184. {
  185. .name = "device_add",
  186. .args_type = "device:O",
  187. .params = "driver[,prop=value][,...]",
  188. .help = "add device, like -device on the command line",
  189. .user_print = monitor_user_noop,
  190. .mhandler.cmd_new = do_device_add,
  191. },
  192. SQMP
  193. device_add
  194. ----------
  195. Add a device.
  196. Arguments:
  197. - "driver": the name of the new device's driver (json-string)
  198. - "bus": the device's parent bus (device tree path, json-string, optional)
  199. - "id": the device's ID, must be unique (json-string)
  200. - device properties
  201. Example:
  202. -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
  203. <- { "return": {} }
  204. Notes:
  205. (1) For detailed information about this command, please refer to the
  206. 'docs/qdev-device-use.txt' file.
  207. (2) It's possible to list device properties by running QEMU with the
  208. "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
  209. EQMP
  210. {
  211. .name = "device_del",
  212. .args_type = "id:s",
  213. .mhandler.cmd_new = qmp_marshal_input_device_del,
  214. },
  215. SQMP
  216. device_del
  217. ----------
  218. Remove a device.
  219. Arguments:
  220. - "id": the device's ID (json-string)
  221. Example:
  222. -> { "execute": "device_del", "arguments": { "id": "net1" } }
  223. <- { "return": {} }
  224. EQMP
  225. {
  226. .name = "send-key",
  227. .args_type = "keys:O,hold-time:i?",
  228. .mhandler.cmd_new = qmp_marshal_input_send_key,
  229. },
  230. SQMP
  231. send-key
  232. ----------
  233. Send keys to VM.
  234. Arguments:
  235. keys array:
  236. - "key": key sequence (a json-array of key union values,
  237. union can be number or qcode enum)
  238. - hold-time: time to delay key up events, milliseconds. Defaults to 100
  239. (json-int, optional)
  240. Example:
  241. -> { "execute": "send-key",
  242. "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
  243. { "type": "qcode", "data": "alt" },
  244. { "type": "qcode", "data": "delete" } ] } }
  245. <- { "return": {} }
  246. EQMP
  247. {
  248. .name = "cpu",
  249. .args_type = "index:i",
  250. .mhandler.cmd_new = qmp_marshal_input_cpu,
  251. },
  252. SQMP
  253. cpu
  254. ---
  255. Set the default CPU.
  256. Arguments:
  257. - "index": the CPU's index (json-int)
  258. Example:
  259. -> { "execute": "cpu", "arguments": { "index": 0 } }
  260. <- { "return": {} }
  261. Note: CPUs' indexes are obtained with the 'query-cpus' command.
  262. EQMP
  263. {
  264. .name = "cpu-add",
  265. .args_type = "id:i",
  266. .mhandler.cmd_new = qmp_marshal_input_cpu_add,
  267. },
  268. SQMP
  269. cpu-add
  270. -------
  271. Adds virtual cpu
  272. Arguments:
  273. - "id": cpu id (json-int)
  274. Example:
  275. -> { "execute": "cpu-add", "arguments": { "id": 2 } }
  276. <- { "return": {} }
  277. EQMP
  278. {
  279. .name = "memsave",
  280. .args_type = "val:l,size:i,filename:s,cpu:i?",
  281. .mhandler.cmd_new = qmp_marshal_input_memsave,
  282. },
  283. SQMP
  284. memsave
  285. -------
  286. Save to disk virtual memory dump starting at 'val' of size 'size'.
  287. Arguments:
  288. - "val": the starting address (json-int)
  289. - "size": the memory size, in bytes (json-int)
  290. - "filename": file path (json-string)
  291. - "cpu": virtual CPU index (json-int, optional)
  292. Example:
  293. -> { "execute": "memsave",
  294. "arguments": { "val": 10,
  295. "size": 100,
  296. "filename": "/tmp/virtual-mem-dump" } }
  297. <- { "return": {} }
  298. EQMP
  299. {
  300. .name = "pmemsave",
  301. .args_type = "val:l,size:i,filename:s",
  302. .mhandler.cmd_new = qmp_marshal_input_pmemsave,
  303. },
  304. SQMP
  305. pmemsave
  306. --------
  307. Save to disk physical memory dump starting at 'val' of size 'size'.
  308. Arguments:
  309. - "val": the starting address (json-int)
  310. - "size": the memory size, in bytes (json-int)
  311. - "filename": file path (json-string)
  312. Example:
  313. -> { "execute": "pmemsave",
  314. "arguments": { "val": 10,
  315. "size": 100,
  316. "filename": "/tmp/physical-mem-dump" } }
  317. <- { "return": {} }
  318. EQMP
  319. {
  320. .name = "inject-nmi",
  321. .args_type = "",
  322. .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
  323. },
  324. SQMP
  325. inject-nmi
  326. ----------
  327. Inject an NMI on guest's CPUs.
  328. Arguments: None.
  329. Example:
  330. -> { "execute": "inject-nmi" }
  331. <- { "return": {} }
  332. Note: inject-nmi fails when the guest doesn't support injecting.
  333. Currently, only x86 (NMI) and s390x (RESTART) guests do.
  334. EQMP
  335. {
  336. .name = "ringbuf-write",
  337. .args_type = "device:s,data:s,format:s?",
  338. .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
  339. },
  340. SQMP
  341. ringbuf-write
  342. -------------
  343. Write to a ring buffer character device.
  344. Arguments:
  345. - "device": ring buffer character device name (json-string)
  346. - "data": data to write (json-string)
  347. - "format": data format (json-string, optional)
  348. - Possible values: "utf8" (default), "base64"
  349. Bug: invalid base64 is currently not rejected.
  350. Whitespace *is* invalid.
  351. Example:
  352. -> { "execute": "ringbuf-write",
  353. "arguments": { "device": "foo",
  354. "data": "abcdefgh",
  355. "format": "utf8" } }
  356. <- { "return": {} }
  357. EQMP
  358. {
  359. .name = "ringbuf-read",
  360. .args_type = "device:s,size:i,format:s?",
  361. .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
  362. },
  363. SQMP
  364. ringbuf-read
  365. -------------
  366. Read from a ring buffer character device.
  367. Arguments:
  368. - "device": ring buffer character device name (json-string)
  369. - "size": how many bytes to read at most (json-int)
  370. - Number of data bytes, not number of characters in encoded data
  371. - "format": data format (json-string, optional)
  372. - Possible values: "utf8" (default), "base64"
  373. - Naturally, format "utf8" works only when the ring buffer
  374. contains valid UTF-8 text. Invalid UTF-8 sequences get
  375. replaced. Bug: replacement doesn't work. Bug: can screw
  376. up on encountering NUL characters, after the ring buffer
  377. lost data, and when reading stops because the size limit
  378. is reached.
  379. Example:
  380. -> { "execute": "ringbuf-read",
  381. "arguments": { "device": "foo",
  382. "size": 1000,
  383. "format": "utf8" } }
  384. <- {"return": "abcdefgh"}
  385. EQMP
  386. {
  387. .name = "xen-save-devices-state",
  388. .args_type = "filename:F",
  389. .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
  390. },
  391. SQMP
  392. xen-save-devices-state
  393. -------
  394. Save the state of all devices to file. The RAM and the block devices
  395. of the VM are not saved by this command.
  396. Arguments:
  397. - "filename": the file to save the state of the devices to as binary
  398. data. See xen-save-devices-state.txt for a description of the binary
  399. format.
  400. Example:
  401. -> { "execute": "xen-save-devices-state",
  402. "arguments": { "filename": "/tmp/save" } }
  403. <- { "return": {} }
  404. EQMP
  405. {
  406. .name = "xen-set-global-dirty-log",
  407. .args_type = "enable:b",
  408. .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
  409. },
  410. SQMP
  411. xen-set-global-dirty-log
  412. -------
  413. Enable or disable the global dirty log mode.
  414. Arguments:
  415. - "enable": Enable it or disable it.
  416. Example:
  417. -> { "execute": "xen-set-global-dirty-log",
  418. "arguments": { "enable": true } }
  419. <- { "return": {} }
  420. EQMP
  421. {
  422. .name = "migrate",
  423. .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
  424. .mhandler.cmd_new = qmp_marshal_input_migrate,
  425. },
  426. SQMP
  427. migrate
  428. -------
  429. Migrate to URI.
  430. Arguments:
  431. - "blk": block migration, full disk copy (json-bool, optional)
  432. - "inc": incremental disk copy (json-bool, optional)
  433. - "uri": Destination URI (json-string)
  434. Example:
  435. -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
  436. <- { "return": {} }
  437. Notes:
  438. (1) The 'query-migrate' command should be used to check migration's progress
  439. and final result (this information is provided by the 'status' member)
  440. (2) All boolean arguments default to false
  441. (3) The user Monitor's "detach" argument is invalid in QMP and should not
  442. be used
  443. EQMP
  444. {
  445. .name = "migrate_cancel",
  446. .args_type = "",
  447. .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
  448. },
  449. SQMP
  450. migrate_cancel
  451. --------------
  452. Cancel the current migration.
  453. Arguments: None.
  454. Example:
  455. -> { "execute": "migrate_cancel" }
  456. <- { "return": {} }
  457. EQMP
  458. {
  459. .name = "migrate-set-cache-size",
  460. .args_type = "value:o",
  461. .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
  462. },
  463. SQMP
  464. migrate-set-cache-size
  465. ----------------------
  466. Set cache size to be used by XBZRLE migration, the cache size will be rounded
  467. down to the nearest power of 2
  468. Arguments:
  469. - "value": cache size in bytes (json-int)
  470. Example:
  471. -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
  472. <- { "return": {} }
  473. EQMP
  474. {
  475. .name = "query-migrate-cache-size",
  476. .args_type = "",
  477. .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
  478. },
  479. SQMP
  480. query-migrate-cache-size
  481. ------------------------
  482. Show cache size to be used by XBZRLE migration
  483. returns a json-object with the following information:
  484. - "size" : json-int
  485. Example:
  486. -> { "execute": "query-migrate-cache-size" }
  487. <- { "return": 67108864 }
  488. EQMP
  489. {
  490. .name = "migrate_set_speed",
  491. .args_type = "value:o",
  492. .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
  493. },
  494. SQMP
  495. migrate_set_speed
  496. -----------------
  497. Set maximum speed for migrations.
  498. Arguments:
  499. - "value": maximum speed, in bytes per second (json-int)
  500. Example:
  501. -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
  502. <- { "return": {} }
  503. EQMP
  504. {
  505. .name = "migrate_set_downtime",
  506. .args_type = "value:T",
  507. .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
  508. },
  509. SQMP
  510. migrate_set_downtime
  511. --------------------
  512. Set maximum tolerated downtime (in seconds) for migrations.
  513. Arguments:
  514. - "value": maximum downtime (json-number)
  515. Example:
  516. -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
  517. <- { "return": {} }
  518. EQMP
  519. {
  520. .name = "client_migrate_info",
  521. .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
  522. .params = "protocol hostname port tls-port cert-subject",
  523. .help = "send migration info to spice/vnc client",
  524. .user_print = monitor_user_noop,
  525. .mhandler.cmd_async = client_migrate_info,
  526. .flags = MONITOR_CMD_ASYNC,
  527. },
  528. SQMP
  529. client_migrate_info
  530. ------------------
  531. Set the spice/vnc connection info for the migration target. The spice/vnc
  532. server will ask the spice/vnc client to automatically reconnect using the
  533. new parameters (if specified) once the vm migration finished successfully.
  534. Arguments:
  535. - "protocol": protocol: "spice" or "vnc" (json-string)
  536. - "hostname": migration target hostname (json-string)
  537. - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
  538. - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
  539. - "cert-subject": server certificate subject (json-string, optional)
  540. Example:
  541. -> { "execute": "client_migrate_info",
  542. "arguments": { "protocol": "spice",
  543. "hostname": "virt42.lab.kraxel.org",
  544. "port": 1234 } }
  545. <- { "return": {} }
  546. EQMP
  547. {
  548. .name = "dump-guest-memory",
  549. .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
  550. .params = "-p protocol [begin] [length] [format]",
  551. .help = "dump guest memory to file",
  552. .user_print = monitor_user_noop,
  553. .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
  554. },
  555. SQMP
  556. dump
  557. Dump guest memory to file. The file can be processed with crash or gdb.
  558. Arguments:
  559. - "paging": do paging to get guest's memory mapping (json-bool)
  560. - "protocol": destination file(started with "file:") or destination file
  561. descriptor (started with "fd:") (json-string)
  562. - "begin": the starting physical address. It's optional, and should be specified
  563. with length together (json-int)
  564. - "length": the memory size, in bytes. It's optional, and should be specified
  565. with begin together (json-int)
  566. - "format": the format of guest memory dump. It's optional, and can be
  567. elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
  568. conflict with paging and filter, ie. begin and length (json-string)
  569. Example:
  570. -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
  571. <- { "return": {} }
  572. Notes:
  573. (1) All boolean arguments default to false
  574. EQMP
  575. {
  576. .name = "query-dump-guest-memory-capability",
  577. .args_type = "",
  578. .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
  579. },
  580. SQMP
  581. query-dump-guest-memory-capability
  582. ----------
  583. Show available formats for 'dump-guest-memory'
  584. Example:
  585. -> { "execute": "query-dump-guest-memory-capability" }
  586. <- { "return": { "formats":
  587. ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
  588. EQMP
  589. {
  590. .name = "netdev_add",
  591. .args_type = "netdev:O",
  592. .mhandler.cmd_new = qmp_netdev_add,
  593. },
  594. SQMP
  595. netdev_add
  596. ----------
  597. Add host network device.
  598. Arguments:
  599. - "type": the device type, "tap", "user", ... (json-string)
  600. - "id": the device's ID, must be unique (json-string)
  601. - device options
  602. Example:
  603. -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
  604. <- { "return": {} }
  605. Note: The supported device options are the same ones supported by the '-netdev'
  606. command-line argument, which are listed in the '-help' output or QEMU's
  607. manual
  608. EQMP
  609. {
  610. .name = "netdev_del",
  611. .args_type = "id:s",
  612. .mhandler.cmd_new = qmp_marshal_input_netdev_del,
  613. },
  614. SQMP
  615. netdev_del
  616. ----------
  617. Remove host network device.
  618. Arguments:
  619. - "id": the device's ID, must be unique (json-string)
  620. Example:
  621. -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
  622. <- { "return": {} }
  623. EQMP
  624. {
  625. .name = "object-add",
  626. .args_type = "qom-type:s,id:s,props:q?",
  627. .mhandler.cmd_new = qmp_object_add,
  628. },
  629. SQMP
  630. object-add
  631. ----------
  632. Create QOM object.
  633. Arguments:
  634. - "qom-type": the object's QOM type, i.e. the class name (json-string)
  635. - "id": the object's ID, must be unique (json-string)
  636. - "props": a dictionary of object property values (optional, json-dict)
  637. Example:
  638. -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
  639. "props": { "filename": "/dev/hwrng" } } }
  640. <- { "return": {} }
  641. EQMP
  642. {
  643. .name = "object-del",
  644. .args_type = "id:s",
  645. .mhandler.cmd_new = qmp_marshal_input_object_del,
  646. },
  647. SQMP
  648. object-del
  649. ----------
  650. Remove QOM object.
  651. Arguments:
  652. - "id": the object's ID (json-string)
  653. Example:
  654. -> { "execute": "object-del", "arguments": { "id": "rng1" } }
  655. <- { "return": {} }
  656. EQMP
  657. {
  658. .name = "block_resize",
  659. .args_type = "device:s?,node-name:s?,size:o",
  660. .mhandler.cmd_new = qmp_marshal_input_block_resize,
  661. },
  662. SQMP
  663. block_resize
  664. ------------
  665. Resize a block image while a guest is running.
  666. Arguments:
  667. - "device": the device's ID, must be unique (json-string)
  668. - "node-name": the node name in the block driver state graph (json-string)
  669. - "size": new size
  670. Example:
  671. -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
  672. <- { "return": {} }
  673. EQMP
  674. {
  675. .name = "block-stream",
  676. .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
  677. .mhandler.cmd_new = qmp_marshal_input_block_stream,
  678. },
  679. {
  680. .name = "block-commit",
  681. .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
  682. .mhandler.cmd_new = qmp_marshal_input_block_commit,
  683. },
  684. SQMP
  685. block-commit
  686. ------------
  687. Live commit of data from overlay image nodes into backing nodes - i.e., writes
  688. data between 'top' and 'base' into 'base'.
  689. Arguments:
  690. - "device": The device's ID, must be unique (json-string)
  691. - "base": The file name of the backing image to write data into.
  692. If not specified, this is the deepest backing image
  693. (json-string, optional)
  694. - "top": The file name of the backing image within the image chain,
  695. which contains the topmost data to be committed down. If
  696. not specified, this is the active layer. (json-string, optional)
  697. - backing-file: The backing file string to write into the overlay
  698. image of 'top'. If 'top' is the active layer,
  699. specifying a backing file string is an error. This
  700. filename is not validated.
  701. If a pathname string is such that it cannot be
  702. resolved by QEMU, that means that subsequent QMP or
  703. HMP commands must use node-names for the image in
  704. question, as filename lookup methods will fail.
  705. If not specified, QEMU will automatically determine
  706. the backing file string to use, or error out if
  707. there is no obvious choice. Care should be taken
  708. when specifying the string, to specify a valid
  709. filename or protocol.
  710. (json-string, optional) (Since 2.1)
  711. If top == base, that is an error.
  712. If top == active, the job will not be completed by itself,
  713. user needs to complete the job with the block-job-complete
  714. command after getting the ready event. (Since 2.0)
  715. If the base image is smaller than top, then the base image
  716. will be resized to be the same size as top. If top is
  717. smaller than the base image, the base will not be
  718. truncated. If you want the base image size to match the
  719. size of the smaller top, you can safely truncate it
  720. yourself once the commit operation successfully completes.
  721. (json-string)
  722. - "speed": the maximum speed, in bytes per second (json-int, optional)
  723. Example:
  724. -> { "execute": "block-commit", "arguments": { "device": "virtio0",
  725. "top": "/tmp/snap1.qcow2" } }
  726. <- { "return": {} }
  727. EQMP
  728. {
  729. .name = "drive-backup",
  730. .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
  731. "on-source-error:s?,on-target-error:s?",
  732. .mhandler.cmd_new = qmp_marshal_input_drive_backup,
  733. },
  734. SQMP
  735. drive-backup
  736. ------------
  737. Start a point-in-time copy of a block device to a new destination. The
  738. status of ongoing drive-backup operations can be checked with
  739. query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
  740. The operation can be stopped before it has completed using the
  741. block-job-cancel command.
  742. Arguments:
  743. - "device": the name of the device which should be copied.
  744. (json-string)
  745. - "target": the target of the new image. If the file exists, or if it is a
  746. device, the existing file/device will be used as the new
  747. destination. If it does not exist, a new file will be created.
  748. (json-string)
  749. - "format": the format of the new destination, default is to probe if 'mode' is
  750. 'existing', else the format of the source
  751. (json-string, optional)
  752. - "sync": what parts of the disk image should be copied to the destination;
  753. possibilities include "full" for all the disk, "top" for only the sectors
  754. allocated in the topmost image, or "none" to only replicate new I/O
  755. (MirrorSyncMode).
  756. - "mode": whether and how QEMU should create a new image
  757. (NewImageMode, optional, default 'absolute-paths')
  758. - "speed": the maximum speed, in bytes per second (json-int, optional)
  759. - "on-source-error": the action to take on an error on the source, default
  760. 'report'. 'stop' and 'enospc' can only be used
  761. if the block device supports io-status.
  762. (BlockdevOnError, optional)
  763. - "on-target-error": the action to take on an error on the target, default
  764. 'report' (no limitations, since this applies to
  765. a different block device than device).
  766. (BlockdevOnError, optional)
  767. Example:
  768. -> { "execute": "drive-backup", "arguments": { "device": "drive0",
  769. "sync": "full",
  770. "target": "backup.img" } }
  771. <- { "return": {} }
  772. EQMP
  773. {
  774. .name = "block-job-set-speed",
  775. .args_type = "device:B,speed:o",
  776. .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
  777. },
  778. {
  779. .name = "block-job-cancel",
  780. .args_type = "device:B,force:b?",
  781. .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
  782. },
  783. {
  784. .name = "block-job-pause",
  785. .args_type = "device:B",
  786. .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
  787. },
  788. {
  789. .name = "block-job-resume",
  790. .args_type = "device:B",
  791. .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
  792. },
  793. {
  794. .name = "block-job-complete",
  795. .args_type = "device:B",
  796. .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
  797. },
  798. {
  799. .name = "transaction",
  800. .args_type = "actions:q",
  801. .mhandler.cmd_new = qmp_marshal_input_transaction,
  802. },
  803. SQMP
  804. transaction
  805. -----------
  806. Atomically operate on one or more block devices. The only supported operations
  807. for now are drive-backup, internal and external snapshotting. A list of
  808. dictionaries is accepted, that contains the actions to be performed.
  809. If there is any failure performing any of the operations, all operations
  810. for the group are abandoned.
  811. For external snapshots, the dictionary contains the device, the file to use for
  812. the new snapshot, and the format. The default format, if not specified, is
  813. qcow2.
  814. Each new snapshot defaults to being created by QEMU (wiping any
  815. contents if the file already exists), but it is also possible to reuse
  816. an externally-created file. In the latter case, you should ensure that
  817. the new image file has the same contents as the current one; QEMU cannot
  818. perform any meaningful check. Typically this is achieved by using the
  819. current image file as the backing file for the new image.
  820. On failure, the original disks pre-snapshot attempt will be used.
  821. For internal snapshots, the dictionary contains the device and the snapshot's
  822. name. If an internal snapshot matching name already exists, the request will
  823. be rejected. Only some image formats support it, for example, qcow2, rbd,
  824. and sheepdog.
  825. On failure, qemu will try delete the newly created internal snapshot in the
  826. transaction. When an I/O error occurs during deletion, the user needs to fix
  827. it later with qemu-img or other command.
  828. Arguments:
  829. actions array:
  830. - "type": the operation to perform. The only supported
  831. value is "blockdev-snapshot-sync". (json-string)
  832. - "data": a dictionary. The contents depend on the value
  833. of "type". When "type" is "blockdev-snapshot-sync":
  834. - "device": device name to snapshot (json-string)
  835. - "node-name": graph node name to snapshot (json-string)
  836. - "snapshot-file": name of new image file (json-string)
  837. - "snapshot-node-name": graph node name of the new snapshot (json-string)
  838. - "format": format of new image (json-string, optional)
  839. - "mode": whether and how QEMU should create the snapshot file
  840. (NewImageMode, optional, default "absolute-paths")
  841. When "type" is "blockdev-snapshot-internal-sync":
  842. - "device": device name to snapshot (json-string)
  843. - "name": name of the new snapshot (json-string)
  844. Example:
  845. -> { "execute": "transaction",
  846. "arguments": { "actions": [
  847. { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
  848. "snapshot-file": "/some/place/my-image",
  849. "format": "qcow2" } },
  850. { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
  851. "snapshot-file": "/some/place/my-image2",
  852. "snapshot-node-name": "node3432",
  853. "mode": "existing",
  854. "format": "qcow2" } },
  855. { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
  856. "snapshot-file": "/some/place/my-image2",
  857. "mode": "existing",
  858. "format": "qcow2" } },
  859. { "type": "blockdev-snapshot-internal-sync", "data" : {
  860. "device": "ide-hd2",
  861. "name": "snapshot0" } } ] } }
  862. <- { "return": {} }
  863. EQMP
  864. {
  865. .name = "blockdev-snapshot-sync",
  866. .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
  867. .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
  868. },
  869. SQMP
  870. blockdev-snapshot-sync
  871. ----------------------
  872. Synchronous snapshot of a block device. snapshot-file specifies the
  873. target of the new image. If the file exists, or if it is a device, the
  874. snapshot will be created in the existing file/device. If does not
  875. exist, a new file will be created. format specifies the format of the
  876. snapshot image, default is qcow2.
  877. Arguments:
  878. - "device": device name to snapshot (json-string)
  879. - "node-name": graph node name to snapshot (json-string)
  880. - "snapshot-file": name of new image file (json-string)
  881. - "snapshot-node-name": graph node name of the new snapshot (json-string)
  882. - "mode": whether and how QEMU should create the snapshot file
  883. (NewImageMode, optional, default "absolute-paths")
  884. - "format": format of new image (json-string, optional)
  885. Example:
  886. -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
  887. "snapshot-file":
  888. "/some/place/my-image",
  889. "format": "qcow2" } }
  890. <- { "return": {} }
  891. EQMP
  892. {
  893. .name = "blockdev-snapshot-internal-sync",
  894. .args_type = "device:B,name:s",
  895. .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
  896. },
  897. SQMP
  898. blockdev-snapshot-internal-sync
  899. -------------------------------
  900. Synchronously take an internal snapshot of a block device when the format of
  901. image used supports it. If the name is an empty string, or a snapshot with
  902. name already exists, the operation will fail.
  903. Arguments:
  904. - "device": device name to snapshot (json-string)
  905. - "name": name of the new snapshot (json-string)
  906. Example:
  907. -> { "execute": "blockdev-snapshot-internal-sync",
  908. "arguments": { "device": "ide-hd0",
  909. "name": "snapshot0" }
  910. }
  911. <- { "return": {} }
  912. EQMP
  913. {
  914. .name = "blockdev-snapshot-delete-internal-sync",
  915. .args_type = "device:B,id:s?,name:s?",
  916. .mhandler.cmd_new =
  917. qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
  918. },
  919. SQMP
  920. blockdev-snapshot-delete-internal-sync
  921. --------------------------------------
  922. Synchronously delete an internal snapshot of a block device when the format of
  923. image used supports it. The snapshot is identified by name or id or both. One
  924. of name or id is required. If the snapshot is not found, the operation will
  925. fail.
  926. Arguments:
  927. - "device": device name (json-string)
  928. - "id": ID of the snapshot (json-string, optional)
  929. - "name": name of the snapshot (json-string, optional)
  930. Example:
  931. -> { "execute": "blockdev-snapshot-delete-internal-sync",
  932. "arguments": { "device": "ide-hd0",
  933. "name": "snapshot0" }
  934. }
  935. <- { "return": {
  936. "id": "1",
  937. "name": "snapshot0",
  938. "vm-state-size": 0,
  939. "date-sec": 1000012,
  940. "date-nsec": 10,
  941. "vm-clock-sec": 100,
  942. "vm-clock-nsec": 20
  943. }
  944. }
  945. EQMP
  946. {
  947. .name = "drive-mirror",
  948. .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
  949. "node-name:s?,replaces:s?,"
  950. "on-source-error:s?,on-target-error:s?,"
  951. "granularity:i?,buf-size:i?",
  952. .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
  953. },
  954. SQMP
  955. drive-mirror
  956. ------------
  957. Start mirroring a block device's writes to a new destination. target
  958. specifies the target of the new image. If the file exists, or if it is
  959. a device, it will be used as the new destination for writes. If it does not
  960. exist, a new file will be created. format specifies the format of the
  961. mirror image, default is to probe if mode='existing', else the format
  962. of the source.
  963. Arguments:
  964. - "device": device name to operate on (json-string)
  965. - "target": name of new image file (json-string)
  966. - "format": format of new image (json-string, optional)
  967. - "node-name": the name of the new block driver state in the node graph
  968. (json-string, optional)
  969. - "replaces": the block driver node name to replace when finished
  970. (json-string, optional)
  971. - "mode": how an image file should be created into the target
  972. file/device (NewImageMode, optional, default 'absolute-paths')
  973. - "speed": maximum speed of the streaming job, in bytes per second
  974. (json-int)
  975. - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
  976. - "buf_size": maximum amount of data in flight from source to target, in bytes
  977. (json-int, default 10M)
  978. - "sync": what parts of the disk image should be copied to the destination;
  979. possibilities include "full" for all the disk, "top" for only the sectors
  980. allocated in the topmost image, or "none" to only replicate new I/O
  981. (MirrorSyncMode).
  982. - "on-source-error": the action to take on an error on the source
  983. (BlockdevOnError, default 'report')
  984. - "on-target-error": the action to take on an error on the target
  985. (BlockdevOnError, default 'report')
  986. The default value of the granularity is the image cluster size clamped
  987. between 4096 and 65536, if the image format defines one. If the format
  988. does not define a cluster size, the default value of the granularity
  989. is 65536.
  990. Example:
  991. -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
  992. "target": "/some/place/my-image",
  993. "sync": "full",
  994. "format": "qcow2" } }
  995. <- { "return": {} }
  996. EQMP
  997. {
  998. .name = "change-backing-file",
  999. .args_type = "device:s,image-node-name:s,backing-file:s",
  1000. .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
  1001. },
  1002. SQMP
  1003. change-backing-file
  1004. -------------------
  1005. Since: 2.1
  1006. Change the backing file in the image file metadata. This does not cause
  1007. QEMU to reopen the image file to reparse the backing filename (it may,
  1008. however, perform a reopen to change permissions from r/o -> r/w -> r/o,
  1009. if needed). The new backing file string is written into the image file
  1010. metadata, and the QEMU internal strings are updated.
  1011. Arguments:
  1012. - "image-node-name": The name of the block driver state node of the
  1013. image to modify. The "device" is argument is used to
  1014. verify "image-node-name" is in the chain described by
  1015. "device".
  1016. (json-string, optional)
  1017. - "device": The name of the device.
  1018. (json-string)
  1019. - "backing-file": The string to write as the backing file. This string is
  1020. not validated, so care should be taken when specifying
  1021. the string or the image chain may not be able to be
  1022. reopened again.
  1023. (json-string)
  1024. Returns: Nothing on success
  1025. If "device" does not exist or cannot be determined, DeviceNotFound
  1026. EQMP
  1027. {
  1028. .name = "balloon",
  1029. .args_type = "value:M",
  1030. .mhandler.cmd_new = qmp_marshal_input_balloon,
  1031. },
  1032. SQMP
  1033. balloon
  1034. -------
  1035. Request VM to change its memory allocation (in bytes).
  1036. Arguments:
  1037. - "value": New memory allocation (json-int)
  1038. Example:
  1039. -> { "execute": "balloon", "arguments": { "value": 536870912 } }
  1040. <- { "return": {} }
  1041. EQMP
  1042. {
  1043. .name = "set_link",
  1044. .args_type = "name:s,up:b",
  1045. .mhandler.cmd_new = qmp_marshal_input_set_link,
  1046. },
  1047. SQMP
  1048. set_link
  1049. --------
  1050. Change the link status of a network adapter.
  1051. Arguments:
  1052. - "name": network device name (json-string)
  1053. - "up": status is up (json-bool)
  1054. Example:
  1055. -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
  1056. <- { "return": {} }
  1057. EQMP
  1058. {
  1059. .name = "getfd",
  1060. .args_type = "fdname:s",
  1061. .params = "getfd name",
  1062. .help = "receive a file descriptor via SCM rights and assign it a name",
  1063. .mhandler.cmd_new = qmp_marshal_input_getfd,
  1064. },
  1065. SQMP
  1066. getfd
  1067. -----
  1068. Receive a file descriptor via SCM rights and assign it a name.
  1069. Arguments:
  1070. - "fdname": file descriptor name (json-string)
  1071. Example:
  1072. -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
  1073. <- { "return": {} }
  1074. Notes:
  1075. (1) If the name specified by the "fdname" argument already exists,
  1076. the file descriptor assigned to it will be closed and replaced
  1077. by the received file descriptor.
  1078. (2) The 'closefd' command can be used to explicitly close the file
  1079. descriptor when it is no longer needed.
  1080. EQMP
  1081. {
  1082. .name = "closefd",
  1083. .args_type = "fdname:s",
  1084. .params = "closefd name",
  1085. .help = "close a file descriptor previously passed via SCM rights",
  1086. .mhandler.cmd_new = qmp_marshal_input_closefd,
  1087. },
  1088. SQMP
  1089. closefd
  1090. -------
  1091. Close a file descriptor previously passed via SCM rights.
  1092. Arguments:
  1093. - "fdname": file descriptor name (json-string)
  1094. Example:
  1095. -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
  1096. <- { "return": {} }
  1097. EQMP
  1098. {
  1099. .name = "add-fd",
  1100. .args_type = "fdset-id:i?,opaque:s?",
  1101. .params = "add-fd fdset-id opaque",
  1102. .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
  1103. .mhandler.cmd_new = qmp_marshal_input_add_fd,
  1104. },
  1105. SQMP
  1106. add-fd
  1107. -------
  1108. Add a file descriptor, that was passed via SCM rights, to an fd set.
  1109. Arguments:
  1110. - "fdset-id": The ID of the fd set to add the file descriptor to.
  1111. (json-int, optional)
  1112. - "opaque": A free-form string that can be used to describe the fd.
  1113. (json-string, optional)
  1114. Return a json-object with the following information:
  1115. - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
  1116. - "fd": The file descriptor that was received via SCM rights and added to the
  1117. fd set. (json-int)
  1118. Example:
  1119. -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
  1120. <- { "return": { "fdset-id": 1, "fd": 3 } }
  1121. Notes:
  1122. (1) The list of fd sets is shared by all monitor connections.
  1123. (2) If "fdset-id" is not specified, a new fd set will be created.
  1124. EQMP
  1125. {
  1126. .name = "remove-fd",
  1127. .args_type = "fdset-id:i,fd:i?",
  1128. .params = "remove-fd fdset-id fd",
  1129. .help = "Remove a file descriptor from an fd set",
  1130. .mhandler.cmd_new = qmp_marshal_input_remove_fd,
  1131. },
  1132. SQMP
  1133. remove-fd
  1134. ---------
  1135. Remove a file descriptor from an fd set.
  1136. Arguments:
  1137. - "fdset-id": The ID of the fd set that the file descriptor belongs to.
  1138. (json-int)
  1139. - "fd": The file descriptor that is to be removed. (json-int, optional)
  1140. Example:
  1141. -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
  1142. <- { "return": {} }
  1143. Notes:
  1144. (1) The list of fd sets is shared by all monitor connections.
  1145. (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
  1146. removed.
  1147. EQMP
  1148. {
  1149. .name = "query-fdsets",
  1150. .args_type = "",
  1151. .help = "Return information describing all fd sets",
  1152. .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
  1153. },
  1154. SQMP
  1155. query-fdsets
  1156. -------------
  1157. Return information describing all fd sets.
  1158. Arguments: None
  1159. Example:
  1160. -> { "execute": "query-fdsets" }
  1161. <- { "return": [
  1162. {
  1163. "fds": [
  1164. {
  1165. "fd": 30,
  1166. "opaque": "rdonly:/path/to/file"
  1167. },
  1168. {
  1169. "fd": 24,
  1170. "opaque": "rdwr:/path/to/file"
  1171. }
  1172. ],
  1173. "fdset-id": 1
  1174. },
  1175. {
  1176. "fds": [
  1177. {
  1178. "fd": 28
  1179. },
  1180. {
  1181. "fd": 29
  1182. }
  1183. ],
  1184. "fdset-id": 0
  1185. }
  1186. ]
  1187. }
  1188. Note: The list of fd sets is shared by all monitor connections.
  1189. EQMP
  1190. {
  1191. .name = "block_passwd",
  1192. .args_type = "device:s?,node-name:s?,password:s",
  1193. .mhandler.cmd_new = qmp_marshal_input_block_passwd,
  1194. },
  1195. SQMP
  1196. block_passwd
  1197. ------------
  1198. Set the password of encrypted block devices.
  1199. Arguments:
  1200. - "device": device name (json-string)
  1201. - "node-name": name in the block driver state graph (json-string)
  1202. - "password": password (json-string)
  1203. Example:
  1204. -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
  1205. "password": "12345" } }
  1206. <- { "return": {} }
  1207. EQMP
  1208. {
  1209. .name = "block_set_io_throttle",
  1210. .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,iops_size:l?",
  1211. .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
  1212. },
  1213. SQMP
  1214. block_set_io_throttle
  1215. ------------
  1216. Change I/O throttle limits for a block drive.
  1217. Arguments:
  1218. - "device": device name (json-string)
  1219. - "bps": total throughput limit in bytes per second (json-int)
  1220. - "bps_rd": read throughput limit in bytes per second (json-int)
  1221. - "bps_wr": write throughput limit in bytes per second (json-int)
  1222. - "iops": total I/O operations per second (json-int)
  1223. - "iops_rd": read I/O operations per second (json-int)
  1224. - "iops_wr": write I/O operations per second (json-int)
  1225. - "bps_max": total max in bytes (json-int)
  1226. - "bps_rd_max": read max in bytes (json-int)
  1227. - "bps_wr_max": write max in bytes (json-int)
  1228. - "iops_max": total I/O operations max (json-int)
  1229. - "iops_rd_max": read I/O operations max (json-int)
  1230. - "iops_wr_max": write I/O operations max (json-int)
  1231. - "iops_size": I/O size in bytes when limiting (json-int)
  1232. Example:
  1233. -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
  1234. "bps": 1000000,
  1235. "bps_rd": 0,
  1236. "bps_wr": 0,
  1237. "iops": 0,
  1238. "iops_rd": 0,
  1239. "iops_wr": 0,
  1240. "bps_max": 8000000,
  1241. "bps_rd_max": 0,
  1242. "bps_wr_max": 0,
  1243. "iops_max": 0,
  1244. "iops_rd_max": 0,
  1245. "iops_wr_max": 0,
  1246. "iops_size": 0 } }
  1247. <- { "return": {} }
  1248. EQMP
  1249. {
  1250. .name = "set_password",
  1251. .args_type = "protocol:s,password:s,connected:s?",
  1252. .mhandler.cmd_new = qmp_marshal_input_set_password,
  1253. },
  1254. SQMP
  1255. set_password
  1256. ------------
  1257. Set the password for vnc/spice protocols.
  1258. Arguments:
  1259. - "protocol": protocol name (json-string)
  1260. - "password": password (json-string)
  1261. - "connected": [ keep | disconnect | fail ] (josn-string, optional)
  1262. Example:
  1263. -> { "execute": "set_password", "arguments": { "protocol": "vnc",
  1264. "password": "secret" } }
  1265. <- { "return": {} }
  1266. EQMP
  1267. {
  1268. .name = "expire_password",
  1269. .args_type = "protocol:s,time:s",
  1270. .mhandler.cmd_new = qmp_marshal_input_expire_password,
  1271. },
  1272. SQMP
  1273. expire_password
  1274. ---------------
  1275. Set the password expire time for vnc/spice protocols.
  1276. Arguments:
  1277. - "protocol": protocol name (json-string)
  1278. - "time": [ now | never | +secs | secs ] (json-string)
  1279. Example:
  1280. -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
  1281. "time": "+60" } }
  1282. <- { "return": {} }
  1283. EQMP
  1284. {
  1285. .name = "add_client",
  1286. .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
  1287. .mhandler.cmd_new = qmp_marshal_input_add_client,
  1288. },
  1289. SQMP
  1290. add_client
  1291. ----------
  1292. Add a graphics client
  1293. Arguments:
  1294. - "protocol": protocol name (json-string)
  1295. - "fdname": file descriptor name (json-string)
  1296. - "skipauth": whether to skip authentication (json-bool, optional)
  1297. - "tls": whether to perform TLS (json-bool, optional)
  1298. Example:
  1299. -> { "execute": "add_client", "arguments": { "protocol": "vnc",
  1300. "fdname": "myclient" } }
  1301. <- { "return": {} }
  1302. EQMP
  1303. {
  1304. .name = "qmp_capabilities",
  1305. .args_type = "",
  1306. .params = "",
  1307. .help = "enable QMP capabilities",
  1308. .user_print = monitor_user_noop,
  1309. .mhandler.cmd_new = do_qmp_capabilities,
  1310. },
  1311. SQMP
  1312. qmp_capabilities
  1313. ----------------
  1314. Enable QMP capabilities.
  1315. Arguments: None.
  1316. Example:
  1317. -> { "execute": "qmp_capabilities" }
  1318. <- { "return": {} }
  1319. Note: This command must be issued before issuing any other command.
  1320. EQMP
  1321. {
  1322. .name = "human-monitor-command",
  1323. .args_type = "command-line:s,cpu-index:i?",
  1324. .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
  1325. },
  1326. SQMP
  1327. human-monitor-command
  1328. ---------------------
  1329. Execute a Human Monitor command.
  1330. Arguments:
  1331. - command-line: the command name and its arguments, just like the
  1332. Human Monitor's shell (json-string)
  1333. - cpu-index: select the CPU number to be used by commands which access CPU
  1334. data, like 'info registers'. The Monitor selects CPU 0 if this
  1335. argument is not provided (json-int, optional)
  1336. Example:
  1337. -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
  1338. <- { "return": "kvm support: enabled\r\n" }
  1339. Notes:
  1340. (1) The Human Monitor is NOT an stable interface, this means that command
  1341. names, arguments and responses can change or be removed at ANY time.
  1342. Applications that rely on long term stability guarantees should NOT
  1343. use this command
  1344. (2) Limitations:
  1345. o This command is stateless, this means that commands that depend
  1346. on state information (such as getfd) might not work
  1347. o Commands that prompt the user for data (eg. 'cont' when the block
  1348. device is encrypted) don't currently work
  1349. 3. Query Commands
  1350. =================
  1351. HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
  1352. HXCOMM this! We will possibly move query commands definitions inside those
  1353. HXCOMM sections, just like regular commands.
  1354. EQMP
  1355. SQMP
  1356. query-version
  1357. -------------
  1358. Show QEMU version.
  1359. Return a json-object with the following information:
  1360. - "qemu": A json-object containing three integer values:
  1361. - "major": QEMU's major version (json-int)
  1362. - "minor": QEMU's minor version (json-int)
  1363. - "micro": QEMU's micro version (json-int)
  1364. - "package": package's version (json-string)
  1365. Example:
  1366. -> { "execute": "query-version" }
  1367. <- {
  1368. "return":{
  1369. "qemu":{
  1370. "major":0,
  1371. "minor":11,
  1372. "micro":5
  1373. },
  1374. "package":""
  1375. }
  1376. }
  1377. EQMP
  1378. {
  1379. .name = "query-version",
  1380. .args_type = "",
  1381. .mhandler.cmd_new = qmp_marshal_input_query_version,
  1382. },
  1383. SQMP
  1384. query-commands
  1385. --------------
  1386. List QMP available commands.
  1387. Each command is represented by a json-object, the returned value is a json-array
  1388. of all commands.
  1389. Each json-object contain:
  1390. - "name": command's name (json-string)
  1391. Example:
  1392. -> { "execute": "query-commands" }
  1393. <- {
  1394. "return":[
  1395. {
  1396. "name":"query-balloon"
  1397. },
  1398. {
  1399. "name":"system_powerdown"
  1400. }
  1401. ]
  1402. }
  1403. Note: This example has been shortened as the real response is too long.
  1404. EQMP
  1405. {
  1406. .name = "query-commands",
  1407. .args_type = "",
  1408. .mhandler.cmd_new = qmp_marshal_input_query_commands,
  1409. },
  1410. SQMP
  1411. query-events
  1412. --------------
  1413. List QMP available events.
  1414. Each event is represented by a json-object, the returned value is a json-array
  1415. of all events.
  1416. Each json-object contains:
  1417. - "name": event's name (json-string)
  1418. Example:
  1419. -> { "execute": "query-events" }
  1420. <- {
  1421. "return":[
  1422. {
  1423. "name":"SHUTDOWN"
  1424. },
  1425. {
  1426. "name":"RESET"
  1427. }
  1428. ]
  1429. }
  1430. Note: This example has been shortened as the real response is too long.
  1431. EQMP
  1432. {
  1433. .name = "query-events",
  1434. .args_type = "",
  1435. .mhandler.cmd_new = qmp_marshal_input_query_events,
  1436. },
  1437. SQMP
  1438. query-chardev
  1439. -------------
  1440. Each device is represented by a json-object. The returned value is a json-array
  1441. of all devices.
  1442. Each json-object contain the following:
  1443. - "label": device's label (json-string)
  1444. - "filename": device's file (json-string)
  1445. - "frontend-open": open/closed state of the frontend device attached to this
  1446. backend (json-bool)
  1447. Example:
  1448. -> { "execute": "query-chardev" }
  1449. <- {
  1450. "return": [
  1451. {
  1452. "label": "charchannel0",
  1453. "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
  1454. "frontend-open": false
  1455. },
  1456. {
  1457. "label": "charmonitor",
  1458. "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
  1459. "frontend-open": true
  1460. },
  1461. {
  1462. "label": "charserial0",
  1463. "filename": "pty:/dev/pts/2",
  1464. "frontend-open": true
  1465. }
  1466. ]
  1467. }
  1468. EQMP
  1469. {
  1470. .name = "query-chardev",
  1471. .args_type = "",
  1472. .mhandler.cmd_new = qmp_marshal_input_query_chardev,
  1473. },
  1474. SQMP
  1475. query-chardev-backends
  1476. -------------
  1477. List available character device backends.
  1478. Each backend is represented by a json-object, the returned value is a json-array
  1479. of all backends.
  1480. Each json-object contains:
  1481. - "name": backend name (json-string)
  1482. Example:
  1483. -> { "execute": "query-chardev-backends" }
  1484. <- {
  1485. "return":[
  1486. {
  1487. "name":"udp"
  1488. },
  1489. {
  1490. "name":"tcp"
  1491. },
  1492. {
  1493. "name":"unix"
  1494. },
  1495. {
  1496. "name":"spiceport"
  1497. }
  1498. ]
  1499. }
  1500. EQMP
  1501. {
  1502. .name = "query-chardev-backends",
  1503. .args_type = "",
  1504. .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
  1505. },
  1506. SQMP
  1507. query-block
  1508. -----------
  1509. Show the block devices.
  1510. Each block device information is stored in a json-object and the returned value
  1511. is a json-array of all devices.
  1512. Each json-object contain the following:
  1513. - "device": device name (json-string)
  1514. - "type": device type (json-string)
  1515. - deprecated, retained for backward compatibility
  1516. - Possible values: "unknown"
  1517. - "removable": true if the device is removable, false otherwise (json-bool)
  1518. - "locked": true if the device is locked, false otherwise (json-bool)
  1519. - "tray_open": only present if removable, true if the device has a tray,
  1520. and it is open (json-bool)
  1521. - "inserted": only present if the device is inserted, it is a json-object
  1522. containing the following:
  1523. - "file": device file name (json-string)
  1524. - "ro": true if read-only, false otherwise (json-bool)
  1525. - "drv": driver format name (json-string)
  1526. - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
  1527. "file", "file", "ftp", "ftps", "host_cdrom",
  1528. "host_device", "host_floppy", "http", "https",
  1529. "nbd", "parallels", "qcow", "qcow2", "raw",
  1530. "tftp", "vdi", "vmdk", "vpc", "vvfat"
  1531. - "backing_file": backing file name (json-string, optional)
  1532. - "backing_file_depth": number of files in the backing file chain (json-int)
  1533. - "encrypted": true if encrypted, false otherwise (json-bool)
  1534. - "bps": limit total bytes per second (json-int)
  1535. - "bps_rd": limit read bytes per second (json-int)
  1536. - "bps_wr": limit write bytes per second (json-int)
  1537. - "iops": limit total I/O operations per second (json-int)
  1538. - "iops_rd": limit read operations per second (json-int)
  1539. - "iops_wr": limit write operations per second (json-int)
  1540. - "bps_max": total max in bytes (json-int)
  1541. - "bps_rd_max": read max in bytes (json-int)
  1542. - "bps_wr_max": write max in bytes (json-int)
  1543. - "iops_max": total I/O operations max (json-int)
  1544. - "iops_rd_max": read I/O operations max (json-int)
  1545. - "iops_wr_max": write I/O operations max (json-int)
  1546. - "iops_size": I/O size when limiting by iops (json-int)
  1547. - "detect_zeroes": detect and optimize zero writing (json-string)
  1548. - Possible values: "off", "on", "unmap"
  1549. - "image": the detail of the image, it is a json-object containing
  1550. the following:
  1551. - "filename": image file name (json-string)
  1552. - "format": image format (json-string)
  1553. - "virtual-size": image capacity in bytes (json-int)
  1554. - "dirty-flag": true if image is not cleanly closed, not present
  1555. means clean (json-bool, optional)
  1556. - "actual-size": actual size on disk in bytes of the image, not
  1557. present when image does not support thin
  1558. provision (json-int, optional)
  1559. - "cluster-size": size of a cluster in bytes, not present if image
  1560. format does not support it (json-int, optional)
  1561. - "encrypted": true if the image is encrypted, not present means
  1562. false or the image format does not support
  1563. encryption (json-bool, optional)
  1564. - "backing_file": backing file name, not present means no backing
  1565. file is used or the image format does not
  1566. support backing file chain
  1567. (json-string, optional)
  1568. - "full-backing-filename": full path of the backing file, not
  1569. present if it equals backing_file or no
  1570. backing file is used
  1571. (json-string, optional)
  1572. - "backing-filename-format": the format of the backing file, not
  1573. present means unknown or no backing
  1574. file (json-string, optional)
  1575. - "snapshots": the internal snapshot info, it is an optional list
  1576. of json-object containing the following:
  1577. - "id": unique snapshot id (json-string)
  1578. - "name": snapshot name (json-string)
  1579. - "vm-state-size": size of the VM state in bytes (json-int)
  1580. - "date-sec": UTC date of the snapshot in seconds (json-int)
  1581. - "date-nsec": fractional part in nanoseconds to be used with
  1582. date-sec (json-int)
  1583. - "vm-clock-sec": VM clock relative to boot in seconds
  1584. (json-int)
  1585. - "vm-clock-nsec": fractional part in nanoseconds to be used
  1586. with vm-clock-sec (json-int)
  1587. - "backing-image": the detail of the backing image, it is an
  1588. optional json-object only present when a
  1589. backing image present for this image
  1590. - "io-status": I/O operation status, only present if the device supports it
  1591. and the VM is configured to stop on errors. It's always reset
  1592. to "ok" when the "cont" command is issued (json_string, optional)
  1593. - Possible values: "ok", "failed", "nospace"
  1594. Example:
  1595. -> { "execute": "query-block" }
  1596. <- {
  1597. "return":[
  1598. {
  1599. "io-status": "ok",
  1600. "device":"ide0-hd0",
  1601. "locked":false,
  1602. "removable":false,
  1603. "inserted":{
  1604. "ro":false,
  1605. "drv":"qcow2",
  1606. "encrypted":false,
  1607. "file":"disks/test.qcow2",
  1608. "backing_file_depth":1,
  1609. "bps":1000000,
  1610. "bps_rd":0,
  1611. "bps_wr":0,
  1612. "iops":1000000,
  1613. "iops_rd":0,
  1614. "iops_wr":0,
  1615. "bps_max": 8000000,
  1616. "bps_rd_max": 0,
  1617. "bps_wr_max": 0,
  1618. "iops_max": 0,
  1619. "iops_rd_max": 0,
  1620. "iops_wr_max": 0,
  1621. "iops_size": 0,
  1622. "detect_zeroes": "on",
  1623. "image":{
  1624. "filename":"disks/test.qcow2",
  1625. "format":"qcow2",
  1626. "virtual-size":2048000,
  1627. "backing_file":"base.qcow2",
  1628. "full-backing-filename":"disks/base.qcow2",
  1629. "backing-filename-format:"qcow2",
  1630. "snapshots":[
  1631. {
  1632. "id": "1",
  1633. "name": "snapshot1",
  1634. "vm-state-size": 0,
  1635. "date-sec": 10000200,
  1636. "date-nsec": 12,
  1637. "vm-clock-sec": 206,
  1638. "vm-clock-nsec": 30
  1639. }
  1640. ],
  1641. "backing-image":{
  1642. "filename":"disks/base.qcow2",
  1643. "format":"qcow2",
  1644. "virtual-size":2048000
  1645. }
  1646. }
  1647. },
  1648. "type":"unknown"
  1649. },
  1650. {
  1651. "io-status": "ok",
  1652. "device":"ide1-cd0",
  1653. "locked":false,
  1654. "removable":true,
  1655. "type":"unknown"
  1656. },
  1657. {
  1658. "device":"floppy0",
  1659. "locked":false,
  1660. "removable":true,
  1661. "type":"unknown"
  1662. },
  1663. {
  1664. "device":"sd0",
  1665. "locked":false,
  1666. "removable":true,
  1667. "type":"unknown"
  1668. }
  1669. ]
  1670. }
  1671. EQMP
  1672. {
  1673. .name = "query-block",
  1674. .args_type = "",
  1675. .mhandler.cmd_new = qmp_marshal_input_query_block,
  1676. },
  1677. SQMP
  1678. query-blockstats
  1679. ----------------
  1680. Show block device statistics.
  1681. Each device statistic information is stored in a json-object and the returned
  1682. value is a json-array of all devices.
  1683. Each json-object contain the following:
  1684. - "device": device name (json-string)
  1685. - "stats": A json-object with the statistics information, it contains:
  1686. - "rd_bytes": bytes read (json-int)
  1687. - "wr_bytes": bytes written (json-int)
  1688. - "rd_operations": read operations (json-int)
  1689. - "wr_operations": write operations (json-int)
  1690. - "flush_operations": cache flush operations (json-int)
  1691. - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
  1692. - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
  1693. - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
  1694. - "wr_highest_offset": Highest offset of a sector written since the
  1695. BlockDriverState has been opened (json-int)
  1696. - "parent": Contains recursively the statistics of the underlying
  1697. protocol (e.g. the host file for a qcow2 image). If there is
  1698. no underlying protocol, this field is omitted
  1699. (json-object, optional)
  1700. Example:
  1701. -> { "execute": "query-blockstats" }
  1702. <- {
  1703. "return":[
  1704. {
  1705. "device":"ide0-hd0",
  1706. "parent":{
  1707. "stats":{
  1708. "wr_highest_offset":3686448128,
  1709. "wr_bytes":9786368,
  1710. "wr_operations":751,
  1711. "rd_bytes":122567168,
  1712. "rd_operations":36772
  1713. "wr_total_times_ns":313253456
  1714. "rd_total_times_ns":3465673657
  1715. "flush_total_times_ns":49653
  1716. "flush_operations":61,
  1717. }
  1718. },
  1719. "stats":{
  1720. "wr_highest_offset":2821110784,
  1721. "wr_bytes":9786368,
  1722. "wr_operations":692,
  1723. "rd_bytes":122739200,
  1724. "rd_operations":36604
  1725. "flush_operations":51,
  1726. "wr_total_times_ns":313253456
  1727. "rd_total_times_ns":3465673657
  1728. "flush_total_times_ns":49653
  1729. }
  1730. },
  1731. {
  1732. "device":"ide1-cd0",
  1733. "stats":{
  1734. "wr_highest_offset":0,
  1735. "wr_bytes":0,
  1736. "wr_operations":0,
  1737. "rd_bytes":0,
  1738. "rd_operations":0
  1739. "flush_operations":0,
  1740. "wr_total_times_ns":0
  1741. "rd_total_times_ns":0
  1742. "flush_total_times_ns":0
  1743. }
  1744. },
  1745. {
  1746. "device":"floppy0",
  1747. "stats":{
  1748. "wr_highest_offset":0,
  1749. "wr_bytes":0,
  1750. "wr_operations":0,
  1751. "rd_bytes":0,
  1752. "rd_operations":0
  1753. "flush_operations":0,
  1754. "wr_total_times_ns":0
  1755. "rd_total_times_ns":0
  1756. "flush_total_times_ns":0
  1757. }
  1758. },
  1759. {
  1760. "device":"sd0",
  1761. "stats":{
  1762. "wr_highest_offset":0,
  1763. "wr_bytes":0,
  1764. "wr_operations":0,
  1765. "rd_bytes":0,
  1766. "rd_operations":0
  1767. "flush_operations":0,
  1768. "wr_total_times_ns":0
  1769. "rd_total_times_ns":0
  1770. "flush_total_times_ns":0
  1771. }
  1772. }
  1773. ]
  1774. }
  1775. EQMP
  1776. {
  1777. .name = "query-blockstats",
  1778. .args_type = "",
  1779. .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
  1780. },
  1781. SQMP
  1782. query-cpus
  1783. ----------
  1784. Show CPU information.
  1785. Return a json-array. Each CPU is represented by a json-object, which contains:
  1786. - "CPU": CPU index (json-int)
  1787. - "current": true if this is the current CPU, false otherwise (json-bool)
  1788. - "halted": true if the cpu is halted, false otherwise (json-bool)
  1789. - Current program counter. The key's name depends on the architecture:
  1790. "pc": i386/x86_64 (json-int)
  1791. "nip": PPC (json-int)
  1792. "pc" and "npc": sparc (json-int)
  1793. "PC": mips (json-int)
  1794. - "thread_id": ID of the underlying host thread (json-int)
  1795. Example:
  1796. -> { "execute": "query-cpus" }
  1797. <- {
  1798. "return":[
  1799. {
  1800. "CPU":0,
  1801. "current":true,
  1802. "halted":false,
  1803. "pc":3227107138
  1804. "thread_id":3134
  1805. },
  1806. {
  1807. "CPU":1,
  1808. "current":false,
  1809. "halted":true,
  1810. "pc":7108165
  1811. "thread_id":3135
  1812. }
  1813. ]
  1814. }
  1815. EQMP
  1816. {
  1817. .name = "query-cpus",
  1818. .args_type = "",
  1819. .mhandler.cmd_new = qmp_marshal_input_query_cpus,
  1820. },
  1821. SQMP
  1822. query-iothreads
  1823. ---------------
  1824. Returns a list of information about each iothread.
  1825. Note this list excludes the QEMU main loop thread, which is not declared
  1826. using the -object iothread command-line option. It is always the main thread
  1827. of the process.
  1828. Return a json-array. Each iothread is represented by a json-object, which contains:
  1829. - "id": name of iothread (json-str)
  1830. - "thread-id": ID of the underlying host thread (json-int)
  1831. Example:
  1832. -> { "execute": "query-iothreads" }
  1833. <- {
  1834. "return":[
  1835. {
  1836. "id":"iothread0",
  1837. "thread-id":3134
  1838. },
  1839. {
  1840. "id":"iothread1",
  1841. "thread-id":3135
  1842. }
  1843. ]
  1844. }
  1845. EQMP
  1846. {
  1847. .name = "query-iothreads",
  1848. .args_type = "",
  1849. .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
  1850. },
  1851. SQMP
  1852. query-pci
  1853. ---------
  1854. PCI buses and devices information.
  1855. The returned value is a json-array of all buses. Each bus is represented by
  1856. a json-object, which has a key with a json-array of all PCI devices attached
  1857. to it. Each device is represented by a json-object.
  1858. The bus json-object contains the following:
  1859. - "bus": bus number (json-int)
  1860. - "devices": a json-array of json-objects, each json-object represents a
  1861. PCI device
  1862. The PCI device json-object contains the following:
  1863. - "bus": identical to the parent's bus number (json-int)
  1864. - "slot": slot number (json-int)
  1865. - "function": function number (json-int)
  1866. - "class_info": a json-object containing:
  1867. - "desc": device class description (json-string, optional)
  1868. - "class": device class number (json-int)
  1869. - "id": a json-object containing:
  1870. - "device": device ID (json-int)
  1871. - "vendor": vendor ID (json-int)
  1872. - "irq": device's IRQ if assigned (json-int, optional)
  1873. - "qdev_id": qdev id string (json-string)
  1874. - "pci_bridge": It's a json-object, only present if this device is a
  1875. PCI bridge, contains:
  1876. - "bus": bus number (json-int)
  1877. - "secondary": secondary bus number (json-int)
  1878. - "subordinate": subordinate bus number (json-int)
  1879. - "io_range": I/O memory range information, a json-object with the
  1880. following members:
  1881. - "base": base address, in bytes (json-int)
  1882. - "limit": limit address, in bytes (json-int)
  1883. - "memory_range": memory range information, a json-object with the
  1884. following members:
  1885. - "base": base address, in bytes (json-int)
  1886. - "limit": limit address, in bytes (json-int)
  1887. - "prefetchable_range": Prefetchable memory range information, a
  1888. json-object with the following members:
  1889. - "base": base address, in bytes (json-int)
  1890. - "limit": limit address, in bytes (json-int)
  1891. - "devices": a json-array of PCI devices if there's any attached, each
  1892. each element is represented by a json-object, which contains
  1893. the same members of the 'PCI device json-object' described
  1894. above (optional)
  1895. - "regions": a json-array of json-objects, each json-object represents a
  1896. memory region of this device
  1897. The memory range json-object contains the following:
  1898. - "base": base memory address (json-int)
  1899. - "limit": limit value (json-int)
  1900. The region json-object can be an I/O region or a memory region, an I/O region
  1901. json-object contains the following:
  1902. - "type": "io" (json-string, fixed)
  1903. - "bar": BAR number (json-int)
  1904. - "address": memory address (json-int)
  1905. - "size": memory size (json-int)
  1906. A memory region json-object contains the following:
  1907. - "type": "memory" (json-string, fixed)
  1908. - "bar": BAR number (json-int)
  1909. - "address": memory address (json-int)
  1910. - "size": memory size (json-int)
  1911. - "mem_type_64": true or false (json-bool)
  1912. - "prefetch": true or false (json-bool)
  1913. Example:
  1914. -> { "execute": "query-pci" }
  1915. <- {
  1916. "return":[
  1917. {
  1918. "bus":0,
  1919. "devices":[
  1920. {
  1921. "bus":0,
  1922. "qdev_id":"",
  1923. "slot":0,
  1924. "class_info":{
  1925. "class":1536,
  1926. "desc":"Host bridge"
  1927. },
  1928. "id":{
  1929. "device":32902,
  1930. "vendor":4663
  1931. },
  1932. "function":0,
  1933. "regions":[
  1934. ]
  1935. },
  1936. {
  1937. "bus":0,
  1938. "qdev_id":"",
  1939. "slot":1,
  1940. "class_info":{
  1941. "class":1537,
  1942. "desc":"ISA bridge"
  1943. },
  1944. "id":{
  1945. "device":32902,
  1946. "vendor":28672
  1947. },
  1948. "function":0,
  1949. "regions":[
  1950. ]
  1951. },
  1952. {
  1953. "bus":0,
  1954. "qdev_id":"",
  1955. "slot":1,
  1956. "class_info":{
  1957. "class":257,
  1958. "desc":"IDE controller"
  1959. },
  1960. "id":{
  1961. "device":32902,
  1962. "vendor":28688
  1963. },
  1964. "function":1,
  1965. "regions":[
  1966. {
  1967. "bar":4,
  1968. "size":16,
  1969. "address":49152,
  1970. "type":"io"
  1971. }
  1972. ]
  1973. },
  1974. {
  1975. "bus":0,
  1976. "qdev_id":"",
  1977. "slot":2,
  1978. "class_info":{
  1979. "class":768,
  1980. "desc":"VGA controller"
  1981. },
  1982. "id":{
  1983. "device":4115,
  1984. "vendor":184
  1985. },
  1986. "function":0,
  1987. "regions":[
  1988. {
  1989. "prefetch":true,
  1990. "mem_type_64":false,
  1991. "bar":0,
  1992. "size":33554432,
  1993. "address":4026531840,
  1994. "type":"memory"
  1995. },
  1996. {
  1997. "prefetch":false,
  1998. "mem_type_64":false,
  1999. "bar":1,
  2000. "size":4096,
  2001. "address":4060086272,
  2002. "type":"memory"
  2003. },
  2004. {
  2005. "prefetch":false,
  2006. "mem_type_64":false,
  2007. "bar":6,
  2008. "size":65536,
  2009. "address":-1,
  2010. "type":"memory"
  2011. }
  2012. ]
  2013. },
  2014. {
  2015. "bus":0,
  2016. "qdev_id":"",
  2017. "irq":11,
  2018. "slot":4,
  2019. "class_info":{
  2020. "class":1280,
  2021. "desc":"RAM controller"
  2022. },
  2023. "id":{
  2024. "device":6900,
  2025. "vendor":4098
  2026. },
  2027. "function":0,
  2028. "regions":[
  2029. {
  2030. "bar":0,
  2031. "size":32,
  2032. "address":49280,
  2033. "type":"io"
  2034. }
  2035. ]
  2036. }
  2037. ]
  2038. }
  2039. ]
  2040. }
  2041. Note: This example has been shortened as the real response is too long.
  2042. EQMP
  2043. {
  2044. .name = "query-pci",
  2045. .args_type = "",
  2046. .mhandler.cmd_new = qmp_marshal_input_query_pci,
  2047. },
  2048. SQMP
  2049. query-kvm
  2050. ---------
  2051. Show KVM information.
  2052. Return a json-object with the following information:
  2053. - "enabled": true if KVM support is enabled, false otherwise (json-bool)
  2054. - "present": true if QEMU has KVM support, false otherwise (json-bool)
  2055. Example:
  2056. -> { "execute": "query-kvm" }
  2057. <- { "return": { "enabled": true, "present": true } }
  2058. EQMP
  2059. {
  2060. .name = "query-kvm",
  2061. .args_type = "",
  2062. .mhandler.cmd_new = qmp_marshal_input_query_kvm,
  2063. },
  2064. SQMP
  2065. query-status
  2066. ------------
  2067. Return a json-object with the following information:
  2068. - "running": true if the VM is running, or false if it is paused (json-bool)
  2069. - "singlestep": true if the VM is in single step mode,
  2070. false otherwise (json-bool)
  2071. - "status": one of the following values (json-string)
  2072. "debug" - QEMU is running on a debugger
  2073. "inmigrate" - guest is paused waiting for an incoming migration
  2074. "internal-error" - An internal error that prevents further guest
  2075. execution has occurred
  2076. "io-error" - the last IOP has failed and the device is configured
  2077. to pause on I/O errors
  2078. "paused" - guest has been paused via the 'stop' command
  2079. "postmigrate" - guest is paused following a successful 'migrate'
  2080. "prelaunch" - QEMU was started with -S and guest has not started
  2081. "finish-migrate" - guest is paused to finish the migration process
  2082. "restore-vm" - guest is paused to restore VM state
  2083. "running" - guest is actively running
  2084. "save-vm" - guest is paused to save the VM state
  2085. "shutdown" - guest is shut down (and -no-shutdown is in use)
  2086. "watchdog" - the watchdog action is configured to pause and
  2087. has been triggered
  2088. Example:
  2089. -> { "execute": "query-status" }
  2090. <- { "return": { "running": true, "singlestep": false, "status": "running" } }
  2091. EQMP
  2092. {
  2093. .name = "query-status",
  2094. .args_type = "",
  2095. .mhandler.cmd_new = qmp_marshal_input_query_status,
  2096. },
  2097. SQMP
  2098. query-mice
  2099. ----------
  2100. Show VM mice information.
  2101. Each mouse is represented by a json-object, the returned value is a json-array
  2102. of all mice.
  2103. The mouse json-object contains the following:
  2104. - "name": mouse's name (json-string)
  2105. - "index": mouse's index (json-int)
  2106. - "current": true if this mouse is receiving events, false otherwise (json-bool)
  2107. - "absolute": true if the mouse generates absolute input events (json-bool)
  2108. Example:
  2109. -> { "execute": "query-mice" }
  2110. <- {
  2111. "return":[
  2112. {
  2113. "name":"QEMU Microsoft Mouse",
  2114. "index":0,
  2115. "current":false,
  2116. "absolute":false
  2117. },
  2118. {
  2119. "name":"QEMU PS/2 Mouse",
  2120. "index":1,
  2121. "current":true,
  2122. "absolute":true
  2123. }
  2124. ]
  2125. }
  2126. EQMP
  2127. {
  2128. .name = "query-mice",
  2129. .args_type = "",
  2130. .mhandler.cmd_new = qmp_marshal_input_query_mice,
  2131. },
  2132. SQMP
  2133. query-vnc
  2134. ---------
  2135. Show VNC server information.
  2136. Return a json-object with server information. Connected clients are returned
  2137. as a json-array of json-objects.
  2138. The main json-object contains the following:
  2139. - "enabled": true or false (json-bool)
  2140. - "host": server's IP address (json-string)
  2141. - "family": address family (json-string)
  2142. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  2143. - "service": server's port number (json-string)
  2144. - "auth": authentication method (json-string)
  2145. - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
  2146. "tls", "ultra", "unknown", "vencrypt", "vencrypt",
  2147. "vencrypt+plain", "vencrypt+tls+none",
  2148. "vencrypt+tls+plain", "vencrypt+tls+sasl",
  2149. "vencrypt+tls+vnc", "vencrypt+x509+none",
  2150. "vencrypt+x509+plain", "vencrypt+x509+sasl",
  2151. "vencrypt+x509+vnc", "vnc"
  2152. - "clients": a json-array of all connected clients
  2153. Clients are described by a json-object, each one contain the following:
  2154. - "host": client's IP address (json-string)
  2155. - "family": address family (json-string)
  2156. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  2157. - "service": client's port number (json-string)
  2158. - "x509_dname": TLS dname (json-string, optional)
  2159. - "sasl_username": SASL username (json-string, optional)
  2160. Example:
  2161. -> { "execute": "query-vnc" }
  2162. <- {
  2163. "return":{
  2164. "enabled":true,
  2165. "host":"0.0.0.0",
  2166. "service":"50402",
  2167. "auth":"vnc",
  2168. "family":"ipv4",
  2169. "clients":[
  2170. {
  2171. "host":"127.0.0.1",
  2172. "service":"50401",
  2173. "family":"ipv4"
  2174. }
  2175. ]
  2176. }
  2177. }
  2178. EQMP
  2179. {
  2180. .name = "query-vnc",
  2181. .args_type = "",
  2182. .mhandler.cmd_new = qmp_marshal_input_query_vnc,
  2183. },
  2184. SQMP
  2185. query-spice
  2186. -----------
  2187. Show SPICE server information.
  2188. Return a json-object with server information. Connected clients are returned
  2189. as a json-array of json-objects.
  2190. The main json-object contains the following:
  2191. - "enabled": true or false (json-bool)
  2192. - "host": server's IP address (json-string)
  2193. - "port": server's port number (json-int, optional)
  2194. - "tls-port": server's port number (json-int, optional)
  2195. - "auth": authentication method (json-string)
  2196. - Possible values: "none", "spice"
  2197. - "channels": a json-array of all active channels clients
  2198. Channels are described by a json-object, each one contain the following:
  2199. - "host": client's IP address (json-string)
  2200. - "family": address family (json-string)
  2201. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  2202. - "port": client's port number (json-string)
  2203. - "connection-id": spice connection id. All channels with the same id
  2204. belong to the same spice session (json-int)
  2205. - "channel-type": channel type. "1" is the main control channel, filter for
  2206. this one if you want track spice sessions only (json-int)
  2207. - "channel-id": channel id. Usually "0", might be different needed when
  2208. multiple channels of the same type exist, such as multiple
  2209. display channels in a multihead setup (json-int)
  2210. - "tls": whevener the channel is encrypted (json-bool)
  2211. Example:
  2212. -> { "execute": "query-spice" }
  2213. <- {
  2214. "return": {
  2215. "enabled": true,
  2216. "auth": "spice",
  2217. "port": 5920,
  2218. "tls-port": 5921,
  2219. "host": "0.0.0.0",
  2220. "channels": [
  2221. {
  2222. "port": "54924",
  2223. "family": "ipv4",
  2224. "channel-type": 1,
  2225. "connection-id": 1804289383,
  2226. "host": "127.0.0.1",
  2227. "channel-id": 0,
  2228. "tls": true
  2229. },
  2230. {
  2231. "port": "36710",
  2232. "family": "ipv4",
  2233. "channel-type": 4,
  2234. "connection-id": 1804289383,
  2235. "host": "127.0.0.1",
  2236. "channel-id": 0,
  2237. "tls": false
  2238. },
  2239. [ ... more channels follow ... ]
  2240. ]
  2241. }
  2242. }
  2243. EQMP
  2244. #if defined(CONFIG_SPICE)
  2245. {
  2246. .name = "query-spice",
  2247. .args_type = "",
  2248. .mhandler.cmd_new = qmp_marshal_input_query_spice,
  2249. },
  2250. #endif
  2251. SQMP
  2252. query-name
  2253. ----------
  2254. Show VM name.
  2255. Return a json-object with the following information:
  2256. - "name": VM's name (json-string, optional)
  2257. Example:
  2258. -> { "execute": "query-name" }
  2259. <- { "return": { "name": "qemu-name" } }
  2260. EQMP
  2261. {
  2262. .name = "query-name",
  2263. .args_type = "",
  2264. .mhandler.cmd_new = qmp_marshal_input_query_name,
  2265. },
  2266. SQMP
  2267. query-uuid
  2268. ----------
  2269. Show VM UUID.
  2270. Return a json-object with the following information:
  2271. - "UUID": Universally Unique Identifier (json-string)
  2272. Example:
  2273. -> { "execute": "query-uuid" }
  2274. <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
  2275. EQMP
  2276. {
  2277. .name = "query-uuid",
  2278. .args_type = "",
  2279. .mhandler.cmd_new = qmp_marshal_input_query_uuid,
  2280. },
  2281. SQMP
  2282. query-command-line-options
  2283. --------------------------
  2284. Show command line option schema.
  2285. Return a json-array of command line option schema for all options (or for
  2286. the given option), returning an error if the given option doesn't exist.
  2287. Each array entry contains the following:
  2288. - "option": option name (json-string)
  2289. - "parameters": a json-array describes all parameters of the option:
  2290. - "name": parameter name (json-string)
  2291. - "type": parameter type (one of 'string', 'boolean', 'number',
  2292. or 'size')
  2293. - "help": human readable description of the parameter
  2294. (json-string, optional)
  2295. - "default": default value string for the parameter
  2296. (json-string, optional)
  2297. Example:
  2298. -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
  2299. <- { "return": [
  2300. {
  2301. "parameters": [
  2302. {
  2303. "name": "romfile",
  2304. "type": "string"
  2305. },
  2306. {
  2307. "name": "bootindex",
  2308. "type": "number"
  2309. }
  2310. ],
  2311. "option": "option-rom"
  2312. }
  2313. ]
  2314. }
  2315. EQMP
  2316. {
  2317. .name = "query-command-line-options",
  2318. .args_type = "option:s?",
  2319. .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
  2320. },
  2321. SQMP
  2322. query-migrate
  2323. -------------
  2324. Migration status.
  2325. Return a json-object. If migration is active there will be another json-object
  2326. with RAM migration status and if block migration is active another one with
  2327. block migration status.
  2328. The main json-object contains the following:
  2329. - "status": migration status (json-string)
  2330. - Possible values: "setup", "active", "completed", "failed", "cancelled"
  2331. - "total-time": total amount of ms since migration started. If
  2332. migration has ended, it returns the total migration
  2333. time (json-int)
  2334. - "setup-time" amount of setup time in milliseconds _before_ the
  2335. iterations begin but _after_ the QMP command is issued.
  2336. This is designed to provide an accounting of any activities
  2337. (such as RDMA pinning) which may be expensive, but do not
  2338. actually occur during the iterative migration rounds
  2339. themselves. (json-int)
  2340. - "downtime": only present when migration has finished correctly
  2341. total amount in ms for downtime that happened (json-int)
  2342. - "expected-downtime": only present while migration is active
  2343. total amount in ms for downtime that was calculated on
  2344. the last bitmap round (json-int)
  2345. - "ram": only present if "status" is "active", it is a json-object with the
  2346. following RAM information:
  2347. - "transferred": amount transferred in bytes (json-int)
  2348. - "remaining": amount remaining to transfer in bytes (json-int)
  2349. - "total": total amount of memory in bytes (json-int)
  2350. - "duplicate": number of pages filled entirely with the same
  2351. byte (json-int)
  2352. These are sent over the wire much more efficiently.
  2353. - "skipped": number of skipped zero pages (json-int)
  2354. - "normal" : number of whole pages transferred. I.e. they
  2355. were not sent as duplicate or xbzrle pages (json-int)
  2356. - "normal-bytes" : number of bytes transferred in whole
  2357. pages. This is just normal pages times size of one page,
  2358. but this way upper levels don't need to care about page
  2359. size (json-int)
  2360. - "dirty-sync-count": times that dirty ram was synchronized (json-int)
  2361. - "disk": only present if "status" is "active" and it is a block migration,
  2362. it is a json-object with the following disk information:
  2363. - "transferred": amount transferred in bytes (json-int)
  2364. - "remaining": amount remaining to transfer in bytes json-int)
  2365. - "total": total disk size in bytes (json-int)
  2366. - "xbzrle-cache": only present if XBZRLE is active.
  2367. It is a json-object with the following XBZRLE information:
  2368. - "cache-size": XBZRLE cache size in bytes
  2369. - "bytes": number of bytes transferred for XBZRLE compressed pages
  2370. - "pages": number of XBZRLE compressed pages
  2371. - "cache-miss": number of XBRZRLE page cache misses
  2372. - "cache-miss-rate": rate of XBRZRLE page cache misses
  2373. - "overflow": number of times XBZRLE overflows. This means
  2374. that the XBZRLE encoding was bigger than just sent the
  2375. whole page, and then we sent the whole page instead (as as
  2376. normal page).
  2377. Examples:
  2378. 1. Before the first migration
  2379. -> { "execute": "query-migrate" }
  2380. <- { "return": {} }
  2381. 2. Migration is done and has succeeded
  2382. -> { "execute": "query-migrate" }
  2383. <- { "return": {
  2384. "status": "completed",
  2385. "ram":{
  2386. "transferred":123,
  2387. "remaining":123,
  2388. "total":246,
  2389. "total-time":12345,
  2390. "setup-time":12345,
  2391. "downtime":12345,
  2392. "duplicate":123,
  2393. "normal":123,
  2394. "normal-bytes":123456,
  2395. "dirty-sync-count":15
  2396. }
  2397. }
  2398. }
  2399. 3. Migration is done and has failed
  2400. -> { "execute": "query-migrate" }
  2401. <- { "return": { "status": "failed" } }
  2402. 4. Migration is being performed and is not a block migration:
  2403. -> { "execute": "query-migrate" }
  2404. <- {
  2405. "return":{
  2406. "status":"active",
  2407. "ram":{
  2408. "transferred":123,
  2409. "remaining":123,
  2410. "total":246,
  2411. "total-time":12345,
  2412. "setup-time":12345,
  2413. "expected-downtime":12345,
  2414. "duplicate":123,
  2415. "normal":123,
  2416. "normal-bytes":123456,
  2417. "dirty-sync-count":15
  2418. }
  2419. }
  2420. }
  2421. 5. Migration is being performed and is a block migration:
  2422. -> { "execute": "query-migrate" }
  2423. <- {
  2424. "return":{
  2425. "status":"active",
  2426. "ram":{
  2427. "total":1057024,
  2428. "remaining":1053304,
  2429. "transferred":3720,
  2430. "total-time":12345,
  2431. "setup-time":12345,
  2432. "expected-downtime":12345,
  2433. "duplicate":123,
  2434. "normal":123,
  2435. "normal-bytes":123456,
  2436. "dirty-sync-count":15
  2437. },
  2438. "disk":{
  2439. "total":20971520,
  2440. "remaining":20880384,
  2441. "transferred":91136
  2442. }
  2443. }
  2444. }
  2445. 6. Migration is being performed and XBZRLE is active:
  2446. -> { "execute": "query-migrate" }
  2447. <- {
  2448. "return":{
  2449. "status":"active",
  2450. "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
  2451. "ram":{
  2452. "total":1057024,
  2453. "remaining":1053304,
  2454. "transferred":3720,
  2455. "total-time":12345,
  2456. "setup-time":12345,
  2457. "expected-downtime":12345,
  2458. "duplicate":10,
  2459. "normal":3333,
  2460. "normal-bytes":3412992,
  2461. "dirty-sync-count":15
  2462. },
  2463. "xbzrle-cache":{
  2464. "cache-size":67108864,
  2465. "bytes":20971520,
  2466. "pages":2444343,
  2467. "cache-miss":2244,
  2468. "cache-miss-rate":0.123,
  2469. "overflow":34434
  2470. }
  2471. }
  2472. }
  2473. EQMP
  2474. {
  2475. .name = "query-migrate",
  2476. .args_type = "",
  2477. .mhandler.cmd_new = qmp_marshal_input_query_migrate,
  2478. },
  2479. SQMP
  2480. migrate-set-capabilities
  2481. ------------------------
  2482. Enable/Disable migration capabilities
  2483. - "xbzrle": XBZRLE support
  2484. Arguments:
  2485. Example:
  2486. -> { "execute": "migrate-set-capabilities" , "arguments":
  2487. { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
  2488. EQMP
  2489. {
  2490. .name = "migrate-set-capabilities",
  2491. .args_type = "capabilities:O",
  2492. .params = "capability:s,state:b",
  2493. .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
  2494. },
  2495. SQMP
  2496. query-migrate-capabilities
  2497. --------------------------
  2498. Query current migration capabilities
  2499. - "capabilities": migration capabilities state
  2500. - "xbzrle" : XBZRLE state (json-bool)
  2501. Arguments:
  2502. Example:
  2503. -> { "execute": "query-migrate-capabilities" }
  2504. <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
  2505. EQMP
  2506. {
  2507. .name = "query-migrate-capabilities",
  2508. .args_type = "",
  2509. .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
  2510. },
  2511. SQMP
  2512. query-balloon
  2513. -------------
  2514. Show balloon information.
  2515. Make an asynchronous request for balloon info. When the request completes a
  2516. json-object will be returned containing the following data:
  2517. - "actual": current balloon value in bytes (json-int)
  2518. Example:
  2519. -> { "execute": "query-balloon" }
  2520. <- {
  2521. "return":{
  2522. "actual":1073741824,
  2523. }
  2524. }
  2525. EQMP
  2526. {
  2527. .name = "query-balloon",
  2528. .args_type = "",
  2529. .mhandler.cmd_new = qmp_marshal_input_query_balloon,
  2530. },
  2531. {
  2532. .name = "query-block-jobs",
  2533. .args_type = "",
  2534. .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
  2535. },
  2536. {
  2537. .name = "qom-list",
  2538. .args_type = "path:s",
  2539. .mhandler.cmd_new = qmp_marshal_input_qom_list,
  2540. },
  2541. {
  2542. .name = "qom-set",
  2543. .args_type = "path:s,property:s,value:q",
  2544. .mhandler.cmd_new = qmp_qom_set,
  2545. },
  2546. {
  2547. .name = "qom-get",
  2548. .args_type = "path:s,property:s",
  2549. .mhandler.cmd_new = qmp_qom_get,
  2550. },
  2551. {
  2552. .name = "nbd-server-start",
  2553. .args_type = "addr:q",
  2554. .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
  2555. },
  2556. {
  2557. .name = "nbd-server-add",
  2558. .args_type = "device:B,writable:b?",
  2559. .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
  2560. },
  2561. {
  2562. .name = "nbd-server-stop",
  2563. .args_type = "",
  2564. .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
  2565. },
  2566. {
  2567. .name = "change-vnc-password",
  2568. .args_type = "password:s",
  2569. .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
  2570. },
  2571. {
  2572. .name = "qom-list-types",
  2573. .args_type = "implements:s?,abstract:b?",
  2574. .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
  2575. },
  2576. {
  2577. .name = "device-list-properties",
  2578. .args_type = "typename:s",
  2579. .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
  2580. },
  2581. {
  2582. .name = "query-machines",
  2583. .args_type = "",
  2584. .mhandler.cmd_new = qmp_marshal_input_query_machines,
  2585. },
  2586. {
  2587. .name = "query-cpu-definitions",
  2588. .args_type = "",
  2589. .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
  2590. },
  2591. {
  2592. .name = "query-target",
  2593. .args_type = "",
  2594. .mhandler.cmd_new = qmp_marshal_input_query_target,
  2595. },
  2596. {
  2597. .name = "query-tpm",
  2598. .args_type = "",
  2599. .mhandler.cmd_new = qmp_marshal_input_query_tpm,
  2600. },
  2601. SQMP
  2602. query-tpm
  2603. ---------
  2604. Return information about the TPM device.
  2605. Arguments: None
  2606. Example:
  2607. -> { "execute": "query-tpm" }
  2608. <- { "return":
  2609. [
  2610. { "model": "tpm-tis",
  2611. "options":
  2612. { "type": "passthrough",
  2613. "data":
  2614. { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
  2615. "path": "/dev/tpm0"
  2616. }
  2617. },
  2618. "id": "tpm0"
  2619. }
  2620. ]
  2621. }
  2622. EQMP
  2623. {
  2624. .name = "query-tpm-models",
  2625. .args_type = "",
  2626. .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
  2627. },
  2628. SQMP
  2629. query-tpm-models
  2630. ----------------
  2631. Return a list of supported TPM models.
  2632. Arguments: None
  2633. Example:
  2634. -> { "execute": "query-tpm-models" }
  2635. <- { "return": [ "tpm-tis" ] }
  2636. EQMP
  2637. {
  2638. .name = "query-tpm-types",
  2639. .args_type = "",
  2640. .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
  2641. },
  2642. SQMP
  2643. query-tpm-types
  2644. ---------------
  2645. Return a list of supported TPM types.
  2646. Arguments: None
  2647. Example:
  2648. -> { "execute": "query-tpm-types" }
  2649. <- { "return": [ "passthrough" ] }
  2650. EQMP
  2651. {
  2652. .name = "chardev-add",
  2653. .args_type = "id:s,backend:q",
  2654. .mhandler.cmd_new = qmp_marshal_input_chardev_add,
  2655. },
  2656. SQMP
  2657. chardev-add
  2658. ----------------
  2659. Add a chardev.
  2660. Arguments:
  2661. - "id": the chardev's ID, must be unique (json-string)
  2662. - "backend": chardev backend type + parameters
  2663. Examples:
  2664. -> { "execute" : "chardev-add",
  2665. "arguments" : { "id" : "foo",
  2666. "backend" : { "type" : "null", "data" : {} } } }
  2667. <- { "return": {} }
  2668. -> { "execute" : "chardev-add",
  2669. "arguments" : { "id" : "bar",
  2670. "backend" : { "type" : "file",
  2671. "data" : { "out" : "/tmp/bar.log" } } } }
  2672. <- { "return": {} }
  2673. -> { "execute" : "chardev-add",
  2674. "arguments" : { "id" : "baz",
  2675. "backend" : { "type" : "pty", "data" : {} } } }
  2676. <- { "return": { "pty" : "/dev/pty/42" } }
  2677. EQMP
  2678. {
  2679. .name = "chardev-remove",
  2680. .args_type = "id:s",
  2681. .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
  2682. },
  2683. SQMP
  2684. chardev-remove
  2685. --------------
  2686. Remove a chardev.
  2687. Arguments:
  2688. - "id": the chardev's ID, must exist and not be in use (json-string)
  2689. Example:
  2690. -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
  2691. <- { "return": {} }
  2692. EQMP
  2693. {
  2694. .name = "query-rx-filter",
  2695. .args_type = "name:s?",
  2696. .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
  2697. },
  2698. SQMP
  2699. query-rx-filter
  2700. ---------------
  2701. Show rx-filter information.
  2702. Returns a json-array of rx-filter information for all NICs (or for the
  2703. given NIC), returning an error if the given NIC doesn't exist, or
  2704. given NIC doesn't support rx-filter querying, or given net client
  2705. isn't a NIC.
  2706. The query will clear the event notification flag of each NIC, then qemu
  2707. will start to emit event to QMP monitor.
  2708. Each array entry contains the following:
  2709. - "name": net client name (json-string)
  2710. - "promiscuous": promiscuous mode is enabled (json-bool)
  2711. - "multicast": multicast receive state (one of 'normal', 'none', 'all')
  2712. - "unicast": unicast receive state (one of 'normal', 'none', 'all')
  2713. - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
  2714. - "broadcast-allowed": allow to receive broadcast (json-bool)
  2715. - "multicast-overflow": multicast table is overflowed (json-bool)
  2716. - "unicast-overflow": unicast table is overflowed (json-bool)
  2717. - "main-mac": main macaddr string (json-string)
  2718. - "vlan-table": a json-array of active vlan id
  2719. - "unicast-table": a json-array of unicast macaddr string
  2720. - "multicast-table": a json-array of multicast macaddr string
  2721. Example:
  2722. -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
  2723. <- { "return": [
  2724. {
  2725. "promiscuous": true,
  2726. "name": "vnet0",
  2727. "main-mac": "52:54:00:12:34:56",
  2728. "unicast": "normal",
  2729. "vlan": "normal",
  2730. "vlan-table": [
  2731. 4,
  2732. 0
  2733. ],
  2734. "unicast-table": [
  2735. ],
  2736. "multicast": "normal",
  2737. "multicast-overflow": false,
  2738. "unicast-overflow": false,
  2739. "multicast-table": [
  2740. "01:00:5e:00:00:01",
  2741. "33:33:00:00:00:01",
  2742. "33:33:ff:12:34:56"
  2743. ],
  2744. "broadcast-allowed": false
  2745. }
  2746. ]
  2747. }
  2748. EQMP
  2749. {
  2750. .name = "blockdev-add",
  2751. .args_type = "options:q",
  2752. .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
  2753. },
  2754. SQMP
  2755. blockdev-add
  2756. ------------
  2757. Add a block device.
  2758. Arguments:
  2759. - "options": block driver options
  2760. Example (1):
  2761. -> { "execute": "blockdev-add",
  2762. "arguments": { "options" : { "driver": "qcow2",
  2763. "file": { "driver": "file",
  2764. "filename": "test.qcow2" } } } }
  2765. <- { "return": {} }
  2766. Example (2):
  2767. -> { "execute": "blockdev-add",
  2768. "arguments": {
  2769. "options": {
  2770. "driver": "qcow2",
  2771. "id": "my_disk",
  2772. "discard": "unmap",
  2773. "cache": {
  2774. "direct": true,
  2775. "writeback": true
  2776. },
  2777. "file": {
  2778. "driver": "file",
  2779. "filename": "/tmp/test.qcow2"
  2780. },
  2781. "backing": {
  2782. "driver": "raw",
  2783. "file": {
  2784. "driver": "file",
  2785. "filename": "/dev/fdset/4"
  2786. }
  2787. }
  2788. }
  2789. }
  2790. }
  2791. <- { "return": {} }
  2792. EQMP
  2793. {
  2794. .name = "query-named-block-nodes",
  2795. .args_type = "",
  2796. .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
  2797. },
  2798. SQMP
  2799. @query-named-block-nodes
  2800. ------------------------
  2801. Return a list of BlockDeviceInfo for all the named block driver nodes
  2802. Example:
  2803. -> { "execute": "query-named-block-nodes" }
  2804. <- { "return": [ { "ro":false,
  2805. "drv":"qcow2",
  2806. "encrypted":false,
  2807. "file":"disks/test.qcow2",
  2808. "node-name": "my-node",
  2809. "backing_file_depth":1,
  2810. "bps":1000000,
  2811. "bps_rd":0,
  2812. "bps_wr":0,
  2813. "iops":1000000,
  2814. "iops_rd":0,
  2815. "iops_wr":0,
  2816. "bps_max": 8000000,
  2817. "bps_rd_max": 0,
  2818. "bps_wr_max": 0,
  2819. "iops_max": 0,
  2820. "iops_rd_max": 0,
  2821. "iops_wr_max": 0,
  2822. "iops_size": 0,
  2823. "image":{
  2824. "filename":"disks/test.qcow2",
  2825. "format":"qcow2",
  2826. "virtual-size":2048000,
  2827. "backing_file":"base.qcow2",
  2828. "full-backing-filename":"disks/base.qcow2",
  2829. "backing-filename-format:"qcow2",
  2830. "snapshots":[
  2831. {
  2832. "id": "1",
  2833. "name": "snapshot1",
  2834. "vm-state-size": 0,
  2835. "date-sec": 10000200,
  2836. "date-nsec": 12,
  2837. "vm-clock-sec": 206,
  2838. "vm-clock-nsec": 30
  2839. }
  2840. ],
  2841. "backing-image":{
  2842. "filename":"disks/base.qcow2",
  2843. "format":"qcow2",
  2844. "virtual-size":2048000
  2845. }
  2846. } } ] }
  2847. EQMP
  2848. {
  2849. .name = "query-memdev",
  2850. .args_type = "",
  2851. .mhandler.cmd_new = qmp_marshal_input_query_memdev,
  2852. },
  2853. SQMP
  2854. query-memdev
  2855. ------------
  2856. Show memory devices information.
  2857. Example (1):
  2858. -> { "execute": "query-memdev" }
  2859. <- { "return": [
  2860. {
  2861. "size": 536870912,
  2862. "merge": false,
  2863. "dump": true,
  2864. "prealloc": false,
  2865. "host-nodes": [0, 1],
  2866. "policy": "bind"
  2867. },
  2868. {
  2869. "size": 536870912,
  2870. "merge": false,
  2871. "dump": true,
  2872. "prealloc": true,
  2873. "host-nodes": [2, 3],
  2874. "policy": "preferred"
  2875. }
  2876. ]
  2877. }
  2878. EQMP
  2879. {
  2880. .name = "query-memory-devices",
  2881. .args_type = "",
  2882. .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
  2883. },
  2884. SQMP
  2885. @query-memory-devices
  2886. --------------------
  2887. Return a list of memory devices.
  2888. Example:
  2889. -> { "execute": "query-memory-devices" }
  2890. <- { "return": [ { "data":
  2891. { "addr": 5368709120,
  2892. "hotpluggable": true,
  2893. "hotplugged": true,
  2894. "id": "d1",
  2895. "memdev": "/objects/memX",
  2896. "node": 0,
  2897. "size": 1073741824,
  2898. "slot": 0},
  2899. "type": "dimm"
  2900. } ] }
  2901. EQMP
  2902. {
  2903. .name = "query-acpi-ospm-status",
  2904. .args_type = "",
  2905. .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
  2906. },
  2907. SQMP
  2908. @query-acpi-ospm-status
  2909. --------------------
  2910. Return list of ACPIOSTInfo for devices that support status reporting
  2911. via ACPI _OST method.
  2912. Example:
  2913. -> { "execute": "query-acpi-ospm-status" }
  2914. <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
  2915. { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
  2916. { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
  2917. { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
  2918. ]}
  2919. EQMP
  2920. #if defined TARGET_I386
  2921. {
  2922. .name = "rtc-reset-reinjection",
  2923. .args_type = "",
  2924. .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
  2925. },
  2926. #endif
  2927. SQMP
  2928. rtc-reset-reinjection
  2929. ---------------------
  2930. Reset the RTC interrupt reinjection backlog.
  2931. Arguments: None.
  2932. Example:
  2933. -> { "execute": "rtc-reset-reinjection" }
  2934. <- { "return": {} }
  2935. EQMP