diff options
author | Max Reitz <mreitz@redhat.com> | 2016-05-17 16:41:31 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-05-25 19:04:10 +0200 |
commit | 5b3639371c3e220b41cd2eae8c34c49ad38ef527 (patch) | |
tree | 0f46cc379f81b2ed90b97a36e3fd1b6687e6958a /include | |
parent | 9bddf759790cf1b9c46889f8f8370c90e6ca7610 (diff) |
block: Make bdrv_open() return a BDS
There are no callers to bdrv_open() or bdrv_open_inherit() left that
pass a pointer to a non-NULL BDS pointer as the first argument of these
functions, so we can finally drop that parameter and just make them
return the new BDS.
Generally, the following pattern is applied:
bs = NULL;
ret = bdrv_open(&bs, ..., &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
...
}
by
bs = bdrv_open(..., errp);
if (!bs) {
ret = -EINVAL;
...
}
Of course, there are only a few instances where the pattern is really
pure.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/block.h b/include/block/block.h index 348e4783f0..e899f7d3c0 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -212,8 +212,8 @@ BdrvChild *bdrv_open_child(const char *filename, void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd); int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, const char *bdref_key, Error **errp); -int bdrv_open(BlockDriverState **pbs, const char *filename, - const char *reference, QDict *options, int flags, Error **errp); +BlockDriverState *bdrv_open(const char *filename, const char *reference, + QDict *options, int flags, Error **errp); BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue, BlockDriverState *bs, QDict *options, int flags); |