From: Wei Liu Subject: Re: [PATCH] xl: don't print out uninitialised rc Date: Wed, 4 Nov 2015 11:25:32 +0000 Message-ID: <20151104112532.GB4026@zion.uk.xensource.com> References: <1446635739-15430-1-git-send-email-wei.liu2@citrix.com> <1446636209.6461.66.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtwCD-0003wW-LJ for xen-devel@lists.xenproject.org; Wed, 04 Nov 2015 11:25:41 +0000 Content-Disposition: inline In-Reply-To: <1446636209.6461.66.camel@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 Campbell Cc: Xen-devel , Dario Faggioli , Wei Liu , Ian Jackson , Harmandeep Kaur List-Id: xen-devel@lists.xenproject.org On Wed, Nov 04, 2015 at 11:23:29AM +0000, Ian Campbell wrote: > On Wed, 2015-11-04 at 11:15 +0000, Wei Liu wrote: > > In 5b725e56 (xl: improve return and exit codes of vcpu related > > functions), the return value of libxl_cpu_bitmap_alloc was not stored in > > rc anymore. Yet the subsequent fprintf still used that. > > = > > While it is trivial to reinstate the original implementation, xl's > > caller has no idea what a libxl error code is so printing out rc won't > > be that useful. > = > I don't buy this I'm afraid. xl prints the libxl error code in lots of > places and it is indeed useful for a person (e.g. a developer reading a b= ug > report) since they can go and look the number up. > = > I'm not sure where "xl's caller" comes into it, since this is only about > printing and not returning. > = So the original implementation it is -- I don't feel strong enough to argue for one way or another. Wei. > > Don't print out rc in that case. > > = > > Signed-off-by: Wei Liu > > --- > > Cc: Ian Campbell > > Cc: Ian Jackson > > Cc: Dario Faggioli > > Cc: Harmandeep Kaur > > --- > > =A0tools/libxl/xl_cmdimpl.c | 2 +- > > =A01 file changed, 1 insertion(+), 1 deletion(-) > > = > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > > index 2756d2f..6056344 100644 > > --- a/tools/libxl/xl_cmdimpl.c > > +++ b/tools/libxl/xl_cmdimpl.c > > @@ -5474,7 +5474,7 @@ static int vcpuset(uint32_t domid, const char* > > nr_vcpus, int check_host) > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return 1; > > =A0=A0=A0=A0=A0} > > =A0=A0=A0=A0=A0if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) { > > -=A0=A0=A0=A0=A0=A0=A0=A0fprintf(stderr, "libxl_cpu_bitmap_alloc failed= , rc: %d\n", rc); > > +=A0=A0=A0=A0=A0=A0=A0=A0fprintf(stderr, "libxl_cpu_bitmap_alloc failed= \n"); > > =A0=A0=A0=A0=A0=A0=A0=A0=A0return 1; > > =A0=A0=A0=A0=A0} > > =A0=A0=A0=A0=A0for (i =3D 0; i < max_vcpus; i++)