
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