ethtool does not support virtio_net devices.
authorRalph Wuerthner <ralph.wuerthner@de.ibm.com>
Thu, 15 Apr 2010 06:38:19 +0000 (16:38 +1000)
committerMartin Schwenke <martin@meltin.net>
Thu, 15 Apr 2010 06:38:19 +0000 (16:38 +1000)
Skip link test for this type of devices

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/10.interface

index d7abc186fb0ff40da41cd5dbfe32f787e3749cca..35a8b2f4394f3d4f3d1e294202beb2b21b1442c6 100755 (executable)
@@ -80,7 +80,8 @@ monitor_interfaces()
                # we dont know how to test ib links
                ;;
            *)
-               [ -z "$IFACE" ] || {
+               [ -z "$IFACE" ] ||
+               [ "$(basename $(readlink /sys/class/net/$IFACE/device/driver))" = virtio_net ] || {
                    ethtool $IFACE | grep -q 'Link detected: yes' || {
                        # On some systems, this is not successful when a
                        # cable is plugged but the interface has not been