DaanHoogland commented on a change in pull request #4212:
URL: https://github.com/apache/cloudstack/pull/4212#discussion_r462174163



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5619,7 +5619,7 @@ public VirtualMachine migrateVirtualMachine(Long vmId, 
Host destinationHost) thr
             throw new InvalidParameterValueException("Unsupported Hypervisor 
Type for User VM migration, we support XenServer/VMware/KVM/Ovm/Hyperv/Ovm3 
only");
         }
 
-        if (isVMUsingLocalStorage(vm)) {
+        if (isVMUsingLocalStorage(vm.getId())) {
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug(vm + " is using Local Storage, cannot migrate 
this VM.");

Review comment:
       1. As for the message, looks like an extra check for the strategy is in 
order, but the flow might already guarantee it's validity.
   2. As for the second interpretation of the question, as a matter of 
principle it is always good to check the logging level as parameters are always 
evaluated before passing and you never know how often the code is being 
executed.
   3. As for the level, this is an obvious mis-use of debug. An error or at 
least warning or info situation is occurring here; the user might expect a 
migration but there is something impairing it. This is not a message for a 
developer, hence not a debug level message.
   
   my €0,03 ;)




----------------------------------------------------------------
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]


Reply via email to