block: Add error parameter to blk_insert_bs()

Now that blk_insert_bs() requests the BlockBackend permissions for the
node it attaches to, it can fail. Instead of aborting, pass the errors
to the callers.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Acked-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
Kevin Wolf 2017-01-13 19:02:32 +01:00
parent 6d0eb64d5c
commit d7086422b1
14 changed files with 100 additions and 29 deletions

View file

@ -446,7 +446,7 @@ static void init_blk_migration(QEMUFile *f)
BlockDriverState *bs = bmds_bs[i].bs;
if (bmds) {
blk_insert_bs(bmds->blk, bs);
blk_insert_bs(bmds->blk, bs, &error_abort);
alloc_aio_bitmap(bmds);
error_setg(&bmds->blocker, "block device is in use by migration");