Re: [PATCH 2/2] sanlock: don't fail with unregistered domains

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

 



On Tue, May 13, 2014 at 07:25:29AM -0400, John Ferlan wrote:
On 05/12/2014 09:37 AM, Martin Kletzander wrote:
When a domain was started without registration in sanlock, but libvirt
was restarted after that, most of the operations failed due to
contacting sanlock about that process.  E.g. migration could not be
performed because the locks couldn't be released (or inquired before a
release).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1088034

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/locking/lock_driver_sanlock.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index 01441a0..5bc72ba 100644
[...]
@@ -915,6 +929,9 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
             goto error;
         }

+        /* Mark the pid as registered */
+        priv->registered = true;
+
         if (action != VIR_DOMAIN_LOCK_FAILURE_DEFAULT) {
             char uuidstr[VIR_UUID_STRING_BUFLEN];
             virUUIDFormat(priv->vm_uuid, uuidstr);
@@ -922,6 +939,9 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
                                                         uuidstr, action) < 0)
                 goto error;
         }
+    } else if (!priv->registered) {
+        VIR_DEBUG("Process not registered, not acquiring lock");
+        return 0;

Coverity found an issue regarding 'opt' not being VIR_FREE()'d


Oh, thanks for finding that, this part should've been moved in the
previous patch as well.  I'll post a follow-up fixing it since I've
pushed the patches already.

Martin

Attachment: signature.asc
Description: Digital signature

--
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]