From 8d7e3a723da9a885bd0a020a04bd68c9809bf315 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 25 Feb 2022 14:12:46 +0100 Subject: [PATCH] remote_driver: Return 'virLockGuard' from 'remoteDriverLock' The function currently didn't have a return value. Returning the 'virLockGuard' struct allows the callers to use automatic unlocking of the mutex. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/remote/remote_driver.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b0dba9057b..8310326ad0 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -105,9 +105,17 @@ enum { }; -static void remoteDriverLock(struct private_data *driver) +/** + * remoteDriverLock: + * @driver: private data of the remote driver + * + * Locks the internal mutex of the private driver. Callers may optionally use + * the returned virLockGuard struct to automatically unlock the driver. + */ +static virLockGuard +remoteDriverLock(struct private_data *driver) { - virMutexLock(&driver->lock); + return virLockGuardLock(&driver->lock); } static void remoteDriverUnlock(struct private_data *driver) -- 2.39.5