From patchwork Thu Nov 17 17:36:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9434823 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 8829D6047D for ; Thu, 17 Nov 2016 17:38:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B1CF20499 for ; Thu, 17 Nov 2016 17:38:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FB4629687; Thu, 17 Nov 2016 17:38:55 +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 0856D20499 for ; Thu, 17 Nov 2016 17:38:55 +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 1c7QcJ-0000I0-Uh; Thu, 17 Nov 2016 17:36:55 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7QcI-0000Eb-Uz for xen-devel@lists.xen.org; Thu, 17 Nov 2016 17:36:55 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id B2/C6-20944-6BAED285; Thu, 17 Nov 2016 17:36:54 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsVyuP0uq+7WV7o RBhdemFks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmHVv5mKnilUXH57CXmBsYrsl2MXBxCAksY Jda132PqYuTkYBOwl+j6cxTMFhGQlrj2+TIjSBGzwFFGib237rGCJIQF3CXeXL7ICGKzCKhKv J3QBWbzClhILJh7nwXElhCQl7hw9RSYzQkUP3D4HDOILSRgLvHmzQImiHpBiZMznwDVcAAtUJ dYP08IJMwM1Nq8dTbzBEbeWUiqZiFUzUJStYCReRWjRnFqUVlqka6hiV5SUWZ6RkluYmaOrqG BmV5uanFxYnpqTmJSsV5yfu4mRmBQMQDBDsbrGwMOMUpyMCmJ8jK/1I0Q4kvKT6nMSCzOiC8q zUktPsQow8GhJMH7BiQnWJSanlqRlpkDDG+YtAQHj5IIryRImre4IDG3ODMdInWKUVFKnPc0S EIAJJFRmgfXBoupS4yyUsK8jECHCPEUpBblZpagyr9iFOdgVBLmTQGZwpOZVwI3/RXQYiagxX sEdEAWlyQipKQaGPdKnC2Wttm0+2791WKZPWZrbpkyvnv2ct6RipCrD/gerLn8+PStJ0EZRbl 1TDJ8wk3KP9kEKjpZ3kh2HZT6pRhndWSHgjfHkuqL/mlX3N9JxDY4JyqdkVN8dc5hmmZnf3m2 +hTm2ouyx1bN9e0vmGxo0/P0JUNYFtu6oyFl7fUb/gdozeSZrMRSnJFoqMVcVJwIALVUAQukA gAA X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1479404213!72609074!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 24113 invoked from network); 17 Nov 2016 17:36:53 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Nov 2016 17:36:53 -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); Thu, 17 Nov 2016 18:36:51 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Thu, 17 Nov 2016 18:36:04 +0100 Message-Id: <20161117173617.6697-23-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161117173617.6697-1-cbosdonnat@suse.com> References: <20161117173617.6697-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Shriram Rajagopalan , Ian Jackson , Yang Hongyang , Cedric Bosdonnat , Wei Liu 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 --- 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; }