diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-03-06 16:20:51 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-03-07 14:53:28 +0100 |
commit | 5fe31c25cce3b09e989e40439667cd4961aba969 (patch) | |
tree | 0b9809f4e3af0d80e817a65d0723f305dfe187ae /include | |
parent | 234ac1a9025bcfcc532449f72a97b3d4754d466c (diff) | |
download | qemu-5fe31c25cce3b09e989e40439667cd4961aba969.zip qemu-5fe31c25cce3b09e989e40439667cd4961aba969.tar.gz qemu-5fe31c25cce3b09e989e40439667cd4961aba969.tar.bz2 |
block: Fix error handling in bdrv_replace_in_backing_chain()
When adding an Error parameter, bdrv_replace_in_backing_chain() would
become nothing more than a wrapper around change_parent_backing_link().
So make the latter public, renamed as bdrv_replace_node(), and remove
bdrv_replace_in_backing_chain().
Most of the callers just remove a node from the graph that they just
inserted, so they can use &error_abort, but completion of a mirror job
with 'replaces' set can actually fail.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block.h | 4 | ||||
-rw-r--r-- | include/block/block_int.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/block/block.h b/include/block/block.h index c7c4a3a..5149260 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -238,8 +238,8 @@ 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_in_backing_chain(BlockDriverState *old, - BlockDriverState *new); +void bdrv_replace_node(BlockDriverState *from, BlockDriverState *to, + Error **errp); int bdrv_parse_cache_mode(const char *mode, int *flags, bool *writethrough); int bdrv_parse_discard_flags(const char *mode, int *flags); diff --git a/include/block/block_int.h b/include/block/block_int.h index fc83f7f..6c699ac 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -441,8 +441,8 @@ typedef struct BdrvAioNotifier { } BdrvAioNotifier; struct BdrvChildRole { - /* If true, bdrv_replace_in_backing_chain() doesn't change the node this - * BdrvChild points to. */ + /* If true, bdrv_replace_node() doesn't change the node this BdrvChild + * points to. */ bool stay_at_node; void (*inherit_options)(int *child_flags, QDict *child_options, |