From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 14/15] tools: implement new generic set value interface and MBA set value command Date: Thu, 28 Sep 2017 18:23:16 +0200 Message-ID: <1506615796.5001.14.camel@citrix.com> References: <1504603957-5389-1-git-send-email-yi.y.sun@linux.intel.com> <1504603957-5389-15-git-send-email-yi.y.sun@linux.intel.com> <20170919113059.dkhuxh7omoehazk5@dhcp-3-128.uk.xensource.com> <20170920161040.mfacafkgssifmff2@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4873542905910263650==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxbb0-0007uC-1f for xen-devel@lists.xenproject.org; Thu, 28 Sep 2017 16:23:30 +0000 In-Reply-To: <20170920161040.mfacafkgssifmff2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu , Roger Pau =?ISO-8859-1?Q?Monn=E9?= Cc: kevin.tian@intel.com, Yi Sun , andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, julien.grall@arm.com, mengxu@cis.upenn.edu, jbeulich@suse.com, xen-devel@lists.xenproject.org, chao.p.peng@linux.intel.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org --===============4873542905910263650== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-/nElXKmjCeQc5gLRZhDv" --=-/nElXKmjCeQc5gLRZhDv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2017-09-20 at 17:10 +0100, Wei Liu wrote: > On Tue, Sep 19, 2017 at 12:30:59PM +0100, Roger Pau Monn=C3=A9 wrote: > > > +=C2=A0=C2=A0=C2=A0=C2=A0type =3D LIBXL_PSR_CBM_TYPE_MBA_THRTL; > > > + > > > +=C2=A0=C2=A0=C2=A0=C2=A0if (libxl_bitmap_is_empty(&target_map)) > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0libxl_bitmap_set_any= (&target_map); > > > + > > > +=C2=A0=C2=A0=C2=A0=C2=A0if (argc !=3D optind + 2) { > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0help("psr-mba-set"); > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 2; > > > +=C2=A0=C2=A0=C2=A0=C2=A0} > >=20 > > Can you do this check at the beginning of the function? Also why > > return 2 instead of EXIT_FAILURE? > >=20 >=20 > Returning 2 is used in several places when help string is > printed.=C2=A0=C2=A0It > isn't really consistent in xl though. >=20 True. However, there's been efforts for improving that (consistency, I mean) and getting to a situation where only EXIT_SUCCESS or EXIT_FAILURE are used. I know it's not a done deal yet, and that it's being a slow process, but I think it would be nice if new code would help achieving that, instead than making it more difficult. :-) Then... > I'm not too fussed whether it is 2 or EXIT_FAILURE. >=20 ...this is just my opinion (as one of the ones which was part of that effort, and that plans to get back to finish it at some point). You're the maintainer, your rules. :-P :-D Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-/nElXKmjCeQc5gLRZhDv 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 v2 iQIcBAABCAAGBQJZzSH1AAoJEBZCeImluHPuYocQAOI6UzM37R3H5S01yU9MkTHX TyP3SP/08/uZwpYpjlGCrdGO2AHid8Bpbf/GEBwfhgxGgBatfVjdOtXLmbHn1Dk2 juWbPsOeMlp2Kx6nTIiHiDXq7UuZnR7DGdK0/bwITI2h0biEMQ9lVTlII/PHvOHn eXc6pfOZG7n3UCljEZst8LFqhZ+J7sbMy5KKIm5WAri/RMj0Fq0Z61/kRv6Do0O8 7aYpPKauxfaJQMrlRhmqH3HirYcIUBVRC2ps9tW/89NtXBaBtFbLB8kqCO/0PjFr LBb5OkDfTjJaLgHxyNmhIU751xhwX08Je4Ttk95/+sQPEeB8aIBRNVRb8ko0Ejib vlPd3QboZsfBcUSnyUaduAA4VUsJNrkuplWVWTxhOG39ABrH5RLGNVD3DUr1KnaW 5A4NzEQ79HrwMdNERTGSdtNtxenaZeNRnShUnR5zL6KCsdCs72pjK++W3m17JmUK KS5PkrADjjTAIzbtOn6kqdun50vtL3ZaSu8gCe8kcp1jkPjfpYY5Du58A97dYLIl m49K2AF7rBE6rpMjCbaN8f2pkTlZ9NEEB2E7vHhfqsa25ZncrHj8a5b89OO/mQu2 IvjbaCqal3dws814IEK9TYkc5HAKOJA78wxsCHthoNL7dDciO0Cc/HQeLR4wJnMR Vd715WLrL3eGyaD43A4g =yoZj -----END PGP SIGNATURE----- --=-/nElXKmjCeQc5gLRZhDv-- --===============4873542905910263650== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============4873542905910263650==--