On 03/27/2009 07:00 PM, Joel Granados Moreno wrote:
We were erroneously assuming that there could only exist one RaidSet on top of a group of underlying devs. This patch corrects this assumption by allowing anaconda to see a dynamic number of sets.
Hi, Thanks for taking care of this! Patch looks good, only one remark, we should no longer be ignoring the member disk when we are ignoring a set, otherwise if there are 2 sets of which we ignore only one, after a storage reset (which can happen during partitioning setup), we will no longer find the non ignored set. Regards, Hans
--- storage/devicetree.py | 115 +++++++++++++++++++++++++------------------------ 1 files changed, 58 insertions(+), 57 deletions(-) diff --git a/storage/devicetree.py b/storage/devicetree.py index b9552bd..8305e45 100644 --- a/storage/devicetree.py +++ b/storage/devicetree.py @@ -1234,72 +1234,73 @@ class DeviceTree(object): major = udev_device_get_major(info) minor = udev_device_get_minor(info) # Have we already created the DMRaidArrayDevice? - rs = block.getRaidSetFromRelatedMem(uuid=uuid, name=name, + rss = block.getRaidSetFromRelatedMem(uuid=uuid, name=name, major=major, minor=minor) - if rs is None: + if len(rss) == 0: # we ignore the device in the hope that all the devices # from this set will be ignored. self.addIgnoredDisk(device.name) return - elif rs.name in self._ignoredDisks: - # If the rs is being ignored, we should ignore device too. - self.addIgnoredDisk(device.name) - return + for rs in rss: + if rs.name in self._ignoredDisks: + # If the rs is being ignored, we should ignore device too. + self.addIgnoredDisk(device.name) + return - else: - dm_array = self.getDeviceByName(rs.name) - if dm_array is not None: - # We add the new device. - dm_array._addDevice(device) else: - # Activate the Raid set. - rs.activate(mknod=True) - - # Create the DMRaidArray - if self.zeroMbr: - cb = lambda: True - else: - cb = lambda: questionInitializeDisk(self.intf, - rs.name) - - if not self.clearPartDisks or \ - rs.name in self.clearPartDisks: - # if the disk contains protected partitions - # we will not wipe the disklabel even if - # clearpart --initlabel was specified - initlabel = self.reinitializeDisks - for protected in self.protectedPartitions: - disk_name = re.sub(r'p\d+$', '', protected) - if disk_name != protected and \ - disk_name == rs.name: - initlabel = False - break + dm_array = self.getDeviceByName(rs.name) + if dm_array is not None: + # We add the new device. + dm_array._addDevice(device) else: - initlabel = False + # Activate the Raid set. + rs.activate(mknod=True) - try: - dm_array = DMRaidArrayDevice(rs.name, - major=major, minor=minor, - raidSet=rs, - level=rs.level, - parents=[device], - initcb=cb, - initlabel=initlabel) - - self._addDevice(dm_array) - # Use the rs's object on the device. - # pyblock can return the memebers of a set and the - # device has the attribute to hold it. But ATM we - # are not really using it. Commenting this out until - # we really need it. - #device.format.raidmem = block.getMemFromRaidSet(dm_array, - # major=major, minor=minor, uuid=uuid, name=name) - except DeviceUserDeniedFormatError: - # We should ignore the dmriad and its components - self.addIgnoredDisk(rs.name) - self.addIgnoredDisk(device.name) - rs.deactivate() + # Create the DMRaidArray + if self.zeroMbr: + cb = lambda: True + else: + cb = lambda: questionInitializeDisk(self.intf, + rs.name) + + if not self.clearPartDisks or \ + rs.name in self.clearPartDisks: + # if the disk contains protected partitions + # we will not wipe the disklabel even if + # clearpart --initlabel was specified + initlabel = self.reinitializeDisks + for protected in self.protectedPartitions: + disk_name = re.sub(r'p\d+$', '', protected) + if disk_name != protected and \ + disk_name == rs.name: + initlabel = False + break + else: + initlabel = False + + try: + dm_array = DMRaidArrayDevice(rs.name, + major=major, minor=minor, + raidSet=rs, + level=rs.level, + parents=[device], + initcb=cb, + initlabel=initlabel) + + self._addDevice(dm_array) + # Use the rs's object on the device. + # pyblock can return the memebers of a set and the + # device has the attribute to hold it. But ATM we + # are not really using it. Commenting this out until + # we really need it. + #device.format.raidmem = block.getMemFromRaidSet(dm_array, + # major=major, minor=minor, uuid=uuid, name=name) + except DeviceUserDeniedFormatError: + # We should ignore the dmriad and its components + self.addIgnoredDisk(rs.name) + self.addIgnoredDisk(device.name) + rs.deactivate() elif format.type == "lvmpv": # lookup/create the VG and LVs try:
_______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list