From: Paolo Bonzini <pbonzini@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>
Cc: Sergio Lopez <slp@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] hw/char/serial: Only retry if qemu_chr_fe_write returns 0
Date: Mon, 9 Jul 2018 15:17:27 +0200 [thread overview]
Message-ID: <01f5d4ef-cea1-ff81-82cc-30a617a3c648@redhat.com> (raw)
In-Reply-To: <CAJ+F1CKk=3amSNTSusbPj1MUM+ksTse2YVddLyTf5jqr6RDyFQ@mail.gmail.com>
On 09/07/2018 14:23, Marc-André Lureau wrote:
> I suppose the patch should also change qemu_chr_fe_write() to
> qemu_chr_fe_write_all() to be complete and let the chardev handle
> EAGAIN.
No, using qemu_chr_fe_write_all() is even more wrong, because hw/char
devices should never block (and hw/char/serial.c handles flow control
properly).
However, indeed it seems to me that the logic of the patch is backwards:
- -1/EAGAIN should retry
- 0 should *not* retry, because it means the other side has hung up
- everything else should not retry.
Paolo
next prev parent reply other threads:[~2018-07-09 13:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1528185295-14199-1-git-send-email-slp@redhat.com>
2018-06-05 9:18 ` [Qemu-devel] [PATCH] hw/char/serial: Only retry if qemu_chr_fe_write returns 0 Paolo Bonzini
2018-07-09 10:25 ` Marc-André Lureau
2018-07-09 12:11 ` Peter Maydell
2018-07-09 12:23 ` Marc-André Lureau
2018-07-09 13:17 ` Paolo Bonzini [this message]
2018-07-09 13:21 ` Peter Maydell
2018-07-09 13:44 ` Paolo Bonzini
2018-07-10 13:48 ` Igor Mammedov
2018-07-13 14:55 ` Marc-André Lureau
2018-07-13 15:05 ` Paolo Bonzini
2018-07-16 9:03 ` Igor Mammedov
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=01f5d4ef-cea1-ff81-82cc-30a617a3c648@redhat.com \
--to=pbonzini@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=slp@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).