use of org.ovirt.engine.core.bll.snapshots.CountMacUsageDifference in project ovirt-engine by oVirt.
the class MacsUsedAcrossWholeSystem method calculateAllMacsUsedInVmAndItsSnapshot.
private Stream<String> calculateAllMacsUsedInVmAndItsSnapshot(List<? extends VmNic> vmInterfaces, List<? extends VmNic> snapshotInterfaces) {
CountMacUsageDifference countMacUsageDifference = new CountMacUsageDifference(macAddressesOfInterfaces(snapshotInterfaces), macAddressesOfInterfaces(vmInterfaces));
Stream<String> macsDuplicatedByNumberOfTimesTheyAreUsed = countMacUsageDifference.maxUsage().entrySet().stream().flatMap(entry -> LongStream.range(0, entry.getValue()).boxed().map(e -> entry.getKey()));
return macsDuplicatedByNumberOfTimesTheyAreUsed;
}
use of org.ovirt.engine.core.bll.snapshots.CountMacUsageDifference in project ovirt-engine by oVirt.
the class UpdateVmInterfaceCommand method initMacPoolData.
void initMacPoolData() {
macShouldBeChanged = !StringUtils.equals(oldIface.getMacAddress(), getMacAddress());
countMacUsageDifference = new CountMacUsageDifference(snapshotsManager.macsInStatelessSnapshot(getVmId()), macsWhichShouldExistAfterCommandIsFinished());
}
Aggregations