debugcon: support for debugging consoles (e.g. Bochs port 0xe9)

Add generic support for debugging consoles (simple I/O ports which
when written to cause debugging output to be written to a target.)
The current implementation matches Bochs' port 0xe9, allowing the same
debugging code to be used for both Bochs and Qemu.

There is no vm state associated with the debugging port, simply
because it has none -- the entire interface is a single, stateless,
write-only port.

Most of the code was cribbed from the serial port driver.

v2: removed non-ISA variants (they can be introduced when/if someone
wants them, using code from the serial port); added configurable
readback (Bochs returns 0xe9 on a read from this register, mimic that
by default)  This retains the apparently somewhat controversial user
friendly option, however.

v3: reimplemented the user friendly option as a synthetic option
("-debugcon foo" basically ends up being a parser-level shorthand for
"-chardev stdio,id=debugcon -device isa-debugcon,chardev=debugcon") --
this dramatically reduced the complexity while keeping the same level
of user friendliness.

v4: spaces, not tabs.

v5: update to match current top of tree.  Calling qemu_chr_open()
already during parsing no longer works; defer until we are parsing the
other console-like devices.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
4 files changed
tree: b88cd717c42f798322adab83febcb84722640e6d
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. default-configs/
  6. fpu/
  7. gdb-xml/
  8. hw/
  9. linux-user/
  10. net/
  11. pc-bios/
  12. QMP/
  13. roms/
  14. slirp/
  15. target-alpha/
  16. target-arm/
  17. target-cris/
  18. target-i386/
  19. target-m68k/
  20. target-microblaze/
  21. target-mips/
  22. target-ppc/
  23. target-s390x/
  24. target-sh4/
  25. target-sparc/
  26. tcg/
  27. tests/
  28. .gitignore
  29. .gitmodules
  30. a.out.h
  31. acl.c
  32. acl.h
  33. aes.c
  34. aes.h
  35. aio.c
  36. alpha-dis.c
  37. alpha.ld
  38. arm-dis.c
  39. arm-semi.c
  40. arm.ld
  41. async.c
  42. balloon.h
  43. block-migration.c
  44. block-migration.h
  45. block.c
  46. block.h
  47. block_int.h
  48. bswap.h
  49. bt-host.c
  50. bt-host.h
  51. bt-vhci.c
  52. buffered_file.c
  53. buffered_file.h
  54. cache-utils.c
  55. cache-utils.h
  56. Changelog
  57. check-qdict.c
  58. check-qfloat.c
  59. check-qint.c
  60. check-qjson.c
  61. check-qlist.c
  62. check-qstring.c
  63. cmd.c
  64. cmd.h
  65. cocoa.m
  66. CODING_STYLE
  67. config.h
  68. configure
  69. console.c
  70. console.h
  71. COPYING
  72. COPYING.LIB
  73. cpu-all.h
  74. cpu-common.h
  75. cpu-defs.h
  76. cpu-exec.c
  77. create_config
  78. cris-dis.c
  79. curses.c
  80. curses_keys.h
  81. cutils.c
  82. d3des.c
  83. d3des.h
  84. def-helper.h
  85. device_tree.c
  86. device_tree.h
  87. dis-asm.h
  88. disas.c
  89. disas.h
  90. dma-helpers.c
  91. dma.h
  92. dyngen-exec.h
  93. elf.h
  94. envlist.c
  95. envlist.h
  96. exec-all.h
  97. exec.c
  98. feature_to_c.sh
  99. gdbstub.c
  100. gdbstub.h
  101. gen-icount.h
  102. host-utils.c
  103. host-utils.h
  104. hostregs_helper.h
  105. hpet.h
  106. hppa-dis.c
  107. hppa.ld
  108. hxtool
  109. i386-dis.c
  110. i386.ld
  111. ia64.ld
  112. ioport-user.c
  113. ioport.c
  114. ioport.h
  115. json-lexer.c
  116. json-lexer.h
  117. json-parser.c
  118. json-parser.h
  119. json-streamer.c
  120. json-streamer.h
  121. keymaps.c
  122. keymaps.h
  123. kvm-all.c
  124. kvm.h
  125. libfdt_env.h
  126. LICENSE
  127. linux-aio.c
  128. m68k-dis.c
  129. m68k-semi.c
  130. m68k.ld
  131. MAINTAINERS
  132. Makefile
  133. Makefile.hw
  134. Makefile.objs
  135. Makefile.target
  136. Makefile.user
  137. microblaze-dis.c
  138. migration-exec.c
  139. migration-fd.c
  140. migration-tcp.c
  141. migration-unix.c
  142. migration.c
  143. migration.h
  144. mips-dis.c
  145. mips.ld
  146. module.c
  147. module.h
  148. monitor.c
  149. monitor.h
  150. nbd.c
  151. nbd.h
  152. net-checksum.c
  153. net.c
  154. net.h
  155. osdep.c
  156. osdep.h
  157. path.c
  158. pci-ids.txt
  159. posix-aio-compat.c
  160. ppc-dis.c
  161. ppc.ld
  162. ppc64.ld
  163. qbool.c
  164. qbool.h
  165. qdict-test-data.txt
  166. qdict.c
  167. qdict.h
  168. qemu-aio.h
  169. qemu-binfmt-conf.sh
  170. qemu-char.c
  171. qemu-char.h
  172. qemu-common.h
  173. qemu-config.c
  174. qemu-config.h
  175. qemu-doc.texi
  176. qemu-img-cmds.hx
  177. qemu-img.c
  178. qemu-img.texi
  179. qemu-io.c
  180. qemu-lock.h
  181. qemu-log.h
  182. qemu-malloc.c
  183. qemu-monitor.hx
  184. qemu-nbd.c
  185. qemu-nbd.texi
  186. qemu-objects.h
  187. qemu-option.c
  188. qemu-option.h
  189. qemu-options.hx
  190. qemu-queue.h
  191. qemu-sockets.c
  192. qemu-tech.texi
  193. qemu-thread.c
  194. qemu-thread.h
  195. qemu-timer.h
  196. qemu-tool.c
  197. qemu.sasl
  198. qemu_socket.h
  199. qerror.c
  200. qerror.h
  201. qfloat.c
  202. qfloat.h
  203. qint.c
  204. qint.h
  205. qjson.c
  206. qjson.h
  207. qlist.c
  208. qlist.h
  209. qobject.h
  210. qstring.c
  211. qstring.h
  212. readline.c
  213. readline.h
  214. README
  215. rules.mak
  216. s390-dis.c
  217. s390.ld
  218. savevm.c
  219. sdl.c
  220. sdl_keysym.h
  221. sdl_zoom.c
  222. sdl_zoom.h
  223. sdl_zoom_template.h
  224. sh4-dis.c
  225. softmmu-semi.h
  226. softmmu_defs.h
  227. softmmu_exec.h
  228. softmmu_header.h
  229. softmmu_template.h
  230. sparc-dis.c
  231. sparc.ld
  232. sparc64.ld
  233. sysemu.h
  234. targphys.h
  235. tcg-runtime.c
  236. texi2pod.pl
  237. thunk.c
  238. thunk.h
  239. TODO
  240. translate-all.c
  241. uboot_image.h
  242. usb-bsd.c
  243. usb-linux.c
  244. usb-stub.c
  245. VERSION
  246. vgafont.h
  247. vl.c
  248. vnc-auth-sasl.c
  249. vnc-auth-sasl.h
  250. vnc-auth-vencrypt.c
  251. vnc-auth-vencrypt.h
  252. vnc-tls.c
  253. vnc-tls.h
  254. vnc.c
  255. vnc.h
  256. vnc_keysym.h
  257. vnchextile.h
  258. x86_64.ld
  259. x_keymap.c
  260. x_keymap.h