use of org.ovirt.engine.core.bll.network.macpool.MacPool in project ovirt-engine by oVirt.
the class ObjectCompensation method handleReleaseMacsCompensation.
private void handleReleaseMacsCompensation(ReleaseMacsTransientCompensation releaseMacs) {
MacPool macPool = macPoolPerCluster.getMacPoolById(releaseMacs.getMacPoolId());
macPool.freeMacs(releaseMacs.getMacs());
}
use of org.ovirt.engine.core.bll.network.macpool.MacPool in project ovirt-engine by oVirt.
the class UpdateVmInterfaceCommand method macPoolCleanupAfterExecution.
void macPoolCleanupAfterExecution(boolean macAddedToPool) {
if (!macShouldBeChanged) {
return;
}
MacPool macPool = getMacPool();
if (getSucceeded()) {
// command succeeded, actions are not going to be reverted.
String macToRelease = oldIface.getMacAddress();
boolean canReleaseMac = new MacIsNotReservedInSnapshotAndCanBeReleased().macCanBeReleased(macToRelease, getVm(), countMacUsageDifference);
if (canReleaseMac) {
macPool.freeMac(macToRelease);
}
} else {
// since this command ins't transactive
if (macAddedToPool) {
// new mac was added to MAC pool.
macPool.freeMac(getMacAddress());
}
}
}
Aggregations