From patchwork Tue Nov 15 10:18:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9429317 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 DC29860469 for ; Tue, 15 Nov 2016 10:21:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C50E2286BF for ; Tue, 15 Nov 2016 10:21:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9FBC286C4; Tue, 15 Nov 2016 10:21:53 +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 61F04286BF for ; Tue, 15 Nov 2016 10:21:53 +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 1c6aqZ-0005aC-Bm; Tue, 15 Nov 2016 10:20:11 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6aqX-0005Q0-L8 for xen-devel@lists.xen.org; Tue, 15 Nov 2016 10:20:09 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 89/48-19310-951EA285; Tue, 15 Nov 2016 10:20:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42I53H6XVTfioVa EwdV11hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8azhceZCqbKVew81M/WwPhGpIuRk0NIYAmj RPMjexCbTcBeouvPUSYQW0RAWuLa58uMXYxcHMwCJxglejZuZgNJCAs4SzTMOssIYrMIqEocf /AfzOYVsJT4fm8NC4gtISAvceHqKTCbEyj+8+hTdohlFhJLLnczQ9QLSpyc+QSohgNogbrE+n lCIGFmoNbmrbOZJzDyzkJSNQuhahaSqgWMzKsY1YtTi8pSi3SN9JKKMtMzSnITM3N0DQ1M9XJ Ti4sT01NzEpOK9ZLzczcxAgOKAQh2MH7/43SIUZKDSUmUV2i1VoQQX1J+SmVGYnFGfFFpTmrx IUYZDg4lCV6FB0A5waLU9NSKtMwcYGjDpCU4eJREeGNA0rzFBYm5xZnpEKlTjIpS4rwBIAkBk ERGaR5cGyyeLjHKSgnzMgIdIsRTkFqUm1mCKv+KUZyDUUmYVwNkCk9mXgnc9FdAi5mAFu8y1w BZXJKIkJJqYAw9cF2EaeKVHHmDj65R2w+ttTr99nHeQcmFM9UXRMxZm/kt2+Wgh2039ymZyuA rdlu1fGPkp/2Z9W1dZMaLK0IT3Ca4Wjx5mL5ri/Nyq6MlgVNPBT+5n6GZqPd1izi3Kcv6cKnH i3pCjSLMVd4szb8uEb3jLc9mraVVhyqLLodf+FxwwXlHeb0SS3FGoqEWc1FxIgDolgPQogIAA A== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1479205206!70166108!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 40733 invoked from network); 15 Nov 2016 10:20:07 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Nov 2016 10:20:07 -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); Tue, 15 Nov 2016 11:20:07 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Tue, 15 Nov 2016 11:18:57 +0100 Message-Id: <20161115101913.10396-20-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161115101913.10396-1-cbosdonnat@suse.com> References: <20161115101913.10396-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= , Wei Liu , Ian Jackson , =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Subject: [Xen-devel] [PATCH 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: Cédric 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 78ed2f6..7bf5620 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; }