diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-12-13 17:50:07 +0530 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2011-01-20 14:38:22 +0530 |
commit | e300ac275bbf19b31cf5968b8de8abe52c26e163 (patch) | |
tree | 7618fc55554a93b58b604d6abf3463bfd672882b /hw/virtio-serial.h | |
parent | 471344db88cc3e7adf7664aa34d54ce0cacc3419 (diff) | |
download | qemu-e300ac275bbf19b31cf5968b8de8abe52c26e163.zip qemu-e300ac275bbf19b31cf5968b8de8abe52c26e163.tar.gz qemu-e300ac275bbf19b31cf5968b8de8abe52c26e163.tar.bz2 |
virtio-serial: Let virtio-serial-bus know if all data was consumed
The have_data() API to hand off guest data to apps using virtio-serial
so far assumed all the data was consumed. Relax this assumption.
Future commits will allow for incomplete writes.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'hw/virtio-serial.h')
-rw-r--r-- | hw/virtio-serial.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h index ff08c40..9cc0fb3 100644 --- a/hw/virtio-serial.h +++ b/hw/virtio-serial.h @@ -137,10 +137,11 @@ struct VirtIOSerialPortInfo { /* * Guest wrote some data to the port. This data is handed over to - * the app via this callback. The app is supposed to consume all - * the data that is presented to it. + * the app via this callback. The app can return a size less than + * 'len'. In this case, throttling will be enabled for this port. */ - void (*have_data)(VirtIOSerialPort *port, const uint8_t *buf, size_t len); + ssize_t (*have_data)(VirtIOSerialPort *port, const uint8_t *buf, + size_t len); }; /* Interface to the virtio-serial bus */ |