Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   Deal with zFCP multipath devices in the filter UI (#618535) (http://www.linux-archive.org/fedora-user/564979-deal-zfcp-multipath-devices-filter-ui-618535-a.html)

David Cantrell 08-16-2011 07:52 PM

Deal with zFCP multipath devices in the filter UI (#618535)
 
Handle zFCP multipath devices correctly in the filter UI. When you add
the LUN the first time, whatever path you choose, the filter UI treats
it as a singlepath disk and it shows up in the Other SAN Devices list.
Once you add another path for the zFCP LUN, you get the multipath
device. But the invalid singlepath entry is still there, even though we
don't want to see it.

Since our Add Advanced Storage dialog only allows us to add one LUN path
at a time for multipath storage, we need to account for instances where
a LUN path may initially show up as a singlepath storage device then
later show up as multipath storage. In those cases, invalidate
_cachedDevices and remove the singlepath instance from the store used by
the UI.
---
iw/filter_gui.py | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 4f05f31..d6dac34 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -464,14 +464,17 @@ class FilterWindow(InstallWindow):
(new_raids, new_nonraids) = self.split_list(lambda d: isRAID(d) and not isCCISS(d),
new_singlepaths)

- nonraids = filter(lambda d: d not in self._cachedDevices, new_nonraids)
- raids = filter(lambda d: d not in self._cachedRaidDevices, new_raids)
-
# The end result of the loop below is that mpaths is a list of lists of
# components, just like new_mpaths. That's what populate expects.
mpaths = []
for mp in new_mpaths:
for d in mp:
+ # If any of the multipath components are in the nonraids cache,
+ # invalidate that cache and remove it from the UI store.
+ if d in self._cachedDevices:
+ self.depopulate(d)
+ del(self._cachedDevices[:])
+
# If all components of this multipath device are in the
# cache, skip it. Otherwise, it's a new device and needs to
# be populated into the UI.
@@ -479,6 +482,9 @@ class FilterWindow(InstallWindow):
mpaths.append(mp)
break

+ nonraids = filter(lambda d: d not in self._cachedDevices, new_nonraids)
+ raids = filter(lambda d: d not in self._cachedRaidDevices, new_raids)
+
self.populate(nonraids, mpaths, raids, activeByDefault=True)

# Make sure to update the size label at the bottom.
@@ -671,6 +677,12 @@ class FilterWindow(InstallWindow):

return self.vbox

+ def depopulate(self, component):
+ for row in self.store:
+ if row[4] == component['DEVNAME']:
+ self.store.remove(row.iter)
+ return
+
def populate(self, nonraids, mpaths, raids, activeByDefault=False):
def _addTuple(tuple):
global totalDevices, totalSize
--
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 05:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.