« Previous | Next » 

Revision 1e885b25

ID1e885b25275fb6763eb947b1e53b2d6911b967a8

Added by Paolo Bonzini about 11 years ago

qemu-char: really fix behavior on can_read = 0

I misread the glib manual, g_source_remove does not let you re-attach
the source later. This behavior (called "blocking" the source in glib)
is present in glib's source code, but private and not available outside
glib; hence, we have to resort to re-creating the source every time.

In fact, g_source_remove and g_source_destroy are the same thing,
except g_source_destroy is O(1) while g_source_remove scans a potentially
very long list of GSources in the current main loop. Ugh. Better
use g_source_destroy explicitly, and leave "tags" to those dummies who
cannot track their pointers' lifetimes.

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

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences