core: fix warning when releasing slaves on exit (rh #1169936)

NetworkManager[30304]: <info>  (virbr0): bridge port virbr0-nic was detached
NetworkManager[30304]: (devices/nm-device.c:962):nm_device_release_one_slave: runtime check failed: (reason == NM_DEVICE_STATE_REASON_NONE)
NetworkManager[30304]: <info>  (virbr0-nic): released from master virbr0

If the slave is removed, then the master is already cleaned up so NM
doesn't need to do anything.  5dd48f fixed that but forgot to update
the !configure case, causing the warning but no other problems.

Fixes: 5dd48f7527
This commit is contained in:
Dan Williams 2014-12-11 16:21:38 -06:00
parent da4a98bfbb
commit 7d5c0db53a

View file

@ -959,7 +959,7 @@ nm_device_release_one_slave (NMDevice *self, NMDevice *slave, gboolean configure
}
if (!configure) {
g_warn_if_fail (reason == NM_DEVICE_STATE_REASON_NONE);
g_warn_if_fail (reason == NM_DEVICE_STATE_REASON_NONE || reason == NM_DEVICE_STATE_REASON_REMOVED);
reason = NM_DEVICE_STATE_REASON_NONE;
} else if (reason == NM_DEVICE_STATE_REASON_NONE) {
g_warn_if_reached ();