From patchwork Fri Dec 2 15:08:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9458711 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 D3DEA60236 for ; Fri, 2 Dec 2016 15:11:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C702A2847C for ; Fri, 2 Dec 2016 15:11:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBF5F2855C; Fri, 2 Dec 2016 15:11:30 +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 668BE2847C for ; Fri, 2 Dec 2016 15:11:30 +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 1cCpSj-000395-JN; Fri, 02 Dec 2016 15:09:21 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpSi-000372-QO for xen-devel@lists.xen.org; Fri, 02 Dec 2016 15:09:20 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 53/44-08915-0AE81485; Fri, 02 Dec 2016 15:09:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsVyuP0uq+78Psc Ig/tnpSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ow/MxvZCk7LVpz595S5gbFVtIuRi0NIYAmj xJF391m6GDk52ATsJbr+HGUCsUUEpCWufb7MCGIzC5RINJ3rZAaxhQWcJc4/OAxWwyKgKvFr+ imwXl4BS4kTRxvAbAkBeYmF54+A1XACxR+0XAebIyRgIdF84w5UvaDEyZlPgGwOoPnqEuvnCU Gskpdo3jqbeQIj7ywkVbMQqmYhqVrAyLyKUaM4tagstUjX0FwvqSgzPaMkNzEzR9fQwFgvN7W 4ODE9NScxqVgvOT93EyMwpBiAYAfjy9OehxglOZiURHlNcxwjhPiS8lMqMxKLM+KLSnNSiw8x ynBwKEnw/u0BygkWpaanVqRl5gCDGyYtwcGjJMKr2guU5i0uSMwtzkyHSJ1iVJQS5z0CkhAAS WSU5sG1wSLqEqOslDAvI9AhQjwFqUW5mSWo8q8YxTkYlYR5G0Gm8GTmlcBNfwW0mAloccd1e5 DFJYkIKakGRq8Jm5M/2Rx+xGK0LmalyXMR//qJm67c1VEoPtS6Qf9jcfauR4FqDBlZ//KnK/7 +XXOpgG3N+oM/VDoWXYx5fOucQ1bm1eeVkx5/aJbkl7A73mwrH/CENy59SuFu/WOXO+at/fB0 KefRbc+kQ6cdPHVecInihe6YOfc//X5/ULbbKsu08adMELcSS3FGoqEWc1FxIgDr1q30owIAA A== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1480691359!57366726!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 8420 invoked from network); 2 Dec 2016 15:09:19 -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; 2 Dec 2016 15:09:19 -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:18 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 2 Dec 2016 16:08:26 +0100 Message-Id: <20161202150841.31227-21-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 20/35] libxl/libxl_linux.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_linux.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tools/libxl/libxl_linux.c b/tools/libxl/libxl_linux.c index 0033a0e..6ef0abc 100644 --- a/tools/libxl/libxl_linux.c +++ b/tools/libxl/libxl_linux.c @@ -61,7 +61,7 @@ static char **get_hotplug_env(libxl__gc *gc, env[nr++] = gatewaydev ? : ""; if (libxl__nic_type(gc, dev, &nictype)) { - LOG(ERROR, "unable to get nictype"); + LOGD(ERROR, dev->domid, "unable to get nictype"); return NULL; } switch (nictype) { @@ -107,14 +107,15 @@ static int libxl__hotplug_nic(libxl__gc *gc, libxl__device *dev, script = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/%s", be_path, "script")); if (!script) { - LOGE(ERROR, "unable to read script from %s", be_path); + LOGED(ERROR, dev->domid, + "unable to read script from %s", be_path); rc = ERROR_FAIL; goto out; } rc = libxl__nic_type(gc, dev, &nictype); if (rc) { - LOG(ERROR, "error when fetching nic type"); + LOGD(ERROR, dev->domid, "error when fetching nic type"); rc = ERROR_FAIL; goto out; } @@ -161,14 +162,15 @@ static int libxl__hotplug_disk(libxl__gc *gc, libxl__device *dev, script = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/%s", be_path, "script")); if (!script) { - LOGEV(ERROR, errno, "unable to read script from %s", be_path); + LOGEVD(ERROR, errno, dev->domid, + "unable to read script from %s", be_path); rc = ERROR_FAIL; goto error; } *env = get_hotplug_env(gc, script, dev); if (!*env) { - LOG(ERROR, "Failed to get hotplug environment"); + LOGD(ERROR, dev->domid, "Failed to get hotplug environment"); rc = ERROR_FAIL; goto error; } @@ -180,7 +182,7 @@ static int libxl__hotplug_disk(libxl__gc *gc, libxl__device *dev, (*args)[nr++] = NULL; assert(nr == arraysize); - LOG(DEBUG, "Args and environment ready"); + LOGD(DEBUG, dev->domid, "Args and environment ready"); rc = 1; error: @@ -197,7 +199,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, switch (dev->backend_kind) { case LIBXL__DEVICE_KIND_VBD: if (num_exec != 0) { - LOG(DEBUG, "num_exec %d, not running hotplug scripts", num_exec); + LOGD(DEBUG, dev->domid, + "num_exec %d, not running hotplug scripts", num_exec); rc = 0; goto out; } @@ -210,7 +213,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, */ if ((num_exec > 1) || (libxl_get_stubdom_id(CTX, dev->domid) && num_exec)) { - LOG(DEBUG, "num_exec %d, not running hotplug scripts", num_exec); + LOGD(DEBUG, dev->domid, + "num_exec %d, not running hotplug scripts", num_exec); rc = 0; goto out; } @@ -218,7 +222,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, break; default: /* No need to execute any hotplug scripts */ - LOG(DEBUG, "backend_kind %d, no need to execute scripts", dev->backend_kind); + LOGD(DEBUG, dev->domid, + "backend_kind %d, no need to execute scripts", dev->backend_kind); rc = 0; break; }