use of org.ovirt.engine.core.common.businessentities.ServerCpu in project ovirt-engine by oVirt.
the class ClusterModel method version_SelectedItemChanged.
private void version_SelectedItemChanged() {
Version version = getEffectiveVersion();
AsyncDataProvider.getInstance().getCPUList(new AsyncQuery<>(cpus -> {
if (getIsEdit()) {
AsyncDataProvider.getInstance().isClusterEmpty(new AsyncQuery<>(isEmpty -> {
if (isEmpty) {
populateCPUList(cpus, true);
} else {
ArrayList<ServerCpu> filteredCpus = new ArrayList<>();
for (ServerCpu cpu : cpus) {
if (cpu.getArchitecture() == getEntity().getArchitecture()) {
filteredCpus.add(cpu);
}
}
populateCPUList(filteredCpus, false);
}
}), getEntity().getId());
} else {
cpus.add(0, null);
populateCPUList(cpus, true);
}
}), version);
getVersionSupportsCpuThreads().setEntity(true);
getEnableBallooning().setChangeProhibitionReason(ConstantsManager.getInstance().getConstants().ballooningNotAvailable());
getEnableBallooning().setIsChangeable(true);
setRngSourcesCheckboxes(version);
updateSwitchTypeUponVersionChange(version);
updateFirewallTypeUponVersionChange(version);
updateFencingPolicyContent(version);
updateMigrateOnError();
refreshMigrationPolicies();
refreshAdditionalClusterFeaturesList();
if (getEnableGlusterService().getEntity()) {
initTunedProfiles();
}
}
use of org.ovirt.engine.core.common.businessentities.ServerCpu in project ovirt-engine by oVirt.
the class ClusterModel method updateMigrateOnError.
private void updateMigrateOnError() {
ServerCpu cpu = getCPU().getSelectedItem();
Version version = getVersion().getSelectedItem();
if (version == null) {
return;
}
if (cpu == null || cpu.getArchitecture() == null) {
return;
}
getMigrateOnErrorOption_NO().setIsAvailable(true);
if (AsyncDataProvider.getInstance().isMigrationSupported(cpu.getArchitecture(), version)) {
getMigrateOnErrorOption_YES().setIsAvailable(true);
getMigrateOnErrorOption_HA_ONLY().setIsAvailable(true);
} else {
getMigrateOnErrorOption_YES().setIsAvailable(false);
getMigrateOnErrorOption_HA_ONLY().setIsAvailable(false);
setMigrateOnErrorOption(MigrateOnErrorOptions.NO);
}
}
use of org.ovirt.engine.core.common.businessentities.ServerCpu in project ovirt-engine by oVirt.
the class VmModelBehaviorBase method updateCustomCpu.
/*
* Updates the cpu model combobox after a cluster change occurs
*/
protected void updateCustomCpu() {
Cluster cluster = getModel().getSelectedCluster();
if (cluster == null || cluster.getCpuName() == null) {
return;
}
AsyncDataProvider.getInstance().getSupportedCpuList(new AsyncQuery<>(returnValue -> {
if (returnValue != null) {
List<String> cpuList = new ArrayList<>();
// $NON-NLS-1$
cpuList.add("");
for (ServerCpu cpu : returnValue) {
cpuList.add(cpu.getVdsVerbData());
}
String oldVal = getModel().getCustomCpu().getSelectedItem();
getModel().getCustomCpu().setItems(cpuList);
getModel().getCustomCpu().setSelectedItem(oldVal);
}
}), cluster.getCpuName());
}
use of org.ovirt.engine.core.common.businessentities.ServerCpu in project ovirt-engine by oVirt.
the class HostModel method getCurrentCpuVendor.
/**
* @return it may return `null`
*/
private CpuVendor getCurrentCpuVendor() {
if (getCluster().getSelectedItem() == null) {
return null;
}
final Cluster selectedCluster = getCluster().getSelectedItem();
final ServerCpu clustersCpu = AsyncDataProvider.getInstance().getCpuByName(selectedCluster.getCpuName(), selectedCluster.getCompatibilityVersion());
if (clustersCpu == null) {
// in case CPU of cluster was not yet set
return null;
}
return clustersCpu.getVendor();
}
use of org.ovirt.engine.core.common.businessentities.ServerCpu in project ovirt-engine by oVirt.
the class HostConfigureLocalStoragePopupView method initialize.
private void initialize() {
dataCenterVersionEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Version>() {
@Override
public String renderNullSafe(Version object) {
return object.getValue();
}
});
clusterCpuTypeEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<ServerCpu>() {
@Override
public String renderNullSafe(ServerCpu object) {
return object.getCpuName();
}
});
// Optimization options.
// $NON-NLS-1$
optimizationNoneEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
optimizationForServerEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
optimizationForDesktopEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
optimizationCustomEditor = new EntityModelRadioButtonEditor("1");
optimizationCustomEditor.setVisible(false);
countThreadsAsCoresEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
memoryOptimizationInfo = new InfoIcon(templates.italicText(constants.clusterPopupMemoryOptimizationInfo()));
memoryOptimizationInfo.setTooltipMaxWidth(TooltipWidth.W520);
cpuThreadsInfo = new InfoIcon(templates.italicText(constants.clusterPopupCpuThreadsInfo()));
cpuThreadsInfo.setTooltipMaxWidth(TooltipWidth.W620);
}
Aggregations