From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH] tools/libxc: fix errno handling for HVM in xc_domain_save
Date: Thu, 13 Mar 2014 17:46:43 +0000 [thread overview]
Message-ID: <5321EF03.1040408@citrix.com> (raw)
In-Reply-To: <1394732071-14342-1-git-send-email-olaf@aepfle.de>
On 13/03/14 17:34, Olaf Hering wrote:
> The previous patch ("tools/libxc: pass errno to callers of
> xc_domain_save") did not jump to the proper label if the domU is HVM.
>
> Also make it clearer what "out" and "out_rc" are supposed to mean:
> label "out" is for failure case, it expects errno to be set.
> label "out_rc" is for success case, it preserves the initial errno for
> the caller.
Surely "out_rc" should be renamed to "success" then?
~Andrew
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
> tools/libxc/xc_domain_save.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
> index 9f96bb7..5a50c5c 100644
> --- a/tools/libxc/xc_domain_save.c
> +++ b/tools/libxc/xc_domain_save.c
> @@ -1837,7 +1837,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
>
> /* HVM guests are done now */
> errno = 0;
> - goto out;
> + goto out_rc;
> }
>
> /* PV guests only from now on */
> @@ -2037,13 +2037,13 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
> }
>
> /* Success! */
> - rc = errno = 0;
> + errno = 0;
> goto out_rc;
>
> out:
> - rc = errno;
> - assert(rc);
> + assert(errno);
> out_rc:
> + rc = errno;
> completed = 1;
>
> if ( !rc && callbacks->postcopy )
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-03-13 17:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 17:34 [PATCH] tools/libxc: fix errno handling for HVM in xc_domain_save Olaf Hering
2014-03-13 17:44 ` Ian Campbell
2014-03-13 17:46 ` Andrew Cooper [this message]
2014-03-13 17:53 ` Ian Jackson
2014-03-13 17:57 ` Olaf Hering
2014-03-13 18:01 ` Ian Jackson
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=5321EF03.1040408@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=olaf@aepfle.de \
--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.