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

Re: [Xen-devel] [PATCH v2] libxl: refactor toolstack save restore code



On Wed, 2015-06-17 at 12:08 +0100, Wei Liu wrote:
> This patch does following things:
> 1. Document v1 format.
> 2. Factor out function to handle QEMU restore data and function to
>    handle v1 blob for restore path.
> 3. Refactor save function to generate different blobs in the order
>    specified in format specification.
> 4. Change functions to use "goto out" idiom.
> 
> No functional changes introduced.
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
[...]
> -    *len = sizeof(version) + sizeof(count);
> +    /* Version number */
> +    *len = sizeof(version);
>      *buf = calloc(1, *len);

This ought to use lbixl__calloc and therefore avoid the error handling,
and possibly the cleanup by taking advantage of the gc.

[...]
> +        *len += sizeof(count);
> +        *buf = realloc(*buf, *len);

As should this use libxl__realloc.

But those are out of scope for what you are doing (it just gets more
obvious with the goto out idiom I think), so:

Acked + applied.


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