You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/02/03 21:23:11 UTC

git commit: updated refs/heads/master to b35eb04

Updated Branches:
  refs/heads/master 9778481d8 -> b35eb04de


CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root
volume with S3 as secondary storage.

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

Branch: refs/heads/master
Commit: b35eb04de3fd26dbbb57124dd4da51c4ffd27486
Parents: 9778481
Author: Min Chen <mi...@citrix.com>
Authored: Mon Feb 3 12:16:19 2014 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Mon Feb 3 12:16:19 2014 -0800

----------------------------------------------------------------------
 .../org/apache/cloudstack/storage/snapshot/SnapshotObject.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b35eb04d/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
index 9cac20d..669a075 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
@@ -286,7 +286,10 @@ public class SnapshotObject implements SnapshotInfo {
             } else if (answer instanceof CopyCmdAnswer) {
                 SnapshotObjectTO snapshotTO = (SnapshotObjectTO)((CopyCmdAnswer)answer).getNewData();
                 snapshotStore.setInstallPath(snapshotTO.getPath());
-                snapshotStore.setSize(snapshotTO.getPhysicalSize());
+                if (snapshotTO.getPhysicalSize() != null) {
+                    // For S3 delta snapshot, physical size is currently not set
+                    snapshotStore.setSize(snapshotTO.getPhysicalSize());
+                }
                 if (snapshotTO.getParentSnapshotPath() == null) {
                     snapshotStore.setParentSnapshotId(0L);
                 }