mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
bdrv: Use "Error" for opening images
Add an Error ** parameter to BlockDriver.bdrv_open and BlockDriver.bdrv_file_open to allow more specific error messages. Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
8023090be5
commit
015a1036a7
28 changed files with 67 additions and 37 deletions
4
block.c
4
block.c
|
@ -761,7 +761,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
|
|||
if (drv->bdrv_file_open) {
|
||||
assert(file == NULL);
|
||||
assert(drv->bdrv_parse_filename || filename != NULL);
|
||||
ret = drv->bdrv_file_open(bs, options, open_flags);
|
||||
ret = drv->bdrv_file_open(bs, options, open_flags, NULL);
|
||||
} else {
|
||||
if (file == NULL) {
|
||||
qerror_report(ERROR_CLASS_GENERIC_ERROR, "Can't use '%s' as a "
|
||||
|
@ -771,7 +771,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
|
|||
goto free_and_fail;
|
||||
}
|
||||
bs->file = file;
|
||||
ret = drv->bdrv_open(bs, options, open_flags);
|
||||
ret = drv->bdrv_open(bs, options, open_flags, NULL);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue