From a58cb1ac40b1af53af881c3d1901240cc07853bc Mon Sep 17 00:00:00 2001 From: Frido Roose Date: Mon, 13 Aug 2012 12:54:38 +0200 Subject: [PATCH] Release only specific sanlock resource This is a patch for bug 826704 All sanlock resources get released when hot-dettaching a disk from the domain because virLockManagerSanlockRelease uses the wrong function parameters/flags. With the patch only the resources that should be released are cleaned up. Signed-off-by: Frido Roose --- src/locking/lock_driver_sanlock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c index 7c71af3f0c..9ec99dd7d4 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -814,7 +814,7 @@ static int virLockManagerSanlockRelease(virLockManagerPtr lock, unsigned int flags) { virLockManagerSanlockPrivatePtr priv = lock->privateData; - int res_count; + int res_count = priv->res_count; int rv; virCheckFlags(0, -1); @@ -834,7 +834,8 @@ static int virLockManagerSanlockRelease(virLockManagerPtr lock, VIR_FREE(*state); } - if ((rv = sanlock_release(-1, priv->vm_pid, SANLK_REL_ALL, 0, NULL)) < 0) { + if ((rv = sanlock_release(-1, priv->vm_pid, 0, res_count, + priv->res_args)) < 0) { if (rv <= -200) virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to release lock: error %d"), rv);