[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 09/35] libxl/libxl_colo_proxy.c: used LOG*D functions



From: Cedric Bosdonnat <cbosdonnat@xxxxxxxx>

Use LOG*D logging functions where possible instead of the LOG* ones.

Signed-off-by: Cédric Bosdonnat <cbosdonnat@xxxxxxxx>
---
 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;
     }
 
-- 
2.10.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.