[libvirt] Bug report 826704 - sanlock releases all resources on virsh detach-disk
Frido Roose
fr.roose at gmail.com
Mon Jul 9 09:53:57 UTC 2012
On Friday 8 June 2012 at 15:45, Daniel P. Berrange wrote:
>
> You are a little mixed up with the sanlock API naming here vs the hotplug
> hotunplug actions.
>
> The way sanlock works is that you do
>
> - Connect to sanlock
> - Register all the disks that will be operated on using
> virLockManagerSanlockAddResource
> - Invoke the acquire/inquire/release actions on sanlock
>
> In other words, using 'AddResource' is correct, even when
> releasing a resource/lease.
>
> The problem is that the usage of SANLK_REL_ALL is wrong. We should
> be using the res_args + res_count fields to pass the explicit list
> of disks, instead of releasing all of them.
>
You are absolutely right, I was confused about the naming.
I found some time this weekend to take a look into the code again and changed to code as you suggested.
I compiled and tested the patch, and the release of the resource looks fine now. Only the specific resource/disk is being removed from sanlock now, while the others stay registered.
You find the patch included in this message.
Thanks for the help!
BR,
Frido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-sanlock_release.patch
Type: application/octet-stream
Size: 630 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120709/09765506/attachment-0001.obj>
More information about the libvir-list
mailing list