2
0
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:
Ben Pfaff
2013-12-11 10:50:10 -08:00
parent 202a4b176e
commit 4f6b993481
3 changed files with 10 additions and 13 deletions

View File

@@ -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;
}