From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-trivial] [PATCH] char: fix handling of QIO_CHANNEL_ERR_BLOCK
Date: Fri, 12 Feb 2016 16:24:35 +0100 [thread overview]
Message-ID: <56BDF933.6040208@redhat.com> (raw)
In-Reply-To: <1455288410-27046-1-git-send-email-berrange@redhat.com>
On 12/02/2016 15:46, Daniel P. Berrange wrote:
> If io_channel_send_full gets QIO_CHANNEL_ERR_BLOCK it
> and has already sent some of the data, it should return
> that amount of data, not EAGAIN, as that would cause
> the caller to re-try already sent data.
>
> Unfortunately due to a previous rebase conflict resolution
> error, the code for dealing with this was in the wrong
> part of the conditional, and so mistakenly ran on other
> I/O errors.
>
> This be seen running
>
> qemu-system-x86_64 -monitor stdio
>
> and entering 'info mtree', when running on a slow console
> (eg a slow remote ssh session). The monitor would get into
> an indefinite loop writing the same data until it managed
> to send it all without getting EAGAIN.
>
> Reported-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> qemu-char.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 1b7d5da..c2e24a5 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -896,13 +896,13 @@ static int io_channel_send_full(QIOChannel *ioc,
> ioc, &iov, 1,
> fds, nfds, NULL);
> if (ret == QIO_CHANNEL_ERR_BLOCK) {
> - errno = EAGAIN;
> - return -1;
> - } else if (ret < 0) {
> if (offset) {
> return offset;
> }
>
> + errno = EAGAIN;
> + return -1;
> + } else if (ret < 0) {
> errno = EINVAL;
> return -1;
> }
>
Queued, thanks.
Paolo
WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] char: fix handling of QIO_CHANNEL_ERR_BLOCK
Date: Fri, 12 Feb 2016 16:24:35 +0100 [thread overview]
Message-ID: <56BDF933.6040208@redhat.com> (raw)
In-Reply-To: <1455288410-27046-1-git-send-email-berrange@redhat.com>
On 12/02/2016 15:46, Daniel P. Berrange wrote:
> If io_channel_send_full gets QIO_CHANNEL_ERR_BLOCK it
> and has already sent some of the data, it should return
> that amount of data, not EAGAIN, as that would cause
> the caller to re-try already sent data.
>
> Unfortunately due to a previous rebase conflict resolution
> error, the code for dealing with this was in the wrong
> part of the conditional, and so mistakenly ran on other
> I/O errors.
>
> This be seen running
>
> qemu-system-x86_64 -monitor stdio
>
> and entering 'info mtree', when running on a slow console
> (eg a slow remote ssh session). The monitor would get into
> an indefinite loop writing the same data until it managed
> to send it all without getting EAGAIN.
>
> Reported-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> qemu-char.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 1b7d5da..c2e24a5 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -896,13 +896,13 @@ static int io_channel_send_full(QIOChannel *ioc,
> ioc, &iov, 1,
> fds, nfds, NULL);
> if (ret == QIO_CHANNEL_ERR_BLOCK) {
> - errno = EAGAIN;
> - return -1;
> - } else if (ret < 0) {
> if (offset) {
> return offset;
> }
>
> + errno = EAGAIN;
> + return -1;
> + } else if (ret < 0) {
> errno = EINVAL;
> return -1;
> }
>
Queued, thanks.
Paolo
next prev parent reply other threads:[~2016-02-12 15:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 14:46 [Qemu-trivial] [PATCH] char: fix handling of QIO_CHANNEL_ERR_BLOCK Daniel P. Berrange
2016-02-12 14:46 ` [Qemu-devel] " Daniel P. Berrange
2016-02-12 15:24 ` Paolo Bonzini [this message]
2016-02-12 15:24 ` Paolo Bonzini
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=56BDF933.6040208@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.