From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [PATCH] xl: log an error if libxl_cpupool_destroy() fails Date: Fri, 23 Oct 2015 06:21:52 +0200 Message-ID: <5629B5E0.4060600@suse.com> References: <20151022171420.15122.92760.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZpTrY-0005Gi-FO for xen-devel@lists.xenproject.org; Fri, 23 Oct 2015 04:21:56 +0000 In-Reply-To: <20151022171420.15122.92760.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli , xen-devel@lists.xenproject.org Cc: Wei Liu , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 10/22/2015 07:14 PM, Dario Faggioli wrote: > In fact, right now, failing at destroying a cpupool is just > not reported to the user in any explicit way. Log an error, > as it is customary for xl in these cases. > > While there, take the chance to turn a couple of xl exit > codes into EXIT_[SUCCESS|FAILURE], as discussed and agreed > here: > > http://lists.xenproject.org/archives/html/xen-devel/2015-03/msg01336.html > http://lists.xenproject.org/archives/html/xen-devel/2015-03/msg01341.html > > Signed-off-by: Dario Faggioli Reviewed-by: Juergen Gross > --- > Cc: Ian Jackson > Cc: Stefano Stabellini > Cc: Ian Campbell > Cc: Wei Liu > Cc: Juergen Gross > --- > tools/libxl/xl_cmdimpl.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 365798b..5a5f959 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -7581,13 +7581,15 @@ int main_cpupooldestroy(int argc, char **argv) > if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) || > !libxl_cpupoolid_is_valid(ctx, poolid)) { > fprintf(stderr, "unknown cpupool '%s'\n", pool); > - return 1; > + return EXIT_FAILURE; > } > > - if (libxl_cpupool_destroy(ctx, poolid)) > - return 1; > + if (libxl_cpupool_destroy(ctx, poolid)) { > + fprintf(stderr, "Can't destroy cpupool '%s'\n", pool); > + return EXIT_FAILURE; > + } > > - return 0; > + return EXIT_SUCCESS; > } > > int main_cpupoolrename(int argc, char **argv) > >