[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/20] replication: interrupt failover if the main de
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PULL 01/20] replication: interrupt failover if the main device is closed |
Date: |
Fri, 28 Oct 2016 22:49:06 +0800 |
From: Paolo Bonzini <address@hidden>
Without this change, there is a race condition in tests/test-replication.
Depending on how fast the failover job (active commit) runs, there is a
chance of two bad things happening:
1) replication_done can be called after the secondary has been closed
and hence when the BDRVReplicationState is not valid anymore.
2) two copies of the active disk are present during the
/replication/secondary/stop test (that test runs immediately after
/replication/secondary/start, which tests failover). This causes the
corruption detector to fire.
Reviewed-by: Wen Congyang <address@hidden>
Reviewed-by: Changlong Xie <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
---
block/replication.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/replication.c b/block/replication.c
index 8bbfc8f..a2747e7 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -138,6 +138,9 @@ static void replication_close(BlockDriverState *bs)
if (s->replication_state == BLOCK_REPLICATION_RUNNING) {
replication_stop(s->rs, false, NULL);
}
+ if (s->replication_state == BLOCK_REPLICATION_FAILOVER) {
+ block_job_cancel_sync(s->active_disk->bs->job);
+ }
if (s->mode == REPLICATION_MODE_SECONDARY) {
g_free(s->top_id);
--
2.7.4
- [Qemu-devel] [PULL 00/20] Block patches, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 01/20] replication: interrupt failover if the main device is closed,
Fam Zheng <=
- [Qemu-devel] [PULL 03/20] mirror: use bdrv_drained_begin/bdrv_drained_end, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 02/20] blockjob: introduce .drain callback for jobs, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 05/20] block: change drain to look only at one child at a time, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 04/20] block: add BDS field to count in-flight requests, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 06/20] qed: Implement .bdrv_drain, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 07/20] block: introduce BDRV_POLL_WHILE, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 09/20] nfs: use BDRV_POLL_WHILE, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 08/20] nfs: move nfs_set_events out of the while loops, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 11/20] aio: introduce qemu_get_current_aio_context, Fam Zheng, 2016/10/28
- [Qemu-devel] [PULL 10/20] sheepdog: use BDRV_POLL_WHILE, Fam Zheng, 2016/10/28