cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aprat...@apache.org
Subject git commit: For assignVM, marking older snapshots removed in db
Date Thu, 23 Aug 2012 06:52:26 GMT
Updated Branches:
  refs/heads/master 6f26894ea -> 3298a481a


For assignVM, marking older snapshots removed in db


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

Branch: refs/heads/master
Commit: 3298a481a8099a717583554196f8e92d4206e344
Parents: 6f26894
Author: Abhinandan Prateek <aprateek@apache.org>
Authored: Thu Aug 23 12:22:02 2012 +0530
Committer: Abhinandan Prateek <aprateek@apache.org>
Committed: Thu Aug 23 12:22:02 2012 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3298a481/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 f1f32c3..3af50a1 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3463,6 +3463,11 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService,
Manager
             _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.volume);
             _usageEventDao.persist(new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(),
volume.getDataCenterId(), volume.getId(), volume.getName(),
                     volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize()));
+            //snapshots: mark these removed in db
+            List<SnapshotVO> snapshots = _snapshotDao.listByVolumeIdIncludingRemoved(volume.getId());
+            for (SnapshotVO snapshot: snapshots){
+                _snapshotDao.remove(snapshot.getId());
+            }
         }
 
         _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.user_vm);


Mime
View raw message