cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafaelweingartner <...@git.apache.org>
Subject [GitHub] cloudstack pull request: [4.7] vmware: improve support for disks
Date Thu, 07 Apr 2016 20:41:29 GMT
Github user rafaelweingartner commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1365#discussion_r58941182
  
    --- Diff: server/src/com/cloud/storage/VolumeApiServiceImpl.java ---
    @@ -1835,6 +1847,26 @@ 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))
{
    +            return;
    +        }
    +        String rootDiskController = null;
    +        try {
    +            final VirtualMachineDiskInfo infoInChain = _gson.fromJson(rootVolChainInfo,
VirtualMachineDiskInfo.class);
    +            if (infoInChain != null) {
    --- End diff --
    
    Do we need this check ?
    is it possible that `gson.fromJson` returns a null ?
    I believe it does not return null values. If it cannot execute the unmarshall process,
an exception happens, right?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message