ofri masad has uploaded a new change for review.

Change subject: core: Fix empty quota in updateVM pass
......................................................................

core: Fix empty quota in updateVM pass

When vm is running and have no quota, updateVM does not check quota
validity for empty quota.

The rule for adding quotaConsumptionParameter was changed so that null
or empty quota would be passed to the QuotaManager for validation.

Change-Id: I5b4c782c7c2dd3a70a19e8ed82ab5e180495eb6d
Bug-Url: https://bugzilla.redhat.com/882809
Signed-off-by: Ofri Masad <oma...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/9654/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
index 5ac2ab0..1525c03 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
@@ -35,6 +35,7 @@
 import org.ovirt.engine.core.common.validation.group.UpdateEntity;
 import org.ovirt.engine.core.compat.DateTime;
 import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.compat.NGuid;
 import org.ovirt.engine.core.dal.VdcBllMessages;
 import org.ovirt.engine.core.dal.dbbroker.DbFacade;
 import org.ovirt.engine.core.dao.VmDeviceDAO;
@@ -361,8 +362,9 @@
                 || getVm().getstatus() == VMStatus.PoweringDown) {
             list.add(new 
QuotaSanityParameter(getParameters().getVmStaticData().getQuotaId(), null));
         } else {
-            if (getParameters().getVmStaticData().getQuotaId() != null
-                    && 
!getParameters().getVmStaticData().getQuotaId().equals(getVm().getQuotaId())) {
+            if (getParameters().getVmStaticData().getQuotaId() == null
+                    || 
getParameters().getVmStaticData().getQuotaId().equals(NGuid.Empty)
+                    || 
!getParameters().getVmStaticData().getQuotaId().equals(getVm().getQuotaId())) {
                 list.add(new 
QuotaVdsGroupConsumptionParameter(getVm().getQuotaId(),
                         null,
                         QuotaConsumptionParameter.QuotaAction.RELEASE,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b4c782c7c2dd3a70a19e8ed82ab5e180495eb6d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to