From: Fam Zheng <famz@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Jeff Cody <jcody@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/6] block: Add blocker on mirror target
Date: Thu, 25 Jun 2015 10:27:40 +0800 [thread overview]
Message-ID: <20150625022740.GE17695@ad.nay.redhat.com> (raw)
In-Reply-To: <558AD771.3070000@redhat.com>
On Wed, 06/24 18:14, Max Reitz wrote:
> On 09.06.2015 04:13, Fam Zheng wrote:
> >In block/backup.c, we already check and add blocker on the target bs,
> >which is necessary so that it won't be intervened with other operations.
> >
> >In block/mirror.c we should also protect the mirror target bs, because it
> >could have a node-name (drive-mirror ... node-name=XXX), and on top of
> >that it's safe to add blockdev-mirror.
> >
> >Signed-off-by: Fam Zheng <famz@redhat.com>
> >---
> > block/mirror.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> >diff --git a/block/mirror.c b/block/mirror.c
> >index 33c640f..8b23ddd 100644
> >--- a/block/mirror.c
> >+++ b/block/mirror.c
> >@@ -360,6 +360,7 @@ static void mirror_exit(BlockJob *job, void *opaque)
> > aio_context_release(replace_aio_context);
> > }
> > g_free(s->replaces);
> >+ bdrv_op_unblock_all(s->target, s->common.blocker);
> > bdrv_unref(s->target);
> > block_job_completed(&s->common, data->ret);
> > g_free(data);
> >@@ -682,6 +683,7 @@ static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
> > return;
> > }
> >+ bdrv_op_block_all(target, s->common.blocker);
> > s->replaces = g_strdup(replaces);
> > s->on_source_error = on_source_error;
> > s->on_target_error = on_target_error;
>
> Do we need a bdrv_op_unblock_all() if bdrv_create_dirty_bitmap() fails?
>
Yes, good catch!
Fam
next prev parent reply other threads:[~2015-06-25 2:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 2:13 [Qemu-devel] [PATCH 0/6] qmp: Add blockdev-mirror Fam Zheng
2015-06-09 2:13 ` [Qemu-devel] [PATCH 1/6] block: Add blocker on mirror target Fam Zheng
2015-06-24 16:14 ` Max Reitz
2015-06-25 2:27 ` Fam Zheng [this message]
2015-06-09 2:13 ` [Qemu-devel] [PATCH 2/6] block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE Fam Zheng
2015-06-24 16:18 ` Max Reitz
2015-06-09 2:13 ` [Qemu-devel] [PATCH 3/6] block: Extract blockdev part of qmp_drive_mirror Fam Zheng
2015-06-24 16:34 ` Max Reitz
2015-06-25 2:33 ` Fam Zheng
2015-06-09 2:13 ` [Qemu-devel] [PATCH 4/6] block: Add check on mirror target Fam Zheng
2015-06-24 16:40 ` Max Reitz
2015-06-09 2:13 ` [Qemu-devel] [PATCH 5/6] qmp: Add blockdev-mirror command Fam Zheng
2015-06-24 17:05 ` Max Reitz
2015-06-09 2:13 ` [Qemu-devel] [PATCH 6/6] iotests: Add test cases for blockdev-mirror Fam Zheng
2015-06-24 17:10 ` Max Reitz
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=20150625022740.GE17695@ad.nay.redhat.com \
--to=famz@redhat.com \
--cc=armbru@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.