char: restore read callback on a reattached (hotplug) chardev

Fix a bug that was introduced in commit 386a5a1e. A removal of a device
set the chr handlers to NULL. However when the device is plugged back,
its read callback is not restored so data can't be transferred from the
host to the guest (e.g. via the virtio-serial port).

https://bugzilla.redhat.com/show_bug.cgi?id=1027181

Signed-off-by: Gal Hammer <ghammer@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
1 file changed
tree: 9fa9da3b024df9a066029f8523bba19666e9504e
  1. .exrc
  2. .gitignore
  3. .gitmodules
  4. .mailmap
  5. .travis.yml
  6. CODING_STYLE
  7. COPYING
  8. COPYING.LIB
  9. Changelog
  10. HACKING
  11. LICENSE
  12. MAINTAINERS
  13. Makefile
  14. Makefile.objs
  15. Makefile.target
  16. README
  17. VERSION
  18. aio-posix.c
  19. aio-win32.c
  20. arch_init.c
  21. async.c
  22. audio/
  23. backends/
  24. balloon.c
  25. block-migration.c
  26. block.c
  27. block/
  28. blockdev-nbd.c
  29. blockdev.c
  30. blockjob.c
  31. bsd-user/
  32. bt-host.c
  33. bt-vhci.c
  34. configure
  35. coroutine-gthread.c
  36. coroutine-sigaltstack.c
  37. coroutine-ucontext.c
  38. coroutine-win32.c
  39. cpu-exec.c
  40. cpus.c
  41. cputlb.c
  42. default-configs/
  43. device-hotplug.c
  44. device_tree.c
  45. disas.c
  46. disas/
  47. dma-helpers.c
  48. docs/
  49. dump.c
  50. exec.c
  51. fpu/
  52. fsdev/
  53. gdb-xml/
  54. gdbstub.c
  55. hmp-commands.hx
  56. hmp.c
  57. hmp.h
  58. hw/
  59. include/
  60. iohandler.c
  61. ioport.c
  62. kvm-all.c
  63. kvm-stub.c
  64. libcacard/
  65. linux-headers/
  66. linux-user/
  67. main-loop.c
  68. memory.c
  69. memory_mapping.c
  70. migration-exec.c
  71. migration-fd.c
  72. migration-rdma.c
  73. migration-tcp.c
  74. migration-unix.c
  75. migration.c
  76. monitor.c
  77. nbd.c
  78. net/
  79. os-posix.c
  80. os-win32.c
  81. page_cache.c
  82. pc-bios/
  83. po/
  84. qapi-schema.json
  85. qapi/
  86. qdev-monitor.c
  87. qdict-test-data.txt
  88. qemu-bridge-helper.c
  89. qemu-char.c
  90. qemu-coroutine-io.c
  91. qemu-coroutine-lock.c
  92. qemu-coroutine-sleep.c
  93. qemu-coroutine.c
  94. qemu-doc.texi
  95. qemu-file.c
  96. qemu-img-cmds.hx
  97. qemu-img.c
  98. qemu-img.texi
  99. qemu-io-cmds.c
  100. qemu-io.c
  101. qemu-log.c
  102. qemu-nbd.c
  103. qemu-nbd.texi
  104. qemu-options-wrapper.h
  105. qemu-options.h
  106. qemu-options.hx
  107. qemu-seccomp.c
  108. qemu-tech.texi
  109. qemu-timer.c
  110. qemu.nsi
  111. qemu.sasl
  112. qga/
  113. qmp-commands.hx
  114. qmp.c
  115. qobject/
  116. qom/
  117. qtest.c
  118. roms/
  119. rules.mak
  120. savevm.c
  121. scripts/
  122. slirp/
  123. spice-qemu-char.c
  124. stubs/
  125. sysconfigs/
  126. target-alpha/
  127. target-arm/
  128. target-cris/
  129. target-i386/
  130. target-lm32/
  131. target-m68k/
  132. target-microblaze/
  133. target-mips/
  134. target-moxie/
  135. target-openrisc/
  136. target-ppc/
  137. target-s390x/
  138. target-sh4/
  139. target-sparc/
  140. target-unicore32/
  141. target-xtensa/
  142. tcg-runtime.c
  143. tcg/
  144. tci.c
  145. tests/
  146. thread-pool.c
  147. thunk.c
  148. tpm.c
  149. trace-events
  150. trace/
  151. translate-all.c
  152. translate-all.h
  153. ui/
  154. user-exec.c
  155. util/
  156. version.rc
  157. vl.c
  158. vmstate.c
  159. xbzrle.c
  160. xen-all.c
  161. xen-mapcache.c
  162. xen-stub.c