virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse

We cannot indicate to the guest how much data was consumed by an app for
out_bufs.  So we just have to assume the apps will consume all the data
that are handed over to them.

Fix the virtio api abuse in control_out() and handle_output().

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Amit Shah 2010-04-27 18:04:09 +05:30 committed by Anthony Liguori
parent e85ba9b2dc
commit 1e4476aa03
3 changed files with 8 additions and 11 deletions

View file

@ -136,10 +136,10 @@ struct VirtIOSerialPortInfo {
/*
* Guest wrote some data to the port. This data is handed over to
* the app via this callback. The app should return the number of
* bytes it successfully consumed.
* the app via this callback. The app is supposed to consume all
* the data that is presented to it.
*/
size_t (*have_data)(VirtIOSerialPort *port, const uint8_t *buf, size_t len);
void (*have_data)(VirtIOSerialPort *port, const uint8_t *buf, size_t len);
};
/* Interface to the virtio-serial bus */