From patchwork Tue Nov 15 10:19:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9429331 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 8FA4360469 for ; Tue, 15 Nov 2016 10:22:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77E2A286B9 for ; Tue, 15 Nov 2016 10:22:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C8AE286C2; Tue, 15 Nov 2016 10:22:06 +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 08B7E286B9 for ; Tue, 15 Nov 2016 10:22:06 +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 1c6aqc-0005jy-Db; Tue, 15 Nov 2016 10:20:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6aqa-0005Nf-7c for xen-devel@lists.xen.org; Tue, 15 Nov 2016 10:20:12 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id 79/90-30618-B51EA285; Tue, 15 Nov 2016 10:20:11 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsVyuP0uq270Q60 Ig0O7JCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owdW66xFHzQqNjePJmxgfGWbBcjF4eQwBJG iQ2bHjJ2MXJysAnYS3T9OcoEYosISEtc+3yZEaSIWWAmk0TX/Z9gCWEBF4kX6+aBNbAIqErcW HyKFcTmFbCUaO5/wgZiSwjIS1y4eooFxOYEiv88+pQdxBYSsJBYcrmbGaJeUOLkzCdANRxAC9 Ql1s8TAgkzA7U2b53NPIGRdxaSqlkIVbOQVC1gZF7FqF6cWlSWWqRrpJdUlJmeUZKbmJmja2h gppebWlycmJ6ak5hUrJecn7uJERhSDECwg3HZX6dDjJIcTEqivEKrtSKE+JLyUyozEosz4otK c1KLDzHKcHAoSfBOeACUEyxKTU+tSMvMAQY3TFqCg0dJhHc6SJq3uCAxtzgzHSJ1ilFRSpw3A CQhAJLIKM2Da4NF1CVGWSlhXkagQ4R4ClKLcjNLUOVfMYpzMCoJ82qATOHJzCuBm/4KaDET0O Jd5hogi0sSEVJSDYzL6y48+pwm8/vjmpJdRwwT3/lWSxsd8FYMmWuzc0GlyT8tJkMrV6Fjs3/ arIx6nZce8olp4up1euEap4+LdVy52iHdNCH3yUbN+H1zLJqUfoqdOLpQs25+6frbjk/3ejjf Md5rVt2qtkjnl21J4Pfc489F90978u7pi4wJZ05bNvxyUbgd/M9WiaU4I9FQi7moOBEALEncK qMCAAA= X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1479205211!71535096!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 3548 invoked from network); 15 Nov 2016 10:20:11 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-12.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Nov 2016 10:20:11 -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:09 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Tue, 15 Nov 2016 11:19:00 +0100 Message-Id: <20161115101913.10396-23-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: Wei Liu , Ian Jackson , =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= , Yang Hongyang , =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= , Shriram Rajagopalan Subject: [Xen-devel] [PATCH 22/35] libxl/libxl_netbuffer.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_netbuffer.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/tools/libxl/libxl_netbuffer.c b/tools/libxl/libxl_netbuffer.c index 5c7e8a2..323cdd8 100644 --- a/tools/libxl/libxl_netbuffer.c +++ b/tools/libxl/libxl_netbuffer.c @@ -48,15 +48,15 @@ int init_subkind_nic(libxl__checkpoint_devices_state *cds) rs->nlsock = nl_socket_alloc(); if (!rs->nlsock) { - LOG(ERROR, "cannot allocate nl socket"); + LOGD(ERROR, dss->domid, "cannot allocate nl socket"); rc = ERROR_FAIL; goto out; } ret = nl_connect(rs->nlsock, NETLINK_ROUTE); if (ret) { - LOG(ERROR, "failed to open netlink socket: %s", - nl_geterror(ret)); + LOGD(ERROR, dss->domid, "failed to open netlink socket: %s", + nl_geterror(ret)); rc = ERROR_FAIL; goto out; } @@ -64,8 +64,8 @@ int init_subkind_nic(libxl__checkpoint_devices_state *cds) /* get list of all qdiscs installed on network devs. */ ret = rtnl_qdisc_alloc_cache(rs->nlsock, &rs->qdisc_cache); if (ret) { - LOG(ERROR, "failed to allocate qdisc cache: %s", - nl_geterror(ret)); + LOGD(ERROR, dss->domid, "failed to allocate qdisc cache: %s", + nl_geterror(ret)); rc = ERROR_FAIL; goto out; } @@ -162,7 +162,8 @@ static int init_qdisc(libxl__checkpoint_devices_state *cds, */ ret = nl_cache_refill(rs->nlsock, rs->qdisc_cache); if (ret) { - LOG(ERROR, "cannot refill qdisc cache: %s", nl_geterror(ret)); + LOGD(ERROR, cds->domid, + "cannot refill qdisc cache: %s", nl_geterror(ret)); rc = ERROR_FAIL; goto out; } @@ -170,7 +171,8 @@ static int init_qdisc(libxl__checkpoint_devices_state *cds, /* get a handle to the REMUS_IFB interface */ ret = rtnl_link_get_kernel(rs->nlsock, 0, remus_nic->ifb, &ifb); if (ret) { - LOG(ERROR, "cannot obtain handle for %s: %s", remus_nic->ifb, + LOGD(ERROR, cds->domid, + "cannot obtain handle for %s: %s", remus_nic->ifb, nl_geterror(ret)); rc = ERROR_FAIL; goto out; @@ -178,7 +180,8 @@ static int init_qdisc(libxl__checkpoint_devices_state *cds, ifindex = rtnl_link_get_ifindex(ifb); if (!ifindex) { - LOG(ERROR, "interface %s has no index", remus_nic->ifb); + LOGD(ERROR, cds->domid, + "interface %s has no index", remus_nic->ifb); rc = ERROR_FAIL; goto out; } @@ -196,13 +199,15 @@ static int init_qdisc(libxl__checkpoint_devices_state *cds, const char *tc_kind = rtnl_tc_get_kind(TC_CAST(qdisc)); /* Sanity check: Ensure that the root qdisc is a plug qdisc. */ if (!tc_kind || strcmp(tc_kind, "plug")) { - LOG(ERROR, "plug qdisc is not installed on %s", remus_nic->ifb); + LOGD(ERROR, cds->domid, + "plug qdisc is not installed on %s", remus_nic->ifb); rc = ERROR_FAIL; goto out; } remus_nic->qdisc = qdisc; } else { - LOG(ERROR, "Cannot get qdisc handle from ifb %s", remus_nic->ifb); + LOGD(ERROR, cds->domid, + "Cannot get qdisc handle from ifb %s", remus_nic->ifb); rc = ERROR_FAIL; goto out; } @@ -366,8 +371,8 @@ static void netbuf_setup_script_cb(libxl__egc *egc, goto out; if (!(*ifb)) { - LOG(ERROR, "Cannot get ifb dev name for domain %u dev %s", - domid, vif); + LOGD(ERROR, domid, "Cannot get ifb dev name for domain %u dev %s", + domid, vif); rc = ERROR_FAIL; goto out; } @@ -382,8 +387,8 @@ static void netbuf_setup_script_cb(libxl__egc *egc, goto out; if (hotplug_error) { - LOG(ERROR, "netbuf script %s setup failed for vif %s: %s", - rs->netbufscript, vif, hotplug_error); + LOGD(ERROR, domid, "netbuf script %s setup failed for vif %s: %s", + rs->netbufscript, vif, hotplug_error); rc = ERROR_FAIL; goto out; } @@ -393,7 +398,7 @@ static void netbuf_setup_script_cb(libxl__egc *egc, goto out; } - LOG(DEBUG, "%s will buffer packets from vif %s", *ifb, vif); + LOGD(DEBUG, domid, "%s will buffer packets from vif %s", *ifb, vif); rc = init_qdisc(cds, remus_nic); out: @@ -475,10 +480,10 @@ static int remus_netbuf_op(libxl__remus_device_nic *remus_nic, out: if (rc) - LOG(ERROR, "Remus: cannot do netbuf op %s on %s:%s", - ((buffer_op == tc_buffer_start) ? - "start_new_epoch" : "release_prev_epoch"), - remus_nic->ifb, nl_geterror(ret)); + LOGD(ERROR, cds-> domid, "Remus: cannot do netbuf op %s on %s:%s", + ((buffer_op == tc_buffer_start) ? + "start_new_epoch" : "release_prev_epoch"), + remus_nic->ifb, nl_geterror(ret)); return rc; }