From patchwork Fri Dec 2 15:08:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9458693 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 3888160756 for ; Fri, 2 Dec 2016 15:11:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C02F2847C for ; Fri, 2 Dec 2016 15:11:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20DBB28542; Fri, 2 Dec 2016 15:11:18 +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 50DB92847C for ; Fri, 2 Dec 2016 15:11:16 +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 1cCpSc-0002yS-Ku; Fri, 02 Dec 2016 15:09: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 1cCpSb-0002wK-2z for xen-devel@lists.xen.org; Fri, 02 Dec 2016 15:09:13 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id 01/7F-28568-89E81485; Fri, 02 Dec 2016 15:09:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42I53H6XVXd6n2O EwbIzFhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8axR5tZCl5LV2z+foWpgfG/cBcjF4eQwBJG if57/exdjJwcbAL2El1/jjKB2CIC0hLXPl9mBLGZBUokms51MoPYwgIeEku+gcQ5OFgEVCWWT K4DCfMKWEqcmN8L1iohIC+x8PwRMJsTKP6g5TrYGCEBC4nmG3dYIOoFJU7OfMICMoZZQF1i/T whiE3yEs1bZzNPYOSdhaRqFkLVLCRVCxiZVzFqFKcWlaUW6Roa6SUVZaZnlOQmZuboGhqY6eW mFhcnpqfmJCYV6yXn525iBAYUAxDsYLy8MeAQoyQHk5Ior2mOY4QQX1J+SmVGYnFGfFFpTmrx IUYZDg4lCd6/PUA5waLU9NSKtMwcYGjDpCU4eJREeFV7gdK8xQWJucWZ6RCpU4yKUuK850H6B EASGaV5cG2weLrEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd5GkPE8mXklcNNfAS1mAlrccd 0eZHFJIkJKqoGR+ZWeidq3Rd5hGd03U7ms//Ea/4zTz2fOZuz7cI/hqX8+234Oh6uT9MX7X++ SCOf52RvaVucaysM8t6lNeNvBSqblGdXZ+z5Vvw44Me2uVPV13uc7Dzi3JXhtTtsZmD6nXZWJ p9pL8Gbkp0g7Ab7JjK3zA5ZyPK58e+hC/olDa/o0k+r/XldiKc5INNRiLipOBAB+lLszogIAA A== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1480691351!74550896!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 43799 invoked from network); 2 Dec 2016 15:09:11 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-4.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Dec 2016 15:09: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); Fri, 02 Dec 2016 16:09:10 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 2 Dec 2016 16:08:15 +0100 Message-Id: <20161202150841.31227-10-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 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: 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_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; }