cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject [1/4] git commit: updated refs/heads/master to 81c07f1
Date Thu, 28 Nov 2013 09:57:08 GMT
Updated Branches:
  refs/heads/master ab39b658a -> 81c07f179


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


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/221aea57
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/221aea57
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/221aea57

Branch: refs/heads/master
Commit: 221aea573008a0b13d115f4949ea3eed2d574ac0
Parents: ab39b65
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Thu Nov 28 10:47:21 2013 +0100
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Thu Nov 28 10:47:21 2013 +0100

----------------------------------------------------------------------
 server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/221aea57/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
index 36f6740..a8631f7 100644
--- a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
@@ -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();


Mime
View raw message