virtio-serial-bus: post_load send_event when vm is running

Alexander Larsson found irq injection to Windows guests stopped after a
migration.  The symptom was the mouse stopped working.

Reproduction steps are:
1. On src, start qemu with a virtio-serial port without any backend
2. On dest, start qemu with a virtio-serial port with a backend
3. Migrate.

Upon migration, the older code detected the change in backend connection
status, and sent a notification to the guest.  However, it's not
guaranteed that the apic is ready to inject irqs into the guest, and the
irq line remained high, resulting in any future interrupts going
unnoticed by the guest as well.

Add a new timer based on vm_clock for 1 ns in the future from post_load
to do the event send in case host_connected differs between migration
source and target.

RHBZ: 867366

Signed-off-by: Alon Levy <alevy@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com> # verbose commit log
1 file changed
tree: a2cc2fdb3bfd4f1654ad781fcafcd1013fd7c2db
  1. .exrc
  2. .gitignore
  3. .gitmodules
  4. .mailmap
  5. CODING_STYLE
  6. COPYING
  7. COPYING.LIB
  8. Changelog
  9. HACKING
  10. LICENSE
  11. MAINTAINERS
  12. Makefile
  13. Makefile.dis
  14. Makefile.objs
  15. Makefile.target
  16. Makefile.user
  17. QMP/
  18. README
  19. TODO
  20. VERSION
  21. a.out.h
  22. acl.c
  23. acl.h
  24. aes.c
  25. aes.h
  26. aio-posix.c
  27. aio-win32.c
  28. alpha-dis.c
  29. alpha.ld
  30. arch_init.c
  31. arch_init.h
  32. arm-dis.c
  33. arm.ld
  34. async.c
  35. audio/
  36. balloon.c
  37. balloon.h
  38. bitmap.c
  39. bitmap.h
  40. bitops.c
  41. bitops.h
  42. block-migration.c
  43. block-migration.h
  44. block.c
  45. block.h
  46. block/
  47. block_int.h
  48. blockdev-nbd.c
  49. blockdev.c
  50. blockdev.h
  51. blockjob.c
  52. blockjob.h
  53. bsd-user/
  54. bswap.h
  55. bt-host.c
  56. bt-host.h
  57. bt-vhci.c
  58. buffered_file.c
  59. buffered_file.h
  60. cache-utils.c
  61. cache-utils.h
  62. cmd.c
  63. cmd.h
  64. compatfd.c
  65. compatfd.h
  66. compiler.h
  67. config.h
  68. configure
  69. console.c
  70. console.h
  71. coroutine-gthread.c
  72. coroutine-sigaltstack.c
  73. coroutine-ucontext.c
  74. coroutine-win32.c
  75. cpu-all.h
  76. cpu-common.h
  77. cpu-defs.h
  78. cpu-exec.c
  79. cpus.c
  80. cpus.h
  81. cputlb.c
  82. cputlb.h
  83. cris-dis.c
  84. cursor.c
  85. cursor_hidden.xpm
  86. cursor_left_ptr.xpm
  87. cutils.c
  88. def-helper.h
  89. default-configs/
  90. device_tree.c
  91. device_tree.h
  92. dis-asm.h
  93. disas.c
  94. disas.h
  95. dma-helpers.c
  96. dma.h
  97. docs/
  98. dump-stub.c
  99. dump.c
  100. dump.h
  101. elf.h
  102. envlist.c
  103. envlist.h
  104. error.c
  105. error.h
  106. event_notifier-posix.c
  107. event_notifier-win32.c
  108. event_notifier.h
  109. exec-all.h
  110. exec-memory.h
  111. exec.c
  112. fpu/
  113. fsdev/
  114. gdb-xml/
  115. gdbstub.c
  116. gdbstub.h
  117. gen-icount.h
  118. hmp-commands.hx
  119. hmp.c
  120. hmp.h
  121. host-utils.c
  122. host-utils.h
  123. hppa-dis.c
  124. hppa.ld
  125. hw/
  126. hwaddr.h
  127. i386-dis.c
  128. i386.ld
  129. ia64-dis.c
  130. ia64.ld
  131. include/
  132. input.c
  133. int128.h
  134. iohandler.c
  135. ioport.c
  136. ioport.h
  137. iorange.h
  138. iov.c
  139. iov.h
  140. json-lexer.c
  141. json-lexer.h
  142. json-parser.c
  143. json-parser.h
  144. json-streamer.c
  145. json-streamer.h
  146. kvm-all.c
  147. kvm-stub.c
  148. kvm.h
  149. libcacard/
  150. libfdt_env.h
  151. linux-headers/
  152. linux-user/
  153. lm32-dis.c
  154. m68k-dis.c
  155. m68k.ld
  156. main-loop.c
  157. main-loop.h
  158. memory-internal.h
  159. memory.c
  160. memory.h
  161. memory_mapping-stub.c
  162. memory_mapping.c
  163. memory_mapping.h
  164. microblaze-dis.c
  165. migration-exec.c
  166. migration-fd.c
  167. migration-tcp.c
  168. migration-unix.c
  169. migration.c
  170. migration.h
  171. mips-dis.c
  172. mips.ld
  173. module.c
  174. module.h
  175. monitor.c
  176. monitor.h
  177. nbd.c
  178. nbd.h
  179. net.c
  180. net.h
  181. net/
  182. notify.c
  183. notify.h
  184. os-posix.c
  185. os-win32.c
  186. osdep.c
  187. osdep.h
  188. oslib-posix.c
  189. oslib-win32.c
  190. page_cache.c
  191. path.c
  192. pc-bios/
  193. pci-ids.txt
  194. poison.h
  195. ppc-dis.c
  196. ppc.ld
  197. ppc64.ld
  198. qapi-schema-guest.json
  199. qapi-schema-test.json
  200. qapi-schema.json
  201. qapi/
  202. qbool.c
  203. qbool.h
  204. qdict-test-data.txt
  205. qdict.c
  206. qdict.h
  207. qemu-aio.h
  208. qemu-barrier.h
  209. qemu-bridge-helper.c
  210. qemu-char.c
  211. qemu-char.h
  212. qemu-common.h
  213. qemu-config.c
  214. qemu-config.h
  215. qemu-coroutine-int.h
  216. qemu-coroutine-io.c
  217. qemu-coroutine-lock.c
  218. qemu-coroutine-sleep.c
  219. qemu-coroutine.c
  220. qemu-coroutine.h
  221. qemu-doc.texi
  222. qemu-error.c
  223. qemu-error.h
  224. qemu-file.h
  225. qemu-ga.c
  226. qemu-img-cmds.hx
  227. qemu-img.c
  228. qemu-img.texi
  229. qemu-io.c
  230. qemu-lock.h
  231. qemu-log.c
  232. qemu-log.h
  233. qemu-nbd.c
  234. qemu-nbd.texi
  235. qemu-objects.h
  236. qemu-option-internal.h
  237. qemu-option.c
  238. qemu-option.h
  239. qemu-options-wrapper.h
  240. qemu-options.h
  241. qemu-options.hx
  242. qemu-os-posix.h
  243. qemu-os-win32.h
  244. qemu-pixman.c
  245. qemu-pixman.h
  246. qemu-progress.c
  247. qemu-queue.h
  248. qemu-seccomp.c
  249. qemu-seccomp.h
  250. qemu-sockets.c
  251. qemu-tech.texi
  252. qemu-thread-posix.c
  253. qemu-thread-posix.h
  254. qemu-thread-win32.c
  255. qemu-thread-win32.h
  256. qemu-thread.h
  257. qemu-timer-common.c
  258. qemu-timer.c
  259. qemu-timer.h
  260. qemu-tls.h
  261. qemu-tool.c
  262. qemu-user.c
  263. qemu-x509.h
  264. qemu-xattr.h
  265. qemu.sasl
  266. qemu_socket.h
  267. qerror.c
  268. qerror.h
  269. qfloat.c
  270. qfloat.h
  271. qga/
  272. qint.c
  273. qint.h
  274. qjson.c
  275. qjson.h
  276. qlist.c
  277. qlist.h
  278. qmp-commands.hx
  279. qmp.c
  280. qobject.h
  281. qom/
  282. qstring.c
  283. qstring.h
  284. qtest.c
  285. qtest.h
  286. range.h
  287. readline.c
  288. readline.h
  289. roms/
  290. rules.mak
  291. s390-dis.c
  292. s390.ld
  293. savevm.c
  294. scripts/
  295. sh4-dis.c
  296. slirp/
  297. softmmu-semi.h
  298. softmmu_defs.h
  299. softmmu_exec.h
  300. softmmu_header.h
  301. softmmu_template.h
  302. sparc-dis.c
  303. sparc.ld
  304. sparc64.ld
  305. spice-qemu-char.c
  306. sysconfigs/
  307. sysemu.h
  308. target-alpha/
  309. target-arm/
  310. target-cris/
  311. target-i386/
  312. target-lm32/
  313. target-m68k/
  314. target-microblaze/
  315. target-mips/
  316. target-openrisc/
  317. target-ppc/
  318. target-s390x/
  319. target-sh4/
  320. target-sparc/
  321. target-unicore32/
  322. target-xtensa/
  323. tcg-runtime.c
  324. tcg/
  325. tci-dis.c
  326. tci.c
  327. tests/
  328. thread-pool.c
  329. thread-pool.h
  330. thunk.c
  331. thunk.h
  332. trace-events
  333. trace/
  334. translate-all.c
  335. uboot_image.h
  336. ui/
  337. uri.c
  338. uri.h
  339. user-exec.c
  340. version.rc
  341. vgafont.h
  342. vl.c
  343. vmstate.h
  344. x86_64.ld
  345. xen-all.c
  346. xen-mapcache.c
  347. xen-mapcache.h
  348. xen-stub.c