Re: [PATH] New iswmd parameter for kernel cmdline

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

 





On 04/03/2009 04:47 PM, Jacek Danecki wrote:


diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py
index 784bb1c..f4213f5 100644
--- a/storage/formats/__init__.py
+++ b/storage/formats/__init__.py
@@ -112,6 +112,9 @@ def collect_device_format_classes():
                 log.debug("import of device format module '%s' failed" % mod_name)

 def get_device_format_class(fmt_type):
+    from mdraid import MDRaidMember
+    from dmraid import DMRaidMember
+    from flags import flags
     """ Return an appropriate format class based on fmt_type. """
     if not device_formats:
         collect_device_format_classes()
@@ -122,6 +125,15 @@ def get_device_format_class(fmt_type):
             if fmt_type and fmt_type == fmt_class._name:
                 fmt = fmt_class
                 break
+            elif fmt_type == "isw_raid_member":
+                 if flags.cmdline.has_key("iswmd"):
+                       log.debug("found MD cmdline parameter")
+                       fmt = MDRaidMember
+                       break
+                 else:
+                       log.debug("don't found MD cmdline parameter")
+                       fmt = DMRaidMember
+                       break
             elif fmt_type in fmt_class._udevTypes:
                 fmt = fmt_class
                 break

Why not just write:
+            elif fmt_type == "isw_raid_member" and flags.cmdline.has_key("iswmd"):
+                log.debug("using MD for isw raid")
+                fmt = MDRaidMember
+                break

The code already defaults to using dmraid, so you only need to check for isw + cmdline
option and then do fmt = MDRaidMember.



diff --git a/storage/udev.py b/storage/udev.py
index 63cc3fd..46ccd39 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -308,6 +308,21 @@ def udev_device_is_dmraid(info):

     return False

+def udev_device_is_mdraid(info):
+    from formats.mdraid import MDRaidMember
+    from flags import flags
+    if info.has_key("ID_FS_TYPE"):
+        if flags.cmdline.has_key("iswmd"):
+            log.debug("found MD cmdline parameter")
+            if info["ID_FS_TYPE"] == "isw_raid_member":
+                log.debug("use MD for isw")
+                return True
+        else:
+            if info["ID_FS_TYPE"] in MDRaidMember._udevTypes:
+                return True
+
+    return False
+

What is this for, given that we already have the fmt handling above ?

Regards,

Hans

_______________________________________________
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