static void ofport_destroy__(struct ofport *) OVS_EXCLUDED(ofproto_mutex);
static void ofport_destroy(struct ofport *);
-static void update_port(struct ofproto *, const char *devname);
+static int update_port(struct ofproto *, const char *devname);
static int init_ports(struct ofproto *);
static void reinit_ports(struct ofproto *);
simap_put(&ofproto->ofp_requests, netdev_name,
ofp_to_u16(ofp_port));
- update_port(ofproto, netdev_name);
+ error = update_port(ofproto, netdev_name);
}
if (ofp_portp) {
*ofp_portp = OFPP_NONE;
/* Adds an ofport to 'p' initialized based on the given 'netdev' and 'opp'.
* The caller must ensure that 'p' does not have a conflicting ofport (that is,
* one with the same name or port number). */
-static void
+static int
ofport_install(struct ofproto *p,
struct netdev *netdev, const struct ofputil_phy_port *pp)
{
goto error;
}
connmgr_send_port_status(p->connmgr, NULL, pp, OFPPR_ADD);
- return;
+ return 0;
error:
VLOG_WARN_RL(&rl, "%s: could not add port %s (%s)",
} else {
netdev_close(netdev);
}
+ return error;
}
/* Removes 'ofport' from 'p' and destroys it. */
return error;
}
-static void
+static int
update_port(struct ofproto *ofproto, const char *name)
{
struct ofproto_port ofproto_port;
struct ofputil_phy_port pp;
struct netdev *netdev;
struct ofport *port;
+ int error = 0;
COVERAGE_INC(ofproto_update_port);
ofport_remove(port);
}
ofport_remove_with_name(ofproto, name);
- ofport_install(ofproto, netdev, &pp);
+ error = ofport_install(ofproto, netdev, &pp);
}
} else {
/* Any port named 'name' is gone now. */
ofport_remove_with_name(ofproto, name);
}
ofproto_port_destroy(&ofproto_port);
+
+ return error;
}
static int