mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +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 *
|
struct _virBhyveDriverConfig *
|
||||||
virBhyveDriverGetConfig(struct _bhyveConn *driver)
|
virBhyveDriverGetConfig(struct _bhyveConn *driver)
|
||||||
{
|
{
|
||||||
struct _virBhyveDriverConfig *cfg;
|
VIR_LOCK_GUARD lock = virLockGuardLock(&driver->lock);
|
||||||
bhyveDriverLock(driver);
|
return virObjectRef(driver->config);
|
||||||
cfg = virObjectRef(driver->config);
|
|
||||||
bhyveDriverUnlock(driver);
|
|
||||||
return cfg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -70,18 +70,6 @@ VIR_LOG_INIT("bhyve.bhyve_driver");
|
|||||||
|
|
||||||
struct _bhyveConn *bhyve_driver = NULL;
|
struct _bhyveConn *bhyve_driver = NULL;
|
||||||
|
|
||||||
void
|
|
||||||
bhyveDriverLock(struct _bhyveConn *driver)
|
|
||||||
{
|
|
||||||
virMutexLock(&driver->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
bhyveDriverUnlock(struct _bhyveConn *driver)
|
|
||||||
{
|
|
||||||
virMutexUnlock(&driver->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bhyveAutostartDomain(virDomainObj *vm, void *opaque)
|
bhyveAutostartDomain(virDomainObj *vm, void *opaque)
|
||||||
{
|
{
|
||||||
|
@ -73,6 +73,3 @@ struct bhyveAutostartData {
|
|||||||
struct _bhyveConn *driver;
|
struct _bhyveConn *driver;
|
||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
};
|
};
|
||||||
|
|
||||||
void bhyveDriverLock(struct _bhyveConn *driver);
|
|
||||||
void bhyveDriverUnlock(struct _bhyveConn *driver);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user