From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH for-4.5 v3] Xen and tools: Fix listing of vcpus when domains lacking any vcpus exist Date: Wed, 22 Oct 2014 18:18:43 +0200 Message-ID: <1413994723.17454.10.camel@Abyss> References: <1413910014-4249-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3266054609195360997==" Return-path: In-Reply-To: <1413910014-4249-1-git-send-email-andrew.cooper3@citrix.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: Andrew Cooper Cc: Keir Fraser , Ian Campbell , Ian Jackson , Xen-devel , Euan Harris , Jan Beulich , Wei Liu List-Id: xen-devel@lists.xenproject.org --===============3266054609195360997== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-i0mSrorX+s0ksXcxNcGG" --=-i0mSrorX+s0ksXcxNcGG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2014-10-21 at 17:46 +0100, Andrew Cooper wrote: > As part of this change, remove the pointless call to libxl_get_max_cpus()= , > whose returned value is unconditionally clobbered in the for() loop. >=20 Is it? You mind pointing me at where? > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index f27b581..ee127d8 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -5246,7 +5246,12 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, ui= nt32_t domid, > GC_FREE; > return NULL; > } > - *nr_cpus_out =3D libxl_get_max_cpus(ctx); > I may be wrong, but the only other occurrence of nr_cpus_out, which is where the result from libxl_get_max_cpus() is stored, seems to be in the parameter list of the function. About the for, here's how it looks like here: for (*nr_vcpus_out =3D 0; *nr_vcpus_out <=3D domaininfo.max_vcpu_id; ++*nr_vcpus_out, ++ptr) { I.e., it uses nr_vcpus_out. Note: _v_cpus, different from _p_cpus. Without such call, callers that expect to see the parameter filled with the maximum possible number of _P_CPUs, will break! Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-i0mSrorX+s0ksXcxNcGG 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 iEYEABECAAYFAlRH2OMACgkQk4XaBE3IOsRpVQCfWpW8K4UEATbwHO+3U2fanCYt EQ0AoJBWWc0A9tAYYsXCTulaGfxFylZk =wlta -----END PGP SIGNATURE----- --=-i0mSrorX+s0ksXcxNcGG-- --===============3266054609195360997== 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 --===============3266054609195360997==--