cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [03/50] git commit: updated refs/heads/master to 0b83559
Date Wed, 29 Apr 2015 05:43:47 GMT
volume upload: Size is listed as zero for uploaded volumes
Updating the virtual size for template/volume when upload is completed.


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

Branch: refs/heads/master
Commit: dc870b5114a0bf864cc4477cc800e6b09a9e3299
Parents: 075c841
Author: Koushik Das <koushik@apache.org>
Authored: Thu Feb 19 17:11:51 2015 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Thu Feb 19 17:13:47 2015 +0530

----------------------------------------------------------------------
 .../com/cloud/storage/ImageStoreUploadMonitorImpl.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc870b51/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java b/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
index b2cc5d9..bbc650f 100755
--- a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
@@ -280,7 +280,12 @@ public class ImageStoreUploadMonitorImpl extends ManagerBase implements
ImageSto
                             tmpVolumeDataStore.setPhysicalSize(answer.getPhysicalSize());
                             tmpVolumeDataStore.setSize(answer.getVirtualSize());
                             tmpVolumeDataStore.setDownloadPercent(100);
+
+                            VolumeVO volumeUpdate = _volumeDao.createForUpdate();
+                            volumeUpdate.setSize(answer.getVirtualSize());
+                            _volumeDao.update(tmpVolume.getId(), volumeUpdate);
                             stateMachine.transitTo(tmpVolume, Event.OperationSucceeded, null,
_volumeDao);
+
                             if (s_logger.isDebugEnabled()) {
                                 s_logger.debug("Volume " + tmpVolume.getUuid() + " uploaded
successfully");
                             }
@@ -344,7 +349,12 @@ public class ImageStoreUploadMonitorImpl extends ManagerBase implements
ImageSto
                             tmpTemplateDataStore.setPhysicalSize(answer.getPhysicalSize());
                             tmpTemplateDataStore.setSize(answer.getVirtualSize());
                             tmpTemplateDataStore.setDownloadPercent(100);
+
+                            VMTemplateVO templateUpdate = _templateDao.createForUpdate();
+                            templateUpdate.setSize(answer.getVirtualSize());
+                            _templateDao.update(tmpTemplate.getId(), templateUpdate);
                             stateMachine.transitTo(tmpTemplate, VirtualMachineTemplate.Event.OperationSucceeded,
null, _templateDao);
+
                             if (s_logger.isDebugEnabled()) {
                                 s_logger.debug("Template " + tmpTemplate.getUuid() + " uploaded
successfully");
                             }


Mime
View raw message