From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrSih-0002L2-3t for qemu-devel@nongnu.org; Wed, 18 Jul 2012 07:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrSib-000174-83 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 07:47:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrSib-00016u-08 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 07:47:01 -0400 Date: Wed, 18 Jul 2012 14:47:28 +0300 From: "Michael S. Tsirkin" Message-ID: <20120718114728.GA5184@redhat.com> References: <4FF02F2C.30006@ozlabs.ru> <4FF05173.6090801@redhat.com> <4FF05369.20405@ozlabs.ru> <4FF062BC.4090200@ozlabs.ru> <4FF066AF.40606@redhat.com> <4FF0A980.4070903@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FF0A980.4070903@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH] eventfd: making it rhread safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Paolo Bonzini , Alex Williamson , qemu-devel@nongnu.org, David Gibson On Mon, Jul 02, 2012 at 05:48:16AM +1000, Alexey Kardashevskiy wrote: >Subject: Re: [PATCH] eventfd: making it rhread safe typo in the subject > QEMU uses IO handlers to run select() in the main loop. The handlers list is managed by qemu_set_fd_handler() helper which works fine when called from the main thread as it is called not when select() is waiting. git commit logs should break lines at 70-80 chars. Sometimes people go beyond that a bit. But 214 chars is not reasonable. > However sometime we need to update the handlers list from another thread. Want to be more specific? > For that the main loop's select() needs to be restarted with the updated list. > > The patch adds the qemu_notify_event() call to interrupt select() and make wrapping code to restart select() with the updated IO handlers list. What does 'and make wrapping code' mean? > Signed-off-by: Alexey Kardashevskiy > Reviewed-by: Paolo Bonzini Does this fix any bugs? If yes commit log should mention this. > --- > iohandler.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/iohandler.c b/iohandler.c > index 3c74de6..dea4355 100644 > --- a/iohandler.c > +++ b/iohandler.c > @@ -77,6 +77,7 @@ int qemu_set_fd_handler2(int fd, > ioh->fd_write = fd_write; > ioh->opaque = opaque; > ioh->deleted = 0; > + qemu_notify_event(); > } > return 0; > } > -- > 1.7.10