mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
block: Error parameter for open functions
Add an Error ** parameter to bdrv_open, bdrv_file_open and associated functions to allow more specific error messages. Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
d5124c00d8
commit
34b5d2c68e
17 changed files with 163 additions and 85 deletions
|
@ -809,10 +809,15 @@ static int blk_connect(struct XenDevice *xendev)
|
|||
xen_be_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n");
|
||||
blkdev->bs = bdrv_new(blkdev->dev);
|
||||
if (blkdev->bs) {
|
||||
Error *local_err = NULL;
|
||||
BlockDriver *drv = bdrv_find_whitelisted_format(blkdev->fileproto,
|
||||
readonly);
|
||||
if (bdrv_open(blkdev->bs,
|
||||
blkdev->filename, NULL, qflags, drv) != 0) {
|
||||
blkdev->filename, NULL, qflags, drv, &local_err) != 0)
|
||||
{
|
||||
xen_be_printf(&blkdev->xendev, 0, "error: %s\n",
|
||||
error_get_pretty(local_err));
|
||||
error_free(local_err);
|
||||
bdrv_unref(blkdev->bs);
|
||||
blkdev->bs = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue