cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject [1/6] git commit: updated refs/heads/4.2 to 2fc1161
Date Fri, 29 Nov 2013 10:18:35 GMT
Updated Branches:
  refs/heads/4.2 224c48a76 -> 2fc1161e5


CLOUDSTACK-5299: set hypervisor_type of volumes from image format if not set.
(cherry picked from commit 221aea573008a0b13d115f4949ea3eed2d574ac0)

Conflicts:

	server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java


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

Branch: refs/heads/4.2
Commit: 562aa0425b63958fb30b437fdd615b5e23d1d0d0
Parents: 224c48a
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Fri Nov 29 10:54:28 2013 +0100
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Fri Nov 29 11:17:45 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/562aa042/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 63e0eff..3320376 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