Pearl1594 commented on code in PR #14484:
URL: https://github.com/apache/cloudstack/pull/14484#discussion_r4697425828


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java:
##########
@@ -2109,13 +2117,7 @@ public Answer createSnapshot(final CreateObjectCommand 
cmd) {
                         newSnapshot.setPhysicalSize(snapshotSize);
                     }
                 } else if (primaryPool.getType() == StoragePoolType.CLVM || 
primaryPool.getType() == StoragePoolType.CLVM_NG) {
-                    if (primaryPool.getType() == StoragePoolType.CLVM_NG && 
snapshotTO.isKvmIncrementalSnapshot()) {
-                        if (secondaryPool == null) {
-                            String errorMsg = String.format("Incremental 
snapshots for CLVM_NG require secondary storage. " +
-                                    "Please configure secondary storage or 
disable incremental snapshots for volume [%s].", volume.getName());
-                            logger.error(errorMsg);
-                            return new CreateObjectAnswer(errorMsg);
-                        }
+                    if (isClvmNgIncremental) {
                         logger.info("Taking incremental snapshot of CLVM_NG 
volume [{}] using QCOW2 backup to secondary storage.", volume.getName());
                         newSnapshot = 
takeIncrementalVolumeSnapshotOfStoppedVm(snapshotTO, primaryPool, secondaryPool,
                                 imageStoreTo.getUrl(), snapshotName, volume, 
conn, cmd.getWait());

Review Comment:
   this is a false positive - there's a guard before. So no NPE.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to