Github user abhinandanprateek commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1454#discussion_r57835178
  
    --- Diff: server/src/com/cloud/resource/ResourceManagerImpl.java ---
    @@ -2112,11 +2112,13 @@ private boolean doCancelMaintenance(final long 
hostId) {
     
             /* TODO: move to listener */
             _haMgr.cancelScheduledMigrations(host);
    +
    +        boolean vms_migrating = false;
             final List<VMInstanceVO> vms = _haMgr.findTakenMigrationWork();
             for (final VMInstanceVO vm : vms) {
                 if (vm != null && vm.getHostId() != null && vm.getHostId() == 
hostId) {
                     s_logger.info("Unable to cancel migration because the vm 
is being migrated: " + vm);
    --- End diff --
    
    @alexandrelimassantana 
    The reason for not breaking from the for loop is to log info about vms that 
are under migration. Probably the log level should be increased to warn. These 
log messages would be valuable for trouble shooting.
    On readability front yes the code will be improved further.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to