xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Bosdonnat" <cbosdonnat@suse.com>
To: xen-devel@lists.xen.org
Cc: "Wei Liu" <wei.liu2@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Cédric Bosdonnat" <cedric.bosdonnat@free.fr>,
	"Yang Hongyang" <imhy.yang@gmail.com>,
	"Cédric Bosdonnat" <cbosdonnat@suse.com>,
	"Shriram Rajagopalan" <rshriram@cs.ubc.ca>
Subject: [PATCH 22/35] libxl/libxl_netbuffer.c: used LOG*D functions
Date: Tue, 15 Nov 2016 11:19:00 +0100	[thread overview]
Message-ID: <20161115101913.10396-23-cbosdonnat@suse.com> (raw)
In-Reply-To: <20161115101913.10396-1-cbosdonnat@suse.com>

From: Cédric Bosdonnat <cedric.bosdonnat@free.fr>

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

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


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

  parent reply	other threads:[~2016-11-15 10:19 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 10:18 [PATCH 00/35] libxl LOG*D functions Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 01/35] libxl: add LIBXL_LOGD_* and LOG*D function families Cédric Bosdonnat
2016-11-17 14:41   ` Wei Liu
2016-11-17 16:01     ` Cedric Bosdonnat
2016-11-17 16:12       ` Wei Liu
2016-11-17 16:29       ` Ian Jackson
2016-11-17 16:34         ` Wei Liu
2016-11-17 16:36           ` Ian Jackson
2016-11-17 16:38             ` Wei Liu
2016-11-15 10:18 ` [PATCH 02/35] libxl.c: switch to LOG*D use Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 03/35] libxl.c: switch to LOG*D use (refactored messages) Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 04/35] libxl.c: switch to LOG*D use Cédric Bosdonnat
2016-11-17 14:50   ` Wei Liu
2016-11-17 16:03     ` Cedric Bosdonnat
2016-11-17 16:15       ` Wei Liu
2016-11-17 16:30       ` Ian Jackson
2016-11-15 10:18 ` [PATCH 05/35] libxl/libxl_bootloader.c: used LOG*D functions Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 06/35] libxl/libxl_checkpoint_device.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 07/35] libxl/libxl_colo.h: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 08/35] libxl/libxl_colo_nic.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 09/35] libxl/libxl_colo_proxy.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 10/35] libxl/libxl_colo_qdisk.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 11/35] libxl/libxl_colo_restore.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 12/35] libxl/libxl_colo_save.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 13/35] libxl/libxl_create.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 14/35] libxl/libxl_device.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 15/35] libxl/libxl_dm.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 16/35] libxl/libxl_dom_save.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 17/35] libxl/libxl_dom_suspend.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 18/35] libxl/libxl_freebsd.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 19/35] libxl/libxl_internal.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 20/35] libxl/libxl_linux.c: " Cédric Bosdonnat
2016-11-15 10:18 ` [PATCH 21/35] libxl/libxl_netbsd.c: " Cédric Bosdonnat
2016-11-15 10:19 ` Cédric Bosdonnat [this message]
2016-11-15 10:19 ` [PATCH 23/35] libxl/libxl_nic.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 24/35] libxl/libxl_no_colo.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 25/35] libxl/libxl_pci.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 26/35] libxl/libxl_psr.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 27/35] libxl/libxl_pvusb.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 28/35] libxl/libxl_qmp.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 29/35] libxl/libxl_remus.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 30/35] libxl/libxl_save_callout.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 31/35] libxl/libxl_stream_write.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 32/35] libxl/libxl_vnuma.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 33/35] libxl/libxl_vtpm.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 34/35] libxl/libxl_x86.c: " Cédric Bosdonnat
2016-11-15 10:19 ` [PATCH 35/35] libxl/libxl_xshelp.c: " Cédric Bosdonnat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161115101913.10396-23-cbosdonnat@suse.com \
    --to=cbosdonnat@suse.com \
    --cc=cedric.bosdonnat@free.fr \
    --cc=ian.jackson@eu.citrix.com \
    --cc=imhy.yang@gmail.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).