DennisKonrad commented on a change in pull request #3839: FEATURE-3823: kvm 
agent hooks
URL: https://github.com/apache/cloudstack/pull/3839#discussion_r371242703
 
 

 ##########
 File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -1015,11 +1015,12 @@ public UserVm upgradeVirtualMachine(UpgradeVMCmd cmd) 
throws ResourceAllocationE
         int currentCpu = currentServiceOffering.getCpu();
         int currentMemory = currentServiceOffering.getRamSize();
 
+        Account owner = 
_accountMgr.getActiveAccountById(vmInstance.getAccountId());
         if (newCpu > currentCpu) {
-            _resourceLimitMgr.checkResourceLimit(caller, ResourceType.cpu, 
newCpu - currentCpu);
+            _resourceLimitMgr.checkResourceLimit(owner, ResourceType.cpu, 
newCpu - currentCpu);
         }
         if (newMemory > currentMemory) {
-            _resourceLimitMgr.checkResourceLimit(caller, ResourceType.memory, 
newMemory - currentMemory);
+            _resourceLimitMgr.checkResourceLimit(owner, ResourceType.memory, 
newMemory - currentMemory);
         }
 
         // Check that the specified service offering ID is valid
 
 Review comment:
   I previously saw code like this in 
https://github.com/apache/cloudstack/pull/3759/files. Does this belong into 
this PR?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to