From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Anthony Liguori <aliguori@us.ibm.com>
Subject: Re: [Qemu-devel] glib mainloop breaks virtfs
Date: Wed, 07 Sep 2011 16:14:34 +0530 [thread overview]
Message-ID: <8739g8d431.fsf@skywalker.in.ibm.com> (raw)
In-Reply-To: <4E66027C.3090909@redhat.com>
On Tue, 06 Sep 2011 13:22:36 +0200, Gerd Hoffmann <kraxel@redhat.com> 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 <aliguori@us.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
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 <aneesh.kumar@linux.vnet.ibm.com>
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;
}
next prev parent reply other threads:[~2011-09-07 10:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-06 11:22 [Qemu-devel] glib mainloop breaks virtfs Gerd Hoffmann
2011-09-06 14:31 ` Anthony Liguori
2011-09-06 17:25 ` Aneesh Kumar K.V
2011-09-06 17:41 ` Aneesh Kumar K.V
2011-09-07 10:44 ` Aneesh Kumar K.V [this message]
2011-09-07 10:58 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8739g8d431.fsf@skywalker.in.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.