diff options
| author | zhanghailiang <zhang.zhanghailiang@huawei.com> | 2016-10-27 14:42:54 +0800 |
|---|---|---|
| committer | Amit Shah <amit@amitshah.net> | 2016-10-30 15:17:39 +0530 |
| commit | 0b827d5e7291193887d22d058bc20c12b423047c (patch) | |
| tree | b8f52184446a2936eb9f5f57789975fea882727a /migration/colo.c | |
| parent | 5821ebf93b1da9f74dc04c20e2923aadfaf803df (diff) | |
| download | focaccia-qemu-0b827d5e7291193887d22d058bc20c12b423047c.tar.gz focaccia-qemu-0b827d5e7291193887d22d058bc20c12b423047c.zip | |
migration: Enter into COLO mode after migration if COLO is enabled
Add a new migration state: MIGRATION_STATUS_COLO. Migration source side enters this state after the first live migration successfully finished if COLO is enabled by command 'migrate_set_capability x-colo on'. We reuse migration thread, so the process of checkpointing will be handled in migration thread. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amit Shah <amit@amitshah.net>
Diffstat (limited to 'migration/colo.c')
| -rw-r--r-- | migration/colo.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/migration/colo.c b/migration/colo.c index d21505794e..f480431972 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -11,9 +11,38 @@ */ #include "qemu/osdep.h" +#include "sysemu/sysemu.h" #include "migration/colo.h" +#include "trace.h" bool colo_supported(void) { return false; } + +bool migration_in_colo_state(void) +{ + MigrationState *s = migrate_get_current(); + + return (s->state == MIGRATION_STATUS_COLO); +} + +static void colo_process_checkpoint(MigrationState *s) +{ + qemu_mutex_lock_iothread(); + vm_start(); + qemu_mutex_unlock_iothread(); + trace_colo_vm_state_change("stop", "run"); + + /* TODO: COLO checkpoint savevm loop */ + +} + +void migrate_start_colo_process(MigrationState *s) +{ + qemu_mutex_unlock_iothread(); + migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, + MIGRATION_STATUS_COLO); + colo_process_checkpoint(s); + qemu_mutex_lock_iothread(); +} |