cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [36/50] git commit: updated refs/heads/ui-restyle to 06ccb84
Date Fri, 15 Nov 2013 20:03:21 GMT
Add a new method on datastoredriver: getCapabilities, which will be called by liststoragepoolcmd.
UI can make decision based on the capabilities of the storage.
And also add a new table: snapshotdetails


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

Branch: refs/heads/ui-restyle
Commit: 1292b76c63094805b2034f2e624a9576e1e1758b
Parents: 1762dbb
Author: Edison Su <sudison@gmail.com>
Authored: Thu Nov 14 15:51:56 2013 -0800
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Nov 14 15:55:39 2013 -0800

----------------------------------------------------------------------
 .../org/apache/cloudstack/api/ApiConstants.java |  1 +
 .../api/response/StoragePoolResponse.java       | 11 +++
 .../api/storage/DataStoreCapabilities.java      | 23 +++++++
 .../subsystem/api/storage/DataStoreDriver.java  |  3 +
 .../cloud/storage/dao/SnapshotDetailsDao.java   | 25 +++++++
 .../storage/dao/SnapshotDetailsDaoImpl.java     | 28 ++++++++
 .../cloud/storage/dao/SnapshotDetailsVO.java    | 72 ++++++++++++++++++++
 .../snapshot/XenserverSnapshotStrategy.java     | 13 ++--
 .../storage/image/BaseImageStoreDriverImpl.java | 14 ++--
 .../driver/CloudStackImageStoreDriverImpl.java  |  8 +--
 .../CloudStackPrimaryDataStoreDriverImpl.java   | 21 +++---
 .../SamplePrimaryDataStoreDriverImpl.java       |  8 +++
 .../driver/SolidfirePrimaryDataStoreDriver.java | 16 ++---
 .../com/cloud/api/query/QueryManagerImpl.java   | 15 ++++
 setup/db/db/schema-421to430.sql                 |  9 +++
 15 files changed, 233 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 82b2af6..ea3137d 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -223,6 +223,7 @@ public class ApiConstants {
     public static final String STATUS = "status";
     public static final String STORAGE_TYPE = "storagetype";
     public static final String STORAGE_MOTION_ENABLED = "storagemotionenabled";
+    public static final String STORAGE_CAPABILITIES = "storagecapabilities";
     public static final String SYSTEM_VM_TYPE = "systemvmtype";
     public static final String TAGS = "tags";
     public static final String TARGET_IQN = "targetiqn";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
index 7321d98..1c94377 100644
--- a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
@@ -25,6 +25,7 @@ import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import java.util.Date;
+import java.util.Map;
 
 @EntityReference(value=StoragePool.class)
 public class StoragePoolResponse extends BaseResponse {
@@ -93,6 +94,16 @@ public class StoragePoolResponse extends BaseResponse {
             " false otherwise")
     private Boolean suitableForMigration;
 
+    @SerializedName(ApiConstants.STORAGE_CAPABILITIES) @Param(description="the storage pool
capabilities")
+    private Map<String, String> caps;
+
+    public Map<String, String> getCaps() {
+        return caps;
+    }
+
+    public void setCaps(Map<String, String> cap) {
+        this.caps = cap;
+    }
     /**
      * @return the scope
      */

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreCapabilities.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreCapabilities.java
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreCapabilities.java
new file mode 100644
index 0000000..79ce92e
--- /dev/null
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreCapabilities.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.engine.subsystem.api.storage;
+
+public enum  DataStoreCapabilities {
+    VOLUME_SNAPSHOT_QUIESCEVM
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
index 127b858..9e7329f 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
@@ -23,7 +23,10 @@ import com.cloud.agent.api.to.DataTO;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.storage.command.CommandResult;
 
+import java.util.Map;
+
 public interface DataStoreDriver {
+    Map<String, String>  getCapabilities();
     DataTO getTO(DataObject data);
     DataStoreTO getStoreTO(DataStore store);
     void createAsync(DataStore store, DataObject data, AsyncCompletionCallback<CreateCmdResult>
callback);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDao.java b/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDao.java
new file mode 100644
index 0000000..b216de6
--- /dev/null
+++ b/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDao.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.storage.dao;
+
+import com.cloud.utils.db.GenericDao;
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDao;
+
+public interface SnapshotDetailsDao extends GenericDao<SnapshotDetailsVO, Long>, ResourceDetailsDao<SnapshotDetailsVO>
{
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDaoImpl.java
new file mode 100644
index 0000000..f8d3813
--- /dev/null
+++ b/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsDaoImpl.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.storage.dao;
+
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase;
+
+public class SnapshotDetailsDaoImpl extends ResourceDetailsDaoBase<SnapshotDetailsVO>
implements SnapshotDetailsDao {
+    @Override
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new SnapshotDetailsVO(resourceId, key, value));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsVO.java b/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsVO.java
new file mode 100644
index 0000000..5406749
--- /dev/null
+++ b/engine/schema/src/com/cloud/storage/dao/SnapshotDetailsVO.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.storage.dao;
+
+import org.apache.cloudstack.api.ResourceDetail;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "snapshot_details")
+public class SnapshotDetailsVO implements ResourceDetail {
+    @Id
+    @GeneratedValue(strategy= GenerationType.IDENTITY)
+    @Column(name = "id")
+    private long id;
+
+    @Column(name = "snapshot_id")
+    private long resourceId;
+
+    @Column(name = "name")
+    String name;
+
+    @Column(name = "value")
+    String value;
+
+    public SnapshotDetailsVO(Long resourceId, String name, String value) {
+        this.resourceId = resourceId;
+        this.name = name;
+        this.value = value;
+    }
+
+    @Override
+    public long getResourceId() {
+        return resourceId;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getValue() {
+        return value;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return false;
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
index 7eec5ff..69900af 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
@@ -21,6 +21,7 @@ import java.util.List;
 
 import javax.inject.Inject;
 
+import com.cloud.storage.*;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -41,10 +42,6 @@ import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreVO;
 import org.apache.cloudstack.storage.to.SnapshotObjectTO;
 
 import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.storage.DataStoreRole;
-import com.cloud.storage.Snapshot;
-import com.cloud.storage.SnapshotVO;
-import com.cloud.storage.Volume;
 import com.cloud.storage.dao.SnapshotDao;
 import com.cloud.storage.snapshot.SnapshotManager;
 import com.cloud.utils.NumbersUtil;
@@ -260,6 +257,14 @@ public class XenserverSnapshotStrategy extends SnapshotStrategyBase {
     @Override
     @DB
     public SnapshotInfo takeSnapshot(SnapshotInfo snapshot) {
+        Object payload = snapshot.getPayload();
+        if (payload != null) {
+            CreateSnapshotPayload createSnapshotPayload = (CreateSnapshotPayload)payload;
+            if (createSnapshotPayload.getQuiescevm()) {
+                throw new InvalidParameterValueException("can't handle quiescevm equal true
for volume snapshot");
+            }
+        }
+
         SnapshotVO snapshotVO = snapshotDao.acquireInLockTable(snapshot.getId());
         if (snapshotVO == null) {
             throw new CloudRuntimeException("Failed to get lock on snapshot:" + snapshot.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
index bd93e73..6a74c45 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
@@ -21,17 +21,14 @@ package org.apache.cloudstack.storage.image;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.inject.Inject;
 
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.log4j.Logger;
 
-import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
 import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.framework.async.AsyncRpcContext;
@@ -87,6 +84,11 @@ public abstract class BaseImageStoreDriverImpl implements ImageStoreDriver
{
     }
 
     @Override
+    public Map<String, String> getCapabilities() {
+        return null;
+    }
+
+    @Override
     public DataTO getTO(DataObject data) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java
b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java
index be7c77d..aa60ce6 100644
--- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java
+++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java
@@ -18,16 +18,15 @@
  */
 package org.apache.cloudstack.storage.datastore.driver;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.UUID;
 
 import javax.inject.Inject;
 
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.log4j.Logger;
 
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl;
 import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
@@ -49,7 +48,6 @@ public class CloudStackImageStoreDriverImpl extends BaseImageStoreDriverImpl
{
     @Inject
     EndPointSelector _epSelector;
 
-
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
         ImageStoreImpl nfsStore = (ImageStoreImpl) store;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
index 327d87c..bf28999 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
@@ -18,26 +18,18 @@
  */
 package org.apache.cloudstack.storage.datastore.driver;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.UUID;
 
 import javax.inject.Inject;
 
 import com.cloud.storage.*;
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.cloudstack.storage.to.SnapshotObjectTO;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
-import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.storage.command.CommandResult;
@@ -70,6 +62,13 @@ import com.cloud.utils.NumbersUtil;
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver {
+    @Override
+    public Map<String, String> getCapabilities() {
+        Map<String, String> caps = new HashMap<String, String>();
+        caps.put(DataStoreCapabilities.VOLUME_SNAPSHOT_QUIESCEVM.toString(), "false");
+        return caps;
+    }
+
     private static final Logger s_logger = Logger.getLogger(CloudStackPrimaryDataStoreDriverImpl.class);
     @Inject
     DiskOfferingDao diskOfferingDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
index 8f4c7bb..fcd7855 100644
--- a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
+++ b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
@@ -43,6 +43,9 @@ import com.cloud.agent.api.to.DataTO;
 import com.cloud.storage.dao.StoragePoolHostDao;
 import com.cloud.utils.exception.CloudRuntimeException;
 
+import java.util.HashMap;
+import java.util.Map;
+
 public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver {
     private static final Logger s_logger = Logger.getLogger(SamplePrimaryDataStoreDriverImpl.class);
     @Inject
@@ -57,6 +60,11 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
     }
 
     @Override
+    public Map<String, String> getCapabilities() {
+        return null;
+    }
+
+    @Override
     public DataTO getTO(DataObject data) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
index 1c726cd..4301bfa 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
@@ -17,18 +17,13 @@
 package org.apache.cloudstack.storage.datastore.driver;
 
 import java.text.NumberFormat;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.inject.Inject;
 
-import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.storage.command.CommandResult;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@@ -62,6 +57,11 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver
{
     @Inject private AccountDetailsDao _accountDetailsDao;
 
     @Override
+    public Map<String, String> getCapabilities() {
+        return null;
+    }
+
+    @Override
     public DataTO getTO(DataObject data) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index f251000..35a539a 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -83,6 +83,9 @@ import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.TemplateState;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.query.QueryService;
@@ -342,6 +345,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
     
     @Inject
     ResourceTagDao _resourceTagDao;
+    @Inject
+    DataStoreManager dataStoreManager;
 
     /*
      * (non-Javadoc)
@@ -1994,6 +1999,16 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
 
         List<StoragePoolResponse> poolResponses = ViewResponseHelper.createStoragePoolResponse(result.first().toArray(
                 new StoragePoolJoinVO[result.first().size()]));
+        for(StoragePoolResponse poolResponse : poolResponses) {
+            DataStore store = dataStoreManager.getPrimaryDataStore(Integer.parseInt(poolResponse.getId()));
+            if (store != null) {
+                DataStoreDriver driver = store.getDriver();
+                if (driver != null && driver.getCapabilities() != null) {
+                    poolResponse.setCaps(driver.getCapabilities());
+                }
+            }
+        }
+
         response.setResponses(poolResponses, result.second());
         return response;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1292b76c/setup/db/db/schema-421to430.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index 6507148..1c305f9 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -52,6 +52,15 @@ CREATE TABLE `cloud`.`vm_snapshot_details` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+DROP TABLE IF EXISTS `cloud`.`snapshot_details`;
+CREATE TABLE `cloud`.`snapshot_details` (
+  `id` bigint unsigned UNIQUE NOT NULL,
+  `snapshot_id` bigint unsigned NOT NULL,
+  `name` varchar(255) NOT NULL,
+  `value` varchar(255) NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
 CREATE TABLE `cloud`.`vm_work_job` (
   `id` bigint unsigned UNIQUE NOT NULL,
   `step` char(32) NOT NULL COMMENT 'state',


Mime
View raw message