[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH COLO-Frame (Base) v20 11/17] COLO: Synchronize PVM's
From: |
zhanghailiang |
Subject: |
[Qemu-devel] [PATCH COLO-Frame (Base) v20 11/17] COLO: Synchronize PVM's state to SVM periodically |
Date: |
Thu, 29 Sep 2016 16:46:31 +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 9a98caa..4a70e1d 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:
--
1.8.3.1
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 00/17] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT), zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 03/17] migration: Enter into COLO mode after migration if COLO is enabled, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 17/17] configure: Support enable/disable COLO feature, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 07/17] COLO: Add a new RunState RUN_STATE_COLO, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 15/17] COLO: Implement failover work for secondary VM, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 08/17] COLO: Send PVM state to secondary side when do checkpoint, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 16/17] docs: Add documentation for COLO feature, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 11/17] COLO: Synchronize PVM's state to SVM periodically,
zhanghailiang <=
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 05/17] COLO: Establish a new communicating path for COLO, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 04/17] migration: Switch to COLO process after finishing loadvm, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 01/17] migration: Introduce capability 'x-colo' to migration, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 12/17] COLO: Add 'x-colo-lost-heartbeat' command to trigger failover, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 13/17] COLO: Introduce state to record failover process, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 06/17] COLO: Introduce checkpointing protocol, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 09/17] COLO: Load VMState into QIOChannelBuffer before restore it, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 02/17] COLO: migrate COLO related info to secondary node, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 10/17] COLO: Add checkpoint-delay parameter for migrate-set-parameters, zhanghailiang, 2016/09/29
- [Qemu-devel] [PATCH COLO-Frame (Base) v20 14/17] COLO: Implement the process of failover for primary VM, zhanghailiang, 2016/09/29