xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, wency@cn.fujitsu.com,
	andrew.cooper3@citrix.com, yunhong.jiang@intel.com,
	ian.jackson@eu.citrix.com, eddie.dong@intel.com,
	rshriram@cs.ubc.ca, laijs@cn.fujitsu.com
Subject: [PATCH v16 6/7] libxl: disk buffering cmdline switch
Date: Tue, 15 Jul 2014 14:46:44 +0800	[thread overview]
Message-ID: <1405406805-1455-7-git-send-email-yanghy@cn.fujitsu.com> (raw)
In-Reply-To: <1405406805-1455-1-git-send-email-yanghy@cn.fujitsu.com>

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

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
---
 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

  parent reply	other threads:[~2014-07-15  6:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15  6:46 [PATCH v16 0/7] Remus/Libxl: Remus network buffering and drbd disk Yang Hongyang
2014-07-15  6:46 ` [PATCH v16 1/7] remus: add libnl3 dependency for network buffering support Yang Hongyang
2014-07-15  6:46 ` [PATCH v16 2/7] remus: introduce remus device Yang Hongyang
2014-07-15 18:28   ` Ian Jackson
2014-07-16 10:50     ` Hongyang Yang
2014-07-16 11:46       ` Ian Jackson
2014-07-18 10:06         ` Hongyang Yang
2014-07-18 10:14           ` Ian Campbell
2014-07-18 14:24           ` Ian Jackson
2014-07-18 15:54             ` Shriram Rajagopalan
2014-07-18 15:58               ` Ian Campbell
2014-07-18 16:08                 ` Shriram Rajagopalan
2014-07-18 16:17                   ` Ian Campbell
2014-07-18 16:50                     ` Shriram Rajagopalan
2014-07-15  6:46 ` [PATCH v16 3/7] remus netbuffer: implement remus network buffering for nic devices Yang Hongyang
2014-07-15  6:46 ` [PATCH v16 4/7] remus drbd: Implement remus drbd replicated disk Yang Hongyang
2014-07-15  6:46 ` [PATCH v16 5/7] libxl: network buffering cmdline switch Yang Hongyang
2014-07-15  6:46 ` Yang Hongyang [this message]
2014-07-15  6:46 ` [PATCH v16 7/7] MAINTAINERS: Update maintained files of REMUS Yang Hongyang

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=1405406805-1455-7-git-send-email-yanghy@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=andrew.cooper3@citrix.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).