From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Eric Blake <eblake@redhat.com>, Jeff Cody <jcody@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH v2 2/2] commit: Don't use error_abort in commit_start
Date: Tue, 7 Mar 2017 19:07:22 +0800 [thread overview]
Message-ID: <20170307110722.12583-3-famz@redhat.com> (raw)
In-Reply-To: <20170307110722.12583-1-famz@redhat.com>
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>
---
block/commit.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index 22a0a4d..55f5cee 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);
--
2.9.3
next prev parent reply other threads:[~2017-03-07 11:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 11:07 [Qemu-devel] [PATCH v2 0/2] block: More robust error handling around perm check Fam Zheng
2017-03-07 11:07 ` [Qemu-devel] [PATCH v2 1/2] block: Don't use error_abort in blk_new_open Fam Zheng
2017-03-07 11:07 ` Fam Zheng [this message]
2017-03-07 12:39 ` [Qemu-devel] [PATCH v2 0/2] block: More robust error handling around perm check Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170307110722.12583-3-famz@redhat.com \
--to=famz@redhat.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).