[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/17] virtio-serial: Apps should consume all da
From: |
Amit Shah |
Subject: |
Re: [Qemu-devel] [PATCH 15/17] virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse |
Date: |
Wed, 31 Mar 2010 19:36:12 +0530 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On (Wed) Mar 31 2010 [15:53:59], Gerd Hoffmann wrote:
>> /* Callback function that's called when the guest sends us data */
>> -static size_t flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t
>> len)
>> +static void flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t
>> len)
>> {
>> VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
>> - ssize_t ret;
>>
>> - ret = qemu_chr_write(vcon->chr, buf, len);
>> -
>> - return ret< 0 ? 0 : ret;
>> + qemu_chr_write(vcon->chr, buf, len);
>> }
>
> Ok, so we loose data in case qemu_chr_write wasn't able to write out all
> data? Nice opportunity to show flow control in action here ;)
>
> On failed+partial writes just put the remaining data into a buffer and
> throttle the port until all buffered data has been successfully written
> to the chardev.
>
> Incremental patch is fine to avoid the chicken-egg issue (throttling is
> added by patch #17).
Yes, that's what I intend to do in a later patch (series).
Amit
- [Qemu-devel] [PATCH 10/17] virtio-serial: Send out guest data to ports only if port is opened, (continued)
- [Qemu-devel] [PATCH 10/17] virtio-serial: Send out guest data to ports only if port is opened, Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 11/17] iov: Introduce a new file for helpers around iovs, add iov_from_buf(), Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 12/17] iov: Add iov_to_buf and iov_size helpers, Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 13/17] virtio-serial: Handle scatter-gather buffers for control messages, Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 14/17] virtio-serial: Handle scatter/gather input from the guest, Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 15/17] virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse, Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 16/17] virtio-serial: Discard data that guest sends us when ports aren't connected, Amit Shah, 2010/03/31
- [Qemu-devel] [PATCH 17/17] virtio-serial: Implement flow control for individual ports, Amit Shah, 2010/03/31
- [Qemu-devel] Re: [PATCH 16/17] virtio-serial: Discard data that guest sends us when ports aren't connected, Juan Quintela, 2010/03/31
- Re: [Qemu-devel] [PATCH 15/17] virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse, Gerd Hoffmann, 2010/03/31
- Re: [Qemu-devel] [PATCH 15/17] virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse,
Amit Shah <=
[Qemu-devel] Re: [PATCH 00/17] v4: virtio-serial fixes, new abi for port discovery, Juan Quintela, 2010/03/31