You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by rhtyd <gi...@git.apache.org> on 2016/11/24 17:32:33 UTC

[GitHub] cloudstack pull request #1710: CLOUDSTACK-9538: FIX failure in Deleting Snap...

Github user rhtyd commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1710#discussion_r89532748
  
    --- Diff: engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java ---
    @@ -268,7 +268,9 @@ public boolean deleteSnapshot(Long snapshotId) {
                     SnapshotDataStoreVO snapshotOnPrimary = snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary);
                     if (snapshotOnPrimary != null) {
                         SnapshotInfo snapshotOnPrimaryInfo = snapshotDataFactory.getSnapshot(snapshotId, DataStoreRole.Primary);
    -                    if (((PrimaryDataStoreImpl)snapshotOnPrimaryInfo.getDataStore()).getPoolType() == StoragePoolType.RBD) {
    +                    long volumeId = snapshotOnPrimary.getVolumeId();
    +                    VolumeVO volumeVO = volumeDao.findById(volumeId);
    --- End diff --
    
    This will throw NPE, if snapshot has no primary volume id. Can there be such a case?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---