diff options
author | Max Reitz <mreitz@redhat.com> | 2013-09-05 14:45:29 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-09-12 10:12:48 +0200 |
commit | 34b5d2c68eb4082c288e70fb99c61af8f7b96fde (patch) | |
tree | 7c4c1e4e248a8e044dd891b0e54de1fcc03d7434 /hw | |
parent | d5124c00d80b4d948509f2c7f6b54228d9981f75 (diff) |
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/xen_disk.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 668cc069ff..f35fc5944a 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -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; } |