]> xenbits.xensource.com Git - xen.git/commitdiff
xl/remus: add a cmdline switch to disable disk replication
authorYang Hongyang <yanghy@cn.fujitsu.com>
Wed, 16 Jul 2014 09:27:43 +0000 (17:27 +0800)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Sep 2014 14:12:37 +0000 (15:12 +0100)
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
tools/libxl/libxl.c
tools/libxl/libxl_types.idl
tools/libxl/xl_cmdimpl.c
tools/libxl/xl_cmdtable.c

index 1f165adf1885d37faa7fedf35dd0d126a7a1cc98..362e92faa1118a6b620d4f0859a8665419cfe1de 100644 (file)
@@ -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>
index e0e1b4446ce84c2c95065e595b4c847ad2ef4cc6..9f629c48af98b0de943a1cac2b84ea27a306c44f 100644 (file)
@@ -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;
index 494d37e0a49fd7c79d81c447b265fbeef1e21a5a..bbb03e216a9631921a45699a47e467dce7908b1b 100644 (file)
@@ -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", [
index 48a3a4190250f043df8f1370e89ce6dc44b97f55..7912e0641176ecc7fd64c0e599d9d2de934646ac 100644 (file)
@@ -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;
index cd1b6123f1c325c9c615ccb678d83fa229051129..f93ee4fae002ddc2de33deb618fdd8cb313d8fd5 100644 (file)
@@ -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",