Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
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
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)
{
struct _bhyveConn *driver;
virConnectPtr conn;
};
-
-void bhyveDriverLock(struct _bhyveConn *driver);
-void bhyveDriverUnlock(struct _bhyveConn *driver);