mirror: Fix aio context of mirror_top_bs
authorFam Zheng <famz@redhat.com>
Fri, 7 Apr 2017 06:54:11 +0000 (14:54 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 7 Apr 2017 12:44:06 +0000 (14:44 +0200)
It should be moved to the same context as source, before inserting to the
graph.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c

index 46ecd38ef0e99cc13318f37e38823efc3c04a2d0..164438f42237d94fff9e339c37b3459181a73e43 100644 (file)
@@ -1148,6 +1148,7 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs,
         return;
     }
     mirror_top_bs->total_sectors = bs->total_sectors;
+    bdrv_set_aio_context(mirror_top_bs, bdrv_get_aio_context(bs));
 
     /* bdrv_append takes ownership of the mirror_top_bs reference, need to keep
      * it alive until block_job_create() succeeds even if bs has no parent. */