qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] aio-posix: Fix return value of aio_poll()


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] aio-posix: Fix return value of aio_poll()
Date: Thu, 24 Jan 2013 09:25:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 24/01/2013 08:42, Dietmar Maurer ha scritto:
>>> But when I use a thread it triggers the bug in bdrv_drain_all(). So
>>> how can I fix  bdrv_drain_all() if I use a separate thread to write data?
>>
>> The bug is, in all likelihood, in your own code.  Sorry. :)
> 
> yes. I still not fully understand that aio code.
> 
> If I detect a incomplete write, I register an aio handler like this:
> 
>         ret = write(fd, buf, count) 
>          if (ret < 0 && (errno == EAGAIN || errno == EWOULDBLOCK) ) {
>               ...
>               qemu_aio_set_fd_handler(fd, NULL, vma_co_continue_write,  NULL, 
> mydata);
>               qemu_coroutine_yield();
> 
> But seems that qemu_aio_wait() returns false after that.
> 
> I thought that should return true instead?

You need a flush handler (fourth argument to qemu_aio_set_fd_handler)
that returns true.

Paolo



reply via email to

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