summary refs log tree commit diff stats
path: root/block/commit.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-03-07 19:07:22 +0800
committerKevin Wolf <kwolf@redhat.com>2017-03-07 14:53:29 +0100
commitb69f00dde490e88d55f5ee731545e690b2dc61f8 (patch)
tree5d5ebab3a635015dc31888ba2ce19a42bf23e29e /block/commit.c
parent50bfbe93b2ca0ab795f3de305bec5ab1df620be4 (diff)
downloadfocaccia-qemu-b69f00dde490e88d55f5ee731545e690b2dc61f8.tar.gz
focaccia-qemu-b69f00dde490e88d55f5ee731545e690b2dc61f8.zip
commit: Don't use error_abort in commit_start
bdrv_set_backing_hd failure needn't be abort. Since we already have
error parameter, use it.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r--block/commit.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/block/commit.c b/block/commit.c
index e57c1cffa2..9c4198837f 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -316,8 +316,20 @@ void commit_start(const char *job_id, BlockDriverState *bs,
         goto fail;
     }
 
-    bdrv_set_backing_hd(commit_top_bs, top, &error_abort);
-    bdrv_set_backing_hd(overlay_bs, commit_top_bs, &error_abort);
+    bdrv_set_backing_hd(commit_top_bs, top, &local_err);
+    if (local_err) {
+        bdrv_unref(commit_top_bs);
+        commit_top_bs = NULL;
+        error_propagate(errp, local_err);
+        goto fail;
+    }
+    bdrv_set_backing_hd(overlay_bs, commit_top_bs, &local_err);
+    if (local_err) {
+        bdrv_unref(commit_top_bs);
+        commit_top_bs = NULL;
+        error_propagate(errp, local_err);
+        goto fail;
+    }
 
     s->commit_top_bs = commit_top_bs;
     bdrv_unref(commit_top_bs);