Hello Vered Volansky,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/20185

to review the following change.

Change subject: [WIP]webadmin: Expose read-only disk functionality in UI.
......................................................................

[WIP]webadmin: Expose read-only disk functionality in UI.

Work in progress...

Change-Id: I2c8d98df5e9b7aa8130b45b1ca036219175b70bf
Bug-Url: https://bugzilla.redhat.com/878705
Feature-Page-Url: http://www.ovirt.org/Features/Read_Only_Disk
Signed-off-by: Vered Volansky <[email protected]>
Signed-off-by: Sergey Gotliv <[email protected]>
---
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/NewDiskModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
3 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/20185/1

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 fa99c27..3a728eb 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
@@ -60,6 +60,7 @@
     private EntityModel isBootable;
     private EntityModel isShareable;
     private EntityModel isPlugged;
+    private EntityModel isReadOnly;
     private EntityModel isAttachDisk;
     private EntityModel isInternal;
     private EntityModel isDirectLunDiskAvaialable;
@@ -112,6 +113,14 @@
 
     public void setIsPlugged(EntityModel isPlugged) {
         this.isPlugged = isPlugged;
+    }
+
+    public EntityModel getIsReadOnly() {
+        return isReadOnly;
+    }
+
+    public void setIsReadOnly(EntityModel isReadOnly) {
+        this.isReadOnly = isReadOnly;
     }
 
     public EntityModel getIsAttachDisk() {
@@ -260,6 +269,9 @@
         setIsPlugged(new EntityModel());
         getIsPlugged().setEntity(true);
 
+        setIsReadOnly(new EntityModel());
+        getIsReadOnly().setEntity(false);
+
         setIsSgIoUnfiltered(new EntityModel());
         getIsSgIoUnfiltered().setIsAvailable(false);
 
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 76c6131..8d88487 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
@@ -83,7 +83,8 @@
         for (int i = 0; i < disksToAttach.size(); i++) {
             DiskModel disk = (DiskModel) disksToAttach.get(i).getEntity();
             AttachDettachVmDiskParameters parameters = new 
AttachDettachVmDiskParameters(
-                    getVm().getId(), disk.getDisk().getId(), (Boolean) 
getIsPlugged().getEntity());
+                    getVm().getId(), disk.getDisk().getId(), (Boolean) 
getIsPlugged().getEntity(),
+                    (Boolean) getIsReadOnly().getEntity());
 
             actionTypes.add(VdcActionType.AttachDiskToVm);
             paramerterList.add(parameters);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
index 9cffc49..1aeb033 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
@@ -437,8 +437,7 @@
             Disk disk = (Disk) item;
             VdcActionParametersBase parameters = removeDisk ?
                     new RemoveDiskParameters(disk.getId()) :
-                    new AttachDettachVmDiskParameters(vm.getId(), 
disk.getId(), true);
-
+                    new AttachDettachVmDiskParameters(vm.getId(), 
disk.getId(), true, false);
             paramerterList.add(parameters);
         }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c8d98df5e9b7aa8130b45b1ca036219175b70bf
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to