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

    https://github.com/apache/cloudstack/pull/672#discussion_r51359410
  
    --- Diff: 
plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
 ---
    @@ -4251,6 +4257,34 @@ public void rebootVM(final Connection conn, final VM 
vm, final String vmName) th
             }
         }
     
    +    protected String skipOrRemoveSR(Connection conn, SR sr) {
    +        if (sr == null) {
    +            return null;
    +        }
    +        if (s_logger.isDebugEnabled()) {
    +            s_logger.debug(logX(sr, "Removing SR"));
    +        }
    +        try {
    +            Set<VDI> vdis = sr.getVDIs(conn);
    +            for (VDI vdi : vdis) {
    +                Map<java.lang.String, Types.VdiOperations> 
currentOperation = vdi.getCurrentOperations(conn);
    +                if (currentOperation == null || currentOperation.size() == 
0) {
    --- End diff --
    
    @anshul1886 Could you please use MapUtils.isEmpty()?
    It is a null-safe check if the specified map is empty 
(https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MapUtils.html#isEmpty%28java.util.Map%29).
 


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