[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/18] COLO: Synchronize PVM's state to SVM periodica
From: |
Amit Shah |
Subject: |
[Qemu-devel] [PULL 11/18] COLO: Synchronize PVM's state to SVM periodically |
Date: |
Sun, 30 Oct 2016 16:17:03 +0530 |
From: zhanghailiang <address@hidden>
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>
Reviewed-by: Amit Shah <address@hidden>
Signed-off-by: Amit Shah <address@hidden>
---
migration/colo.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/migration/colo.c b/migration/colo.c
index bb9b870..a35cc59 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 "io/channel-buffer.h"
@@ -226,6 +227,7 @@ static void colo_process_checkpoint(MigrationState *s)
{
QIOChannelBuffer *bioc;
QEMUFile *fb = NULL;
+ int64_t current_time, checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
Error *local_err = NULL;
int ret;
@@ -254,10 +256,20 @@ 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.x_checkpoint_delay) {
+ int64_t delay_ms;
+
+ delay_ms = s->parameters.x_checkpoint_delay -
+ (current_time - checkpoint_time);
+ g_usleep(delay_ms * 1000);
+ }
ret = colo_do_checkpoint_transaction(s, bioc, fb);
if (ret < 0) {
goto out;
}
+ checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
}
out:
--
2.7.4
- [Qemu-devel] [PULL 05/18] COLO: Establish a new communicating path for COLO, (continued)
- [Qemu-devel] [PULL 05/18] COLO: Establish a new communicating path for COLO, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 06/18] COLO: Introduce checkpointing protocol, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 07/18] COLO: Add a new RunState RUN_STATE_COLO, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 08/18] COLO: Send PVM state to secondary side when do checkpoint, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 09/18] COLO: Load VMState into QIOChannelBuffer before restore it, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 10/18] COLO: Add checkpoint-delay parameter for migrate-set-parameters, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 11/18] COLO: Synchronize PVM's state to SVM periodically,
Amit Shah <=
- [Qemu-devel] [PULL 12/18] COLO: Add 'x-colo-lost-heartbeat' command to trigger failover, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 13/18] COLO: Introduce state to record failover process, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 14/18] COLO: Implement the process of failover for primary VM, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 15/18] COLO: Implement failover work for secondary VM, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 16/18] docs: Add documentation for COLO feature, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 17/18] configure: Support enable/disable COLO feature, Amit Shah, 2016/10/30
- [Qemu-devel] [PULL 18/18] MAINTAINERS: Add maintainer for COLO framework related files, Amit Shah, 2016/10/30
- Re: [Qemu-devel] [PULL 00/18] migration: COLO, Peter Maydell, 2016/10/31