ofri masad has uploaded a new change for review.

Change subject: core: Fix quota not inherited from VM to Template
......................................................................

core: Fix quota not inherited from VM to Template

When Template was created from a Vm using the REST API the quota of the
disks was not inherited by the new template disks.

The command was looking for quota to assign to the new disk in the
DiskInfoDestinationMap. But as quota is not yet fully supported in REST,
this map is left empty.

Added an 'else' block which uses the old disk quota as a default.

Change-Id: I697082483c706178b8ea47306779dc2b63da5ed6
Bug-Url: https://bugzilla.redhat.com/913551
Signed-off-by: Ofri Masad <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/18/12618/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
index c180683..c3b5005 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
@@ -359,6 +359,8 @@
                     && 
getParameters().getDiskInfoDestinationMap().get(diskImage.getId()) != null) {
             
createParams.setQuotaId(getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId()
 != null
                     ? 
getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId() 
: null);
+            } else {
+                createParams.setQuotaId(diskImage.getQuotaId());
             }
             // The return value of this action is the 'copyImage' task GUID:
             VdcReturnValueBase retValue = 
Backend.getInstance().runInternalAction(


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

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

Reply via email to