From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1/4] libxl: convert to use LOG() macro Date: Tue, 15 Sep 2015 16:12:57 +0100 Message-ID: <55F83579.8070307@citrix.com> References: <1442310104-23932-1-git-send-email-wei.liu2@citrix.com> <1442310104-23932-2-git-send-email-wei.liu2@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 1Zbrvs-0003XG-MI for xen-devel@lists.xenproject.org; Tue, 15 Sep 2015 15:14:08 +0000 In-Reply-To: <1442310104-23932-2-git-send-email-wei.liu2@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: Wei Liu , Xen-devel Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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. > @@ -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; > + } Alignment. ~Andrew