qemu-char: make tcp_chr_disconnect() reentrant-safe
During CHR_EVENT_CLOSED, the function could be reentered, make this case safe. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6167ebbd91
commit
342f7a9d05
@ -2769,6 +2769,10 @@ static void tcp_chr_disconnect(CharDriverState *chr)
|
||||
{
|
||||
TCPCharDriver *s = chr->opaque;
|
||||
|
||||
if (!s->connected) {
|
||||
return;
|
||||
}
|
||||
|
||||
s->connected = 0;
|
||||
if (s->listen_ioc) {
|
||||
s->listen_tag = qio_channel_add_watch(
|
||||
|
Loading…
Reference in New Issue
Block a user