mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 19:14:58 -06:00
block: Don't use error_abort in blk_new_open
We have an errp and bdrv_root_attach_child can fail permission check, error_abort is not the best choice here. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
d282f34e82
commit
50bfbe93b2
1 changed files with 6 additions and 1 deletions
|
@ -213,7 +213,12 @@ BlockBackend *blk_new_open(const char *filename, const char *reference,
|
||||||
}
|
}
|
||||||
|
|
||||||
blk->root = bdrv_root_attach_child(bs, "root", &child_root,
|
blk->root = bdrv_root_attach_child(bs, "root", &child_root,
|
||||||
perm, BLK_PERM_ALL, blk, &error_abort);
|
perm, BLK_PERM_ALL, blk, errp);
|
||||||
|
if (!blk->root) {
|
||||||
|
bdrv_unref(bs);
|
||||||
|
blk_unref(blk);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return blk;
|
return blk;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue