From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 10/10] libxl: fix caller of libxl_cpupool functions Date: Thu, 16 Jul 2015 10:57:24 +0200 Message-ID: <1437037044.13522.219.camel@citrix.com> References: <1436892073-14186-1-git-send-email-wei.liu2@citrix.com> <1436892073-14186-11-git-send-email-wei.liu2@citrix.com> <21925.18402.35455.636018@mariner.uk.xensource.com> <20150715171643.GI12455@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7730882347035412575==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZFezC-0007az-9H for xen-devel@lists.xenproject.org; Thu, 16 Jul 2015 08:57:46 +0000 In-Reply-To: <20150715171643.GI12455@zion.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: Wei Liu Cc: Xen-devel , Juergen Gross , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org --===============7730882347035412575== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-GrdW3B7RNYdP+MZSOQT7" --=-GrdW3B7RNYdP+MZSOQT7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [Adding Juergen] =09 On Wed, 2015-07-15 at 18:16 +0100, Wei Liu wrote: > On Tue, Jul 14, 2015 at 06:33:22PM +0100, Ian Jackson wrote: > > Wei Liu writes ("[PATCH v3 10/10] libxl: fix caller of libxl_cpupool fu= nctions"): > > > --- a/tools/libxl/libxl.c > > > +++ b/tools/libxl/libxl.c > > > @@ -771,8 +771,11 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx= *ctx, int *nb_pool_out) > > > =20 > > > poolid =3D 0; > > > for (i =3D 0;; i++) { > > > - if (cpupool_info(gc, &info, poolid, false)) > > > + libxl_cpupoolinfo_init(&info); > > > + if (cpupool_info(gc, &info, poolid, false)) { > > > + libxl_cpupoolinfo_dispose(&info); > > > break; > > > + } > >=20 > > I'm not convinced by this change. > >=20 > > I think that this function has broken error handling: if cpupool_info > > fails, it simply ignores the error. > >=20 >=20 > I think the semantics of this function is to get back as many cpupool > info as it can. >=20 Yes, I also think this is the case. > Unfortunately the failing of cpupool_info can either mean the cpupool id > does not exist or other internal errors. So not cleaning up is the > right thing to do (speaking from semantics point of view). >=20 Indeed. > I think I need to overhaul cpupool_info a bit if we want to make this > API better. >=20 Well, perhaps having cpupool_info() treating specially the situation where the pool ID is not there may help... However, what would you do once you have this additional piece of information available? Maybe, depending on the error, we can cleanup the whole array? Is it this that we are after? > I'm not sure if it is possible to interleave pool ids. If so, we need a > way to get back the exact number of cpupools. Dario? >=20 Sorry, what you mean by 'interleave pool ids'? Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-GrdW3B7RNYdP+MZSOQT7 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 iEYEABECAAYFAlWncf8ACgkQk4XaBE3IOsSDJwCcDe2+z6SgOdGcpWSF2MBN/beD SlwAn17yiBG9RhCRGwB7cREHmaorSaQX =FZqV -----END PGP SIGNATURE----- --=-GrdW3B7RNYdP+MZSOQT7-- --===============7730882347035412575== 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 --===============7730882347035412575==--