From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 ]libxl: allow to set more than 31 vcpus Date: Fri, 01 Jun 2012 08:35:41 +0200 Message-ID: <1338532541.31901.10.camel@Abyss> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6394858579261262338==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Zhang, Yang Z" Cc: "xen-devel@lists.xensource.com" , Ian Campbell List-Id: xen-devel@lists.xenproject.org --===============6394858579261262338== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-/eGdupRGnTZxx0qcmlNc" --=-/eGdupRGnTZxx0qcmlNc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2012-06-01 at 02:48 +0000, Zhang, Yang Z wrote:=20 > Change from v2: > Add function libxl_cpumap_to_hex_string to covert cpumap to hex string. > According to Ian's comments, modified some codes to make the logic more r= easonable. >=20 > In current implementation, it uses integer to record current avail cpus a= nd this only allows user to specify 31 vcpus.=20 > In following patch, it uses cpumap instead integer which make more sense = than before. Also there is no limit to the max vcpus. >=20 This part I understand, and looks reasonable. I also see this is the whole point of your other patch, however ... > diff -r 3b0eed731020 tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c Fri Jun 01 09:27:17 2012 +0800 > +++ b/tools/libxl/xl_cmdimpl.c Fri Jun 01 10:34:13 2012 +0800 > @@ -650,7 +650,14 @@ static void parse_config_data(const char >=20 > if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) { > b_info->max_vcpus =3D l; > - b_info->cur_vcpus =3D (1 << l) - 1; > + > + if (libxl_cpumap_alloc(ctx, &b_info->avail_vcpus, l)) { > + fprintf(stderr, "Unable to allocate cpumap\n"); > + exit(1); > + } > ... Do you mind explaining me what would have happened here without your previous patch, i.e., by just using the existing libxl_cpumap_alloc ? I might be wrong, but I was wondering whether it is worth changing the interface like that for just this single case which saves, what, 1 to 3 bytes per domain? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-/eGdupRGnTZxx0qcmlNc 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.12 (GNU/Linux) iEYEABECAAYFAk/IYr0ACgkQk4XaBE3IOsRh4QCfccT8mDMUryVPbAey/+wtEdZS sEYAoIeoFumjV5Ar3KR0xl46sGgqkrdn =BNBE -----END PGP SIGNATURE----- --=-/eGdupRGnTZxx0qcmlNc-- --===============6394858579261262338== 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 --===============6394858579261262338==--