From: George Dunlap <george.dunlap@eu.citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Patch 1/2] tools/libxc: goto correct label on error paths
Date: Tue, 28 Jan 2014 11:41:11 +0000 [thread overview]
Message-ID: <52E79757.9090708@eu.citrix.com> (raw)
In-Reply-To: <1390839925-28088-2-git-send-email-andrew.cooper3@citrix.com>
On 01/27/2014 04:25 PM, Andrew Cooper wrote:
> Both of these "goto finish;" statements are actually errors, and need to "goto
> out;" instead, which will correctly destroy the domain and return an error,
> rather than trying to finish the migration (and in at least one scenario,
> return success).
>
> Signed-off-by: Andrew Cooper<andrew.cooper3@citrix.com>
> CC: Ian Campbell<Ian.Campbell@citrix.com>
> CC: Ian Jackson<Ian.Jackson@eu.citrix.com>
> CC: George Dunlap<george.dunlap@eu.citrix.com>
Right -- I can't imagine any goodness coming from jumping to "finish" in
those cases...
Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
> tools/libxc/xc_domain_restore.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
> index ca2fb51..5ba47d7 100644
> --- a/tools/libxc/xc_domain_restore.c
> +++ b/tools/libxc/xc_domain_restore.c
> @@ -1778,14 +1778,14 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
>
> if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
> PERROR("error when buffering batch, finishing");
> - goto finish;
> + goto out;
> }
> memset(&tmptail, 0, sizeof(tmptail));
> tmptail.ishvm = hvm;
> if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
> ext_vcpucontext, vcpuextstate, vcpuextstate_size) < 0 ) {
> ERROR ("error buffering image tail, finishing");
> - goto finish;
> + goto out;
> }
> tailbuf_free(&tailbuf);
> memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
next prev parent reply other threads:[~2014-01-28 11:41 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 [this message]
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
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=52E79757.9090708@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@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.