From: Wei Liu Subject: Re: [PATCH 35/35] libxl: When save/restore helper dies, do not overwrite rc Date: Fri, 26 Jun 2015 15:56:54 +0100 Message-ID: <20150626145654.GK6265@zion.uk.xensource.com> References: <1435254275-8184-1-git-send-email-ian.jackson@eu.citrix.com> <1435254275-8184-36-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1435254275-8184-36-git-send-email-ian.jackson@eu.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: Ian Jackson Cc: Wei Liu , xen-devel@lists.xensource.com, Euan Harris , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Thu, Jun 25, 2015 at 06:44:35PM +0100, Ian Jackson wrote: > If we already have an rc (eg from ao abort), keep it. > > Signed-off-by: Ian Jackson Acked-by: Wei Liu > --- > v4: New patch in this version of the series. > --- > tools/libxl/libxl_save_callout.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c > index 93a884b..087c2d5 100644 > --- a/tools/libxl/libxl_save_callout.c > +++ b/tools/libxl/libxl_save_callout.c > @@ -332,19 +332,22 @@ static void helper_exited(libxl__egc *egc, libxl__ev_child *ch, > > if (status) { > libxl_report_child_exitstatus(CTX, XTL_ERROR, what, pid, status); > - shs->rc = ERROR_FAIL; > + if (!shs->rc) > + shs->rc = ERROR_FAIL; > } > > if (shs->need_results) { > - if (!shs->rc) > + if (!shs->rc) { > LOG(ERROR,"%s exited without providing results",what); > - shs->rc = ERROR_FAIL; > + shs->rc = ERROR_FAIL; > + } > } > > if (!shs->completed) { > - if (!shs->rc) > + if (!shs->rc) { > LOG(ERROR,"%s exited without signaling completion",what); > - shs->rc = ERROR_FAIL; > + shs->rc = ERROR_FAIL; > + } > } > > helper_done(egc, shs); > -- > 1.7.10.4