From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, quintela@redhat.com, dgilbert@redhat.com,
eblake@redhat.com, peter.huangpeng@huawei.com,
eddie.dong@intel.com, yunhong.jiang@intel.com,
wency@cn.fujitsu.com, lizhijian@cn.fujitsu.com,
arei.gonglei@huawei.com, stefanha@redhat.com,
hongyang.yang@easystack.cn, zhangchen.fnst@cn.fujitsu.com,
xiecl.fnst@cn.fujitsu.com, armbru@redhat.com,
zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: [Qemu-devel] [PATCH COLO-Frame v16 02/35] migration: Introduce capability 'x-colo' to migration
Date: Fri, 8 Apr 2016 14:26:04 +0800 [thread overview]
Message-ID: <1460096797-14916-3-git-send-email-zhang.zhanghailiang@huawei.com> (raw)
In-Reply-To: <1460096797-14916-1-git-send-email-zhang.zhanghailiang@huawei.com>
We add helper function colo_supported() to indicate whether
colo is supported or not, with which we use to control whether or not
showing 'x-colo' string to users, they can use qmp command
'query-migrate-capabilities' or hmp command 'info migrate_capabilities'
to learn if colo is supported.
Cc: Juan Quintela <quintela@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
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: Eric Blake <eblake@redhat.com>
---
v16:
- fix compile broken due to missing osdep.h
v14:
- Fix the date of Copyright to 2016
v10:
- Rename capability 'colo' to experimental 'x-colo' (Eric's suggestion).
- Rename migrate_enable_colo() to migrate_colo_enabled() (Eric's suggestion).
---
include/migration/colo.h | 20 ++++++++++++++++++++
include/migration/migration.h | 1 +
migration/Makefile.objs | 1 +
migration/colo.c | 19 +++++++++++++++++++
migration/migration.c | 18 ++++++++++++++++++
qapi-schema.json | 6 +++++-
qmp-commands.hx | 2 +-
stubs/Makefile.objs | 1 +
stubs/migration-colo.c | 19 +++++++++++++++++++
9 files changed, 85 insertions(+), 2 deletions(-)
create mode 100644 include/migration/colo.h
create mode 100644 migration/colo.c
create mode 100644 stubs/migration-colo.c
diff --git a/include/migration/colo.h b/include/migration/colo.h
new file mode 100644
index 0000000..59a632a
--- /dev/null
+++ b/include/migration/colo.h
@@ -0,0 +1,20 @@
+/*
+ * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
+ * (a.k.a. Fault Tolerance or Continuous Replication)
+ *
+ * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
+ * Copyright (c) 2016 FUJITSU LIMITED
+ * Copyright (c) 2016 Intel Corporation
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_COLO_H
+#define QEMU_COLO_H
+
+#include "qemu-common.h"
+
+bool colo_supported(void);
+
+#endif
diff --git a/include/migration/migration.h b/include/migration/migration.h
index ac2c12c..f6b641a 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -276,6 +276,7 @@ int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen);
int migrate_use_xbzrle(void);
int64_t migrate_xbzrle_cache_size(void);
+bool migrate_colo_enabled(void);
int64_t xbzrle_cache_resize(int64_t new_size);
diff --git a/migration/Makefile.objs b/migration/Makefile.objs
index 0cac6d7..65ecc35 100644
--- a/migration/Makefile.objs
+++ b/migration/Makefile.objs
@@ -1,4 +1,5 @@
common-obj-y += migration.o tcp.o
+common-obj-$(CONFIG_COLO) += colo.o
common-obj-y += vmstate.o
common-obj-y += qemu-file.o qemu-file-buf.o qemu-file-unix.o qemu-file-stdio.o
common-obj-y += xbzrle.o postcopy-ram.o
diff --git a/migration/colo.c b/migration/colo.c
new file mode 100644
index 0000000..5749016
--- /dev/null
+++ b/migration/colo.c
@@ -0,0 +1,19 @@
+/*
+ * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
+ * (a.k.a. Fault Tolerance or Continuous Replication)
+ *
+ * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
+ * Copyright (c) 2016 FUJITSU LIMITED
+ * Copyright (c) 2016 Intel Corporation
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "migration/colo.h"
+
+bool colo_supported(void)
+{
+ return true;
+}
diff --git a/migration/migration.c b/migration/migration.c
index 991313a..b6cd130 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -34,6 +34,7 @@
#include "qom/cpu.h"
#include "exec/memory.h"
#include "exec/address-spaces.h"
+#include "migration/colo.h"
#define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttling */
@@ -494,6 +495,9 @@ MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp)
caps = NULL; /* silence compiler warning */
for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) {
+ if (i == MIGRATION_CAPABILITY_X_COLO && !colo_supported()) {
+ continue;
+ }
if (head == NULL) {
head = g_malloc0(sizeof(*caps));
caps = head;
@@ -694,6 +698,14 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
}
for (cap = params; cap; cap = cap->next) {
+ if (cap->value->capability == MIGRATION_CAPABILITY_X_COLO) {
+ if (!colo_supported()) {
+ error_setg(errp, "COLO is not currently supported, please"
+ " configure with --enable-colo option in order to"
+ " support COLO feature");
+ continue;
+ }
+ }
s->enabled_capabilities[cap->value->capability] = cap->value->state;
}
@@ -1615,6 +1627,12 @@ fail:
MIGRATION_STATUS_FAILED);
}
+bool migrate_colo_enabled(void)
+{
+ MigrationState *s = migrate_get_current();
+ return s->enabled_capabilities[MIGRATION_CAPABILITY_X_COLO];
+}
+
/*
* Master migration thread on the source VM.
* It drives the migration and pumps the data down the outgoing channel.
diff --git a/qapi-schema.json b/qapi-schema.json
index 54634c4..1d22e96 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -544,11 +544,15 @@
# been migrated, pulling the remaining pages along as needed. NOTE: If
# the migration fails during postcopy the VM will fail. (since 2.6)
#
+# @x-colo: If enabled, migration will never end, and the state of the VM on the
+# primary side will be migrated continuously to the VM on secondary
+# side. (since 2.7)
+#
# Since: 1.2
##
{ 'enum': 'MigrationCapability',
'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
- 'compress', 'events', 'postcopy-ram'] }
+ 'compress', 'events', 'postcopy-ram', 'x-colo'] }
##
# @MigrationCapabilityStatus
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 8856256..3ff05aa 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3751,7 +3751,7 @@ Query current migration capabilities
- "zero-blocks" : Zero Blocks state (json-bool)
- "compress": Multiple compression threads state (json-bool)
- "events": Migration state change event state (json-bool)
- - "postcopy-ram": postcopy ram state (json-bool)
+ - "x-colo" : COarse-Grain LOck Stepping for Non-stop Service (json-bool)
Arguments:
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index b6d1e65..e79816b 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -40,3 +40,4 @@ stub-obj-y += qmp_pc_dimm_device_list.o
stub-obj-y += target-monitor-defs.o
stub-obj-y += target-get-monitor-def.o
stub-obj-y += vhost.o
+stub-obj-y += migration-colo.o
diff --git a/stubs/migration-colo.c b/stubs/migration-colo.c
new file mode 100644
index 0000000..d215057
--- /dev/null
+++ b/stubs/migration-colo.c
@@ -0,0 +1,19 @@
+/*
+ * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
+ * (a.k.a. Fault Tolerance or Continuous Replication)
+ *
+ * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
+ * Copyright (c) 2016 FUJITSU LIMITED
+ * Copyright (c) 2016 Intel Corporation
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "migration/colo.h"
+
+bool colo_supported(void)
+{
+ return false;
+}
--
1.8.3.1
next prev parent reply other threads:[~2016-04-08 6:27 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 6:26 [Qemu-devel] [PATCH COLO-Frame v16 for-2.7 00/35] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT) zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 01/35] configure: Add parameter for configure to enable/disable COLO support zhanghailiang
2016-04-08 6:26 ` zhanghailiang [this message]
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 03/35] COLO: migrate colo related info to secondary node zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 04/35] migration: Integrate COLO checkpoint process into migration zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 05/35] migration: Integrate COLO checkpoint process into loadvm zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 06/35] COLO/migration: Create a new communication path from destination to source zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 07/35] COLO: Implement colo checkpoint protocol zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 08/35] COLO: Add a new RunState RUN_STATE_COLO zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 09/35] QEMUSizedBuffer: Introduce two help functions for qsb zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 10/35] COLO: Save PVM state to secondary side when do checkpoint zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 11/35] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 12/35] ram/COLO: Record the dirty pages that SVM received zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 13/35] COLO: Load VMState into qsb before restore it zhanghailiang
2016-04-22 10:12 ` Dr. David Alan Gilbert
2016-04-25 9:17 ` Hailiang Zhang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 14/35] COLO: Flush PVM's cached RAM into SVM's memory zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 15/35] COLO: Add checkpoint-delay parameter for migrate-set-parameters zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 16/35] COLO: synchronize PVM's state to SVM periodically zhanghailiang
2016-04-12 3:02 ` Li Zhijian
2016-04-12 13:01 ` Hailiang Zhang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 17/35] COLO failover: Introduce a new command to trigger a failover zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 18/35] COLO failover: Introduce state to record failover process zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 19/35] COLO: Implement failover work for Primary VM zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 20/35] COLO: Implement failover work for Secondary VM zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 21/35] qmp event: Add COLO_EXIT event to notify users while exited from COLO zhanghailiang
2016-04-22 14:25 ` Eric Blake
2016-04-25 9:33 ` Hailiang Zhang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 22/35] COLO failover: Shutdown related socket fd when do failover zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 23/35] COLO failover: Don't do failover during loading VM's state zhanghailiang
2016-05-06 9:09 ` Changlong Xie
2016-05-06 11:07 ` Hailiang Zhang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 24/35] COLO: Process shutdown command for VM in COLO state zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 25/35] COLO: Update the global runstate after going into colo state zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 26/35] savevm: Introduce two helper functions for save/find loadvm_handlers entry zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 27/35] migration/savevm: Add new helpers to process the different stages of loadvm zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 28/35] migration/savevm: Export two helper functions for savevm process zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 29/35] COLO: Separate the process of saving/loading ram and device state zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 30/35] COLO: Split qemu_savevm_state_begin out of checkpoint process zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 31/35] filter-buffer: Accept zero interval zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 32/35] net: Add notifier/callback for netdev init zhanghailiang
2016-04-21 0:30 ` Hailiang Zhang
2016-04-26 6:59 ` Jason Wang
2016-04-26 6:48 ` Jason Wang
2016-05-04 8:18 ` Hailiang Zhang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 33/35] COLO/filter: add each netdev a buffer filter zhanghailiang
2016-04-26 6:58 ` Jason Wang
2016-05-04 8:22 ` Hailiang Zhang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 34/35] COLO: manage the status of buffer filters for PVM zhanghailiang
2016-04-08 6:26 ` [Qemu-devel] [PATCH COLO-Frame v16 35/35] COLO: Add block replication into colo process zhanghailiang
2016-04-08 7:58 ` [Qemu-devel] [PATCH COLO-Frame v16 for-2.7 00/35] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT) Zhang Chen
2016-04-08 8:49 ` Hailiang Zhang
2016-04-22 10:42 ` Dr. David Alan Gilbert
2016-04-25 9:28 ` Hailiang Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460096797-14916-3-git-send-email-zhang.zhanghailiang@huawei.com \
--to=zhang.zhanghailiang@huawei.com \
--cc=amit.shah@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=eddie.dong@intel.com \
--cc=hongyang.yang@easystack.cn \
--cc=lizhijian@cn.fujitsu.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=wency@cn.fujitsu.com \
--cc=xiecl.fnst@cn.fujitsu.com \
--cc=yunhong.jiang@intel.com \
--cc=zhangchen.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).