Jiří Moskovčák has uploaded a new change for review. Change subject: webadmin: added the ksm checkbox ......................................................................
webadmin: added the ksm checkbox Change-Id: I95414d676da17f00f8c23150b0cdef666a91ce74 Bug-Url: https://bugzilla.redhat.com/1026980 Signed-off-by: Jiri Moskovcak <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml M packaging/dbscripts/vds_groups_sp.sql 7 files changed, 44 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/60/23360/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java index 5110aab..1072091 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java @@ -366,6 +366,7 @@ clusterModel.getEnableOvirtService().setIsChangable(true); clusterModel.getEnableGlusterService().setEntity(cluster.supportsGlusterService()); clusterModel.getEnableGlusterService().setIsChangable(true); + clusterModel.getEnableKsm().setEntity(cluster.isEnableKsm()); clusterModel.getEnableBallooning().setEntity(cluster.isEnableBallooning()); clusterModel.getArchitecture().setSelectedItem(cluster.getArchitecture()); @@ -703,6 +704,8 @@ cluster.setmax_vds_memory_over_commit(model.getMemoryOverCommit()); cluster.setCountThreadsAsCores(Boolean.TRUE.equals(model.getVersionSupportsCpuThreads().getEntity()) && Boolean.TRUE.equals(model.getCountThreadsAsCores().getEntity())); + cluster.setEnableKsm(Boolean.TRUE.equals(model.getEnableKsm().getEntity()) + || version.compareTo(Version.v3_4) < 0); cluster.setEnableBallooning(Boolean.TRUE.equals(model.getEnableBallooning().getEntity()) && version.compareTo(Version.v3_3) >= 0); cluster.setTransparentHugepages(version.compareTo(new Version("3.0")) >= 0); //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java index 5026543..fb02bcd 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java @@ -494,6 +494,16 @@ privateMigrateOnErrorOption_HA_ONLY = value; } + private EntityModel<Boolean> enableKsm; + + public EntityModel<Boolean> getEnableKsm() { + return enableKsm; + } + + public void setEnableKsm(EntityModel<Boolean> enableKsm) { + this.enableKsm = enableKsm; + } + private EntityModel<Boolean> enableBallooning; public EntityModel<Boolean> getEnableBallooning() { @@ -902,6 +912,8 @@ tempVar7.setEntity(false); setMigrateOnErrorOption_HA_ONLY(tempVar7); getMigrateOnErrorOption_HA_ONLY().getEntityChangedEvent().addListener(this); + setEnableKsm(new EntityModel<Boolean>()); + getEnableKsm().setEntity(false); setEnableBallooning(new EntityModel<Boolean>()); getEnableBallooning().setEntity(false); // Optimization methods: @@ -1165,6 +1177,7 @@ getCountThreadsAsCores().setEntity(getEntity().getCountThreadsAsCores()); getEnableBallooning().setEntity(getEntity().isEnableBallooning()); + getEnableKsm().setEntity(getEntity().isEnableKsm()); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); @@ -1337,6 +1350,7 @@ getVersionSupportsCpuThreads().setEntity(version.compareTo(Version.v3_2) >= 0); getEnableBallooning().setChangeProhibitionReason(ConstantsManager.getInstance().getConstants().ballooningNotAvailable()); getEnableBallooning().setIsChangable(version.compareTo(Version.v3_3) >= 0); + getEnableKsm().setIsChangable(version.compareTo(Version.v3_4) >= 0); } private void populateCPUList(ClusterModel clusterModel, List<ServerCpu> cpus, boolean canChangeArchitecture) diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java index 83df9e2..7571f1d 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java @@ -2038,6 +2038,9 @@ @DefaultStringValue("Remove Cluster Policy") String removeClusterPolicyTitle(); + @DefaultStringValue("KSM control is only available for Cluster compatibility version 3.3 and higher") + String ksmNotAvailable(); + @DefaultStringValue("Ballooning is only available for Cluster compatibility version 3.3 and higher") String ballooningNotAvailable(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java index 3e0280d..6b22329 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java @@ -142,6 +142,12 @@ @DefaultStringValue("Enable HA Reservation") String clusterPolicyEnableHaReservationLabel(); + @DefaultStringValue("KSM control") + String ksmLabelTitle(); + + @DefaultStringValue("Enable KSM") + String enableKsmLabel(); + @DefaultStringValue("Enable Memory Balloon Optimization") String enableBallooningLabel(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java index 184295b..af3b309 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java @@ -263,6 +263,11 @@ protected KeyValueWidget<KeyValueModel> customPropertiesSheetEditor; @UiField(provided = true) + @Path(value = "enableKsm.entity") + @WithElementId + EntityModelCheckBoxEditor enableKsm; + + @UiField(provided = true) @Path(value = "enableBallooning.entity") @WithElementId EntityModelCheckBoxEditor enableBallooning; @@ -393,6 +398,7 @@ enableHaReservationEditor.setLabel(constants.clusterPolicyEnableHaReservationLabel()); clusterPolicyEditor.setLabel(constants.clusterPolicySelectPolicyLabel()); + enableKsm.setLabel(constants.enableKsmLabel()); enableBallooning.setLabel(constants.enableBallooningLabel()); schedulerOptimizationPanelTitle.setText(constants.schedulerOptimizationPanelLabel()); @@ -473,6 +479,9 @@ enableHaReservationEditor = new EntityModelCheckBoxEditor(Align.RIGHT); + enableKsm = new EntityModelCheckBoxEditor(Align.RIGHT); + enableKsm.getContentWidgetContainer().setWidth("350px"); //$NON-NLS-1$ + enableBallooning = new EntityModelCheckBoxEditor(Align.RIGHT); enableBallooning.getContentWidgetContainer().setWidth("350px"); //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml index 7b138b1..c916402 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml @@ -14,7 +14,7 @@ background-color: #D3D3D3; margin-bottom: 8px; margin-top: 4px; - margin-right: 3px; + margin-right: 3px; padding-top: 6px; padding-bottom: 6px; } @@ -29,7 +29,7 @@ margin-bottom: 10px; width: 300px; } - + .label { width: 100%; } @@ -154,7 +154,7 @@ <g:FlowPanel> <g:FlowPanel ui:field="dataCenterPanel" addStyleNames="{style.generalTabTopDecorator}"> <e:ListModelListBoxEditor ui:field="dataCenterEditor" /> - </g:FlowPanel> + </g:FlowPanel> <ge:StringEntityModelTextBoxEditor ui:field="nameEditor" /> <ge:StringEntityModelTextBoxEditor ui:field="descriptionEditor" /> <ge:StringEntityModelTextBoxEditor ui:field="commentEditor" /> @@ -200,6 +200,10 @@ <g:Label text="{constants.ballooningLabelTitle}" addStyleNames="{style.panelTitle}" /> <ge:EntityModelCheckBoxEditor ui:field="enableBallooning" /> </g:FlowPanel> + <g:FlowPanel addStyleNames="{style.nestedSubsequentPanel}"> + <g:Label text="{constants.ksmLabelTitle}" addStyleNames="{style.panelTitle}" /> + <ge:EntityModelCheckBoxEditor ui:field="enableKsm" /> + </g:FlowPanel> </g:FlowPanel> </t:content> </t:DialogTab> diff --git a/packaging/dbscripts/vds_groups_sp.sql b/packaging/dbscripts/vds_groups_sp.sql index 47200b5..6d0dd33 100644 --- a/packaging/dbscripts/vds_groups_sp.sql +++ b/packaging/dbscripts/vds_groups_sp.sql @@ -32,7 +32,7 @@ v_architecture INTEGER, v_optimization_type SMALLINT, v_spice_proxy VARCHAR(255), - v_enable_ksm BOOLEAN) + v_enable_ksm BOOLEAN) RETURNS VOID AS $procedure$ BEGIN @@ -73,7 +73,7 @@ v_architecture INTEGER, v_optimization_type SMALLINT, v_spice_proxy VARCHAR(255), - v_enable_ksm BOOLEAN + v_enable_ksm BOOLEAN ) RETURNS VOID -- To view, visit http://gerrit.ovirt.org/23360 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95414d676da17f00f8c23150b0cdef666a91ce74 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
