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

Re: [Xen-devel] [XEN PATCH for-4.13 4/6] libxl: libxl_domain_need_memory: Make it take a domain_config



On Fri, Oct 04, 2019 at 04:17:05PM +0100, Ian Jackson wrote:
> diff --git a/tools/libxl/libxl_mem.c b/tools/libxl/libxl_mem.c
> index fd6f33312e..26cf136ac2 100644
> --- a/tools/libxl/libxl_mem.c
> +++ b/tools/libxl/libxl_mem.c
> @@ -446,20 +446,12 @@ int libxl_get_memory_target_0x040700(
>      return libxl__memkb_64to32(ctx, rc, my_out_target, out_target);
>  }
>  
> -int libxl_domain_need_memory(libxl_ctx *ctx,
> -                             const libxl_domain_build_info *b_info_in,
> -                             uint64_t *need_memkb)
> +int libxl__domain_need_memory_calculate(libxl__gc *gc,
> +                              libxl_domain_build_info *b_info,
> +                              uint64_t *need_memkb)
>  {
> -    GC_INIT(ctx);
> -    libxl_domain_build_info b_info[1];
>      int rc;
>  
> -    libxl_domain_build_info_init(b_info);
> -    libxl_domain_build_info_copy(ctx, b_info, b_info_in);
> -
> -    rc = libxl__domain_build_info_setdefault(gc, b_info);
> -    if (rc) goto out;
> -
>      *need_memkb = b_info->target_memkb;
>      *need_memkb += b_info->shadow_memkb + b_info->iommu_memkb;
>  
> @@ -482,9 +474,57 @@ int libxl_domain_need_memory(libxl_ctx *ctx,
>      rc = 0;
>  out:
>      GC_FREE;

This GC_FREE should be removed.

> -    libxl_domain_build_info_dispose(b_info);
>      return rc;
> +}
>  

The rest looks fine. So with the extra GC_FREE removed:
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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