[ovs-dev] [PATCH 1/2] Reduce log level for ENODEV errors getting Ethernet address.

Ben Pfaff blp at nicira.com
Thu Jun 16 21:05:39 UTC 2011


Bug #5844 reports several log messages of the form:

    netdev_linux|ERR|ioctl(SIOCGIFHWADDR) on vif426.1 device failed: No
    such device

during migrations.  These are normal and unavoidable, because the vifs
disappear from the kernel before they are removed them from the OVS
database.  Reduce the log level to avoid making people worry.

Bug #5844.
---
 lib/netdev-linux.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 1667282..385c0b8 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -4152,8 +4152,12 @@ get_etheraddr(const char *netdev_name, uint8_t ea[ETH_ADDR_LEN])
     ovs_strzcpy(ifr.ifr_name, netdev_name, sizeof ifr.ifr_name);
     COVERAGE_INC(netdev_get_hwaddr);
     if (ioctl(af_inet_sock, SIOCGIFHWADDR, &ifr) < 0) {
-        VLOG_ERR("ioctl(SIOCGIFHWADDR) on %s device failed: %s",
-                 netdev_name, strerror(errno));
+        /* ENODEV probably means that a vif disappeared asynchronously and
+         * hasn't been removed from the database yet, so reduce the log level
+         * to INFO for that case. */
+        VLOG(errno == ENODEV ? VLL_INFO : VLL_ERR,
+             "ioctl(SIOCGIFHWADDR) on %s device failed: %s",
+             netdev_name, strerror(errno));
         return errno;
     }
     hwaddr_family = ifr.ifr_hwaddr.sa_family;
-- 
1.7.4.4




More information about the dev mailing list