use of org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.NewInstanceTypeModelBehavior in project ovirt-engine by oVirt.
the class BalloonEnabled method balloonEnabled.
public static boolean balloonEnabled(UnitVmModel model) {
Cluster cluster = model.getSelectedCluster();
Integer osType = model.getOSType().getSelectedItem();
Boolean deviceEnabled = Boolean.TRUE.equals(model.getMemoryBalloonDeviceEnabled().getEntity());
if (cluster == null || osType == null) {
if (model.getBehavior() instanceof ExistingBlankTemplateModelBehavior || model.getBehavior() instanceof ExistingInstanceTypeModelBehavior || model.getBehavior() instanceof NewInstanceTypeModelBehavior) {
return deviceEnabled;
}
return false;
}
return deviceEnabled && AsyncDataProvider.getInstance().isBalloonEnabled(osType, model.getCompatibilityVersion());
}
Aggregations