Daniel Erez has uploaded a new change for review.

Change subject: webadmin: introducing virtio-scsi support
......................................................................

webadmin: introducing virtio-scsi support

A new DiskInterface: VirtIO_SCSI
* Updated GetDiskInterfaceList in AsyncDataProvider
* Filtered for unsupported cluster versions
  (using VirtIoScsiEnabled ConfigurationValue)

SGIO [1]
* Avaiable only for DirectLUN disks with VirtIO_SCSI interface
* Added a checkbox next to DiskInterface editor:
  "Allow Privileged SCSI I/O"
* Restriced by MLA permissions
- Added CONFIGURE_SCSI_GENERIC_IO ActionGroup to RoleTreeView
  under Disk node: "Manipulate SCSI I/O Privileges"
  (Admin roles only)

[updated Enums, LocalizedEnums, AppErrors and Constants accordingly]

[1] 'sgio': SCSI Generic IO - filtered/unfiltered
(indicates whether the OS kernel will filter unprivileged
SG_IO commands for the disk).

* Feature page: http://www.ovirt.org/Features/Virtio-SCSI

Change-Id: Ia5b3926650586783388bf36fae399e76999843dd
Signed-off-by: Daniel Erez <[email protected]>
---
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.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/vm/VmDiskPopupWidget.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.ui.xml
M 
frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/roles_ui/RoleTreeView.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/EditDiskModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewDiskModel.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Enums.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
M 
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
M 
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
M 
frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
17 files changed, 100 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/14908/1

diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index 073e6a6..b54a499 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -2050,6 +2050,9 @@
     @DefaultStringValue("Cannot ${action} ${type} without at least one active 
disk.\nPlease activate a disk and rerun the VM.")
     String VM_CANNOT_RUN_FROM_DISK_WITHOUT_PLUGGED_DISK();
 
+    @DefaultStringValue("Cannot ${action} ${type}. SCSI Generic IO is not 
supported for image disk.")
+    String SCSI_GENERIC_IO_IS_NOT_SUPPORTED_FOR_IMAGE_DISK();
+
     // Suspected (not in use?)
     @DefaultStringValue("Cannot Login. User Password has expired, Please 
change your password.")
     String USER_PASSWORD_EXPIRED();
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 92906e9..a3e56c5 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
@@ -827,6 +827,9 @@
     @DefaultStringValue("Is Shareable")
     String isShareableVmDiskPopup();
 
+    @DefaultStringValue("Allow Privileged SCSI I/O")
+    String isSgIoUnfilteredEditor();
+
     @DefaultStringValue("Activate")
     String activateVmDiskPopup();
 
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.java
index c2106c7..8951cbd 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.java
@@ -142,6 +142,11 @@
     EntityModelCheckBoxEditor isShareableEditor;
 
     @UiField(provided = true)
+    @Path("isSgIoUnfiltered.entity")
+    @WithElementId("isSgIoUnfiltered")
+    EntityModelCheckBoxEditor isSgIoUnfilteredEditor;
+
+    @UiField(provided = true)
     @Path("isPlugged.entity")
     @WithElementId("isPlugged")
     EntityModelCheckBoxEditor isPluggedEditor;
@@ -238,6 +243,7 @@
         wipeAfterDeleteEditor.setLabel(constants.wipeAfterDeleteVmDiskPopup());
         isBootableEditor.setLabel(constants.isBootableVmDiskPopup());
         isShareableEditor.setLabel(constants.isShareableVmDiskPopup());
+        isSgIoUnfilteredEditor.setLabel(constants.isSgIoUnfilteredEditor());
         attachEditor.setLabel(constants.attachDiskVmDiskPopup());
         isPluggedEditor.setLabel(constants.activateVmDiskPopup());
     }
@@ -260,12 +266,7 @@
             }
         });
 
-        interfaceEditor = new ListModelListBoxEditor<Object>(new 
NullSafeRenderer<Object>() {
-            @Override
-            public String renderNullSafe(Object object) {
-                return object.toString();
-            }
-        });
+        interfaceEditor = new ListModelListBoxEditor<Object>(new 
EnumRenderer());
 
         datacenterEditor = new ListModelListBoxEditor<Object>(new 
NullSafeRenderer<Object>() {
             @Override
@@ -280,6 +281,7 @@
         wipeAfterDeleteEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         isBootableEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         isShareableEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
+        isSgIoUnfilteredEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         isPluggedEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         attachEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
 
@@ -723,6 +725,7 @@
         wipeAfterDeleteEditor.setTabIndex(nextTabIndex++);
         isBootableEditor.setTabIndex(nextTabIndex++);
         isShareableEditor.setTabIndex(nextTabIndex++);
+        isSgIoUnfilteredEditor.setTabIndex(nextTabIndex++);
 
         isPluggedEditor.setTabIndex(nextTabIndex++);
 
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.ui.xml
index ba85e6b..1c8e127 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.ui.xml
@@ -102,6 +102,7 @@
                                        <e:EntityModelCheckBoxEditor 
ui:field="wipeAfterDeleteEditor" addStyleNames="{style.checkBoxEditor}"/>
                                        <e:EntityModelCheckBoxEditor 
ui:field="isBootableEditor" addStyleNames="{style.checkBoxEditor}" />
                                        <e:EntityModelCheckBoxEditor 
ui:field="isShareableEditor" addStyleNames="{style.checkBoxEditor}"/>
+                                       <e:EntityModelCheckBoxEditor 
ui:field="isSgIoUnfilteredEditor" addStyleNames="{style.checkBoxEditor}"/>
                                </g:VerticalPanel>
                        </g:HorizontalPanel>
                        <g:Label ui:field="message" 
addStyleNames="{style.errorMessageLabel}" />
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
index f170e1f..b4c7ec7 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
@@ -37,6 +37,7 @@
                <include name="common/businessentities/Nameable.java" />
                <include name="common/businessentities/Provider.java" />
                <include name="common/businessentities/ProviderType.java" />
+               <include name="common/businessentities/ScsiGenericIO.java" />
 
                <!-- Network business entities -->
                <include 
name="common/businessentities/network/VdsNetworkInterface.java" />
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
index 04b5545..9c84d16 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
@@ -29,6 +29,7 @@
 import org.ovirt.engine.core.common.businessentities.Snapshot;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
+import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.businessentities.StorageServerConnections;
 import org.ovirt.engine.core.common.businessentities.StorageType;
 import org.ovirt.engine.core.common.businessentities.TagsType;
@@ -44,7 +45,6 @@
 import org.ovirt.engine.core.common.businessentities.VolumeFormat;
 import org.ovirt.engine.core.common.businessentities.VolumeType;
 import org.ovirt.engine.core.common.businessentities.permissions;
-import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.businessentities.tags;
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
@@ -2601,12 +2601,22 @@
         }));
     }
 
-    public static ArrayList<DiskInterface> getDiskInterfaceList()
+    public static ArrayList<DiskInterface> getDiskInterfaceList(Version 
clusterVersion)
     {
-        return new ArrayList<DiskInterface>(Arrays.asList(new DiskInterface[] {
-                DiskInterface.IDE,
-                DiskInterface.VirtIO
-        }));
+        ArrayList<DiskInterface> diskInterfaces = new ArrayList<DiskInterface>(
+                Arrays.asList(new DiskInterface[] {
+                        DiskInterface.IDE,
+                        DiskInterface.VirtIO
+                }));
+
+        boolean isVirtIOScsiEnabled = (Boolean) 
AsyncDataProvider.getConfigValuePreConverted(
+                ConfigurationValues.VirtIoScsiEnabled, 
clusterVersion.getValue());
+
+        if (isVirtIOScsiEnabled) {
+            diskInterfaces.add(DiskInterface.VirtIO_SCSI);
+        }
+
+        return diskInterfaces;
     }
 
     public static String getNewNicName(ArrayList<VmNetworkInterface> 
existingInterfaces)
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/roles_ui/RoleTreeView.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/roles_ui/RoleTreeView.java
index 92096bf..0205596 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/roles_ui/RoleTreeView.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/roles_ui/RoleTreeView.java
@@ -459,7 +459,11 @@
                                                                 new 
RoleNode(ActionGroup.EDIT_DISK_PROPERTIES,
                                                                         
ConstantsManager.getInstance()
                                                                                
 .getConstants()
-                                                                               
 .allowToChangePropertiesOfTheDiskRoleTreeTooltip()) }) }) });
+                                                                               
 .allowToChangePropertiesOfTheDiskRoleTreeTooltip()),
+                                                                new 
RoleNode(ActionGroup.CONFIGURE_SCSI_GENERIC_IO,
+                                                                        
ConstantsManager.getInstance()
+                                                                               
 .getConstants()
+                                                                               
 .allowToChangeSGIORoleTreeTooltip()) }) }) });
 
         // nothing to filter
         if 
(!ApplicationModeHelper.getUiMode().equals(ApplicationMode.AllModes)) {
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
index a8e7235..ca925a3 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
@@ -12,21 +12,23 @@
 import org.ovirt.engine.core.common.businessentities.PropagateErrors;
 import org.ovirt.engine.core.common.businessentities.Quota;
 import org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum;
+import org.ovirt.engine.core.common.businessentities.ScsiGenericIO;
+import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
+import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.businessentities.StorageType;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
 import org.ovirt.engine.core.common.businessentities.VolumeFormat;
 import org.ovirt.engine.core.common.businessentities.VolumeType;
-import org.ovirt.engine.core.common.businessentities.StorageDomain;
-import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.queries.ConfigurationValues;
 import 
org.ovirt.engine.core.common.queries.GetAllRelevantQuotasForStorageParameters;
 import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
 import org.ovirt.engine.core.common.queries.VdcQueryType;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.compat.StringHelper;
+import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
 import org.ovirt.engine.ui.frontend.Frontend;
 import org.ovirt.engine.ui.frontend.INewAsyncCallback;
@@ -59,6 +61,7 @@
     private EntityModel isAttachDisk;
     private EntityModel isInternal;
     private EntityModel isDirectLunDiskAvaialable;
+    private EntityModel isSgIoUnfiltered;
 
     private ListModel storageType;
     private ListModel host;
@@ -130,6 +133,14 @@
 
     public void setIsDirectLunDiskAvaialable(EntityModel 
isDirectLunDiskAvaialable) {
         this.isDirectLunDiskAvaialable = isDirectLunDiskAvaialable;
+    }
+
+    public EntityModel getIsSgIoUnfiltered() {
+        return isSgIoUnfiltered;
+    }
+
+    public void setIsSgIoUnfiltered(EntityModel isSgIoUnfiltered) {
+        this.isSgIoUnfiltered = isSgIoUnfiltered;
     }
 
     public ListModel getStorageType() {
@@ -235,6 +246,9 @@
         setIsPlugged(new EntityModel());
         getIsPlugged().setEntity(true);
 
+        setIsSgIoUnfiltered(new EntityModel());
+        getIsSgIoUnfiltered().setIsAvailable(false);
+
         setIsDirectLunDiskAvaialable(new EntityModel());
         getIsDirectLunDiskAvaialable().setEntity(true);
 
@@ -251,6 +265,7 @@
         getHost().setIsAvailable(false);
 
         getVolumeType().getSelectedItemChangedEvent().addListener(this);
+        getDiskInterface().getSelectedItemChangedEvent().addListener(this);
 
         setInternalAttachableDisks(new ListModel());
         setExternalAttachableDisks(new ListModel());
@@ -261,8 +276,6 @@
     protected abstract boolean isDatacenterAvailable(StoragePool dataCenter);
 
     protected abstract void updateWipeAfterDelete(StorageType storageType);
-
-    protected abstract void updateInterface(StoragePool datacenter);
 
     protected abstract DiskImage getDiskImage();
 
@@ -467,6 +480,10 @@
         volumeType_SelectedItemChanged();
     }
 
+    public void updateInterface(Version clusterVersion) {
+        
getDiskInterface().setItems(AsyncDataProvider.getDiskInterfaceList(clusterVersion));
+    }
+
     private void updateQuota(StoragePool datacenter) {
         if 
(datacenter.getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED)
                 || !(Boolean) getIsInternal().getEntity()) {
@@ -554,6 +571,12 @@
         updateShareable(volumeType, storageType);
     }
 
+    private void DiskInterface_SelectedItemChanged() {
+        boolean isInternal = (Boolean) getIsInternal().getEntity();
+        DiskInterface diskInterface = (DiskInterface) 
getDiskInterface().getSelectedItem();
+        getIsSgIoUnfiltered().setIsAvailable(!isInternal && 
DiskInterface.VirtIO_SCSI.equals(diskInterface));
+    }
+
     private void wipeAfterDelete_EntityChanged(EventArgs e) {
         if (!getIsWipeAfterDelete().getIsChangable() && (Boolean) 
getIsWipeAfterDelete().getEntity())
         {
@@ -597,12 +620,12 @@
     private void datacenter_SelectedItemChanged() {
         StoragePool datacenter = (StoragePool) 
getDataCenter().getSelectedItem();
         boolean isInternal = getIsInternal().getEntity() != null ? (Boolean) 
getIsInternal().getEntity() : false;
+        boolean isInVm = getVm() != null;
 
         if (datacenter == null) {
             return;
         }
 
-        updateInterface(datacenter);
         updateVolumeType(datacenter.getstorage_pool_type());
         updateShareableDiskEnabled(datacenter);
         updateDirectLunDiskEnabled(datacenter);
@@ -612,6 +635,10 @@
         }
         else {
             updateHosts(datacenter);
+        }
+
+        if (isInVm) {
+            updateInterface(getVm().getVdsGroupCompatibilityVersion());
         }
     }
 
@@ -687,6 +714,11 @@
         }
         else {
             LunDisk lunDisk = getLunDisk();
+            DiskInterface diskInterface = (DiskInterface) 
getDiskInterface().getSelectedItem();
+            if (DiskInterface.VirtIO_SCSI.equals(diskInterface)) {
+                lunDisk.setSgio(Boolean.TRUE.equals((Boolean) 
getIsSgIoUnfiltered().getEntity()) ?
+                        ScsiGenericIO.UNFILTERED : ScsiGenericIO.FILTERED);
+            }
             setDisk(lunDisk);
         }
 
@@ -735,6 +767,10 @@
         {
             volumeType_SelectedItemChanged();
         }
+        else if 
(ev.matchesDefinition(ListModel.selectedItemChangedEventDefinition) && sender 
== getDiskInterface())
+        {
+            DiskInterface_SelectedItemChanged();
+        }
         else if 
(ev.matchesDefinition(ListModel.selectedItemChangedEventDefinition) && sender 
== getDataCenter())
         {
             datacenter_SelectedItemChanged();
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/EditDiskModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/EditDiskModel.java
index dfc1417..3043419 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/EditDiskModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/EditDiskModel.java
@@ -5,10 +5,12 @@
 import org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType;
 import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.businessentities.LunDisk;
-import org.ovirt.engine.core.common.businessentities.StorageType;
+import org.ovirt.engine.core.common.businessentities.ScsiGenericIO;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StoragePool;
+import org.ovirt.engine.core.common.businessentities.StorageType;
 import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
 import org.ovirt.engine.ui.frontend.Frontend;
 import org.ovirt.engine.ui.frontend.INewAsyncCallback;
@@ -40,6 +42,7 @@
         getDescription().setEntity(getDisk().getDiskDescription());
         getIsShareable().setEntity(getDisk().isShareable());
         getIsWipeAfterDelete().setEntity(getDisk().isWipeAfterDelete());
+        getIsSgIoUnfiltered().setEntity(getDisk().getSgio() == 
ScsiGenericIO.UNFILTERED);
 
         if (getDisk().getDiskStorageType() == DiskStorageType.IMAGE) {
             DiskImage diskImage = (DiskImage) getDisk();
@@ -84,8 +87,8 @@
     }
 
     @Override
-    public void updateInterface(StoragePool datacenter) {
-        getDiskInterface().setItems(AsyncDataProvider.getDiskInterfaceList());
+    public void updateInterface(Version clusterVersion) {
+        super.updateInterface(clusterVersion);
         getDiskInterface().setSelectedItem(getDisk().getDiskInterface());
     }
 
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewDiskModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewDiskModel.java
index 0cddb93..50ac419 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewDiskModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewDiskModel.java
@@ -11,11 +11,12 @@
 import org.ovirt.engine.core.common.businessentities.LUNs;
 import org.ovirt.engine.core.common.businessentities.LunDisk;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
+import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.businessentities.StoragePoolStatus;
 import org.ovirt.engine.core.common.businessentities.StorageType;
 import org.ovirt.engine.core.common.businessentities.VolumeType;
-import org.ovirt.engine.core.common.businessentities.StoragePool;
 import org.ovirt.engine.core.common.queries.ConfigurationValues;
+import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
 import org.ovirt.engine.ui.frontend.Frontend;
 import org.ovirt.engine.ui.frontend.INewAsyncCallback;
@@ -132,8 +133,8 @@
     }
 
     @Override
-    public void updateInterface(StoragePool datacenter) {
-        getDiskInterface().setItems(AsyncDataProvider.getDiskInterfaceList());
+    public void updateInterface(Version clusterVersion) {
+        super.updateInterface(clusterVersion);
         getDiskInterface().setSelectedItem(DiskInterface.VirtIO);
     }
 
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
index f13f98a..b8edb16 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
@@ -1202,6 +1202,9 @@
     @DefaultStringValue("Allow to change properties of the Disk")
     String allowToChangePropertiesOfTheDiskRoleTreeTooltip();
 
+    @DefaultStringValue("Allow to change SCSI I/O privileges")
+    String allowToChangeSGIORoleTreeTooltip();
+
     @DefaultStringValue("No")
     String noAlerts();
 
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Enums.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Enums.java
index 0298cac..ee72620 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Enums.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Enums.java
@@ -269,6 +269,8 @@
 
     String DiskInterface___VirtIO();
 
+    String DiskInterface___VirtIO_SCSI();
+
     String Snapshot$SnapshotStatus___OK();
 
     String Snapshot$SnapshotStatus___LOCKED();
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
index 46d53ad..1770cc8 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
@@ -142,6 +142,8 @@
 
        String ActionGroup___EDIT_DISK_PROPERTIES();
 
+    String ActionGroup___CONFIGURE_SCSI_GENERIC_IO();
+
        String ActionGroup___PORT_MIRRORING();
 
        String ActionGroup___CONFIGURE_DISK_STORAGE();
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
index e918f89..be7632f 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
+++ 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
@@ -129,6 +129,7 @@
 DiskInterface___IDE=IDE
 DiskInterface___SCSI=SCSI
 DiskInterface___VirtIO=VirtIO
+DiskInterface___VirtIO_SCSI=VirtIO-SCSI
 Snapshot$SnapshotStatus___OK=Ok
 Snapshot$SnapshotStatus___LOCKED=Locked
 Snapshot$SnapshotStatus___IN_PREVIEW=In Preview
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
index f9d5cf2..ece2d61 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
+++ 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
@@ -72,6 +72,7 @@
 ActionGroup___EDIT_DISK_PROPERTIES=Edit Properties
 ActionGroup___CONFIGURE_DISK_STORAGE=Edit Storage
 ActionGroup___DELETE_DISK=Delete
+ActionGroup___CONFIGURE_SCSI_GENERIC_IO=Manipulate SCSI I/O Privileges
 ActionGroup___PORT_MIRRORING=Port Mirroring
 ActionGroup___MANIPULATE_GLUSTER_HOOK=Manipulate Gluster Hook
 EventNotificationEntity___Host=Host Events:
diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index 848f53d..0e772d8 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -750,6 +750,7 @@
 SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT=Cannot ${action} ${type}. 
Disk's volume format is not supported for shareable disk.
 ERROR_CANNOT_DETACH_DISK_WITH_SNAPSHOT=Cannot ${action} ${type}. The disk is 
already configured in a snapshot. In order to detach it, remove the disk's 
snapshots.
 DISK_IS_ALREADY_SHARED_BETWEEN_VMS=Cannot ${action} ${type}. Disk is shared 
between vms and cannot become unshareable . Detach the disk from the rest of 
the vms it is attached to and then update the disk to be unshareable.
+SCSI_GENERIC_IO_IS_NOT_SUPPORTED_FOR_IMAGE_DISk="Cannot ${action} ${type}. 
SCSI Generic IO is not supported for image disk."
 
 #Suspected (not in use?)
 USER_PASSWORD_EXPIRED=Cannot Login. User Password has expired, Please change 
your password.
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index 3683cec..74ba53d 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -759,6 +759,7 @@
 SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT=Cannot ${action} ${type}. 
Disk's volume format is not supported for shareable disk.
 ERROR_CANNOT_DETACH_DISK_WITH_SNAPSHOT=Cannot ${action} ${type}. The disk is 
already configured in a snapshot. In order to detach it, remove the disk's 
snapshots.
 DISK_IS_ALREADY_SHARED_BETWEEN_VMS=Cannot ${action} ${type}. Disk is shared 
between vms and cannot become unshareable . Detach the disk from the rest of 
the vms it is attached to and then update the disk to be unshareable.
+SCSI_GENERIC_IO_IS_NOT_SUPPORTED_FOR_IMAGE_DISk="Cannot ${action} ${type}. 
SCSI Generic IO is not supported for image disk."
 
 #Suspected (not in use?)
 USER_PASSWORD_EXPIRED=Cannot Login. User Password has expired, Please change 
your password.


--
To view, visit http://gerrit.ovirt.org/14908
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5b3926650586783388bf36fae399e76999843dd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to