CLOUDSTACK-5299: set hypervisor_type of volumes from image format if not set.

This commit is contained in:
Wei Zhou 2013-11-28 10:47:21 +01:00
parent ab39b658ad
commit 221aea5730
1 changed files with 6 additions and 2 deletions

View File

@ -171,8 +171,12 @@ public class VolumeJoinDaoImpl extends GenericDaoBase<VolumeJoinVO, Long> implem
// return hypervisor and storage pool info for ROOT and Resource domain only
if (caller.getType() == Account.ACCOUNT_TYPE_ADMIN || caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) {
if (volume.getState() != Volume.State.UploadOp && volume.getHypervisorType() != null) {
volResponse.setHypervisor(volume.getHypervisorType().toString());
if (volume.getState() != Volume.State.UploadOp) {
if (volume.getHypervisorType() != null) {
volResponse.setHypervisor(volume.getHypervisorType().toString());
} else {
volResponse.setHypervisor(ApiDBUtils.getHypervisorTypeFromFormat(volume.getFormat()).toString());
}
}
Long poolId = volume.getPoolId();
String poolName = (poolId == null) ? "none" : volume.getPoolName();