Shahar Havivi has uploaded a new change for review. Change subject: 787578: ......................................................................
787578: Change-Id: If18b8ceba3d641f3e2e79947b34b549902f00b55 Signed-off-by: Shahar Havivi <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java M packaging/dbscripts/create_tables.sql M packaging/dbscripts/create_views.sql A packaging/dbscripts/upgrade/03_03_0385_add_signle_qxl_pci_column.sql M packaging/dbscripts/vm_templates_sp.sql M packaging/dbscripts/vms_sp.sql 19 files changed, 120 insertions(+), 35 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/03/16803/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java index c2dc05f..6da97d1 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.Set; + import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.VmHandler; import org.ovirt.engine.core.bll.network.VmInterfaceManager; @@ -41,6 +42,7 @@ public class VmDeviceUtils { private static VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDao(); private final static String VRAM = "vram"; + private final static String HEADS = "heads"; private final static String EHCI_MODEL = "ich9-ehci"; private final static String UHCI_MODEL = "ich9-uhci"; private final static int SLOTS_PER_CONTROLLER = 6; @@ -824,6 +826,7 @@ String mem = (numOfMonitors > 2 ? VmDeviceCommonUtils.LOW_VIDEO_MEM : VmDeviceCommonUtils.HIGH_VIDEO_MEM); Map<String, Object> specParams = new HashMap<String, Object>(); specParams.put(VRAM, mem); + specParams.put(HEADS, numOfMonitors); return specParams; } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java index 33cf4fc..bf5ba2f 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java @@ -201,6 +201,14 @@ this.vmStatic.setNumOfMonitors(value); } + public boolean getSingleQxlPci() { + return this.vmStatic.getSingleQxlPci(); + } + + public void setSingleQxlPci(boolean value) { + this.vmStatic.setSingleQxlPci(value); + } + public boolean getAllowConsoleReconnect() { return this.vmStatic.isAllowConsoleReconnect(); } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java index 959f1ae..31b73bc 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java @@ -68,6 +68,9 @@ message = "VALIDATION.VM.NUM_OF_MONITORS.EXCEEDED") private int numOfMonitors; + @EditableOnVmStatusField + private boolean singleQxlPci = false; + @EditableField @Size(max = BusinessEntitiesDefinitions.GENERAL_DOMAIN_SIZE) private String domain; @@ -382,6 +385,14 @@ numOfMonitors = value; } + public boolean getSingleQxlPci() { + return singleQxlPci; + } + + public void setSingleQxlPci(boolean value) { + singleQxlPci = value; + } + public String getDomain() { return domain; } @@ -609,6 +620,7 @@ && niceLevel == other.niceLevel && numOfSockets == other.numOfSockets && numOfMonitors == other.numOfMonitors + && singleQxlPci == other.singleQxlPci && origin == other.origin && priority == other.priority && stateless == other.stateless diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java index 14c7d3e..4c230c7 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java @@ -203,6 +203,7 @@ .addValue("vm_name", vm.getName()) .addValue("vmt_guid", vm.getVmtGuid()) .addValue("num_of_monitors", vm.getNumOfMonitors()) + .addValue("single_qxl_pci", vm.getSingleQxlPci()) .addValue("allow_console_reconnect", vm.getAllowConsoleReconnect()) .addValue("is_initialized", vm.isInitialized()) .addValue("num_of_sockets", vm.getNumOfSockets()) @@ -341,6 +342,7 @@ entity.setVmPoolName(rs.getString("vm_pool_name")); entity.setVmPoolId(getGuid(rs, "vm_pool_id")); entity.setNumOfMonitors(rs.getInt("num_of_monitors")); + entity.setSingleQxlPci(rs.getBoolean("single_qxl_pci")); entity.setAllowConsoleReconnect(rs.getBoolean("allow_console_reconnect")); entity.setInitialized(rs.getBoolean("is_initialized")); entity.setNumOfSockets(rs.getInt("num_of_sockets")); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java index 7d95745..f15421d 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java @@ -51,6 +51,7 @@ .addValue("domain", vm.getDomain()) .addValue("creation_date", vm.getCreationDate()) .addValue("num_of_monitors", vm.getNumOfMonitors()) + .addValue("single_qxl_pci", vm.getSingleQxlPci()) .addValue("is_initialized", vm.isInitialized()) .addValue("num_of_sockets", vm.getNumOfSockets()) .addValue("cpu_per_socket", vm.getCpuPerSocket()) @@ -198,6 +199,7 @@ entity.setVmtGuid(getGuidDefaultEmpty(rs, "vmt_guid")); entity.setDomain(rs.getString("domain")); entity.setNumOfMonitors(rs.getInt("num_of_monitors")); + entity.setSingleQxlPci(rs.getBoolean("single_qxl_pci")); entity.setInitialized(rs.getBoolean("is_initialized")); entity.setDedicatedVmForVds(getGuid(rs, "dedicated_vm_for_vds")); entity.setDefaultDisplayType(DisplayType.forValue(rs.getInt("default_display_type"))); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java index a27fed3..c2599fd 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java @@ -136,6 +136,7 @@ .addValue("vds_group_id", template.getVdsGroupId()) .addValue("domain", template.getDomain()) .addValue("num_of_monitors", template.getNumOfMonitors()) + .addValue("single_qxl_pci", template.getSingleQxlPci()) .addValue("allow_console_reconnect", template.isAllowConsoleReconnect()) .addValue("status", template.getStatus()) .addValue("usb_policy", template.getUsbPolicy()) @@ -217,6 +218,7 @@ entity.setVdsGroupId(getGuidDefaultEmpty(rs, "vds_group_id")); entity.setDomain(rs.getString("domain")); entity.setNumOfMonitors(rs.getInt("num_of_monitors")); + entity.setSingleQxlPci(rs.getBoolean("single_qxl_pci")); entity.setAllowConsoleReconnect(rs.getBoolean("allow_console_reconnect")); entity.setStatus(VmTemplateStatus.forValue(rs.getInt("status"))); entity.setVdsGroupName(rs.getString("vds_group_name")); diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java index df60bec..9ab07b6 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java @@ -582,6 +582,7 @@ private static HashMap<String, Object> getNewMonitorSpecParams() { HashMap<String, Object> specParams = new HashMap<String, Object>(); specParams.put("vram", VmDeviceCommonUtils.HIGH_VIDEO_MEM); + // specParams.put("heads", "7"); return specParams; } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java index 7794267..1b265de 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java @@ -1293,6 +1293,9 @@ @DefaultStringValue("Soundcard enabled") String soundcardEnabled(); + @DefaultStringValue("Single display device") + String singleQxlEnabled(); + @DefaultStringValue("Optimized for") String optimizedFor(); } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java index 548ee98..fba9cea 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java @@ -1,29 +1,12 @@ package org.ovirt.engine.ui.common.widget.uicommon.popup; -import com.google.gwt.core.client.GWT; -import com.google.gwt.editor.client.SimpleBeanEditorDriver; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.logical.shared.ValueChangeEvent; -import com.google.gwt.event.logical.shared.ValueChangeHandler; -import com.google.gwt.resources.client.CssResource; -import com.google.gwt.text.shared.AbstractRenderer; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.cellview.client.CellTable; -import com.google.gwt.user.cellview.client.CellTable.Resources; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.Panel; -import com.google.gwt.user.client.ui.RadioButton; -import com.google.gwt.user.client.ui.ValueLabel; -import com.google.gwt.user.client.ui.Widget; +import static org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import org.ovirt.engine.core.common.businessentities.Disk; import org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType; import org.ovirt.engine.core.common.businessentities.DiskImage; @@ -74,7 +57,27 @@ import org.ovirt.engine.ui.uicompat.IEventListener; import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; import org.ovirt.engine.ui.uicompat.external.StringUtils; -import static org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.editor.client.SimpleBeanEditorDriver; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; +import com.google.gwt.resources.client.CssResource; +import com.google.gwt.text.shared.AbstractRenderer; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.cellview.client.CellTable; +import com.google.gwt.user.cellview.client.CellTable.Resources; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.Panel; +import com.google.gwt.user.client.ui.RadioButton; +import com.google.gwt.user.client.ui.ValueLabel; +import com.google.gwt.user.client.ui.Widget; public abstract class AbstractVmPopupWidget extends AbstractModeSwitchingPopupWidget<UnitVmModel> { @@ -340,6 +343,11 @@ public ListModelListBoxEditor<Object> numOfMonitorsEditor; @UiField(provided = true) + @Path(value = "isSingleQxlEnabled.entity") + @WithElementId("isSingleQxlEnabled.entity") + public EntityModelCheckBoxEditor isSingleQxlEnabledEditor; + + @UiField(provided = true) @Path(value = "isStateless.entity") @WithElementId("isStateless") public EntityModelCheckBoxEditor isStatelessEditor; @@ -566,6 +574,7 @@ cdAttachedEditor = new EntityModelCheckBoxEditor(Align.LEFT, new ModeSwitchingVisibilityRenderer()); allowConsoleReconnectEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); isSoundcardEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); + isSingleQxlEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); priorityEditor = new EntityModelCellTable<ListModel>( (Resources) GWT.create(ButtonCellTableResources.class)); @@ -925,6 +934,7 @@ corePerSocketEditor.setLabel(constants.coresPerSocket()); numOfSocketsEditor.setLabel(constants.numOfSockets()); isSoundcardEnabledEditor.setLabel(constants.soundcardEnabled()); + isSingleQxlEnabledEditor.setLabel(constants.singleQxlEnabled()); } protected void applyStyles() { @@ -1263,6 +1273,7 @@ displayProtocolEditor.setTabIndex(nextTabIndex++); vncKeyboardLayoutEditor.setTabIndex(nextTabIndex++); usbSupportEditor.setTabIndex(nextTabIndex++); + isSingleQxlEnabledEditor.setTabIndex(nextTabIndex++); numOfMonitorsEditor.setTabIndex(nextTabIndex++); isSmartcardEnabledEditor.setTabIndex(nextTabIndex++); nextTabIndex = expander.setTabIndexes(nextTabIndex); @@ -1319,6 +1330,7 @@ putAll(consoleTabWidgets(), simpleField().visibleInAdvancedModeOnly()). update(consoleTab, simpleField()). update(numOfMonitorsEditor, simpleField()). + update(isSingleQxlEnabledEditor, simpleField()). putOne(isSoundcardEnabledEditor, simpleField().visibleInAdvancedModeOnly()). putOne(isConsoleDeviceEnabledEditor, simpleField().visibleInAdvancedModeOnly()); } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml index f31a7a7..042fda5 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml @@ -346,6 +346,7 @@ <e:ListModelListBoxEditor ui:field="displayProtocolEditor" /> <e:ListModelListBoxEditor ui:field="vncKeyboardLayoutEditor" /> <e:ListModelListBoxEditor ui:field="usbSupportEditor" /> + <e:EntityModelCheckBoxEditor ui:field="isSingleQxlEnabledEditor" addStyleNames="{style.checkbox}" /> <e:ListModelListBoxEditor ui:field="numOfMonitorsEditor" /> <e:EntityModelCheckBoxEditor ui:field="isSmartcardEnabledEditor" addStyleNames="{style.checkbox}" /> <g:Label ui:field="nativeUsbWarningMessage" text="{constants.nativeUsbSupportWarning}" addStyleNames="{style.warningMessageLabel}" /> diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java index 7001978..5028310 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java @@ -106,6 +106,8 @@ } } }), vm.getId()); + + updateSingleQxl(); } protected void initClusters(final List<StoragePool> dataCenters) { @@ -319,4 +321,8 @@ updateCdImage(); } + + protected void updateSingleQxl() { + getModel().getIsSingleQxlEnabled().setEntity(vm.getSingleQxlPci()); + } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java index d1b06c5..01856ed 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java @@ -5,7 +5,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; - import java.util.Map; import org.ovirt.engine.core.common.businessentities.BootSequence; @@ -148,6 +147,7 @@ getDisplayProtocol().setIsChangable(false); getUsbPolicy().setIsChangable(false); getNumOfMonitors().setIsChangable(false); + getIsSingleQxlEnabled().setIsChangable(false); getIsSmartcardEnabled().setIsChangable(false); getAllowConsoleReconnect().setIsChangable(false); getVncKeyboardLayout().setIsChangable(false); @@ -455,6 +455,19 @@ { privateNumOfMonitors = value; } + + private NotChangableForVmInPoolListModel privateIsSingleQxlEnabled; + + public ListModel getIsSingleQxlEnabled() + { + return privateIsSingleQxlEnabled; + } + + private void setIsSingleQxlEnabled(NotChangableForVmInPoolListModel value) + { + privateIsSingleQxlEnabled = value; + } + private NotChangableForVmInPoolEntityModel privateAllowConsoleReconnect; @@ -1066,6 +1079,7 @@ setStorageDomain(new NotChangableForVmInPoolListModel()); setName(new NotChangableForVmInPoolEntityModel()); setNumOfMonitors(new NotChangableForVmInPoolListModel()); + setIsSingleQxlEnabled(new NotChangableForVmInPoolListModel()); setAllowConsoleReconnect(new NotChangableForVmInPoolEntityModel()); setDescription(new NotChangableForVmInPoolEntityModel()); setDomain(new NotChangableForVmInPoolListModel()); @@ -1683,6 +1697,7 @@ getVncKeyboardLayout().setIsAvailable(type == DisplayType.vnc); updateNumOfMonitors(); + getBehavior().updateSingleQxl(); } private void memSize_EntityChanged(Object sender, EventArgs args) diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java index a7aec44..631219e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; + import org.ovirt.engine.core.common.VdcActionUtils; import org.ovirt.engine.core.common.action.AddVmFromScratchParameters; import org.ovirt.engine.core.common.action.AddVmFromTemplateParameters; @@ -80,6 +81,9 @@ import org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel; import org.ovirt.engine.ui.uicommonweb.models.userportal.AttachCdModel; import org.ovirt.engine.ui.uicommonweb.models.userportal.UserSelectedDisplayProtocolManager; +import org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkCreateFrontendAsyncCallback; +import org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkCreateOrUpdateFrontendActionAsyncCallback; +import org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback; import org.ovirt.engine.ui.uicompat.ConstantsManager; import org.ovirt.engine.ui.uicompat.Event; import org.ovirt.engine.ui.uicompat.EventArgs; @@ -91,9 +95,6 @@ import org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback; import org.ovirt.engine.ui.uicompat.ObservableCollection; import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; -import static org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkCreateFrontendAsyncCallback; -import static org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkCreateOrUpdateFrontendActionAsyncCallback; -import static org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback; public class VmListModel extends VmBaseListModel<VM> implements ISupportSystemTreeContext, UserSelectedDisplayProtocolManager { @@ -1352,6 +1353,7 @@ } tempVar.setVmOs((Integer) model.getOSType().getSelectedItem()); tempVar.setNumOfMonitors((Integer) model.getNumOfMonitors().getSelectedItem()); + tempVar.setSingleQxlPci((Boolean) model.getIsSingleQxlEnabled().getEntity()); tempVar.setAllowConsoleReconnect((Boolean) model.getAllowConsoleReconnect().getEntity()); tempVar.setVmDomain(model.getDomain().getIsAvailable() ? (String) model.getDomain().getSelectedItem() : ""); //$NON-NLS-1$ tempVar.setVmMemSizeMb((Integer) model.getMemSize().getEntity()); @@ -1940,6 +1942,7 @@ } getcurrentVm().setVmOs((Integer) model.getOSType().getSelectedItem()); getcurrentVm().setNumOfMonitors((Integer) model.getNumOfMonitors().getSelectedItem()); + getcurrentVm().setSingleQxlPci((Boolean) model.getIsSingleQxlEnabled().getEntity()); getcurrentVm().setAllowConsoleReconnect((Boolean) model.getAllowConsoleReconnect().getEntity()); getcurrentVm().setVmDescription((String) model.getDescription().getEntity()); getcurrentVm().setVmDomain(model.getDomain().getIsAvailable() ? (String) model.getDomain().getSelectedItem() diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java index 23dc490..96aeb09 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java @@ -980,4 +980,9 @@ behavior.initNetworks(hotUpdateSupported, getModel().getSelectedCluster().getId(), query); } + + protected void updateSingleQxl() { + // getModel().getIsSingleQxlEnabled().setEntity(false); + // getModel().getIsSingleQxlEnabled().setIsChangable(false); + } } diff --git a/packaging/dbscripts/create_tables.sql b/packaging/dbscripts/create_tables.sql index 1c6654b..c06ff79 100644 --- a/packaging/dbscripts/create_tables.sql +++ b/packaging/dbscripts/create_tables.sql @@ -185,6 +185,7 @@ vds_group_id UUID NOT NULL, domain VARCHAR(40), num_of_monitors INTEGER NOT NULL, + single_qxl_pci BOOLEAN default false, status INTEGER NOT NULL, usb_policy INTEGER, time_zone VARCHAR(40), @@ -254,6 +255,7 @@ domain VARCHAR(40), creation_date TIMESTAMP WITH TIME ZONE, num_of_monitors INTEGER NOT NULL, + single_qxl_pci BOOLEAN default false, is_initialized BOOLEAN, is_auto_suspend BOOLEAN default false, num_of_sockets INTEGER NOT NULL DEFAULT 1, diff --git a/packaging/dbscripts/create_views.sql b/packaging/dbscripts/create_views.sql index 587d90e..c4360c8 100644 --- a/packaging/dbscripts/create_views.sql +++ b/packaging/dbscripts/create_views.sql @@ -351,6 +351,7 @@ vm_templates.vds_group_id as vds_group_id, vm_templates.domain as domain, vm_templates.num_of_monitors as num_of_monitors, + vm_templates.single_qxl_pci as single_qxl_pci, vm_templates.allow_console_reconnect as allow_console_reconnect, vm_templates.template_status as status, vm_templates.usb_policy as usb_policy, @@ -412,7 +413,7 @@ vm_templates.os, vm_templates.creation_date, vm_templates.child_count, vm_templates.num_of_sockets, vm_templates.cpu_per_socket, vm_templates.num_of_sockets*vm_templates.cpu_per_socket AS num_of_cpus, vm_templates.description, - vm_templates.vds_group_id, vm_templates.domain, vm_templates.num_of_monitors, vm_templates.allow_console_reconnect, vm_templates.template_status AS status, + vm_templates.vds_group_id, vm_templates.domain, vm_templates.num_of_monitors, vm_templates.single_qxl_pci, vm_templates.allow_console_reconnect, vm_templates.template_status AS status, vm_templates.usb_policy, vm_templates.time_zone, vm_templates.fail_back, vds_groups.name AS vds_group_name, vm_templates.vm_type, vm_templates.nice_level, storage_pool.id AS storage_pool_id, storage_pool.name AS storage_pool_name, @@ -432,7 +433,7 @@ SELECT vm_templates_1.vm_guid AS vmt_guid, vm_templates_1.vm_name AS name, vm_templates_1.mem_size_mb, vm_templates_1.os, vm_templates_1.creation_date, vm_templates_1.child_count, vm_templates_1.num_of_sockets, vm_templates_1.cpu_per_socket, vm_templates_1.num_of_sockets*vm_templates_1.cpu_per_socket AS num_of_cpus, vm_templates_1.description, vm_templates_1.vds_group_id, - vm_templates_1.domain, vm_templates_1.num_of_monitors, vm_templates_1.allow_console_reconnect, vm_templates_1.template_status AS status, vm_templates_1.usb_policy, vm_templates_1.time_zone, + vm_templates_1.domain, vm_templates_1.num_of_monitors, vm_templates_1.single_qxl_pci, vm_templates_1.allow_console_reconnect, vm_templates_1.template_status AS status, vm_templates_1.usb_policy, vm_templates_1.time_zone, vm_templates_1.fail_back, vds_groups_1.name AS vds_group_name, vm_templates_1.vm_type, vm_templates_1.nice_level, storage_pool_1.id AS storage_pool_id, storage_pool_1.name AS storage_pool_name, vm_templates_1.default_boot_sequence, vm_templates_1.default_display_type, @@ -547,7 +548,7 @@ vm_dynamic.guest_last_login_time as guest_last_login_time, vm_dynamic.guest_last_logout_time as guest_last_logout_time, vm_dynamic.guest_os as guest_os, vm_dynamic.console_user_id as console_user_id, vm_dynamic.guest_agent_nics_hash as guest_agent_nics_hash, vm_dynamic.run_on_vds as run_on_vds, vm_dynamic.migrating_to_vds as migrating_to_vds, vm_dynamic.app_list as app_list, vm_dynamic.display as display, vm_dynamic.hibernation_vol_handle as hibernation_vol_handle, - vm_pool_map_view.vm_pool_name as vm_pool_name, vm_pool_map_view.vm_pool_id as vm_pool_id, vm_static.vm_guid as vm_guid, vm_static.num_of_monitors as num_of_monitors, vm_static.allow_console_reconnect as allow_console_reconnect, vm_static.is_initialized as is_initialized, + vm_pool_map_view.vm_pool_name as vm_pool_name, vm_pool_map_view.vm_pool_id as vm_pool_id, vm_static.vm_guid as vm_guid, vm_static.num_of_monitors as num_of_monitors, vm_static.single_qxl_pci as single_qxl_pci, vm_static.allow_console_reconnect as allow_console_reconnect, vm_static.is_initialized as is_initialized, vm_static.num_of_sockets as num_of_sockets, vm_static.cpu_per_socket as cpu_per_socket, vm_static.usb_policy as usb_policy, vm_dynamic.acpi_enable as acpi_enable, vm_dynamic.session as session, vm_static.num_of_sockets*vm_static.cpu_per_socket as num_of_cpus, vm_static.quota_id as quota_id, quota.quota_name as quota_name, storage_pool.quota_enforcement_type as quota_enforcement_type, @@ -585,7 +586,7 @@ vms.vm_host, vms.vmt_num_of_sockets * vms.vmt_cpu_per_socket AS vmt_num_of_cpus, vms.vm_pid, vms.last_start_time, vms.guest_cur_user_name, vms.console_cur_user_name, vms.guest_last_login_time, vms.console_user_id, vms.guest_last_logout_time, vms.guest_os, vms.run_on_vds, vms.migrating_to_vds, vms.app_list, vms.display, - vms.hibernation_vol_handle, vms.vm_pool_name, vms.vm_pool_id, vms.vm_guid, vms.num_of_monitors, + vms.hibernation_vol_handle, vms.vm_pool_name, vms.vm_pool_id, vms.vm_guid, vms.num_of_monitors, vms.single_qxl_pci, vms.allow_console_reconnect, vms.is_initialized, vms.num_of_sockets, vms.cpu_per_socket, vms.usb_policy, vms.acpi_enable, vms.session, vms.num_of_sockets * vms.cpu_per_socket AS num_of_cpus, vms.display_ip, vms.display_type, diff --git a/packaging/dbscripts/upgrade/03_03_0385_add_signle_qxl_pci_column.sql b/packaging/dbscripts/upgrade/03_03_0385_add_signle_qxl_pci_column.sql new file mode 100644 index 0000000..d1ea769 --- /dev/null +++ b/packaging/dbscripts/upgrade/03_03_0385_add_signle_qxl_pci_column.sql @@ -0,0 +1 @@ +select fn_db_add_column('vm_static', 'single_qxl_pci', 'BOOLEAN NOT NULL DEFAULT FALSE'); diff --git a/packaging/dbscripts/vm_templates_sp.sql b/packaging/dbscripts/vm_templates_sp.sql index 4835b94..5b412c9 100644 --- a/packaging/dbscripts/vm_templates_sp.sql +++ b/packaging/dbscripts/vm_templates_sp.sql @@ -65,6 +65,7 @@ vds_group_id, domain, num_of_monitors, + single_qxl_pci, allow_console_reconnect, template_status, usb_policy, @@ -109,6 +110,7 @@ v_vds_group_id, v_domain, v_num_of_monitors, + v_single_qxl_pci, v_allow_console_reconnect, v_status, v_usb_policy, @@ -162,6 +164,7 @@ v_vds_group_id UUID, v_domain VARCHAR(40), v_num_of_monitors INTEGER, + v_single_qxl_pci BOOLEAN, v_allow_console_reconnect BOOLEAN, v_status INTEGER, v_usb_policy INTEGER, @@ -199,7 +202,7 @@ mem_size_mb = v_mem_size_mb,vm_name = v_name,num_of_sockets = v_num_of_sockets, cpu_per_socket = v_cpu_per_socket,os = v_os, vds_group_id = v_vds_group_id,domain = v_domain,num_of_monitors = v_num_of_monitors, - allow_console_reconnect = v_allow_console_reconnect, + single_qxl_pci = v_single_qxl_pci, allow_console_reconnect = v_allow_console_reconnect, template_status = v_status,usb_policy = v_usb_policy,time_zone = v_time_zone, fail_back = v_fail_back, vm_type = v_vm_type, diff --git a/packaging/dbscripts/vms_sp.sql b/packaging/dbscripts/vms_sp.sql index 3e1f5e0..37f16fa 100644 --- a/packaging/dbscripts/vms_sp.sql +++ b/packaging/dbscripts/vms_sp.sql @@ -404,6 +404,7 @@ v_domain VARCHAR(40), v_creation_date TIMESTAMP WITH TIME ZONE, v_num_of_monitors INTEGER, + v_single_qxl_pci BOOLEAN, v_allow_console_reconnect BOOLEAN, v_is_initialized BOOLEAN, v_num_of_sockets INTEGER, @@ -439,8 +440,8 @@ RETURNS VOID AS $procedure$ BEGIN -INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid,domain,creation_date,num_of_monitors,allow_console_reconnect,is_initialized,num_of_sockets,cpu_per_socket,usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, default_boot_sequence, vm_type, nice_level, default_display_type, priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem, entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, vnc_keyboard_layout, is_run_and_pause) - VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_domain, v_creation_date, v_num_of_monitors, v_allow_console_reconnect, v_is_initialized, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone, v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, v_default_boot_sequence, v_vm_type, v_nice_level, v_default_display_type, v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem, 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_vnc_keyboard_layout, v_is_run_and_pause); +INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid,domain,creation_date,num_of_monitors, single_qxl_pci, allow_console_reconnect,is_initialized,num_of_sockets,cpu_per_socket,usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, default_boot_sequence, vm_type, nice_level, default_display_type, priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem, entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, vnc_keyboard_layout, is_run_and_pause) + VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_domain, v_creation_date, v_num_of_monitors, v_single_qxl_pci, v_allow_console_reconnect, v_is_initialized, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone, v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, v_default_boot_sequence, v_vm_type, v_nice_level, v_default_display_type, v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem, 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_vnc_keyboard_layout, v_is_run_and_pause); -- perform deletion from vm_ovf_generations to ensure that no record exists when performing insert to avoid PK violation. DELETE FROM vm_ovf_generations gen WHERE gen.vm_guid = v_vm_guid; INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES (v_vm_guid, (SELECT storage_pool_id FROM vds_groups vg WHERE vg.vds_group_id = v_vds_group_id)); @@ -519,6 +520,7 @@ v_domain VARCHAR(40), v_creation_date TIMESTAMP WITH TIME ZONE, v_num_of_monitors INTEGER, + v_single_qxl_pci BOOLEAN, v_allow_console_reconnect BOOLEAN, v_is_initialized BOOLEAN, v_num_of_sockets INTEGER, @@ -559,7 +561,7 @@ UPDATE vm_static SET description = v_description,mem_size_mb = v_mem_size_mb,os = v_os,vds_group_id = v_vds_group_id, VM_NAME = v_vm_name,vmt_guid = v_vmt_guid, - domain = v_domain,creation_date = v_creation_date,num_of_monitors = v_num_of_monitors, + domain = v_domain,creation_date = v_creation_date,num_of_monitors = v_num_of_monitors,single_qxl_pci = v_single_qxl_pci, allow_console_reconnect = v_allow_console_reconnect, is_initialized = v_is_initialized, num_of_sockets = v_num_of_sockets,cpu_per_socket = v_cpu_per_socket, @@ -892,6 +894,7 @@ v_vm_name VARCHAR(255), v_vmt_guid UUID, v_num_of_monitors INTEGER, + v_single_qxl_pci BOOLEAN, v_allow_console_reconnect BOOLEAN, v_is_initialized BOOLEAN, v_num_of_sockets INTEGER, @@ -925,8 +928,8 @@ RETURNS VOID AS $procedure$ BEGIN -INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid, num_of_monitors, allow_console_reconnect, is_initialized, num_of_sockets, cpu_per_socket, usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds,fail_back,vm_type,nice_level,default_boot_sequence,default_display_type,priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,cpu_pinning,is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, is_run_and_pause) - VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_num_of_monitors, v_num_of_monitors, v_is_initialized, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone,v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back,v_vm_type,v_nice_level,v_default_boot_sequence,v_default_display_type,v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,v_cpu_pinning,v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_is_run_and_pause); +INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid, num_of_monitors, single_qxl_pci, allow_console_reconnect, is_initialized, num_of_sockets, cpu_per_socket, usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds,fail_back,vm_type,nice_level,default_boot_sequence,default_display_type,priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,cpu_pinning,is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, is_run_and_pause) + VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_num_of_monitors, v_num_of_monitors, v_single_qxl_pci, v_is_initialized, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone,v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back,v_vm_type,v_nice_level,v_default_boot_sequence,v_default_display_type,v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,v_cpu_pinning,v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_is_run_and_pause); INSERT INTO vm_dynamic(vm_guid, status) VALUES(v_vm_guid, 0); -- To view, visit http://gerrit.ovirt.org/16803 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If18b8ceba3d641f3e2e79947b34b549902f00b55 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
