qmp-commands.hx 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777
  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 enum values)
  237. - hold-time: time to delay key up events, milliseconds. Defaults to 100
  238. (json-int, optional)
  239. Example:
  240. -> { "execute": "send-key",
  241. "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
  242. <- { "return": {} }
  243. EQMP
  244. {
  245. .name = "cpu",
  246. .args_type = "index:i",
  247. .mhandler.cmd_new = qmp_marshal_input_cpu,
  248. },
  249. SQMP
  250. cpu
  251. ---
  252. Set the default CPU.
  253. Arguments:
  254. - "index": the CPU's index (json-int)
  255. Example:
  256. -> { "execute": "cpu", "arguments": { "index": 0 } }
  257. <- { "return": {} }
  258. Note: CPUs' indexes are obtained with the 'query-cpus' command.
  259. EQMP
  260. {
  261. .name = "memsave",
  262. .args_type = "val:l,size:i,filename:s,cpu:i?",
  263. .mhandler.cmd_new = qmp_marshal_input_memsave,
  264. },
  265. SQMP
  266. memsave
  267. -------
  268. Save to disk virtual memory dump starting at 'val' of size 'size'.
  269. Arguments:
  270. - "val": the starting address (json-int)
  271. - "size": the memory size, in bytes (json-int)
  272. - "filename": file path (json-string)
  273. - "cpu": virtual CPU index (json-int, optional)
  274. Example:
  275. -> { "execute": "memsave",
  276. "arguments": { "val": 10,
  277. "size": 100,
  278. "filename": "/tmp/virtual-mem-dump" } }
  279. <- { "return": {} }
  280. EQMP
  281. {
  282. .name = "pmemsave",
  283. .args_type = "val:l,size:i,filename:s",
  284. .mhandler.cmd_new = qmp_marshal_input_pmemsave,
  285. },
  286. SQMP
  287. pmemsave
  288. --------
  289. Save to disk physical memory dump starting at 'val' of size 'size'.
  290. Arguments:
  291. - "val": the starting address (json-int)
  292. - "size": the memory size, in bytes (json-int)
  293. - "filename": file path (json-string)
  294. Example:
  295. -> { "execute": "pmemsave",
  296. "arguments": { "val": 10,
  297. "size": 100,
  298. "filename": "/tmp/physical-mem-dump" } }
  299. <- { "return": {} }
  300. EQMP
  301. {
  302. .name = "inject-nmi",
  303. .args_type = "",
  304. .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
  305. },
  306. SQMP
  307. inject-nmi
  308. ----------
  309. Inject an NMI on guest's CPUs.
  310. Arguments: None.
  311. Example:
  312. -> { "execute": "inject-nmi" }
  313. <- { "return": {} }
  314. Note: inject-nmi fails when the guest doesn't support injecting.
  315. Currently, only x86 guests do.
  316. EQMP
  317. {
  318. .name = "ringbuf-write",
  319. .args_type = "device:s,data:s,format:s?",
  320. .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
  321. },
  322. SQMP
  323. ringbuf-write
  324. -------------
  325. Write to a ring buffer character device.
  326. Arguments:
  327. - "device": ring buffer character device name (json-string)
  328. - "data": data to write (json-string)
  329. - "format": data format (json-string, optional)
  330. - Possible values: "utf8" (default), "base64"
  331. Bug: invalid base64 is currently not rejected.
  332. Whitespace *is* invalid.
  333. Example:
  334. -> { "execute": "ringbuf-write",
  335. "arguments": { "device": "foo",
  336. "data": "abcdefgh",
  337. "format": "utf8" } }
  338. <- { "return": {} }
  339. EQMP
  340. {
  341. .name = "ringbuf-read",
  342. .args_type = "device:s,size:i,format:s?",
  343. .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
  344. },
  345. SQMP
  346. ringbuf-read
  347. -------------
  348. Read from a ring buffer character device.
  349. Arguments:
  350. - "device": ring buffer character device name (json-string)
  351. - "size": how many bytes to read at most (json-int)
  352. - Number of data bytes, not number of characters in encoded data
  353. - "format": data format (json-string, optional)
  354. - Possible values: "utf8" (default), "base64"
  355. - Naturally, format "utf8" works only when the ring buffer
  356. contains valid UTF-8 text. Invalid UTF-8 sequences get
  357. replaced. Bug: replacement doesn't work. Bug: can screw
  358. up on encountering NUL characters, after the ring buffer
  359. lost data, and when reading stops because the size limit
  360. is reached.
  361. Example:
  362. -> { "execute": "ringbuf-read",
  363. "arguments": { "device": "foo",
  364. "size": 1000,
  365. "format": "utf8" } }
  366. <- {"return": "abcdefgh"}
  367. EQMP
  368. {
  369. .name = "xen-save-devices-state",
  370. .args_type = "filename:F",
  371. .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
  372. },
  373. SQMP
  374. xen-save-devices-state
  375. -------
  376. Save the state of all devices to file. The RAM and the block devices
  377. of the VM are not saved by this command.
  378. Arguments:
  379. - "filename": the file to save the state of the devices to as binary
  380. data. See xen-save-devices-state.txt for a description of the binary
  381. format.
  382. Example:
  383. -> { "execute": "xen-save-devices-state",
  384. "arguments": { "filename": "/tmp/save" } }
  385. <- { "return": {} }
  386. EQMP
  387. {
  388. .name = "xen-set-global-dirty-log",
  389. .args_type = "enable:b",
  390. .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
  391. },
  392. SQMP
  393. xen-set-global-dirty-log
  394. -------
  395. Enable or disable the global dirty log mode.
  396. Arguments:
  397. - "enable": Enable it or disable it.
  398. Example:
  399. -> { "execute": "xen-set-global-dirty-log",
  400. "arguments": { "enable": true } }
  401. <- { "return": {} }
  402. EQMP
  403. {
  404. .name = "migrate",
  405. .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
  406. .mhandler.cmd_new = qmp_marshal_input_migrate,
  407. },
  408. SQMP
  409. migrate
  410. -------
  411. Migrate to URI.
  412. Arguments:
  413. - "blk": block migration, full disk copy (json-bool, optional)
  414. - "inc": incremental disk copy (json-bool, optional)
  415. - "uri": Destination URI (json-string)
  416. Example:
  417. -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
  418. <- { "return": {} }
  419. Notes:
  420. (1) The 'query-migrate' command should be used to check migration's progress
  421. and final result (this information is provided by the 'status' member)
  422. (2) All boolean arguments default to false
  423. (3) The user Monitor's "detach" argument is invalid in QMP and should not
  424. be used
  425. EQMP
  426. {
  427. .name = "migrate_cancel",
  428. .args_type = "",
  429. .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
  430. },
  431. SQMP
  432. migrate_cancel
  433. --------------
  434. Cancel the current migration.
  435. Arguments: None.
  436. Example:
  437. -> { "execute": "migrate_cancel" }
  438. <- { "return": {} }
  439. EQMP
  440. {
  441. .name = "migrate-set-cache-size",
  442. .args_type = "value:o",
  443. .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
  444. },
  445. SQMP
  446. migrate-set-cache-size
  447. ---------------------
  448. Set cache size to be used by XBZRLE migration, the cache size will be rounded
  449. down to the nearest power of 2
  450. Arguments:
  451. - "value": cache size in bytes (json-int)
  452. Example:
  453. -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
  454. <- { "return": {} }
  455. EQMP
  456. {
  457. .name = "query-migrate-cache-size",
  458. .args_type = "",
  459. .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
  460. },
  461. SQMP
  462. query-migrate-cache-size
  463. ---------------------
  464. Show cache size to be used by XBZRLE migration
  465. returns a json-object with the following information:
  466. - "size" : json-int
  467. Example:
  468. -> { "execute": "query-migrate-cache-size" }
  469. <- { "return": 67108864 }
  470. EQMP
  471. {
  472. .name = "migrate_set_speed",
  473. .args_type = "value:o",
  474. .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
  475. },
  476. SQMP
  477. migrate_set_speed
  478. -----------------
  479. Set maximum speed for migrations.
  480. Arguments:
  481. - "value": maximum speed, in bytes per second (json-int)
  482. Example:
  483. -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
  484. <- { "return": {} }
  485. EQMP
  486. {
  487. .name = "migrate_set_downtime",
  488. .args_type = "value:T",
  489. .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
  490. },
  491. SQMP
  492. migrate_set_downtime
  493. --------------------
  494. Set maximum tolerated downtime (in seconds) for migrations.
  495. Arguments:
  496. - "value": maximum downtime (json-number)
  497. Example:
  498. -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
  499. <- { "return": {} }
  500. EQMP
  501. {
  502. .name = "client_migrate_info",
  503. .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
  504. .params = "protocol hostname port tls-port cert-subject",
  505. .help = "send migration info to spice/vnc client",
  506. .user_print = monitor_user_noop,
  507. .mhandler.cmd_async = client_migrate_info,
  508. .flags = MONITOR_CMD_ASYNC,
  509. },
  510. SQMP
  511. client_migrate_info
  512. ------------------
  513. Set the spice/vnc connection info for the migration target. The spice/vnc
  514. server will ask the spice/vnc client to automatically reconnect using the
  515. new parameters (if specified) once the vm migration finished successfully.
  516. Arguments:
  517. - "protocol": protocol: "spice" or "vnc" (json-string)
  518. - "hostname": migration target hostname (json-string)
  519. - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
  520. - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
  521. - "cert-subject": server certificate subject (json-string, optional)
  522. Example:
  523. -> { "execute": "client_migrate_info",
  524. "arguments": { "protocol": "spice",
  525. "hostname": "virt42.lab.kraxel.org",
  526. "port": 1234 } }
  527. <- { "return": {} }
  528. EQMP
  529. {
  530. .name = "dump-guest-memory",
  531. .args_type = "paging:b,protocol:s,begin:i?,end:i?",
  532. .params = "-p protocol [begin] [length]",
  533. .help = "dump guest memory to file",
  534. .user_print = monitor_user_noop,
  535. .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
  536. },
  537. SQMP
  538. dump
  539. Dump guest memory to file. The file can be processed with crash or gdb.
  540. Arguments:
  541. - "paging": do paging to get guest's memory mapping (json-bool)
  542. - "protocol": destination file(started with "file:") or destination file
  543. descriptor (started with "fd:") (json-string)
  544. - "begin": the starting physical address. It's optional, and should be specified
  545. with length together (json-int)
  546. - "length": the memory size, in bytes. It's optional, and should be specified
  547. with begin together (json-int)
  548. Example:
  549. -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
  550. <- { "return": {} }
  551. Notes:
  552. (1) All boolean arguments default to false
  553. EQMP
  554. {
  555. .name = "netdev_add",
  556. .args_type = "netdev:O",
  557. .mhandler.cmd_new = qmp_netdev_add,
  558. },
  559. SQMP
  560. netdev_add
  561. ----------
  562. Add host network device.
  563. Arguments:
  564. - "type": the device type, "tap", "user", ... (json-string)
  565. - "id": the device's ID, must be unique (json-string)
  566. - device options
  567. Example:
  568. -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
  569. <- { "return": {} }
  570. Note: The supported device options are the same ones supported by the '-netdev'
  571. command-line argument, which are listed in the '-help' output or QEMU's
  572. manual
  573. EQMP
  574. {
  575. .name = "netdev_del",
  576. .args_type = "id:s",
  577. .mhandler.cmd_new = qmp_marshal_input_netdev_del,
  578. },
  579. SQMP
  580. netdev_del
  581. ----------
  582. Remove host network device.
  583. Arguments:
  584. - "id": the device's ID, must be unique (json-string)
  585. Example:
  586. -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
  587. <- { "return": {} }
  588. EQMP
  589. {
  590. .name = "block_resize",
  591. .args_type = "device:B,size:o",
  592. .mhandler.cmd_new = qmp_marshal_input_block_resize,
  593. },
  594. SQMP
  595. block_resize
  596. ------------
  597. Resize a block image while a guest is running.
  598. Arguments:
  599. - "device": the device's ID, must be unique (json-string)
  600. - "size": new size
  601. Example:
  602. -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
  603. <- { "return": {} }
  604. EQMP
  605. {
  606. .name = "block-stream",
  607. .args_type = "device:B,base:s?,speed:o?,on-error:s?",
  608. .mhandler.cmd_new = qmp_marshal_input_block_stream,
  609. },
  610. {
  611. .name = "block-commit",
  612. .args_type = "device:B,base:s?,top:s,speed:o?",
  613. .mhandler.cmd_new = qmp_marshal_input_block_commit,
  614. },
  615. {
  616. .name = "block-job-set-speed",
  617. .args_type = "device:B,speed:o",
  618. .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
  619. },
  620. {
  621. .name = "block-job-cancel",
  622. .args_type = "device:B,force:b?",
  623. .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
  624. },
  625. {
  626. .name = "block-job-pause",
  627. .args_type = "device:B",
  628. .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
  629. },
  630. {
  631. .name = "block-job-resume",
  632. .args_type = "device:B",
  633. .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
  634. },
  635. {
  636. .name = "block-job-complete",
  637. .args_type = "device:B",
  638. .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
  639. },
  640. {
  641. .name = "transaction",
  642. .args_type = "actions:q",
  643. .mhandler.cmd_new = qmp_marshal_input_transaction,
  644. },
  645. SQMP
  646. transaction
  647. -----------
  648. Atomically operate on one or more block devices. The only supported
  649. operation for now is snapshotting. If there is any failure performing
  650. any of the operations, all snapshots for the group are abandoned, and
  651. the original disks pre-snapshot attempt are used.
  652. A list of dictionaries is accepted, that contains the actions to be performed.
  653. For snapshots this is the device, the file to use for the new snapshot,
  654. and the format. The default format, if not specified, is qcow2.
  655. Each new snapshot defaults to being created by QEMU (wiping any
  656. contents if the file already exists), but it is also possible to reuse
  657. an externally-created file. In the latter case, you should ensure that
  658. the new image file has the same contents as the current one; QEMU cannot
  659. perform any meaningful check. Typically this is achieved by using the
  660. current image file as the backing file for the new image.
  661. Arguments:
  662. actions array:
  663. - "type": the operation to perform. The only supported
  664. value is "blockdev-snapshot-sync". (json-string)
  665. - "data": a dictionary. The contents depend on the value
  666. of "type". When "type" is "blockdev-snapshot-sync":
  667. - "device": device name to snapshot (json-string)
  668. - "snapshot-file": name of new image file (json-string)
  669. - "format": format of new image (json-string, optional)
  670. - "mode": whether and how QEMU should create the snapshot file
  671. (NewImageMode, optional, default "absolute-paths")
  672. Example:
  673. -> { "execute": "transaction",
  674. "arguments": { "actions": [
  675. { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
  676. "snapshot-file": "/some/place/my-image",
  677. "format": "qcow2" } },
  678. { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
  679. "snapshot-file": "/some/place/my-image2",
  680. "mode": "existing",
  681. "format": "qcow2" } } ] } }
  682. <- { "return": {} }
  683. EQMP
  684. {
  685. .name = "blockdev-snapshot-sync",
  686. .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
  687. .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
  688. },
  689. SQMP
  690. blockdev-snapshot-sync
  691. ----------------------
  692. Synchronous snapshot of a block device. snapshot-file specifies the
  693. target of the new image. If the file exists, or if it is a device, the
  694. snapshot will be created in the existing file/device. If does not
  695. exist, a new file will be created. format specifies the format of the
  696. snapshot image, default is qcow2.
  697. Arguments:
  698. - "device": device name to snapshot (json-string)
  699. - "snapshot-file": name of new image file (json-string)
  700. - "mode": whether and how QEMU should create the snapshot file
  701. (NewImageMode, optional, default "absolute-paths")
  702. - "format": format of new image (json-string, optional)
  703. Example:
  704. -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
  705. "snapshot-file":
  706. "/some/place/my-image",
  707. "format": "qcow2" } }
  708. <- { "return": {} }
  709. EQMP
  710. {
  711. .name = "drive-mirror",
  712. .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
  713. "on-source-error:s?,on-target-error:s?,"
  714. "granularity:i?,buf-size:i?",
  715. .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
  716. },
  717. SQMP
  718. drive-mirror
  719. ------------
  720. Start mirroring a block device's writes to a new destination. target
  721. specifies the target of the new image. If the file exists, or if it is
  722. a device, it will be used as the new destination for writes. If it does not
  723. exist, a new file will be created. format specifies the format of the
  724. mirror image, default is to probe if mode='existing', else the format
  725. of the source.
  726. Arguments:
  727. - "device": device name to operate on (json-string)
  728. - "target": name of new image file (json-string)
  729. - "format": format of new image (json-string, optional)
  730. - "mode": how an image file should be created into the target
  731. file/device (NewImageMode, optional, default 'absolute-paths')
  732. - "speed": maximum speed of the streaming job, in bytes per second
  733. (json-int)
  734. - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
  735. - "buf_size": maximum amount of data in flight from source to target, in bytes
  736. (json-int, default 10M)
  737. - "sync": what parts of the disk image should be copied to the destination;
  738. possibilities include "full" for all the disk, "top" for only the sectors
  739. allocated in the topmost image, or "none" to only replicate new I/O
  740. (MirrorSyncMode).
  741. - "on-source-error": the action to take on an error on the source
  742. (BlockdevOnError, default 'report')
  743. - "on-target-error": the action to take on an error on the target
  744. (BlockdevOnError, default 'report')
  745. The default value of the granularity is the image cluster size clamped
  746. between 4096 and 65536, if the image format defines one. If the format
  747. does not define a cluster size, the default value of the granularity
  748. is 65536.
  749. Example:
  750. -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
  751. "target": "/some/place/my-image",
  752. "sync": "full",
  753. "format": "qcow2" } }
  754. <- { "return": {} }
  755. EQMP
  756. {
  757. .name = "balloon",
  758. .args_type = "value:M",
  759. .mhandler.cmd_new = qmp_marshal_input_balloon,
  760. },
  761. SQMP
  762. balloon
  763. -------
  764. Request VM to change its memory allocation (in bytes).
  765. Arguments:
  766. - "value": New memory allocation (json-int)
  767. Example:
  768. -> { "execute": "balloon", "arguments": { "value": 536870912 } }
  769. <- { "return": {} }
  770. EQMP
  771. {
  772. .name = "set_link",
  773. .args_type = "name:s,up:b",
  774. .mhandler.cmd_new = qmp_marshal_input_set_link,
  775. },
  776. SQMP
  777. set_link
  778. --------
  779. Change the link status of a network adapter.
  780. Arguments:
  781. - "name": network device name (json-string)
  782. - "up": status is up (json-bool)
  783. Example:
  784. -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
  785. <- { "return": {} }
  786. EQMP
  787. {
  788. .name = "getfd",
  789. .args_type = "fdname:s",
  790. .params = "getfd name",
  791. .help = "receive a file descriptor via SCM rights and assign it a name",
  792. .mhandler.cmd_new = qmp_marshal_input_getfd,
  793. },
  794. SQMP
  795. getfd
  796. -----
  797. Receive a file descriptor via SCM rights and assign it a name.
  798. Arguments:
  799. - "fdname": file descriptor name (json-string)
  800. Example:
  801. -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
  802. <- { "return": {} }
  803. Notes:
  804. (1) If the name specified by the "fdname" argument already exists,
  805. the file descriptor assigned to it will be closed and replaced
  806. by the received file descriptor.
  807. (2) The 'closefd' command can be used to explicitly close the file
  808. descriptor when it is no longer needed.
  809. EQMP
  810. {
  811. .name = "closefd",
  812. .args_type = "fdname:s",
  813. .params = "closefd name",
  814. .help = "close a file descriptor previously passed via SCM rights",
  815. .mhandler.cmd_new = qmp_marshal_input_closefd,
  816. },
  817. SQMP
  818. closefd
  819. -------
  820. Close a file descriptor previously passed via SCM rights.
  821. Arguments:
  822. - "fdname": file descriptor name (json-string)
  823. Example:
  824. -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
  825. <- { "return": {} }
  826. EQMP
  827. {
  828. .name = "add-fd",
  829. .args_type = "fdset-id:i?,opaque:s?",
  830. .params = "add-fd fdset-id opaque",
  831. .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
  832. .mhandler.cmd_new = qmp_marshal_input_add_fd,
  833. },
  834. SQMP
  835. add-fd
  836. -------
  837. Add a file descriptor, that was passed via SCM rights, to an fd set.
  838. Arguments:
  839. - "fdset-id": The ID of the fd set to add the file descriptor to.
  840. (json-int, optional)
  841. - "opaque": A free-form string that can be used to describe the fd.
  842. (json-string, optional)
  843. Return a json-object with the following information:
  844. - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
  845. - "fd": The file descriptor that was received via SCM rights and added to the
  846. fd set. (json-int)
  847. Example:
  848. -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
  849. <- { "return": { "fdset-id": 1, "fd": 3 } }
  850. Notes:
  851. (1) The list of fd sets is shared by all monitor connections.
  852. (2) If "fdset-id" is not specified, a new fd set will be created.
  853. EQMP
  854. {
  855. .name = "remove-fd",
  856. .args_type = "fdset-id:i,fd:i?",
  857. .params = "remove-fd fdset-id fd",
  858. .help = "Remove a file descriptor from an fd set",
  859. .mhandler.cmd_new = qmp_marshal_input_remove_fd,
  860. },
  861. SQMP
  862. remove-fd
  863. ---------
  864. Remove a file descriptor from an fd set.
  865. Arguments:
  866. - "fdset-id": The ID of the fd set that the file descriptor belongs to.
  867. (json-int)
  868. - "fd": The file descriptor that is to be removed. (json-int, optional)
  869. Example:
  870. -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
  871. <- { "return": {} }
  872. Notes:
  873. (1) The list of fd sets is shared by all monitor connections.
  874. (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
  875. removed.
  876. EQMP
  877. {
  878. .name = "query-fdsets",
  879. .args_type = "",
  880. .help = "Return information describing all fd sets",
  881. .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
  882. },
  883. SQMP
  884. query-fdsets
  885. -------------
  886. Return information describing all fd sets.
  887. Arguments: None
  888. Example:
  889. -> { "execute": "query-fdsets" }
  890. <- { "return": [
  891. {
  892. "fds": [
  893. {
  894. "fd": 30,
  895. "opaque": "rdonly:/path/to/file"
  896. },
  897. {
  898. "fd": 24,
  899. "opaque": "rdwr:/path/to/file"
  900. }
  901. ],
  902. "fdset-id": 1
  903. },
  904. {
  905. "fds": [
  906. {
  907. "fd": 28
  908. },
  909. {
  910. "fd": 29
  911. }
  912. ],
  913. "fdset-id": 0
  914. }
  915. ]
  916. }
  917. Note: The list of fd sets is shared by all monitor connections.
  918. EQMP
  919. {
  920. .name = "block_passwd",
  921. .args_type = "device:B,password:s",
  922. .mhandler.cmd_new = qmp_marshal_input_block_passwd,
  923. },
  924. SQMP
  925. block_passwd
  926. ------------
  927. Set the password of encrypted block devices.
  928. Arguments:
  929. - "device": device name (json-string)
  930. - "password": password (json-string)
  931. Example:
  932. -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
  933. "password": "12345" } }
  934. <- { "return": {} }
  935. EQMP
  936. {
  937. .name = "block_set_io_throttle",
  938. .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
  939. .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
  940. },
  941. SQMP
  942. block_set_io_throttle
  943. ------------
  944. Change I/O throttle limits for a block drive.
  945. Arguments:
  946. - "device": device name (json-string)
  947. - "bps": total throughput limit in bytes per second(json-int)
  948. - "bps_rd": read throughput limit in bytes per second(json-int)
  949. - "bps_wr": read throughput limit in bytes per second(json-int)
  950. - "iops": total I/O operations per second(json-int)
  951. - "iops_rd": read I/O operations per second(json-int)
  952. - "iops_wr": write I/O operations per second(json-int)
  953. Example:
  954. -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
  955. "bps": "1000000",
  956. "bps_rd": "0",
  957. "bps_wr": "0",
  958. "iops": "0",
  959. "iops_rd": "0",
  960. "iops_wr": "0" } }
  961. <- { "return": {} }
  962. EQMP
  963. {
  964. .name = "set_password",
  965. .args_type = "protocol:s,password:s,connected:s?",
  966. .mhandler.cmd_new = qmp_marshal_input_set_password,
  967. },
  968. SQMP
  969. set_password
  970. ------------
  971. Set the password for vnc/spice protocols.
  972. Arguments:
  973. - "protocol": protocol name (json-string)
  974. - "password": password (json-string)
  975. - "connected": [ keep | disconnect | fail ] (josn-string, optional)
  976. Example:
  977. -> { "execute": "set_password", "arguments": { "protocol": "vnc",
  978. "password": "secret" } }
  979. <- { "return": {} }
  980. EQMP
  981. {
  982. .name = "expire_password",
  983. .args_type = "protocol:s,time:s",
  984. .mhandler.cmd_new = qmp_marshal_input_expire_password,
  985. },
  986. SQMP
  987. expire_password
  988. ---------------
  989. Set the password expire time for vnc/spice protocols.
  990. Arguments:
  991. - "protocol": protocol name (json-string)
  992. - "time": [ now | never | +secs | secs ] (json-string)
  993. Example:
  994. -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
  995. "time": "+60" } }
  996. <- { "return": {} }
  997. EQMP
  998. {
  999. .name = "add_client",
  1000. .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
  1001. .mhandler.cmd_new = qmp_marshal_input_add_client,
  1002. },
  1003. SQMP
  1004. add_client
  1005. ----------
  1006. Add a graphics client
  1007. Arguments:
  1008. - "protocol": protocol name (json-string)
  1009. - "fdname": file descriptor name (json-string)
  1010. - "skipauth": whether to skip authentication (json-bool, optional)
  1011. - "tls": whether to perform TLS (json-bool, optional)
  1012. Example:
  1013. -> { "execute": "add_client", "arguments": { "protocol": "vnc",
  1014. "fdname": "myclient" } }
  1015. <- { "return": {} }
  1016. EQMP
  1017. {
  1018. .name = "qmp_capabilities",
  1019. .args_type = "",
  1020. .params = "",
  1021. .help = "enable QMP capabilities",
  1022. .user_print = monitor_user_noop,
  1023. .mhandler.cmd_new = do_qmp_capabilities,
  1024. },
  1025. SQMP
  1026. qmp_capabilities
  1027. ----------------
  1028. Enable QMP capabilities.
  1029. Arguments: None.
  1030. Example:
  1031. -> { "execute": "qmp_capabilities" }
  1032. <- { "return": {} }
  1033. Note: This command must be issued before issuing any other command.
  1034. EQMP
  1035. {
  1036. .name = "human-monitor-command",
  1037. .args_type = "command-line:s,cpu-index:i?",
  1038. .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
  1039. },
  1040. SQMP
  1041. human-monitor-command
  1042. ---------------------
  1043. Execute a Human Monitor command.
  1044. Arguments:
  1045. - command-line: the command name and its arguments, just like the
  1046. Human Monitor's shell (json-string)
  1047. - cpu-index: select the CPU number to be used by commands which access CPU
  1048. data, like 'info registers'. The Monitor selects CPU 0 if this
  1049. argument is not provided (json-int, optional)
  1050. Example:
  1051. -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
  1052. <- { "return": "kvm support: enabled\r\n" }
  1053. Notes:
  1054. (1) The Human Monitor is NOT an stable interface, this means that command
  1055. names, arguments and responses can change or be removed at ANY time.
  1056. Applications that rely on long term stability guarantees should NOT
  1057. use this command
  1058. (2) Limitations:
  1059. o This command is stateless, this means that commands that depend
  1060. on state information (such as getfd) might not work
  1061. o Commands that prompt the user for data (eg. 'cont' when the block
  1062. device is encrypted) don't currently work
  1063. 3. Query Commands
  1064. =================
  1065. HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
  1066. HXCOMM this! We will possibly move query commands definitions inside those
  1067. HXCOMM sections, just like regular commands.
  1068. EQMP
  1069. SQMP
  1070. query-version
  1071. -------------
  1072. Show QEMU version.
  1073. Return a json-object with the following information:
  1074. - "qemu": A json-object containing three integer values:
  1075. - "major": QEMU's major version (json-int)
  1076. - "minor": QEMU's minor version (json-int)
  1077. - "micro": QEMU's micro version (json-int)
  1078. - "package": package's version (json-string)
  1079. Example:
  1080. -> { "execute": "query-version" }
  1081. <- {
  1082. "return":{
  1083. "qemu":{
  1084. "major":0,
  1085. "minor":11,
  1086. "micro":5
  1087. },
  1088. "package":""
  1089. }
  1090. }
  1091. EQMP
  1092. {
  1093. .name = "query-version",
  1094. .args_type = "",
  1095. .mhandler.cmd_new = qmp_marshal_input_query_version,
  1096. },
  1097. SQMP
  1098. query-commands
  1099. --------------
  1100. List QMP available commands.
  1101. Each command is represented by a json-object, the returned value is a json-array
  1102. of all commands.
  1103. Each json-object contain:
  1104. - "name": command's name (json-string)
  1105. Example:
  1106. -> { "execute": "query-commands" }
  1107. <- {
  1108. "return":[
  1109. {
  1110. "name":"query-balloon"
  1111. },
  1112. {
  1113. "name":"system_powerdown"
  1114. }
  1115. ]
  1116. }
  1117. Note: This example has been shortened as the real response is too long.
  1118. EQMP
  1119. {
  1120. .name = "query-commands",
  1121. .args_type = "",
  1122. .mhandler.cmd_new = qmp_marshal_input_query_commands,
  1123. },
  1124. SQMP
  1125. query-events
  1126. --------------
  1127. List QMP available events.
  1128. Each event is represented by a json-object, the returned value is a json-array
  1129. of all events.
  1130. Each json-object contains:
  1131. - "name": event's name (json-string)
  1132. Example:
  1133. -> { "execute": "query-events" }
  1134. <- {
  1135. "return":[
  1136. {
  1137. "name":"SHUTDOWN"
  1138. },
  1139. {
  1140. "name":"RESET"
  1141. }
  1142. ]
  1143. }
  1144. Note: This example has been shortened as the real response is too long.
  1145. EQMP
  1146. {
  1147. .name = "query-events",
  1148. .args_type = "",
  1149. .mhandler.cmd_new = qmp_marshal_input_query_events,
  1150. },
  1151. SQMP
  1152. query-chardev
  1153. -------------
  1154. Each device is represented by a json-object. The returned value is a json-array
  1155. of all devices.
  1156. Each json-object contain the following:
  1157. - "label": device's label (json-string)
  1158. - "filename": device's file (json-string)
  1159. Example:
  1160. -> { "execute": "query-chardev" }
  1161. <- {
  1162. "return":[
  1163. {
  1164. "label":"monitor",
  1165. "filename":"stdio"
  1166. },
  1167. {
  1168. "label":"serial0",
  1169. "filename":"vc"
  1170. }
  1171. ]
  1172. }
  1173. EQMP
  1174. {
  1175. .name = "query-chardev",
  1176. .args_type = "",
  1177. .mhandler.cmd_new = qmp_marshal_input_query_chardev,
  1178. },
  1179. SQMP
  1180. query-block
  1181. -----------
  1182. Show the block devices.
  1183. Each block device information is stored in a json-object and the returned value
  1184. is a json-array of all devices.
  1185. Each json-object contain the following:
  1186. - "device": device name (json-string)
  1187. - "type": device type (json-string)
  1188. - deprecated, retained for backward compatibility
  1189. - Possible values: "unknown"
  1190. - "removable": true if the device is removable, false otherwise (json-bool)
  1191. - "locked": true if the device is locked, false otherwise (json-bool)
  1192. - "tray_open": only present if removable, true if the device has a tray,
  1193. and it is open (json-bool)
  1194. - "inserted": only present if the device is inserted, it is a json-object
  1195. containing the following:
  1196. - "file": device file name (json-string)
  1197. - "ro": true if read-only, false otherwise (json-bool)
  1198. - "drv": driver format name (json-string)
  1199. - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
  1200. "file", "file", "ftp", "ftps", "host_cdrom",
  1201. "host_device", "host_floppy", "http", "https",
  1202. "nbd", "parallels", "qcow", "qcow2", "raw",
  1203. "tftp", "vdi", "vmdk", "vpc", "vvfat"
  1204. - "backing_file": backing file name (json-string, optional)
  1205. - "backing_file_depth": number of files in the backing file chain (json-int)
  1206. - "encrypted": true if encrypted, false otherwise (json-bool)
  1207. - "bps": limit total bytes per second (json-int)
  1208. - "bps_rd": limit read bytes per second (json-int)
  1209. - "bps_wr": limit write bytes per second (json-int)
  1210. - "iops": limit total I/O operations per second (json-int)
  1211. - "iops_rd": limit read operations per second (json-int)
  1212. - "iops_wr": limit write operations per second (json-int)
  1213. - "io-status": I/O operation status, only present if the device supports it
  1214. and the VM is configured to stop on errors. It's always reset
  1215. to "ok" when the "cont" command is issued (json_string, optional)
  1216. - Possible values: "ok", "failed", "nospace"
  1217. Example:
  1218. -> { "execute": "query-block" }
  1219. <- {
  1220. "return":[
  1221. {
  1222. "io-status": "ok",
  1223. "device":"ide0-hd0",
  1224. "locked":false,
  1225. "removable":false,
  1226. "inserted":{
  1227. "ro":false,
  1228. "drv":"qcow2",
  1229. "encrypted":false,
  1230. "file":"disks/test.img",
  1231. "backing_file_depth":0,
  1232. "bps":1000000,
  1233. "bps_rd":0,
  1234. "bps_wr":0,
  1235. "iops":1000000,
  1236. "iops_rd":0,
  1237. "iops_wr":0,
  1238. },
  1239. "type":"unknown"
  1240. },
  1241. {
  1242. "io-status": "ok",
  1243. "device":"ide1-cd0",
  1244. "locked":false,
  1245. "removable":true,
  1246. "type":"unknown"
  1247. },
  1248. {
  1249. "device":"floppy0",
  1250. "locked":false,
  1251. "removable":true,
  1252. "type":"unknown"
  1253. },
  1254. {
  1255. "device":"sd0",
  1256. "locked":false,
  1257. "removable":true,
  1258. "type":"unknown"
  1259. }
  1260. ]
  1261. }
  1262. EQMP
  1263. {
  1264. .name = "query-block",
  1265. .args_type = "",
  1266. .mhandler.cmd_new = qmp_marshal_input_query_block,
  1267. },
  1268. SQMP
  1269. query-blockstats
  1270. ----------------
  1271. Show block device statistics.
  1272. Each device statistic information is stored in a json-object and the returned
  1273. value is a json-array of all devices.
  1274. Each json-object contain the following:
  1275. - "device": device name (json-string)
  1276. - "stats": A json-object with the statistics information, it contains:
  1277. - "rd_bytes": bytes read (json-int)
  1278. - "wr_bytes": bytes written (json-int)
  1279. - "rd_operations": read operations (json-int)
  1280. - "wr_operations": write operations (json-int)
  1281. - "flush_operations": cache flush operations (json-int)
  1282. - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
  1283. - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
  1284. - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
  1285. - "wr_highest_offset": Highest offset of a sector written since the
  1286. BlockDriverState has been opened (json-int)
  1287. - "parent": Contains recursively the statistics of the underlying
  1288. protocol (e.g. the host file for a qcow2 image). If there is
  1289. no underlying protocol, this field is omitted
  1290. (json-object, optional)
  1291. Example:
  1292. -> { "execute": "query-blockstats" }
  1293. <- {
  1294. "return":[
  1295. {
  1296. "device":"ide0-hd0",
  1297. "parent":{
  1298. "stats":{
  1299. "wr_highest_offset":3686448128,
  1300. "wr_bytes":9786368,
  1301. "wr_operations":751,
  1302. "rd_bytes":122567168,
  1303. "rd_operations":36772
  1304. "wr_total_times_ns":313253456
  1305. "rd_total_times_ns":3465673657
  1306. "flush_total_times_ns":49653
  1307. "flush_operations":61,
  1308. }
  1309. },
  1310. "stats":{
  1311. "wr_highest_offset":2821110784,
  1312. "wr_bytes":9786368,
  1313. "wr_operations":692,
  1314. "rd_bytes":122739200,
  1315. "rd_operations":36604
  1316. "flush_operations":51,
  1317. "wr_total_times_ns":313253456
  1318. "rd_total_times_ns":3465673657
  1319. "flush_total_times_ns":49653
  1320. }
  1321. },
  1322. {
  1323. "device":"ide1-cd0",
  1324. "stats":{
  1325. "wr_highest_offset":0,
  1326. "wr_bytes":0,
  1327. "wr_operations":0,
  1328. "rd_bytes":0,
  1329. "rd_operations":0
  1330. "flush_operations":0,
  1331. "wr_total_times_ns":0
  1332. "rd_total_times_ns":0
  1333. "flush_total_times_ns":0
  1334. }
  1335. },
  1336. {
  1337. "device":"floppy0",
  1338. "stats":{
  1339. "wr_highest_offset":0,
  1340. "wr_bytes":0,
  1341. "wr_operations":0,
  1342. "rd_bytes":0,
  1343. "rd_operations":0
  1344. "flush_operations":0,
  1345. "wr_total_times_ns":0
  1346. "rd_total_times_ns":0
  1347. "flush_total_times_ns":0
  1348. }
  1349. },
  1350. {
  1351. "device":"sd0",
  1352. "stats":{
  1353. "wr_highest_offset":0,
  1354. "wr_bytes":0,
  1355. "wr_operations":0,
  1356. "rd_bytes":0,
  1357. "rd_operations":0
  1358. "flush_operations":0,
  1359. "wr_total_times_ns":0
  1360. "rd_total_times_ns":0
  1361. "flush_total_times_ns":0
  1362. }
  1363. }
  1364. ]
  1365. }
  1366. EQMP
  1367. {
  1368. .name = "query-blockstats",
  1369. .args_type = "",
  1370. .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
  1371. },
  1372. SQMP
  1373. query-cpus
  1374. ----------
  1375. Show CPU information.
  1376. Return a json-array. Each CPU is represented by a json-object, which contains:
  1377. - "CPU": CPU index (json-int)
  1378. - "current": true if this is the current CPU, false otherwise (json-bool)
  1379. - "halted": true if the cpu is halted, false otherwise (json-bool)
  1380. - Current program counter. The key's name depends on the architecture:
  1381. "pc": i386/x86_64 (json-int)
  1382. "nip": PPC (json-int)
  1383. "pc" and "npc": sparc (json-int)
  1384. "PC": mips (json-int)
  1385. - "thread_id": ID of the underlying host thread (json-int)
  1386. Example:
  1387. -> { "execute": "query-cpus" }
  1388. <- {
  1389. "return":[
  1390. {
  1391. "CPU":0,
  1392. "current":true,
  1393. "halted":false,
  1394. "pc":3227107138
  1395. "thread_id":3134
  1396. },
  1397. {
  1398. "CPU":1,
  1399. "current":false,
  1400. "halted":true,
  1401. "pc":7108165
  1402. "thread_id":3135
  1403. }
  1404. ]
  1405. }
  1406. EQMP
  1407. {
  1408. .name = "query-cpus",
  1409. .args_type = "",
  1410. .mhandler.cmd_new = qmp_marshal_input_query_cpus,
  1411. },
  1412. SQMP
  1413. query-pci
  1414. ---------
  1415. PCI buses and devices information.
  1416. The returned value is a json-array of all buses. Each bus is represented by
  1417. a json-object, which has a key with a json-array of all PCI devices attached
  1418. to it. Each device is represented by a json-object.
  1419. The bus json-object contains the following:
  1420. - "bus": bus number (json-int)
  1421. - "devices": a json-array of json-objects, each json-object represents a
  1422. PCI device
  1423. The PCI device json-object contains the following:
  1424. - "bus": identical to the parent's bus number (json-int)
  1425. - "slot": slot number (json-int)
  1426. - "function": function number (json-int)
  1427. - "class_info": a json-object containing:
  1428. - "desc": device class description (json-string, optional)
  1429. - "class": device class number (json-int)
  1430. - "id": a json-object containing:
  1431. - "device": device ID (json-int)
  1432. - "vendor": vendor ID (json-int)
  1433. - "irq": device's IRQ if assigned (json-int, optional)
  1434. - "qdev_id": qdev id string (json-string)
  1435. - "pci_bridge": It's a json-object, only present if this device is a
  1436. PCI bridge, contains:
  1437. - "bus": bus number (json-int)
  1438. - "secondary": secondary bus number (json-int)
  1439. - "subordinate": subordinate bus number (json-int)
  1440. - "io_range": I/O memory range information, a json-object with the
  1441. following members:
  1442. - "base": base address, in bytes (json-int)
  1443. - "limit": limit address, in bytes (json-int)
  1444. - "memory_range": memory range information, a json-object with the
  1445. following members:
  1446. - "base": base address, in bytes (json-int)
  1447. - "limit": limit address, in bytes (json-int)
  1448. - "prefetchable_range": Prefetchable memory range information, a
  1449. json-object with the following members:
  1450. - "base": base address, in bytes (json-int)
  1451. - "limit": limit address, in bytes (json-int)
  1452. - "devices": a json-array of PCI devices if there's any attached, each
  1453. each element is represented by a json-object, which contains
  1454. the same members of the 'PCI device json-object' described
  1455. above (optional)
  1456. - "regions": a json-array of json-objects, each json-object represents a
  1457. memory region of this device
  1458. The memory range json-object contains the following:
  1459. - "base": base memory address (json-int)
  1460. - "limit": limit value (json-int)
  1461. The region json-object can be an I/O region or a memory region, an I/O region
  1462. json-object contains the following:
  1463. - "type": "io" (json-string, fixed)
  1464. - "bar": BAR number (json-int)
  1465. - "address": memory address (json-int)
  1466. - "size": memory size (json-int)
  1467. A memory region json-object contains the following:
  1468. - "type": "memory" (json-string, fixed)
  1469. - "bar": BAR number (json-int)
  1470. - "address": memory address (json-int)
  1471. - "size": memory size (json-int)
  1472. - "mem_type_64": true or false (json-bool)
  1473. - "prefetch": true or false (json-bool)
  1474. Example:
  1475. -> { "execute": "query-pci" }
  1476. <- {
  1477. "return":[
  1478. {
  1479. "bus":0,
  1480. "devices":[
  1481. {
  1482. "bus":0,
  1483. "qdev_id":"",
  1484. "slot":0,
  1485. "class_info":{
  1486. "class":1536,
  1487. "desc":"Host bridge"
  1488. },
  1489. "id":{
  1490. "device":32902,
  1491. "vendor":4663
  1492. },
  1493. "function":0,
  1494. "regions":[
  1495. ]
  1496. },
  1497. {
  1498. "bus":0,
  1499. "qdev_id":"",
  1500. "slot":1,
  1501. "class_info":{
  1502. "class":1537,
  1503. "desc":"ISA bridge"
  1504. },
  1505. "id":{
  1506. "device":32902,
  1507. "vendor":28672
  1508. },
  1509. "function":0,
  1510. "regions":[
  1511. ]
  1512. },
  1513. {
  1514. "bus":0,
  1515. "qdev_id":"",
  1516. "slot":1,
  1517. "class_info":{
  1518. "class":257,
  1519. "desc":"IDE controller"
  1520. },
  1521. "id":{
  1522. "device":32902,
  1523. "vendor":28688
  1524. },
  1525. "function":1,
  1526. "regions":[
  1527. {
  1528. "bar":4,
  1529. "size":16,
  1530. "address":49152,
  1531. "type":"io"
  1532. }
  1533. ]
  1534. },
  1535. {
  1536. "bus":0,
  1537. "qdev_id":"",
  1538. "slot":2,
  1539. "class_info":{
  1540. "class":768,
  1541. "desc":"VGA controller"
  1542. },
  1543. "id":{
  1544. "device":4115,
  1545. "vendor":184
  1546. },
  1547. "function":0,
  1548. "regions":[
  1549. {
  1550. "prefetch":true,
  1551. "mem_type_64":false,
  1552. "bar":0,
  1553. "size":33554432,
  1554. "address":4026531840,
  1555. "type":"memory"
  1556. },
  1557. {
  1558. "prefetch":false,
  1559. "mem_type_64":false,
  1560. "bar":1,
  1561. "size":4096,
  1562. "address":4060086272,
  1563. "type":"memory"
  1564. },
  1565. {
  1566. "prefetch":false,
  1567. "mem_type_64":false,
  1568. "bar":6,
  1569. "size":65536,
  1570. "address":-1,
  1571. "type":"memory"
  1572. }
  1573. ]
  1574. },
  1575. {
  1576. "bus":0,
  1577. "qdev_id":"",
  1578. "irq":11,
  1579. "slot":4,
  1580. "class_info":{
  1581. "class":1280,
  1582. "desc":"RAM controller"
  1583. },
  1584. "id":{
  1585. "device":6900,
  1586. "vendor":4098
  1587. },
  1588. "function":0,
  1589. "regions":[
  1590. {
  1591. "bar":0,
  1592. "size":32,
  1593. "address":49280,
  1594. "type":"io"
  1595. }
  1596. ]
  1597. }
  1598. ]
  1599. }
  1600. ]
  1601. }
  1602. Note: This example has been shortened as the real response is too long.
  1603. EQMP
  1604. {
  1605. .name = "query-pci",
  1606. .args_type = "",
  1607. .mhandler.cmd_new = qmp_marshal_input_query_pci,
  1608. },
  1609. SQMP
  1610. query-kvm
  1611. ---------
  1612. Show KVM information.
  1613. Return a json-object with the following information:
  1614. - "enabled": true if KVM support is enabled, false otherwise (json-bool)
  1615. - "present": true if QEMU has KVM support, false otherwise (json-bool)
  1616. Example:
  1617. -> { "execute": "query-kvm" }
  1618. <- { "return": { "enabled": true, "present": true } }
  1619. EQMP
  1620. {
  1621. .name = "query-kvm",
  1622. .args_type = "",
  1623. .mhandler.cmd_new = qmp_marshal_input_query_kvm,
  1624. },
  1625. SQMP
  1626. query-status
  1627. ------------
  1628. Return a json-object with the following information:
  1629. - "running": true if the VM is running, or false if it is paused (json-bool)
  1630. - "singlestep": true if the VM is in single step mode,
  1631. false otherwise (json-bool)
  1632. - "status": one of the following values (json-string)
  1633. "debug" - QEMU is running on a debugger
  1634. "inmigrate" - guest is paused waiting for an incoming migration
  1635. "internal-error" - An internal error that prevents further guest
  1636. execution has occurred
  1637. "io-error" - the last IOP has failed and the device is configured
  1638. to pause on I/O errors
  1639. "paused" - guest has been paused via the 'stop' command
  1640. "postmigrate" - guest is paused following a successful 'migrate'
  1641. "prelaunch" - QEMU was started with -S and guest has not started
  1642. "finish-migrate" - guest is paused to finish the migration process
  1643. "restore-vm" - guest is paused to restore VM state
  1644. "running" - guest is actively running
  1645. "save-vm" - guest is paused to save the VM state
  1646. "shutdown" - guest is shut down (and -no-shutdown is in use)
  1647. "watchdog" - the watchdog action is configured to pause and
  1648. has been triggered
  1649. Example:
  1650. -> { "execute": "query-status" }
  1651. <- { "return": { "running": true, "singlestep": false, "status": "running" } }
  1652. EQMP
  1653. {
  1654. .name = "query-status",
  1655. .args_type = "",
  1656. .mhandler.cmd_new = qmp_marshal_input_query_status,
  1657. },
  1658. SQMP
  1659. query-mice
  1660. ----------
  1661. Show VM mice information.
  1662. Each mouse is represented by a json-object, the returned value is a json-array
  1663. of all mice.
  1664. The mouse json-object contains the following:
  1665. - "name": mouse's name (json-string)
  1666. - "index": mouse's index (json-int)
  1667. - "current": true if this mouse is receiving events, false otherwise (json-bool)
  1668. - "absolute": true if the mouse generates absolute input events (json-bool)
  1669. Example:
  1670. -> { "execute": "query-mice" }
  1671. <- {
  1672. "return":[
  1673. {
  1674. "name":"QEMU Microsoft Mouse",
  1675. "index":0,
  1676. "current":false,
  1677. "absolute":false
  1678. },
  1679. {
  1680. "name":"QEMU PS/2 Mouse",
  1681. "index":1,
  1682. "current":true,
  1683. "absolute":true
  1684. }
  1685. ]
  1686. }
  1687. EQMP
  1688. {
  1689. .name = "query-mice",
  1690. .args_type = "",
  1691. .mhandler.cmd_new = qmp_marshal_input_query_mice,
  1692. },
  1693. SQMP
  1694. query-vnc
  1695. ---------
  1696. Show VNC server information.
  1697. Return a json-object with server information. Connected clients are returned
  1698. as a json-array of json-objects.
  1699. The main json-object contains the following:
  1700. - "enabled": true or false (json-bool)
  1701. - "host": server's IP address (json-string)
  1702. - "family": address family (json-string)
  1703. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  1704. - "service": server's port number (json-string)
  1705. - "auth": authentication method (json-string)
  1706. - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
  1707. "tls", "ultra", "unknown", "vencrypt", "vencrypt",
  1708. "vencrypt+plain", "vencrypt+tls+none",
  1709. "vencrypt+tls+plain", "vencrypt+tls+sasl",
  1710. "vencrypt+tls+vnc", "vencrypt+x509+none",
  1711. "vencrypt+x509+plain", "vencrypt+x509+sasl",
  1712. "vencrypt+x509+vnc", "vnc"
  1713. - "clients": a json-array of all connected clients
  1714. Clients are described by a json-object, each one contain the following:
  1715. - "host": client's IP address (json-string)
  1716. - "family": address family (json-string)
  1717. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  1718. - "service": client's port number (json-string)
  1719. - "x509_dname": TLS dname (json-string, optional)
  1720. - "sasl_username": SASL username (json-string, optional)
  1721. Example:
  1722. -> { "execute": "query-vnc" }
  1723. <- {
  1724. "return":{
  1725. "enabled":true,
  1726. "host":"0.0.0.0",
  1727. "service":"50402",
  1728. "auth":"vnc",
  1729. "family":"ipv4",
  1730. "clients":[
  1731. {
  1732. "host":"127.0.0.1",
  1733. "service":"50401",
  1734. "family":"ipv4"
  1735. }
  1736. ]
  1737. }
  1738. }
  1739. EQMP
  1740. {
  1741. .name = "query-vnc",
  1742. .args_type = "",
  1743. .mhandler.cmd_new = qmp_marshal_input_query_vnc,
  1744. },
  1745. SQMP
  1746. query-spice
  1747. -----------
  1748. Show SPICE server information.
  1749. Return a json-object with server information. Connected clients are returned
  1750. as a json-array of json-objects.
  1751. The main json-object contains the following:
  1752. - "enabled": true or false (json-bool)
  1753. - "host": server's IP address (json-string)
  1754. - "port": server's port number (json-int, optional)
  1755. - "tls-port": server's port number (json-int, optional)
  1756. - "auth": authentication method (json-string)
  1757. - Possible values: "none", "spice"
  1758. - "channels": a json-array of all active channels clients
  1759. Channels are described by a json-object, each one contain the following:
  1760. - "host": client's IP address (json-string)
  1761. - "family": address family (json-string)
  1762. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  1763. - "port": client's port number (json-string)
  1764. - "connection-id": spice connection id. All channels with the same id
  1765. belong to the same spice session (json-int)
  1766. - "channel-type": channel type. "1" is the main control channel, filter for
  1767. this one if you want track spice sessions only (json-int)
  1768. - "channel-id": channel id. Usually "0", might be different needed when
  1769. multiple channels of the same type exist, such as multiple
  1770. display channels in a multihead setup (json-int)
  1771. - "tls": whevener the channel is encrypted (json-bool)
  1772. Example:
  1773. -> { "execute": "query-spice" }
  1774. <- {
  1775. "return": {
  1776. "enabled": true,
  1777. "auth": "spice",
  1778. "port": 5920,
  1779. "tls-port": 5921,
  1780. "host": "0.0.0.0",
  1781. "channels": [
  1782. {
  1783. "port": "54924",
  1784. "family": "ipv4",
  1785. "channel-type": 1,
  1786. "connection-id": 1804289383,
  1787. "host": "127.0.0.1",
  1788. "channel-id": 0,
  1789. "tls": true
  1790. },
  1791. {
  1792. "port": "36710",
  1793. "family": "ipv4",
  1794. "channel-type": 4,
  1795. "connection-id": 1804289383,
  1796. "host": "127.0.0.1",
  1797. "channel-id": 0,
  1798. "tls": false
  1799. },
  1800. [ ... more channels follow ... ]
  1801. ]
  1802. }
  1803. }
  1804. EQMP
  1805. #if defined(CONFIG_SPICE)
  1806. {
  1807. .name = "query-spice",
  1808. .args_type = "",
  1809. .mhandler.cmd_new = qmp_marshal_input_query_spice,
  1810. },
  1811. #endif
  1812. SQMP
  1813. query-name
  1814. ----------
  1815. Show VM name.
  1816. Return a json-object with the following information:
  1817. - "name": VM's name (json-string, optional)
  1818. Example:
  1819. -> { "execute": "query-name" }
  1820. <- { "return": { "name": "qemu-name" } }
  1821. EQMP
  1822. {
  1823. .name = "query-name",
  1824. .args_type = "",
  1825. .mhandler.cmd_new = qmp_marshal_input_query_name,
  1826. },
  1827. SQMP
  1828. query-uuid
  1829. ----------
  1830. Show VM UUID.
  1831. Return a json-object with the following information:
  1832. - "UUID": Universally Unique Identifier (json-string)
  1833. Example:
  1834. -> { "execute": "query-uuid" }
  1835. <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
  1836. EQMP
  1837. {
  1838. .name = "query-uuid",
  1839. .args_type = "",
  1840. .mhandler.cmd_new = qmp_marshal_input_query_uuid,
  1841. },
  1842. SQMP
  1843. query-migrate
  1844. -------------
  1845. Migration status.
  1846. Return a json-object. If migration is active there will be another json-object
  1847. with RAM migration status and if block migration is active another one with
  1848. block migration status.
  1849. The main json-object contains the following:
  1850. - "status": migration status (json-string)
  1851. - Possible values: "active", "completed", "failed", "cancelled"
  1852. - "total-time": total amount of ms since migration started. If
  1853. migration has ended, it returns the total migration
  1854. time (json-int)
  1855. - "downtime": only present when migration has finished correctly
  1856. total amount in ms for downtime that happened (json-int)
  1857. - "expected-downtime": only present while migration is active
  1858. total amount in ms for downtime that was calculated on
  1859. the last bitmap round (json-int)
  1860. - "ram": only present if "status" is "active", it is a json-object with the
  1861. following RAM information (in bytes):
  1862. - "transferred": amount transferred (json-int)
  1863. - "remaining": amount remaining (json-int)
  1864. - "total": total (json-int)
  1865. - "duplicate": number of duplicated pages (json-int)
  1866. - "normal" : number of normal pages transferred (json-int)
  1867. - "normal-bytes" : number of normal bytes transferred (json-int)
  1868. - "disk": only present if "status" is "active" and it is a block migration,
  1869. it is a json-object with the following disk information (in bytes):
  1870. - "transferred": amount transferred (json-int)
  1871. - "remaining": amount remaining (json-int)
  1872. - "total": total (json-int)
  1873. - "xbzrle-cache": only present if XBZRLE is active.
  1874. It is a json-object with the following XBZRLE information:
  1875. - "cache-size": XBZRLE cache size
  1876. - "bytes": total XBZRLE bytes transferred
  1877. - "pages": number of XBZRLE compressed pages
  1878. - "cache-miss": number of cache misses
  1879. - "overflow": number of XBZRLE overflows
  1880. Examples:
  1881. 1. Before the first migration
  1882. -> { "execute": "query-migrate" }
  1883. <- { "return": {} }
  1884. 2. Migration is done and has succeeded
  1885. -> { "execute": "query-migrate" }
  1886. <- { "return": {
  1887. "status": "completed",
  1888. "ram":{
  1889. "transferred":123,
  1890. "remaining":123,
  1891. "total":246,
  1892. "total-time":12345,
  1893. "downtime":12345,
  1894. "duplicate":123,
  1895. "normal":123,
  1896. "normal-bytes":123456
  1897. }
  1898. }
  1899. }
  1900. 3. Migration is done and has failed
  1901. -> { "execute": "query-migrate" }
  1902. <- { "return": { "status": "failed" } }
  1903. 4. Migration is being performed and is not a block migration:
  1904. -> { "execute": "query-migrate" }
  1905. <- {
  1906. "return":{
  1907. "status":"active",
  1908. "ram":{
  1909. "transferred":123,
  1910. "remaining":123,
  1911. "total":246,
  1912. "total-time":12345,
  1913. "expected-downtime":12345,
  1914. "duplicate":123,
  1915. "normal":123,
  1916. "normal-bytes":123456
  1917. }
  1918. }
  1919. }
  1920. 5. Migration is being performed and is a block migration:
  1921. -> { "execute": "query-migrate" }
  1922. <- {
  1923. "return":{
  1924. "status":"active",
  1925. "ram":{
  1926. "total":1057024,
  1927. "remaining":1053304,
  1928. "transferred":3720,
  1929. "total-time":12345,
  1930. "expected-downtime":12345,
  1931. "duplicate":123,
  1932. "normal":123,
  1933. "normal-bytes":123456
  1934. },
  1935. "disk":{
  1936. "total":20971520,
  1937. "remaining":20880384,
  1938. "transferred":91136
  1939. }
  1940. }
  1941. }
  1942. 6. Migration is being performed and XBZRLE is active:
  1943. -> { "execute": "query-migrate" }
  1944. <- {
  1945. "return":{
  1946. "status":"active",
  1947. "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
  1948. "ram":{
  1949. "total":1057024,
  1950. "remaining":1053304,
  1951. "transferred":3720,
  1952. "total-time":12345,
  1953. "expected-downtime":12345,
  1954. "duplicate":10,
  1955. "normal":3333,
  1956. "normal-bytes":3412992
  1957. },
  1958. "xbzrle-cache":{
  1959. "cache-size":67108864,
  1960. "bytes":20971520,
  1961. "pages":2444343,
  1962. "cache-miss":2244,
  1963. "overflow":34434
  1964. }
  1965. }
  1966. }
  1967. EQMP
  1968. {
  1969. .name = "query-migrate",
  1970. .args_type = "",
  1971. .mhandler.cmd_new = qmp_marshal_input_query_migrate,
  1972. },
  1973. SQMP
  1974. migrate-set-capabilities
  1975. -------
  1976. Enable/Disable migration capabilities
  1977. - "xbzrle": xbzrle support
  1978. Arguments:
  1979. Example:
  1980. -> { "execute": "migrate-set-capabilities" , "arguments":
  1981. { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
  1982. EQMP
  1983. {
  1984. .name = "migrate-set-capabilities",
  1985. .args_type = "capabilities:O",
  1986. .params = "capability:s,state:b",
  1987. .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
  1988. },
  1989. SQMP
  1990. query-migrate-capabilities
  1991. -------
  1992. Query current migration capabilities
  1993. - "capabilities": migration capabilities state
  1994. - "xbzrle" : XBZRLE state (json-bool)
  1995. Arguments:
  1996. Example:
  1997. -> { "execute": "query-migrate-capabilities" }
  1998. <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
  1999. EQMP
  2000. {
  2001. .name = "query-migrate-capabilities",
  2002. .args_type = "",
  2003. .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
  2004. },
  2005. SQMP
  2006. query-balloon
  2007. -------------
  2008. Show balloon information.
  2009. Make an asynchronous request for balloon info. When the request completes a
  2010. json-object will be returned containing the following data:
  2011. - "actual": current balloon value in bytes (json-int)
  2012. Example:
  2013. -> { "execute": "query-balloon" }
  2014. <- {
  2015. "return":{
  2016. "actual":1073741824,
  2017. }
  2018. }
  2019. EQMP
  2020. {
  2021. .name = "query-balloon",
  2022. .args_type = "",
  2023. .mhandler.cmd_new = qmp_marshal_input_query_balloon,
  2024. },
  2025. {
  2026. .name = "query-block-jobs",
  2027. .args_type = "",
  2028. .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
  2029. },
  2030. {
  2031. .name = "qom-list",
  2032. .args_type = "path:s",
  2033. .mhandler.cmd_new = qmp_marshal_input_qom_list,
  2034. },
  2035. {
  2036. .name = "qom-set",
  2037. .args_type = "path:s,property:s,value:q",
  2038. .mhandler.cmd_new = qmp_qom_set,
  2039. },
  2040. {
  2041. .name = "qom-get",
  2042. .args_type = "path:s,property:s",
  2043. .mhandler.cmd_new = qmp_qom_get,
  2044. },
  2045. {
  2046. .name = "nbd-server-start",
  2047. .args_type = "addr:q",
  2048. .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
  2049. },
  2050. {
  2051. .name = "nbd-server-add",
  2052. .args_type = "device:B,writable:b?",
  2053. .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
  2054. },
  2055. {
  2056. .name = "nbd-server-stop",
  2057. .args_type = "",
  2058. .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
  2059. },
  2060. {
  2061. .name = "change-vnc-password",
  2062. .args_type = "password:s",
  2063. .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
  2064. },
  2065. {
  2066. .name = "qom-list-types",
  2067. .args_type = "implements:s?,abstract:b?",
  2068. .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
  2069. },
  2070. {
  2071. .name = "device-list-properties",
  2072. .args_type = "typename:s",
  2073. .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
  2074. },
  2075. {
  2076. .name = "query-machines",
  2077. .args_type = "",
  2078. .mhandler.cmd_new = qmp_marshal_input_query_machines,
  2079. },
  2080. {
  2081. .name = "query-cpu-definitions",
  2082. .args_type = "",
  2083. .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
  2084. },
  2085. {
  2086. .name = "query-target",
  2087. .args_type = "",
  2088. .mhandler.cmd_new = qmp_marshal_input_query_target,
  2089. },
  2090. {
  2091. .name = "chardev-add",
  2092. .args_type = "id:s,backend:q",
  2093. .mhandler.cmd_new = qmp_marshal_input_chardev_add,
  2094. },
  2095. SQMP
  2096. chardev-add
  2097. ----------------
  2098. Add a chardev.
  2099. Arguments:
  2100. - "id": the chardev's ID, must be unique (json-string)
  2101. - "backend": chardev backend type + parameters
  2102. Examples:
  2103. -> { "execute" : "chardev-add",
  2104. "arguments" : { "id" : "foo",
  2105. "backend" : { "type" : "null", "data" : {} } } }
  2106. <- { "return": {} }
  2107. -> { "execute" : "chardev-add",
  2108. "arguments" : { "id" : "bar",
  2109. "backend" : { "type" : "file",
  2110. "data" : { "out" : "/tmp/bar.log" } } } }
  2111. <- { "return": {} }
  2112. -> { "execute" : "chardev-add",
  2113. "arguments" : { "id" : "baz",
  2114. "backend" : { "type" : "pty", "data" : {} } } }
  2115. <- { "return": { "pty" : "/dev/pty/42" } }
  2116. EQMP
  2117. {
  2118. .name = "chardev-remove",
  2119. .args_type = "id:s",
  2120. .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
  2121. },
  2122. SQMP
  2123. chardev-remove
  2124. --------------
  2125. Remove a chardev.
  2126. Arguments:
  2127. - "id": the chardev's ID, must exist and not be in use (json-string)
  2128. Example:
  2129. -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
  2130. <- { "return": {} }
  2131. EQMP