[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/18] replication: interrupt failover if the main d
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 01/18] replication: interrupt failover if the main device is closed |
Date: |
Thu, 13 Oct 2016 19:34:05 +0200 |
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>
---
block/replication.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/replication.c b/block/replication.c
index 3bd1cf1..5231a00 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -133,6 +133,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] [PATCH 00/18] dataplane: remove RFifoLock (including almost all previously sent patches), Paolo Bonzini, 2016/10/13
- [Qemu-devel] [PATCH 01/18] replication: interrupt failover if the main device is closed,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 03/18] mirror: use bdrv_drained_begin/bdrv_drained_end, Paolo Bonzini, 2016/10/13
- [Qemu-devel] [PATCH 02/18] blockjob: introduce .drain callback for jobs, Paolo Bonzini, 2016/10/13
- [Qemu-devel] [PATCH 05/18] block: change drain to look only at one child at a time, Paolo Bonzini, 2016/10/13
- [Qemu-devel] [PATCH 04/18] block: add BDS field to count in-flight requests, Paolo Bonzini, 2016/10/13
- [Qemu-devel] [PATCH 06/18] qed: Implement .bdrv_drain, Paolo Bonzini, 2016/10/13