[PATCH f13-branch] filter_gui.py: fixup isProtected changes for biosraid and mpath (#581820)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 8e62952a0e52d9ac5df781eb2f4ff5915208602b causes a number of
issues for biosraid / mpath:
1) For biosraid it passes the raidset name to _active, but _active
   expects a udev info dict now
2) _active now takes the name to compare to exclusivedisks from the passed
   udev info dict, but for biosraid and mpath the name stored in exclusiveDisks
   is not the member udev name, but the name of the higher level device
   (Note the code before the above commit already got this wrong for the
    mpath case)

This patch fixes this by:
1) Passing the fake udev info data for biosraid sets to _active and
   to _isProtected (it adds a sysfs_path entry to the fake data for this).
   This fixes both above problems for biosraid
2) Creating fake udev info data for mpath, setting the name of that
   to the name of the higher level device and using that as _Active
   and _isProtected argument. By also storing this info dict into to
   store, we can can also drop the special mpath case in getNext()

Note 1: This also fixes the miss merge of commit
8e62952a0e52d9ac5df781eb2f4ff5915208602b on F-13 branch, fixing #581820

Note 2: This depends on also cherry picking
6a289692b304c8423cfebca16faedfd8feab8b44 to F-13 branch
---
 iw/filter_gui.py |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 37de9c7..2e9f34d 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -402,10 +402,7 @@ class FilterWindow(InstallWindow):
         # are in the list.
         selected = set()
         for dev in self.pages[0].ds.getSelected():
-            if udev_device_is_multipath_member(dev[OBJECT_COL]):
-                selected.add(udev_device_get_multipath_name(dev[OBJECT_COL]))
-            else:
-                selected.add(udev_device_get_name(dev[OBJECT_COL]))
+            selected.add(udev_device_get_name(dev[OBJECT_COL]))
 
         if len(selected) == 0:
             self.anaconda.intf.messageWindow(_("Error"),
@@ -630,10 +627,12 @@ class FilterWindow(InstallWindow):
 
             return False
 
-        def _active(name):
+        def _active(info):
             if _isProtected(info):
                 return True
 
+            name = udev_device_get_name(info)
+
             if self.anaconda.storage.exclusiveDisks and \
                name in self.anaconda.storage.exclusiveDisks:
                 return True
@@ -689,6 +688,7 @@ class FilterWindow(InstallWindow):
                 for d in raids:
                     if udev_device_get_name(d) in members:
                         fstype = udev_device_get_format(d)
+                        sysfs_path = udev_device_get_sysfs_path(d)
                         break
 
                 # Skip this set if none of its members are in the raids list
@@ -701,10 +701,11 @@ class FilterWindow(InstallWindow):
                 # a way that's useful to the filtering UI.  So we need to fake
                 # that data now so we have something to put into the store.
                 data = {"XXX_SIZE": size, "ID_FS_TYPE": fstype,
-                        "DM_NAME": rs.name, "name": rs.name}
+                        "DM_NAME": rs.name, "name": rs.name,
+                        "sysfs_path": sysfs_path}
 
                 model = "BIOS RAID set (%s)" % rs.rs.set_type
-                tuple = (data, True, _active(rs.name), _isProtected(d), rs.name,
+                tuple = (data, True, _active(data), _isProtected(data), rs.name,
                          model, str(size) + " MB", "", "", "", "", "", "", "", "")
                 _addTuple(tuple)
 
@@ -729,7 +730,11 @@ class FilterWindow(InstallWindow):
             # However, we do need all the paths making up this multipath set.
             paths = "\n".join(map(udev_device_get_name, mpath))
 
-            tuple = (mpath[0], True, _active(mpath[0]), _isProtected(mpath[0]),
+            # We use a copy here, so as to not modify the original udev info
+            # dict as that would break NameCache matching
+            data = mpath[0].copy()
+            data["name"] = udev_device_get_multipath_name(mpath[0])
+            tuple = (data, True, _active(data), _isProtected(data),
                      udev_device_get_multipath_name(mpath[0]), model,
                      str(mpath[0]["XXX_SIZE"]) + " MB",
                      udev_device_get_vendor(mpath[0]),
-- 
1.7.0.1

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux