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

    https://github.com/apache/cloudstack/pull/1365#discussion_r58929616
  
    --- Diff: server/src/com/cloud/storage/VolumeApiServiceImpl.java ---
    @@ -1835,6 +1847,25 @@ private Volume orchestrateDetachVolumeFromVM(long 
vmId, long volumeId) {
             }
         }
     
    +    public void updateMissingRootDiskController(final VMInstanceVO vm, 
final String rootVolChainInfo) {
    +        if (vm != null && vm.getType().equals(VirtualMachine.Type.User) && 
!Strings.isNullOrEmpty(rootVolChainInfo)) {
    --- End diff --
    
    very nice the extraction you did here.
    What about the short-circuit for the condition at line 1851?
    
    ```
    if (vm == null || !VirtualMachine.Type.User.equals(vm.getType()) || 
Strings.isNullOrEmpty(rootVolChainInfo)) {
        return;
    }
    ...
    the rest of the code (lines 1852-1865)
    ...
    
    ```


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