
On 09/20/2018 03:30 AM, Michal Privoznik wrote:
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@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.
True, in both cases though it's a copy of existing code. I'm assuming it's a Coverity thing though... As a test I just removed all ignore_value from unlink and ran a Coverity build with no issues. I'll generate and post a patch to remove them all shortly. Tks for the review - John
+ if (backend->stopPool) + backend->stopPool(obj); +} +
Michal