qmp-commands.hx 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565
  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?,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?,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. If top == base, that is an error.
  698. If top == active, the job will not be completed by itself,
  699. user needs to complete the job with the block-job-complete
  700. command after getting the ready event. (Since 2.0)
  701. If the base image is smaller than top, then the base image
  702. will be resized to be the same size as top. If top is
  703. smaller than the base image, the base will not be
  704. truncated. If you want the base image size to match the
  705. size of the smaller top, you can safely truncate it
  706. yourself once the commit operation successfully completes.
  707. (json-string)
  708. - "speed": the maximum speed, in bytes per second (json-int, optional)
  709. Example:
  710. -> { "execute": "block-commit", "arguments": { "device": "virtio0",
  711. "top": "/tmp/snap1.qcow2" } }
  712. <- { "return": {} }
  713. EQMP
  714. {
  715. .name = "drive-backup",
  716. .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
  717. "on-source-error:s?,on-target-error:s?",
  718. .mhandler.cmd_new = qmp_marshal_input_drive_backup,
  719. },
  720. SQMP
  721. drive-backup
  722. ------------
  723. Start a point-in-time copy of a block device to a new destination. The
  724. status of ongoing drive-backup operations can be checked with
  725. query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
  726. The operation can be stopped before it has completed using the
  727. block-job-cancel command.
  728. Arguments:
  729. - "device": the name of the device which should be copied.
  730. (json-string)
  731. - "target": the target of the new image. If the file exists, or if it is a
  732. device, the existing file/device will be used as the new
  733. destination. If it does not exist, a new file will be created.
  734. (json-string)
  735. - "format": the format of the new destination, default is to probe if 'mode' is
  736. 'existing', else the format of the source
  737. (json-string, optional)
  738. - "sync": what parts of the disk image should be copied to the destination;
  739. possibilities include "full" for all the disk, "top" for only the sectors
  740. allocated in the topmost image, or "none" to only replicate new I/O
  741. (MirrorSyncMode).
  742. - "mode": whether and how QEMU should create a new image
  743. (NewImageMode, optional, default 'absolute-paths')
  744. - "speed": the maximum speed, in bytes per second (json-int, optional)
  745. - "on-source-error": the action to take on an error on the source, default
  746. 'report'. 'stop' and 'enospc' can only be used
  747. if the block device supports io-status.
  748. (BlockdevOnError, optional)
  749. - "on-target-error": the action to take on an error on the target, default
  750. 'report' (no limitations, since this applies to
  751. a different block device than device).
  752. (BlockdevOnError, optional)
  753. Example:
  754. -> { "execute": "drive-backup", "arguments": { "device": "drive0",
  755. "sync": "full",
  756. "target": "backup.img" } }
  757. <- { "return": {} }
  758. EQMP
  759. {
  760. .name = "block-job-set-speed",
  761. .args_type = "device:B,speed:o",
  762. .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
  763. },
  764. {
  765. .name = "block-job-cancel",
  766. .args_type = "device:B,force:b?",
  767. .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
  768. },
  769. {
  770. .name = "block-job-pause",
  771. .args_type = "device:B",
  772. .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
  773. },
  774. {
  775. .name = "block-job-resume",
  776. .args_type = "device:B",
  777. .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
  778. },
  779. {
  780. .name = "block-job-complete",
  781. .args_type = "device:B",
  782. .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
  783. },
  784. {
  785. .name = "transaction",
  786. .args_type = "actions:q",
  787. .mhandler.cmd_new = qmp_marshal_input_transaction,
  788. },
  789. SQMP
  790. transaction
  791. -----------
  792. Atomically operate on one or more block devices. The only supported operations
  793. for now are drive-backup, internal and external snapshotting. A list of
  794. dictionaries is accepted, that contains the actions to be performed.
  795. If there is any failure performing any of the operations, all operations
  796. for the group are abandoned.
  797. For external snapshots, the dictionary contains the device, the file to use for
  798. the new snapshot, and the format. The default format, if not specified, is
  799. qcow2.
  800. Each new snapshot defaults to being created by QEMU (wiping any
  801. contents if the file already exists), but it is also possible to reuse
  802. an externally-created file. In the latter case, you should ensure that
  803. the new image file has the same contents as the current one; QEMU cannot
  804. perform any meaningful check. Typically this is achieved by using the
  805. current image file as the backing file for the new image.
  806. On failure, the original disks pre-snapshot attempt will be used.
  807. For internal snapshots, the dictionary contains the device and the snapshot's
  808. name. If an internal snapshot matching name already exists, the request will
  809. be rejected. Only some image formats support it, for example, qcow2, rbd,
  810. and sheepdog.
  811. On failure, qemu will try delete the newly created internal snapshot in the
  812. transaction. When an I/O error occurs during deletion, the user needs to fix
  813. it later with qemu-img or other command.
  814. Arguments:
  815. actions array:
  816. - "type": the operation to perform. The only supported
  817. value is "blockdev-snapshot-sync". (json-string)
  818. - "data": a dictionary. The contents depend on the value
  819. of "type". When "type" is "blockdev-snapshot-sync":
  820. - "device": device name to snapshot (json-string)
  821. - "node-name": graph node name to snapshot (json-string)
  822. - "snapshot-file": name of new image file (json-string)
  823. - "snapshot-node-name": graph node name of the new snapshot (json-string)
  824. - "format": format of new image (json-string, optional)
  825. - "mode": whether and how QEMU should create the snapshot file
  826. (NewImageMode, optional, default "absolute-paths")
  827. When "type" is "blockdev-snapshot-internal-sync":
  828. - "device": device name to snapshot (json-string)
  829. - "name": name of the new snapshot (json-string)
  830. Example:
  831. -> { "execute": "transaction",
  832. "arguments": { "actions": [
  833. { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
  834. "snapshot-file": "/some/place/my-image",
  835. "format": "qcow2" } },
  836. { 'type': 'blockdev-snapshot-sync', 'data' : { "node-name": "myfile",
  837. "snapshot-file": "/some/place/my-image2",
  838. "snapshot-node-name": "node3432",
  839. "mode": "existing",
  840. "format": "qcow2" } },
  841. { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
  842. "snapshot-file": "/some/place/my-image2",
  843. "mode": "existing",
  844. "format": "qcow2" } },
  845. { 'type': 'blockdev-snapshot-internal-sync', 'data' : {
  846. "device": "ide-hd2",
  847. "name": "snapshot0" } } ] } }
  848. <- { "return": {} }
  849. EQMP
  850. {
  851. .name = "blockdev-snapshot-sync",
  852. .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
  853. .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
  854. },
  855. SQMP
  856. blockdev-snapshot-sync
  857. ----------------------
  858. Synchronous snapshot of a block device. snapshot-file specifies the
  859. target of the new image. If the file exists, or if it is a device, the
  860. snapshot will be created in the existing file/device. If does not
  861. exist, a new file will be created. format specifies the format of the
  862. snapshot image, default is qcow2.
  863. Arguments:
  864. - "device": device name to snapshot (json-string)
  865. - "node-name": graph node name to snapshot (json-string)
  866. - "snapshot-file": name of new image file (json-string)
  867. - "snapshot-node-name": graph node name of the new snapshot (json-string)
  868. - "mode": whether and how QEMU should create the snapshot file
  869. (NewImageMode, optional, default "absolute-paths")
  870. - "format": format of new image (json-string, optional)
  871. Example:
  872. -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
  873. "snapshot-file":
  874. "/some/place/my-image",
  875. "format": "qcow2" } }
  876. <- { "return": {} }
  877. EQMP
  878. {
  879. .name = "blockdev-snapshot-internal-sync",
  880. .args_type = "device:B,name:s",
  881. .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
  882. },
  883. SQMP
  884. blockdev-snapshot-internal-sync
  885. -------------------------------
  886. Synchronously take an internal snapshot of a block device when the format of
  887. image used supports it. If the name is an empty string, or a snapshot with
  888. name already exists, the operation will fail.
  889. Arguments:
  890. - "device": device name to snapshot (json-string)
  891. - "name": name of the new snapshot (json-string)
  892. Example:
  893. -> { "execute": "blockdev-snapshot-internal-sync",
  894. "arguments": { "device": "ide-hd0",
  895. "name": "snapshot0" }
  896. }
  897. <- { "return": {} }
  898. EQMP
  899. {
  900. .name = "blockdev-snapshot-delete-internal-sync",
  901. .args_type = "device:B,id:s?,name:s?",
  902. .mhandler.cmd_new =
  903. qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
  904. },
  905. SQMP
  906. blockdev-snapshot-delete-internal-sync
  907. --------------------------------------
  908. Synchronously delete an internal snapshot of a block device when the format of
  909. image used supports it. The snapshot is identified by name or id or both. One
  910. of name or id is required. If the snapshot is not found, the operation will
  911. fail.
  912. Arguments:
  913. - "device": device name (json-string)
  914. - "id": ID of the snapshot (json-string, optional)
  915. - "name": name of the snapshot (json-string, optional)
  916. Example:
  917. -> { "execute": "blockdev-snapshot-delete-internal-sync",
  918. "arguments": { "device": "ide-hd0",
  919. "name": "snapshot0" }
  920. }
  921. <- { "return": {
  922. "id": "1",
  923. "name": "snapshot0",
  924. "vm-state-size": 0,
  925. "date-sec": 1000012,
  926. "date-nsec": 10,
  927. "vm-clock-sec": 100,
  928. "vm-clock-nsec": 20
  929. }
  930. }
  931. EQMP
  932. {
  933. .name = "drive-mirror",
  934. .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
  935. "on-source-error:s?,on-target-error:s?,"
  936. "granularity:i?,buf-size:i?",
  937. .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
  938. },
  939. SQMP
  940. drive-mirror
  941. ------------
  942. Start mirroring a block device's writes to a new destination. target
  943. specifies the target of the new image. If the file exists, or if it is
  944. a device, it will be used as the new destination for writes. If it does not
  945. exist, a new file will be created. format specifies the format of the
  946. mirror image, default is to probe if mode='existing', else the format
  947. of the source.
  948. Arguments:
  949. - "device": device name to operate on (json-string)
  950. - "target": name of new image file (json-string)
  951. - "format": format of new image (json-string, optional)
  952. - "mode": how an image file should be created into the target
  953. file/device (NewImageMode, optional, default 'absolute-paths')
  954. - "speed": maximum speed of the streaming job, in bytes per second
  955. (json-int)
  956. - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
  957. - "buf_size": maximum amount of data in flight from source to target, in bytes
  958. (json-int, default 10M)
  959. - "sync": what parts of the disk image should be copied to the destination;
  960. possibilities include "full" for all the disk, "top" for only the sectors
  961. allocated in the topmost image, or "none" to only replicate new I/O
  962. (MirrorSyncMode).
  963. - "on-source-error": the action to take on an error on the source
  964. (BlockdevOnError, default 'report')
  965. - "on-target-error": the action to take on an error on the target
  966. (BlockdevOnError, default 'report')
  967. The default value of the granularity is the image cluster size clamped
  968. between 4096 and 65536, if the image format defines one. If the format
  969. does not define a cluster size, the default value of the granularity
  970. is 65536.
  971. Example:
  972. -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
  973. "target": "/some/place/my-image",
  974. "sync": "full",
  975. "format": "qcow2" } }
  976. <- { "return": {} }
  977. EQMP
  978. {
  979. .name = "balloon",
  980. .args_type = "value:M",
  981. .mhandler.cmd_new = qmp_marshal_input_balloon,
  982. },
  983. SQMP
  984. balloon
  985. -------
  986. Request VM to change its memory allocation (in bytes).
  987. Arguments:
  988. - "value": New memory allocation (json-int)
  989. Example:
  990. -> { "execute": "balloon", "arguments": { "value": 536870912 } }
  991. <- { "return": {} }
  992. EQMP
  993. {
  994. .name = "set_link",
  995. .args_type = "name:s,up:b",
  996. .mhandler.cmd_new = qmp_marshal_input_set_link,
  997. },
  998. SQMP
  999. set_link
  1000. --------
  1001. Change the link status of a network adapter.
  1002. Arguments:
  1003. - "name": network device name (json-string)
  1004. - "up": status is up (json-bool)
  1005. Example:
  1006. -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
  1007. <- { "return": {} }
  1008. EQMP
  1009. {
  1010. .name = "getfd",
  1011. .args_type = "fdname:s",
  1012. .params = "getfd name",
  1013. .help = "receive a file descriptor via SCM rights and assign it a name",
  1014. .mhandler.cmd_new = qmp_marshal_input_getfd,
  1015. },
  1016. SQMP
  1017. getfd
  1018. -----
  1019. Receive a file descriptor via SCM rights and assign it a name.
  1020. Arguments:
  1021. - "fdname": file descriptor name (json-string)
  1022. Example:
  1023. -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
  1024. <- { "return": {} }
  1025. Notes:
  1026. (1) If the name specified by the "fdname" argument already exists,
  1027. the file descriptor assigned to it will be closed and replaced
  1028. by the received file descriptor.
  1029. (2) The 'closefd' command can be used to explicitly close the file
  1030. descriptor when it is no longer needed.
  1031. EQMP
  1032. {
  1033. .name = "closefd",
  1034. .args_type = "fdname:s",
  1035. .params = "closefd name",
  1036. .help = "close a file descriptor previously passed via SCM rights",
  1037. .mhandler.cmd_new = qmp_marshal_input_closefd,
  1038. },
  1039. SQMP
  1040. closefd
  1041. -------
  1042. Close a file descriptor previously passed via SCM rights.
  1043. Arguments:
  1044. - "fdname": file descriptor name (json-string)
  1045. Example:
  1046. -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
  1047. <- { "return": {} }
  1048. EQMP
  1049. {
  1050. .name = "add-fd",
  1051. .args_type = "fdset-id:i?,opaque:s?",
  1052. .params = "add-fd fdset-id opaque",
  1053. .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
  1054. .mhandler.cmd_new = qmp_marshal_input_add_fd,
  1055. },
  1056. SQMP
  1057. add-fd
  1058. -------
  1059. Add a file descriptor, that was passed via SCM rights, to an fd set.
  1060. Arguments:
  1061. - "fdset-id": The ID of the fd set to add the file descriptor to.
  1062. (json-int, optional)
  1063. - "opaque": A free-form string that can be used to describe the fd.
  1064. (json-string, optional)
  1065. Return a json-object with the following information:
  1066. - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
  1067. - "fd": The file descriptor that was received via SCM rights and added to the
  1068. fd set. (json-int)
  1069. Example:
  1070. -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
  1071. <- { "return": { "fdset-id": 1, "fd": 3 } }
  1072. Notes:
  1073. (1) The list of fd sets is shared by all monitor connections.
  1074. (2) If "fdset-id" is not specified, a new fd set will be created.
  1075. EQMP
  1076. {
  1077. .name = "remove-fd",
  1078. .args_type = "fdset-id:i,fd:i?",
  1079. .params = "remove-fd fdset-id fd",
  1080. .help = "Remove a file descriptor from an fd set",
  1081. .mhandler.cmd_new = qmp_marshal_input_remove_fd,
  1082. },
  1083. SQMP
  1084. remove-fd
  1085. ---------
  1086. Remove a file descriptor from an fd set.
  1087. Arguments:
  1088. - "fdset-id": The ID of the fd set that the file descriptor belongs to.
  1089. (json-int)
  1090. - "fd": The file descriptor that is to be removed. (json-int, optional)
  1091. Example:
  1092. -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
  1093. <- { "return": {} }
  1094. Notes:
  1095. (1) The list of fd sets is shared by all monitor connections.
  1096. (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
  1097. removed.
  1098. EQMP
  1099. {
  1100. .name = "query-fdsets",
  1101. .args_type = "",
  1102. .help = "Return information describing all fd sets",
  1103. .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
  1104. },
  1105. SQMP
  1106. query-fdsets
  1107. -------------
  1108. Return information describing all fd sets.
  1109. Arguments: None
  1110. Example:
  1111. -> { "execute": "query-fdsets" }
  1112. <- { "return": [
  1113. {
  1114. "fds": [
  1115. {
  1116. "fd": 30,
  1117. "opaque": "rdonly:/path/to/file"
  1118. },
  1119. {
  1120. "fd": 24,
  1121. "opaque": "rdwr:/path/to/file"
  1122. }
  1123. ],
  1124. "fdset-id": 1
  1125. },
  1126. {
  1127. "fds": [
  1128. {
  1129. "fd": 28
  1130. },
  1131. {
  1132. "fd": 29
  1133. }
  1134. ],
  1135. "fdset-id": 0
  1136. }
  1137. ]
  1138. }
  1139. Note: The list of fd sets is shared by all monitor connections.
  1140. EQMP
  1141. {
  1142. .name = "block_passwd",
  1143. .args_type = "device:s?,node-name:s?,password:s",
  1144. .mhandler.cmd_new = qmp_marshal_input_block_passwd,
  1145. },
  1146. SQMP
  1147. block_passwd
  1148. ------------
  1149. Set the password of encrypted block devices.
  1150. Arguments:
  1151. - "device": device name (json-string)
  1152. - "node-name": name in the block driver state graph (json-string)
  1153. - "password": password (json-string)
  1154. Example:
  1155. -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
  1156. "password": "12345" } }
  1157. <- { "return": {} }
  1158. EQMP
  1159. {
  1160. .name = "block_set_io_throttle",
  1161. .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?",
  1162. .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
  1163. },
  1164. SQMP
  1165. block_set_io_throttle
  1166. ------------
  1167. Change I/O throttle limits for a block drive.
  1168. Arguments:
  1169. - "device": device name (json-string)
  1170. - "bps": total throughput limit in bytes per second (json-int)
  1171. - "bps_rd": read throughput limit in bytes per second (json-int)
  1172. - "bps_wr": write throughput limit in bytes per second (json-int)
  1173. - "iops": total I/O operations per second (json-int)
  1174. - "iops_rd": read I/O operations per second (json-int)
  1175. - "iops_wr": write I/O operations per second (json-int)
  1176. - "bps_max": total max in bytes (json-int)
  1177. - "bps_rd_max": read max in bytes (json-int)
  1178. - "bps_wr_max": write max in bytes (json-int)
  1179. - "iops_max": total I/O operations max (json-int)
  1180. - "iops_rd_max": read I/O operations max (json-int)
  1181. - "iops_wr_max": write I/O operations max (json-int)
  1182. - "iops_size": I/O size in bytes when limiting (json-int)
  1183. Example:
  1184. -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
  1185. "bps": 1000000,
  1186. "bps_rd": 0,
  1187. "bps_wr": 0,
  1188. "iops": 0,
  1189. "iops_rd": 0,
  1190. "iops_wr": 0,
  1191. "bps_max": 8000000,
  1192. "bps_rd_max": 0,
  1193. "bps_wr_max": 0,
  1194. "iops_max": 0,
  1195. "iops_rd_max": 0,
  1196. "iops_wr_max": 0,
  1197. "iops_size": 0 } }
  1198. <- { "return": {} }
  1199. EQMP
  1200. {
  1201. .name = "set_password",
  1202. .args_type = "protocol:s,password:s,connected:s?",
  1203. .mhandler.cmd_new = qmp_marshal_input_set_password,
  1204. },
  1205. SQMP
  1206. set_password
  1207. ------------
  1208. Set the password for vnc/spice protocols.
  1209. Arguments:
  1210. - "protocol": protocol name (json-string)
  1211. - "password": password (json-string)
  1212. - "connected": [ keep | disconnect | fail ] (josn-string, optional)
  1213. Example:
  1214. -> { "execute": "set_password", "arguments": { "protocol": "vnc",
  1215. "password": "secret" } }
  1216. <- { "return": {} }
  1217. EQMP
  1218. {
  1219. .name = "expire_password",
  1220. .args_type = "protocol:s,time:s",
  1221. .mhandler.cmd_new = qmp_marshal_input_expire_password,
  1222. },
  1223. SQMP
  1224. expire_password
  1225. ---------------
  1226. Set the password expire time for vnc/spice protocols.
  1227. Arguments:
  1228. - "protocol": protocol name (json-string)
  1229. - "time": [ now | never | +secs | secs ] (json-string)
  1230. Example:
  1231. -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
  1232. "time": "+60" } }
  1233. <- { "return": {} }
  1234. EQMP
  1235. {
  1236. .name = "add_client",
  1237. .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
  1238. .mhandler.cmd_new = qmp_marshal_input_add_client,
  1239. },
  1240. SQMP
  1241. add_client
  1242. ----------
  1243. Add a graphics client
  1244. Arguments:
  1245. - "protocol": protocol name (json-string)
  1246. - "fdname": file descriptor name (json-string)
  1247. - "skipauth": whether to skip authentication (json-bool, optional)
  1248. - "tls": whether to perform TLS (json-bool, optional)
  1249. Example:
  1250. -> { "execute": "add_client", "arguments": { "protocol": "vnc",
  1251. "fdname": "myclient" } }
  1252. <- { "return": {} }
  1253. EQMP
  1254. {
  1255. .name = "qmp_capabilities",
  1256. .args_type = "",
  1257. .params = "",
  1258. .help = "enable QMP capabilities",
  1259. .user_print = monitor_user_noop,
  1260. .mhandler.cmd_new = do_qmp_capabilities,
  1261. },
  1262. SQMP
  1263. qmp_capabilities
  1264. ----------------
  1265. Enable QMP capabilities.
  1266. Arguments: None.
  1267. Example:
  1268. -> { "execute": "qmp_capabilities" }
  1269. <- { "return": {} }
  1270. Note: This command must be issued before issuing any other command.
  1271. EQMP
  1272. {
  1273. .name = "human-monitor-command",
  1274. .args_type = "command-line:s,cpu-index:i?",
  1275. .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
  1276. },
  1277. SQMP
  1278. human-monitor-command
  1279. ---------------------
  1280. Execute a Human Monitor command.
  1281. Arguments:
  1282. - command-line: the command name and its arguments, just like the
  1283. Human Monitor's shell (json-string)
  1284. - cpu-index: select the CPU number to be used by commands which access CPU
  1285. data, like 'info registers'. The Monitor selects CPU 0 if this
  1286. argument is not provided (json-int, optional)
  1287. Example:
  1288. -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
  1289. <- { "return": "kvm support: enabled\r\n" }
  1290. Notes:
  1291. (1) The Human Monitor is NOT an stable interface, this means that command
  1292. names, arguments and responses can change or be removed at ANY time.
  1293. Applications that rely on long term stability guarantees should NOT
  1294. use this command
  1295. (2) Limitations:
  1296. o This command is stateless, this means that commands that depend
  1297. on state information (such as getfd) might not work
  1298. o Commands that prompt the user for data (eg. 'cont' when the block
  1299. device is encrypted) don't currently work
  1300. 3. Query Commands
  1301. =================
  1302. HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
  1303. HXCOMM this! We will possibly move query commands definitions inside those
  1304. HXCOMM sections, just like regular commands.
  1305. EQMP
  1306. SQMP
  1307. query-version
  1308. -------------
  1309. Show QEMU version.
  1310. Return a json-object with the following information:
  1311. - "qemu": A json-object containing three integer values:
  1312. - "major": QEMU's major version (json-int)
  1313. - "minor": QEMU's minor version (json-int)
  1314. - "micro": QEMU's micro version (json-int)
  1315. - "package": package's version (json-string)
  1316. Example:
  1317. -> { "execute": "query-version" }
  1318. <- {
  1319. "return":{
  1320. "qemu":{
  1321. "major":0,
  1322. "minor":11,
  1323. "micro":5
  1324. },
  1325. "package":""
  1326. }
  1327. }
  1328. EQMP
  1329. {
  1330. .name = "query-version",
  1331. .args_type = "",
  1332. .mhandler.cmd_new = qmp_marshal_input_query_version,
  1333. },
  1334. SQMP
  1335. query-commands
  1336. --------------
  1337. List QMP available commands.
  1338. Each command is represented by a json-object, the returned value is a json-array
  1339. of all commands.
  1340. Each json-object contain:
  1341. - "name": command's name (json-string)
  1342. Example:
  1343. -> { "execute": "query-commands" }
  1344. <- {
  1345. "return":[
  1346. {
  1347. "name":"query-balloon"
  1348. },
  1349. {
  1350. "name":"system_powerdown"
  1351. }
  1352. ]
  1353. }
  1354. Note: This example has been shortened as the real response is too long.
  1355. EQMP
  1356. {
  1357. .name = "query-commands",
  1358. .args_type = "",
  1359. .mhandler.cmd_new = qmp_marshal_input_query_commands,
  1360. },
  1361. SQMP
  1362. query-events
  1363. --------------
  1364. List QMP available events.
  1365. Each event is represented by a json-object, the returned value is a json-array
  1366. of all events.
  1367. Each json-object contains:
  1368. - "name": event's name (json-string)
  1369. Example:
  1370. -> { "execute": "query-events" }
  1371. <- {
  1372. "return":[
  1373. {
  1374. "name":"SHUTDOWN"
  1375. },
  1376. {
  1377. "name":"RESET"
  1378. }
  1379. ]
  1380. }
  1381. Note: This example has been shortened as the real response is too long.
  1382. EQMP
  1383. {
  1384. .name = "query-events",
  1385. .args_type = "",
  1386. .mhandler.cmd_new = qmp_marshal_input_query_events,
  1387. },
  1388. SQMP
  1389. query-chardev
  1390. -------------
  1391. Each device is represented by a json-object. The returned value is a json-array
  1392. of all devices.
  1393. Each json-object contain the following:
  1394. - "label": device's label (json-string)
  1395. - "filename": device's file (json-string)
  1396. Example:
  1397. -> { "execute": "query-chardev" }
  1398. <- {
  1399. "return":[
  1400. {
  1401. "label":"monitor",
  1402. "filename":"stdio"
  1403. },
  1404. {
  1405. "label":"serial0",
  1406. "filename":"vc"
  1407. }
  1408. ]
  1409. }
  1410. EQMP
  1411. {
  1412. .name = "query-chardev",
  1413. .args_type = "",
  1414. .mhandler.cmd_new = qmp_marshal_input_query_chardev,
  1415. },
  1416. SQMP
  1417. query-chardev-backends
  1418. -------------
  1419. List available character device backends.
  1420. Each backend is represented by a json-object, the returned value is a json-array
  1421. of all backends.
  1422. Each json-object contains:
  1423. - "name": backend name (json-string)
  1424. Example:
  1425. -> { "execute": "query-chardev-backends" }
  1426. <- {
  1427. "return":[
  1428. {
  1429. "name":"udp"
  1430. },
  1431. {
  1432. "name":"tcp"
  1433. },
  1434. {
  1435. "name":"unix"
  1436. },
  1437. {
  1438. "name":"spiceport"
  1439. }
  1440. ]
  1441. }
  1442. EQMP
  1443. {
  1444. .name = "query-chardev-backends",
  1445. .args_type = "",
  1446. .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
  1447. },
  1448. SQMP
  1449. query-block
  1450. -----------
  1451. Show the block devices.
  1452. Each block device information is stored in a json-object and the returned value
  1453. is a json-array of all devices.
  1454. Each json-object contain the following:
  1455. - "device": device name (json-string)
  1456. - "type": device type (json-string)
  1457. - deprecated, retained for backward compatibility
  1458. - Possible values: "unknown"
  1459. - "removable": true if the device is removable, false otherwise (json-bool)
  1460. - "locked": true if the device is locked, false otherwise (json-bool)
  1461. - "tray_open": only present if removable, true if the device has a tray,
  1462. and it is open (json-bool)
  1463. - "inserted": only present if the device is inserted, it is a json-object
  1464. containing the following:
  1465. - "file": device file name (json-string)
  1466. - "ro": true if read-only, false otherwise (json-bool)
  1467. - "drv": driver format name (json-string)
  1468. - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
  1469. "file", "file", "ftp", "ftps", "host_cdrom",
  1470. "host_device", "host_floppy", "http", "https",
  1471. "nbd", "parallels", "qcow", "qcow2", "raw",
  1472. "tftp", "vdi", "vmdk", "vpc", "vvfat"
  1473. - "backing_file": backing file name (json-string, optional)
  1474. - "backing_file_depth": number of files in the backing file chain (json-int)
  1475. - "encrypted": true if encrypted, false otherwise (json-bool)
  1476. - "bps": limit total bytes per second (json-int)
  1477. - "bps_rd": limit read bytes per second (json-int)
  1478. - "bps_wr": limit write bytes per second (json-int)
  1479. - "iops": limit total I/O operations per second (json-int)
  1480. - "iops_rd": limit read operations per second (json-int)
  1481. - "iops_wr": limit write operations per second (json-int)
  1482. - "bps_max": total max in bytes (json-int)
  1483. - "bps_rd_max": read max in bytes (json-int)
  1484. - "bps_wr_max": write max in bytes (json-int)
  1485. - "iops_max": total I/O operations max (json-int)
  1486. - "iops_rd_max": read I/O operations max (json-int)
  1487. - "iops_wr_max": write I/O operations max (json-int)
  1488. - "iops_size": I/O size when limiting by iops (json-int)
  1489. - "image": the detail of the image, it is a json-object containing
  1490. the following:
  1491. - "filename": image file name (json-string)
  1492. - "format": image format (json-string)
  1493. - "virtual-size": image capacity in bytes (json-int)
  1494. - "dirty-flag": true if image is not cleanly closed, not present
  1495. means clean (json-bool, optional)
  1496. - "actual-size": actual size on disk in bytes of the image, not
  1497. present when image does not support thin
  1498. provision (json-int, optional)
  1499. - "cluster-size": size of a cluster in bytes, not present if image
  1500. format does not support it (json-int, optional)
  1501. - "encrypted": true if the image is encrypted, not present means
  1502. false or the image format does not support
  1503. encryption (json-bool, optional)
  1504. - "backing_file": backing file name, not present means no backing
  1505. file is used or the image format does not
  1506. support backing file chain
  1507. (json-string, optional)
  1508. - "full-backing-filename": full path of the backing file, not
  1509. present if it equals backing_file or no
  1510. backing file is used
  1511. (json-string, optional)
  1512. - "backing-filename-format": the format of the backing file, not
  1513. present means unknown or no backing
  1514. file (json-string, optional)
  1515. - "snapshots": the internal snapshot info, it is an optional list
  1516. of json-object containing the following:
  1517. - "id": unique snapshot id (json-string)
  1518. - "name": snapshot name (json-string)
  1519. - "vm-state-size": size of the VM state in bytes (json-int)
  1520. - "date-sec": UTC date of the snapshot in seconds (json-int)
  1521. - "date-nsec": fractional part in nanoseconds to be used with
  1522. date-sec (json-int)
  1523. - "vm-clock-sec": VM clock relative to boot in seconds
  1524. (json-int)
  1525. - "vm-clock-nsec": fractional part in nanoseconds to be used
  1526. with vm-clock-sec (json-int)
  1527. - "backing-image": the detail of the backing image, it is an
  1528. optional json-object only present when a
  1529. backing image present for this image
  1530. - "io-status": I/O operation status, only present if the device supports it
  1531. and the VM is configured to stop on errors. It's always reset
  1532. to "ok" when the "cont" command is issued (json_string, optional)
  1533. - Possible values: "ok", "failed", "nospace"
  1534. Example:
  1535. -> { "execute": "query-block" }
  1536. <- {
  1537. "return":[
  1538. {
  1539. "io-status": "ok",
  1540. "device":"ide0-hd0",
  1541. "locked":false,
  1542. "removable":false,
  1543. "inserted":{
  1544. "ro":false,
  1545. "drv":"qcow2",
  1546. "encrypted":false,
  1547. "file":"disks/test.qcow2",
  1548. "backing_file_depth":1,
  1549. "bps":1000000,
  1550. "bps_rd":0,
  1551. "bps_wr":0,
  1552. "iops":1000000,
  1553. "iops_rd":0,
  1554. "iops_wr":0,
  1555. "bps_max": 8000000,
  1556. "bps_rd_max": 0,
  1557. "bps_wr_max": 0,
  1558. "iops_max": 0,
  1559. "iops_rd_max": 0,
  1560. "iops_wr_max": 0,
  1561. "iops_size": 0,
  1562. "image":{
  1563. "filename":"disks/test.qcow2",
  1564. "format":"qcow2",
  1565. "virtual-size":2048000,
  1566. "backing_file":"base.qcow2",
  1567. "full-backing-filename":"disks/base.qcow2",
  1568. "backing-filename-format:"qcow2",
  1569. "snapshots":[
  1570. {
  1571. "id": "1",
  1572. "name": "snapshot1",
  1573. "vm-state-size": 0,
  1574. "date-sec": 10000200,
  1575. "date-nsec": 12,
  1576. "vm-clock-sec": 206,
  1577. "vm-clock-nsec": 30
  1578. }
  1579. ],
  1580. "backing-image":{
  1581. "filename":"disks/base.qcow2",
  1582. "format":"qcow2",
  1583. "virtual-size":2048000
  1584. }
  1585. }
  1586. },
  1587. "type":"unknown"
  1588. },
  1589. {
  1590. "io-status": "ok",
  1591. "device":"ide1-cd0",
  1592. "locked":false,
  1593. "removable":true,
  1594. "type":"unknown"
  1595. },
  1596. {
  1597. "device":"floppy0",
  1598. "locked":false,
  1599. "removable":true,
  1600. "type":"unknown"
  1601. },
  1602. {
  1603. "device":"sd0",
  1604. "locked":false,
  1605. "removable":true,
  1606. "type":"unknown"
  1607. }
  1608. ]
  1609. }
  1610. EQMP
  1611. {
  1612. .name = "query-block",
  1613. .args_type = "",
  1614. .mhandler.cmd_new = qmp_marshal_input_query_block,
  1615. },
  1616. SQMP
  1617. query-blockstats
  1618. ----------------
  1619. Show block device statistics.
  1620. Each device statistic information is stored in a json-object and the returned
  1621. value is a json-array of all devices.
  1622. Each json-object contain the following:
  1623. - "device": device name (json-string)
  1624. - "stats": A json-object with the statistics information, it contains:
  1625. - "rd_bytes": bytes read (json-int)
  1626. - "wr_bytes": bytes written (json-int)
  1627. - "rd_operations": read operations (json-int)
  1628. - "wr_operations": write operations (json-int)
  1629. - "flush_operations": cache flush operations (json-int)
  1630. - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
  1631. - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
  1632. - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
  1633. - "wr_highest_offset": Highest offset of a sector written since the
  1634. BlockDriverState has been opened (json-int)
  1635. - "parent": Contains recursively the statistics of the underlying
  1636. protocol (e.g. the host file for a qcow2 image). If there is
  1637. no underlying protocol, this field is omitted
  1638. (json-object, optional)
  1639. Example:
  1640. -> { "execute": "query-blockstats" }
  1641. <- {
  1642. "return":[
  1643. {
  1644. "device":"ide0-hd0",
  1645. "parent":{
  1646. "stats":{
  1647. "wr_highest_offset":3686448128,
  1648. "wr_bytes":9786368,
  1649. "wr_operations":751,
  1650. "rd_bytes":122567168,
  1651. "rd_operations":36772
  1652. "wr_total_times_ns":313253456
  1653. "rd_total_times_ns":3465673657
  1654. "flush_total_times_ns":49653
  1655. "flush_operations":61,
  1656. }
  1657. },
  1658. "stats":{
  1659. "wr_highest_offset":2821110784,
  1660. "wr_bytes":9786368,
  1661. "wr_operations":692,
  1662. "rd_bytes":122739200,
  1663. "rd_operations":36604
  1664. "flush_operations":51,
  1665. "wr_total_times_ns":313253456
  1666. "rd_total_times_ns":3465673657
  1667. "flush_total_times_ns":49653
  1668. }
  1669. },
  1670. {
  1671. "device":"ide1-cd0",
  1672. "stats":{
  1673. "wr_highest_offset":0,
  1674. "wr_bytes":0,
  1675. "wr_operations":0,
  1676. "rd_bytes":0,
  1677. "rd_operations":0
  1678. "flush_operations":0,
  1679. "wr_total_times_ns":0
  1680. "rd_total_times_ns":0
  1681. "flush_total_times_ns":0
  1682. }
  1683. },
  1684. {
  1685. "device":"floppy0",
  1686. "stats":{
  1687. "wr_highest_offset":0,
  1688. "wr_bytes":0,
  1689. "wr_operations":0,
  1690. "rd_bytes":0,
  1691. "rd_operations":0
  1692. "flush_operations":0,
  1693. "wr_total_times_ns":0
  1694. "rd_total_times_ns":0
  1695. "flush_total_times_ns":0
  1696. }
  1697. },
  1698. {
  1699. "device":"sd0",
  1700. "stats":{
  1701. "wr_highest_offset":0,
  1702. "wr_bytes":0,
  1703. "wr_operations":0,
  1704. "rd_bytes":0,
  1705. "rd_operations":0
  1706. "flush_operations":0,
  1707. "wr_total_times_ns":0
  1708. "rd_total_times_ns":0
  1709. "flush_total_times_ns":0
  1710. }
  1711. }
  1712. ]
  1713. }
  1714. EQMP
  1715. {
  1716. .name = "query-blockstats",
  1717. .args_type = "",
  1718. .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
  1719. },
  1720. SQMP
  1721. query-cpus
  1722. ----------
  1723. Show CPU information.
  1724. Return a json-array. Each CPU is represented by a json-object, which contains:
  1725. - "CPU": CPU index (json-int)
  1726. - "current": true if this is the current CPU, false otherwise (json-bool)
  1727. - "halted": true if the cpu is halted, false otherwise (json-bool)
  1728. - Current program counter. The key's name depends on the architecture:
  1729. "pc": i386/x86_64 (json-int)
  1730. "nip": PPC (json-int)
  1731. "pc" and "npc": sparc (json-int)
  1732. "PC": mips (json-int)
  1733. - "thread_id": ID of the underlying host thread (json-int)
  1734. Example:
  1735. -> { "execute": "query-cpus" }
  1736. <- {
  1737. "return":[
  1738. {
  1739. "CPU":0,
  1740. "current":true,
  1741. "halted":false,
  1742. "pc":3227107138
  1743. "thread_id":3134
  1744. },
  1745. {
  1746. "CPU":1,
  1747. "current":false,
  1748. "halted":true,
  1749. "pc":7108165
  1750. "thread_id":3135
  1751. }
  1752. ]
  1753. }
  1754. EQMP
  1755. {
  1756. .name = "query-cpus",
  1757. .args_type = "",
  1758. .mhandler.cmd_new = qmp_marshal_input_query_cpus,
  1759. },
  1760. SQMP
  1761. query-iothreads
  1762. ---------------
  1763. Returns a list of information about each iothread.
  1764. Note this list excludes the QEMU main loop thread, which is not declared
  1765. using the -object iothread command-line option. It is always the main thread
  1766. of the process.
  1767. Return a json-array. Each iothread is represented by a json-object, which contains:
  1768. - "id": name of iothread (json-str)
  1769. - "thread-id": ID of the underlying host thread (json-int)
  1770. Example:
  1771. -> { "execute": "query-iothreads" }
  1772. <- {
  1773. "return":[
  1774. {
  1775. "id":"iothread0",
  1776. "thread-id":3134
  1777. },
  1778. {
  1779. "id":"iothread1",
  1780. "thread-id":3135
  1781. }
  1782. ]
  1783. }
  1784. EQMP
  1785. {
  1786. .name = "query-iothreads",
  1787. .args_type = "",
  1788. .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
  1789. },
  1790. SQMP
  1791. query-pci
  1792. ---------
  1793. PCI buses and devices information.
  1794. The returned value is a json-array of all buses. Each bus is represented by
  1795. a json-object, which has a key with a json-array of all PCI devices attached
  1796. to it. Each device is represented by a json-object.
  1797. The bus json-object contains the following:
  1798. - "bus": bus number (json-int)
  1799. - "devices": a json-array of json-objects, each json-object represents a
  1800. PCI device
  1801. The PCI device json-object contains the following:
  1802. - "bus": identical to the parent's bus number (json-int)
  1803. - "slot": slot number (json-int)
  1804. - "function": function number (json-int)
  1805. - "class_info": a json-object containing:
  1806. - "desc": device class description (json-string, optional)
  1807. - "class": device class number (json-int)
  1808. - "id": a json-object containing:
  1809. - "device": device ID (json-int)
  1810. - "vendor": vendor ID (json-int)
  1811. - "irq": device's IRQ if assigned (json-int, optional)
  1812. - "qdev_id": qdev id string (json-string)
  1813. - "pci_bridge": It's a json-object, only present if this device is a
  1814. PCI bridge, contains:
  1815. - "bus": bus number (json-int)
  1816. - "secondary": secondary bus number (json-int)
  1817. - "subordinate": subordinate bus number (json-int)
  1818. - "io_range": I/O memory range information, a json-object with the
  1819. following members:
  1820. - "base": base address, in bytes (json-int)
  1821. - "limit": limit address, in bytes (json-int)
  1822. - "memory_range": memory range information, a json-object with the
  1823. following members:
  1824. - "base": base address, in bytes (json-int)
  1825. - "limit": limit address, in bytes (json-int)
  1826. - "prefetchable_range": Prefetchable memory range information, a
  1827. json-object with the following members:
  1828. - "base": base address, in bytes (json-int)
  1829. - "limit": limit address, in bytes (json-int)
  1830. - "devices": a json-array of PCI devices if there's any attached, each
  1831. each element is represented by a json-object, which contains
  1832. the same members of the 'PCI device json-object' described
  1833. above (optional)
  1834. - "regions": a json-array of json-objects, each json-object represents a
  1835. memory region of this device
  1836. The memory range json-object contains the following:
  1837. - "base": base memory address (json-int)
  1838. - "limit": limit value (json-int)
  1839. The region json-object can be an I/O region or a memory region, an I/O region
  1840. json-object contains the following:
  1841. - "type": "io" (json-string, fixed)
  1842. - "bar": BAR number (json-int)
  1843. - "address": memory address (json-int)
  1844. - "size": memory size (json-int)
  1845. A memory region json-object contains the following:
  1846. - "type": "memory" (json-string, fixed)
  1847. - "bar": BAR number (json-int)
  1848. - "address": memory address (json-int)
  1849. - "size": memory size (json-int)
  1850. - "mem_type_64": true or false (json-bool)
  1851. - "prefetch": true or false (json-bool)
  1852. Example:
  1853. -> { "execute": "query-pci" }
  1854. <- {
  1855. "return":[
  1856. {
  1857. "bus":0,
  1858. "devices":[
  1859. {
  1860. "bus":0,
  1861. "qdev_id":"",
  1862. "slot":0,
  1863. "class_info":{
  1864. "class":1536,
  1865. "desc":"Host bridge"
  1866. },
  1867. "id":{
  1868. "device":32902,
  1869. "vendor":4663
  1870. },
  1871. "function":0,
  1872. "regions":[
  1873. ]
  1874. },
  1875. {
  1876. "bus":0,
  1877. "qdev_id":"",
  1878. "slot":1,
  1879. "class_info":{
  1880. "class":1537,
  1881. "desc":"ISA bridge"
  1882. },
  1883. "id":{
  1884. "device":32902,
  1885. "vendor":28672
  1886. },
  1887. "function":0,
  1888. "regions":[
  1889. ]
  1890. },
  1891. {
  1892. "bus":0,
  1893. "qdev_id":"",
  1894. "slot":1,
  1895. "class_info":{
  1896. "class":257,
  1897. "desc":"IDE controller"
  1898. },
  1899. "id":{
  1900. "device":32902,
  1901. "vendor":28688
  1902. },
  1903. "function":1,
  1904. "regions":[
  1905. {
  1906. "bar":4,
  1907. "size":16,
  1908. "address":49152,
  1909. "type":"io"
  1910. }
  1911. ]
  1912. },
  1913. {
  1914. "bus":0,
  1915. "qdev_id":"",
  1916. "slot":2,
  1917. "class_info":{
  1918. "class":768,
  1919. "desc":"VGA controller"
  1920. },
  1921. "id":{
  1922. "device":4115,
  1923. "vendor":184
  1924. },
  1925. "function":0,
  1926. "regions":[
  1927. {
  1928. "prefetch":true,
  1929. "mem_type_64":false,
  1930. "bar":0,
  1931. "size":33554432,
  1932. "address":4026531840,
  1933. "type":"memory"
  1934. },
  1935. {
  1936. "prefetch":false,
  1937. "mem_type_64":false,
  1938. "bar":1,
  1939. "size":4096,
  1940. "address":4060086272,
  1941. "type":"memory"
  1942. },
  1943. {
  1944. "prefetch":false,
  1945. "mem_type_64":false,
  1946. "bar":6,
  1947. "size":65536,
  1948. "address":-1,
  1949. "type":"memory"
  1950. }
  1951. ]
  1952. },
  1953. {
  1954. "bus":0,
  1955. "qdev_id":"",
  1956. "irq":11,
  1957. "slot":4,
  1958. "class_info":{
  1959. "class":1280,
  1960. "desc":"RAM controller"
  1961. },
  1962. "id":{
  1963. "device":6900,
  1964. "vendor":4098
  1965. },
  1966. "function":0,
  1967. "regions":[
  1968. {
  1969. "bar":0,
  1970. "size":32,
  1971. "address":49280,
  1972. "type":"io"
  1973. }
  1974. ]
  1975. }
  1976. ]
  1977. }
  1978. ]
  1979. }
  1980. Note: This example has been shortened as the real response is too long.
  1981. EQMP
  1982. {
  1983. .name = "query-pci",
  1984. .args_type = "",
  1985. .mhandler.cmd_new = qmp_marshal_input_query_pci,
  1986. },
  1987. SQMP
  1988. query-kvm
  1989. ---------
  1990. Show KVM information.
  1991. Return a json-object with the following information:
  1992. - "enabled": true if KVM support is enabled, false otherwise (json-bool)
  1993. - "present": true if QEMU has KVM support, false otherwise (json-bool)
  1994. Example:
  1995. -> { "execute": "query-kvm" }
  1996. <- { "return": { "enabled": true, "present": true } }
  1997. EQMP
  1998. {
  1999. .name = "query-kvm",
  2000. .args_type = "",
  2001. .mhandler.cmd_new = qmp_marshal_input_query_kvm,
  2002. },
  2003. SQMP
  2004. query-status
  2005. ------------
  2006. Return a json-object with the following information:
  2007. - "running": true if the VM is running, or false if it is paused (json-bool)
  2008. - "singlestep": true if the VM is in single step mode,
  2009. false otherwise (json-bool)
  2010. - "status": one of the following values (json-string)
  2011. "debug" - QEMU is running on a debugger
  2012. "inmigrate" - guest is paused waiting for an incoming migration
  2013. "internal-error" - An internal error that prevents further guest
  2014. execution has occurred
  2015. "io-error" - the last IOP has failed and the device is configured
  2016. to pause on I/O errors
  2017. "paused" - guest has been paused via the 'stop' command
  2018. "postmigrate" - guest is paused following a successful 'migrate'
  2019. "prelaunch" - QEMU was started with -S and guest has not started
  2020. "finish-migrate" - guest is paused to finish the migration process
  2021. "restore-vm" - guest is paused to restore VM state
  2022. "running" - guest is actively running
  2023. "save-vm" - guest is paused to save the VM state
  2024. "shutdown" - guest is shut down (and -no-shutdown is in use)
  2025. "watchdog" - the watchdog action is configured to pause and
  2026. has been triggered
  2027. Example:
  2028. -> { "execute": "query-status" }
  2029. <- { "return": { "running": true, "singlestep": false, "status": "running" } }
  2030. EQMP
  2031. {
  2032. .name = "query-status",
  2033. .args_type = "",
  2034. .mhandler.cmd_new = qmp_marshal_input_query_status,
  2035. },
  2036. SQMP
  2037. query-mice
  2038. ----------
  2039. Show VM mice information.
  2040. Each mouse is represented by a json-object, the returned value is a json-array
  2041. of all mice.
  2042. The mouse json-object contains the following:
  2043. - "name": mouse's name (json-string)
  2044. - "index": mouse's index (json-int)
  2045. - "current": true if this mouse is receiving events, false otherwise (json-bool)
  2046. - "absolute": true if the mouse generates absolute input events (json-bool)
  2047. Example:
  2048. -> { "execute": "query-mice" }
  2049. <- {
  2050. "return":[
  2051. {
  2052. "name":"QEMU Microsoft Mouse",
  2053. "index":0,
  2054. "current":false,
  2055. "absolute":false
  2056. },
  2057. {
  2058. "name":"QEMU PS/2 Mouse",
  2059. "index":1,
  2060. "current":true,
  2061. "absolute":true
  2062. }
  2063. ]
  2064. }
  2065. EQMP
  2066. {
  2067. .name = "query-mice",
  2068. .args_type = "",
  2069. .mhandler.cmd_new = qmp_marshal_input_query_mice,
  2070. },
  2071. SQMP
  2072. query-vnc
  2073. ---------
  2074. Show VNC server information.
  2075. Return a json-object with server information. Connected clients are returned
  2076. as a json-array of json-objects.
  2077. The main json-object contains the following:
  2078. - "enabled": true or false (json-bool)
  2079. - "host": server's IP address (json-string)
  2080. - "family": address family (json-string)
  2081. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  2082. - "service": server's port number (json-string)
  2083. - "auth": authentication method (json-string)
  2084. - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
  2085. "tls", "ultra", "unknown", "vencrypt", "vencrypt",
  2086. "vencrypt+plain", "vencrypt+tls+none",
  2087. "vencrypt+tls+plain", "vencrypt+tls+sasl",
  2088. "vencrypt+tls+vnc", "vencrypt+x509+none",
  2089. "vencrypt+x509+plain", "vencrypt+x509+sasl",
  2090. "vencrypt+x509+vnc", "vnc"
  2091. - "clients": a json-array of all connected clients
  2092. Clients are described by a json-object, each one contain the following:
  2093. - "host": client's IP address (json-string)
  2094. - "family": address family (json-string)
  2095. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  2096. - "service": client's port number (json-string)
  2097. - "x509_dname": TLS dname (json-string, optional)
  2098. - "sasl_username": SASL username (json-string, optional)
  2099. Example:
  2100. -> { "execute": "query-vnc" }
  2101. <- {
  2102. "return":{
  2103. "enabled":true,
  2104. "host":"0.0.0.0",
  2105. "service":"50402",
  2106. "auth":"vnc",
  2107. "family":"ipv4",
  2108. "clients":[
  2109. {
  2110. "host":"127.0.0.1",
  2111. "service":"50401",
  2112. "family":"ipv4"
  2113. }
  2114. ]
  2115. }
  2116. }
  2117. EQMP
  2118. {
  2119. .name = "query-vnc",
  2120. .args_type = "",
  2121. .mhandler.cmd_new = qmp_marshal_input_query_vnc,
  2122. },
  2123. SQMP
  2124. query-spice
  2125. -----------
  2126. Show SPICE server information.
  2127. Return a json-object with server information. Connected clients are returned
  2128. as a json-array of json-objects.
  2129. The main json-object contains the following:
  2130. - "enabled": true or false (json-bool)
  2131. - "host": server's IP address (json-string)
  2132. - "port": server's port number (json-int, optional)
  2133. - "tls-port": server's port number (json-int, optional)
  2134. - "auth": authentication method (json-string)
  2135. - Possible values: "none", "spice"
  2136. - "channels": a json-array of all active channels clients
  2137. Channels are described by a json-object, each one contain the following:
  2138. - "host": client's IP address (json-string)
  2139. - "family": address family (json-string)
  2140. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  2141. - "port": client's port number (json-string)
  2142. - "connection-id": spice connection id. All channels with the same id
  2143. belong to the same spice session (json-int)
  2144. - "channel-type": channel type. "1" is the main control channel, filter for
  2145. this one if you want track spice sessions only (json-int)
  2146. - "channel-id": channel id. Usually "0", might be different needed when
  2147. multiple channels of the same type exist, such as multiple
  2148. display channels in a multihead setup (json-int)
  2149. - "tls": whevener the channel is encrypted (json-bool)
  2150. Example:
  2151. -> { "execute": "query-spice" }
  2152. <- {
  2153. "return": {
  2154. "enabled": true,
  2155. "auth": "spice",
  2156. "port": 5920,
  2157. "tls-port": 5921,
  2158. "host": "0.0.0.0",
  2159. "channels": [
  2160. {
  2161. "port": "54924",
  2162. "family": "ipv4",
  2163. "channel-type": 1,
  2164. "connection-id": 1804289383,
  2165. "host": "127.0.0.1",
  2166. "channel-id": 0,
  2167. "tls": true
  2168. },
  2169. {
  2170. "port": "36710",
  2171. "family": "ipv4",
  2172. "channel-type": 4,
  2173. "connection-id": 1804289383,
  2174. "host": "127.0.0.1",
  2175. "channel-id": 0,
  2176. "tls": false
  2177. },
  2178. [ ... more channels follow ... ]
  2179. ]
  2180. }
  2181. }
  2182. EQMP
  2183. #if defined(CONFIG_SPICE)
  2184. {
  2185. .name = "query-spice",
  2186. .args_type = "",
  2187. .mhandler.cmd_new = qmp_marshal_input_query_spice,
  2188. },
  2189. #endif
  2190. SQMP
  2191. query-name
  2192. ----------
  2193. Show VM name.
  2194. Return a json-object with the following information:
  2195. - "name": VM's name (json-string, optional)
  2196. Example:
  2197. -> { "execute": "query-name" }
  2198. <- { "return": { "name": "qemu-name" } }
  2199. EQMP
  2200. {
  2201. .name = "query-name",
  2202. .args_type = "",
  2203. .mhandler.cmd_new = qmp_marshal_input_query_name,
  2204. },
  2205. SQMP
  2206. query-uuid
  2207. ----------
  2208. Show VM UUID.
  2209. Return a json-object with the following information:
  2210. - "UUID": Universally Unique Identifier (json-string)
  2211. Example:
  2212. -> { "execute": "query-uuid" }
  2213. <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
  2214. EQMP
  2215. {
  2216. .name = "query-uuid",
  2217. .args_type = "",
  2218. .mhandler.cmd_new = qmp_marshal_input_query_uuid,
  2219. },
  2220. SQMP
  2221. query-command-line-options
  2222. --------------------------
  2223. Show command line option schema.
  2224. Return a json-array of command line option schema for all options (or for
  2225. the given option), returning an error if the given option doesn't exist.
  2226. Each array entry contains the following:
  2227. - "option": option name (json-string)
  2228. - "parameters": a json-array describes all parameters of the option:
  2229. - "name": parameter name (json-string)
  2230. - "type": parameter type (one of 'string', 'boolean', 'number',
  2231. or 'size')
  2232. - "help": human readable description of the parameter
  2233. (json-string, optional)
  2234. Example:
  2235. -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
  2236. <- { "return": [
  2237. {
  2238. "parameters": [
  2239. {
  2240. "name": "romfile",
  2241. "type": "string"
  2242. },
  2243. {
  2244. "name": "bootindex",
  2245. "type": "number"
  2246. }
  2247. ],
  2248. "option": "option-rom"
  2249. }
  2250. ]
  2251. }
  2252. EQMP
  2253. {
  2254. .name = "query-command-line-options",
  2255. .args_type = "option:s?",
  2256. .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
  2257. },
  2258. SQMP
  2259. query-migrate
  2260. -------------
  2261. Migration status.
  2262. Return a json-object. If migration is active there will be another json-object
  2263. with RAM migration status and if block migration is active another one with
  2264. block migration status.
  2265. The main json-object contains the following:
  2266. - "status": migration status (json-string)
  2267. - Possible values: "active", "completed", "failed", "cancelled"
  2268. - "total-time": total amount of ms since migration started. If
  2269. migration has ended, it returns the total migration
  2270. time (json-int)
  2271. - "setup-time" amount of setup time in milliseconds _before_ the
  2272. iterations begin but _after_ the QMP command is issued.
  2273. This is designed to provide an accounting of any activities
  2274. (such as RDMA pinning) which may be expensive, but do not
  2275. actually occur during the iterative migration rounds
  2276. themselves. (json-int)
  2277. - "downtime": only present when migration has finished correctly
  2278. total amount in ms for downtime that happened (json-int)
  2279. - "expected-downtime": only present while migration is active
  2280. total amount in ms for downtime that was calculated on
  2281. the last bitmap round (json-int)
  2282. - "ram": only present if "status" is "active", it is a json-object with the
  2283. following RAM information:
  2284. - "transferred": amount transferred in bytes (json-int)
  2285. - "remaining": amount remaining to transfer in bytes (json-int)
  2286. - "total": total amount of memory in bytes (json-int)
  2287. - "duplicate": number of pages filled entirely with the same
  2288. byte (json-int)
  2289. These are sent over the wire much more efficiently.
  2290. - "skipped": number of skipped zero pages (json-int)
  2291. - "normal" : number of whole pages transferred. I.e. they
  2292. were not sent as duplicate or xbzrle pages (json-int)
  2293. - "normal-bytes" : number of bytes transferred in whole
  2294. pages. This is just normal pages times size of one page,
  2295. but this way upper levels don't need to care about page
  2296. size (json-int)
  2297. - "disk": only present if "status" is "active" and it is a block migration,
  2298. it is a json-object with the following disk information:
  2299. - "transferred": amount transferred in bytes (json-int)
  2300. - "remaining": amount remaining to transfer in bytes json-int)
  2301. - "total": total disk size in bytes (json-int)
  2302. - "xbzrle-cache": only present if XBZRLE is active.
  2303. It is a json-object with the following XBZRLE information:
  2304. - "cache-size": XBZRLE cache size in bytes
  2305. - "bytes": number of bytes transferred for XBZRLE compressed pages
  2306. - "pages": number of XBZRLE compressed pages
  2307. - "cache-miss": number of XBRZRLE page cache misses
  2308. - "overflow": number of times XBZRLE overflows. This means
  2309. that the XBZRLE encoding was bigger than just sent the
  2310. whole page, and then we sent the whole page instead (as as
  2311. normal page).
  2312. Examples:
  2313. 1. Before the first migration
  2314. -> { "execute": "query-migrate" }
  2315. <- { "return": {} }
  2316. 2. Migration is done and has succeeded
  2317. -> { "execute": "query-migrate" }
  2318. <- { "return": {
  2319. "status": "completed",
  2320. "ram":{
  2321. "transferred":123,
  2322. "remaining":123,
  2323. "total":246,
  2324. "total-time":12345,
  2325. "setup-time":12345,
  2326. "downtime":12345,
  2327. "duplicate":123,
  2328. "normal":123,
  2329. "normal-bytes":123456
  2330. }
  2331. }
  2332. }
  2333. 3. Migration is done and has failed
  2334. -> { "execute": "query-migrate" }
  2335. <- { "return": { "status": "failed" } }
  2336. 4. Migration is being performed and is not a block migration:
  2337. -> { "execute": "query-migrate" }
  2338. <- {
  2339. "return":{
  2340. "status":"active",
  2341. "ram":{
  2342. "transferred":123,
  2343. "remaining":123,
  2344. "total":246,
  2345. "total-time":12345,
  2346. "setup-time":12345,
  2347. "expected-downtime":12345,
  2348. "duplicate":123,
  2349. "normal":123,
  2350. "normal-bytes":123456
  2351. }
  2352. }
  2353. }
  2354. 5. Migration is being performed and is a block migration:
  2355. -> { "execute": "query-migrate" }
  2356. <- {
  2357. "return":{
  2358. "status":"active",
  2359. "ram":{
  2360. "total":1057024,
  2361. "remaining":1053304,
  2362. "transferred":3720,
  2363. "total-time":12345,
  2364. "setup-time":12345,
  2365. "expected-downtime":12345,
  2366. "duplicate":123,
  2367. "normal":123,
  2368. "normal-bytes":123456
  2369. },
  2370. "disk":{
  2371. "total":20971520,
  2372. "remaining":20880384,
  2373. "transferred":91136
  2374. }
  2375. }
  2376. }
  2377. 6. Migration is being performed and XBZRLE is active:
  2378. -> { "execute": "query-migrate" }
  2379. <- {
  2380. "return":{
  2381. "status":"active",
  2382. "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
  2383. "ram":{
  2384. "total":1057024,
  2385. "remaining":1053304,
  2386. "transferred":3720,
  2387. "total-time":12345,
  2388. "setup-time":12345,
  2389. "expected-downtime":12345,
  2390. "duplicate":10,
  2391. "normal":3333,
  2392. "normal-bytes":3412992
  2393. },
  2394. "xbzrle-cache":{
  2395. "cache-size":67108864,
  2396. "bytes":20971520,
  2397. "pages":2444343,
  2398. "cache-miss":2244,
  2399. "overflow":34434
  2400. }
  2401. }
  2402. }
  2403. EQMP
  2404. {
  2405. .name = "query-migrate",
  2406. .args_type = "",
  2407. .mhandler.cmd_new = qmp_marshal_input_query_migrate,
  2408. },
  2409. SQMP
  2410. migrate-set-capabilities
  2411. ------------------------
  2412. Enable/Disable migration capabilities
  2413. - "xbzrle": XBZRLE support
  2414. Arguments:
  2415. Example:
  2416. -> { "execute": "migrate-set-capabilities" , "arguments":
  2417. { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
  2418. EQMP
  2419. {
  2420. .name = "migrate-set-capabilities",
  2421. .args_type = "capabilities:O",
  2422. .params = "capability:s,state:b",
  2423. .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
  2424. },
  2425. SQMP
  2426. query-migrate-capabilities
  2427. --------------------------
  2428. Query current migration capabilities
  2429. - "capabilities": migration capabilities state
  2430. - "xbzrle" : XBZRLE state (json-bool)
  2431. Arguments:
  2432. Example:
  2433. -> { "execute": "query-migrate-capabilities" }
  2434. <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
  2435. EQMP
  2436. {
  2437. .name = "query-migrate-capabilities",
  2438. .args_type = "",
  2439. .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
  2440. },
  2441. SQMP
  2442. query-balloon
  2443. -------------
  2444. Show balloon information.
  2445. Make an asynchronous request for balloon info. When the request completes a
  2446. json-object will be returned containing the following data:
  2447. - "actual": current balloon value in bytes (json-int)
  2448. Example:
  2449. -> { "execute": "query-balloon" }
  2450. <- {
  2451. "return":{
  2452. "actual":1073741824,
  2453. }
  2454. }
  2455. EQMP
  2456. {
  2457. .name = "query-balloon",
  2458. .args_type = "",
  2459. .mhandler.cmd_new = qmp_marshal_input_query_balloon,
  2460. },
  2461. {
  2462. .name = "query-block-jobs",
  2463. .args_type = "",
  2464. .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
  2465. },
  2466. {
  2467. .name = "qom-list",
  2468. .args_type = "path:s",
  2469. .mhandler.cmd_new = qmp_marshal_input_qom_list,
  2470. },
  2471. {
  2472. .name = "qom-set",
  2473. .args_type = "path:s,property:s,value:q",
  2474. .mhandler.cmd_new = qmp_qom_set,
  2475. },
  2476. {
  2477. .name = "qom-get",
  2478. .args_type = "path:s,property:s",
  2479. .mhandler.cmd_new = qmp_qom_get,
  2480. },
  2481. {
  2482. .name = "nbd-server-start",
  2483. .args_type = "addr:q",
  2484. .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
  2485. },
  2486. {
  2487. .name = "nbd-server-add",
  2488. .args_type = "device:B,writable:b?",
  2489. .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
  2490. },
  2491. {
  2492. .name = "nbd-server-stop",
  2493. .args_type = "",
  2494. .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
  2495. },
  2496. {
  2497. .name = "change-vnc-password",
  2498. .args_type = "password:s",
  2499. .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
  2500. },
  2501. {
  2502. .name = "qom-list-types",
  2503. .args_type = "implements:s?,abstract:b?",
  2504. .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
  2505. },
  2506. {
  2507. .name = "device-list-properties",
  2508. .args_type = "typename:s",
  2509. .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
  2510. },
  2511. {
  2512. .name = "query-machines",
  2513. .args_type = "",
  2514. .mhandler.cmd_new = qmp_marshal_input_query_machines,
  2515. },
  2516. {
  2517. .name = "query-cpu-definitions",
  2518. .args_type = "",
  2519. .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
  2520. },
  2521. {
  2522. .name = "query-target",
  2523. .args_type = "",
  2524. .mhandler.cmd_new = qmp_marshal_input_query_target,
  2525. },
  2526. {
  2527. .name = "query-tpm",
  2528. .args_type = "",
  2529. .mhandler.cmd_new = qmp_marshal_input_query_tpm,
  2530. },
  2531. SQMP
  2532. query-tpm
  2533. ---------
  2534. Return information about the TPM device.
  2535. Arguments: None
  2536. Example:
  2537. -> { "execute": "query-tpm" }
  2538. <- { "return":
  2539. [
  2540. { "model": "tpm-tis",
  2541. "options":
  2542. { "type": "passthrough",
  2543. "data":
  2544. { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
  2545. "path": "/dev/tpm0"
  2546. }
  2547. },
  2548. "id": "tpm0"
  2549. }
  2550. ]
  2551. }
  2552. EQMP
  2553. {
  2554. .name = "query-tpm-models",
  2555. .args_type = "",
  2556. .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
  2557. },
  2558. SQMP
  2559. query-tpm-models
  2560. ----------------
  2561. Return a list of supported TPM models.
  2562. Arguments: None
  2563. Example:
  2564. -> { "execute": "query-tpm-models" }
  2565. <- { "return": [ "tpm-tis" ] }
  2566. EQMP
  2567. {
  2568. .name = "query-tpm-types",
  2569. .args_type = "",
  2570. .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
  2571. },
  2572. SQMP
  2573. query-tpm-types
  2574. ---------------
  2575. Return a list of supported TPM types.
  2576. Arguments: None
  2577. Example:
  2578. -> { "execute": "query-tpm-types" }
  2579. <- { "return": [ "passthrough" ] }
  2580. EQMP
  2581. {
  2582. .name = "chardev-add",
  2583. .args_type = "id:s,backend:q",
  2584. .mhandler.cmd_new = qmp_marshal_input_chardev_add,
  2585. },
  2586. SQMP
  2587. chardev-add
  2588. ----------------
  2589. Add a chardev.
  2590. Arguments:
  2591. - "id": the chardev's ID, must be unique (json-string)
  2592. - "backend": chardev backend type + parameters
  2593. Examples:
  2594. -> { "execute" : "chardev-add",
  2595. "arguments" : { "id" : "foo",
  2596. "backend" : { "type" : "null", "data" : {} } } }
  2597. <- { "return": {} }
  2598. -> { "execute" : "chardev-add",
  2599. "arguments" : { "id" : "bar",
  2600. "backend" : { "type" : "file",
  2601. "data" : { "out" : "/tmp/bar.log" } } } }
  2602. <- { "return": {} }
  2603. -> { "execute" : "chardev-add",
  2604. "arguments" : { "id" : "baz",
  2605. "backend" : { "type" : "pty", "data" : {} } } }
  2606. <- { "return": { "pty" : "/dev/pty/42" } }
  2607. EQMP
  2608. {
  2609. .name = "chardev-remove",
  2610. .args_type = "id:s",
  2611. .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
  2612. },
  2613. SQMP
  2614. chardev-remove
  2615. --------------
  2616. Remove a chardev.
  2617. Arguments:
  2618. - "id": the chardev's ID, must exist and not be in use (json-string)
  2619. Example:
  2620. -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
  2621. <- { "return": {} }
  2622. EQMP
  2623. {
  2624. .name = "query-rx-filter",
  2625. .args_type = "name:s?",
  2626. .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
  2627. },
  2628. SQMP
  2629. query-rx-filter
  2630. ---------------
  2631. Show rx-filter information.
  2632. Returns a json-array of rx-filter information for all NICs (or for the
  2633. given NIC), returning an error if the given NIC doesn't exist, or
  2634. given NIC doesn't support rx-filter querying, or given net client
  2635. isn't a NIC.
  2636. The query will clear the event notification flag of each NIC, then qemu
  2637. will start to emit event to QMP monitor.
  2638. Each array entry contains the following:
  2639. - "name": net client name (json-string)
  2640. - "promiscuous": promiscuous mode is enabled (json-bool)
  2641. - "multicast": multicast receive state (one of 'normal', 'none', 'all')
  2642. - "unicast": unicast receive state (one of 'normal', 'none', 'all')
  2643. - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
  2644. - "broadcast-allowed": allow to receive broadcast (json-bool)
  2645. - "multicast-overflow": multicast table is overflowed (json-bool)
  2646. - "unicast-overflow": unicast table is overflowed (json-bool)
  2647. - "main-mac": main macaddr string (json-string)
  2648. - "vlan-table": a json-array of active vlan id
  2649. - "unicast-table": a json-array of unicast macaddr string
  2650. - "multicast-table": a json-array of multicast macaddr string
  2651. Example:
  2652. -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
  2653. <- { "return": [
  2654. {
  2655. "promiscuous": true,
  2656. "name": "vnet0",
  2657. "main-mac": "52:54:00:12:34:56",
  2658. "unicast": "normal",
  2659. "vlan": "normal",
  2660. "vlan-table": [
  2661. 4,
  2662. 0
  2663. ],
  2664. "unicast-table": [
  2665. ],
  2666. "multicast": "normal",
  2667. "multicast-overflow": false,
  2668. "unicast-overflow": false,
  2669. "multicast-table": [
  2670. "01:00:5e:00:00:01",
  2671. "33:33:00:00:00:01",
  2672. "33:33:ff:12:34:56"
  2673. ],
  2674. "broadcast-allowed": false
  2675. }
  2676. ]
  2677. }
  2678. EQMP
  2679. {
  2680. .name = "blockdev-add",
  2681. .args_type = "options:q",
  2682. .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
  2683. },
  2684. SQMP
  2685. blockdev-add
  2686. ------------
  2687. Add a block device.
  2688. Arguments:
  2689. - "options": block driver options
  2690. Example (1):
  2691. -> { "execute": "blockdev-add",
  2692. "arguments": { "options" : { "driver": "qcow2",
  2693. "file": { "driver": "file",
  2694. "filename": "test.qcow2" } } } }
  2695. <- { "return": {} }
  2696. Example (2):
  2697. -> { "execute": "blockdev-add",
  2698. "arguments": {
  2699. "options": {
  2700. "driver": "qcow2",
  2701. "id": "my_disk",
  2702. "discard": "unmap",
  2703. "cache": {
  2704. "direct": true,
  2705. "writeback": true
  2706. },
  2707. "file": {
  2708. "driver": "file",
  2709. "filename": "/tmp/test.qcow2"
  2710. },
  2711. "backing": {
  2712. "driver": "raw",
  2713. "file": {
  2714. "driver": "file",
  2715. "filename": "/dev/fdset/4"
  2716. }
  2717. }
  2718. }
  2719. }
  2720. }
  2721. <- { "return": {} }
  2722. EQMP
  2723. {
  2724. .name = "query-named-block-nodes",
  2725. .args_type = "",
  2726. .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
  2727. },
  2728. SQMP
  2729. @query-named-block-nodes
  2730. ------------------------
  2731. Return a list of BlockDeviceInfo for all the named block driver nodes
  2732. Example:
  2733. -> { "execute": "query-named-block-nodes" }
  2734. <- { "return": [ { "ro":false,
  2735. "drv":"qcow2",
  2736. "encrypted":false,
  2737. "file":"disks/test.qcow2",
  2738. "node-name": "my-node",
  2739. "backing_file_depth":1,
  2740. "bps":1000000,
  2741. "bps_rd":0,
  2742. "bps_wr":0,
  2743. "iops":1000000,
  2744. "iops_rd":0,
  2745. "iops_wr":0,
  2746. "bps_max": 8000000,
  2747. "bps_rd_max": 0,
  2748. "bps_wr_max": 0,
  2749. "iops_max": 0,
  2750. "iops_rd_max": 0,
  2751. "iops_wr_max": 0,
  2752. "iops_size": 0,
  2753. "image":{
  2754. "filename":"disks/test.qcow2",
  2755. "format":"qcow2",
  2756. "virtual-size":2048000,
  2757. "backing_file":"base.qcow2",
  2758. "full-backing-filename":"disks/base.qcow2",
  2759. "backing-filename-format:"qcow2",
  2760. "snapshots":[
  2761. {
  2762. "id": "1",
  2763. "name": "snapshot1",
  2764. "vm-state-size": 0,
  2765. "date-sec": 10000200,
  2766. "date-nsec": 12,
  2767. "vm-clock-sec": 206,
  2768. "vm-clock-nsec": 30
  2769. }
  2770. ],
  2771. "backing-image":{
  2772. "filename":"disks/base.qcow2",
  2773. "format":"qcow2",
  2774. "virtual-size":2048000
  2775. }
  2776. } } ] }
  2777. EQMP