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

Re: [Xen-devel] [PATCH v4 4/7] libxl: Fix libxl_set_memory_target return value

On Mon, May 09, 2016 at 01:30:55PM +0200, Paulina Szubarczyk wrote:
> From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
> libxl_set_memory_target seems to have the following return values:
>  '1' : on failure, if the failure happens because of a xenstore error
>        *or* invalid target
>  '-1': on error, the setmaxmem and set_pod_target hypercalls
>        return -1 and set errno appropriately.
>  '0' : on success
> Make it consistently return ERROR_FAIL on failure, unless the
> parameters were invalid, in which case return ERROR_INVAL.
> In accordance with CODING_SYTLE:
>   1. Leave rc uninitialized, and set when an error is detected
>   2. Use 'r' for return values to functions whose return values are a
>      different error space (like xc_domain_setmaxmem and
>      xc_domain_set_pod_target)
>   3. Use 'lrc' for return values to local functions libxl__*
>      where a failure means retry, rather than fail the whole function
>      (libxl__fill_dom0_memory_info), to reduce the risk of that.
> Signed-off-by: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
> Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@xxxxxxxxx>
> Reviewed-by: Olaf Hering <olaf@xxxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Thanks Olaf for reviewing btw.

Xen-devel mailing list



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