qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <mlureau@redhat.com>
To: Ed Swierk <eswierk@skyportsystems.com>
Cc: qemu-devel@nongnu.org, libvir-list@redhat.com,
	berrange@redhat.com, pbonzini@redhat.com,
	marcandre lureau <marcandre.lureau@redhat.com>,
	eblake@redhat.com, ben@skyportsystems.com
Subject: Re: [Qemu-devel] [PATCH] char: drop data written to a disconnected pty
Date: Tue, 31 Jan 2017 09:06:32 -0500 (EST)	[thread overview]
Message-ID: <421566746.771522.1485871592528.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1485870329-79428-1-git-send-email-eswierk@skyportsystems.com>

Hi

----- Original Message -----
> When a serial port writes data to a pty that's disconnected, drop the
> data and return the length dropped. This avoids triggering pointless
> retries in callers like the 16550A serial_xmit(), and causes
> qemu_chr_fe_write() to write all data to the log file, rather than
> logging only while a pty client like virsh console happens to be
> connected.
> 
> Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
> ---
>  qemu-char.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-char.c b/qemu-char.c
> index 676944a..ccb6923 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -1528,7 +1528,7 @@ static int pty_chr_write(CharDriverState *chr, const
> uint8_t *buf, int len)
>          /* guest sends data, check for (re-)connect */
>          pty_chr_update_read_handler_locked(chr);
>          if (!s->connected) {
> -            return 0;
> +            return len;

I think this can be confusing if some backends silently drop the data (under disconnected state), while other don't. Perhaps we should have instead a new common chardev property "hup-drop" ? (suggestions for better name welcome)

>          }
>      }
>      return io_channel_send(s->ioc, buf, len);
> --
> 1.9.1
> 
> 

  reply	other threads:[~2017-01-31 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 13:45 [Qemu-devel] [PATCH] char: drop data written to a disconnected pty Ed Swierk
2017-01-31 14:06 ` Marc-André Lureau [this message]
2017-01-31 14:07   ` Marc-André Lureau
2017-01-31 22:19   ` Ed Swierk
2017-02-02  1:11     ` Paolo Bonzini
2017-02-06  9:51 ` 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=421566746.771522.1485871592528.JavaMail.zimbra@redhat.com \
    --to=mlureau@redhat.com \
    --cc=ben@skyportsystems.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eswierk@skyportsystems.com \
    --cc=libvir-list@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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 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).