From: Paolo Bonzini <pbonzini@redhat.com>
To: Changlong Xie <xiecl.fnst@cn.fujitsu.com>,
qemu devel <qemu-devel@nongnu.org>, Jeff Cody <jcody@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
Max Reitz <mreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] blockjob: assert(cb) in the entry functions of blockjob
Date: Wed, 22 Jun 2016 11:50:47 +0200 [thread overview]
Message-ID: <2b17fa8d-d2bb-d20e-2445-e010aa7066b1@redhat.com> (raw)
In-Reply-To: <1466587008-3933-2-git-send-email-xiecl.fnst@cn.fujitsu.com>
On 22/06/2016 11:16, Changlong Xie wrote:
> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
> ---
> block/commit.c | 1 +
> block/mirror.c | 2 ++
> block/stream.c | 1 +
> 3 files changed, 4 insertions(+)
Why is this useful?
Paolo
> diff --git a/block/commit.c b/block/commit.c
> index 444333b..13b55c1 100644
> --- a/block/commit.c
> +++ b/block/commit.c
> @@ -223,6 +223,7 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base,
> BlockDriverState *overlay_bs;
> Error *local_err = NULL;
>
> + assert(cb);
> assert(top != bs);
> if (top == base) {
> error_setg(errp, "Invalid files for merge: top and base are the same");
> diff --git a/block/mirror.c b/block/mirror.c
> index a04ed9c..fa2bdab 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -912,6 +912,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target,
> bool is_none_mode;
> BlockDriverState *base;
>
> + assert(cb);
> if (mode == MIRROR_SYNC_MODE_INCREMENTAL) {
> error_setg(errp, "Sync mode 'incremental' not supported");
> return;
> @@ -935,6 +936,7 @@ void commit_active_start(BlockDriverState *bs, BlockDriverState *base,
> int ret;
> Error *local_err = NULL;
>
> + assert(cb);
> orig_base_flags = bdrv_get_flags(base);
>
> if (bdrv_reopen(base, bs->open_flags, errp)) {
> diff --git a/block/stream.c b/block/stream.c
> index c0efbda..fc34c63 100644
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -226,6 +226,7 @@ void stream_start(BlockDriverState *bs, BlockDriverState *base,
> {
> StreamBlockJob *s;
>
> + assert(cb);
> s = block_job_create(&stream_job_driver, bs, speed, cb, opaque, errp);
> if (!s) {
> return;
>
next prev parent reply other threads:[~2016-06-22 9:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 9:16 [Qemu-devel] [PATCH 0/2] small fix of block job Changlong Xie
2016-06-22 9:16 ` [Qemu-devel] [PATCH 1/2] blockjob: assert(cb) in the entry functions of blockjob Changlong Xie
2016-06-22 9:50 ` Paolo Bonzini [this message]
2016-06-22 10:12 ` Changlong Xie
2016-06-22 10:19 ` Paolo Bonzini
2016-06-22 17:31 ` Eric Blake
2016-06-23 1:04 ` Changlong Xie
2016-06-23 6:21 ` Kevin Wolf
2016-06-23 6:57 ` Changlong Xie
2016-06-22 9:16 ` [Qemu-devel] [PATCH 2/2] mirror: fix misleading comments Changlong Xie
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=2b17fa8d-d2bb-d20e-2445-e010aa7066b1@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xiecl.fnst@cn.fujitsu.com \
/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).