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/master to 9947e68
Date Fri, 20 Dec 2013 20:45:20 GMT
Updated Branches:
  refs/heads/master e52a4d930 -> 9947e688c


CS-18564: create template from snapshot failed, due to the volume(the
    snapshot created from) is deleted.


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

Branch: refs/heads/master
Commit: 9947e688c4d4046774d9a14cb28151cb757a16f5
Parents: e52a4d9
Author: Edison Su <sudison@gmail.com>
Authored: Fri Dec 20 12:43:06 2013 -0800
Committer: Edison Su <sudison@gmail.com>
Committed: Fri Dec 20 12:45:02 2013 -0800

----------------------------------------------------------------------
 .../storage/resource/NfsSecondaryStorageResource.java       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9947e688/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 00c1aac..6964bf4 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
@@ -444,7 +444,14 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements
S
             File srcFile = getFile(srcData.getPath(), srcDataStore.getUrl());
             File destFile = getFile(destData.getPath(), destDataStore.getUrl());
 
-            ImageFormat srcFormat = srcData.getVolume().getFormat();
+            VolumeObjectTO volumeObjectTO = srcData.getVolume();
+            ImageFormat srcFormat = null;
+            //TODO: the image format should be stored in snapshot table, instead of getting
from volume
+            if (volumeObjectTO != null) {
+                srcFormat = volumeObjectTO.getFormat();
+            } else {
+                srcFormat = ImageFormat.QCOW2;
+            }
 
             // get snapshot file name
             String templateName = srcFile.getName();


Mime
View raw message