pc: Fix CMOS info for drives defined with -device

Drives defined with -drive if=ide get get created along with the IDE
controller, inside machine->init().  That's before cmos_init().
Drives defined with -device get created during generic device init.
That's after cmos_init().  Because of that, CMOS has no information on
them (type, geometry, translation).  Older versions of Windows such as
XP reportedly choke on that.

Split off the part of CMOS initialization that needs to know about
-device devices, and turn it into a reset handler, so it runs after
device creation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit c0897e0cb94e83ec1098867b81870e4f51f225b9)
3 files changed
tree: 3f6c7cf61f7d1ffadd2333fbada631956e601a9c
  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.target
  135. Makefile.user
  136. microblaze-dis.c
  137. migration-exec.c
  138. migration-fd.c
  139. migration-tcp.c
  140. migration-unix.c
  141. migration.c
  142. migration.h
  143. mips-dis.c
  144. mips.ld
  145. module.c
  146. module.h
  147. monitor.c
  148. monitor.h
  149. nbd.c
  150. nbd.h
  151. net-checksum.c
  152. net.c
  153. net.h
  154. osdep.c
  155. osdep.h
  156. path.c
  157. pci-ids.txt
  158. posix-aio-compat.c
  159. ppc-dis.c
  160. ppc.ld
  161. ppc64.ld
  162. qbool.c
  163. qbool.h
  164. qdict-test-data.txt
  165. qdict.c
  166. qdict.h
  167. qemu-aio.h
  168. qemu-binfmt-conf.sh
  169. qemu-char.c
  170. qemu-char.h
  171. qemu-common.h
  172. qemu-config.c
  173. qemu-config.h
  174. qemu-doc.texi
  175. qemu-img-cmds.hx
  176. qemu-img.c
  177. qemu-img.texi
  178. qemu-io.c
  179. qemu-lock.h
  180. qemu-log.h
  181. qemu-malloc.c
  182. qemu-monitor.hx
  183. qemu-nbd.c
  184. qemu-nbd.texi
  185. qemu-objects.h
  186. qemu-option.c
  187. qemu-option.h
  188. qemu-options.hx
  189. qemu-queue.h
  190. qemu-sockets.c
  191. qemu-tech.texi
  192. qemu-thread.c
  193. qemu-thread.h
  194. qemu-timer.h
  195. qemu-tool.c
  196. qemu.sasl
  197. qemu_socket.h
  198. qerror.c
  199. qerror.h
  200. qfloat.c
  201. qfloat.h
  202. qint.c
  203. qint.h
  204. qjson.c
  205. qjson.h
  206. qlist.c
  207. qlist.h
  208. qobject.h
  209. qstring.c
  210. qstring.h
  211. readline.c
  212. readline.h
  213. README
  214. rules.mak
  215. s390-dis.c
  216. s390.ld
  217. savevm.c
  218. sdl.c
  219. sdl_keysym.h
  220. sdl_zoom.c
  221. sdl_zoom.h
  222. sdl_zoom_template.h
  223. sh4-dis.c
  224. softmmu-semi.h
  225. softmmu_defs.h
  226. softmmu_exec.h
  227. softmmu_header.h
  228. softmmu_template.h
  229. sparc-dis.c
  230. sparc.ld
  231. sparc64.ld
  232. sysemu.h
  233. targphys.h
  234. tcg-runtime.c
  235. texi2pod.pl
  236. thunk.c
  237. thunk.h
  238. TODO
  239. translate-all.c
  240. uboot_image.h
  241. usb-bsd.c
  242. usb-linux.c
  243. usb-stub.c
  244. VERSION
  245. vgafont.h
  246. vl.c
  247. vnc-auth-sasl.c
  248. vnc-auth-sasl.h
  249. vnc-auth-vencrypt.c
  250. vnc-auth-vencrypt.h
  251. vnc-tls.c
  252. vnc-tls.h
  253. vnc.c
  254. vnc.h
  255. vnc_keysym.h
  256. vnchextile.h
  257. x86_64.ld
  258. x_keymap.c
  259. x_keymap.h