hmp-commands.hx 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368
  1. HXCOMM Use DEFHEADING() to define headings in both help text and texi
  2. HXCOMM Text between STEXI and ETEXI are copied to texi version and
  3. HXCOMM discarded from C version
  4. HXCOMM DEF(command, args, callback, arg_string, help) is used to construct
  5. HXCOMM monitor commands
  6. HXCOMM HXCOMM can be used for comments, discarded from both texi and C
  7. STEXI
  8. @table @option
  9. ETEXI
  10. {
  11. .name = "help|?",
  12. .args_type = "name:s?",
  13. .params = "[cmd]",
  14. .help = "show the help",
  15. .mhandler.cmd = do_help_cmd,
  16. },
  17. STEXI
  18. @item help or ? [@var{cmd}]
  19. @findex help
  20. Show the help for all commands or just for command @var{cmd}.
  21. ETEXI
  22. {
  23. .name = "commit",
  24. .args_type = "device:B",
  25. .params = "device|all",
  26. .help = "commit changes to the disk images (if -snapshot is used) or backing files",
  27. .mhandler.cmd = do_commit,
  28. },
  29. STEXI
  30. @item commit
  31. @findex commit
  32. Commit changes to the disk images (if -snapshot is used) or backing files.
  33. ETEXI
  34. {
  35. .name = "q|quit",
  36. .args_type = "",
  37. .params = "",
  38. .help = "quit the emulator",
  39. .user_print = monitor_user_noop,
  40. .mhandler.cmd = hmp_quit,
  41. },
  42. STEXI
  43. @item q or quit
  44. @findex quit
  45. Quit the emulator.
  46. ETEXI
  47. {
  48. .name = "block_resize",
  49. .args_type = "device:B,size:o",
  50. .params = "device size",
  51. .help = "resize a block image",
  52. .user_print = monitor_user_noop,
  53. .mhandler.cmd_new = do_block_resize,
  54. },
  55. STEXI
  56. @item block_resize
  57. @findex block_resize
  58. Resize a block image while a guest is running. Usually requires guest
  59. action to see the updated size. Resize to a lower size is supported,
  60. but should be used with extreme caution. Note that this command only
  61. resizes image files, it can not resize block devices like LVM volumes.
  62. ETEXI
  63. {
  64. .name = "eject",
  65. .args_type = "force:-f,device:B",
  66. .params = "[-f] device",
  67. .help = "eject a removable medium (use -f to force it)",
  68. .user_print = monitor_user_noop,
  69. .mhandler.cmd_new = do_eject,
  70. },
  71. STEXI
  72. @item eject [-f] @var{device}
  73. @findex eject
  74. Eject a removable medium (use -f to force it).
  75. ETEXI
  76. {
  77. .name = "drive_del",
  78. .args_type = "id:s",
  79. .params = "device",
  80. .help = "remove host block device",
  81. .user_print = monitor_user_noop,
  82. .mhandler.cmd_new = do_drive_del,
  83. },
  84. STEXI
  85. @item drive_del @var{device}
  86. @findex drive_del
  87. Remove host block device. The result is that guest generated IO is no longer
  88. submitted against the host device underlying the disk. Once a drive has
  89. been deleted, the QEMU Block layer returns -EIO which results in IO
  90. errors in the guest for applications that are reading/writing to the device.
  91. ETEXI
  92. {
  93. .name = "change",
  94. .args_type = "device:B,target:F,arg:s?",
  95. .params = "device filename [format]",
  96. .help = "change a removable medium, optional format",
  97. .user_print = monitor_user_noop,
  98. .mhandler.cmd_new = do_change,
  99. },
  100. STEXI
  101. @item change @var{device} @var{setting}
  102. @findex change
  103. Change the configuration of a device.
  104. @table @option
  105. @item change @var{diskdevice} @var{filename} [@var{format}]
  106. Change the medium for a removable disk device to point to @var{filename}. eg
  107. @example
  108. (qemu) change ide1-cd0 /path/to/some.iso
  109. @end example
  110. @var{format} is optional.
  111. @item change vnc @var{display},@var{options}
  112. Change the configuration of the VNC server. The valid syntax for @var{display}
  113. and @var{options} are described at @ref{sec_invocation}. eg
  114. @example
  115. (qemu) change vnc localhost:1
  116. @end example
  117. @item change vnc password [@var{password}]
  118. Change the password associated with the VNC server. If the new password is not
  119. supplied, the monitor will prompt for it to be entered. VNC passwords are only
  120. significant up to 8 letters. eg
  121. @example
  122. (qemu) change vnc password
  123. Password: ********
  124. @end example
  125. @end table
  126. ETEXI
  127. {
  128. .name = "screendump",
  129. .args_type = "filename:F",
  130. .params = "filename",
  131. .help = "save screen into PPM image 'filename'",
  132. .user_print = monitor_user_noop,
  133. .mhandler.cmd_new = do_screen_dump,
  134. },
  135. STEXI
  136. @item screendump @var{filename}
  137. @findex screendump
  138. Save screen into PPM image @var{filename}.
  139. ETEXI
  140. {
  141. .name = "logfile",
  142. .args_type = "filename:F",
  143. .params = "filename",
  144. .help = "output logs to 'filename'",
  145. .mhandler.cmd = do_logfile,
  146. },
  147. STEXI
  148. @item logfile @var{filename}
  149. @findex logfile
  150. Output logs to @var{filename}.
  151. ETEXI
  152. {
  153. .name = "trace-event",
  154. .args_type = "name:s,option:b",
  155. .params = "name on|off",
  156. .help = "changes status of a specific trace event",
  157. .mhandler.cmd = do_trace_event_set_state,
  158. },
  159. STEXI
  160. @item trace-event
  161. @findex trace-event
  162. changes status of a trace event
  163. ETEXI
  164. #if defined(CONFIG_TRACE_SIMPLE)
  165. {
  166. .name = "trace-file",
  167. .args_type = "op:s?,arg:F?",
  168. .params = "on|off|flush|set [arg]",
  169. .help = "open, close, or flush trace file, or set a new file name",
  170. .mhandler.cmd = do_trace_file,
  171. },
  172. STEXI
  173. @item trace-file on|off|flush
  174. @findex trace-file
  175. Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed.
  176. ETEXI
  177. #endif
  178. {
  179. .name = "log",
  180. .args_type = "items:s",
  181. .params = "item1[,...]",
  182. .help = "activate logging of the specified items to '/tmp/qemu.log'",
  183. .mhandler.cmd = do_log,
  184. },
  185. STEXI
  186. @item log @var{item1}[,...]
  187. @findex log
  188. Activate logging of the specified items to @file{/tmp/qemu.log}.
  189. ETEXI
  190. {
  191. .name = "savevm",
  192. .args_type = "name:s?",
  193. .params = "[tag|id]",
  194. .help = "save a VM snapshot. If no tag or id are provided, a new snapshot is created",
  195. .mhandler.cmd = do_savevm,
  196. },
  197. STEXI
  198. @item savevm [@var{tag}|@var{id}]
  199. @findex savevm
  200. Create a snapshot of the whole virtual machine. If @var{tag} is
  201. provided, it is used as human readable identifier. If there is already
  202. a snapshot with the same tag or ID, it is replaced. More info at
  203. @ref{vm_snapshots}.
  204. ETEXI
  205. {
  206. .name = "loadvm",
  207. .args_type = "name:s",
  208. .params = "tag|id",
  209. .help = "restore a VM snapshot from its tag or id",
  210. .mhandler.cmd = do_loadvm,
  211. },
  212. STEXI
  213. @item loadvm @var{tag}|@var{id}
  214. @findex loadvm
  215. Set the whole virtual machine to the snapshot identified by the tag
  216. @var{tag} or the unique snapshot ID @var{id}.
  217. ETEXI
  218. {
  219. .name = "delvm",
  220. .args_type = "name:s",
  221. .params = "tag|id",
  222. .help = "delete a VM snapshot from its tag or id",
  223. .mhandler.cmd = do_delvm,
  224. },
  225. STEXI
  226. @item delvm @var{tag}|@var{id}
  227. @findex delvm
  228. Delete the snapshot identified by @var{tag} or @var{id}.
  229. ETEXI
  230. {
  231. .name = "singlestep",
  232. .args_type = "option:s?",
  233. .params = "[on|off]",
  234. .help = "run emulation in singlestep mode or switch to normal mode",
  235. .mhandler.cmd = do_singlestep,
  236. },
  237. STEXI
  238. @item singlestep [off]
  239. @findex singlestep
  240. Run the emulation in single step mode.
  241. If called with option off, the emulation returns to normal mode.
  242. ETEXI
  243. {
  244. .name = "stop",
  245. .args_type = "",
  246. .params = "",
  247. .help = "stop emulation",
  248. .mhandler.cmd = hmp_stop,
  249. },
  250. STEXI
  251. @item stop
  252. @findex stop
  253. Stop emulation.
  254. ETEXI
  255. {
  256. .name = "c|cont",
  257. .args_type = "",
  258. .params = "",
  259. .help = "resume emulation",
  260. .user_print = monitor_user_noop,
  261. .mhandler.cmd_new = do_cont,
  262. },
  263. STEXI
  264. @item c or cont
  265. @findex cont
  266. Resume emulation.
  267. ETEXI
  268. {
  269. .name = "gdbserver",
  270. .args_type = "device:s?",
  271. .params = "[device]",
  272. .help = "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
  273. .mhandler.cmd = do_gdbserver,
  274. },
  275. STEXI
  276. @item gdbserver [@var{port}]
  277. @findex gdbserver
  278. Start gdbserver session (default @var{port}=1234)
  279. ETEXI
  280. {
  281. .name = "x",
  282. .args_type = "fmt:/,addr:l",
  283. .params = "/fmt addr",
  284. .help = "virtual memory dump starting at 'addr'",
  285. .mhandler.cmd = do_memory_dump,
  286. },
  287. STEXI
  288. @item x/fmt @var{addr}
  289. @findex x
  290. Virtual memory dump starting at @var{addr}.
  291. ETEXI
  292. {
  293. .name = "xp",
  294. .args_type = "fmt:/,addr:l",
  295. .params = "/fmt addr",
  296. .help = "physical memory dump starting at 'addr'",
  297. .mhandler.cmd = do_physical_memory_dump,
  298. },
  299. STEXI
  300. @item xp /@var{fmt} @var{addr}
  301. @findex xp
  302. Physical memory dump starting at @var{addr}.
  303. @var{fmt} is a format which tells the command how to format the
  304. data. Its syntax is: @option{/@{count@}@{format@}@{size@}}
  305. @table @var
  306. @item count
  307. is the number of items to be dumped.
  308. @item format
  309. can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
  310. c (char) or i (asm instruction).
  311. @item size
  312. can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
  313. @code{h} or @code{w} can be specified with the @code{i} format to
  314. respectively select 16 or 32 bit code instruction size.
  315. @end table
  316. Examples:
  317. @itemize
  318. @item
  319. Dump 10 instructions at the current instruction pointer:
  320. @example
  321. (qemu) x/10i $eip
  322. 0x90107063: ret
  323. 0x90107064: sti
  324. 0x90107065: lea 0x0(%esi,1),%esi
  325. 0x90107069: lea 0x0(%edi,1),%edi
  326. 0x90107070: ret
  327. 0x90107071: jmp 0x90107080
  328. 0x90107073: nop
  329. 0x90107074: nop
  330. 0x90107075: nop
  331. 0x90107076: nop
  332. @end example
  333. @item
  334. Dump 80 16 bit values at the start of the video memory.
  335. @smallexample
  336. (qemu) xp/80hx 0xb8000
  337. 0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
  338. 0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
  339. 0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
  340. 0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
  341. 0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
  342. 0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
  343. 0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
  344. 0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
  345. 0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
  346. 0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
  347. @end smallexample
  348. @end itemize
  349. ETEXI
  350. {
  351. .name = "p|print",
  352. .args_type = "fmt:/,val:l",
  353. .params = "/fmt expr",
  354. .help = "print expression value (use $reg for CPU register access)",
  355. .mhandler.cmd = do_print,
  356. },
  357. STEXI
  358. @item p or print/@var{fmt} @var{expr}
  359. @findex print
  360. Print expression value. Only the @var{format} part of @var{fmt} is
  361. used.
  362. ETEXI
  363. {
  364. .name = "i",
  365. .args_type = "fmt:/,addr:i,index:i.",
  366. .params = "/fmt addr",
  367. .help = "I/O port read",
  368. .mhandler.cmd = do_ioport_read,
  369. },
  370. STEXI
  371. Read I/O port.
  372. ETEXI
  373. {
  374. .name = "o",
  375. .args_type = "fmt:/,addr:i,val:i",
  376. .params = "/fmt addr value",
  377. .help = "I/O port write",
  378. .mhandler.cmd = do_ioport_write,
  379. },
  380. STEXI
  381. Write to I/O port.
  382. ETEXI
  383. {
  384. .name = "sendkey",
  385. .args_type = "string:s,hold_time:i?",
  386. .params = "keys [hold_ms]",
  387. .help = "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
  388. .mhandler.cmd = do_sendkey,
  389. },
  390. STEXI
  391. @item sendkey @var{keys}
  392. @findex sendkey
  393. Send @var{keys} to the emulator. @var{keys} could be the name of the
  394. key or @code{#} followed by the raw value in either decimal or hexadecimal
  395. format. Use @code{-} to press several keys simultaneously. Example:
  396. @example
  397. sendkey ctrl-alt-f1
  398. @end example
  399. This command is useful to send keys that your graphical user interface
  400. intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
  401. ETEXI
  402. {
  403. .name = "system_reset",
  404. .args_type = "",
  405. .params = "",
  406. .help = "reset the system",
  407. .mhandler.cmd = hmp_system_reset,
  408. },
  409. STEXI
  410. @item system_reset
  411. @findex system_reset
  412. Reset the system.
  413. ETEXI
  414. {
  415. .name = "system_powerdown",
  416. .args_type = "",
  417. .params = "",
  418. .help = "send system power down event",
  419. .mhandler.cmd = hmp_system_powerdown,
  420. },
  421. STEXI
  422. @item system_powerdown
  423. @findex system_powerdown
  424. Power down the system (if supported).
  425. ETEXI
  426. {
  427. .name = "sum",
  428. .args_type = "start:i,size:i",
  429. .params = "addr size",
  430. .help = "compute the checksum of a memory region",
  431. .mhandler.cmd = do_sum,
  432. },
  433. STEXI
  434. @item sum @var{addr} @var{size}
  435. @findex sum
  436. Compute the checksum of a memory region.
  437. ETEXI
  438. {
  439. .name = "usb_add",
  440. .args_type = "devname:s",
  441. .params = "device",
  442. .help = "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')",
  443. .mhandler.cmd = do_usb_add,
  444. },
  445. STEXI
  446. @item usb_add @var{devname}
  447. @findex usb_add
  448. Add the USB device @var{devname}. For details of available devices see
  449. @ref{usb_devices}
  450. ETEXI
  451. {
  452. .name = "usb_del",
  453. .args_type = "devname:s",
  454. .params = "device",
  455. .help = "remove USB device 'bus.addr'",
  456. .mhandler.cmd = do_usb_del,
  457. },
  458. STEXI
  459. @item usb_del @var{devname}
  460. @findex usb_del
  461. Remove the USB device @var{devname} from the QEMU virtual USB
  462. hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor
  463. command @code{info usb} to see the devices you can remove.
  464. ETEXI
  465. {
  466. .name = "device_add",
  467. .args_type = "device:O",
  468. .params = "driver[,prop=value][,...]",
  469. .help = "add device, like -device on the command line",
  470. .user_print = monitor_user_noop,
  471. .mhandler.cmd_new = do_device_add,
  472. },
  473. STEXI
  474. @item device_add @var{config}
  475. @findex device_add
  476. Add device.
  477. ETEXI
  478. {
  479. .name = "device_del",
  480. .args_type = "id:s",
  481. .params = "device",
  482. .help = "remove device",
  483. .user_print = monitor_user_noop,
  484. .mhandler.cmd_new = do_device_del,
  485. },
  486. STEXI
  487. @item device_del @var{id}
  488. @findex device_del
  489. Remove device @var{id}.
  490. ETEXI
  491. {
  492. .name = "cpu",
  493. .args_type = "index:i",
  494. .params = "index",
  495. .help = "set the default CPU",
  496. .mhandler.cmd = hmp_cpu,
  497. },
  498. STEXI
  499. @item cpu @var{index}
  500. @findex cpu
  501. Set the default CPU.
  502. ETEXI
  503. {
  504. .name = "mouse_move",
  505. .args_type = "dx_str:s,dy_str:s,dz_str:s?",
  506. .params = "dx dy [dz]",
  507. .help = "send mouse move events",
  508. .mhandler.cmd = do_mouse_move,
  509. },
  510. STEXI
  511. @item mouse_move @var{dx} @var{dy} [@var{dz}]
  512. @findex mouse_move
  513. Move the active mouse to the specified coordinates @var{dx} @var{dy}
  514. with optional scroll axis @var{dz}.
  515. ETEXI
  516. {
  517. .name = "mouse_button",
  518. .args_type = "button_state:i",
  519. .params = "state",
  520. .help = "change mouse button state (1=L, 2=M, 4=R)",
  521. .mhandler.cmd = do_mouse_button,
  522. },
  523. STEXI
  524. @item mouse_button @var{val}
  525. @findex mouse_button
  526. Change the active mouse button state @var{val} (1=L, 2=M, 4=R).
  527. ETEXI
  528. {
  529. .name = "mouse_set",
  530. .args_type = "index:i",
  531. .params = "index",
  532. .help = "set which mouse device receives events",
  533. .mhandler.cmd = do_mouse_set,
  534. },
  535. STEXI
  536. @item mouse_set @var{index}
  537. @findex mouse_set
  538. Set which mouse device receives events at given @var{index}, index
  539. can be obtained with
  540. @example
  541. info mice
  542. @end example
  543. ETEXI
  544. #ifdef HAS_AUDIO
  545. {
  546. .name = "wavcapture",
  547. .args_type = "path:F,freq:i?,bits:i?,nchannels:i?",
  548. .params = "path [frequency [bits [channels]]]",
  549. .help = "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
  550. .mhandler.cmd = do_wav_capture,
  551. },
  552. #endif
  553. STEXI
  554. @item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]]
  555. @findex wavcapture
  556. Capture audio into @var{filename}. Using sample rate @var{frequency}
  557. bits per sample @var{bits} and number of channels @var{channels}.
  558. Defaults:
  559. @itemize @minus
  560. @item Sample rate = 44100 Hz - CD quality
  561. @item Bits = 16
  562. @item Number of channels = 2 - Stereo
  563. @end itemize
  564. ETEXI
  565. #ifdef HAS_AUDIO
  566. {
  567. .name = "stopcapture",
  568. .args_type = "n:i",
  569. .params = "capture index",
  570. .help = "stop capture",
  571. .mhandler.cmd = do_stop_capture,
  572. },
  573. #endif
  574. STEXI
  575. @item stopcapture @var{index}
  576. @findex stopcapture
  577. Stop capture with a given @var{index}, index can be obtained with
  578. @example
  579. info capture
  580. @end example
  581. ETEXI
  582. {
  583. .name = "memsave",
  584. .args_type = "val:l,size:i,filename:s",
  585. .params = "addr size file",
  586. .help = "save to disk virtual memory dump starting at 'addr' of size 'size'",
  587. .user_print = monitor_user_noop,
  588. .mhandler.cmd_new = do_memory_save,
  589. },
  590. STEXI
  591. @item memsave @var{addr} @var{size} @var{file}
  592. @findex memsave
  593. save to disk virtual memory dump starting at @var{addr} of size @var{size}.
  594. ETEXI
  595. {
  596. .name = "pmemsave",
  597. .args_type = "val:l,size:i,filename:s",
  598. .params = "addr size file",
  599. .help = "save to disk physical memory dump starting at 'addr' of size 'size'",
  600. .user_print = monitor_user_noop,
  601. .mhandler.cmd_new = do_physical_memory_save,
  602. },
  603. STEXI
  604. @item pmemsave @var{addr} @var{size} @var{file}
  605. @findex pmemsave
  606. save to disk physical memory dump starting at @var{addr} of size @var{size}.
  607. ETEXI
  608. {
  609. .name = "boot_set",
  610. .args_type = "bootdevice:s",
  611. .params = "bootdevice",
  612. .help = "define new values for the boot device list",
  613. .mhandler.cmd = do_boot_set,
  614. },
  615. STEXI
  616. @item boot_set @var{bootdevicelist}
  617. @findex boot_set
  618. Define new values for the boot device list. Those values will override
  619. the values specified on the command line through the @code{-boot} option.
  620. The values that can be specified here depend on the machine type, but are
  621. the same that can be specified in the @code{-boot} command line option.
  622. ETEXI
  623. #if defined(TARGET_I386)
  624. {
  625. .name = "nmi",
  626. .args_type = "",
  627. .params = "",
  628. .help = "inject an NMI on all guest's CPUs",
  629. .user_print = monitor_user_noop,
  630. .mhandler.cmd_new = do_inject_nmi,
  631. },
  632. #endif
  633. STEXI
  634. @item nmi @var{cpu}
  635. @findex nmi
  636. Inject an NMI on the given CPU (x86 only).
  637. ETEXI
  638. {
  639. .name = "migrate",
  640. .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
  641. .params = "[-d] [-b] [-i] uri",
  642. .help = "migrate to URI (using -d to not wait for completion)"
  643. "\n\t\t\t -b for migration without shared storage with"
  644. " full copy of disk\n\t\t\t -i for migration without "
  645. "shared storage with incremental copy of disk "
  646. "(base image shared between src and destination)",
  647. .user_print = monitor_user_noop,
  648. .mhandler.cmd_new = do_migrate,
  649. },
  650. STEXI
  651. @item migrate [-d] [-b] [-i] @var{uri}
  652. @findex migrate
  653. Migrate to @var{uri} (using -d to not wait for completion).
  654. -b for migration with full copy of disk
  655. -i for migration with incremental copy of disk (base image is shared)
  656. ETEXI
  657. {
  658. .name = "migrate_cancel",
  659. .args_type = "",
  660. .params = "",
  661. .help = "cancel the current VM migration",
  662. .user_print = monitor_user_noop,
  663. .mhandler.cmd_new = do_migrate_cancel,
  664. },
  665. STEXI
  666. @item migrate_cancel
  667. @findex migrate_cancel
  668. Cancel the current VM migration.
  669. ETEXI
  670. {
  671. .name = "migrate_set_speed",
  672. .args_type = "value:o",
  673. .params = "value",
  674. .help = "set maximum speed (in bytes) for migrations. "
  675. "Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
  676. .user_print = monitor_user_noop,
  677. .mhandler.cmd_new = do_migrate_set_speed,
  678. },
  679. STEXI
  680. @item migrate_set_speed @var{value}
  681. @findex migrate_set_speed
  682. Set maximum speed to @var{value} (in bytes) for migrations.
  683. ETEXI
  684. {
  685. .name = "migrate_set_downtime",
  686. .args_type = "value:T",
  687. .params = "value",
  688. .help = "set maximum tolerated downtime (in seconds) for migrations",
  689. .user_print = monitor_user_noop,
  690. .mhandler.cmd_new = do_migrate_set_downtime,
  691. },
  692. STEXI
  693. @item migrate_set_downtime @var{second}
  694. @findex migrate_set_downtime
  695. Set maximum tolerated downtime (in seconds) for migration.
  696. ETEXI
  697. {
  698. .name = "client_migrate_info",
  699. .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
  700. .params = "protocol hostname port tls-port cert-subject",
  701. .help = "send migration info to spice/vnc client",
  702. .user_print = monitor_user_noop,
  703. .mhandler.cmd_async = client_migrate_info,
  704. .flags = MONITOR_CMD_ASYNC,
  705. },
  706. STEXI
  707. @item client_migrate_info @var{protocol} @var{hostname} @var{port} @var{tls-port} @var{cert-subject}
  708. @findex client_migrate_info
  709. Set the spice/vnc connection info for the migration target. The spice/vnc
  710. server will ask the spice/vnc client to automatically reconnect using the
  711. new parameters (if specified) once the vm migration finished successfully.
  712. ETEXI
  713. {
  714. .name = "snapshot_blkdev",
  715. .args_type = "device:B,snapshot-file:s?,format:s?",
  716. .params = "device [new-image-file] [format]",
  717. .help = "initiates a live snapshot\n\t\t\t"
  718. "of device. If a new image file is specified, the\n\t\t\t"
  719. "new image file will become the new root image.\n\t\t\t"
  720. "If format is specified, the snapshot file will\n\t\t\t"
  721. "be created in that format. Otherwise the\n\t\t\t"
  722. "snapshot will be internal! (currently unsupported)",
  723. .mhandler.cmd_new = do_snapshot_blkdev,
  724. },
  725. STEXI
  726. @item snapshot_blkdev
  727. @findex snapshot_blkdev
  728. Snapshot device, using snapshot file as target if provided
  729. ETEXI
  730. #if defined(TARGET_I386)
  731. {
  732. .name = "drive_add",
  733. .args_type = "pci_addr:s,opts:s",
  734. .params = "[[<domain>:]<bus>:]<slot>\n"
  735. "[file=file][,if=type][,bus=n]\n"
  736. "[,unit=m][,media=d][index=i]\n"
  737. "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
  738. "[snapshot=on|off][,cache=on|off]",
  739. .help = "add drive to PCI storage controller",
  740. .mhandler.cmd = drive_hot_add,
  741. },
  742. #endif
  743. STEXI
  744. @item drive_add
  745. @findex drive_add
  746. Add drive to PCI storage controller.
  747. ETEXI
  748. #if defined(TARGET_I386)
  749. {
  750. .name = "pci_add",
  751. .args_type = "pci_addr:s,type:s,opts:s?",
  752. .params = "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
  753. .help = "hot-add PCI device",
  754. .mhandler.cmd = pci_device_hot_add,
  755. },
  756. #endif
  757. STEXI
  758. @item pci_add
  759. @findex pci_add
  760. Hot-add PCI device.
  761. ETEXI
  762. #if defined(TARGET_I386)
  763. {
  764. .name = "pci_del",
  765. .args_type = "pci_addr:s",
  766. .params = "[[<domain>:]<bus>:]<slot>",
  767. .help = "hot remove PCI device",
  768. .mhandler.cmd = do_pci_device_hot_remove,
  769. },
  770. #endif
  771. STEXI
  772. @item pci_del
  773. @findex pci_del
  774. Hot remove PCI device.
  775. ETEXI
  776. {
  777. .name = "pcie_aer_inject_error",
  778. .args_type = "advisory_non_fatal:-a,correctable:-c,"
  779. "id:s,error_status:s,"
  780. "header0:i?,header1:i?,header2:i?,header3:i?,"
  781. "prefix0:i?,prefix1:i?,prefix2:i?,prefix3:i?",
  782. .params = "[-a] [-c] id "
  783. "<error_status> [<tlp header> [<tlp header prefix>]]",
  784. .help = "inject pcie aer error\n\t\t\t"
  785. " -a for advisory non fatal error\n\t\t\t"
  786. " -c for correctable error\n\t\t\t"
  787. "<id> = qdev device id\n\t\t\t"
  788. "<error_status> = error string or 32bit\n\t\t\t"
  789. "<tlb header> = 32bit x 4\n\t\t\t"
  790. "<tlb header prefix> = 32bit x 4",
  791. .user_print = pcie_aer_inject_error_print,
  792. .mhandler.cmd_new = do_pcie_aer_inejct_error,
  793. },
  794. STEXI
  795. @item pcie_aer_inject_error
  796. @findex pcie_aer_inject_error
  797. Inject PCIe AER error
  798. ETEXI
  799. {
  800. .name = "host_net_add",
  801. .args_type = "device:s,opts:s?",
  802. .params = "tap|user|socket|vde|dump [options]",
  803. .help = "add host VLAN client",
  804. .mhandler.cmd = net_host_device_add,
  805. },
  806. STEXI
  807. @item host_net_add
  808. @findex host_net_add
  809. Add host VLAN client.
  810. ETEXI
  811. {
  812. .name = "host_net_remove",
  813. .args_type = "vlan_id:i,device:s",
  814. .params = "vlan_id name",
  815. .help = "remove host VLAN client",
  816. .mhandler.cmd = net_host_device_remove,
  817. },
  818. STEXI
  819. @item host_net_remove
  820. @findex host_net_remove
  821. Remove host VLAN client.
  822. ETEXI
  823. {
  824. .name = "netdev_add",
  825. .args_type = "netdev:O",
  826. .params = "[user|tap|socket],id=str[,prop=value][,...]",
  827. .help = "add host network device",
  828. .user_print = monitor_user_noop,
  829. .mhandler.cmd_new = do_netdev_add,
  830. },
  831. STEXI
  832. @item netdev_add
  833. @findex netdev_add
  834. Add host network device.
  835. ETEXI
  836. {
  837. .name = "netdev_del",
  838. .args_type = "id:s",
  839. .params = "id",
  840. .help = "remove host network device",
  841. .user_print = monitor_user_noop,
  842. .mhandler.cmd_new = do_netdev_del,
  843. },
  844. STEXI
  845. @item netdev_del
  846. @findex netdev_del
  847. Remove host network device.
  848. ETEXI
  849. #ifdef CONFIG_SLIRP
  850. {
  851. .name = "hostfwd_add",
  852. .args_type = "arg1:s,arg2:s?,arg3:s?",
  853. .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
  854. .help = "redirect TCP or UDP connections from host to guest (requires -net user)",
  855. .mhandler.cmd = net_slirp_hostfwd_add,
  856. },
  857. #endif
  858. STEXI
  859. @item hostfwd_add
  860. @findex hostfwd_add
  861. Redirect TCP or UDP connections from host to guest (requires -net user).
  862. ETEXI
  863. #ifdef CONFIG_SLIRP
  864. {
  865. .name = "hostfwd_remove",
  866. .args_type = "arg1:s,arg2:s?,arg3:s?",
  867. .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
  868. .help = "remove host-to-guest TCP or UDP redirection",
  869. .mhandler.cmd = net_slirp_hostfwd_remove,
  870. },
  871. #endif
  872. STEXI
  873. @item hostfwd_remove
  874. @findex hostfwd_remove
  875. Remove host-to-guest TCP or UDP redirection.
  876. ETEXI
  877. {
  878. .name = "balloon",
  879. .args_type = "value:M",
  880. .params = "target",
  881. .help = "request VM to change its memory allocation (in MB)",
  882. .user_print = monitor_user_noop,
  883. .mhandler.cmd_async = do_balloon,
  884. .flags = MONITOR_CMD_ASYNC,
  885. },
  886. STEXI
  887. @item balloon @var{value}
  888. @findex balloon
  889. Request VM to change its memory allocation to @var{value} (in MB).
  890. ETEXI
  891. {
  892. .name = "set_link",
  893. .args_type = "name:s,up:b",
  894. .params = "name on|off",
  895. .help = "change the link status of a network adapter",
  896. .user_print = monitor_user_noop,
  897. .mhandler.cmd_new = do_set_link,
  898. },
  899. STEXI
  900. @item set_link @var{name} [on|off]
  901. @findex set_link
  902. Switch link @var{name} on (i.e. up) or off (i.e. down).
  903. ETEXI
  904. {
  905. .name = "watchdog_action",
  906. .args_type = "action:s",
  907. .params = "[reset|shutdown|poweroff|pause|debug|none]",
  908. .help = "change watchdog action",
  909. .mhandler.cmd = do_watchdog_action,
  910. },
  911. STEXI
  912. @item watchdog_action
  913. @findex watchdog_action
  914. Change watchdog action.
  915. ETEXI
  916. {
  917. .name = "acl_show",
  918. .args_type = "aclname:s",
  919. .params = "aclname",
  920. .help = "list rules in the access control list",
  921. .mhandler.cmd = do_acl_show,
  922. },
  923. STEXI
  924. @item acl_show @var{aclname}
  925. @findex acl_show
  926. List all the matching rules in the access control list, and the default
  927. policy. There are currently two named access control lists,
  928. @var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
  929. certificate distinguished name, and SASL username respectively.
  930. ETEXI
  931. {
  932. .name = "acl_policy",
  933. .args_type = "aclname:s,policy:s",
  934. .params = "aclname allow|deny",
  935. .help = "set default access control list policy",
  936. .mhandler.cmd = do_acl_policy,
  937. },
  938. STEXI
  939. @item acl_policy @var{aclname} @code{allow|deny}
  940. @findex acl_policy
  941. Set the default access control list policy, used in the event that
  942. none of the explicit rules match. The default policy at startup is
  943. always @code{deny}.
  944. ETEXI
  945. {
  946. .name = "acl_add",
  947. .args_type = "aclname:s,match:s,policy:s,index:i?",
  948. .params = "aclname match allow|deny [index]",
  949. .help = "add a match rule to the access control list",
  950. .mhandler.cmd = do_acl_add,
  951. },
  952. STEXI
  953. @item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}]
  954. @findex acl_add
  955. Add a match rule to the access control list, allowing or denying access.
  956. The match will normally be an exact username or x509 distinguished name,
  957. but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
  958. allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
  959. normally be appended to the end of the ACL, but can be inserted
  960. earlier in the list if the optional @var{index} parameter is supplied.
  961. ETEXI
  962. {
  963. .name = "acl_remove",
  964. .args_type = "aclname:s,match:s",
  965. .params = "aclname match",
  966. .help = "remove a match rule from the access control list",
  967. .mhandler.cmd = do_acl_remove,
  968. },
  969. STEXI
  970. @item acl_remove @var{aclname} @var{match}
  971. @findex acl_remove
  972. Remove the specified match rule from the access control list.
  973. ETEXI
  974. {
  975. .name = "acl_reset",
  976. .args_type = "aclname:s",
  977. .params = "aclname",
  978. .help = "reset the access control list",
  979. .mhandler.cmd = do_acl_reset,
  980. },
  981. STEXI
  982. @item acl_reset @var{aclname}
  983. @findex acl_reset
  984. Remove all matches from the access control list, and set the default
  985. policy back to @code{deny}.
  986. ETEXI
  987. #if defined(TARGET_I386)
  988. {
  989. .name = "mce",
  990. .args_type = "broadcast:-b,cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
  991. .params = "[-b] cpu bank status mcgstatus addr misc",
  992. .help = "inject a MCE on the given CPU [and broadcast to other CPUs with -b option]",
  993. .mhandler.cmd = do_inject_mce,
  994. },
  995. #endif
  996. STEXI
  997. @item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
  998. @findex mce (x86)
  999. Inject an MCE on the given CPU (x86 only).
  1000. ETEXI
  1001. {
  1002. .name = "getfd",
  1003. .args_type = "fdname:s",
  1004. .params = "getfd name",
  1005. .help = "receive a file descriptor via SCM rights and assign it a name",
  1006. .user_print = monitor_user_noop,
  1007. .mhandler.cmd_new = do_getfd,
  1008. },
  1009. STEXI
  1010. @item getfd @var{fdname}
  1011. @findex getfd
  1012. If a file descriptor is passed alongside this command using the SCM_RIGHTS
  1013. mechanism on unix sockets, it is stored using the name @var{fdname} for
  1014. later use by other monitor commands.
  1015. ETEXI
  1016. {
  1017. .name = "closefd",
  1018. .args_type = "fdname:s",
  1019. .params = "closefd name",
  1020. .help = "close a file descriptor previously passed via SCM rights",
  1021. .user_print = monitor_user_noop,
  1022. .mhandler.cmd_new = do_closefd,
  1023. },
  1024. STEXI
  1025. @item closefd @var{fdname}
  1026. @findex closefd
  1027. Close the file descriptor previously assigned to @var{fdname} using the
  1028. @code{getfd} command. This is only needed if the file descriptor was never
  1029. used by another monitor command.
  1030. ETEXI
  1031. {
  1032. .name = "block_passwd",
  1033. .args_type = "device:B,password:s",
  1034. .params = "block_passwd device password",
  1035. .help = "set the password of encrypted block devices",
  1036. .user_print = monitor_user_noop,
  1037. .mhandler.cmd_new = do_block_set_passwd,
  1038. },
  1039. STEXI
  1040. @item block_passwd @var{device} @var{password}
  1041. @findex block_passwd
  1042. Set the encrypted device @var{device} password to @var{password}
  1043. ETEXI
  1044. {
  1045. .name = "set_password",
  1046. .args_type = "protocol:s,password:s,connected:s?",
  1047. .params = "protocol password action-if-connected",
  1048. .help = "set spice/vnc password",
  1049. .user_print = monitor_user_noop,
  1050. .mhandler.cmd_new = set_password,
  1051. },
  1052. STEXI
  1053. @item set_password [ vnc | spice ] password [ action-if-connected ]
  1054. @findex set_password
  1055. Change spice/vnc password. Use zero to make the password stay valid
  1056. forever. @var{action-if-connected} specifies what should happen in
  1057. case a connection is established: @var{fail} makes the password change
  1058. fail. @var{disconnect} changes the password and disconnects the
  1059. client. @var{keep} changes the password and keeps the connection up.
  1060. @var{keep} is the default.
  1061. ETEXI
  1062. {
  1063. .name = "expire_password",
  1064. .args_type = "protocol:s,time:s",
  1065. .params = "protocol time",
  1066. .help = "set spice/vnc password expire-time",
  1067. .user_print = monitor_user_noop,
  1068. .mhandler.cmd_new = expire_password,
  1069. },
  1070. STEXI
  1071. @item expire_password [ vnc | spice ] expire-time
  1072. @findex expire_password
  1073. Specify when a password for spice/vnc becomes
  1074. invalid. @var{expire-time} accepts:
  1075. @table @var
  1076. @item now
  1077. Invalidate password instantly.
  1078. @item never
  1079. Password stays valid forever.
  1080. @item +nsec
  1081. Password stays valid for @var{nsec} seconds starting now.
  1082. @item nsec
  1083. Password is invalidated at the given time. @var{nsec} are the seconds
  1084. passed since 1970, i.e. unix epoch.
  1085. @end table
  1086. ETEXI
  1087. {
  1088. .name = "info",
  1089. .args_type = "item:s?",
  1090. .params = "[subcommand]",
  1091. .help = "show various information about the system state",
  1092. .mhandler.cmd = do_info,
  1093. },
  1094. STEXI
  1095. @item info @var{subcommand}
  1096. @findex info
  1097. Show various information about the system state.
  1098. @table @option
  1099. @item info version
  1100. show the version of QEMU
  1101. @item info network
  1102. show the various VLANs and the associated devices
  1103. @item info chardev
  1104. show the character devices
  1105. @item info block
  1106. show the block devices
  1107. @item info blockstats
  1108. show block device statistics
  1109. @item info registers
  1110. show the cpu registers
  1111. @item info cpus
  1112. show infos for each CPU
  1113. @item info history
  1114. show the command line history
  1115. @item info irq
  1116. show the interrupts statistics (if available)
  1117. @item info pic
  1118. show i8259 (PIC) state
  1119. @item info pci
  1120. show emulated PCI device info
  1121. @item info tlb
  1122. show virtual to physical memory mappings (i386, SH4, SPARC, and PPC only)
  1123. @item info mem
  1124. show the active virtual memory mappings (i386 only)
  1125. @item info jit
  1126. show dynamic compiler info
  1127. @item info numa
  1128. show NUMA information
  1129. @item info kvm
  1130. show KVM information
  1131. @item info usb
  1132. show USB devices plugged on the virtual USB hub
  1133. @item info usbhost
  1134. show all USB host devices
  1135. @item info profile
  1136. show profiling information
  1137. @item info capture
  1138. show information about active capturing
  1139. @item info snapshots
  1140. show list of VM snapshots
  1141. @item info status
  1142. show the current VM status (running|paused)
  1143. @item info pcmcia
  1144. show guest PCMCIA status
  1145. @item info mice
  1146. show which guest mouse is receiving events
  1147. @item info vnc
  1148. show the vnc server status
  1149. @item info name
  1150. show the current VM name
  1151. @item info uuid
  1152. show the current VM UUID
  1153. @item info cpustats
  1154. show CPU statistics
  1155. @item info usernet
  1156. show user network stack connection states
  1157. @item info migrate
  1158. show migration status
  1159. @item info balloon
  1160. show balloon information
  1161. @item info qtree
  1162. show device tree
  1163. @item info qdm
  1164. show qdev device model list
  1165. @item info roms
  1166. show roms
  1167. @end table
  1168. ETEXI
  1169. #ifdef CONFIG_TRACE_SIMPLE
  1170. STEXI
  1171. @item info trace
  1172. show contents of trace buffer
  1173. ETEXI
  1174. #endif
  1175. STEXI
  1176. @item info trace-events
  1177. show available trace events and their state
  1178. ETEXI
  1179. STEXI
  1180. @end table
  1181. ETEXI