qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes we


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes
Date: Tue, 06 Apr 2010 13:16:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

On 04/06/10 13:05, Amit Shah wrote:
On (Tue) Apr 06 2010 [12:21:52], Gerd Hoffmann wrote:
On 04/06/10 11:58, Amit Shah wrote:
It would certainly be beneficial for consumers of virtio-serial to be
notified of -EAGAIN so that the guest can be throttled till the chardev
catches up with the data being sent.

EAGAIN should only ever occur if no bytes are written.

Right. That, or just return 0 and let the caller handle the situation?

Go with the usual unix semantics instead of creating something new.

When something was written -- return the number of bytes.  Caller has to
compare with the length passed in to figure whenever it was a partial
write or not.

When nothing was written -- return the error.

Unless Paul wants to never return recoverable error messages as he
mentioned in his first mail.

Return value "0" usually means end-of-file, I would not use that for something else too. We have to agree on something though ...

cheers,
  Gerd





reply via email to

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