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

2011-11-14 Thread Zhi Yong Wu
On Mon, Nov 14, 2011 at 4:37 PM, Paolo Bonzini wrote: > On 11/14/2011 09:10 AM, Zhi Yong Wu wrote: >>> >>> >  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

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

2011-11-14 Thread Zhi Yong Wu
On Mon, Nov 14, 2011 at 4:50 PM, Kevin Wolf wrote: > Am 14.11.2011 04:04, schrieb Zhi Yong Wu: >> On Sat, Nov 12, 2011 at 12:47 AM, Stefan Hajnoczi >> wrote: >>> This patch adds the .bdrv_co_is_allocated() interface which is identical >>> to .bdrv_is_allocated() but runs in coroutine context.  Ru

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

2011-11-14 Thread Kevin Wolf
Am 14.11.2011 04:04, schrieb Zhi Yong Wu: > On Sat, Nov 12, 2011 at 12:47 AM, Stefan Hajnoczi > wrote: >> This patch adds the .bdrv_co_is_allocated() interface which is identical >> to .bdrv_is_allocated() but runs in coroutine context. Running in >> coroutine context implies that other coroutine

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

2011-11-14 Thread Paolo Bonzini
On 11/14/2011 09:10 AM, Zhi Yong Wu wrote: > 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_coroutin

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

2011-11-14 Thread Zhi Yong Wu
On Mon, Nov 14, 2011 at 3:32 PM, Paolo Bonzini 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

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

2011-11-13 Thread Paolo Bonzini
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 cod

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

2011-11-13 Thread Zhi Yong Wu
On Sat, Nov 12, 2011 at 12:47 AM, Stefan Hajnoczi wrote: > This patch adds the .bdrv_co_is_allocated() interface which is identical > to .bdrv_is_allocated() but runs in coroutine context.  Running in > coroutine context implies that other coroutines might be performing I/O > at the same time.   T

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

2011-11-11 Thread Stefan Hajnoczi
This patch adds the .bdrv_co_is_allocated() interface which is identical to .bdrv_is_allocated() but runs in coroutine context. Running in coroutine context implies that other coroutines might be performing I/O at the same time. Therefore it must be safe to run while the following BlockDriver fu