All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Bosdonnat" <cbosdonnat@suse.com>
To: xen-devel@lists.xen.org
Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca>,
	Yang Hongyang <imhy.yang@gmail.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Cedric Bosdonnat <cbosdonnat@suse.com>
Subject: [PATCH v2 22/35] libxl/libxl_netbuffer.c: used LOG*D functions
Date: Fri,  2 Dec 2016 16:08:28 +0100	[thread overview]
Message-ID: <20161202150841.31227-23-cbosdonnat@suse.com> (raw)
In-Reply-To: <20161202150841.31227-1-cbosdonnat@suse.com>

From: Cedric Bosdonnat <cbosdonnat@suse.com>

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

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.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-12-02 15:08 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 15:08 [PATCH v2 00/35] libxl LOG*D functions Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 01/35] libxl: add LIBXL_LOGD_* and LOG*D function families Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 02/35] libxl.c: switch to LOG*D use Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 03/35] libxl.c: switch to LOG*D use (refactored messages) Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 04/35] libxl.c: switch to LOG*D use Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 05/35] libxl/libxl_bootloader.c: used LOG*D functions Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 06/35] libxl/libxl_checkpoint_device.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 07/35] libxl/libxl_colo.h: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 08/35] libxl/libxl_colo_nic.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 09/35] libxl/libxl_colo_proxy.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 10/35] libxl/libxl_colo_qdisk.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 11/35] libxl/libxl_colo_restore.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 12/35] libxl/libxl_colo_save.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 13/35] libxl/libxl_create.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 14/35] libxl/libxl_device.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 15/35] libxl/libxl_dm.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 16/35] libxl/libxl_dom_save.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 17/35] libxl/libxl_dom_suspend.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 18/35] libxl/libxl_freebsd.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 19/35] libxl/libxl_internal.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 20/35] libxl/libxl_linux.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 21/35] libxl/libxl_netbsd.c: " Cédric Bosdonnat
2016-12-02 15:08 ` Cédric Bosdonnat [this message]
2016-12-02 15:08 ` [PATCH v2 23/35] libxl/libxl_nic.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 24/35] libxl/libxl_no_colo.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 25/35] libxl/libxl_pci.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 26/35] libxl/libxl_psr.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 27/35] libxl/libxl_pvusb.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 28/35] libxl/libxl_qmp.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 29/35] libxl/libxl_remus.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 30/35] libxl/libxl_save_callout.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 31/35] libxl/libxl_stream_write.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 32/35] libxl/libxl_vnuma.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 33/35] libxl/libxl_vtpm.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 34/35] libxl/libxl_x86.c: " Cédric Bosdonnat
2016-12-02 15:08 ` [PATCH v2 35/35] libxl/libxl_xshelp.c: " Cédric Bosdonnat
2016-12-03 16:03 ` [PATCH v2 00/35] libxl " Wei Liu
2016-12-05 12:05   ` Wei Liu
  -- strict thread matches above, loose matches on Subject: below --
2016-11-17 17:35 Cédric Bosdonnat
2016-11-17 17:36 ` [PATCH v2 22/35] libxl/libxl_netbuffer.c: used " 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=20161202150841.31227-23-cbosdonnat@suse.com \
    --to=cbosdonnat@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.