From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, wency@cn.fujitsu.com,
ian.jackson@eu.citrix.com, yunhong.jiang@intel.com,
eddie.dong@intel.com, rshriram@cs.ubc.ca, laijs@cn.fujitsu.com
Subject: [PATCH for-4.5 v21 12/14] xl/remus: add a cmdline switch to disable disk replication
Date: Fri, 26 Sep 2014 14:13:17 +0800 [thread overview]
Message-ID: <1411711999-3183-13-git-send-email-yanghy@cn.fujitsu.com> (raw)
In-Reply-To: <1411711999-3183-1-git-send-email-yanghy@cn.fujitsu.com>
Disk replication is enabled by default. This patch adds a cmdline
switch to 'xl remus' command to explicitly disable disk replication.
A new boolean field 'diskbuf' is added to the libxl_domain_remus_info
structure to represent this configuration option inside libxl.
Note: Disabling disk replication requires enabling unsafe mode.
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
docs/man/xl.pod.1 | 6 +++++-
tools/libxl/libxl.c | 12 ++++++++----
tools/libxl/libxl_types.idl | 1 +
tools/libxl/xl_cmdimpl.c | 5 ++++-
tools/libxl/xl_cmdtable.c | 5 +++--
5 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 1f165ad..362e92f 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -436,7 +436,7 @@ Enable Remus HA for domain. By default B<xl> relies on ssh as a transport
mechanism between the two hosts.
N.B: Remus support in xl is still in experimental (proof-of-concept) phase.
- There is no support for disk buffering at the moment.
+ Disk replication support is limited to DRBD disks.
B<OPTIONS>
@@ -479,6 +479,10 @@ Generally useful for debugging. Requires enabling unsafe mode.
Disable network output buffering. Requires enabling unsafe mode.
+=item B<-d>
+
+Disable disk replication. Requires enabling unsafe mode.
+
=back
=item B<pause> I<domain-id>
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e0e1b44..9f629c4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -808,12 +808,14 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
libxl_defbool_setdefault(&info->blackhole, false);
libxl_defbool_setdefault(&info->compression, true);
libxl_defbool_setdefault(&info->netbuf, true);
+ libxl_defbool_setdefault(&info->diskbuf, true);
if (!libxl_defbool_val(info->allow_unsafe) &&
(libxl_defbool_val(info->blackhole) ||
- !libxl_defbool_val(info->netbuf))) {
- LOG(ERROR, "Unsafe mode must be enabled to replicate to /dev/null and "
- "disable network buffering");
+ !libxl_defbool_val(info->netbuf) ||
+ !libxl_defbool_val(info->diskbuf))) {
+ LOG(ERROR, "Unsafe mode must be enabled to replicate to /dev/null,"
+ "disable network buffering and disk replication");
goto out;
}
@@ -841,7 +843,9 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
}
rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VIF);
}
- rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VBD);
+
+ if (libxl_defbool_val(info->diskbuf))
+ rds->device_kind_flags |= (1 << LIBXL__DEVICE_KIND_VBD);
rds->ao = ao;
rds->domid = domid;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 494d37e..bbb03e2 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -616,6 +616,7 @@ libxl_domain_remus_info = Struct("domain_remus_info",[
("compression", libxl_defbool),
("netbuf", libxl_defbool),
("netbufscript", string),
+ ("diskbuf", libxl_defbool),
])
libxl_event_type = Enumeration("event_type", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 48a3a41..7912e06 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7497,7 +7497,7 @@ int main_remus(int argc, char **argv)
r_info.interval = 200;
libxl_defbool_setdefault(&r_info.blackhole, false);
- SWITCH_FOREACH_OPT(opt, "Fbuni:s:N:e", NULL, "remus", 2) {
+ SWITCH_FOREACH_OPT(opt, "Fbundi:s:N:e", NULL, "remus", 2) {
case 'i':
r_info.interval = atoi(optarg);
break;
@@ -7516,6 +7516,9 @@ int main_remus(int argc, char **argv)
case 'N':
r_info.netbufscript = optarg;
break;
+ case 'd':
+ libxl_defbool_set(&r_info.diskbuf, false);
+ break;
case 's':
ssh_command = optarg;
break;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index cd1b612..f93ee4f 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -503,11 +503,12 @@ struct cmd_spec cmd_table[] = {
" of the domain.\n"
"-N <netbufscript> Use netbufscript to setup network buffering instead of the\n"
" default script (/etc/xen/scripts/remus-netbuf-setup).\n"
- "-F Enable unsafe configurations [-b|-n flags]. Use this option\n"
+ "-F Enable unsafe configurations [-b|-n|-d flags]. Use this option\n"
" with caution as failover may not work as intended.\n"
"-b Replicate memory checkpoints to /dev/null (blackhole).\n"
" Works only in unsafe mode.\n"
- "-n Disable network output buffering. Works only in unsafe mode."
+ "-n Disable network output buffering. Works only in unsafe mode.\n"
+ "-d Disable disk replication. Works only in unsafe mode."
},
#endif
{ "devd",
--
1.9.1
next prev parent reply other threads:[~2014-09-26 6:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 6:13 [PATCH for-4.5 v21 00/14] Remus/Libxl: Remus network buffering and drbd disk Yang Hongyang
2014-09-26 6:13 ` [PATCH for-4.5 v21 01/14] libxl: multidev: Clarify comments about which callbacks are meant Yang Hongyang
2014-09-26 13:56 ` Wei Liu
2014-09-26 6:13 ` [PATCH for-4.5 v21 02/14] libxl: multidev: Expose libxl__multidev_one_callback Yang Hongyang
2014-09-26 13:58 ` Wei Liu
2014-09-26 6:13 ` [PATCH for-4.5 v21 03/14] libxl: introduce libxl__multidev_prepare_with_aodev Yang Hongyang
2014-09-26 6:13 ` [PATCH for-4.5 v21 04/14] libxl: Extend libxl__ao_device with a libxl__ev_child member Yang Hongyang
2014-09-26 6:13 ` [PATCH for-4.5 v21 05/14] autoconf: add libnl3 dependency for Remus network buffering support Yang Hongyang
2014-10-06 14:48 ` Ian Campbell
2014-09-26 6:13 ` [PATCH for-4.5 v21 06/14] libxl/remus: introduce an abstract Remus device layer Yang Hongyang
2014-09-26 12:59 ` Ian Jackson
2014-09-26 6:13 ` [PATCH for-4.5 v21 07/14] libxl/remus: setup and control network output buffering Yang Hongyang
2014-09-26 6:13 ` [PATCH for-4.5 v21 08/14] libxl/remus: setup and control disk replication for DRBD backends Yang Hongyang
2014-09-26 6:13 ` [PATCH for-4.5 v21 09/14] xl/remus: change bool to defbool Yang Hongyang
2014-09-26 12:57 ` Ian Jackson
2014-09-26 6:13 ` [PATCH for-4.5 v21 10/14] xl/remus: cmdline switch to explicitly enable unsafe configurations Yang Hongyang
2014-09-26 12:57 ` Ian Jackson
2014-09-26 6:13 ` [PATCH for-4.5 v21 11/14] xl/remus: cmdline switches and config vars to control network buffering Yang Hongyang
2014-09-26 6:13 ` Yang Hongyang [this message]
2014-09-26 6:13 ` [PATCH for-4.5 v21 13/14] libxl/remus: add LIBXL_HAVE_REMUS to indicate Remus support in libxl Yang Hongyang
2014-09-26 6:13 ` [PATCH for-4.5 v21 14/14] MAINTAINERS: update maintained files of Remus Yang Hongyang
2014-09-26 13:10 ` [PATCH for-4.5 v21 00/14] Remus/Libxl: Remus network buffering and drbd disk Ian Jackson
2014-09-26 14:14 ` Ian Jackson
2014-09-26 14:20 ` Konrad Rzeszutek Wilk
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=1411711999-3183-13-git-send-email-yanghy@cn.fujitsu.com \
--to=yanghy@cn.fujitsu.com \
--cc=eddie.dong@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=laijs@cn.fujitsu.com \
--cc=rshriram@cs.ubc.ca \
--cc=wency@cn.fujitsu.com \
--cc=xen-devel@lists.xen.org \
--cc=yunhong.jiang@intel.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).