From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] tools/libxc: Fix error checking for xc_get_{cpu, node}map_size() callers Date: Thu, 12 Dec 2013 15:56:18 +0100 Message-ID: <1386860178.5488.113.camel@Solace> References: <1386776862-19921-1-git-send-email-andrew.cooper3@citrix.com> <1386858242.18946.1.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8204732475814082360==" Return-path: In-Reply-To: <1386858242.18946.1.camel@kazak.uk.xensource.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: George Dunlap , Andrew Cooper , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org --===============8204732475814082360== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-1G+V5Uy/w4GRn/oBUnTH" --=-1G+V5Uy/w4GRn/oBUnTH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On gio, 2013-12-12 at 14:24 +0000, Ian Campbell wrote: > On Wed, 2013-12-11 at 15:47 +0000, Andrew Cooper wrote: > > c/s 2e82c18cd850592ae9a1f682eb93965a868b5f2f changed the error returns = of > > xc_get_{cpu,node}map_size() to now include returning -1. This invalida= ted the > > error checks from callers, which expected 0 to be the only error case. >=20 > I don't think 0 is a valid error value any more. Neither xc_get_max_cpus > nor xc_get_max_nodes can return 0 and the map_size functions will round > to 1 or more. >=20 Yep, I confirm that, after that changeset, neither xc_get_max_{cpus,nodes}() nor xc_get_{cpu,node}map_size() return 0 as an error anymore. > So these could all be "< 0" tests think. >=20 Indeed. Anyway, looks like, while I fixed the callers of the xx_get_max_xx things in that very comment, I didn't do the same for the xx_get_*map_xx ones. Weird, as ISTR doing so too... :-/ Anyway, thanks to Coverity for caching this and to Andrew for the patch. I'll reply to v2 (if you're posting it) but, with the conditions converted to "< 0", this can have my: Reviewed-by: Dario Faggioli Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-1G+V5Uy/w4GRn/oBUnTH 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.4.15 (GNU/Linux) iEYEABECAAYFAlKpzpIACgkQk4XaBE3IOsTF4ACgheesLL/z2ZqLZwfJR7rKUwqh ojwAn13YZGaVZ+SzbiIM0NOOHcnAFC5T =OqR1 -----END PGP SIGNATURE----- --=-1G+V5Uy/w4GRn/oBUnTH-- --===============8204732475814082360== 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 --===============8204732475814082360==--