qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-base


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch
Date: Wed, 26 Sep 2012 08:36:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

Il 26/09/2012 00:01, Anthony Liguori ha scritto:
>> > +        node->pfd.events = G_IO_ERR;
>> > +        node->pfd.events |= (io_read ? G_IO_IN | G_IO_HUP : 0);
>> > +        node->pfd.events |= (io_write ? G_IO_OUT : 0);
>> >      }
> Should we even set G_IO_ERR?  I think that corresponds to exceptfd

No, that would be G_IO_PRI.

> in select() but we've never set that historically.  I know glib recommends
> it but I don't think it's applicable to how we use it.
> 
> Moreover, the way you do dispatch, if G_IO_ERR did occur, we'd dispatch
> both the read and write handlers which definitely isn't right.

I'm not sure what gives POLLERR.  Probably a connect() that fails, and
in that case dispatching on the write handler would be okay.  But I was
not sure and calling both is safe: handlers have to be ready for
spurious wakeups anyway, it happens if qemu_aio_wait dispatches from a
VCPU thread before the main loop gets hold of the big lock.

> I think it's easiest just to drop it.

That's indeed the case, since the current code never sets either
G_IO_HUP or G_IO_ERR.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]