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

Re: [Xen-devel] [PATCH 7/7] xl: Fix 'free_memory' to include outstanding_claims value.



Konrad Rzeszutek Wilk writes ("[PATCH 7/7] xl: Fix 'free_memory' to include 
outstanding_claims value."):
> Updating to make it clear that free_memory reported by 'xl info'
> is influenced by the outstanding claim value. [...]

>      if (libxl_get_physinfo(ctx, &info) != 0) {
>          fprintf(stderr, "libxl_physinfo failed.\n");
>          return;
>      }
> -
> +    /*
> +     * Don't bother checking "claim_mode" as user might have turned it off
> +     * and we have outstanding claims.
> +     */
> +    if ((claims = libxl_get_claiminfo(ctx)) < 0){
> +        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
> +                errno, strerror(errno));
> +        return;
> +    }
...
> +        printf("free_memory            : %"PRIu64"\n", (info.free_pages - 
> claims) / i);

This has a race, I think.

Ian.

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