qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@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 08:54:29 +0530	[thread overview]
Message-ID: <20100406032429.GB4135@amit-x200.redhat.com> (raw)
In-Reply-To: <201004051733.38629.paul@codesourcery.com>

On (Mon) Apr 05 2010 [17:33:38], Paul Brook wrote:
> > There might be cases where a few bytes would have been sent out to char
> > devices and some not. Currently the return values from qemu_chr_write()
> > to char devs are only -1, indicating an error, or the complete length
> > of the string passed.
> > 
> > Make 'len' a pointer instead, and indicate how much of the string was
> > written. The return value will either be the same as 'len' or a negative
> > number indicating an error condition.
> 
> This seems wrong. We should not be getting recoverable errors.

I was thinking of adding a bool to CharDriverState to indicate if EAGAIN
should be reported to the writer. This can be conveyed at the time of
doing qemu_chr_add_handlers().

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.

		Amit

  reply	other threads:[~2010-04-06  3:26 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 [this message]
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
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=20100406032429.GB4135@amit-x200.redhat.com \
    --to=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).