mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
virStoragePoolUpdateInactive: Don't call virStoragePoolObjEndAPI
There is no need for this function to call virStoragePoolObjEndAPI(). The object is perfectly usable after return from this function. In fact, all callers will call virStoragePoolObjEndAPI() eventually. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
62ec38518f
commit
c7df2437d2
@ -113,20 +113,17 @@ storagePoolRefreshImpl(virStorageBackendPtr backend,
|
||||
|
||||
/**
|
||||
* virStoragePoolUpdateInactive:
|
||||
* @objptr: pointer to a variable holding the pool object pointer
|
||||
* @obj: pool object
|
||||
*
|
||||
* This function is supposed to be called after a pool becomes inactive. The
|
||||
* function switches to the new config object for persistent pools. Inactive
|
||||
* pools are removed.
|
||||
*/
|
||||
static void
|
||||
virStoragePoolUpdateInactive(virStoragePoolObjPtr *objptr)
|
||||
virStoragePoolUpdateInactive(virStoragePoolObjPtr obj)
|
||||
{
|
||||
virStoragePoolObjPtr obj = *objptr;
|
||||
|
||||
if (!virStoragePoolObjGetConfigFile(obj)) {
|
||||
virStoragePoolObjRemove(driver->pools, obj);
|
||||
virStoragePoolObjEndAPI(objptr);
|
||||
} else if (virStoragePoolObjGetNewDef(obj)) {
|
||||
virStoragePoolObjDefUseNewDef(obj);
|
||||
}
|
||||
@ -177,7 +174,7 @@ storagePoolUpdateStateCallback(virStoragePoolObjPtr obj,
|
||||
virStoragePoolObjSetActive(obj, active);
|
||||
|
||||
if (!virStoragePoolObjIsActive(obj))
|
||||
virStoragePoolUpdateInactive(&obj);
|
||||
virStoragePoolUpdateInactive(obj);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1087,7 +1084,7 @@ storagePoolDestroy(virStoragePoolPtr pool)
|
||||
|
||||
virStoragePoolObjSetActive(obj, false);
|
||||
|
||||
virStoragePoolUpdateInactive(&obj);
|
||||
virStoragePoolUpdateInactive(obj);
|
||||
|
||||
ret = 0;
|
||||
|
||||
@ -1205,7 +1202,7 @@ storagePoolRefresh(virStoragePoolPtr pool,
|
||||
0);
|
||||
virStoragePoolObjSetActive(obj, false);
|
||||
|
||||
virStoragePoolUpdateInactive(&obj);
|
||||
virStoragePoolUpdateInactive(obj);
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user