From: Jamie Lokier <jamie@shareable.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>,
qemu-devel@nongnu.org, Paul Brook <paul@codesourcery.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes
Date: Tue, 6 Apr 2010 14:30:02 +0100 [thread overview]
Message-ID: <20100406133002.GA24003@shareable.org> (raw)
In-Reply-To: <4BBB1800.4060105@redhat.com>
Gerd Hoffmann wrote:
> 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 ...
Which is why EAGAIN was invented.
-- Jamie
next prev parent reply other threads:[~2010-04-06 13:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 12:45 [Qemu-devel] [PATCH 0/5] chardev, virtio-console: flow control, error handling Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 2/5] char: unix write: Add some sleep to ease off spinning in a tight loop Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 3/5] char: unix: For files that are nonblocking, report -EAGAIN to calling functions Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 4/5] virtio-console: Factor out common init between console and generic ports Amit Shah
2010-04-05 12:45 ` [Qemu-devel] [PATCH 5/5] virtio-console: Throttle virtio-serial-bus if we can't consume any more guest data Amit Shah
2010-04-06 7:45 ` [Qemu-devel] " Gerd Hoffmann
2010-04-05 16:33 ` [Qemu-devel] [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes Paul Brook
2010-04-06 3:24 ` Amit Shah
2010-04-06 9:34 ` Paul Brook
2010-04-06 9:58 ` Amit Shah
2010-04-06 10:21 ` Gerd Hoffmann
2010-04-06 11:05 ` Amit Shah
2010-04-06 11:16 ` Gerd Hoffmann
2010-04-06 13:30 ` Jamie Lokier [this message]
2010-04-06 7:40 ` [Qemu-devel] " Gerd Hoffmann
2010-04-06 7:54 ` Amit Shah
2010-04-06 7:36 ` [Qemu-devel] Re: [PATCH 0/5] chardev, virtio-console: flow control, error handling Gerd Hoffmann
2010-04-06 7:52 ` Amit Shah
2010-04-06 8:17 ` Gerd Hoffmann
2010-04-06 8:28 ` Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100406133002.GA24003@shareable.org \
--to=jamie@shareable.org \
--cc=amit.shah@redhat.com \
--cc=kraxel@redhat.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).