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

volume with S3 as secondary storage.
This commit is contained in:
Min Chen 2014-02-03 12:16:19 -08:00
parent 9778481d85
commit b35eb04de3

View File

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