From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1Fcb-0006Jr-IE for qemu-devel@nongnu.org; Wed, 07 Sep 2011 06:44:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1Fca-0000Rd-7F for qemu-devel@nongnu.org; Wed, 07 Sep 2011 06:44:45 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:55657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1Fca-0000R2-26 for qemu-devel@nongnu.org; Wed, 07 Sep 2011 06:44:44 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p87AURkn016485 for ; Wed, 7 Sep 2011 06:30:27 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p87Aidd7186174 for ; Wed, 7 Sep 2011 06:44:39 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p87Aid0u004551 for ; Wed, 7 Sep 2011 06:44:39 -0400 From: "Aneesh Kumar K.V" In-Reply-To: <4E66027C.3090909@redhat.com> References: <4E66027C.3090909@redhat.com> Date: Wed, 07 Sep 2011 16:14:34 +0530 Message-ID: <8739g8d431.fsf@skywalker.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] glib mainloop breaks virtfs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , "qemu-devel@nongnu.org" , Anthony Liguori On Tue, 06 Sep 2011 13:22:36 +0200, Gerd Hoffmann wrote: > Hi, > > virtfs stopped working for me in master, the guest (fedora 15) just > hangs at boot when mounting the virtfs filesystems. Bisecting points to > this commit: > > rincewind kraxel ~/projects/qemu ((69e5bb6...)|BISECTING)# git bisect good > 4d88a2ac8643265108ef1fb47ceee5d7b28e19f2 is the first bad commit > commit 4d88a2ac8643265108ef1fb47ceee5d7b28e19f2 > Author: Anthony Liguori > Date: Mon Aug 22 08:12:53 2011 -0500 > > main: switch qemu_set_fd_handler to g_io_add_watch > > cheers, > Gerd > The below patch fix the problem for me. commit 52ed37a201d34a3070b4e2d0f21b5e6cca50352e Author: Aneesh Kumar K.V Date: Wed Sep 7 16:11:03 2011 +0530 iohandler: update qemu_fd_set_handler to work with null call back arg Many users of qemu_fd_set_handler including VirtFS use NULL call back arg. Update fd_trampoline and qemu_fd_set_handler to work with NULL call back arg Signed-off-by: Aneesh Kumar K.V diff --git a/iohandler.c b/iohandler.c index 5ef66fb..b803208 100644 --- a/iohandler.c +++ b/iohandler.c @@ -93,10 +93,6 @@ static gboolean fd_trampoline(GIOChannel *chan, GIOCondition cond, gpointer opaq { IOTrampoline *tramp = opaque; - if (tramp->opaque == NULL) { - return FALSE; - } - if ((cond & G_IO_IN) && tramp->fd_read) { tramp->fd_read(tramp->opaque); } @@ -113,6 +109,7 @@ int qemu_set_fd_handler(int fd, IOHandler *fd_write, void *opaque) { + GIOCondition cond = 0; static IOTrampoline fd_trampolines[FD_SETSIZE]; IOTrampoline *tramp = &fd_trampolines[fd]; @@ -121,25 +118,21 @@ int qemu_set_fd_handler(int fd, g_source_remove(tramp->tag); } - if (opaque) { - GIOCondition cond = 0; - - tramp->fd_read = fd_read; - tramp->fd_write = fd_write; - tramp->opaque = opaque; - - if (fd_read) { - cond |= G_IO_IN | G_IO_ERR; - } + tramp->fd_read = fd_read; + tramp->fd_write = fd_write; + tramp->opaque = opaque; - if (fd_write) { - cond |= G_IO_OUT | G_IO_ERR; - } + if (fd_read) { + cond |= G_IO_IN | G_IO_ERR; + } - tramp->chan = g_io_channel_unix_new(fd); - tramp->tag = g_io_add_watch(tramp->chan, cond, fd_trampoline, tramp); + if (fd_write) { + cond |= G_IO_OUT | G_IO_ERR; } + tramp->chan = g_io_channel_unix_new(fd); + tramp->tag = g_io_add_watch(tramp->chan, cond, fd_trampoline, tramp); + return 0; }