cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/object_store to 0ce01e5
Date Mon, 13 May 2013 23:46:29 GMT
Updated Branches:
  refs/heads/object_store a7480530f -> 0ce01e56d


set template size when creating template from snapshot


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

Branch: refs/heads/object_store
Commit: 0ce01e56dbb4ec83383f43932da5a66f1b7280c6
Parents: a748053
Author: Edison Su <sudison@gmail.com>
Authored: Mon May 13 16:45:03 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Mon May 13 16:45:03 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/storage/to/TemplateObjectTO.java    |    9 +++++++++
 .../storage/image/store/TemplateObject.java        |    1 +
 .../resource/NfsSecondaryStorageResource.java      |    3 ++-
 3 files changed, 12 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ce01e56/engine/api/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java b/engine/api/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
index 14577ef..9e7e9ef 100644
--- a/engine/api/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
@@ -39,6 +39,7 @@ public class TemplateObjectTO implements DataTO {
     private  DataStoreTO imageDataStore;
     private  String name;
     private String guestOsType;
+    private Long size;
 
     public TemplateObjectTO() {
 
@@ -159,4 +160,12 @@ public class TemplateObjectTO implements DataTO {
     public void setGuestOsType(String guestOsType) {
         this.guestOsType = guestOsType;
     }
+
+	public Long getSize() {
+		return size;
+	}
+
+	public void setSize(Long size) {
+		this.size = size;
+	}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ce01e56/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
index 12e29e7..cd94704 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
@@ -226,6 +226,7 @@ public class TemplateObject implements TemplateInfo {
                     if (this.getDataStore().getRole() == DataStoreRole.Image) {
                         VMTemplateVO templateVO = this.imageDao.findById(this.getId());
                         templateVO.setFormat(newTemplate.getFormat());
+                        templateVO.setSize(newTemplate.getSize());
                         this.imageDao.update(templateVO.getId(), templateVO);
                     }
         		}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ce01e56/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index fcd3481..c93b99a 100755
--- a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -367,10 +367,11 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
             loc.create(1, true, templateName);
             loc.addFormat(info);
             loc.save();
-
+            TemplateProp prop = loc.getTemplateInfo();
             TemplateObjectTO newTemplate = new TemplateObjectTO();
             newTemplate.setPath(destData.getPath() + File.separator + templateName);
             newTemplate.setFormat(ImageFormat.VHD);
+            newTemplate.setSize(prop.getSize());
             return new CopyCmdAnswer(newTemplate);
         } catch (ConfigurationException e) {
             s_logger.debug("Failed to create template from snapshot: " + e.toString());


Mime
View raw message