mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 13:17:58 +03:00
virStorageVolObjEndAPI: Remove
This allows a later patch to replace virObjectLock/Unlock pairs with automatic mutex management code. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8283450370
commit
d12417de63
@ -138,17 +138,6 @@ virStorageVolObjNew(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
virStorageVolObjEndAPI(virStorageVolObj **obj)
|
|
||||||
{
|
|
||||||
if (!*obj)
|
|
||||||
return;
|
|
||||||
|
|
||||||
virObjectUnlock(*obj);
|
|
||||||
g_clear_pointer(obj, virObjectUnref);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virStorageVolObjDispose(void *opaque)
|
virStorageVolObjDispose(void *opaque)
|
||||||
{
|
{
|
||||||
@ -660,7 +649,8 @@ virStoragePoolObjAddVol(virStoragePoolObj *obj,
|
|||||||
|
|
||||||
volobj->voldef = voldef;
|
volobj->voldef = voldef;
|
||||||
|
|
||||||
virStorageVolObjEndAPI(&volobj);
|
virObjectUnlock(volobj);
|
||||||
|
virObjectUnref(volobj);
|
||||||
virObjectRWUnlock(volumes);
|
virObjectRWUnlock(volumes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -689,8 +679,8 @@ virStoragePoolObjRemoveVol(virStoragePoolObj *obj,
|
|||||||
g_hash_table_remove(volumes->objsKey, voldef->key);
|
g_hash_table_remove(volumes->objsKey, voldef->key);
|
||||||
g_hash_table_remove(volumes->objsName, voldef->name);
|
g_hash_table_remove(volumes->objsName, voldef->name);
|
||||||
g_hash_table_remove(volumes->objsPath, voldef->target.path);
|
g_hash_table_remove(volumes->objsPath, voldef->target.path);
|
||||||
virStorageVolObjEndAPI(&volobj);
|
virObjectUnlock(volobj);
|
||||||
|
virObjectUnref(volobj);
|
||||||
virObjectRWUnlock(volumes);
|
virObjectRWUnlock(volumes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user