Reduce log level for ENODEV errors getting Ethernet address.
authorBen Pfaff <blp@nicira.com>
Thu, 16 Jun 2011 21:02:10 +0000 (14:02 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Jun 2011 20:38:31 +0000 (13:38 -0700)
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

index 166728262b81f4b6e80ac1e54ae94c4b3de7d9d2..385c0b81688e62a2d11a0ff6e363ceb5fb23d672 100644 (file)
@@ -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;