qmp-commands.hx 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144
  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. .params = "filename",
  103. .help = "save screen into PPM image 'filename'",
  104. .user_print = monitor_user_noop,
  105. .mhandler.cmd_new = do_screen_dump,
  106. },
  107. SQMP
  108. screendump
  109. ----------
  110. Save screen into PPM image.
  111. Arguments:
  112. - "filename": file path (json-string)
  113. Example:
  114. -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
  115. <- { "return": {} }
  116. EQMP
  117. {
  118. .name = "stop",
  119. .args_type = "",
  120. .mhandler.cmd_new = qmp_marshal_input_stop,
  121. },
  122. SQMP
  123. stop
  124. ----
  125. Stop the emulator.
  126. Arguments: None.
  127. Example:
  128. -> { "execute": "stop" }
  129. <- { "return": {} }
  130. EQMP
  131. {
  132. .name = "cont",
  133. .args_type = "",
  134. .mhandler.cmd_new = qmp_marshal_input_cont,
  135. },
  136. SQMP
  137. cont
  138. ----
  139. Resume emulation.
  140. Arguments: None.
  141. Example:
  142. -> { "execute": "cont" }
  143. <- { "return": {} }
  144. EQMP
  145. {
  146. .name = "system_wakeup",
  147. .args_type = "",
  148. .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
  149. },
  150. SQMP
  151. system_wakeup
  152. -------------
  153. Wakeup guest from suspend.
  154. Arguments: None.
  155. Example:
  156. -> { "execute": "system_wakeup" }
  157. <- { "return": {} }
  158. EQMP
  159. {
  160. .name = "system_reset",
  161. .args_type = "",
  162. .mhandler.cmd_new = qmp_marshal_input_system_reset,
  163. },
  164. SQMP
  165. system_reset
  166. ------------
  167. Reset the system.
  168. Arguments: None.
  169. Example:
  170. -> { "execute": "system_reset" }
  171. <- { "return": {} }
  172. EQMP
  173. {
  174. .name = "system_powerdown",
  175. .args_type = "",
  176. .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
  177. },
  178. SQMP
  179. system_powerdown
  180. ----------------
  181. Send system power down event.
  182. Arguments: None.
  183. Example:
  184. -> { "execute": "system_powerdown" }
  185. <- { "return": {} }
  186. EQMP
  187. {
  188. .name = "device_add",
  189. .args_type = "device:O",
  190. .params = "driver[,prop=value][,...]",
  191. .help = "add device, like -device on the command line",
  192. .user_print = monitor_user_noop,
  193. .mhandler.cmd_new = do_device_add,
  194. },
  195. SQMP
  196. device_add
  197. ----------
  198. Add a device.
  199. Arguments:
  200. - "driver": the name of the new device's driver (json-string)
  201. - "bus": the device's parent bus (device tree path, json-string, optional)
  202. - "id": the device's ID, must be unique (json-string)
  203. - device properties
  204. Example:
  205. -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
  206. <- { "return": {} }
  207. Notes:
  208. (1) For detailed information about this command, please refer to the
  209. 'docs/qdev-device-use.txt' file.
  210. (2) It's possible to list device properties by running QEMU with the
  211. "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
  212. EQMP
  213. {
  214. .name = "device_del",
  215. .args_type = "id:s",
  216. .mhandler.cmd_new = qmp_marshal_input_device_del,
  217. },
  218. SQMP
  219. device_del
  220. ----------
  221. Remove a device.
  222. Arguments:
  223. - "id": the device's ID (json-string)
  224. Example:
  225. -> { "execute": "device_del", "arguments": { "id": "net1" } }
  226. <- { "return": {} }
  227. EQMP
  228. {
  229. .name = "cpu",
  230. .args_type = "index:i",
  231. .mhandler.cmd_new = qmp_marshal_input_cpu,
  232. },
  233. SQMP
  234. cpu
  235. ---
  236. Set the default CPU.
  237. Arguments:
  238. - "index": the CPU's index (json-int)
  239. Example:
  240. -> { "execute": "cpu", "arguments": { "index": 0 } }
  241. <- { "return": {} }
  242. Note: CPUs' indexes are obtained with the 'query-cpus' command.
  243. EQMP
  244. {
  245. .name = "memsave",
  246. .args_type = "val:l,size:i,filename:s,cpu:i?",
  247. .mhandler.cmd_new = qmp_marshal_input_memsave,
  248. },
  249. SQMP
  250. memsave
  251. -------
  252. Save to disk virtual memory dump starting at 'val' of size 'size'.
  253. Arguments:
  254. - "val": the starting address (json-int)
  255. - "size": the memory size, in bytes (json-int)
  256. - "filename": file path (json-string)
  257. - "cpu": virtual CPU index (json-int, optional)
  258. Example:
  259. -> { "execute": "memsave",
  260. "arguments": { "val": 10,
  261. "size": 100,
  262. "filename": "/tmp/virtual-mem-dump" } }
  263. <- { "return": {} }
  264. EQMP
  265. {
  266. .name = "pmemsave",
  267. .args_type = "val:l,size:i,filename:s",
  268. .mhandler.cmd_new = qmp_marshal_input_pmemsave,
  269. },
  270. SQMP
  271. pmemsave
  272. --------
  273. Save to disk physical memory dump starting at 'val' of size 'size'.
  274. Arguments:
  275. - "val": the starting address (json-int)
  276. - "size": the memory size, in bytes (json-int)
  277. - "filename": file path (json-string)
  278. Example:
  279. -> { "execute": "pmemsave",
  280. "arguments": { "val": 10,
  281. "size": 100,
  282. "filename": "/tmp/physical-mem-dump" } }
  283. <- { "return": {} }
  284. EQMP
  285. {
  286. .name = "inject-nmi",
  287. .args_type = "",
  288. .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
  289. },
  290. SQMP
  291. inject-nmi
  292. ----------
  293. Inject an NMI on guest's CPUs.
  294. Arguments: None.
  295. Example:
  296. -> { "execute": "inject-nmi" }
  297. <- { "return": {} }
  298. Note: inject-nmi is only supported for x86 guest currently, it will
  299. returns "Unsupported" error for non-x86 guest.
  300. EQMP
  301. {
  302. .name = "xen-save-devices-state",
  303. .args_type = "filename:F",
  304. .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
  305. },
  306. SQMP
  307. xen-save-devices-state
  308. -------
  309. Save the state of all devices to file. The RAM and the block devices
  310. of the VM are not saved by this command.
  311. Arguments:
  312. - "filename": the file to save the state of the devices to as binary
  313. data. See xen-save-devices-state.txt for a description of the binary
  314. format.
  315. Example:
  316. -> { "execute": "xen-save-devices-state",
  317. "arguments": { "filename": "/tmp/save" } }
  318. <- { "return": {} }
  319. EQMP
  320. {
  321. .name = "migrate",
  322. .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
  323. .mhandler.cmd_new = qmp_marshal_input_migrate,
  324. },
  325. SQMP
  326. migrate
  327. -------
  328. Migrate to URI.
  329. Arguments:
  330. - "blk": block migration, full disk copy (json-bool, optional)
  331. - "inc": incremental disk copy (json-bool, optional)
  332. - "uri": Destination URI (json-string)
  333. Example:
  334. -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
  335. <- { "return": {} }
  336. Notes:
  337. (1) The 'query-migrate' command should be used to check migration's progress
  338. and final result (this information is provided by the 'status' member)
  339. (2) All boolean arguments default to false
  340. (3) The user Monitor's "detach" argument is invalid in QMP and should not
  341. be used
  342. EQMP
  343. {
  344. .name = "migrate_cancel",
  345. .args_type = "",
  346. .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
  347. },
  348. SQMP
  349. migrate_cancel
  350. --------------
  351. Cancel the current migration.
  352. Arguments: None.
  353. Example:
  354. -> { "execute": "migrate_cancel" }
  355. <- { "return": {} }
  356. EQMP
  357. {
  358. .name = "migrate_set_speed",
  359. .args_type = "value:o",
  360. .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
  361. },
  362. SQMP
  363. migrate_set_speed
  364. -----------------
  365. Set maximum speed for migrations.
  366. Arguments:
  367. - "value": maximum speed, in bytes per second (json-int)
  368. Example:
  369. -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
  370. <- { "return": {} }
  371. EQMP
  372. {
  373. .name = "migrate_set_downtime",
  374. .args_type = "value:T",
  375. .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
  376. },
  377. SQMP
  378. migrate_set_downtime
  379. --------------------
  380. Set maximum tolerated downtime (in seconds) for migrations.
  381. Arguments:
  382. - "value": maximum downtime (json-number)
  383. Example:
  384. -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
  385. <- { "return": {} }
  386. EQMP
  387. {
  388. .name = "client_migrate_info",
  389. .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
  390. .params = "protocol hostname port tls-port cert-subject",
  391. .help = "send migration info to spice/vnc client",
  392. .user_print = monitor_user_noop,
  393. .mhandler.cmd_async = client_migrate_info,
  394. .flags = MONITOR_CMD_ASYNC,
  395. },
  396. SQMP
  397. client_migrate_info
  398. ------------------
  399. Set the spice/vnc connection info for the migration target. The spice/vnc
  400. server will ask the spice/vnc client to automatically reconnect using the
  401. new parameters (if specified) once the vm migration finished successfully.
  402. Arguments:
  403. - "protocol": protocol: "spice" or "vnc" (json-string)
  404. - "hostname": migration target hostname (json-string)
  405. - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
  406. - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
  407. - "cert-subject": server certificate subject (json-string, optional)
  408. Example:
  409. -> { "execute": "client_migrate_info",
  410. "arguments": { "protocol": "spice",
  411. "hostname": "virt42.lab.kraxel.org",
  412. "port": 1234 } }
  413. <- { "return": {} }
  414. EQMP
  415. {
  416. .name = "netdev_add",
  417. .args_type = "netdev:O",
  418. .params = "[user|tap|socket],id=str[,prop=value][,...]",
  419. .help = "add host network device",
  420. .user_print = monitor_user_noop,
  421. .mhandler.cmd_new = do_netdev_add,
  422. },
  423. SQMP
  424. netdev_add
  425. ----------
  426. Add host network device.
  427. Arguments:
  428. - "type": the device type, "tap", "user", ... (json-string)
  429. - "id": the device's ID, must be unique (json-string)
  430. - device options
  431. Example:
  432. -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
  433. <- { "return": {} }
  434. Note: The supported device options are the same ones supported by the '-net'
  435. command-line argument, which are listed in the '-help' output or QEMU's
  436. manual
  437. EQMP
  438. {
  439. .name = "netdev_del",
  440. .args_type = "id:s",
  441. .params = "id",
  442. .help = "remove host network device",
  443. .user_print = monitor_user_noop,
  444. .mhandler.cmd_new = do_netdev_del,
  445. },
  446. SQMP
  447. netdev_del
  448. ----------
  449. Remove host network device.
  450. Arguments:
  451. - "id": the device's ID, must be unique (json-string)
  452. Example:
  453. -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
  454. <- { "return": {} }
  455. EQMP
  456. {
  457. .name = "block_resize",
  458. .args_type = "device:B,size:o",
  459. .mhandler.cmd_new = qmp_marshal_input_block_resize,
  460. },
  461. SQMP
  462. block_resize
  463. ------------
  464. Resize a block image while a guest is running.
  465. Arguments:
  466. - "device": the device's ID, must be unique (json-string)
  467. - "size": new size
  468. Example:
  469. -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
  470. <- { "return": {} }
  471. EQMP
  472. {
  473. .name = "block-stream",
  474. .args_type = "device:B,base:s?,speed:o?",
  475. .mhandler.cmd_new = qmp_marshal_input_block_stream,
  476. },
  477. {
  478. .name = "block-job-set-speed",
  479. .args_type = "device:B,speed:o",
  480. .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
  481. },
  482. {
  483. .name = "block-job-cancel",
  484. .args_type = "device:B",
  485. .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
  486. },
  487. {
  488. .name = "transaction",
  489. .args_type = "actions:q",
  490. .mhandler.cmd_new = qmp_marshal_input_transaction,
  491. },
  492. SQMP
  493. transaction
  494. -----------
  495. Atomically operate on one or more block devices. The only supported
  496. operation for now is snapshotting. If there is any failure performing
  497. any of the operations, all snapshots for the group are abandoned, and
  498. the original disks pre-snapshot attempt are used.
  499. A list of dictionaries is accepted, that contains the actions to be performed.
  500. For snapshots this is the device, the file to use for the new snapshot,
  501. and the format. The default format, if not specified, is qcow2.
  502. Each new snapshot defaults to being created by QEMU (wiping any
  503. contents if the file already exists), but it is also possible to reuse
  504. an externally-created file. In the latter case, you should ensure that
  505. the new image file has the same contents as the current one; QEMU cannot
  506. perform any meaningful check. Typically this is achieved by using the
  507. current image file as the backing file for the new image.
  508. Arguments:
  509. actions array:
  510. - "type": the operation to perform. The only supported
  511. value is "blockdev-snapshot-sync". (json-string)
  512. - "data": a dictionary. The contents depend on the value
  513. of "type". When "type" is "blockdev-snapshot-sync":
  514. - "device": device name to snapshot (json-string)
  515. - "snapshot-file": name of new image file (json-string)
  516. - "format": format of new image (json-string, optional)
  517. - "mode": whether and how QEMU should create the snapshot file
  518. (NewImageMode, optional, default "absolute-paths")
  519. Example:
  520. -> { "execute": "transaction",
  521. "arguments": { "actions": [
  522. { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
  523. "snapshot-file": "/some/place/my-image",
  524. "format": "qcow2" } },
  525. { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
  526. "snapshot-file": "/some/place/my-image2",
  527. "mode": "existing",
  528. "format": "qcow2" } } ] } }
  529. <- { "return": {} }
  530. EQMP
  531. {
  532. .name = "blockdev-snapshot-sync",
  533. .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
  534. .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
  535. },
  536. SQMP
  537. blockdev-snapshot-sync
  538. ----------------------
  539. Synchronous snapshot of a block device. snapshot-file specifies the
  540. target of the new image. If the file exists, or if it is a device, the
  541. snapshot will be created in the existing file/device. If does not
  542. exist, a new file will be created. format specifies the format of the
  543. snapshot image, default is qcow2.
  544. Arguments:
  545. - "device": device name to snapshot (json-string)
  546. - "snapshot-file": name of new image file (json-string)
  547. - "mode": whether and how QEMU should create the snapshot file
  548. (NewImageMode, optional, default "absolute-paths")
  549. - "format": format of new image (json-string, optional)
  550. Example:
  551. -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
  552. "snapshot-file":
  553. "/some/place/my-image",
  554. "format": "qcow2" } }
  555. <- { "return": {} }
  556. EQMP
  557. {
  558. .name = "balloon",
  559. .args_type = "value:M",
  560. .mhandler.cmd_new = qmp_marshal_input_balloon,
  561. },
  562. SQMP
  563. balloon
  564. -------
  565. Request VM to change its memory allocation (in bytes).
  566. Arguments:
  567. - "value": New memory allocation (json-int)
  568. Example:
  569. -> { "execute": "balloon", "arguments": { "value": 536870912 } }
  570. <- { "return": {} }
  571. EQMP
  572. {
  573. .name = "set_link",
  574. .args_type = "name:s,up:b",
  575. .mhandler.cmd_new = qmp_marshal_input_set_link,
  576. },
  577. SQMP
  578. set_link
  579. --------
  580. Change the link status of a network adapter.
  581. Arguments:
  582. - "name": network device name (json-string)
  583. - "up": status is up (json-bool)
  584. Example:
  585. -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
  586. <- { "return": {} }
  587. EQMP
  588. {
  589. .name = "getfd",
  590. .args_type = "fdname:s",
  591. .params = "getfd name",
  592. .help = "receive a file descriptor via SCM rights and assign it a name",
  593. .user_print = monitor_user_noop,
  594. .mhandler.cmd_new = do_getfd,
  595. },
  596. SQMP
  597. getfd
  598. -----
  599. Receive a file descriptor via SCM rights and assign it a name.
  600. Arguments:
  601. - "fdname": file descriptor name (json-string)
  602. Example:
  603. -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
  604. <- { "return": {} }
  605. EQMP
  606. {
  607. .name = "closefd",
  608. .args_type = "fdname:s",
  609. .params = "closefd name",
  610. .help = "close a file descriptor previously passed via SCM rights",
  611. .user_print = monitor_user_noop,
  612. .mhandler.cmd_new = do_closefd,
  613. },
  614. SQMP
  615. closefd
  616. -------
  617. Close a file descriptor previously passed via SCM rights.
  618. Arguments:
  619. - "fdname": file descriptor name (json-string)
  620. Example:
  621. -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
  622. <- { "return": {} }
  623. EQMP
  624. {
  625. .name = "block_passwd",
  626. .args_type = "device:B,password:s",
  627. .mhandler.cmd_new = qmp_marshal_input_block_passwd,
  628. },
  629. SQMP
  630. block_passwd
  631. ------------
  632. Set the password of encrypted block devices.
  633. Arguments:
  634. - "device": device name (json-string)
  635. - "password": password (json-string)
  636. Example:
  637. -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
  638. "password": "12345" } }
  639. <- { "return": {} }
  640. EQMP
  641. {
  642. .name = "block_set_io_throttle",
  643. .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
  644. .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
  645. },
  646. SQMP
  647. block_set_io_throttle
  648. ------------
  649. Change I/O throttle limits for a block drive.
  650. Arguments:
  651. - "device": device name (json-string)
  652. - "bps": total throughput limit in bytes per second(json-int)
  653. - "bps_rd": read throughput limit in bytes per second(json-int)
  654. - "bps_wr": read throughput limit in bytes per second(json-int)
  655. - "iops": total I/O operations per second(json-int)
  656. - "iops_rd": read I/O operations per second(json-int)
  657. - "iops_wr": write I/O operations per second(json-int)
  658. Example:
  659. -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
  660. "bps": "1000000",
  661. "bps_rd": "0",
  662. "bps_wr": "0",
  663. "iops": "0",
  664. "iops_rd": "0",
  665. "iops_wr": "0" } }
  666. <- { "return": {} }
  667. EQMP
  668. {
  669. .name = "set_password",
  670. .args_type = "protocol:s,password:s,connected:s?",
  671. .mhandler.cmd_new = qmp_marshal_input_set_password,
  672. },
  673. SQMP
  674. set_password
  675. ------------
  676. Set the password for vnc/spice protocols.
  677. Arguments:
  678. - "protocol": protocol name (json-string)
  679. - "password": password (json-string)
  680. - "connected": [ keep | disconnect | fail ] (josn-string, optional)
  681. Example:
  682. -> { "execute": "set_password", "arguments": { "protocol": "vnc",
  683. "password": "secret" } }
  684. <- { "return": {} }
  685. EQMP
  686. {
  687. .name = "expire_password",
  688. .args_type = "protocol:s,time:s",
  689. .mhandler.cmd_new = qmp_marshal_input_expire_password,
  690. },
  691. SQMP
  692. expire_password
  693. ---------------
  694. Set the password expire time for vnc/spice protocols.
  695. Arguments:
  696. - "protocol": protocol name (json-string)
  697. - "time": [ now | never | +secs | secs ] (json-string)
  698. Example:
  699. -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
  700. "time": "+60" } }
  701. <- { "return": {} }
  702. EQMP
  703. {
  704. .name = "add_client",
  705. .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
  706. .params = "protocol fdname skipauth tls",
  707. .help = "add a graphics client",
  708. .user_print = monitor_user_noop,
  709. .mhandler.cmd_new = add_graphics_client,
  710. },
  711. SQMP
  712. add_client
  713. ----------
  714. Add a graphics client
  715. Arguments:
  716. - "protocol": protocol name (json-string)
  717. - "fdname": file descriptor name (json-string)
  718. - "skipauth": whether to skip authentication (json-bool, optional)
  719. - "tls": whether to perform TLS (json-bool, optional)
  720. Example:
  721. -> { "execute": "add_client", "arguments": { "protocol": "vnc",
  722. "fdname": "myclient" } }
  723. <- { "return": {} }
  724. EQMP
  725. {
  726. .name = "qmp_capabilities",
  727. .args_type = "",
  728. .params = "",
  729. .help = "enable QMP capabilities",
  730. .user_print = monitor_user_noop,
  731. .mhandler.cmd_new = do_qmp_capabilities,
  732. },
  733. SQMP
  734. qmp_capabilities
  735. ----------------
  736. Enable QMP capabilities.
  737. Arguments: None.
  738. Example:
  739. -> { "execute": "qmp_capabilities" }
  740. <- { "return": {} }
  741. Note: This command must be issued before issuing any other command.
  742. EQMP
  743. {
  744. .name = "human-monitor-command",
  745. .args_type = "command-line:s,cpu-index:i?",
  746. .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
  747. },
  748. SQMP
  749. human-monitor-command
  750. ---------------------
  751. Execute a Human Monitor command.
  752. Arguments:
  753. - command-line: the command name and its arguments, just like the
  754. Human Monitor's shell (json-string)
  755. - cpu-index: select the CPU number to be used by commands which access CPU
  756. data, like 'info registers'. The Monitor selects CPU 0 if this
  757. argument is not provided (json-int, optional)
  758. Example:
  759. -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
  760. <- { "return": "kvm support: enabled\r\n" }
  761. Notes:
  762. (1) The Human Monitor is NOT an stable interface, this means that command
  763. names, arguments and responses can change or be removed at ANY time.
  764. Applications that rely on long term stability guarantees should NOT
  765. use this command
  766. (2) Limitations:
  767. o This command is stateless, this means that commands that depend
  768. on state information (such as getfd) might not work
  769. o Commands that prompt the user for data (eg. 'cont' when the block
  770. device is encrypted) don't currently work
  771. 3. Query Commands
  772. =================
  773. HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
  774. HXCOMM this! We will possibly move query commands definitions inside those
  775. HXCOMM sections, just like regular commands.
  776. EQMP
  777. SQMP
  778. query-version
  779. -------------
  780. Show QEMU version.
  781. Return a json-object with the following information:
  782. - "qemu": A json-object containing three integer values:
  783. - "major": QEMU's major version (json-int)
  784. - "minor": QEMU's minor version (json-int)
  785. - "micro": QEMU's micro version (json-int)
  786. - "package": package's version (json-string)
  787. Example:
  788. -> { "execute": "query-version" }
  789. <- {
  790. "return":{
  791. "qemu":{
  792. "major":0,
  793. "minor":11,
  794. "micro":5
  795. },
  796. "package":""
  797. }
  798. }
  799. EQMP
  800. {
  801. .name = "query-version",
  802. .args_type = "",
  803. .mhandler.cmd_new = qmp_marshal_input_query_version,
  804. },
  805. SQMP
  806. query-commands
  807. --------------
  808. List QMP available commands.
  809. Each command is represented by a json-object, the returned value is a json-array
  810. of all commands.
  811. Each json-object contain:
  812. - "name": command's name (json-string)
  813. Example:
  814. -> { "execute": "query-commands" }
  815. <- {
  816. "return":[
  817. {
  818. "name":"query-balloon"
  819. },
  820. {
  821. "name":"system_powerdown"
  822. }
  823. ]
  824. }
  825. Note: This example has been shortened as the real response is too long.
  826. EQMP
  827. {
  828. .name = "query-commands",
  829. .args_type = "",
  830. .mhandler.cmd_new = qmp_marshal_input_query_commands,
  831. },
  832. SQMP
  833. query-chardev
  834. -------------
  835. Each device is represented by a json-object. The returned value is a json-array
  836. of all devices.
  837. Each json-object contain the following:
  838. - "label": device's label (json-string)
  839. - "filename": device's file (json-string)
  840. Example:
  841. -> { "execute": "query-chardev" }
  842. <- {
  843. "return":[
  844. {
  845. "label":"monitor",
  846. "filename":"stdio"
  847. },
  848. {
  849. "label":"serial0",
  850. "filename":"vc"
  851. }
  852. ]
  853. }
  854. EQMP
  855. {
  856. .name = "query-chardev",
  857. .args_type = "",
  858. .mhandler.cmd_new = qmp_marshal_input_query_chardev,
  859. },
  860. SQMP
  861. query-block
  862. -----------
  863. Show the block devices.
  864. Each block device information is stored in a json-object and the returned value
  865. is a json-array of all devices.
  866. Each json-object contain the following:
  867. - "device": device name (json-string)
  868. - "type": device type (json-string)
  869. - deprecated, retained for backward compatibility
  870. - Possible values: "unknown"
  871. - "removable": true if the device is removable, false otherwise (json-bool)
  872. - "locked": true if the device is locked, false otherwise (json-bool)
  873. - "tray-open": only present if removable, true if the device has a tray,
  874. and it is open (json-bool)
  875. - "inserted": only present if the device is inserted, it is a json-object
  876. containing the following:
  877. - "file": device file name (json-string)
  878. - "ro": true if read-only, false otherwise (json-bool)
  879. - "drv": driver format name (json-string)
  880. - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
  881. "file", "file", "ftp", "ftps", "host_cdrom",
  882. "host_device", "host_floppy", "http", "https",
  883. "nbd", "parallels", "qcow", "qcow2", "raw",
  884. "tftp", "vdi", "vmdk", "vpc", "vvfat"
  885. - "backing_file": backing file name (json-string, optional)
  886. - "encrypted": true if encrypted, false otherwise (json-bool)
  887. - "bps": limit total bytes per second (json-int)
  888. - "bps_rd": limit read bytes per second (json-int)
  889. - "bps_wr": limit write bytes per second (json-int)
  890. - "iops": limit total I/O operations per second (json-int)
  891. - "iops_rd": limit read operations per second (json-int)
  892. - "iops_wr": limit write operations per second (json-int)
  893. - "io-status": I/O operation status, only present if the device supports it
  894. and the VM is configured to stop on errors. It's always reset
  895. to "ok" when the "cont" command is issued (json_string, optional)
  896. - Possible values: "ok", "failed", "nospace"
  897. Example:
  898. -> { "execute": "query-block" }
  899. <- {
  900. "return":[
  901. {
  902. "io-status": "ok",
  903. "device":"ide0-hd0",
  904. "locked":false,
  905. "removable":false,
  906. "inserted":{
  907. "ro":false,
  908. "drv":"qcow2",
  909. "encrypted":false,
  910. "file":"disks/test.img",
  911. "bps":1000000,
  912. "bps_rd":0,
  913. "bps_wr":0,
  914. "iops":1000000,
  915. "iops_rd":0,
  916. "iops_wr":0,
  917. },
  918. "type":"unknown"
  919. },
  920. {
  921. "io-status": "ok",
  922. "device":"ide1-cd0",
  923. "locked":false,
  924. "removable":true,
  925. "type":"unknown"
  926. },
  927. {
  928. "device":"floppy0",
  929. "locked":false,
  930. "removable":true,
  931. "type":"unknown"
  932. },
  933. {
  934. "device":"sd0",
  935. "locked":false,
  936. "removable":true,
  937. "type":"unknown"
  938. }
  939. ]
  940. }
  941. EQMP
  942. {
  943. .name = "query-block",
  944. .args_type = "",
  945. .mhandler.cmd_new = qmp_marshal_input_query_block,
  946. },
  947. SQMP
  948. query-blockstats
  949. ----------------
  950. Show block device statistics.
  951. Each device statistic information is stored in a json-object and the returned
  952. value is a json-array of all devices.
  953. Each json-object contain the following:
  954. - "device": device name (json-string)
  955. - "stats": A json-object with the statistics information, it contains:
  956. - "rd_bytes": bytes read (json-int)
  957. - "wr_bytes": bytes written (json-int)
  958. - "rd_operations": read operations (json-int)
  959. - "wr_operations": write operations (json-int)
  960. - "flush_operations": cache flush operations (json-int)
  961. - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
  962. - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
  963. - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
  964. - "wr_highest_offset": Highest offset of a sector written since the
  965. BlockDriverState has been opened (json-int)
  966. - "parent": Contains recursively the statistics of the underlying
  967. protocol (e.g. the host file for a qcow2 image). If there is
  968. no underlying protocol, this field is omitted
  969. (json-object, optional)
  970. Example:
  971. -> { "execute": "query-blockstats" }
  972. <- {
  973. "return":[
  974. {
  975. "device":"ide0-hd0",
  976. "parent":{
  977. "stats":{
  978. "wr_highest_offset":3686448128,
  979. "wr_bytes":9786368,
  980. "wr_operations":751,
  981. "rd_bytes":122567168,
  982. "rd_operations":36772
  983. "wr_total_times_ns":313253456
  984. "rd_total_times_ns":3465673657
  985. "flush_total_times_ns":49653
  986. "flush_operations":61,
  987. }
  988. },
  989. "stats":{
  990. "wr_highest_offset":2821110784,
  991. "wr_bytes":9786368,
  992. "wr_operations":692,
  993. "rd_bytes":122739200,
  994. "rd_operations":36604
  995. "flush_operations":51,
  996. "wr_total_times_ns":313253456
  997. "rd_total_times_ns":3465673657
  998. "flush_total_times_ns":49653
  999. }
  1000. },
  1001. {
  1002. "device":"ide1-cd0",
  1003. "stats":{
  1004. "wr_highest_offset":0,
  1005. "wr_bytes":0,
  1006. "wr_operations":0,
  1007. "rd_bytes":0,
  1008. "rd_operations":0
  1009. "flush_operations":0,
  1010. "wr_total_times_ns":0
  1011. "rd_total_times_ns":0
  1012. "flush_total_times_ns":0
  1013. }
  1014. },
  1015. {
  1016. "device":"floppy0",
  1017. "stats":{
  1018. "wr_highest_offset":0,
  1019. "wr_bytes":0,
  1020. "wr_operations":0,
  1021. "rd_bytes":0,
  1022. "rd_operations":0
  1023. "flush_operations":0,
  1024. "wr_total_times_ns":0
  1025. "rd_total_times_ns":0
  1026. "flush_total_times_ns":0
  1027. }
  1028. },
  1029. {
  1030. "device":"sd0",
  1031. "stats":{
  1032. "wr_highest_offset":0,
  1033. "wr_bytes":0,
  1034. "wr_operations":0,
  1035. "rd_bytes":0,
  1036. "rd_operations":0
  1037. "flush_operations":0,
  1038. "wr_total_times_ns":0
  1039. "rd_total_times_ns":0
  1040. "flush_total_times_ns":0
  1041. }
  1042. }
  1043. ]
  1044. }
  1045. EQMP
  1046. {
  1047. .name = "query-blockstats",
  1048. .args_type = "",
  1049. .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
  1050. },
  1051. SQMP
  1052. query-cpus
  1053. ----------
  1054. Show CPU information.
  1055. Return a json-array. Each CPU is represented by a json-object, which contains:
  1056. - "CPU": CPU index (json-int)
  1057. - "current": true if this is the current CPU, false otherwise (json-bool)
  1058. - "halted": true if the cpu is halted, false otherwise (json-bool)
  1059. - Current program counter. The key's name depends on the architecture:
  1060. "pc": i386/x86_64 (json-int)
  1061. "nip": PPC (json-int)
  1062. "pc" and "npc": sparc (json-int)
  1063. "PC": mips (json-int)
  1064. - "thread_id": ID of the underlying host thread (json-int)
  1065. Example:
  1066. -> { "execute": "query-cpus" }
  1067. <- {
  1068. "return":[
  1069. {
  1070. "CPU":0,
  1071. "current":true,
  1072. "halted":false,
  1073. "pc":3227107138
  1074. "thread_id":3134
  1075. },
  1076. {
  1077. "CPU":1,
  1078. "current":false,
  1079. "halted":true,
  1080. "pc":7108165
  1081. "thread_id":3135
  1082. }
  1083. ]
  1084. }
  1085. EQMP
  1086. {
  1087. .name = "query-cpus",
  1088. .args_type = "",
  1089. .mhandler.cmd_new = qmp_marshal_input_query_cpus,
  1090. },
  1091. SQMP
  1092. query-pci
  1093. ---------
  1094. PCI buses and devices information.
  1095. The returned value is a json-array of all buses. Each bus is represented by
  1096. a json-object, which has a key with a json-array of all PCI devices attached
  1097. to it. Each device is represented by a json-object.
  1098. The bus json-object contains the following:
  1099. - "bus": bus number (json-int)
  1100. - "devices": a json-array of json-objects, each json-object represents a
  1101. PCI device
  1102. The PCI device json-object contains the following:
  1103. - "bus": identical to the parent's bus number (json-int)
  1104. - "slot": slot number (json-int)
  1105. - "function": function number (json-int)
  1106. - "class_info": a json-object containing:
  1107. - "desc": device class description (json-string, optional)
  1108. - "class": device class number (json-int)
  1109. - "id": a json-object containing:
  1110. - "device": device ID (json-int)
  1111. - "vendor": vendor ID (json-int)
  1112. - "irq": device's IRQ if assigned (json-int, optional)
  1113. - "qdev_id": qdev id string (json-string)
  1114. - "pci_bridge": It's a json-object, only present if this device is a
  1115. PCI bridge, contains:
  1116. - "bus": bus number (json-int)
  1117. - "secondary": secondary bus number (json-int)
  1118. - "subordinate": subordinate bus number (json-int)
  1119. - "io_range": I/O memory range information, a json-object with the
  1120. following members:
  1121. - "base": base address, in bytes (json-int)
  1122. - "limit": limit address, in bytes (json-int)
  1123. - "memory_range": memory range information, a json-object with the
  1124. following members:
  1125. - "base": base address, in bytes (json-int)
  1126. - "limit": limit address, in bytes (json-int)
  1127. - "prefetchable_range": Prefetchable memory range information, a
  1128. json-object with the following members:
  1129. - "base": base address, in bytes (json-int)
  1130. - "limit": limit address, in bytes (json-int)
  1131. - "devices": a json-array of PCI devices if there's any attached, each
  1132. each element is represented by a json-object, which contains
  1133. the same members of the 'PCI device json-object' described
  1134. above (optional)
  1135. - "regions": a json-array of json-objects, each json-object represents a
  1136. memory region of this device
  1137. The memory range json-object contains the following:
  1138. - "base": base memory address (json-int)
  1139. - "limit": limit value (json-int)
  1140. The region json-object can be an I/O region or a memory region, an I/O region
  1141. json-object contains the following:
  1142. - "type": "io" (json-string, fixed)
  1143. - "bar": BAR number (json-int)
  1144. - "address": memory address (json-int)
  1145. - "size": memory size (json-int)
  1146. A memory region json-object contains the following:
  1147. - "type": "memory" (json-string, fixed)
  1148. - "bar": BAR number (json-int)
  1149. - "address": memory address (json-int)
  1150. - "size": memory size (json-int)
  1151. - "mem_type_64": true or false (json-bool)
  1152. - "prefetch": true or false (json-bool)
  1153. Example:
  1154. -> { "execute": "query-pci" }
  1155. <- {
  1156. "return":[
  1157. {
  1158. "bus":0,
  1159. "devices":[
  1160. {
  1161. "bus":0,
  1162. "qdev_id":"",
  1163. "slot":0,
  1164. "class_info":{
  1165. "class":1536,
  1166. "desc":"Host bridge"
  1167. },
  1168. "id":{
  1169. "device":32902,
  1170. "vendor":4663
  1171. },
  1172. "function":0,
  1173. "regions":[
  1174. ]
  1175. },
  1176. {
  1177. "bus":0,
  1178. "qdev_id":"",
  1179. "slot":1,
  1180. "class_info":{
  1181. "class":1537,
  1182. "desc":"ISA bridge"
  1183. },
  1184. "id":{
  1185. "device":32902,
  1186. "vendor":28672
  1187. },
  1188. "function":0,
  1189. "regions":[
  1190. ]
  1191. },
  1192. {
  1193. "bus":0,
  1194. "qdev_id":"",
  1195. "slot":1,
  1196. "class_info":{
  1197. "class":257,
  1198. "desc":"IDE controller"
  1199. },
  1200. "id":{
  1201. "device":32902,
  1202. "vendor":28688
  1203. },
  1204. "function":1,
  1205. "regions":[
  1206. {
  1207. "bar":4,
  1208. "size":16,
  1209. "address":49152,
  1210. "type":"io"
  1211. }
  1212. ]
  1213. },
  1214. {
  1215. "bus":0,
  1216. "qdev_id":"",
  1217. "slot":2,
  1218. "class_info":{
  1219. "class":768,
  1220. "desc":"VGA controller"
  1221. },
  1222. "id":{
  1223. "device":4115,
  1224. "vendor":184
  1225. },
  1226. "function":0,
  1227. "regions":[
  1228. {
  1229. "prefetch":true,
  1230. "mem_type_64":false,
  1231. "bar":0,
  1232. "size":33554432,
  1233. "address":4026531840,
  1234. "type":"memory"
  1235. },
  1236. {
  1237. "prefetch":false,
  1238. "mem_type_64":false,
  1239. "bar":1,
  1240. "size":4096,
  1241. "address":4060086272,
  1242. "type":"memory"
  1243. },
  1244. {
  1245. "prefetch":false,
  1246. "mem_type_64":false,
  1247. "bar":6,
  1248. "size":65536,
  1249. "address":-1,
  1250. "type":"memory"
  1251. }
  1252. ]
  1253. },
  1254. {
  1255. "bus":0,
  1256. "qdev_id":"",
  1257. "irq":11,
  1258. "slot":4,
  1259. "class_info":{
  1260. "class":1280,
  1261. "desc":"RAM controller"
  1262. },
  1263. "id":{
  1264. "device":6900,
  1265. "vendor":4098
  1266. },
  1267. "function":0,
  1268. "regions":[
  1269. {
  1270. "bar":0,
  1271. "size":32,
  1272. "address":49280,
  1273. "type":"io"
  1274. }
  1275. ]
  1276. }
  1277. ]
  1278. }
  1279. ]
  1280. }
  1281. Note: This example has been shortened as the real response is too long.
  1282. EQMP
  1283. {
  1284. .name = "query-pci",
  1285. .args_type = "",
  1286. .mhandler.cmd_new = qmp_marshal_input_query_pci,
  1287. },
  1288. SQMP
  1289. query-kvm
  1290. ---------
  1291. Show KVM information.
  1292. Return a json-object with the following information:
  1293. - "enabled": true if KVM support is enabled, false otherwise (json-bool)
  1294. - "present": true if QEMU has KVM support, false otherwise (json-bool)
  1295. Example:
  1296. -> { "execute": "query-kvm" }
  1297. <- { "return": { "enabled": true, "present": true } }
  1298. EQMP
  1299. {
  1300. .name = "query-kvm",
  1301. .args_type = "",
  1302. .mhandler.cmd_new = qmp_marshal_input_query_kvm,
  1303. },
  1304. SQMP
  1305. query-status
  1306. ------------
  1307. Return a json-object with the following information:
  1308. - "running": true if the VM is running, or false if it is paused (json-bool)
  1309. - "singlestep": true if the VM is in single step mode,
  1310. false otherwise (json-bool)
  1311. - "status": one of the following values (json-string)
  1312. "debug" - QEMU is running on a debugger
  1313. "inmigrate" - guest is paused waiting for an incoming migration
  1314. "internal-error" - An internal error that prevents further guest
  1315. execution has occurred
  1316. "io-error" - the last IOP has failed and the device is configured
  1317. to pause on I/O errors
  1318. "paused" - guest has been paused via the 'stop' command
  1319. "postmigrate" - guest is paused following a successful 'migrate'
  1320. "prelaunch" - QEMU was started with -S and guest has not started
  1321. "finish-migrate" - guest is paused to finish the migration process
  1322. "restore-vm" - guest is paused to restore VM state
  1323. "running" - guest is actively running
  1324. "save-vm" - guest is paused to save the VM state
  1325. "shutdown" - guest is shut down (and -no-shutdown is in use)
  1326. "watchdog" - the watchdog action is configured to pause and
  1327. has been triggered
  1328. Example:
  1329. -> { "execute": "query-status" }
  1330. <- { "return": { "running": true, "singlestep": false, "status": "running" } }
  1331. EQMP
  1332. {
  1333. .name = "query-status",
  1334. .args_type = "",
  1335. .mhandler.cmd_new = qmp_marshal_input_query_status,
  1336. },
  1337. SQMP
  1338. query-mice
  1339. ----------
  1340. Show VM mice information.
  1341. Each mouse is represented by a json-object, the returned value is a json-array
  1342. of all mice.
  1343. The mouse json-object contains the following:
  1344. - "name": mouse's name (json-string)
  1345. - "index": mouse's index (json-int)
  1346. - "current": true if this mouse is receiving events, false otherwise (json-bool)
  1347. - "absolute": true if the mouse generates absolute input events (json-bool)
  1348. Example:
  1349. -> { "execute": "query-mice" }
  1350. <- {
  1351. "return":[
  1352. {
  1353. "name":"QEMU Microsoft Mouse",
  1354. "index":0,
  1355. "current":false,
  1356. "absolute":false
  1357. },
  1358. {
  1359. "name":"QEMU PS/2 Mouse",
  1360. "index":1,
  1361. "current":true,
  1362. "absolute":true
  1363. }
  1364. ]
  1365. }
  1366. EQMP
  1367. {
  1368. .name = "query-mice",
  1369. .args_type = "",
  1370. .mhandler.cmd_new = qmp_marshal_input_query_mice,
  1371. },
  1372. SQMP
  1373. query-vnc
  1374. ---------
  1375. Show VNC server information.
  1376. Return a json-object with server information. Connected clients are returned
  1377. as a json-array of json-objects.
  1378. The main json-object contains the following:
  1379. - "enabled": true or false (json-bool)
  1380. - "host": server's IP address (json-string)
  1381. - "family": address family (json-string)
  1382. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  1383. - "service": server's port number (json-string)
  1384. - "auth": authentication method (json-string)
  1385. - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
  1386. "tls", "ultra", "unknown", "vencrypt", "vencrypt",
  1387. "vencrypt+plain", "vencrypt+tls+none",
  1388. "vencrypt+tls+plain", "vencrypt+tls+sasl",
  1389. "vencrypt+tls+vnc", "vencrypt+x509+none",
  1390. "vencrypt+x509+plain", "vencrypt+x509+sasl",
  1391. "vencrypt+x509+vnc", "vnc"
  1392. - "clients": a json-array of all connected clients
  1393. Clients are described by a json-object, each one contain the following:
  1394. - "host": client's IP address (json-string)
  1395. - "family": address family (json-string)
  1396. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  1397. - "service": client's port number (json-string)
  1398. - "x509_dname": TLS dname (json-string, optional)
  1399. - "sasl_username": SASL username (json-string, optional)
  1400. Example:
  1401. -> { "execute": "query-vnc" }
  1402. <- {
  1403. "return":{
  1404. "enabled":true,
  1405. "host":"0.0.0.0",
  1406. "service":"50402",
  1407. "auth":"vnc",
  1408. "family":"ipv4",
  1409. "clients":[
  1410. {
  1411. "host":"127.0.0.1",
  1412. "service":"50401",
  1413. "family":"ipv4"
  1414. }
  1415. ]
  1416. }
  1417. }
  1418. EQMP
  1419. {
  1420. .name = "query-vnc",
  1421. .args_type = "",
  1422. .mhandler.cmd_new = qmp_marshal_input_query_vnc,
  1423. },
  1424. SQMP
  1425. query-spice
  1426. -----------
  1427. Show SPICE server information.
  1428. Return a json-object with server information. Connected clients are returned
  1429. as a json-array of json-objects.
  1430. The main json-object contains the following:
  1431. - "enabled": true or false (json-bool)
  1432. - "host": server's IP address (json-string)
  1433. - "port": server's port number (json-int, optional)
  1434. - "tls-port": server's port number (json-int, optional)
  1435. - "auth": authentication method (json-string)
  1436. - Possible values: "none", "spice"
  1437. - "channels": a json-array of all active channels clients
  1438. Channels are described by a json-object, each one contain the following:
  1439. - "host": client's IP address (json-string)
  1440. - "family": address family (json-string)
  1441. - Possible values: "ipv4", "ipv6", "unix", "unknown"
  1442. - "port": client's port number (json-string)
  1443. - "connection-id": spice connection id. All channels with the same id
  1444. belong to the same spice session (json-int)
  1445. - "channel-type": channel type. "1" is the main control channel, filter for
  1446. this one if you want track spice sessions only (json-int)
  1447. - "channel-id": channel id. Usually "0", might be different needed when
  1448. multiple channels of the same type exist, such as multiple
  1449. display channels in a multihead setup (json-int)
  1450. - "tls": whevener the channel is encrypted (json-bool)
  1451. Example:
  1452. -> { "execute": "query-spice" }
  1453. <- {
  1454. "return": {
  1455. "enabled": true,
  1456. "auth": "spice",
  1457. "port": 5920,
  1458. "tls-port": 5921,
  1459. "host": "0.0.0.0",
  1460. "channels": [
  1461. {
  1462. "port": "54924",
  1463. "family": "ipv4",
  1464. "channel-type": 1,
  1465. "connection-id": 1804289383,
  1466. "host": "127.0.0.1",
  1467. "channel-id": 0,
  1468. "tls": true
  1469. },
  1470. {
  1471. "port": "36710",
  1472. "family": "ipv4",
  1473. "channel-type": 4,
  1474. "connection-id": 1804289383,
  1475. "host": "127.0.0.1",
  1476. "channel-id": 0,
  1477. "tls": false
  1478. },
  1479. [ ... more channels follow ... ]
  1480. ]
  1481. }
  1482. }
  1483. EQMP
  1484. #if defined(CONFIG_SPICE)
  1485. {
  1486. .name = "query-spice",
  1487. .args_type = "",
  1488. .mhandler.cmd_new = qmp_marshal_input_query_spice,
  1489. },
  1490. #endif
  1491. SQMP
  1492. query-name
  1493. ----------
  1494. Show VM name.
  1495. Return a json-object with the following information:
  1496. - "name": VM's name (json-string, optional)
  1497. Example:
  1498. -> { "execute": "query-name" }
  1499. <- { "return": { "name": "qemu-name" } }
  1500. EQMP
  1501. {
  1502. .name = "query-name",
  1503. .args_type = "",
  1504. .mhandler.cmd_new = qmp_marshal_input_query_name,
  1505. },
  1506. SQMP
  1507. query-uuid
  1508. ----------
  1509. Show VM UUID.
  1510. Return a json-object with the following information:
  1511. - "UUID": Universally Unique Identifier (json-string)
  1512. Example:
  1513. -> { "execute": "query-uuid" }
  1514. <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
  1515. EQMP
  1516. {
  1517. .name = "query-uuid",
  1518. .args_type = "",
  1519. .mhandler.cmd_new = qmp_marshal_input_query_uuid,
  1520. },
  1521. SQMP
  1522. query-migrate
  1523. -------------
  1524. Migration status.
  1525. Return a json-object. If migration is active there will be another json-object
  1526. with RAM migration status and if block migration is active another one with
  1527. block migration status.
  1528. The main json-object contains the following:
  1529. - "status": migration status (json-string)
  1530. - Possible values: "active", "completed", "failed", "cancelled"
  1531. - "ram": only present if "status" is "active", it is a json-object with the
  1532. following RAM information (in bytes):
  1533. - "transferred": amount transferred (json-int)
  1534. - "remaining": amount remaining (json-int)
  1535. - "total": total (json-int)
  1536. - "disk": only present if "status" is "active" and it is a block migration,
  1537. it is a json-object with the following disk information (in bytes):
  1538. - "transferred": amount transferred (json-int)
  1539. - "remaining": amount remaining (json-int)
  1540. - "total": total (json-int)
  1541. Examples:
  1542. 1. Before the first migration
  1543. -> { "execute": "query-migrate" }
  1544. <- { "return": {} }
  1545. 2. Migration is done and has succeeded
  1546. -> { "execute": "query-migrate" }
  1547. <- { "return": { "status": "completed" } }
  1548. 3. Migration is done and has failed
  1549. -> { "execute": "query-migrate" }
  1550. <- { "return": { "status": "failed" } }
  1551. 4. Migration is being performed and is not a block migration:
  1552. -> { "execute": "query-migrate" }
  1553. <- {
  1554. "return":{
  1555. "status":"active",
  1556. "ram":{
  1557. "transferred":123,
  1558. "remaining":123,
  1559. "total":246
  1560. }
  1561. }
  1562. }
  1563. 5. Migration is being performed and is a block migration:
  1564. -> { "execute": "query-migrate" }
  1565. <- {
  1566. "return":{
  1567. "status":"active",
  1568. "ram":{
  1569. "total":1057024,
  1570. "remaining":1053304,
  1571. "transferred":3720
  1572. },
  1573. "disk":{
  1574. "total":20971520,
  1575. "remaining":20880384,
  1576. "transferred":91136
  1577. }
  1578. }
  1579. }
  1580. EQMP
  1581. {
  1582. .name = "query-migrate",
  1583. .args_type = "",
  1584. .mhandler.cmd_new = qmp_marshal_input_query_migrate,
  1585. },
  1586. SQMP
  1587. query-balloon
  1588. -------------
  1589. Show balloon information.
  1590. Make an asynchronous request for balloon info. When the request completes a
  1591. json-object will be returned containing the following data:
  1592. - "actual": current balloon value in bytes (json-int)
  1593. - "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
  1594. - "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
  1595. - "major_page_faults": Number of major faults (json-int, optional)
  1596. - "minor_page_faults": Number of minor faults (json-int, optional)
  1597. - "free_mem": Total amount of free and unused memory in
  1598. bytes (json-int, optional)
  1599. - "total_mem": Total amount of available memory in bytes (json-int, optional)
  1600. Example:
  1601. -> { "execute": "query-balloon" }
  1602. <- {
  1603. "return":{
  1604. "actual":1073741824,
  1605. "mem_swapped_in":0,
  1606. "mem_swapped_out":0,
  1607. "major_page_faults":142,
  1608. "minor_page_faults":239245,
  1609. "free_mem":1014185984,
  1610. "total_mem":1044668416
  1611. }
  1612. }
  1613. EQMP
  1614. {
  1615. .name = "query-balloon",
  1616. .args_type = "",
  1617. .mhandler.cmd_new = qmp_marshal_input_query_balloon,
  1618. },
  1619. {
  1620. .name = "query-block-jobs",
  1621. .args_type = "",
  1622. .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
  1623. },
  1624. {
  1625. .name = "qom-list",
  1626. .args_type = "path:s",
  1627. .mhandler.cmd_new = qmp_marshal_input_qom_list,
  1628. },
  1629. {
  1630. .name = "qom-set",
  1631. .args_type = "path:s,property:s,value:q",
  1632. .mhandler.cmd_new = qmp_qom_set,
  1633. },
  1634. {
  1635. .name = "qom-get",
  1636. .args_type = "path:s,property:s",
  1637. .mhandler.cmd_new = qmp_qom_get,
  1638. },
  1639. {
  1640. .name = "change-vnc-password",
  1641. .args_type = "password:s",
  1642. .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
  1643. },
  1644. {
  1645. .name = "qom-list-types",
  1646. .args_type = "implements:s?,abstract:b?",
  1647. .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
  1648. },