From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] tools/libxc: fix errno handling for HVM in xc_domain_save Date: Thu, 13 Mar 2014 17:46:43 +0000 Message-ID: <5321EF03.1040408@citrix.com> References: <1394732071-14342-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1394732071-14342-1-git-send-email-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 > --- > 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