|
From: | Hans de Goede |
Subject: | Re: [Qemu-devel] [PATCH] qemu-char: another io_add_watch_poll fix |
Date: | Wed, 17 Apr 2013 17:36:46 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Ji, On 04/16/2013 11:34 AM, Paolo Bonzini wrote:
Il 16/04/2013 11:15, Gerd Hoffmann ha scritto:On 04/10/13 15:23, Paolo Bonzini wrote:After attaching the source, we have to remove the reference we hold to it, because we do not hold anymore a pointer to the source. If we do not do this, removing the source will not finalize it and will not drop the "real" I/O watch source. This showed up when backporting the new flow control patches to older versions of QEMU that still used select. The whole select then failed with EBADF (poll instead will reporting POLLNVAL on a single pollfd) and QEMU froze.I get freezes now in master, bisecting points to this patch. Reproducer: "qemu -serial pty". qemu is pretty much unusable with libvirt now as libvirt uses pty chardevs by default for serial & monitor ...I'm not sure why all users of qemu_chr_fe_add_watch believe that the watch will be one-shot. This is definitely not what g_io_create_watch does...
It is supposed to depend on the return value of the callback, if you return False, then the source should be removed, in essence making the watch one-shot, see: http://www.gtk.org/api/2.6/glib/glib-The-Main-Event-Loop.html#GSourceFunc Which specifically says: Returns: it should return FALSE if the source should be removed. And using sources in a one-shot mode by making the callback return false is quite normal in the glib world. Regards, Hans
[Prev in Thread] | Current Thread | [Next in Thread] |