From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 5/7] libxl/libxc: Move libxl_get_cpu_topology()'s hypercall buffer management to libxc Date: Mon, 16 Feb 2015 14:22:08 +0000 Message-ID: <1424096525.6968.23.camel@citrix.com> References: <1423512275-6531-1-git-send-email-boris.ostrovsky@oracle.com> <1423512275-6531-6-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6021184784420513649==" Return-path: In-Reply-To: <1423512275-6531-6-git-send-email-boris.ostrovsky@oracle.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "boris.ostrovsky@oracle.com" Cc: Wei Liu , Ian Campbell , "port-xen@netbsd.org" , Andrew Cooper , "xen-devel@lists.xen.org" , "jbeulich@suse.com" , Stefano Stabellini , "ufimtseva@gmail.com" , Ian Jackson , "Keir (Xen.org)" List-Id: xen-devel@lists.xenproject.org --===============6021184784420513649== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-lgqywK8F+L9hw7UQU3nM" --=-lgqywK8F+L9hw7UQU3nM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-02-09 at 15:04 -0500, Boris Ostrovsky wrote: > Signed-off-by: Boris Ostrovsky > Reviewed-by: Dario Faggioli Just one thing: > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -5072,38 +5072,23 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_phys= info *physinfo) > libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nb_cpu_ou= t) > { > GC_INIT(ctx); > - xc_cputopoinfo_t tinfo; > - DECLARE_HYPERCALL_BUFFER(xen_sysctl_cputopo_t, cputopo); > + xc_cputopo_t *cputopo; > libxl_cputopology *ret =3D NULL; > - int i; > - int max_cpus; > + int i, max_cpus; > =20 > max_cpus =3D libxl_get_max_cpus(ctx); > - if (max_cpus < 0) > - { > + if (max_cpus < 0) { > LIBXL__LOG(ctx, XTL_ERROR, "Unable to determine number of CPUS")= ; > - ret =3D NULL; > goto out; > } > =20 > - cputopo =3D xc_hypercall_buffer_alloc(ctx->xch, cputopo, > - sizeof(*cputopo) * max_cpus); > - if (cputopo =3D=3D NULL) { > - LIBXL__LOG_ERRNOVAL(ctx, XTL_ERROR, ENOMEM, > - "Unable to allocate hypercall arguments"); > - goto fail; > - } > + cputopo =3D libxl__zalloc(gc, sizeof(*cputopo) * max_cpus); > =20 > - set_xen_guest_handle(tinfo.cputopo, cputopo); > - tinfo.max_cpu_index =3D max_cpus - 1; > - if (xc_cputopoinfo(ctx->xch, &tinfo) !=3D 0) { > + if (xc_cputopoinfo(ctx->xch, &max_cpus, cputopo) !=3D 0) { > LIBXL__LOG_ERRNO(ctx, XTL_ERROR, "CPU topology info hypercall fa= iled"); > While at it, you probably can convert this to the new LOGE() error reporting style. Regards, Dario --=-lgqywK8F+L9hw7UQU3nM 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 iEYEABECAAYFAlTh/Q0ACgkQk4XaBE3IOsQNZACgqTdOGCUsNhr9ChCHoHAEs/Kw GpwAniw9jvEuWjVgGdeObMxh7YFJCREY =Bp+0 -----END PGP SIGNATURE----- --=-lgqywK8F+L9hw7UQU3nM-- --===============6021184784420513649== 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 --===============6021184784420513649==--