summaryrefslogtreecommitdiff
path: root/hw/virtio-console.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-12-13 17:50:07 +0530
committerAmit Shah <amit.shah@redhat.com>2011-01-20 14:38:22 +0530
commite300ac275bbf19b31cf5968b8de8abe52c26e163 (patch)
tree7618fc55554a93b58b604d6abf3463bfd672882b /hw/virtio-console.c
parent471344db88cc3e7adf7664aa34d54ce0cacc3419 (diff)
downloadqemu-e300ac275bbf19b31cf5968b8de8abe52c26e163.tar.gz
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-console.c')
-rw-r--r--hw/virtio-console.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index d0b935491d..62624ec780 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -20,11 +20,11 @@ typedef struct VirtConsole {
/* Callback function that's called when the guest sends us data */
-static void flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t len)
+static ssize_t flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t len)
{
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
- qemu_chr_write(vcon->chr, buf, len);
+ return qemu_chr_write(vcon->chr, buf, len);
}
/* Readiness of the guest to accept data on a port */