From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCHv2 2 of 2] libxl: allow for specifying the CPU affinity in the config file. Date: Wed, 25 Jan 2012 11:44:05 +0100 Message-ID: <1327488245.2723.1.camel@Abyss> References: <1327342219.2476.9.camel@Abyss> <1327342932.2476.15.camel@Abyss> <1327487306.24561.258.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0221436070339182707==" Return-path: In-Reply-To: <1327487306.24561.258.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: George Dunlap , Juergen Gross , xen-devel , Ian Jackson List-Id: xen-devel@lists.xenproject.org --===============0221436070339182707== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-JPsWgTfV7tKIYcSrsq4B" --=-JPsWgTfV7tKIYcSrsq4B Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2012-01-25 at 10:28 +0000, Ian Campbell wrote:=20 > > +int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid, > > + unsigned int max_vcpus, libxl_cpumap *c= pumap) > > +{ > > + int i, rc =3D 0; > > + > > + for (i =3D 0; i < max_vcpus; i++)=20 > > + if (libxl_set_vcpuaffinity(ctx, domid, i, cpumap)) { > > + LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "no affinity for cpu %= d", i); >=20 > "failed to set affinity for ..." would better describe what had happened. >=20 Ok. > > +static void print_bitmap(uint8_t *map, int maplen, FILE *stream) > > +{ > [...] >=20 > I assumed this was pure code motion so I didn't read it. >=20 It is. > > @@ -328,6 +384,9 @@ static void printf_info(int domid, > > =20 > > printf("\t(build_info)\n"); > > printf("\t(max_vcpus %d)\n", b_info->max_vcpus); > > + printf("\t(CPU affinity "); > > + print_bitmap(b_info->cpumap.map, nr_cpus, stdout); >=20 > If libxl_get_physinfo failed then nr_cpus would =3D=3D -1 here. >=20 > However I don't think it is even necessary to extend this (legacy) sexp > any further. I'm about to send a patch which will use the print the json > representation (which is autogenerated). >=20 Ok, then I'll drop this. > > +static int vcpupin_parse(char *cpu, libxl_cpumap *cpumap); >=20 > There are no calls to vcpupin_parse added after this point by this patch > so is this necessary? I'd prefer moving the function up in any case or > at least declaring all the forward references near the top of the file. >=20 Oops. I thought I removed all these fwd-decls. Sorry, seems this one escaped... Will nuke it. :-) Thanks, Dario --=20 <> (Raistlin Majere) ------------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-JPsWgTfV7tKIYcSrsq4B 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.11 (GNU/Linux) iEYEABECAAYFAk8f3PUACgkQk4XaBE3IOsSrwgCfczXYRHhvJ7ScqImHnN337mht zzsAoKGDwrpCxP2SdMa+AAfqXxqCHMVs =MkLt -----END PGP SIGNATURE----- --=-JPsWgTfV7tKIYcSrsq4B-- --===============0221436070339182707== 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.xensource.com http://lists.xensource.com/xen-devel --===============0221436070339182707==--