[PATCH] Fix return value in lock manager hotplug methods

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Refactoring of the lock manager hotplug methods lost the
ret = 0 assignment for successful return path

* src/locking/domain_lock.c: Add missing ret = 0 assignments
---
 src/locking/domain_lock.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/locking/domain_lock.c b/src/locking/domain_lock.c
index f0a11b7..771ed53 100644
--- a/src/locking/domain_lock.c
+++ b/src/locking/domain_lock.c
@@ -221,6 +221,8 @@ int virDomainLockDiskAttach(virLockManagerPluginPtr plugin,
     if (virLockManagerAcquire(lock, NULL, 0) < 0)
         goto cleanup;
 
+    ret = 0;
+
 cleanup:
     virLockManagerFree(lock);
 
@@ -240,6 +242,8 @@ int virDomainLockDiskDetach(virLockManagerPluginPtr plugin,
     if (virLockManagerRelease(lock, NULL, 0) < 0)
         goto cleanup;
 
+    ret = 0;
+
 cleanup:
     virLockManagerFree(lock);
 
@@ -260,6 +264,8 @@ int virDomainLockLeaseAttach(virLockManagerPluginPtr plugin,
     if (virLockManagerAcquire(lock, NULL, 0) < 0)
         goto cleanup;
 
+    ret = 0;
+
 cleanup:
     virLockManagerFree(lock);
 
@@ -279,6 +285,8 @@ int virDomainLockLeaseDetach(virLockManagerPluginPtr plugin,
     if (virLockManagerRelease(lock, NULL, 0) < 0)
         goto cleanup;
 
+    ret = 0;
+
 cleanup:
     virLockManagerFree(lock);
 
-- 
1.7.5.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]