« Previous | Next » 

Revision 2b316774

ID2b316774f60291f57ca9ecb6a9f0712c532cae34

Added by Paolo Bonzini almost 12 years ago

qemu-char: do not operate on sources from finalize callbacks

Due to a glib bug, the finalize callback is called with the GMainContext
lock held. Thus, any operation on the context from the callback will
cause recursive locking and a deadlock. This happens, for example,
when a client disconnects from a socket chardev.

The fix for this is somewhat ugly, because we need to forego polymorphism
and implement our own function to destroy IOWatchPoll sources. The
right thing to do here would be child sources, but we support older
glib versions that do not have them. Not coincidentially, glib developers
found and fixed the deadlock as part of implementing child sources.

Signed-off-by: Paolo Bonzini <>
Tested-by: Sander Eikelenboom <>
Message-id:
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences