[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V6 17/17] COLO: quick failover process by kick COLO
From: |
Zhang Chen |
Subject: |
[Qemu-devel] [PATCH V6 17/17] COLO: quick failover process by kick COLO thread |
Date: |
Sun, 11 Mar 2018 15:45:14 +0800 |
From: zhanghailiang <address@hidden>
COLO thread may sleep at qemu_sem_wait(&s->colo_checkpoint_sem),
while failover works begin, It's better to wakeup it to quick
the process.
Signed-off-by: zhanghailiang <address@hidden>
---
migration/colo.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/migration/colo.c b/migration/colo.c
index 1a59baa..1bc5f02 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -134,6 +134,11 @@ static void primary_vm_do_failover(void)
migrate_set_state(&s->state, MIGRATION_STATUS_COLO,
MIGRATION_STATUS_COMPLETED);
+ /*
+ * kick COLO thread which might wait at
+ * qemu_sem_wait(&s->colo_checkpoint_sem).
+ */
+ colo_checkpoint_notify(migrate_get_current());
/*
* Wake up COLO thread which may blocked in recv() or send(),
@@ -549,6 +554,9 @@ static void colo_process_checkpoint(MigrationState *s)
qemu_sem_wait(&s->colo_checkpoint_sem);
+ if (s->state != MIGRATION_STATUS_COLO) {
+ goto out;
+ }
ret = colo_do_checkpoint_transaction(s, bioc, fb);
if (ret < 0) {
goto out;
--
2.7.4
- [Qemu-devel] [PATCH V6 07/17] COLO: Load dirty pages into SVM's RAM cache firstly, (continued)
- [Qemu-devel] [PATCH V6 07/17] COLO: Load dirty pages into SVM's RAM cache firstly, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 08/17] ram/COLO: Record the dirty pages that SVM received, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 09/17] COLO: Flush memory data from ram cache, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 10/17] qmp event: Add COLO_EXIT event to notify users while exited COLO, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 11/17] qapi: Add new command to query colo status, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 12/17] savevm: split the process of different stages for loadvm/savevm, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 13/17] COLO: flush host dirty ram from cache, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 14/17] filter: Add handle_event method for NetFilterClass, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 15/17] filter-rewriter: handle checkpoint and failover event, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 16/17] COLO: notify net filters about checkpoint/failover event, Zhang Chen, 2018/03/11
- [Qemu-devel] [PATCH V6 17/17] COLO: quick failover process by kick COLO thread,
Zhang Chen <=