From patchwork Thu Nov 17 17:36:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9434815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 889176047D for ; Thu, 17 Nov 2016 17:38:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7861428644 for ; Thu, 17 Nov 2016 17:38:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D18C2968C; Thu, 17 Nov 2016 17:38:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 06AFC28644 for ; Thu, 17 Nov 2016 17:38:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7QcH-0000Bv-4o; Thu, 17 Nov 2016 17:36:53 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7QcF-000073-Gp for xen-devel@lists.xen.org; Thu, 17 Nov 2016 17:36:51 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id FC/A0-23231-2BAED285; Thu, 17 Nov 2016 17:36:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeJIrShJLcpLzFFi42I53H6XVXfTK90 Ig5NX+SyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oxFK6oL+uUqLj7ewNTA+Eyki5GLQ0hgCaPE 2tXLmboYOTnYBOwluv4cBbNFBKQlrn2+zAhiMwuUSOx92gFmCwu4SXzsmMkCYrMIqEqcXXmCr YuRg4NXwEJi5UU5kLCEgLzEhaunwEo4gcIHDp9jBrGFBMwl3rxZADaeV0BQ4uTMJywgrcwC6h Lr5wlBbJKXaN46m3kCI+8sJFWzEKpmIalawMi8ilG9OLWoLLVI11QvqSgzPaMkNzEzR9fQwFg vN7W4ODE9NScxqVgvOT93EyMwmOoZGBh3MF7+6nSIUZKDSUmUl/mlboQQX1J+SmVGYnFGfFFp TmrxIUYZDg4lCd43IDnBotT01Iq0zBxgWMOkJTh4lER4JUHSvMUFibnFmekQqVOMilLivKdBE gIgiYzSPLg2WCxdYpSVEuZlZGBgEOIpSC3KzSxBlX/FKM7BqCTMuwhkCk9mXgnc9FdAi5mAFu 8R0AFZXJKIkJJqYMyK5e55GjBrWeO+fdZr/s7m6rm59nOOwie37BuuftbvXM3b33VqlH6uCva Un7piR9OENB1TO67UhcrSkzp7JHJPXQ72td9ic7fNXz2puXzOn//F/K/PXve5NrM9YfqG00te vf9brtsQeUs1cf2DvsV3ev5yHy67pHL/r0L9SfmJa1KFpL76ViuxFGckGmoxFxUnAgC+VvsXo AIAAA== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1479404209!54742004!1 X-Originating-IP: [195.135.221.5] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57102 invoked from network); 17 Nov 2016 17:36:49 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-12.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Nov 2016 17:36:49 -0000 Received: from laptop.vms (mhy71-2-88-167-63-197.fbx.proxad.net [88.167.63.197]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 17 Nov 2016 18:36:48 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Thu, 17 Nov 2016 18:36:01 +0100 Message-Id: <20161117173617.6697-20-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161117173617.6697-1-cbosdonnat@suse.com> References: <20161117173617.6697-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , Cedric Bosdonnat Subject: [Xen-devel] [PATCH v2 19/35] libxl/libxl_internal.c: used LOG*D functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cedric Bosdonnat Use LOG*D logging functions where possible instead of the LOG* ones. Signed-off-by: Cédric Bosdonnat --- tools/libxl/libxl_internal.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c index c270a24..d288215 100644 --- a/tools/libxl/libxl_internal.c +++ b/tools/libxl/libxl_internal.c @@ -380,7 +380,7 @@ int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid) } if (libxl_device_model_version_from_string(dm_version, &value) < 0) { - LOG(ERROR, "fatal: %s contain a wrong value (%s)", path, dm_version); + LOGD(ERROR, domid, "fatal: %s contain a wrong value (%s)", path, dm_version); return -1; } return value; @@ -407,7 +407,8 @@ libxl__domain_userdata_lock *libxl__lock_domain_userdata(libxl__gc *gc, libxl__carefd_begin(); fd = open(lockfile, O_RDWR|O_CREAT, 0666); if (fd < 0) - LOGE(ERROR, "cannot open lockfile %s, errno=%d", lockfile, errno); + LOGED(ERROR, domid, + "cannot open lockfile %s, errno=%d", lockfile, errno); lock->carefd = libxl__carefd_opened(CTX, fd); if (fd < 0) goto out; @@ -421,21 +422,21 @@ libxl__domain_userdata_lock *libxl__lock_domain_userdata(libxl__gc *gc, continue; default: /* All other errno: EBADF, EINVAL, ENOLCK, EWOULDBLOCK */ - LOGE(ERROR, - "unexpected error while trying to lock %s, fd=%d, errno=%d", - lockfile, fd, errno); + LOGED(ERROR, domid, + "unexpected error while trying to lock %s, fd=%d, errno=%d", + lockfile, fd, errno); goto out; } } if (fstat(fd, &fstab)) { - LOGE(ERROR, "cannot fstat %s, fd=%d, errno=%d", - lockfile, fd, errno); + LOGED(ERROR, domid, "cannot fstat %s, fd=%d, errno=%d", + lockfile, fd, errno); goto out; } if (stat(lockfile, &stab)) { if (errno != ENOENT) { - LOGE(ERROR, "cannot stat %s, errno=%d", lockfile, errno); + LOGED(ERROR, domid, "cannot stat %s, errno=%d", lockfile, errno); goto out; } } else { @@ -489,8 +490,8 @@ int libxl__get_domain_configuration(libxl__gc *gc, uint32_t domid, rc = libxl__userdata_retrieve(gc, domid, "libxl-json", &data, &len); if (rc) { - LOGEV(ERROR, rc, - "failed to retrieve domain configuration for domain %d", domid); + LOGEVD(ERROR, rc, domid, + "failed to retrieve domain configuration"); rc = ERROR_FAIL; goto out; } @@ -515,9 +516,8 @@ int libxl__set_domain_configuration(libxl__gc *gc, uint32_t domid, d_config_json = libxl_domain_config_to_json(CTX, d_config); if (!d_config_json) { - LOGE(ERROR, - "failed to convert domain configuration to JSON for domain %d", - domid); + LOGED(ERROR, domid, + "failed to convert domain configuration to JSON"); rc = ERROR_FAIL; goto out; } @@ -526,8 +526,7 @@ int libxl__set_domain_configuration(libxl__gc *gc, uint32_t domid, (const uint8_t *)d_config_json, strlen(d_config_json) + 1 /* include '\0' */); if (rc) { - LOGEV(ERROR, rc, "failed to store domain configuration for domain %d", - domid); + LOGEVD(ERROR, rc, domid, "failed to store domain configuration"); rc = ERROR_FAIL; goto out; }