xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: ian.campbell@citrix.com, wency@cn.fujitsu.com,
	ian.jackson@eu.citrix.com, yunhong.jiang@intel.com,
	eddie.dong@intel.com, xen-devel@lists.xen.org,
	rshriram@cs.ubc.ca, laijs@cn.fujitsu.com
Subject: Re: [PATCH for-4.5 v20 07/12] xl/remus: change bool to defbool
Date: Thu, 25 Sep 2014 15:21:30 -0400	[thread overview]
Message-ID: <20140925192130.GG29663@laptop.dumpdata.com> (raw)
In-Reply-To: <1411625784-4060-8-git-send-email-yanghy@cn.fujitsu.com>

On Thu, Sep 25, 2014 at 02:16:19PM +0800, Yang Hongyang wrote:
> Use defbool instead of bool for boolean flags in remus_info struct.

While that change by itself looks OK, the change in 'libxl_types.idl'
break the ABI.

Could you say a bit of why that is OK? As in, would there had
been in the past any users of this ABI that now would have issues with this?

Also, how important is this patch? Does it have to go in or
can it be dropped from the patchset?

> 
> Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
> ---
>  tools/libxl/libxl.c         | 3 +++
>  tools/libxl/libxl_dom.c     | 2 +-
>  tools/libxl/libxl_types.idl | 4 ++--
>  tools/libxl/xl_cmdimpl.c    | 9 ++++-----
>  4 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 79b508f..9e0a800 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -804,6 +804,9 @@ int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
>          goto out;
>      }
>  
> +    libxl_defbool_setdefault(&info->blackhole, false);
> +    libxl_defbool_setdefault(&info->compression, true);
> +
>      GCNEW(dss);
>      dss->ao = ao;
>      dss->callback = remus_failover_cb;
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index e9d29b5..d63ae1b 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -1809,7 +1809,7 @@ void libxl__domain_suspend(libxl__egc *egc, libxl__domain_suspend_state *dss)
>  
>      if (r_info != NULL) {
>          dss->interval = r_info->interval;
> -        if (r_info->compression)
> +        if (libxl_defbool_val(r_info->compression))
>              dss->xcflags |= XCFLAGS_CHECKPOINT_COMPRESS;
>      }
>  
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index da4c52d..16e374f 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -611,8 +611,8 @@ libxl_sched_credit_params = Struct("sched_credit_params", [
>  
>  libxl_domain_remus_info = Struct("domain_remus_info",[
>      ("interval",     integer),
> -    ("blackhole",    bool),
> -    ("compression",  bool),
> +    ("blackhole",    libxl_defbool),
> +    ("compression",  libxl_defbool),
>      ])
>  
>  libxl_event_type = Enumeration("event_type", [
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index d205f96..e9e8900 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -7495,18 +7495,17 @@ int main_remus(int argc, char **argv)
>      memset(&r_info, 0, sizeof(libxl_domain_remus_info));
>      /* Defaults */
>      r_info.interval = 200;
> -    r_info.blackhole = 0;
> -    r_info.compression = 1;
> +    libxl_defbool_setdefault(&r_info.blackhole, false);
>  
>      SWITCH_FOREACH_OPT(opt, "bui:s:e", NULL, "remus", 2) {
>      case 'i':
>          r_info.interval = atoi(optarg);
>          break;
>      case 'b':
> -        r_info.blackhole = 1;
> +        libxl_defbool_set(&r_info.blackhole, true);
>          break;
>      case 'u':
> -        r_info.compression = 0;
> +        libxl_defbool_set(&r_info.compression, false);
>          break;
>      case 's':
>          ssh_command = optarg;
> @@ -7519,7 +7518,7 @@ int main_remus(int argc, char **argv)
>      domid = find_domain(argv[optind]);
>      host = argv[optind + 1];
>  
> -    if (r_info.blackhole) {
> +    if (libxl_defbool_val(r_info.blackhole)) {
>          send_fd = open("/dev/null", O_RDWR, 0644);
>          if (send_fd < 0) {
>              perror("failed to open /dev/null");
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2014-09-25 19:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25  6:16 [PATCH for-4.5 v20 00/12] Remus/Libxl: Remus network buffering and drbd disk Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 01/12] libxl: introduce libxl__multidev_prepare_with_aodev Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 02/12] libxl: Extend libxl__ao_device with a libxl__ev_child member Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 03/12] autoconf: add libnl3 dependency for Remus network buffering support Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 04/12] libxl/remus: introduce an abstract Remus device layer Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 05/12] libxl/remus: setup and control network output buffering Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 06/12] libxl/remus: setup and control disk replication for DRBD backends Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 07/12] xl/remus: change bool to defbool Yang Hongyang
2014-09-25 19:21   ` Konrad Rzeszutek Wilk [this message]
2014-09-25 20:03     ` Shriram Rajagopalan
2014-09-25 23:38       ` Ian Jackson
2014-09-26 14:02         ` Konrad Rzeszutek Wilk
2014-09-25  6:16 ` [PATCH for-4.5 v20 08/12] xl/remus: cmdline switch to explicitly enable unsafe configurations Yang Hongyang
2014-09-25 19:23   ` Konrad Rzeszutek Wilk
2014-09-25  6:16 ` [PATCH for-4.5 v20 09/12] xl/remus: cmdline switches and config vars to control network buffering Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 10/12] xl/remus: add a cmdline switch to disable disk replication Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 11/12] libxl/remus: add LIBXL_HAVE_REMUS to indicate Remus support in libxl Yang Hongyang
2014-09-25  6:16 ` [PATCH for-4.5 v20 12/12] MAINTAINERS: update maintained files of Remus Yang Hongyang
2014-09-25 19:24   ` Konrad Rzeszutek Wilk
2014-09-25 19:28 ` [PATCH for-4.5 v20 00/12] Remus/Libxl: Remus network buffering and drbd disk Konrad Rzeszutek Wilk
2014-09-26  5:40   ` Hongyang Yang

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=20140925192130.GG29663@laptop.dumpdata.com \
    --to=konrad.wilk@oracle.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=yanghy@cn.fujitsu.com \
    --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).