diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -2040,6 +2040,16 @@ void bdrv_drain_all(void) bool busy = true; BlockDriverState *bs; + QTAILQ_FOREACH(bs, &bdrv_states, device_list) { + AioContext *aio_context = bdrv_get_aio_context(bs); + + aio_context_acquire(aio_context); + if (bs->job) { + block_job_pause(bs->job); + } + aio_context_release(aio_context); + } + while (busy) { busy = false; @@ -2051,6 +2061,16 @@ void bdrv_drain_all(void) aio_context_release(aio_context); } } + + QTAILQ_FOREACH(bs, &bdrv_states, device_list) { + AioContext *aio_context = bdrv_get_aio_context(bs); + + aio_context_acquire(aio_context); + if (bs->job) { + block_job_resume(bs->job); + } + aio_context_release(aio_context); + } } /* make a BlockDriverState anonymous by removing from bdrv_state and |