[libvirt] [PATCH 2/6] storage: Add storagePoolSetInactive

Ján Tomko jtomko at redhat.com
Fri Jun 24 13:26:27 UTC 2016


On Wed, Jun 22, 2016 at 08:12:12PM -0400, Cole Robinson wrote:
>This function handles newDef assignment and transient pool removal
>when an object is set inactive. The return value notifies callers
>if the pool was removed, so they know not to try to access the
>pool object anymore.
>
>Some users don't gain anything from it at this point, but future
>patches will improve that.
>---
> src/storage/storage_driver.c | 54 +++++++++++++++++++++++++++++++-------------
> 1 file changed, 38 insertions(+), 16 deletions(-)
>
>diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
>index 3bdc13f..c7ffea8 100644
>--- a/src/storage/storage_driver.c
>+++ b/src/storage/storage_driver.c
>@@ -76,6 +76,32 @@ static void storageDriverUnlock(void)
>     virMutexUnlock(&driver->lock);
> }
>
>+/*
>+ * storagePoolSetInactive:
>+ * Helper for setting a pool object as 'inactive'. Handles reassigning
>+ * newDef for persistent pools, and removing and freeing the object
>+ * for transient pools.
>+ *
>+ * Returns true if pool was removed from driver->pools
>+ */
>+static bool
>+storagePoolSetInactive(virStoragePoolObjPtr pool)

Can be void (virStoragePoolObjPtr *pool) and clear the original pointer
if it was freed.

Jan




More information about the libvir-list mailing list