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

Re: [Xen-devel] [PATCH 1/2] Revert "libxl: fix "xl mem-set" regression from 0c029c4da2"



>>> On 23.06.15 at 16:16, <wei.liu2@xxxxxxxxxx> wrote:
> This reverts commit f5b43e95facdc17f925cb56a8963cd4531074034.

Even if the patch having introduced the regression this fixed is
being reverted, it's not clear to me why this change needs to be
reverted too - it seems correct to me to use 64-bit types for the
calculations. Or are you planning to do a more comprehensive
adjustments to all of the types later on?

Jan

> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -1285,7 +1285,7 @@ int xc_getcpuinfo(xc_interface *xch, int max_cpus,
>  
>  int xc_domain_setmaxmem(xc_interface *xch,
>                          uint32_t domid,
> -                        uint64_t max_memkb);
> +                        unsigned int max_memkb);
>  
>  int xc_domain_set_memmap_limit(xc_interface *xch,
>                                 uint32_t domid,
> diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
> index ce51e69..5b1a52d 100644
> --- a/tools/libxc/xc_domain.c
> +++ b/tools/libxc/xc_domain.c
> @@ -635,7 +635,7 @@ int xc_shadow_control(xc_interface *xch,
>  
>  int xc_domain_setmaxmem(xc_interface *xch,
>                          uint32_t domid,
> -                        uint64_t max_memkb)
> +                        unsigned int max_memkb)
>  {
>      DECLARE_DOMCTL;
>      domctl.cmd = XEN_DOMCTL_max_mem;
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index d86ea62..35caf42 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -4736,8 +4736,7 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t 
> domid,
>  {
>      GC_INIT(ctx);
>      int rc = 1, abort_transaction = 0;
> -    uint64_t memorykb;
> -    uint32_t videoram = 0;
> +    uint32_t memorykb = 0, videoram = 0;
>      uint32_t current_target_memkb = 0, new_target_memkb = 0;
>      uint32_t current_max_memkb = 0;
>      char *memmax, *endptr, *videoram_s = NULL, *target = NULL;
> @@ -4831,7 +4830,7 @@ retry_transaction:
>          rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb);
>          if (rc != 0) {
>              LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
> -                    "xc_domain_setmaxmem domid=%u memkb=%"PRIu64" failed "
> +                    "xc_domain_setmaxmem domid=%d memkb=%d failed "
>                      "rc=%d\n", domid, memorykb, rc);
>              abort_transaction = 1;
>              goto out;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx 
> http://lists.xen.org/xen-devel 




_______________________________________________
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®.