From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [Patch 1/2] tools/libxc: goto correct label on error paths Date: Tue, 28 Jan 2014 11:41:11 +0000 Message-ID: <52E79757.9090708@eu.citrix.com> References: <1390839925-28088-1-git-send-email-andrew.cooper3@citrix.com> <1390839925-28088-2-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1390839925-28088-2-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Xen-devel Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 > CC: Ian Campbell > CC: Ian Jackson > CC: George Dunlap Right -- I can't imagine any goodness coming from jumping to "finish" in those cases... Release-acked-by: George Dunlap > --- > 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));