[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH COLO-Frame v16 16/35] COLO: synchronize PVM's state
From: |
zhanghailiang |
Subject: |
[Qemu-devel] [PATCH COLO-Frame v16 16/35] COLO: synchronize PVM's state to SVM periodically |
Date: |
Fri, 8 Apr 2016 14:26:18 +0800 |
Do checkpoint periodically, the default interval is 200ms.
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Li Zhijian <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
v12:
- Add Reviewed-by tag
v11:
- Fix wrong sleep time for checkpoint period. (Dave's comment)
---
migration/colo.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/migration/colo.c b/migration/colo.c
index 4dae069..4e3b39f 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -11,6 +11,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/timer.h"
#include "sysemu/sysemu.h"
#include "migration/colo.h"
#include "trace.h"
@@ -231,6 +232,7 @@ out:
static void colo_process_checkpoint(MigrationState *s)
{
QEMUSizedBuffer *buffer = NULL;
+ int64_t current_time, checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
Error *local_err = NULL;
int ret;
@@ -262,11 +264,21 @@ static void colo_process_checkpoint(MigrationState *s)
trace_colo_vm_state_change("stop", "run");
while (s->state == MIGRATION_STATUS_COLO) {
+ current_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
+ if (current_time - checkpoint_time <
+ s->parameters[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY]) {
+ int64_t delay_ms;
+
+ delay_ms = s->parameters[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY] -
+ (current_time - checkpoint_time);
+ g_usleep(delay_ms * 1000);
+ }
/* start a colo checkpoint */
ret = colo_do_checkpoint_transaction(s, buffer);
if (ret < 0) {
goto out;
}
+ checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
}
out:
--
1.8.3.1
- [Qemu-devel] [PATCH COLO-Frame v16 04/35] migration: Integrate COLO checkpoint process into migration, (continued)
- [Qemu-devel] [PATCH COLO-Frame v16 04/35] migration: Integrate COLO checkpoint process into migration, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 09/35] QEMUSizedBuffer: Introduce two help functions for qsb, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 13/35] COLO: Load VMState into qsb before restore it, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 10/35] COLO: Save PVM state to secondary side when do checkpoint, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 14/35] COLO: Flush PVM's cached RAM into SVM's memory, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 12/35] ram/COLO: Record the dirty pages that SVM received, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 23/35] COLO failover: Don't do failover during loading VM's state, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 20/35] COLO: Implement failover work for Secondary VM, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 16/35] COLO: synchronize PVM's state to SVM periodically,
zhanghailiang <=
- [Qemu-devel] [PATCH COLO-Frame v16 26/35] savevm: Introduce two helper functions for save/find loadvm_handlers entry, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 27/35] migration/savevm: Add new helpers to process the different stages of loadvm, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 28/35] migration/savevm: Export two helper functions for savevm process, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 24/35] COLO: Process shutdown command for VM in COLO state, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 21/35] qmp event: Add COLO_EXIT event to notify users while exited from COLO, zhanghailiang, 2016/04/08
- [Qemu-devel] [PATCH COLO-Frame v16 19/35] COLO: Implement failover work for Primary VM, zhanghailiang, 2016/04/08