From patchwork Fri Dec 2 15:08:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9458719 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 8727060236 for ; Fri, 2 Dec 2016 15:11:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79DE62847C for ; Fri, 2 Dec 2016 15:11:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EF5A28563; Fri, 2 Dec 2016 15:11:40 +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 D4D602847C for ; Fri, 2 Dec 2016 15:11:39 +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 1cCpSn-0003L0-So; Fri, 02 Dec 2016 15:09:25 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpSl-0003AR-6d for xen-devel@lists.xen.org; Fri, 02 Dec 2016 15:09:23 +0000 Received: from [85.158.143.35] by server-8.bemta-6.messagelabs.com id F9/62-25331-2AE81485; Fri, 02 Dec 2016 15:09:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42I53H6XVXdRn2O Ewc4jTBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bWjrfsBdvlKh7db2NvYOwS7WLk4hASWMIo 8eDGVKYuRk4ONgF7ia4/R8FsEQFpiWufLzOC2MwCJRJN5zqZQWxhATeJjx0zWUBsFgFViYXfp 7N3MXJw8ApYSnz4JQYSlhCQl1h4/gjYGE6g8IOW62BjhAQsJJpv3AFr5RUQlDg58wkLSCuzgL rE+nlCEJvkJZq3zmaewMg7C0nVLISqWUiqFjAyr2LUKE4tKkst0jUy1EsqykzPKMlNzMzRNTQ w08tNLS5OTE/NSUwq1kvOz93ECAwoBiDYwfhnWcAhRkkOJiVRXtMcxwghvqT8lMqMxOKM+KLS nNTiQ4wyHBxKErx/e4BygkWp6akVaZk5wNCGSUtw8CiJ8Kr2AqV5iwsSc4sz0yFSpxgVpcR5j 4AkBEASGaV5cG2weLrEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd5GkCk8mXklcNNfAS1mAl rccd0eZHFJIkJKqoHRmedAwZofj18eF4qS4KoQMjxf8pVxi2G4xKU8fd0DKn4Hnqy+XDEzd+u VwM3/p6arxZs7cC1z/hGqOzdDlfW4QiJbir/jL9aHFe+vMazdw/pdY41g7oK+nFbHp3dnP3os q/bT+vB7Y+bnhSwzFHnvb2/4dnWPtUWp8r9WeaH6h3mS1cXiP4uUWIozEg21mIuKEwFyKMtBo gIAAA== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1480691361!41870923!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 10562 invoked from network); 2 Dec 2016 15:09:21 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Dec 2016 15:09:21 -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); Fri, 02 Dec 2016 16:09:17 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 2 Dec 2016 16:08:25 +0100 Message-Id: <20161202150841.31227-20-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161202150841.31227-1-cbosdonnat@suse.com> References: <20161202150841.31227-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Ian Jackson , Wei Liu , 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 Acked-by: Wei Liu --- 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; }