qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/10] block: add .bdrv_co_is_allocated()


From: Zhi Yong Wu
Subject: Re: [Qemu-devel] [PATCH 02/10] block: add .bdrv_co_is_allocated()
Date: Mon, 14 Nov 2011 16:10:42 +0800

On Mon, Nov 14, 2011 at 3:32 PM, Paolo Bonzini <address@hidden> wrote:
> On 11/14/2011 04:04 AM, Zhi Yong Wu wrote:
>>>
>>> >  +        co = qemu_coroutine_create(bdrv_is_allocated_co_entry);
>>> >  +        qemu_coroutine_enter(co,&data);
>>
>> Since this main process will stop within qemu_coroutine_enter() until
>> bdrv_is_allocated_co_entry() is completed, three lines of condition
>> codes below are unnecessary, right?
>
> No, they are necessary.  They are executed when bdrv_is_allocated_co_entry
> calls qemu_coroutine_yield.
Right, But i don't think that they are necessary.

after bdrv_is_allocated_co_entry has basically completed all main
task, it call qemu_coroutine_yield to wake up this current process; At
that point, it is equal to the setting of data.done. Why need you
still the three lines of codes below?

>
>>> >  +        while (!data.done) {
>>> >  +            qemu_aio_wait();
>>> >  +        }
>
> Paolo
>
>
>



-- 
Regards,

Zhi Yong Wu



reply via email to

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