-static char *
-make_poll_name(const struct netdev *netdev)
-{
- return xasprintf("%s:%s", netdev_get_type(netdev), netdev_get_name(netdev));
-}
-
-static int
-netdev_vport_poll_add(struct netdev *netdev,
- void (*cb)(struct netdev_notifier *), void *aux,
- struct netdev_notifier **notifierp)
-{
- char *poll_name = make_poll_name(netdev);
- struct netdev_vport_notifier *notifier;
- struct list *list;
- struct shash_node *shash_node;
-
- shash_node = shash_find(&netdev_vport_notifiers, poll_name);
- if (!shash_node) {
- list = xmalloc(sizeof *list);
- list_init(list);
- shash_node = shash_add(&netdev_vport_notifiers, poll_name, list);
- } else {
- list = shash_node->data;
- }
-
- notifier = xmalloc(sizeof *notifier);
- netdev_notifier_init(¬ifier->notifier, netdev, cb, aux);
- list_push_back(list, ¬ifier->list_node);
- notifier->shash_node = shash_node;
-
- *notifierp = ¬ifier->notifier;
- free(poll_name);
-
- return 0;
-}
-
-static void
-netdev_vport_poll_remove(struct netdev_notifier *notifier_)
-{
- struct netdev_vport_notifier *notifier =
- CONTAINER_OF(notifier_, struct netdev_vport_notifier, notifier);
-
- struct list *list;
-
- list = list_remove(¬ifier->list_node);
- if (list_is_empty(list)) {
- shash_delete(&netdev_vport_notifiers, notifier->shash_node);
- free(list);
- }
-
- free(notifier);
-}
-