diff options
author | Vladimir Sementsov-Ogievskiy | 2021-02-02 13:49:43 +0100 |
---|---|---|
committer | Eric Blake | 2021-02-12 22:36:41 +0100 |
commit | a1e708fcda5eab10c866a7d6a4fad4f80b69ad15 (patch) | |
tree | 96e2c16bf9c770920cb0d74933ae6cb8a01f3fef /include/block | |
parent | qemu-iotests: 300: Add test case for modifying persistence of bitmap (diff) | |
download | qemu-a1e708fcda5eab10c866a7d6a4fad4f80b69ad15.tar.gz qemu-a1e708fcda5eab10c866a7d6a4fad4f80b69ad15.tar.xz qemu-a1e708fcda5eab10c866a7d6a4fad4f80b69ad15.zip |
block: return status from bdrv_append and friends
The recommended use of qemu error api assumes returning status together
with setting errp and avoid void functions with errp parameter. Let's
improve bdrv_append and some friends to reduce error-propagation
overhead in further patches.
Choose int return status, because bdrv_replace_node_common() has call
to bdrv_check_update_perm(), which reports int status, which seems
correct to propagate.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210202124956.63146-2-vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/block/block.h b/include/block/block.h index 0a9f2c187c..2c235a29e8 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -356,10 +356,10 @@ int bdrv_create(BlockDriver *drv, const char* filename, int bdrv_create_file(const char *filename, QemuOpts *opts, Error **errp); BlockDriverState *bdrv_new(void); -void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top, - Error **errp); -void bdrv_replace_node(BlockDriverState *from, BlockDriverState *to, - Error **errp); +int bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top, + Error **errp); +int bdrv_replace_node(BlockDriverState *from, BlockDriverState *to, + Error **errp); BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *node_options, int flags, Error **errp); @@ -373,8 +373,8 @@ BdrvChild *bdrv_open_child(const char *filename, BdrvChildRole child_role, bool allow_none, Error **errp); BlockDriverState *bdrv_open_blockdev_ref(BlockdevRef *ref, Error **errp); -void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd, - Error **errp); +int bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd, + Error **errp); int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, const char *bdref_key, Error **errp); BlockDriverState *bdrv_open(const char *filename, const char *reference, |