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

Re: [Xen-devel] [PATCH V5 24/32] libxl: copy function for builtin types



On Tue, 2014-05-13 at 22:54 +0100, Wei Liu wrote:
> These functions will be used in later patch to deep-copy a structure.
> 
> Functions introduced:
>  * libxl_string_list_copy
>  * libxl_key_value_list_copy
>  * libxl_hwcap_copy
>  * libxl_mac_copy
>  * libxl_cpuid_policy_list_copy
>  * libxl_string_copy
>  * libxl_bitmap_copy_alloc
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> +void libxl_hwcap_copy(libxl_ctx *ctx,libxl_hwcap *dst, libxl_hwcap *src)
> +{
> +    int i;
> +
> +    for (i = 0; i < 8; i++)
> +        (*dst)[i] = (*src)[i];
> +}
> +
> +void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src)
> +{
> +    int i;
> +
> +    for (i = 0; i < 6; i++)
> +        (*dst)[i] = (*src)[i];

These two might be candidates for using memcpy.

> diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
> index 37c4d5f..041b927 100644
> --- a/tools/libxl/libxl_uuid.h
> +++ b/tools/libxl/libxl_uuid.h
> @@ -61,7 +61,6 @@ void libxl_uuid_copy(libxl_ctx *ctx, libxl_uuid *dst, const 
> libxl_uuid *src);
>  #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
>  void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
>  #endif
> -

Stray change.

>  void libxl_uuid_clear(libxl_uuid *uuid);
>  int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2);
>  uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid);



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