Re: [Qemu-block] [PATCH] blockjob: cancel blockjobs before stopping all iothreads

2017-06-07 Thread Alberto Garcia
On Sat 03 Jun 2017 07:48:37 AM CEST, sochin.jiang wrote: > --- a/block.c > +++ b/block.c > @@ -3084,9 +3084,16 @@ static void bdrv_close(BlockDriverState *bs) > bdrv_drained_end(bs); > } > > +void bdrv_cancel_all(void) > +{ > +if (!block_jobs_is_empty()) { > +

[Qemu-block] [PATCH] blockjob: cancel blockjobs before stopping all iothreads

2017-06-02 Thread sochin.jiang
From: "sochin.jiang" commit 88b062c and commit c9d1a56 introduce BDRV_POLL_WHILE, checking bs->in_flight in the main thread and exit till bs->in_flight reaches 0. This leaves a chance that BDRV_POLL_WHILE will hang until iothread complete the relative block job when