Re: [Qemu-devel] [PATCH 09/16] block: wait for all pending I/O when doing synchronous requests

2016-03-18 Thread Stefan Hajnoczi
On Tue, Feb 16, 2016 at 06:56:21PM +0100, Paolo Bonzini wrote: > Synchronous I/O should in general happen either in the main thread (e.g. > for bdrv_open and bdrv_create) or between bdrv_drained_begin and > bdrv_drained_end. Therefore, the simplest way to wait for it to finish > is to wait for

Re: [Qemu-devel] [PATCH 09/16] block: wait for all pending I/O when doing synchronous requests

2016-03-09 Thread Paolo Bonzini
On 09/03/2016 09:13, Fam Zheng wrote: >> > @@ -352,7 +352,9 @@ static void qed_start_need_check_timer(BDRVQEDState *s) >> > static void qed_cancel_need_check_timer(BDRVQEDState *s) >> > { >> > trace_qed_cancel_need_check_timer(s); >> > -timer_del(s->need_check_timer); >> > +if

Re: [Qemu-devel] [PATCH 09/16] block: wait for all pending I/O when doing synchronous requests

2016-03-09 Thread Fam Zheng
On Tue, 02/16 18:56, Paolo Bonzini wrote: > diff --git a/block/qed.c b/block/qed.c > index ebba220..e90792f 100644 > --- a/block/qed.c > +++ b/block/qed.c > @@ -352,7 +352,9 @@ static void qed_start_need_check_timer(BDRVQEDState *s) > static void qed_cancel_need_check_timer(BDRVQEDState *s) > {

[Qemu-devel] [PATCH 09/16] block: wait for all pending I/O when doing synchronous requests

2016-02-16 Thread Paolo Bonzini
Synchronous I/O should in general happen either in the main thread (e.g. for bdrv_open and bdrv_create) or between bdrv_drained_begin and bdrv_drained_end. Therefore, the simplest way to wait for it to finish is to wait for _all_ pending I/O to complete. In fact, there was one case in bdrv_close