All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: rshriram@cs.ubc.ca
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 4 of 5] tools/libxl: Control network buffering in remus callbacks
Date: Fri, 30 Aug 2013 09:42:51 +0100	[thread overview]
Message-ID: <52205B0B.1050309@citrix.com> (raw)
In-Reply-To: <CAP8mzPNhL=Yg-1ZRjuO_LVeh=yFuOQi=0+JwuOHTj4k+788=Tw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3131 bytes --]

On 29/08/13 22:49, Shriram Rajagopalan wrote:
> On Mon, Aug 26, 2013 at 6:28 PM, Andrew Cooper
> <andrew.cooper3@citrix.com <mailto:andrew.cooper3@citrix.com>> wrote:
>
>     On 26/08/2013 00:45, rshriram@cs.ubc.ca
>     <mailto:rshriram@cs.ubc.ca> wrote:
>     > # HG changeset patch
>     > # User Shriram Rajagopalan <rshriram@cs.ubc.ca
>     <mailto:rshriram@cs.ubc.ca>>
>     > # Date 1377473611 25200
>     > # Node ID c6804ccfe660cb9c373c5f53a8996d0443316684
>     > # Parent  4b23104828c09218aa7f9fbde1578bb6706e13d6
>     > tools/libxl: Control network buffering in remus callbacks
>     >
>     > This patch constitutes the core network buffering logic.
>     > and does the following:
>     >  a) create a new network buffer when the domain is suspended
>     >     (remus_domain_suspend_callback)
>     >  b) release the previous network buffer pertaining to the
>     >     committed checkpoint (remus_domain_checkpoint_dm_saved)
>     >
>     > Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca
>     <mailto:rshriram@cs.ubc.ca>>
>     >
>     > diff -r 4b23104828c0 -r c6804ccfe660 tools/libxl/libxl_dom.c
>     > --- a/tools/libxl/libxl_dom.c Sun Aug 25 16:33:29 2013 -0700
>     > +++ b/tools/libxl/libxl_dom.c Sun Aug 25 16:33:31 2013 -0700
>     > @@ -1213,12 +1213,28 @@ int libxl__toolstack_save(uint32_t domid
>     >
>     >  /*----- remus callbacks -----*/
>     >
>     > +/* REMUS TODO: Issue disk checkpoint reqs. */
>
>     Why does this comment need to move?
>
>     >  static int libxl__remus_domain_suspend_callback(void *data)
>     >  {
>     > -    /* REMUS TODO: Issue disk and network checkpoint reqs. */
>     > -    return libxl__domain_suspend_common_callback(data);
>     > +    libxl__save_helper_state *shs = data;
>     > +    libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss,
>     shs);
>     > +    libxl__remus_ctx *remus_ctx = dss->remus_ctx;
>     > +    int is_suspended = 0;
>     > +    STATE_AO_GC(dss->ao);
>     > +
>     > +    is_suspended = libxl__domain_suspend_common_callback(data);
>     > +    if (!remus_ctx->netbuf_ctx)
>
>     split to new line please.
>
>     > return is_suspended;
>     > +
>     > +    if (is_suspended) {
>     > +        if (libxl__remus_netbuf_start_new_epoch(gc, dss->domid,
>     > +                                                remus_ctx))
>     > +            return !is_suspended;
>     > +    }
>     > +
>     > +    return is_suspended;
>
>     is_suspended is logically a boolean, so should be bool_t.
>      Unhelpfully,
>     libxl__domain_suspend_common_callback() returns an int, although its
>     implementation strictly returns 0 on failure and 1 on success.
>
>     IMO, It would probably be best to have "bool_t is_suspended" set to
>     "!!libxl__domain_suspend_common_callback()", at which the subsequent
>     return !is_suspended doesn't look as suspect, although that is just a
>     matter of style.
>
>
> Did you mean bool (not bool_t) ? Because I didnt see a typedef in
> libxl folder.
>  

Indeed.  Sorry.  (I had Xen on the brain when reviewing, which does use
bool_t rather than bool).

~Andrew

[-- Attachment #1.2: Type: text/html, Size: 6238 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2013-08-30  8:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-25 23:45 [PATCH 0 of 5] Remus/Libxl: Network buffering support rshriram
2013-08-25 23:45 ` [PATCH 1 of 5] remus: add libnl3 dependency to autoconf scripts rshriram
2013-08-26  9:06   ` Andrew Cooper
2013-08-27  8:44     ` Ian Campbell
2013-08-27 10:56   ` Ian Campbell
2013-08-29 19:13     ` Shriram Rajagopalan
2013-08-25 23:45 ` [PATCH 2 of 5] tools/hotplug: Remus network buffering setup scripts rshriram
2013-08-25 23:45 ` [PATCH 3 of 5] tools/libxl: setup/teardown Remus network buffering rshriram
2013-08-26 22:13   ` Andrew Cooper
2013-08-25 23:45 ` [PATCH 4 of 5] tools/libxl: Control network buffering in remus callbacks rshriram
2013-08-26 22:28   ` Andrew Cooper
2013-08-29 21:49     ` Shriram Rajagopalan
2013-08-30  8:42       ` Andrew Cooper [this message]
2013-08-25 23:45 ` [PATCH 5 of 5] tools/xl: Remus - Network buffering cmdline switch rshriram

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=52205B0B.1050309@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.