All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	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
Subject: Re: [PATCH 4 of 5 V2] tools/libxl: Control network	buffering in remus	callbacks
Date: Thu, 5 Sep 2013 12:25:13 +0100	[thread overview]
Message-ID: <21032.27161.197547.33583@mariner.uk.xensource.com> (raw)
In-Reply-To: <b8839e0b61c2e15b94a2.1377814583@athos.nss.cs.ubc.ca>

Shriram Rajagopalan writes ("[Xen-devel] [PATCH 4 of 5 V2] tools/libxl: Control network buffering in remus	callbacks"):
> tools/libxl: Control network buffering in remus callbacks
...
> @@ -1256,10 +1272,36 @@ static void libxl__remus_domain_checkpoi
>  static void remus_checkpoint_dm_saved(libxl__egc *egc,
>                                        libxl__domain_suspend_state *dss, int rc)
>  {

I think there are some error handling problems in this function.

> -    /* REMUS TODO: Wait for disk and memory ack, release network buffer */
> -    /* REMUS TODO: make this asynchronous */
> -    assert(!rc); /* REMUS TODO handle this error properly */
> -    usleep(dss->remus_ctx->interval * 1000);
> +    /*
> +     * REMUS TODO: Wait for disk and explicit memory ack (through restore
> +     * callback from remote) before releasing network buffer.
> +     */
> +    libxl__remus_ctx *remus_ctx = dss->remus_ctx;
> +    struct timespec epoch;
> +    int ret;
> +    STATE_AO_GC(dss->ao);
> +
> +    if (rc) {
> +        LOG(ERROR, "Failed to save device model. Terminating Remus..");
> +        libxl__xc_domain_saverestore_async_callback_done(egc,
> +                                                         &dss->shs, rc);

Firstly, it would be much clearer if you used the "goto out" error
handling style, rather than calling ..._callback_done and return
separately each time.

Secondly, here you return rc, a libxl error code.

> +        ret = libxl__remus_netbuf_release_prev_epoch(gc, dss->domid,
> +                                                     remus_ctx);
> +        if (ret) {
> +            libxl__xc_domain_saverestore_async_callback_done(egc,
> +                                                             &dss->shs,
> +                                                             ret);

Here you return "ret" which is what exactly ?

> +            return;
...
>      libxl__xc_domain_saverestore_async_callback_done(egc, &dss->shs, 1);

And here the original function returns "1".

The specification for the callback is in xenguest.h's struct
save_callbacks, the "checkpoint" member.  It says the return value
must be 0 or 1.

So if there is a failure I think you need to stash the error code
somewhere because libxc won't pass it through for you.

Ian.

  parent reply	other threads:[~2013-09-05 11:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 22:16 [PATCH 0 of 5 V2] Remus/Libxl: Network buffering support Shriram Rajagopalan
2013-08-29 22:16 ` [PATCH 1 of 5 V2] remus: add libnl3 dependency to autoconf scripts Shriram Rajagopalan
2013-09-04 13:40   ` Ian Campbell
2013-10-09  2:14     ` Shriram Rajagopalan
2013-10-09  8:06       ` Ian Campbell
2013-10-09 16:27         ` Shriram Rajagopalan
2013-10-09 16:36           ` Ian Campbell
2013-08-29 22:16 ` [PATCH 2 of 5 V2] tools/hotplug: Remus network buffering setup scripts Shriram Rajagopalan
2013-09-04 13:50   ` Ian Campbell
2013-08-29 22:16 ` [PATCH 3 of 5 V2] tools/libxl: setup/teardown Remus network buffering Shriram Rajagopalan
2013-09-04 15:17   ` Ian Campbell
2013-10-14 14:23     ` Shriram Rajagopalan
2013-10-15 10:34       ` Ian Campbell
2013-09-04 16:16   ` Ian Jackson
2013-09-04 17:22     ` Shriram Rajagopalan
2013-10-09 16:32       ` Shriram Rajagopalan
2013-10-14 16:30         ` [PATCH] libxl: Deprecate synchronous waiting for the device model Ian Jackson
2013-11-04 16:50           ` Ian Campbell
2013-11-04 17:03             ` Ian Jackson
2013-11-12 16:58               ` [PATCH RESEND] " Ian Jackson
2013-11-12 17:25                 ` Ian Campbell
2013-11-12 17:27                   ` Ian Jackson
2013-10-14 16:34         ` [PATCH 3 of 5 V2] tools/libxl: setup/teardown Remus network buffering [and 1 more messages] Ian Jackson
2013-08-29 22:16 ` [PATCH 4 of 5 V2] tools/libxl: Control network buffering in remus callbacks Shriram Rajagopalan
2013-09-04 15:19   ` Ian Campbell
2013-09-05 11:25   ` Ian Jackson [this message]
2013-08-29 22:16 ` [PATCH 5 of 5 V2] tools/xl: Remus - Network buffering cmdline switch Shriram Rajagopalan
2013-09-04 15:24   ` Ian Campbell
2013-09-04 13:21 ` [PATCH 0 of 5 V2] Remus/Libxl: Network buffering support Shriram Rajagopalan
2013-09-04 13:27   ` Ian Campbell

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=21032.27161.197547.33583@mariner.uk.xensource.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@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.