cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [38/50] [abbrv] git commit: updated refs/heads/reporter to 3e1816d
Date Mon, 27 Jul 2015 08:43:26 GMT
Fixed Coverity issue "Dereference null return value"

added a not null check and a CloudRuntimeException in case of null

Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>

This closes #617


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

Branch: refs/heads/reporter
Commit: 1f09b8c3bfdfee559d1735c8796daae16bf19e74
Parents: d8f37c5
Author: Maneesha P <maneesha.papireddygari@citrix.com>
Authored: Thu Jul 23 00:45:00 2015 +0530
Committer: Rajani Karuturi <rajanikaruturi@gmail.com>
Committed: Thu Jul 23 15:46:17 2015 +0530

----------------------------------------------------------------------
 .../wrapper/LibvirtBackupSnapshotCommandWrapper.java         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f09b8c3/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
index 25da046..ad33945 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtBackupSnapshotCommandWrapper.java
@@ -171,7 +171,11 @@ public final class LibvirtBackupSnapshotCommandWrapper extends CommandWrapper<Ba
                 final String snapshot = snapshotXML.format(args);
                 s_logger.debug(snapshot);
                 final DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
-                snap.delete(0);
+                if (snap != null) {
+                    snap.delete(0);
+                } else {
+                    throw new CloudRuntimeException("Unable to find vm snapshot with name
-" + snapshotName);
+                }
 
                 /*
                  * libvirt on RHEL6 doesn't handle resume event emitted from
@@ -203,4 +207,4 @@ public final class LibvirtBackupSnapshotCommandWrapper extends CommandWrapper<Ba
         }
         return new BackupSnapshotAnswer(command, true, null, snapshotRelPath + File.separator
+ snapshotName, true);
     }
-}
\ No newline at end of file
+}


Mime
View raw message