linma / rpms / iproute

Forked from rpms/iproute 4 years ago
Clone

Blame SOURCES/0173-devlink-write-usage-help-messages-to-stderr.patch

4aca6e
From 5ae2d3cb2d16ad5d7e193978aefba1610de26ac5 Mon Sep 17 00:00:00 2001
4aca6e
From: Sabrina Dubroca <sdubroca@redhat.com>
4aca6e
Date: Fri, 9 Jun 2017 10:31:01 +0200
4aca6e
Subject: [PATCH] devlink: write usage help messages to stderr
4aca6e
4aca6e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1459772
4aca6e
Upstream Status: iproute2.git commit 7a9466dbcba1
4aca6e
4aca6e
commit 7a9466dbcba1918a1c93de8f93b9ff3d62418fcf
4aca6e
Author: Jiri Pirko <jiri@mellanox.com>
4aca6e
Date:   Fri Jul 22 18:34:29 2016 +0200
4aca6e
4aca6e
    devlink: write usage help messages to stderr
4aca6e
4aca6e
    In order to not confuse reader, write help messages into stderr.
4aca6e
4aca6e
    Signed-off-by: Jiri Pirko <jiri@mellanox.com>
4aca6e
4aca6e
Signed-off-by: Sabrina Dubroca <sdubroca@redhat.com>
4aca6e
---
4aca6e
 devlink/devlink.c | 46 +++++++++++++++++++++++-----------------------
4aca6e
 1 file changed, 23 insertions(+), 23 deletions(-)
4aca6e
4aca6e
diff --git a/devlink/devlink.c b/devlink/devlink.c
4aca6e
index 07c28eb95270..bd801880c75f 100644
4aca6e
--- a/devlink/devlink.c
4aca6e
+++ b/devlink/devlink.c
4aca6e
@@ -952,7 +952,7 @@ static bool dl_dump_filter(struct dl *dl, struct nlattr **tb)
4aca6e
 
4aca6e
 static void cmd_dev_help(void)
4aca6e
 {
4aca6e
-	pr_out("Usage: devlink dev show [ DEV ]\n");
4aca6e
+	pr_err("Usage: devlink dev show [ DEV ]\n");
4aca6e
 }
4aca6e
 
4aca6e
 static void __pr_out_handle(const char *bus_name, const char *dev_name)
4aca6e
@@ -1147,10 +1147,10 @@ static int cmd_dev(struct dl *dl)
4aca6e
 
4aca6e
 static void cmd_port_help(void)
4aca6e
 {
4aca6e
-	pr_out("Usage: devlink port show [ DEV/PORT_INDEX ]\n");
4aca6e
-	pr_out("       devlink port set DEV/PORT_INDEX [ type { eth | ib | auto} ]\n");
4aca6e
-	pr_out("       devlink port split DEV/PORT_INDEX count COUNT\n");
4aca6e
-	pr_out("       devlink port unsplit DEV/PORT_INDEX\n");
4aca6e
+	pr_err("Usage: devlink port show [ DEV/PORT_INDEX ]\n");
4aca6e
+	pr_err("       devlink port set DEV/PORT_INDEX [ type { eth | ib | auto} ]\n");
4aca6e
+	pr_err("       devlink port split DEV/PORT_INDEX count COUNT\n");
4aca6e
+	pr_err("       devlink port unsplit DEV/PORT_INDEX\n");
4aca6e
 }
4aca6e
 
4aca6e
 static const char *port_type_name(uint32_t type)
4aca6e
@@ -1297,22 +1297,22 @@ static int cmd_port(struct dl *dl)
4aca6e
 
4aca6e
 static void cmd_sb_help(void)
4aca6e
 {
4aca6e
-	pr_out("Usage: devlink sb show [ DEV [ sb SB_INDEX ] ]\n");
4aca6e
-	pr_out("       devlink sb pool show [ DEV [ sb SB_INDEX ] pool POOL_INDEX ]\n");
4aca6e
-	pr_out("       devlink sb pool set DEV [ sb SB_INDEX ] pool POOL_INDEX\n");
4aca6e
-	pr_out("                           size POOL_SIZE thtype { static | dynamic }\n");
4aca6e
-	pr_out("       devlink sb port pool show [ DEV/PORT_INDEX [ sb SB_INDEX ]\n");
4aca6e
-	pr_out("                                   pool POOL_INDEX ]\n");
4aca6e
-	pr_out("       devlink sb port pool set DEV/PORT_INDEX [ sb SB_INDEX ]\n");
4aca6e
-	pr_out("                                pool POOL_INDEX th THRESHOLD\n");
4aca6e
-	pr_out("       devlink sb tc bind show [ DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
4aca6e
-	pr_out("                                 type { ingress | egress } ]\n");
4aca6e
-	pr_out("       devlink sb tc bind set DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
4aca6e
-	pr_out("                              type { ingress | egress } pool POOL_INDEX\n");
4aca6e
-	pr_out("                              th THRESHOLD\n");
4aca6e
-	pr_out("       devlink sb occupancy show { DEV | DEV/PORT_INDEX } [ sb SB_INDEX ]\n");
4aca6e
-	pr_out("       devlink sb occupancy snapshot DEV [ sb SB_INDEX ]\n");
4aca6e
-	pr_out("       devlink sb occupancy clearmax DEV [ sb SB_INDEX ]\n");
4aca6e
+	pr_err("Usage: devlink sb show [ DEV [ sb SB_INDEX ] ]\n");
4aca6e
+	pr_err("       devlink sb pool show [ DEV [ sb SB_INDEX ] pool POOL_INDEX ]\n");
4aca6e
+	pr_err("       devlink sb pool set DEV [ sb SB_INDEX ] pool POOL_INDEX\n");
4aca6e
+	pr_err("                           size POOL_SIZE thtype { static | dynamic }\n");
4aca6e
+	pr_err("       devlink sb port pool show [ DEV/PORT_INDEX [ sb SB_INDEX ]\n");
4aca6e
+	pr_err("                                   pool POOL_INDEX ]\n");
4aca6e
+	pr_err("       devlink sb port pool set DEV/PORT_INDEX [ sb SB_INDEX ]\n");
4aca6e
+	pr_err("                                pool POOL_INDEX th THRESHOLD\n");
4aca6e
+	pr_err("       devlink sb tc bind show [ DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
4aca6e
+	pr_err("                                 type { ingress | egress } ]\n");
4aca6e
+	pr_err("       devlink sb tc bind set DEV/PORT_INDEX [ sb SB_INDEX ] tc TC_INDEX\n");
4aca6e
+	pr_err("                              type { ingress | egress } pool POOL_INDEX\n");
4aca6e
+	pr_err("                              th THRESHOLD\n");
4aca6e
+	pr_err("       devlink sb occupancy show { DEV | DEV/PORT_INDEX } [ sb SB_INDEX ]\n");
4aca6e
+	pr_err("       devlink sb occupancy snapshot DEV [ sb SB_INDEX ]\n");
4aca6e
+	pr_err("       devlink sb occupancy clearmax DEV [ sb SB_INDEX ]\n");
4aca6e
 }
4aca6e
 
4aca6e
 static void pr_out_sb(struct nlattr **tb)
4aca6e
@@ -2114,7 +2114,7 @@ static int cmd_mon_show(struct dl *dl)
4aca6e
 
4aca6e
 static void cmd_mon_help(void)
4aca6e
 {
4aca6e
-	pr_out("Usage: devlink monitor [ all | OBJECT-LIST ]\n"
4aca6e
+	pr_err("Usage: devlink monitor [ all | OBJECT-LIST ]\n"
4aca6e
 	       "where  OBJECT-LIST := { dev | port }\n");
4aca6e
 }
4aca6e
 
4aca6e
@@ -2133,7 +2133,7 @@ static int cmd_mon(struct dl *dl)
4aca6e
 
4aca6e
 static void help(void)
4aca6e
 {
4aca6e
-	pr_out("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n"
4aca6e
+	pr_err("Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }\n"
4aca6e
 	       "where  OBJECT := { dev | port | sb | monitor }\n"
4aca6e
 	       "       OPTIONS := { -V[ersion] | -n[no-nice-names] }\n");
4aca6e
 }
4aca6e
-- 
4aca6e
2.13.1
4aca6e