Skip to content

Commit

Permalink
Revert "fsm: move workers from fsm->pending to fsm->workers"
Browse files Browse the repository at this point in the history
This reverts commit 35037d1.

Pending workers are just dummies in a queue holding the devices
until they're ready/renamed -- to avoid that code is using them
and e.g. to resolve by their temporary name.
Moving the dummies to the true workers array, causes creation of
duplicates with attached device, while the true workers, which
may already exists, holds the config, actions, ...
  • Loading branch information
mtomaschewski committed Jun 16, 2015
1 parent 0b9d0fc commit 59932d1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/fsm.c
Expand Up @@ -3318,15 +3318,11 @@ ni_fsm_recv_new_netif(ni_fsm_t *fsm, ni_dbus_object_t *object, ni_bool_t refresh
/*
* if tracked as pending worker, it's over now -- device is ready
*/
if ((found = ni_ifworker_array_find_by_objectpath(&fsm->pending, object->path))) {
if (ni_ifworker_array_index(&fsm->workers, found) < 0)
ni_ifworker_array_append(&fsm->workers, found);
if ((found = ni_ifworker_array_find_by_objectpath(&fsm->pending, object->path)))
ni_ifworker_array_remove(&fsm->pending, found);
}

/* lookup worker by object path (ifindex) first, then by name */
if (!found)
found = ni_ifworker_array_find_by_objectpath(&fsm->workers, object->path);
found = ni_ifworker_array_find_by_objectpath(&fsm->workers, object->path);
if (!found)
found = ni_fsm_ifworker_by_name(fsm, NI_IFWORKER_TYPE_NETDEV, dev->name);
if (!found) {
Expand Down

0 comments on commit 59932d1

Please sign in to comment.