[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v16 6/7] libxl: disk buffering cmdline switch



disk buffering is enabled as default.
add an option "-d" to disable it.

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
---
 docs/man/xl.pod.1                | 4 ++++
 tools/libxl/libxl.c              | 1 +
 tools/libxl/libxl_internal.h     | 1 +
 tools/libxl/libxl_remus_device.c | 3 ++-
 tools/libxl/libxl_types.idl      | 1 +
 tools/libxl/xl_cmdimpl.c         | 6 +++++-
 tools/libxl/xl_cmdtable.c        | 1 +
 7 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index e9e4a83..547e8a2 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -459,6 +459,10 @@ Disable network output buffering.
 Use <netbufscript> to setup network buffering instead of the instead of
 the default (/etc/xen/scripts/remus-netbuf-setup).
 
+=item B<-d>
+
+Disable disk buffering.
+
 =item B<-s> I<sshcommand>
 
 Use <sshcommand> instead of ssh.  String will be passed to sh.
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 00b298a..f0b86fd 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -844,6 +844,7 @@ int libxl_domain_remus_start(libxl_ctx *ctx, 
libxl_domain_remus_info *info,
     rds->ao = ao;
     rds->egc = egc;
     rds->domid = domid;
+    rds->diskbuf = info->diskbuf;
     rds->callback = libxl__remus_setup_done;
     rds->ops = remus_ops;
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index ef6bd88..441a51f 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2582,6 +2582,7 @@ struct libxl__remus_device_state {
     /* the last ops must be NULL */
     const libxl__remus_device_subkind_ops **ops;
     const char *netbufscript;
+    bool diskbuf;
 
     /* private */
     /* devices that have been set up */
diff --git a/tools/libxl/libxl_remus_device.c b/tools/libxl/libxl_remus_device.c
index fd2fe02..c9df7f0 100644
--- a/tools/libxl/libxl_remus_device.c
+++ b/tools/libxl/libxl_remus_device.c
@@ -89,7 +89,8 @@ void libxl__remus_devices_setup(libxl__egc *egc, 
libxl__remus_device_state *rds)
     if (rds->netbufscript)
         rds->nics = libxl_device_nic_list(CTX, rds->domid, &rds->num_nics);
 
-    rds->disks = libxl_device_disk_list(CTX, rds->domid, &rds->num_disks);
+    if (rds->diskbuf)
+        rds->disks = libxl_device_disk_list(CTX, rds->domid, &rds->num_disks);
 
     if (rds->num_nics == 0 && rds->num_disks == 0)
         goto out;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index a96771e..6551109 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -592,6 +592,7 @@ libxl_domain_remus_info = Struct("domain_remus_info",[
     ("compression",  bool),
     ("netbuf",       bool),
     ("netbufscript", string),
+    ("diskbuf",      bool),
     ])
 
 libxl_event_type = Enumeration("event_type", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index b324f34..167b65b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7176,8 +7176,9 @@ int main_remus(int argc, char **argv)
     r_info.blackhole = 0;
     r_info.compression = 1;
     r_info.netbuf = 1;
+    r_info.diskbuf = 1;
 
-    SWITCH_FOREACH_OPT(opt, "buni:s:N:e", NULL, "remus", 2) {
+    SWITCH_FOREACH_OPT(opt, "bundi:s:N:e", NULL, "remus", 2) {
     case 'i':
         r_info.interval = atoi(optarg);
         break;
@@ -7193,6 +7194,9 @@ int main_remus(int argc, char **argv)
     case 'N':
         r_info.netbufscript = optarg;
         break;
+    case 'd':
+        r_info.diskbuf = 0;
+        break;
     case 's':
         ssh_command = optarg;
         break;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 3f7520d..246aa11 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -490,6 +490,7 @@ struct cmd_spec cmd_table[] = {
       "-n                      Disable network output buffering.\n"
       "-N <netbufscript>       Use netbufscript to setup network buffering 
instead of the\n"
       "                        instead of the default 
(/etc/xen/scripts/remus-netbuf-setup).\n"
+      "-d                      Disable disk buffering.\n"
       "-s <sshcommand>         Use <sshcommand> instead of ssh.  String will 
be passed\n"
       "                        to sh. If empty, run <host> instead of \n"
       "                        ssh <host> xl migrate-receive -r [-e]\n"
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.