virtio: serial: expose a 'guest_writable' callback for users
commit4add73aa601ab42b7a9863d483fa313b06105b34
authorAmit Shah <amit.shah@redhat.com>
Thu, 17 Jul 2014 14:32:45 +0000 (17 20:02 +0530)
committerAmit Shah <amit.shah@redhat.com>
Thu, 19 Mar 2015 12:05:40 +0000 (19 17:35 +0530)
tree9d181e5e777b8bea757911f2b31d70fe2192a1a9
parent17b11a1406fdc43b5022f32a6fbfcb005a353b38
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>
hw/char/virtio-serial-bus.c
include/hw/virtio/virtio-serial.h