bhyve_driver: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2022-02-07 10:42:57 +01:00
parent a71341fad7
commit fb48d87765
3 changed files with 2 additions and 20 deletions

View File

@ -85,11 +85,8 @@ virBhyveLoadDriverConfig(struct _virBhyveDriverConfig *cfg,
struct _virBhyveDriverConfig *
virBhyveDriverGetConfig(struct _bhyveConn *driver)
{
struct _virBhyveDriverConfig *cfg;
bhyveDriverLock(driver);
cfg = virObjectRef(driver->config);
bhyveDriverUnlock(driver);
return cfg;
VIR_LOCK_GUARD lock = virLockGuardLock(&driver->lock);
return virObjectRef(driver->config);
}
static void

View File

@ -70,18 +70,6 @@ VIR_LOG_INIT("bhyve.bhyve_driver");
struct _bhyveConn *bhyve_driver = NULL;
void
bhyveDriverLock(struct _bhyveConn *driver)
{
virMutexLock(&driver->lock);
}
void
bhyveDriverUnlock(struct _bhyveConn *driver)
{
virMutexUnlock(&driver->lock);
}
static int
bhyveAutostartDomain(virDomainObj *vm, void *opaque)
{

View File

@ -73,6 +73,3 @@ struct bhyveAutostartData {
struct _bhyveConn *driver;
virConnectPtr conn;
};
void bhyveDriverLock(struct _bhyveConn *driver);
void bhyveDriverUnlock(struct _bhyveConn *driver);