use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class ClusterPopupPresenterWidget method computeCustomMigrationBandwidthLimitEnabledState.
/**
* @return true ~ enable, false ~ disable, null ~ can't be computed
*/
private Optional<Boolean> computeCustomMigrationBandwidthLimitEnabledState(ClusterModel clusterModel) {
final Version clusterVersion = clusterModel.getVersion().getSelectedItem();
final MigrationBandwidthLimitType limitType = clusterModel.getMigrationBandwidthLimitType().getSelectedItem();
if (clusterVersion == null || limitType == null) {
return Optional.empty();
}
final Optional<Boolean> enabled = Optional.of(AsyncDataProvider.getInstance().isMigrationPoliciesSupported(clusterVersion) && limitType == MigrationBandwidthLimitType.CUSTOM);
return enabled;
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class UpdateStoragePoolCommand method updateStoragePoolFormatType.
private void updateStoragePoolFormatType() {
final StoragePool storagePool = getStoragePool();
final Guid spId = storagePool.getId();
final Version spVersion = storagePool.getCompatibilityVersion();
final Version oldSpVersion = getOldStoragePool().getCompatibilityVersion();
if (oldSpVersion.equals(spVersion)) {
return;
}
StorageFormatType targetFormat = updatePoolAndDomainsFormat(spVersion);
if (getOldStoragePool().getStatus() == StoragePoolStatus.Up) {
try {
// No need to worry about "reupgrading" as VDSM will silently ignore
// the request.
runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat));
} catch (EngineException e) {
log.warn("Upgrade process of Storage Pool '{}' has encountered a problem due to following reason: {}", spId, e.getMessage());
auditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS);
// and return.
if (e.getVdsError() != null && e.getErrorCode() == EngineError.PoolUpgradeInProgress) {
updatePoolAndDomainsFormat(oldSpVersion);
return;
}
}
}
runSynchronizeOperation(new RefreshPoolSingleAsyncOperationFactory(), new ArrayList<Guid>());
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class ExistingVmModelBehavior method isRestoreMemoryVolumeSupported.
private boolean isRestoreMemoryVolumeSupported() {
// before edit
Version oldVmEffectiveVersion = getVm().getCompatibilityVersion();
Version newVmCustomCompatibilityVersion = getModel().getCustomCompatibilityVersion() == null ? null : getModel().getCustomCompatibilityVersion().getSelectedItem();
Version newClusterVersion = getModel().getSelectedCluster() == null ? null : getModel().getSelectedCluster().getCompatibilityVersion();
Version newVmEffectiveVersion = CommonCompatibilityVersionUtils.getEffective(newVmCustomCompatibilityVersion, newClusterVersion, Version.getLast());
return oldVmEffectiveVersion.equals(newVmEffectiveVersion);
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class NetworkFilterDaoTest method testGetAllSupportedNetworkFiltersByVersionMediumVersion.
@Test
public void testGetAllSupportedNetworkFiltersByVersionMediumVersion() {
final Version version = new Version("3.5");
assertFirstVersionOnly(version);
}
use of org.ovirt.engine.core.compat.Version in project ovirt-engine by oVirt.
the class NetworkFilterDaoTest method testGetAllSupportedNetworkFiltersByInvalidVersion.
@Test
public void testGetAllSupportedNetworkFiltersByInvalidVersion() {
final Version version = new Version(INVALID_VERSION);
final List<NetworkFilter> allNetworkFilter = dao.getAllSupportedNetworkFiltersByVersion(version);
assertTrue(allNetworkFilter.isEmpty());
}
Aggregations