You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/12/20 21:43:43 UTC
git commit: updated refs/heads/4.3 to 6e4192d
Updated Branches:
refs/heads/4.3 ddc3d87b4 -> 6e4192dc4
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/6e4192dc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6e4192dc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6e4192dc
Branch: refs/heads/4.3
Commit: 6e4192dc43dae2547c8c719bf5a9543578e30a89
Parents: ddc3d87
Author: Edison Su <su...@gmail.com>
Authored: Fri Dec 20 12:43:06 2013 -0800
Committer: Edison Su <su...@gmail.com>
Committed: Fri Dec 20 12:43:06 2013 -0800
----------------------------------------------------------------------
.../storage/resource/NfsSecondaryStorageResource.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6e4192dc/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 999acc6..b158fce 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
@@ -446,7 +446,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();