From patchwork Fri Dec 2 15:08:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9458717 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 5EC8360236 for ; Fri, 2 Dec 2016 15:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51D822847C for ; Fri, 2 Dec 2016 15:11:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46B682855C; Fri, 2 Dec 2016 15:11:37 +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 D72C92847C for ; Fri, 2 Dec 2016 15:11:36 +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 1cCpSo-0003Le-3u; Fri, 02 Dec 2016 15:09:26 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpSl-0003AT-7A for xen-devel@lists.xen.org; Fri, 02 Dec 2016 15:09:23 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id 46/B5-13537-2AE81485; Fri, 02 Dec 2016 15:09:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsVyuP0uq+6CPsc IgzWbrC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy/x1+yFUzSrLh0sJ+1gfGHbBcjF4eQwBJG ietP25m6GDk52ATsJbr+HAWzRQSkJa59vswIUsQscJRRYnnLXmaQhLCAu8SbyxcZQWwWAVWJt 8da2UFsXgFLiY0b/oI1SwjISyw8fwTM5gSKP2i5DlYvJGAh0XzjDgtEvaDEyZlPgGwOoAXqEu vnCYGEmYFam7fOZp7AyDsLSdUshKpZSKoWMDKvYtQoTi0qSy3SNTLRSyrKTM8oyU3MzNE1NDD Vy00tLk5MT81JTCrWS87P3cQIDKp6BgbGHYw3J/sdYpTkYFIS5TXNcYwQ4kvKT6nMSCzOiC8q zUktPsQow8GhJMH7twcoJ1iUmp5akZaZAwxvmLQEB4+SCK9qL1Cat7ggMbc4Mx0idYpRUUqc1 xkkIQCSyCjNg2uDxdQlRlkpYV5GBgYGIZ6C1KLczBJU+VeM4hyMSsK8jSBTeDLzSuCmvwJazA S0uOO6PcjikkSElFQDY9yp23ft63b5KVU9qNgdbDAhp5jz99bsB3knJv1mcD5S/U1N6N+p19t MJzgqf6/kZX1k3Oyax1TgxG2o0NXvcShH7Jloxfr3Fukh2ifZui+wGVsf/BWoWPCx7Y3GU5P1 Juui56eeqVV/+61W9//+JxVGx85bSF4ruGCYzevBVNKzcffqXdd/K7EUZyQaajEXFScCAIlRV PSkAgAA X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1480691359!73573299!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 60635 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-4.tower-206.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:19 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 2 Dec 2016 16:08:28 +0100 Message-Id: <20161202150841.31227-23-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: Shriram Rajagopalan , Yang Hongyang , Ian Jackson , Wei Liu , Cedric Bosdonnat Subject: [Xen-devel] [PATCH v2 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: 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_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; }