mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
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:
parent
a71341fad7
commit
fb48d87765
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -73,6 +73,3 @@ struct bhyveAutostartData {
|
||||
struct _bhyveConn *driver;
|
||||
virConnectPtr conn;
|
||||
};
|
||||
|
||||
void bhyveDriverLock(struct _bhyveConn *driver);
|
||||
void bhyveDriverUnlock(struct _bhyveConn *driver);
|
||||
|
Loading…
x
Reference in New Issue
Block a user