qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 1/6] block: Add blocker on mirror target


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH 1/6] block: Add blocker on mirror target
Date: Wed, 24 Jun 2015 18:14:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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 <address@hidden>
---
  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?

Max



reply via email to

[Prev in Thread] Current Thread [Next in Thread]