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

Re: [Xen-devel] [PATCH v6 for-4.5 2/5] xl: move 'replace_string' further up the file



On Wed, Sep 24, 2014 at 09:48:02PM +0100, David Scott wrote:
> This allows the function to be reused more easily.
> 
> Signed-off-by: David Scott <dave.scott@xxxxxxxxxx>
> ---
>  tools/libxl/xl_cmdimpl.c |   13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 698b3bc..1695f74 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -799,6 +799,12 @@ static void parse_vcpu_affinity(libxl_domain_build_info 
> *b_info,
>      }
>  }
>  
> +static void replace_string(char **str, const char *val)
> +{
> +    free(*str);
> +    *str = strdup(val);
> +}
> +

If you rearrange patch 2 and 3 you can then use xstrdup here.

Wei.

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