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

Martin Kletzander mkletzan at redhat.com
Tue May 13 11:38:43 UTC 2014


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 at redhat.com>
>> ---
>>  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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140513/b42a2ac8/attachment-0001.sig>


More information about the libvir-list mailing list