Currently we print a warning if a user tries to configure a
netdev that is not in the list that userspace knows about.
However, it is possible that a given netdev maybe be enabled but
when it tries to create a device it finds out that it can't
(not supported by kernel module, hardware not present, etc.).
This makes the behavior the same in both cases.
Signed-off-by: Jesse Gross <jesse@nicira.com>
netdev_class = shash_find_data(&netdev_classes, options->type);
if (!netdev_class) {
- VLOG_WARN("could not create netdev %s of unknown type %s",
- options->name, options->type);
return EAFNOSUPPORT;
}
if (!netdev_dev) {
error = create_device(options, &netdev_dev);
if (error) {
+ if (error == EAFNOSUPPORT) {
+ VLOG_WARN("could not create netdev %s of unknown type %s",
+ options->name, options->type);
+ }
return error;
}
update_device_args(netdev_dev, options->args);