bridge_driver: Don't check network active unlocked

Okay, this is mainly for educational purposes since is called
from single point only with all the possible locks held. So
there's no way for other thread to hop in and do something wrong.
Nevertheless, we should not give bad example.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2015-02-23 19:00:57 +01:00
parent bf1afdd491
commit 7b8c12d8ce

View File

@ -353,10 +353,11 @@ networkUpdateAllState(void)
for (i = 0; i < driver->networks.count; i++) {
virNetworkObjPtr obj = driver->networks.objs[i];
if (!obj->active)
continue;
virNetworkObjLock(obj);
if (!virNetworkObjIsActive(obj)) {
virNetworkObjUnlock(obj);
continue;
}
switch (obj->def->forward.type) {
case VIR_NETWORK_FORWARD_NONE: