From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 5/5] xl: improve return and exit codes of parse related functions Date: Tue, 27 Oct 2015 12:41:15 +0100 Message-ID: <1445946075.2937.111.camel@citrix.com> References: <1445939452-8091-1-git-send-email-write.harmandeep@gmail.com> <1445939452-8091-6-git-send-email-write.harmandeep@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5518011229959023093==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zr2d0-0005wM-2m for xen-devel@lists.xenproject.org; Tue, 27 Oct 2015 11:41:22 +0000 In-Reply-To: <1445939452-8091-6-git-send-email-write.harmandeep@gmail.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: Harmandeep Kaur , xen-devel@lists.xenproject.org Cc: lars.kurth@citrix.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, george.dunlap@citrix.com List-Id: xen-devel@lists.xenproject.org --===============5518011229959023093== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-3hExddoyvwgZYwTlg1DG" --=-3hExddoyvwgZYwTlg1DG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-10-27 at 15:20 +0530, Harmandeep Kaur wrote: > Turning parsing related functions exit codes towards using the > EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary > numbers > or libxl return codes. > - for main_*: arbitrary -> EXIT_SUCCESS|EXIT_FAILURE. > - for internal fucntion: arbitrary -> 0/1. >=20 > Don't touch parse_config_data() which is big enough to deserve its > own patch. >=20 > Signed-off-by: Harmandeep Kaur > --- > v2->v3: Reverted return of parse_mem_size_kb() to -1. > And exculded out of scope changes. >=20 There are a couple more of out of scope changes, though, at least according to me. So, as Wei also said for patch 1, if you send v4 of this series and, as far as this patch is concerned, you only... > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 76d9af6..1ddf144 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -3118,6 +3118,7 @@ void help(const char *command) > } > } > =20 > +/* Function returns -1 if the parsing fails */ > static int64_t parse_mem_size_kb(const char *mem) > { > char *endptr; > @@ -3264,7 +3265,7 @@ static int set_memory_max(uint32_t domid, const > char *mem) > memorykb =3D parse_mem_size_kb(mem); > if (memorykb =3D=3D -1) { > fprintf(stderr, "invalid memory size: %s\n", mem); > - exit(3); > + exit(EXIT_FAILURE); > } > =20 > rc =3D libxl_domain_setmaxmem(ctx, domid, memorykb); > @@ -3302,7 +3303,7 @@ static void set_memory_target(uint32_t domid, > const char *mem) > memorykb =3D parse_mem_size_kb(mem); > if (memorykb =3D=3D -1) { > fprintf(stderr, "invalid memory size: %s\n", mem); > - exit(3); > + exit(EXIT_FAILURE); > } > =20 > libxl_set_memory_target(ctx, domid, memorykb, 0, /* enforce */ > 1); > ... Leave these two functions alone (set_memory_max() and set_memory_target()), then you can add the following tag to the changelog: Reviewed-by: Dario Faggioli Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-3hExddoyvwgZYwTlg1DG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlYvYtsACgkQk4XaBE3IOsSikwCeJxm8MynOUmKnj9P/aIvcgjuC KbQAoIr3wV/SYO/CumKK74Xrhwg/mttT =0sht -----END PGP SIGNATURE----- --=-3hExddoyvwgZYwTlg1DG-- --===============5518011229959023093== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5518011229959023093==--