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

Re: [Xen-devel] [PATCH for-4.6] libxl: fix libxl__build_hvm error code return path



On Fri, Aug 07, 2015 at 06:08:25PM +0200, Roger Pau Monne wrote:
> This is a simple fix to make sure libxl__build_hvm returns an error code in
> case of failure.
> 



> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>

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

Though I would like to make commit message clearer.

In 25652f23 ("tools/libxl: detect and avoid conflicts with RDM"), new
code was added to use rc to store libxl function call return value,
which complied to libxl coding style. That patch, however, didn't change
other locations where return value was stored in ret. In the end
libxl__build_hvm could return 0 when it failed.

Explicitly set rc to ERROR_FAIL in error path to fix this. A more
comprehensive fix would be changing all ret to rc, which should be done
when next development window opens.

> ---
> I would rather prefer to have it fixed in a proper way like it's done in my
> "libxl: fix libxl__build_hvm error handling" as part of the HVMlite series,
> but I understand that given the current status of the tree and the
> willingness to backport this to stable branches the other approach is going
> to be much harder.
> ---
>  tools/libxl/libxl_dom.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index e1f11a3..668ce11 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -1019,6 +1019,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
>  
>      return 0;
>  out:
> +    rc = ERROR_FAIL;
>      return rc;
>  }
>  
> -- 
> 1.9.5 (Apple Git-50.3)


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