From: Wei Liu Subject: Re: [PATCH v6 for-4.5 2/5] xl: move 'replace_string' further up the file Date: Fri, 26 Sep 2014 10:15:09 +0100 Message-ID: <20140926091509.GB12753@zion.uk.xensource.com> References: <1411591685-25308-1-git-send-email-dave.scott@citrix.com> <1411591685-25308-3-git-send-email-dave.scott@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XXRcP-0001bq-Vn for xen-devel@lists.xenproject.org; Fri, 26 Sep 2014 09:15:14 +0000 Content-Disposition: inline In-Reply-To: <1411591685-25308-3-git-send-email-dave.scott@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Scott Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, ian.jackson@eu.citrix.com, wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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 > --- > 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.