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

Re: [Xen-devel] [PATCH v4 10/15] tools: implement the new libxl get hw info interface



On Sat, Sep 23, 2017 at 09:48:19AM +0000, Yi Sun wrote:
> This patch implements the new libxl get hw info interface,
> 'libxl_psr_get_hw_info', which is suitable to all psr allocation
> features. It also implements corresponding list free function,
> 'libxl_psr_hw_info_list_free' and makes 'libxl_psr_cat_get_info' call
> 'libxl_psr_get_hw_info' to avoid redundant code in libxl_psr.c.
> 
> Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

With one nit:

>  int libxl_psr_get_hw_info(libxl_ctx *ctx, libxl_psr_hw_info **info,
>                            unsigned int *nr, libxl_psr_feat_type type,
>                            unsigned int lvl)
>  {
> -    return ERROR_FAIL;
> +    GC_INIT(ctx);
> +    int rc, nr_sockets;
> +    unsigned int i = 0, socketid;
> +    libxl_bitmap socketmap;
> +    libxl_psr_hw_info *ptr;
> +    xc_psr_feat_type xc_type;
> +    xc_psr_hw_info hw_info;
> +
> +    libxl_bitmap_init(&socketmap);
> +
> +    xc_type = libxl__feat_type_to_libxc_feat_type(type, lvl);
> +
> +    rc = libxl__count_physical_sockets(gc, &nr_sockets);
> +    if (rc) {
> +        LOG(ERROR, "failed to get system socket count");
> +        goto out;
> +    }
> +
> +    libxl_socket_bitmap_alloc(ctx, &socketmap, nr_sockets);
> +    rc = libxl_get_online_socketmap(ctx, &socketmap);
> +    if (rc < 0) {

"if (rc)" like above.

Thanks, Roger.

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

 


Rackspace

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