From: Wei Liu Subject: Re: [PATCH 1/4] libxl: convert to use LOG() macro Date: Tue, 15 Sep 2015 16:36:26 +0100 Message-ID: <20150915153626.GO2294@zion.uk.xensource.com> References: <1442310104-23932-1-git-send-email-wei.liu2@citrix.com> <1442310104-23932-2-git-send-email-wei.liu2@citrix.com> <55F83579.8070307@citrix.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 1ZbsHt-0005np-5B for xen-devel@lists.xenproject.org; Tue, 15 Sep 2015 15:36:53 +0000 Content-Disposition: inline In-Reply-To: <55F83579.8070307@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: Andrew Cooper Cc: Xen-devel , Wei Liu , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Tue, Sep 15, 2015 at 04:12:57PM +0100, Andrew Cooper wrote: > On 15/09/15 10:41, Wei Liu wrote: > > @@ -440,15 +436,18 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid, > > if (old_name) { > > got_old_name = xs_read(ctx->xsh, trans, name_path, &got_old_len); > > if (!got_old_name) { > > - LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, "check old name" > > - " for domain %"PRIu32" allegedly named `%s'", > > - domid, old_name); > > + LOGEV(ERROR, errno, > > + "check old name"" for domain %"PRIu32" allegedly named `%s'", > > + domid, > > + old_name); > > There are a number of entries like this where the number of lines could > be reduced. Urgh, it was generated by spatch. I would certainly rather not going over all instances for such kind of things -- that voids the point of using spatch in the first place. If there is a knob to control spatch to then I would be happy to use it. Otherwise I will just leave it as it is. > > > @@ -669,16 +678,22 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r, > > uint32_t domid) { > > xc_domaininfo_t xcinfo; > > int ret; > > + GC_INIT(ctx); > > > > ret = xc_domain_getinfolist(ctx->xch, domid, 1, &xcinfo); > > if (ret<0) { > > - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list"); > > + LOGE(ERROR, "getting domain info list"); > > + GC_FREE; > > return ERROR_FAIL; > > } > > - if (ret==0 || xcinfo.domain != domid) return ERROR_DOMAIN_NOTFOUND; > > + if (ret==0 || xcinfo.domain != domid) { > > + GC_FREE; > > + return ERROR_DOMAIN_NOTFOUND; > > + } > Nice catch. Will fix this. Wei. > Alignment. > > ~Andrew