From: Wei Liu Subject: Re: [OPW PATCH V3] tools: xl: refactor code to parse network device options Date: Tue, 21 Oct 2014 16:24:20 +0100 Message-ID: <20141021152420.GI10234@zion.uk.xensource.com> References: <1413901175-12026-1-git-send-email-alecsandrasandulescu@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 1XgbIR-00040M-6l for xen-devel@lists.xenproject.org; Tue, 21 Oct 2014 15:24:27 +0000 Content-Disposition: inline In-Reply-To: <1413901175-12026-1-git-send-email-alecsandrasandulescu@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, Alexandra Sandulescu , wei.liu2@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, Oct 21, 2014 at 05:19:35PM +0300, Alexandra Sandulescu wrote: > From: Alexandra Sandulescu > > This patch removes duplicate code in /tools/libxl/xl_cmdimpl.c by > adding parse_nic_config function. This function parses configuration > data and adds the information into libxl_device_nic struct. It is > called in both main_networkattach and parse_config_data functions > to replace duplicate code. > > Signed-off-by: Alexandra Sandulescu > --- > tools/libxl/xl_cmdimpl.c | 188 ++++++++++++++++++----------------------------- > 1 file changed, 71 insertions(+), 117 deletions(-) > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index ea43761..31a0dcb 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -903,6 +903,74 @@ static void replace_string(char **str, const char *val) > *str = xstrdup(val); > } > > +/* for now used only by main_networkattach, but can be reused elsewhere */ A minor nit is that you should remove this comment because it is not true anymore. Other than that: Acked-by: Wei Liu (CC'ing Konrad for his input as release manager) Now we are in freeze, not sure how applicable is it for this patch to go in. To Konrad: -ve: this is only code refactoring, not bug fix +ve: the risk of introducing bug is low as 1) this refactoring is straight-forward, 2) the code path is tested in OSSTest. Wei.