diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-03-17 13:03:44 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-03-17 13:03:44 +0100 |
commit | 11f0f5e553cff93d5fc77d67b98c40adba12b729 (patch) | |
tree | 7bd64123338972d3ee650aeb26a81a068d630f24 | |
parent | b7a745dc33a18377bb4a8dfe54d1df01ea60bf66 (diff) | |
parent | c2b6428d388b3f03261be7b0be770919e4e3e5ec (diff) |
Merge remote-tracking branch 'mreitz/tags/pull-block-2017-03-17' into queue-block
Block patches for 2.9-rc1
# gpg: Signature made Fri Mar 17 12:59:20 2017 CET
# gpg: using RSA key 0xF407DB0061D5CF40
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40
* mreitz/tags/pull-block-2017-03-17:
block: quiesce AioContext when detaching from it
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4350,8 +4350,15 @@ void bdrv_attach_aio_context(BlockDriverState *bs, void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context) { + AioContext *ctx; + bdrv_drain(bs); /* ensure there are no in-flight requests */ + ctx = bdrv_get_aio_context(bs); + while (aio_poll(ctx, false)) { + /* wait for all bottom halves to execute */ + } + bdrv_detach_aio_context(bs); /* This function executes in the old AioContext so acquire the new one in |