Daniel Erez has uploaded a new change for review.

Change subject: core: BaseImagesCommand - update disk volume type
......................................................................

core: BaseImagesCommand - update disk volume type

BaseImagesCommand -> endSuccessfully: update disk's VolumeType/VolumeFormat.
Specifically in bug context, needed when moving a raw/thin provisioned disk
from file domain to block domain.

Change-Id: I34f32dfdc0dcf8bad14d114371d9bd0a7314913c
Bug-Url: https://bugzilla.redhat.com/1098258
Signed-off-by: Daniel Erez <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotCustomPreviewPopupWidget.java
2 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/27793/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
index fa61bd5..d4238c6 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
@@ -339,6 +339,10 @@
 
                 if (newImageIRS != null) {
                     completeImageData(newImageIRS);
+
+                    // Set volume type/format before updating DB in the 
'finally' branch
+                    
getDestinationDiskImage().getImage().setVolumeType(newImageIRS.getVolumeType());
+                    
getDestinationDiskImage().getImage().setVolumeFormat(newImageIRS.getVolumeFormat());
                 }
             } catch (VdcBLLException e) {
                 // Logging only
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotCustomPreviewPopupWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotCustomPreviewPopupWidget.java
index 9665aef..6dc5ff0 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotCustomPreviewPopupWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotCustomPreviewPopupWidget.java
@@ -223,12 +223,24 @@
                 public Boolean getValue(SnapshotModel snapshotModel) {
                     ListModel diskListModel = 
previewSnapshotModel.getDiskSnapshotsMap().get(disk.getId());
                     DiskImage image = 
snapshotModel.getImageByDiskId(disk.getId());
+                    if (image.getImageStatus() == ImageStatus.ILLEGAL) {
+                        return false;
+                    }
 
                     return image != null ? 
image.equals(diskListModel.getSelectedItem()) : false;
                 }
 
                 @Override
+<<<<<<< HEAD
                 protected boolean canEdit(SnapshotModel model) {
+=======
+                protected boolean canEdit(SnapshotModel snapshotModel) {
+                    DiskImage image = 
snapshotModel.getImageByDiskId(disk.getId());
+                    if (image.getImageStatus() == ImageStatus.ILLEGAL) {
+                        return false;
+                    }
+
+>>>>>>> 987af32... core: BaseImagesCommand - update disk volume type
                     return true;
                 }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34f32dfdc0dcf8bad14d114371d9bd0a7314913c
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