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

(cherry picked from commit 221aea5730)

Conflicts:

	server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
This commit is contained in:
Wei Zhou 2013-11-29 10:54:28 +01:00
parent 224c48a76e
commit 562aa0425b
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();