[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 070/115] chardev/char-socket: Properly make qio connections non bl
From: |
Paolo Bonzini |
Subject: |
[PULL 070/115] chardev/char-socket: Properly make qio connections non blocking |
Date: |
Thu, 11 Jun 2020 15:44:04 -0400 |
From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
In tcp_chr_sync_read function, there is a possibility of socket
disconnection during blocking read, then tcp_chr_hup function would clean up
the qio channel pointers(i.e ioc, sioc).
Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Message-Id: <1587289900-29485-1-git-send-email-sai.pavan.boddu@xilinx.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
chardev/char-socket.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index db253d4024..dd3d3ed8d6 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -550,7 +550,9 @@ static int tcp_chr_sync_read(Chardev *chr, const uint8_t
*buf, int len)
qio_channel_set_blocking(s->ioc, true, NULL);
size = tcp_chr_recv(chr, (void *) buf, len);
- qio_channel_set_blocking(s->ioc, false, NULL);
+ if (s->state != TCP_CHARDEV_STATE_DISCONNECTED) {
+ qio_channel_set_blocking(s->ioc, false, NULL);
+ }
if (size == 0) {
/* connection closed */
tcp_chr_disconnect(chr);
--
2.26.2
- [PULL 064/115] target/i386: fix fisttpl, fisttpll handling of out-of-range values, (continued)
- [PULL 064/115] target/i386: fix fisttpl, fisttpll handling of out-of-range values, Paolo Bonzini, 2020/06/11
- [PULL 024/115] target/i386: fix phadd* with identical destination and source register, Paolo Bonzini, 2020/06/11
- [PULL 048/115] megasas: use unsigned type for reply_queue_head and check index, Paolo Bonzini, 2020/06/11
- [PULL 060/115] target/i386: fix floating-point load-constant rounding, Paolo Bonzini, 2020/06/11
- [PULL 019/115] vmbus: vmbus implementation, Paolo Bonzini, 2020/06/11
- [PULL 022/115] vmbus: add infrastructure to save/load vmbus requests, Paolo Bonzini, 2020/06/11
- [PULL 057/115] exec: Propagate cpu_memory_rw_debug() error, Paolo Bonzini, 2020/06/11
- [PULL 031/115] hw/i386/vmport: Introduce vmport.h, Paolo Bonzini, 2020/06/11
- [PULL 047/115] i386/kvm: fix a use-after-free when vcpu plug/unplug, Paolo Bonzini, 2020/06/11
- [PULL 040/115] qom: remove index from object_resolve_abs_path(), Paolo Bonzini, 2020/06/11
- [PULL 070/115] chardev/char-socket: Properly make qio connections non blocking,
Paolo Bonzini <=
- [PULL 072/115] hw/i386/amd_iommu: Fix the reserved bits definition of IOMMU commands, Paolo Bonzini, 2020/06/11
- [PULL 068/115] KVM: Pass EventNotifier into kvm_irqchip_assign_irqfd, Paolo Bonzini, 2020/06/11
- [PULL 076/115] util/oslib: Returns the real thread identifier on FreeBSD and NetBSD, Paolo Bonzini, 2020/06/11
- [PULL 079/115] configure: Do not ignore malloc value, Paolo Bonzini, 2020/06/11
- [PULL 075/115] target/i386: define a new MSR based feature word - FEAT_PERF_CAPABILITIES, Paolo Bonzini, 2020/06/11
- [PULL 074/115] i386: Remove unused define's from hax and hvf, Paolo Bonzini, 2020/06/11
- [PULL 077/115] memory: Make 'info mtree' not display disabled regions by default, Paolo Bonzini, 2020/06/11
- [PULL 078/115] qemu/thread: Mark qemu_thread_exit() with 'noreturn' attribute, Paolo Bonzini, 2020/06/11
- [PULL 071/115] tests: machine-none-test: Enable MicroBlaze testing, Paolo Bonzini, 2020/06/11
- [PULL 050/115] megasas: use unsigned type for positive numeric fields, Paolo Bonzini, 2020/06/11