use of org.ovirt.engine.core.common.businessentities.network.VmNic in project ovirt-engine by oVirt.
the class SnapshotsManager method canSynchronizeNics.
public boolean canSynchronizeNics(VM snapshotedVm, VmInterfaceManager vmInterfaceManager, List<VmNetworkInterface> interfaces, boolean macsInSnapshotAreExpectedToBeAlreadyAllocated) {
MacPool macPool = vmInterfaceManager.getMacPool();
List<VmNic> dbNics = vmNicDao.getAllForVm(snapshotedVm.getId());
return new SyncMacsOfDbNicsWithSnapshot(macPool, auditLogDirector, macsInSnapshotAreExpectedToBeAlreadyAllocated).canSyncNics(dbNics, interfaces);
}
use of org.ovirt.engine.core.common.businessentities.network.VmNic in project ovirt-engine by oVirt.
the class VmInfoBuilderImpl method buildVmNetworkInterfaces.
@Override
public void buildVmNetworkInterfaces(Map<Guid, String> passthroughVnicToVfMap) {
Map<VmDeviceId, VmDevice> devicesByDeviceId = Entities.businessEntitiesById(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceGeneralType.INTERFACE, VmDeviceType.BRIDGE));
devicesByDeviceId.putAll(Entities.businessEntitiesById(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceGeneralType.INTERFACE, VmDeviceType.HOST_DEVICE)));
for (VmNic vmInterface : vm.getInterfaces()) {
// get vm device for this nic from DB
VmDevice vmDevice = devicesByDeviceId.get(new VmDeviceId(vmInterface.getId(), vmInterface.getVmId()));
if (vmDevice != null && vmDevice.isManaged() && vmDevice.isPlugged()) {
Map<String, Object> struct = new HashMap<>();
VmInterfaceType ifaceType = VmInterfaceType.rtl8139;
if (vmInterface.getType() != null) {
ifaceType = VmInterfaceType.forValue(vmInterface.getType());
}
if (vmInterface.isPassthrough()) {
String vfDeviceName = passthroughVnicToVfMap.get(vmInterface.getId());
vmInfoBuildUtils.addNetworkVirtualFunctionProperties(struct, vmInterface, vmDevice, vfDeviceName, vm);
} else {
addNetworkInterfaceProperties(struct, vmInterface, vmDevice, vmInfoBuildUtils.evaluateInterfaceType(ifaceType, vm.getHasAgent()));
}
devices.add(struct);
bootableDevices.add(vmDevice);
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.VmNic in project ovirt-engine by oVirt.
the class ChangeVMClusterCommandTest method macAddressToVmNic.
private VmNic macAddressToVmNic(String macAddress) {
VmNic result = new VmNic();
result.setMacAddress(macAddress);
return result;
}
use of org.ovirt.engine.core.common.businessentities.network.VmNic in project ovirt-engine by oVirt.
the class MacPoolPerClusterTest method createVmNic.
protected VmNic createVmNic() {
final VmNic vmNic = new VmNic();
vmNic.setMacAddress("00:1a:4a:15:c0:fe");
return vmNic;
}
use of org.ovirt.engine.core.common.businessentities.network.VmNic in project ovirt-engine by oVirt.
the class VmInterfaceManagerTest method testAuditLogMacInUse.
@Test
public void testAuditLogMacInUse() {
final VmNic iface = createNewInterface();
vmInterfaceManager.auditLogMacInUse(iface);
verifyCommonAuditLogFilledProperly(AuditLogType.MAC_ADDRESS_IS_IN_USE, iface);
}
Aggregations