This allows its callers to avoid duplicating the code.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
{
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;
}
error = netdev_set_config(netdev, &args);
if (error) {
- ovs_error(error, "%s: failed to configure network device", name);
goto next;
}
error = netdev_set_config(netdev, &args);
smap_destroy(&args);
if (error) {
- ovs_error(error, "%s: failed to configure network device", name);
goto next;
}
iface_set_netdev_config(const struct ovsrec_interface *iface_cfg,
struct netdev *netdev)
{
- int error;
-
- error = netdev_set_config(netdev, &iface_cfg->options);
- if (error) {
- VLOG_WARN("could not configure network device %s (%s)",
- iface_cfg->name, ovs_strerror(error));
- }
- return error;
+ return netdev_set_config(netdev, &iface_cfg->options);
}
/* This function determines whether 'ofproto_port', which is attached to