qmp-commands.hx 50 KB

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