diff options
author | Giuseppe Lettieri <g.lettieri@iet.unipi.it> | 2012-05-09 12:17:15 +0200 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-05-16 10:00:39 -0700 |
commit | 2f66fbf5c001ed3ca40e7d2e2bdb62b1363c2492 (patch) | |
tree | 5a4309cd69eb8fa6b2ee73568102ef69c02671a7 /lib | |
parent | 58a1590cb3da958cc0d1407dcc83d48c1e893c14 (diff) |
dpif-netdev: allow for proper destruction of netdev datapaths
Until now, bridges with datapath_type=netdev did not destroy the datapath
when deleted. In particular, the tap device implementing the internal
interface was not close()d, and therefore the tap persists until
ovs-vswitchd exit()s.
This behaviour was caused by the missing callback for 'enumerate' in the
dpif-netdev class. Without this callback 'bridge_reconfigure' failed to
realize that there are datapaths with no bridge, and thus cannot destroy
them. Providing an 'enumerate' callback fixes this.
Signed-off-by: Giuseppe Lettieri <g.lettieri@iet.unipi.it>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpif-netdev.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 6a411fe9..708b8066 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -167,6 +167,17 @@ get_dp_netdev(const struct dpif *dpif) return dpif_netdev_cast(dpif)->dp; } +static int +dpif_netdev_enumerate(struct sset *all_dps) +{ + struct shash_node *node; + + SHASH_FOR_EACH(node, &dp_netdevs) { + sset_add(all_dps, node->name); + } + return 0; +} + static struct dpif * create_dpif_netdev(struct dp_netdev *dp) { @@ -1273,7 +1284,7 @@ dp_netdev_execute_actions(struct dp_netdev *dp, const struct dpif_class dpif_netdev_class = { "netdev", - NULL, /* enumerate */ + dpif_netdev_enumerate, dpif_netdev_open, dpif_netdev_close, dpif_netdev_destroy, |