cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [07/23] git commit: updated refs/heads/hotfix/CLOUDSTACK-7776 to 9e89a28
Date Thu, 23 Oct 2014 20:11:51 GMT
Changed "boolean connectVolumeToHost(VolumeInfo, Host, DataStore)" to "boolean grantAccess(DataObject,
Host, DataStore)"

Changed "void disconnectVolumeFromHost(VolumeInfo, Host, DataStore)" to "void revokeAccess(DataObject,
Host, DataStore)"


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

Branch: refs/heads/hotfix/CLOUDSTACK-7776
Commit: 57dacf99a2561b4bbd43041548aefc83c2e88ef5
Parents: b29265f
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Sun Oct 19 22:02:04 2014 -0600
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Tue Oct 21 16:01:14 2014 -0600

----------------------------------------------------------------------
 .../service/VolumeOrchestrationService.java            |  5 +++--
 .../subsystem/api/storage/PrimaryDataStoreDriver.java  |  4 ++--
 .../engine/subsystem/api/storage/VolumeService.java    |  4 ++--
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java    |  2 +-
 .../engine/orchestration/VolumeOrchestrator.java       | 13 ++++++++-----
 .../storage/test/FakePrimaryDataStoreDriver.java       |  4 ++--
 .../snapshot/StorageSystemSnapshotStrategy.java        | 12 ++++++------
 .../cloudstack/storage/volume/VolumeServiceImpl.java   | 12 ++++++------
 .../driver/ElastistorPrimaryDataStoreDriver.java       |  4 ++--
 .../driver/CloudStackPrimaryDataStoreDriverImpl.java   |  4 ++--
 .../driver/NexentaPrimaryDataStoreDriver.java          |  4 ++--
 .../driver/SamplePrimaryDataStoreDriverImpl.java       |  4 ++--
 .../driver/SolidFirePrimaryDataStoreDriver.java        |  8 ++++++--
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 10 +++++-----
 server/src/com/cloud/vm/UserVmManagerImpl.java         |  2 +-
 15 files changed, 50 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java
b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java
index df0b5e8..281de92 100644
--- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java
@@ -21,6 +21,7 @@ package org.apache.cloudstack.engine.orchestration.service;
 import java.util.Map;
 import java.util.Set;
 
+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.VolumeInfo;
 
@@ -95,9 +96,9 @@ public interface VolumeOrchestrationService {
 
     void cleanupVolumes(long vmId) throws ConcurrentOperationException;
 
-    void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore);
+    void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);
 
-    void disconnectVolumesFromHost(long vmId, long hostId);
+    void revokeAccess(long vmId, long hostId);
 
     void migrateVolumes(VirtualMachine vm, VirtualMachineTO vmTo, Host srcHost, Host destHost,
Map<Volume, StoragePool> volumeToPool);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
index 43d7d5a..ebaa260 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
@@ -28,9 +28,9 @@ import com.cloud.storage.Volume;
 public interface PrimaryDataStoreDriver extends DataStoreDriver {
     public ChapInfo getChapInfo(VolumeInfo volumeInfo);
 
-    public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore);
+    public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore);
 
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore);
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);
 
     // intended for managed storage (cloud.storage_pool.managed = true)
     // if not managed, return volume.getSize()

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
index cadce56..171e9df 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
@@ -44,9 +44,9 @@ public interface VolumeService {
 
     ChapInfo getChapInfo(VolumeInfo volumeInfo, DataStore dataStore);
 
-    boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore);
+    boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore);
 
-    void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore);
+    void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);
 
     /**
      * Creates the volume based on the given criteria

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index de2fd28..b73d129 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -517,7 +517,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         }
 
         if (hostId != null) {
-            volumeMgr.disconnectVolumesFromHost(vm.getId(), hostId);
+            volumeMgr.revokeAccess(vm.getId(), hostId);
         }
 
         // Clean up volumes based on the vm's instance id

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 262b94d..4b40d5a 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -34,6 +34,7 @@ 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.DataObject;
 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;
@@ -871,16 +872,16 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
         DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null;
 
         if (dataStoreDriver instanceof PrimaryDataStoreDriver) {
-            ((PrimaryDataStoreDriver)dataStoreDriver).disconnectVolumeFromHost(volumeInfo,
host, dataStore);
+            ((PrimaryDataStoreDriver)dataStoreDriver).revokeAccess(dataObject, host, dataStore);
         }
     }
 
     @Override
-    public void disconnectVolumesFromHost(long vmId, long hostId) {
+    public void revokeAccess(long vmId, long hostId) {
         HostVO host = _hostDao.findById(hostId);
 
         List<VolumeVO> volumesForVm = _volsDao.findByInstance(vmId);
@@ -888,10 +889,12 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         if (volumesForVm != null) {
             for (VolumeVO volumeForVm : volumesForVm) {
                 VolumeInfo volumeInfo = volFactory.getVolume(volumeForVm.getId());
+
                 // pool id can be null for the VM's volumes in Allocated state
                 if (volumeForVm.getPoolId() != null) {
                     DataStore dataStore = dataStoreMgr.getDataStore(volumeForVm.getPoolId(),
DataStoreRole.Primary);
-                    volService.disconnectVolumeFromHost(volumeInfo, host, dataStore);
+
+                    volService.revokeAccess(volumeInfo, host, dataStore);
                 }
             }
         }
@@ -1246,7 +1249,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                     long hostId = vm.getVirtualMachine().getHostId();
                     Host host = _hostDao.findById(hostId);
 
-                    volService.connectVolumeToHost(volFactory.getVolume(newVol.getId()),
host, destPool);
+                    volService.grantAccess(volFactory.getVolume(newVol.getId()), host, destPool);
                 }
 
                 newVol = _volsDao.findById(newVol.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/FakePrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/FakePrimaryDataStoreDriver.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/FakePrimaryDataStoreDriver.java
index 7d9cd72..18637b0 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/FakePrimaryDataStoreDriver.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/FakePrimaryDataStoreDriver.java
@@ -49,10 +49,10 @@ public class FakePrimaryDataStoreDriver implements PrimaryDataStoreDriver
{
     }
 
     @Override
-    public boolean  connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{ return false; }
+    public boolean  grantAccess(DataObject dataObject, Host host, DataStore dataStore) {
return false; }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{}
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {}
 
     @Override
     public long getUsedBytes(StoragePool storagePool) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
index 09c5d5f..c895459 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
@@ -221,19 +221,19 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase
{
                 try {
                     // if sourceDetails != null, we need to connect the host(s) to the volume
                     if (sourceDetails != null) {
-                        _volService.connectVolumeToHost(volumeInfo, hostVO, dataStore);
+                        _volService.grantAccess(volumeInfo, hostVO, dataStore);
                     }
 
                     VolumeVO volume = _volumeDao.findById(volumeInfo.getId());
 
-                    // the Folder field is used by connectVolumeToHost(VolumeInfo, Host,
DataStore) when that method
+                    // the Folder field is used by grantAccess(VolumeInfo, Host, DataStore)
when that method
                     // connects the host(s) to the volume
                     // this Folder change is NOT to be written to the DB; it is only temporarily
used here so that
                     // the connect method can be passed in the expected data and do its work
(on the volume that backs
                     // the snapshot)
                     volume.setFolder(destDetails.get(DiskTO.VOLUME_ID));
 
-                    _volService.connectVolumeToHost(volumeInfo, hostVO, dataStore);
+                    _volService.grantAccess(volumeInfo, hostVO, dataStore);
 
                     snapshotAndCopyAnswer = (SnapshotAndCopyAnswer)_agentMgr.send(hostVO.getId(),
snapshotAndCopyCommand);
                 }
@@ -244,18 +244,18 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase
{
                     try {
                         VolumeVO volume = _volumeDao.findById(volumeInfo.getId());
 
-                        // the Folder field is used by disconnectVolumeFromHost(VolumeInfo,
Host, DataStore) when that method
+                        // the Folder field is used by revokeAccess(VolumeInfo, Host, DataStore)
when that method
                         // disconnects the host(s) from the volume
                         // this Folder change is NOT to be written to the DB; it is only
temporarily used here so that
                         // the disconnect method can be passed in the expected data and do
its work (on the volume that backs
                         // the snapshot)
                         volume.setFolder(destDetails.get(DiskTO.VOLUME_ID));
 
-                        _volService.disconnectVolumeFromHost(volumeInfo, hostVO, dataStore);
+                        _volService.revokeAccess(volumeInfo, hostVO, dataStore);
 
                         // if sourceDetails != null, we need to disconnect the host(s) from
the volume
                         if (sourceDetails != null) {
-                            _volService.disconnectVolumeFromHost(volumeInfo, hostVO, dataStore);
+                            _volService.revokeAccess(volumeInfo, hostVO, dataStore);
                         }
                     }
                     catch (Exception ex) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index d97ad60..9174d89 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -167,22 +167,22 @@ public class VolumeServiceImpl implements VolumeService {
     }
 
     @Override
-    public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) {
         DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null;
 
         if (dataStoreDriver instanceof PrimaryDataStoreDriver) {
-            return ((PrimaryDataStoreDriver)dataStoreDriver).connectVolumeToHost(volumeInfo,
host, dataStore);
+            return ((PrimaryDataStoreDriver)dataStoreDriver).grantAccess(dataObject, host,
dataStore);
         }
 
         return false;
     }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
         DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null;
 
         if (dataStoreDriver instanceof PrimaryDataStoreDriver) {
-            ((PrimaryDataStoreDriver)dataStoreDriver).disconnectVolumeFromHost(volumeInfo,
host, dataStore);
+            ((PrimaryDataStoreDriver)dataStoreDriver).revokeAccess(dataObject, host, dataStore);
         }
     }
 
@@ -677,7 +677,7 @@ public class VolumeServiceImpl implements VolumeService {
             // refresh the volume from the DB
             volumeInfo = volFactory.getVolume(volumeInfo.getId(), destPrimaryDataStore);
 
-            connectVolumeToHost(volumeInfo, destHost, destPrimaryDataStore);
+            grantAccess(volumeInfo, destHost, destPrimaryDataStore);
 
             ManagedCreateBaseImageContext<CreateCmdResult> context = new ManagedCreateBaseImageContext<CreateCmdResult>(null,
volumeInfo,
                     destPrimaryDataStore, srcTemplateInfo, future);
@@ -712,7 +712,7 @@ public class VolumeServiceImpl implements VolumeService {
 
             volumeInfo.processEvent(Event.DestroyRequested);
 
-            disconnectVolumeFromHost(volumeInfo, destHost, destPrimaryDataStore);
+            revokeAccess(volumeInfo, destHost, destPrimaryDataStore);
 
             try {
                 AsyncCallFuture<VolumeApiResult> expungeVolumeFuture = expungeVolumeAsync(volumeInfo);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java
b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java
index 20c9289..23db12d 100755
--- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java
@@ -401,13 +401,13 @@ public class ElastistorPrimaryDataStoreDriver extends CloudStackPrimaryDataStore
     }
 
     @Override
-    public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) {
         // TODO Auto-generated method stub
         return false;
     }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
         // TODO Auto-generated method stub
 
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/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 bcc06b0..9421102 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
@@ -149,12 +149,12 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
     }
 
     @Override
-    public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) {
         return false;
     }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/plugins/storage/volume/nexenta/src/org/apache/cloudstack/storage/datastore/driver/NexentaPrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/nexenta/src/org/apache/cloudstack/storage/datastore/driver/NexentaPrimaryDataStoreDriver.java
b/plugins/storage/volume/nexenta/src/org/apache/cloudstack/storage/datastore/driver/NexentaPrimaryDataStoreDriver.java
index aff50e5..bae54f1 100644
--- a/plugins/storage/volume/nexenta/src/org/apache/cloudstack/storage/datastore/driver/NexentaPrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/nexenta/src/org/apache/cloudstack/storage/datastore/driver/NexentaPrimaryDataStoreDriver.java
@@ -58,12 +58,12 @@ public class NexentaPrimaryDataStoreDriver implements PrimaryDataStoreDriver
{
     private static final Logger logger = Logger.getLogger(NexentaPrimaryDataStoreDriver.class);
 
     @Override
-    public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) {
         return false;  //To change body of implemented methods use File | Settings | File
Templates.
     }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
         //To change body of implemented methods use File | Settings | File Templates.
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/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 4ade467..6ff62e9 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
@@ -82,10 +82,10 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
     }
 
     @Override
-    public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{ return false; }
+    public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) { return
false; }
 
     @Override
-    public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore)
{}
+    public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {}
 
     @Override
     public long getUsedBytes(StoragePool storagePool) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/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 94c9595..00fd761 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
@@ -126,8 +126,10 @@ public class SolidFirePrimaryDataStoreDriver implements PrimaryDataStoreDriver
{
     //     if the ID of volumeInfo in not in the VAG, add it (ModifyVolumeAccessGroup)
     // if the VAG doesn't exist, create it with the IQNs of the hosts and the ID of volumeInfo
(CreateVolumeAccessGroup)
     @Override
-    public synchronized boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore
dataStore)
+    public synchronized boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore)
     {
+        VolumeInfo volumeInfo = (VolumeInfo)dataObject;
+
         if (volumeInfo == null || host == null || dataStore == null) {
             return false;
         }
@@ -169,8 +171,10 @@ public class SolidFirePrimaryDataStoreDriver implements PrimaryDataStoreDriver
{
     // if the VAG exists
     //     remove the ID of volumeInfo from the VAG (ModifyVolumeAccessGroup)
     @Override
-    public synchronized void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore
dataStore)
+    public synchronized void revokeAccess(DataObject dataObject, Host host, DataStore dataStore)
     {
+        VolumeInfo volumeInfo = (VolumeInfo)dataObject;
+
         if (volumeInfo == null || host == null || dataStore == null) {
             return;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index e089b77..b70d753 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1654,7 +1654,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             // volume.getPoolId() should be null if the VM we are detaching the disk from
has never been started before
             DataStore dataStore = volume.getPoolId() != null ? dataStoreMgr.getDataStore(volume.getPoolId(),
DataStoreRole.Primary) : null;
 
-            volService.disconnectVolumeFromHost(volFactory.getVolume(volume.getId()), host,
dataStore);
+            volService.revokeAccess(volFactory.getVolume(volume.getId()), host, dataStore);
 
             return _volsDao.findById(volumeId);
         } else {
@@ -2163,10 +2163,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         // if we don't have a host, the VM we are attaching the disk to has never been started
before
         if (host != null) {
             try {
-                volService.connectVolumeToHost(volFactory.getVolume(volumeToAttach.getId()),
host, dataStore);
+                volService.grantAccess(volFactory.getVolume(volumeToAttach.getId()), host,
dataStore);
             }
             catch (Exception e) {
-                volService.disconnectVolumeFromHost(volFactory.getVolume(volumeToAttach.getId()),
host, dataStore);
+                volService.revokeAccess(volFactory.getVolume(volumeToAttach.getId()), host,
dataStore);
 
                 throw new CloudRuntimeException(e.getMessage());
             }
@@ -2211,7 +2211,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
                 answer = (AttachAnswer)_agentMgr.send(hostId, cmd);
             } catch (Exception e) {
                 if(host!=null) {
-                    volService.disconnectVolumeFromHost(volFactory.getVolume(volumeToAttach.getId()),
host, dataStore);
+                    volService.revokeAccess(volFactory.getVolume(volumeToAttach.getId()),
host, dataStore);
                 }
                 throw new CloudRuntimeException(errorMsg + " due to: " + e.getMessage());
             }
@@ -2250,7 +2250,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
                 }
             }
             if(host!= null) {
-                volService.disconnectVolumeFromHost(volFactory.getVolume(volumeToAttach.getId()),
host, dataStore);
+                volService.revokeAccess(volFactory.getVolume(volumeToAttach.getId()), host,
dataStore);
             }
             throw new CloudRuntimeException(errorMsg);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/57dacf99/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 2636096..fe7c32b 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -4905,7 +4905,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
 
                 // root.getPoolId() should be null if the VM we are detaching the disk from
has never been started before
                 DataStore dataStore = root.getPoolId() != null ? _dataStoreMgr.getDataStore(root.getPoolId(),
DataStoreRole.Primary) : null;
-                volumeMgr.disconnectVolumeFromHost(volFactory.getVolume(root.getId()), host,
dataStore);
+                volumeMgr.revokeAccess(volFactory.getVolume(root.getId()), host, dataStore);
             }
         }
     }


Mime
View raw message