[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] Changed the last-mode to none of first start COLO
From: |
Lei Rao |
Subject: |
[PATCH 6/7] Changed the last-mode to none of first start COLO |
Date: |
Thu, 17 Jun 2021 10:47:14 +0800 |
From: "Rao, Lei" <lei.rao@intel.com>
When we first stated the COLO, the last-mode is as follows:
{ "execute": "query-colo-status" }
{"return": {"last-mode": "primary", "mode": "primary", "reason": "none"}}
The last-mode is unreasonable. After the patch, will be changed to the
following:
{ "execute": "query-colo-status" }
{"return": {"last-mode": "none", "mode": "primary", "reason": "none"}}
Signed-off-by: Lei Rao <lei.rao@intel.com>
---
migration/colo.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/migration/colo.c b/migration/colo.c
index e2ab349..69a2501 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -206,7 +206,7 @@ void colo_do_failover(void)
vm_stop_force_state(RUN_STATE_COLO);
}
- switch (get_colo_mode()) {
+ switch (last_colo_mode = get_colo_mode()) {
case COLO_MODE_PRIMARY:
primary_vm_do_failover();
break;
@@ -531,8 +531,7 @@ static void colo_process_checkpoint(MigrationState *s)
Error *local_err = NULL;
int ret;
- last_colo_mode = get_colo_mode();
- if (last_colo_mode != COLO_MODE_PRIMARY) {
+ if (get_colo_mode() != COLO_MODE_PRIMARY) {
error_report("COLO mode must be COLO_MODE_PRIMARY");
return;
}
@@ -830,8 +829,7 @@ void *colo_process_incoming_thread(void *opaque)
migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
MIGRATION_STATUS_COLO);
- last_colo_mode = get_colo_mode();
- if (last_colo_mode != COLO_MODE_SECONDARY) {
+ if (get_colo_mode() != COLO_MODE_SECONDARY) {
error_report("COLO mode must be COLO_MODE_SECONDARY");
return NULL;
}
--
1.8.3.1
- [PATCH 0/7] Fixed some bugs and optimized some codes for COLO, Lei Rao, 2021/06/16
- [PATCH 1/7] Some minor optimizations for COLO, Lei Rao, 2021/06/16
- [PATCH 2/7] Fixed qemu crash when guest power off in COLO mode, Lei Rao, 2021/06/16
- [PATCH 3/7] Fixed SVM hang when do failover before PVM crash, Lei Rao, 2021/06/16
- [PATCH 4/7] colo: fixed 'Segmentation fault' when the simplex mode PVM poweroff, Lei Rao, 2021/06/16
- [PATCH 6/7] Changed the last-mode to none of first start COLO,
Lei Rao <=
- [PATCH 5/7] Removed the qemu_fclose() in colo_process_incoming_thread, Lei Rao, 2021/06/16
- [PATCH 7/7] Optimized the function of fill_connection_key., Lei Rao, 2021/06/16