From: Paolo Bonzini <pbonzini@redhat.com>
To: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, berrange@redhat.com
Subject: Re: [PATCH v2] char: don't fail when client is not connected
Date: Thu, 25 Feb 2021 11:10:10 +0100 [thread overview]
Message-ID: <13d200d7-a5cf-0ad7-40ad-48c06e3f092b@redhat.com> (raw)
In-Reply-To: <161284977034.741841.12565530923825663110.stgit@pasha-ThinkPad-X280>
On 09/02/21 06:49, Pavel Dovgalyuk wrote:
> This patch checks that ioc is not null before
> using it in tcp socket tcp_chr_add_watch function.
>
> The failure occurs in replay mode of the execution,
> when monitor and serial port are tcp servers,
> and there are no clients connected to them:
>
> -monitor tcp:127.0.0.1:8081,server,nowait
> -serial tcp:127.0.0.1:8082,server,nowait
>
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> chardev/char-socket.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> index 213a4c8dd0..cef1d9438f 100644
> --- a/chardev/char-socket.c
> +++ b/chardev/char-socket.c
> @@ -385,6 +385,9 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
> static GSource *tcp_chr_add_watch(Chardev *chr, GIOCondition cond)
> {
> SocketChardev *s = SOCKET_CHARDEV(chr);
> + if (!s->ioc) {
> + return NULL;
> + }
> return qio_channel_create_watch(s->ioc, cond);
> }
>
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2021-02-25 10:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 5:49 [PATCH v2] char: don't fail when client is not connected Pavel Dovgalyuk
2021-02-24 8:26 ` Pavel Dovgalyuk
2021-02-25 10:10 ` Paolo Bonzini [this message]
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=13d200d7-a5cf-0ad7-40ad-48c06e3f092b@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pavel.dovgalyuk@ispras.ru \
--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).