Skip to contentSkip to conversation

Block patches for 2.5

GIT PULL Jeff Cody 2 participants 4 messages Dec 2, 2015 Block layer

lore
Share & tools
lore

Jeff Cody

author
#0 lore raw

The following changes since commit 680617ed43a2811318ac2df63e686f6b7bc22f55:

Merge remote-tracking branch 'remotes/weil/tags/pull-wxx-20151130' into staging (2015-11-30 15:35:20 +0000)

are available in the git repository at:

[email protected]:codyprime/qemu-kvm-jtc.git tags/block-pull-request

for you to fetch changes up to cdf45d4a6d694a394d89f0d8f72f4fefbd82be58:

mirror: Quiesce source during "mirror_exit" (2015-11-30 16:26:14 -0500)

----------------------------------------------------------------
Block patches for 2.5
----------------------------------------------------------------

Fam Zheng (1):
mirror: Quiesce source during "mirror_exit"

 block/mirror.c | 4 ++++
 1 file changed, 4 insertions(+)
Signature · 1 line
1.9.3
author
#1 lore raw

[Qemu-devel] [PULL 1/1] mirror: Quiesce source during "mirror_exit"

From: Fam Zheng <[email protected]>

With dataplane, the ioeventfd events could be dispatched after mirror_run releases the dirty bitmap, but before mirror_exit actually does the device switch, because the iothread will still be running, and it will cause silent data loss.

Fix this by adding a bdrv_drained_begin/end pair around the window, so that no new external request will be handled.

---
 block/mirror.c | 4 ++++
 1 file changed, 4 insertions(+)
block/mirror.c +4 -0
index 52c9abf..0e8f556 100644
@@ -388,6 +388,7 @@ static void mirror_exit(BlockJob *job, void *opaque)
     bdrv_unref(s->target);
     block_job_completed(&s->common, data->ret);
     g_free(data);
+    bdrv_drained_end(src);
     bdrv_unref(src);
 }
 
@@ -607,6 +608,9 @@ immediate_exit:
 
     data = g_malloc(sizeof(*data));
     data->ret = ret;
+    /* Before we switch to target in mirror_exit, make sure data doesn't
+     * change. */
+    bdrv_drained_begin(s->common.bs);
     block_job_defer_to_main_loop(&s->common, mirror_exit, data);
 }
 
Signature · 1 line
1.9.3
#2 lore raw
In reply to Jeff Cody
Quoted 17 lines · Jeff Cody

The following changes since commit 680617ed43a2811318ac2df63e686f6b7bc22f55:

Merge remote-tracking branch 'remotes/weil/tags/pull-wxx-20151130' into staging (2015-11-30 15:35:20 +0000)

are available in the git repository at:

[email protected]:codyprime/qemu-kvm-jtc.git tags/block-pull-request

for you to fetch changes up to cdf45d4a6d694a394d89f0d8f72f4fefbd82be58:

mirror: Quiesce source during "mirror_exit" (2015-11-30 16:26:14 -0500)

----------------------------------------------------------------
Block patches for 2.5
----------------------------------------------------------------

Quoted 5 lines

Fam Zheng (1):
mirror: Quiesce source during "mirror_exit"

 block/mirror.c | 4 ++++
 1 file changed, 4 insertions(+)

Hi. It looks like you forgot to add your own signoff to Fam's patch. Can you respin this pullreq, please?

thanks
-- PMM

author
#3 lore raw
Quoted 21 lines · Peter Maydell
Quoted 20 lines · Jeff Cody

The following changes since commit 680617ed43a2811318ac2df63e686f6b7bc22f55:

Merge remote-tracking branch 'remotes/weil/tags/pull-wxx-20151130' into staging (2015-11-30 15:35:20 +0000)

are available in the git repository at:

[email protected]:codyprime/qemu-kvm-jtc.git tags/block-pull-request

for you to fetch changes up to cdf45d4a6d694a394d89f0d8f72f4fefbd82be58:

mirror: Quiesce source during "mirror_exit" (2015-11-30 16:26:14 -0500)

----------------------------------------------------------------
Block patches for 2.5
----------------------------------------------------------------

Fam Zheng (1):
mirror: Quiesce source during "mirror_exit"

Quoted 8 lines
Quoted 2 lines
 block/mirror.c | 4 ++++
 1 file changed, 4 insertions(+)

Hi. It looks like you forgot to add your own signoff to Fam's patch. Can you respin this pullreq, please?

thanks
-- PMM

Sorry, yes.