virtio-serial api: guest_writable callback for users
virtio: serial: expose a 'guest_writable' callback for users

Users of virtio-serial may want to know when a port becomes writable.  A
port can stop accepting writes if the guest port is open but not being
read from.  In this case, data gets queued up in the virtqueue, and
after the vq is full, writes to the port do not succeed.

When the guest reads off a vq element, and adds a new one for the host
to put data in, we can tell users the port is available for more writes,
via the new ->guest_writable() callback.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2 files changed
tree: 9d181e5e777b8bea757911f2b31d70fe2192a1a9
  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. accel.c
  19. aio-posix.c
  20. aio-win32.c
  21. arch_init.c
  22. async.c
  23. audio/
  24. backends/
  25. balloon.c
  26. block.c
  27. block/
  28. blockdev-nbd.c
  29. blockdev.c
  30. blockjob.c
  31. bootdevice.c
  32. bsd-user/
  33. bt-host.c
  34. bt-vhci.c
  35. configure
  36. coroutine-gthread.c
  37. coroutine-sigaltstack.c
  38. coroutine-ucontext.c
  39. coroutine-win32.c
  40. cpu-exec.c
  41. cpus.c
  42. cputlb.c
  43. default-configs/
  44. device-hotplug.c
  45. device_tree.c
  46. disas.c
  47. disas/
  48. dma-helpers.c
  49. docs/
  50. dump.c
  51. exec.c
  52. fpu/
  53. fsdev/
  54. gdb-xml/
  55. gdbstub.c
  56. hmp-commands.hx
  57. hmp.c
  58. hmp.h
  59. hw/
  60. include/
  61. iohandler.c
  62. ioport.c
  63. iothread.c
  64. kvm-all.c
  65. kvm-stub.c
  66. libcacard/
  67. libdecnumber/
  68. linux-headers/
  69. linux-user/
  70. main-loop.c
  71. memory.c
  72. memory_mapping.c
  73. migration/
  74. module-common.c
  75. monitor.c
  76. nbd.c
  77. net/
  78. numa.c
  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-img-cmds.hx
  96. qemu-img.c
  97. qemu-img.texi
  98. qemu-io-cmds.c
  99. qemu-io.c
  100. qemu-log.c
  101. qemu-nbd.c
  102. qemu-nbd.texi
  103. qemu-options-wrapper.h
  104. qemu-options.h
  105. qemu-options.hx
  106. qemu-seccomp.c
  107. qemu-tech.texi
  108. qemu-timer.c
  109. qemu.nsi
  110. qemu.sasl
  111. qga/
  112. qjson.c
  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. softmmu_template.h
  124. spice-qemu-char.c
  125. stubs/
  126. sysconfigs/
  127. target-alpha/
  128. target-arm/
  129. target-cris/
  130. target-i386/
  131. target-lm32/
  132. target-m68k/
  133. target-microblaze/
  134. target-mips/
  135. target-moxie/
  136. target-openrisc/
  137. target-ppc/
  138. target-s390x/
  139. target-sh4/
  140. target-sparc/
  141. target-tricore/
  142. target-unicore32/
  143. target-xtensa/
  144. tcg-runtime.c
  145. tcg/
  146. tci.c
  147. tests/
  148. thread-pool.c
  149. thunk.c
  150. tpm.c
  151. trace-events
  152. trace/
  153. translate-all.c
  154. translate-all.h
  155. ui/
  156. user-exec.c
  157. util/
  158. version.rc
  159. vl.c
  160. xen-common-stub.c
  161. xen-common.c
  162. xen-hvm-stub.c
  163. xen-hvm.c
  164. xen-mapcache.c