mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
chardev-socket: do not blindly reset handlers when switching GMainContext
If the socket is connecting or connected, tcp_chr_update_read_handler will be called but it should not set the NetListener's callbacks again. Otherwise, tcp_chr_accept is invoked while the socket is in connected state and you get an assertion failure. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3a75ef6a0f
commit
5b774fe550
2 changed files with 102 additions and 2 deletions
|
@ -632,7 +632,7 @@ static void tcp_chr_update_read_handler(Chardev *chr)
|
|||
{
|
||||
SocketChardev *s = SOCKET_CHARDEV(chr);
|
||||
|
||||
if (s->listener) {
|
||||
if (s->listener && s->state == TCP_CHARDEV_STATE_DISCONNECTED) {
|
||||
/*
|
||||
* It's possible that chardev context is changed in
|
||||
* qemu_chr_be_update_read_handlers(). Reset it for QIO net
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue