mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
storage: 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
69d793a0bc
commit
a29db4fbed
@ -65,16 +65,6 @@ struct _virStorageVolStreamInfo {
|
||||
char *vol_path;
|
||||
};
|
||||
|
||||
static void storageDriverLock(void)
|
||||
{
|
||||
virMutexLock(&driver->lock);
|
||||
}
|
||||
static void storageDriverUnlock(void)
|
||||
{
|
||||
virMutexUnlock(&driver->lock);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
storagePoolRefreshFailCleanup(virStorageBackend *backend,
|
||||
virStoragePoolObj *obj,
|
||||
@ -348,14 +338,13 @@ storageStateReload(void)
|
||||
if (!driver)
|
||||
return -1;
|
||||
|
||||
storageDriverLock();
|
||||
virStoragePoolObjLoadAllState(driver->pools,
|
||||
driver->stateDir);
|
||||
virStoragePoolObjLoadAllConfigs(driver->pools,
|
||||
driver->configDir,
|
||||
driver->autostartDir);
|
||||
storageDriverAutostart();
|
||||
storageDriverUnlock();
|
||||
VIR_WITH_MUTEX_LOCK_GUARD(&driver->lock) {
|
||||
virStoragePoolObjLoadAllState(driver->pools, driver->stateDir);
|
||||
virStoragePoolObjLoadAllConfigs(driver->pools,
|
||||
driver->configDir,
|
||||
driver->autostartDir);
|
||||
storageDriverAutostart();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user