qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]