From patchwork Tue Nov 15 10:18:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9429309 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 4731660469 for ; Tue, 15 Nov 2016 10:21:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23B79286B9 for ; Tue, 15 Nov 2016 10:21:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1469C286C2; Tue, 15 Nov 2016 10:21:47 +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 D945D286B9 for ; Tue, 15 Nov 2016 10:21:45 +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 1c6aqS-00056t-94; Tue, 15 Nov 2016 10:20:04 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6aqQ-0004vN-Ei for xen-devel@lists.xen.org; Tue, 15 Nov 2016 10:20:02 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 49/7B-12520-151EA285; Tue, 15 Nov 2016 10:20:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsVyuP0uq27gQ60 IgwMt/BZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8arxw/ZC05KV6ycdo+1gfGhcBcjF4eQwBJG ibev9jB2MXJysAnYS3T9OcoEYosISEtc+3yZEaSIWeAEo0TPxs1sIAlhAVeJU8s3gNksAqoS/ 66sZQexeQUsJZ60NIDZEgLyEheunmIBsTmB4j+PPgWLCwlYSCy53M0MUS8ocXLmE6AaDqAF6h Lr5wmBhJmBWpu3zmaewMg7C0nVLISqWUiqFjAyr2LUKE4tKkst0jU01UsqykzPKMlNzMzRNTQ w08tNLS5OTE/NSUwq1kvOz93ECAwqBiDYwfhtWcAhRkkOJiVRXqHVWhFCfEn5KZUZicUZ8UWl OanFhxhlODiUJHg33QfKCRalpqdWpGXmAMMbJi3BwaMkwrsCJM1bXJCYW5yZDpE6xagoJc5bD ZIQAElklObBtcFi6hKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEeV+BTOHJzCuBm/4KaDET0O Jd5hogi0sSEVJSDYxqcWfcc5bwBT9TL44zfbtBgXVjYYT/HpUJnAln1y/0K2x9/3b/9nXzhTf fnebzK6O2zfztizuqP8pNi5av5Zxcx2h35Ktu7+kU4xlF6wxebZr5cpH+7PJ3sy3ymX/VX8lx feit+N43o8y1NXmD28QH/7ewfmVSYJG8ek7wzhovWduygNwHpW+VWIozEg21mIuKEwFswP1Jp AIAAA== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1479205200!36702095!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 41339 invoked from network); 15 Nov 2016 10:20:01 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Nov 2016 10:20:01 -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:00 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Tue, 15 Nov 2016 11:18:47 +0100 Message-Id: <20161115101913.10396-10-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 09/35] libxl/libxl_colo_proxy.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_colo_proxy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/libxl/libxl_colo_proxy.c b/tools/libxl/libxl_colo_proxy.c index d4b73ee..0983f42 100644 --- a/tools/libxl/libxl_colo_proxy.c +++ b/tools/libxl/libxl_colo_proxy.c @@ -69,7 +69,7 @@ static int colo_proxy_send(libxl__colo_proxy_state *cps, uint8_t *buff, ret = sendmsg(cps->sock_fd, &mh, 0); if (ret <= 0) { - LOG(ERROR, "can't send msg to kernel by netlink: %s", + LOGD(ERROR, ao->domid, "can't send msg to kernel by netlink: %s", strerror(errno)); } @@ -108,7 +108,7 @@ next: ret = recvmsg(cps->sock_fd, &mh, 0); if (ret <= 0) { if (errno != EAGAIN && errno != EWOULDBLOCK) - LOGE(ERROR, "can't recv msg from kernel by netlink"); + LOGED(ERROR, ao->domid, "can't recv msg from kernel by netlink"); goto err; } @@ -154,7 +154,7 @@ int colo_proxy_setup(libxl__colo_proxy_state *cps) skfd = socket(PF_NETLINK, SOCK_RAW, NETLINK_COLO); if (skfd < 0) { - LOG(ERROR, "can not create a netlink socket: %s", strerror(errno)); + LOGD(ERROR, ao->domid, "can not create a netlink socket: %s", strerror(errno)); goto out; } cps->sock_fd = skfd; @@ -165,16 +165,16 @@ retry: sa.nl_pid = i++; if (i > 10) { - LOG(ERROR, "netlink bind error"); + LOGD(ERROR, ao->domid, "netlink bind error"); goto out; } ret = bind(skfd, (struct sockaddr *)&sa, sizeof(sa)); if (ret < 0 && errno == EADDRINUSE) { - LOG(ERROR, "colo index %d has already in used", sa.nl_pid); + LOGD(ERROR, ao->domid, "colo index %d has already in used", sa.nl_pid); goto retry; } else if (ret < 0) { - LOG(ERROR, "netlink bind error"); + LOGD(ERROR, ao->domid, "netlink bind error"); goto out; } @@ -186,8 +186,8 @@ retry: /* receive ack */ size = colo_proxy_recv(cps, &buff, 500000); if (size < 0) { - LOG(ERROR, "Can't recv msg from kernel by netlink: %s", - strerror(errno)); + LOGD(ERROR, ao->domid, "Can't recv msg from kernel by netlink: %s", + strerror(errno)); goto out; } @@ -198,12 +198,12 @@ retry: struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h); if (size - sizeof(*h) < sizeof(*err)) { - LOG(ERROR, "NLMSG_LENGTH is too short"); + LOGD(ERROR, ao->domid, "NLMSG_LENGTH is too short"); goto out; } if (err->error) { - LOG(ERROR, "NLMSG_ERROR contains error %d", err->error); + LOGD(ERROR, ao->domid, "NLMSG_ERROR contains error %d", err->error); goto out; } } @@ -271,12 +271,12 @@ int colo_proxy_checkpoint(libxl__colo_proxy_state *cps, h = (struct nlmsghdr *) buff; if (h->nlmsg_type == NLMSG_ERROR) { - LOG(ERROR, "receive NLMSG_ERROR"); + LOGD(ERROR, ao->domid, "receive NLMSG_ERROR"); goto out; } if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*m))) { - LOG(ERROR, "NLMSG_LENGTH is too short"); + LOGD(ERROR, ao->domid, "NLMSG_LENGTH is too short"); goto out; }