qmp-commands.hx 45 KB

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