[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 10/17] COLO ctl: introduce is_slave() and is_mas
From: |
Yang Hongyang |
Subject: |
[Qemu-devel] [RFC PATCH 10/17] COLO ctl: introduce is_slave() and is_master() |
Date: |
Wed, 23 Jul 2014 22:25:31 +0800 |
is_slaver is to determine whether the QEMU instance is a
slaver(migration target) at runtime.
is_master is to determine whether the QEMU instance is a
master(migration starter) at runtime.
This 2 APIs will be used later.
Signed-off-by: Yang Hongyang <address@hidden>
---
migration-colo.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/migration-colo.c b/migration-colo.c
index 802f8b0..2699e77 100644
--- a/migration-colo.c
+++ b/migration-colo.c
@@ -187,6 +187,12 @@ static const QEMUFileOps colo_read_ops = {
/* save */
+static __attribute__((unused)) bool is_master(void)
+{
+ MigrationState *s = migrate_get_current();
+ return (s->state == MIG_STATE_COLO);
+}
+
static void *colo_thread(void *opaque)
{
MigrationState *s = opaque;
@@ -275,6 +281,11 @@ void colo_init_checkpointer(MigrationState *s)
static Coroutine *colo;
+static __attribute__((unused)) bool is_slave(void)
+{
+ return colo != NULL;
+}
+
/*
* return:
* 0: start a checkpoint
--
1.9.1
- [Qemu-devel] [RFC PATCH 00/17] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 01/17] configure: add CONFIG_COLO to switch COLO support, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 03/17] COLO migration: add a migration capability 'colo', Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 04/17] COLO info: use colo info to tell migration target colo is enabled, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 05/17] COLO save: integrate COLO checkpointed save into qemu migration, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 06/17] COLO restore: integrate COLO checkpointed restore into qemu restore, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 08/17] COLO: disable qdev hotplug, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 07/17] COLO buffer: implement colo buffer as well as QEMUFileOps based on it, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 09/17] COLO ctl: implement API's that communicate with colo agent, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 10/17] COLO ctl: introduce is_slave() and is_master(),
Yang Hongyang <=
- [Qemu-devel] [RFC PATCH 02/17] COLO: introduce an api colo_supported() to indicate COLO support, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 12/17] COLO ctl: add a RunState RUN_STATE_COLO, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 11/17] COLO ctl: implement colo checkpoint protocol, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 13/17] COLO ctl: implement colo save, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 14/17] COLO ctl: implement colo restore, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 15/17] COLO save: reuse migration bitmap under colo checkpoint, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 16/17] COLO ram cache: implement colo ram cache on slaver, Yang Hongyang, 2014/07/23
- [Qemu-devel] [RFC PATCH 17/17] HACK: trigger checkpoint every 500ms, Yang Hongyang, 2014/07/23