From: Wei Liu Subject: Re: [OPW PATCH V2] tools: xl: refactor code to parse network device options Date: Tue, 21 Oct 2014 13:46:22 +0100 Message-ID: <20141021124622.GA10234@zion.uk.xensource.com> References: <1413839201-17146-1-git-send-email-alecsandra.sandulescu@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XgZ1Q-0003jN-Vg for xen-devel@lists.xenproject.org; Tue, 21 Oct 2014 12:58:45 +0000 Content-Disposition: inline In-Reply-To: <1413839201-17146-1-git-send-email-alecsandra.sandulescu@gmail.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: Alexandra Sandulescu Cc: xen-devel@lists.xenproject.org, wei.liu2@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, Oct 21, 2014 at 12:06:41AM +0300, Alexandra Sandulescu wrote: [...] > +static int match_option_size(const char *prefix, size_t len, > + char *arg, char **argopt) > +{ > + int rc = strncmp(prefix, arg, len); > + if (!rc) *argopt = arg+len; > + return !rc; > +} > +#define MATCH_OPTION(prefix, arg, oparg) \ > + match_option_size((prefix "="), sizeof((prefix)), (arg), &(oparg)) > + > +static void replace_string(char **str, const char *val) > +{ > + free(*str); > + *str = strdup(val); > +} Could you rebase your patch against staging branch? Dave Scott recently touched replace_string but that change is yet in master branch. > + [...] > - fprintf(stderr, "unrecognized argument `%s'\n", *argv); > - return 1; > - } > + if (parse_nic_config(&nic, &config, *argv)) > + return 1; Indentation. Wei. > } > > if (dryrun_only) { > -- > 1.9.1