diff options
author | Kevin Wolf | 2014-04-17 13:16:01 +0200 |
---|---|---|
committer | Kevin Wolf | 2014-04-22 12:00:20 +0200 |
commit | 98522f63f40adaebc412481e1d2e9170160d4539 (patch) | |
tree | 025ec57320b8fbec0eab0078506e41154833c111 /hw | |
parent | convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create() (diff) | |
download | qemu-98522f63f40adaebc412481e1d2e9170160d4539.tar.gz qemu-98522f63f40adaebc412481e1d2e9170160d4539.tar.xz qemu-98522f63f40adaebc412481e1d2e9170160d4539.zip |
block: Add errp to bdrv_new()
This patch adds an errp parameter to bdrv_new() and updates all its
callers. The next patches will make use of this in order to check for
duplicate IDs. Most of the callers know that their ID is fine, so they
can simply assert that there is no error.
Behaviour doesn't change with this patch yet as bdrv_new() doesn't
actually assign errors to errp.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/xen_disk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index bc061e6403..a8fea72edf 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -817,11 +817,14 @@ static int blk_connect(struct XenDevice *xendev) index = (blkdev->xendev.dev - 202 * 256) / 16; blkdev->dinfo = drive_get(IF_XEN, 0, index); if (!blkdev->dinfo) { + Error *local_err = NULL; /* setup via xenbus -> create new block driver instance */ xen_be_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n"); - blkdev->bs = bdrv_new(blkdev->dev); + blkdev->bs = bdrv_new(blkdev->dev, &local_err); + if (local_err) { + blkdev->bs = NULL; + } if (blkdev->bs) { - Error *local_err = NULL; BlockDriver *drv = bdrv_find_whitelisted_format(blkdev->fileproto, readonly); if (bdrv_open(&blkdev->bs, blkdev->filename, NULL, NULL, qflags, |