mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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:
parent
6d0eb64d5c
commit
d7086422b1
14 changed files with 100 additions and 29 deletions
5
block.c
5
block.c
|
@ -2194,8 +2194,11 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
|||
}
|
||||
if (file_bs != NULL) {
|
||||
file = blk_new(BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL);
|
||||
blk_insert_bs(file, file_bs);
|
||||
blk_insert_bs(file, file_bs, &local_err);
|
||||
bdrv_unref(file_bs);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
qdict_put(options, "file",
|
||||
qstring_from_str(bdrv_get_node_name(file_bs)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue