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

Re: [Xen-devel] [PATCH v2 14/18] libxl: introduce libxl_get_memory_static_max



On Wed, 2014-07-30 at 19:23 +0100, Wei Liu wrote:
> +/* type determines which node to return:
> + *   1 "target"
> + *   2 "static-max"

You've just invented enums ;-)

Either use an actual enum, or a bool flag (since this is internal only I
don't mind which)

> +int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t 
> *out_target)
> +{
> +    GC_INIT(ctx);
> +    int rc;
> +
> +    rc = libxl__get_memory_target(gc, domid, out_target, 1);

FWIW for trivial helper wrappers like this where the wrapper does
nothing I think it can be acceptable to bend the usual rule about
internal things taking a gc a bit. Although that can just be saving
problems for later when someone adds some new magic to a wrapper.

> @@ -884,6 +891,7 @@ int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid,
>  int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t 
> target_memkb);
>  int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, int32_t 
> target_memkb, int relative, int enforce);
>  int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t 
> *out_target);
> +int libxl_get_memory_static_max(libxl_ctx *ctx, uint32_t domid, uint32_t 
> *out_static_max);

Do you need this to be public, or did you just do it for consistency?

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