use of org.ovirt.engine.api.model.HostNicVirtualFunctionsConfiguration in project ovirt-engine by oVirt.
the class BackendHostNicsResource method doPopulate.
@Override
protected HostNic doPopulate(HostNic model, VdsNetworkInterface entity) {
final HostNic hostNic = super.doPopulate(model, entity);
final Guid nicId = entity.getId();
final HostNicVfsConfig hostNicVfsConfig = findVfsConfig(nicId);
if (hostNicVfsConfig == null) {
final Map<Guid, Guid> vfMap = retriveVfMap();
final Guid physicalFunctionNicId = vfMap.get(nicId);
if (physicalFunctionNicId != null) {
final HostNic physicalFunction = new HostNic();
physicalFunction.setId(physicalFunctionNicId.toString());
hostNic.setPhysicalFunction(physicalFunction);
}
} else {
final Mapper<HostNicVfsConfig, HostNicVirtualFunctionsConfiguration> mapper = getMapper(HostNicVfsConfig.class, HostNicVirtualFunctionsConfiguration.class);
final HostNicVirtualFunctionsConfiguration vfsConfigModel = mapper.map(hostNicVfsConfig, new HostNicVirtualFunctionsConfiguration());
hostNic.setVirtualFunctionsConfiguration(vfsConfigModel);
}
return hostNic;
}
Aggregations