[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/29] char: don't fail when client is not connected
From: |
Paolo Bonzini |
Subject: |
[PULL 14/29] char: don't fail when client is not connected |
Date: |
Fri, 26 Feb 2021 09:05:11 +0100 |
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
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>
Message-Id: <161284977034.741841.12565530923825663110.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@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 9061981f6d..b7863b8aae 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -387,6 +387,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);
}
--
2.29.2
- [PULL 23/29] docs: update to show preferred boolean syntax for -cpu, (continued)
- [PULL 23/29] docs: update to show preferred boolean syntax for -cpu, Paolo Bonzini, 2021/02/26
- [PULL 28/29] chardev: do not use short form boolean options in non-QemuOpts character device descriptions, Paolo Bonzini, 2021/02/26
- [PULL 26/29] target/i386: Add bus lock debug exception support, Paolo Bonzini, 2021/02/26
- [PULL 29/29] tcg/i386: rdpmc: fix the the condtions, Paolo Bonzini, 2021/02/26
- [PULL 04/29] scsi: make io_timeout configurable, Paolo Bonzini, 2021/02/26
- [PULL 08/29] scsi-disk: move scsi_handle_rw_error earlier, Paolo Bonzini, 2021/02/26
- [PULL 07/29] virtio-scsi: don't process IO on fenced dataplane, Paolo Bonzini, 2021/02/26
- [PULL 11/29] scsi-disk: pass SCSI status to scsi_handle_rw_error, Paolo Bonzini, 2021/02/26
- [PULL 09/29] scsi-disk: do not complete requests early for rerror/werror=ignore, Paolo Bonzini, 2021/02/26
- [PULL 15/29] gdbstub: use preferred boolean option syntax, Paolo Bonzini, 2021/02/26
- [PULL 14/29] char: don't fail when client is not connected,
Paolo Bonzini <=
- [PULL 19/29] qemu-options: update to show preferred boolean syntax for -incoming, Paolo Bonzini, 2021/02/26
- [PULL 22/29] docs: update to show preferred boolean syntax for -vnc, Paolo Bonzini, 2021/02/26
- [PULL 24/29] target/i386: update to show preferred boolean syntax for -cpu, Paolo Bonzini, 2021/02/26
- [PULL 25/29] qom/object.c: Fix typo, Paolo Bonzini, 2021/02/26
- [PULL 27/29] vl: deprecate -writeconfig, Paolo Bonzini, 2021/02/26
- Re: [PULL 00/29] Misc patches for 2021-02-25, no-reply, 2021/02/26