CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root

volume with S3 as secondary storage.
(cherry picked from commit 402254337c)

Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
Min Chen 2014-02-03 12:16:19 -08:00 committed by Animesh Chaturvedi
parent 91ec548fc0
commit 8f63c2cf9c
1 changed files with 4 additions and 1 deletions

View File

@ -288,7 +288,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);
}