mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev: Log a warning when netdev_set_config() fails.
This allows its callers to avoid duplicating the code. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
12
lib/netdev.c
12
lib/netdev.c
@@ -386,13 +386,19 @@ netdev_set_config(struct netdev *netdev, const struct smap *args)
|
||||
{
|
||||
if (netdev->netdev_class->set_config) {
|
||||
const struct smap no_args = SMAP_INITIALIZER(&no_args);
|
||||
return netdev->netdev_class->set_config(netdev,
|
||||
args ? args : &no_args);
|
||||
int error;
|
||||
|
||||
error = netdev->netdev_class->set_config(netdev,
|
||||
args ? args : &no_args);
|
||||
if (error) {
|
||||
VLOG_WARN("%s: could not set configuration (%s)",
|
||||
netdev_get_name(netdev), ovs_strerror(error));
|
||||
}
|
||||
return error;
|
||||
} else if (args && !smap_is_empty(args)) {
|
||||
VLOG_WARN("%s: arguments provided to device that is not configurable",
|
||||
netdev_get_name(netdev));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user