Re: [PATCH 4/8] Changes for using mdadm for isw_raid_member

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

 



   activate mdmember

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 7383547..e4cab60 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1297,14 +1297,23 @@ class DeviceTree(object):
                return

            # find the first unused minor
-            minor = 0
-            while True:
-                if self.getDeviceByName("md%d" % minor):
-                    minor += 1
-                else:
-                    break
+            if md_level == "container":
+                   minor = 0
+                   while True:
+                        if self.getDeviceByName("imsm%d" % minor):
+                            minor += 1
+                        else:
+                            break
+                   md_name = "imsm%d" % minor
+            else:
+                minor = 0
+                while True:
+                    if self.getDeviceByName("md%d" % minor):
+                        minor += 1
+                    else:
+                        break
+                    md_name = "md%d" % minor

-            md_name = "md%d" % minor
            md_array = MDRaidArrayDevice(md_name,
                                         level=md_level,
                                         minor=minor,
@@ -1313,12 +1322,19 @@ class DeviceTree(object):
                                         sysfsPath=sysfs_path,
                                         exists=True,
                                         parents=[device])
-            try:
-                md_array.setup()
-            except (DeviceError, MDRaidError) as e:
-                log.info("setup of md array %s failed: %s"
-                            % (md_array.name, e))
+#            try:
+#                md_array.setup()
+#            except (DeviceError, MDRaidError) as e:
+#                log.info("setup of md array %s failed: %s"
+#                            % (md_array.name, e))
            self._addDevice(md_array)
+ try: + # FIXME: this should be mdraid.mdadd with parameter + # no_degraded parameter depends on which member is added
+                 # it was tested only for isw raid 1 array with 2 disks
+                 mdraid.mdadd_no_degraded(device.path)
+            except MDRaidError as e:
+                  log.warning("failed to add member to md array %s" % e)

    def handleUdevDMRaidMemberFormat(self, info, device):
log_method_call(self, name=device.name, type=device.format.type)
_______________________________________________
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