summaryrefslogtreecommitdiff
path: root/block/backup.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-01-13 19:02:32 +0100
committerKevin Wolf <kwolf@redhat.com>2017-02-28 20:40:36 +0100
commitd7086422b1c1e75e320519cfe26176db6ec97a37 (patch)
tree5b8cc8a489ee05f6432288590f1b621bccfa39c4 /block/backup.c
parent6d0eb64d5c6d57017c52a4f36ccae1db79215ee1 (diff)
downloadqemu-d7086422b1c1e75e320519cfe26176db6ec97a37.tar.gz
block: Add error parameter to blk_insert_bs()
Now that blk_insert_bs() requests the BlockBackend permissions for the node it attaches to, it can fail. Instead of aborting, pass the errors to the callers. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/backup.c')
-rw-r--r--block/backup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/backup.c b/block/backup.c
index 4b3c94c812..f38d1d030e 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -626,7 +626,10 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
/* FIXME Use real permissions */
job->target = blk_new(0, BLK_PERM_ALL);
- blk_insert_bs(job->target, target);
+ ret = blk_insert_bs(job->target, target, errp);
+ if (ret < 0) {
+ goto error;
+ }
job->on_source_error = on_source_error;
job->on_target_error = on_target_error;