[libvirt] [PATCH 4/5] storage: Introduce storagePoolRefreshFailCleanup

Michal Privoznik mprivozn at redhat.com
Thu Sep 20 07:30:32 UTC 2018


On 09/12/2018 06:09 PM, John Ferlan wrote:
> Create a common pool refresh failure handling method as the
> same code is repeated multiple times.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/storage/storage_driver.c | 38 +++++++++++++++++-------------------
>  1 file changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
> index 5a8871bd07..8aa3191f7b 100644
> --- a/src/storage/storage_driver.c
> +++ b/src/storage/storage_driver.c
> @@ -79,6 +79,18 @@ static void storageDriverUnlock(void)
>  }
>  
>  
> +static void
> +storagePoolRefreshFailCleanup(virStorageBackendPtr backend,
> +                              virStoragePoolObjPtr obj,
> +                              const char *stateFile)
> +{
> +    if (stateFile)
> +        ignore_value(unlink(stateFile));

I was about to ask this in 1/5. Is this ignore_value() needed? Quick
`git grep' shows we are not consistent.

> +    if (backend->stopPool)
> +        backend->stopPool(obj);
> +}
> +

Michal




More information about the libvir-list mailing list