Commit 11f0f5e5 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

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: default avatarKevin Wolf <kwolf@redhat.com>
parents b7a745dc c2b6428d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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