Re: [PATCH] Changes for using mdadm for isw_raid_member

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

 



Hi,

See me comments below.

<snip>

diff --git a/storage/devices.py b/storage/devices.py
index 32e4c23..34d31e5 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2045,9 +2045,13 @@ class MDRaidArrayDevice(StorageDevice):

        #self.probe()
        if self.exists and self.uuid:
+            if self.level == "container":
+                name = "/dev/md/%s" % self.path.split("/")[2]
+            else:
+                name = self.path
            open("/etc/mdadm.conf", "a").write("ARRAY %s UUID=%s\n"
-                                                % (self.path, self.uuid))
-
+                                                % (name, self.uuid))
+            @property
    def size(self):
        size = None

Isn't
"/dev/md/%s" % self.path.split("/")[2]

The same as just "self.path" ?


diff --git a/storage/devicetree.py b/storage/devicetree.py
index 4a1aeba..f82e290 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
<snip>
@@ -1010,6 +1017,15 @@ class DeviceTree(object):
                                       minor=udev_device_get_minor(info),
                                       sysfsPath=sysfs_path)
                self._addDevice(device)
+        elif udev_device_is_mdraid(info):
+            log.debug("%s is part of a mdraid" % name)
+            device = self.getDeviceByName(name)
+            if device is None:
+                device = StorageDevice(name,
+                                major=udev_device_get_major(info),
+                                minor=udev_device_get_minor(info),
+                                sysfsPath=sysfs_path, exists=True)
+                self._addDevice(device)
        elif udev_device_is_dmraid(info):
            # This is just temporary as I need to differentiate between the
            # device that has partitions and device that dont.

Can't you just do:
-       elif udev_device_is_dmraid(info):
+       elif udev_device_is_dmraid(info) or udev_device_is_mdraid(info):

Also we only want to this for disks which are part of an mdraid so that
we do not try to partition them, not for partitions, which your
current udev rule does not seem to handle. I think we should just rename
udev_device_is_dmraid() to udev_device_is_fakeraidset_member(),
that should do the trick nicely, it will cause us to not add the
disks to the devicetree as disks, which is all what we try to accomplish
by adding them as StorageDevice.


@@ -1120,9 +1136,18 @@ class DeviceTree(object):
                except KeyError:
                    log.debug("mdraid member %s has no md uuid" % name)
            elif format_type == "isw_raid_member":
-                # We dont add any new args because we intend to use the same
-                # block.RaidSet object for all the related devices.
-                pass
+                if  flags.cmdline.has_key("iswmd"):
+                    # mdadm
+                    try:
+                        kwargs["mdUuid"] = udev_device_get_md_uuid(info)
+                        log.debug("mdUuid=%s" % kwargs["mdUuid"])
+                    except KeyError:
+                        log.debug("mdraid member %s has no md uuid" % name)
+                else:
+                    #dmraid
+                    # We dont add any new args because we intend to use the same
+                    # block.RaidSet object for all the related devices.
+                    pass
            elif format_type == "LVM2_member":
                # lvm
                try:

This chunk should be dropped, the elif format_type == "isw_raid_member":
is gone from the most recent code. Instead we will need a utitlity
function: format_type_is_mdraid(format_type) which replaces the
format_type == linux_raid_member check, this function will
check for the passed in type being linux_raid_member and if the
cmdline arg is given also for it isw_raid_member. I want to have
things like this in functions to:
1) minize the amount of checks for the cmdline parameter
2) make it easy to later switch other fakeraid formats to
   mdraid to (if that will ever happen).

<snip>

The rest looks good. Although I'm not all to happy with all the
level=="container" checks, it would be good if you could somehow
generalize that, or atleast hide it in some function somehow.

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