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 <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa 2022-02-25 14:12:46 +01:00
parent 1be393d9ad
commit 8d7e3a723d

View File

@ -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)