From: Ben Pfaff Date: Thu, 16 Jun 2011 21:02:10 +0000 (-0700) Subject: Reduce log level for ENODEV errors getting Ethernet address. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78857dfb3dd2812d8b3a036a2b5adb46be8d7ae8;p=openvswitch Reduce log level for ENODEV errors getting Ethernet address. 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. --- diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 16672826..385c0b81 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;