mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 6165: there is a possiblility of the root volume being null when we search for it, which may be causing a npe in this bug. enhancing the logic around this
status 6165: resolved fixed
This commit is contained in:
parent
2727dc53eb
commit
d07cac932a
@ -290,10 +290,13 @@ public class ListVMsCmd extends BaseCmd {
|
||||
|
||||
//root device related
|
||||
VolumeVO rootVolume = getManagementServer().findRootVolume(vmInstance.getId());
|
||||
vmData.add(new Pair<String, Object>(BaseCmd.Properties.ROOT_DEVICE_ID.getName(), rootVolume.getDeviceId()));
|
||||
if(rootVolume!=null)
|
||||
{
|
||||
vmData.add(new Pair<String, Object>(BaseCmd.Properties.ROOT_DEVICE_ID.getName(), rootVolume.getDeviceId()));
|
||||
|
||||
StoragePoolVO storagePool = getManagementServer().findPoolById(rootVolume.getPoolId());
|
||||
vmData.add(new Pair<String, Object>(BaseCmd.Properties.ROOT_DEVICE_TYPE.getName(), storagePool.getPoolType().toString()));
|
||||
StoragePoolVO storagePool = getManagementServer().findPoolById(rootVolume.getPoolId());
|
||||
vmData.add(new Pair<String, Object>(BaseCmd.Properties.ROOT_DEVICE_TYPE.getName(), storagePool.getPoolType().toString()));
|
||||
}
|
||||
|
||||
vmTag[i++] = vmData;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user