xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Patch 2/2] tools/libxc: Prevent erroneous success from xc_domain_restore
Date: Tue, 4 Feb 2014 17:26:52 +0000	[thread overview]
Message-ID: <52F122DC.8080407@citrix.com> (raw)
In-Reply-To: <1391534561.6497.60.camel@kazak.uk.xensource.com>

On 04/02/14 17:22, Ian Campbell wrote:
> On Tue, 2014-02-04 at 17:16 +0000, Andrew Cooper wrote:
>>>                  goto out;
>>>              }
>>>          } else {
>>> -            rc = -1;
> Mostly looks good but I'm not sure about this change 
>
> We get here on input error (toolstack data available but no callback
> provided) which is neither migration success nor failure, it's a bug in
> the caller. So arguably returning a separate failure from
> success/unsuccess makes sense.
>
> I'd have thought it ought to set errno (too EINVAL perhaps) too, but
> lets not mess with that now.
>
>
> Ian.
>

Hilariously, it turns out that xc_domain_restore() is specified to
return 0 on success and -1 on failure.  From what I can tell, this is
the sole action which would cause xc_domain_restore() to return anything
other than 0 or 1.

I think fixing this should fall into the bucket of "sanitisation of
libxc error paths".

~Andrew

  reply	other threads:[~2014-02-04 17:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27 16:25 [Xen-devel Patch 0/2] Prevent xc_domain_restore() returning success despite errors Andrew Cooper
2014-01-27 16:25 ` [Patch 1/2] tools/libxc: goto correct label on error paths Andrew Cooper
2014-01-28 11:41   ` George Dunlap
2014-02-04 15:55     ` Ian Campbell
2014-01-27 16:25 ` [Patch 2/2] tools/libxc: Prevent erroneous success from xc_domain_restore Andrew Cooper
2014-02-04 17:16   ` Andrew Cooper
2014-02-04 17:22     ` Ian Campbell
2014-02-04 17:26       ` Andrew Cooper [this message]
2014-02-04 17:43         ` Ian Campbell
2014-02-04 18:01           ` [PATCH v2] " Andrew Cooper
2014-02-05  9:21             ` Ian Campbell
2014-02-05 14:55             ` George Dunlap
2014-02-06 12:37               ` 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=52F122DC.8080407@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=george.dunlap@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 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).