Block patches for 2.9-rc1

-----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEkb62CjDbPohX0Rgp9AfbAGHVz0AFAljLz5gSHG1yZWl0ekBy
 ZWRoYXQuY29tAAoJEPQH2wBh1c9A9nAIAJXGpCDW7JgNMA1r/4q6RbfOqUdVxz5v
 ED+6Xpv8tzQ3E182IAM8vlqAhneyvmMk0phZzHJujKGBDVMgU/0Pb0sMb4aTDr4b
 SbuYwsVZqgxgNybtJUo1G6HteH6Gyx5lX9bSyfxTAotKLcf+ZIlas8iPBrYOJT1A
 NEl0ADVRo71bcf9gcrh6ytcABWkQ5wpbdtdlG6lniAhChUJ87erYF5BlkJsonuRC
 pYzfr3sBrSTmyJeBlU2lV3a3UxgzjOxe3dAquZoFY4Lhw9qmTPLoQsu8Vs627URZ
 zlAQGZyphU9rBD0j4wpm49QCQu9wOVnRuXfsHATTY0jc11CfVRV/vYA=
 =geJL
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Kevin Wolf 2017-03-17 13:03:44 +01:00
commit 11f0f5e553
1 changed files with 7 additions and 0 deletions

View File

@ -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