[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/libxl: Correct use of phyinfo_{init, dispose}()



On Tue, Aug 04, 2015 at 07:58:38PM +0100, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
[...]
> index bfc9699..13dc2de 100644
> --- a/tools/libxl/libxl_utils.c
> +++ b/tools/libxl/libxl_utils.c
> @@ -848,11 +848,10 @@ int libxl__count_physical_sockets(libxl__gc *gc, int 
> *sockets)
>      libxl_physinfo_init(&info);
>  
>      rc = libxl_get_physinfo(CTX, &info);
> -    if (rc)
> -        return rc;
> -
> -    *sockets = info.nr_cpus / info.threads_per_core
> -                            / info.cores_per_socket;
> +    if (!rc) {
> +        *sockets = info.nr_cpus / info.threads_per_core
> +                                / info.cores_per_socket;
> +    }
>  
>      libxl_physinfo_dispose(&info);
>      return 0;

This should return rc.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.