render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
7a3408
From 60e7b3d9a02801ac76478abccec00809b6764a5a Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <60e7b3d9a02801ac76478abccec00809b6764a5a@dist-git>
7a3408
From: Erik Skultety <eskultet@redhat.com>
7a3408
Date: Wed, 8 Jul 2015 15:30:04 +0200
7a3408
Subject: [PATCH] storage: Fix regression in storagePoolUpdateAllState
7a3408
7a3408
Commit 2a31c5f0 introduced support for storage pool state XMLs, however
7a3408
it also introduced a regression:
7a3408
7a3408
if (!virstoragePoolObjIsActive(pool)) {
7a3408
    virStoragePoolObjUnlock(pool);
7a3408
    continue;
7a3408
}
7a3408
7a3408
The idea behind this was that since we've got state XMLs and the pool
7a3408
wasn't marked as active by autostart routine (if the autostart flag had been
7a3408
set earlier), the pool is inactive and we can leave it be and continue with
7a3408
other pools. However, filesystem type pools like fs,dir, possibly netfs are
7a3408
supposed to be active if the filesystem is mounted on the host. And this is
7a3408
exactly where the regression occurs, e.g. pool type 'dir' which has been
7a3408
previously destroyed and marked as !autostart gets filtered out
7a3408
by the condition above.
7a3408
The resolution should be simply to remove the condition completely,
7a3408
all pools will get their 'active' flag updated by check callback and if
7a3408
they do not support such callback, the logic doesn't change and such
7a3408
pools will be inactive by default (e.g. RBD, even if a state XML exists).
7a3408
7a3408
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238610
7a3408
7a3408
(cherry picked from commit f92f31213a718e194323718cb3c667129ef1d4e8)
7a3408
Signed-off-by: Erik Skultety <eskultet@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/storage/storage_driver.c | 5 -----
7a3408
 1 file changed, 5 deletions(-)
7a3408
7a3408
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
7a3408
index e600514..d3cdbc5 100644
7a3408
--- a/src/storage/storage_driver.c
7a3408
+++ b/src/storage/storage_driver.c
7a3408
@@ -142,11 +142,6 @@ storagePoolUpdateAllState(void)
7a3408
         virStoragePoolObjPtr pool = driver->pools.objs[i];
7a3408
 
7a3408
         virStoragePoolObjLock(pool);
7a3408
-        if (!virStoragePoolObjIsActive(pool)) {
7a3408
-            virStoragePoolObjUnlock(pool);
7a3408
-            continue;
7a3408
-        }
7a3408
-
7a3408
         storagePoolUpdateState(pool);
7a3408
         virStoragePoolObjUnlock(pool);
7a3408
     }
7a3408
-- 
7a3408
2.4.5
7a3408