[ovs-dev] [bond 2/2] bond: Fix ugly warnings at slave registration.

Ethan Jackson ethan at nicira.com
Mon Apr 18 23:20:35 UTC 2011


Before this patch, when a slave was registered for this first time
the following warning would display.

interface (null): enabled

This is because the slave was enabled before having its name
configured.  This patch fixes the problem by not warning in
bond_enable_slave() when the given slave hasn't had its name
initialized.
---
 lib/bond.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/bond.c b/lib/bond.c
index d826c33..76abdd7 100644
--- a/lib/bond.c
+++ b/lib/bond.c
@@ -1348,12 +1348,16 @@ bond_enable_slave(struct bond_slave *slave, bool enable, struct tag_set *tags)
     if (enable != slave->enabled) {
         slave->enabled = enable;
         if (!slave->enabled) {
-            VLOG_WARN("interface %s: disabled", slave->name);
+            if (slave->name) {
+                VLOG_WARN("interface %s: disabled", slave->name);
+            }
             if (tags) {
                 tag_set_add(tags, slave->tag);
             }
         } else {
-            VLOG_WARN("interface %s: enabled", slave->name);
+            if (slave->name) {
+                VLOG_WARN("interface %s: enabled", slave->name);
+            }
             slave->tag = tag_create_random();
         }
         bond_stb_enable_slave(slave);
-- 
1.7.4.2




More information about the dev mailing list