On Fri, 2009-04-10 at 15:24 +0200, Jacek Danecki wrote: > This patch add activation of MD container and add disk to the container. Tell me again why you couldn't create a separate class for these containers? We are awfully late in the F11 development cycle to be changing so much of the MDRaidArrayDevice behavior so drastically. > > To make this possible name of devDir was changes to /dev/md. > Name of container is created as imsm[number]. > Container path can be for example /dev/md/imsm0 See -- if you created a subclass for your containers you could do this without disrupting the already-working mdraid class. > > Name of the native format array is changed from md[number] to [number] only. > Array path can be for example /dev/md/0 So now regular md devices' names will be '0' and '1'? Not acceptable. You are breaking the connection between device name and device path. > > Function mdraid.mdadd_no_degraded is use only for adding first member to the array. > It is needed for isw format. For the next disks function md_array._addDevice is used in > other path. This belongs in the Device class, not in the devicetree. The storage.devicelibs modules are meant to be used by the Device classes. > plain text document attachment (mdmember.patch) > commit 8a45d537a1f154522de27052a36636bb55e692b0 > Author: Jacek Danecki <Jacek.Danecki@xxxxxxxxx> > Date: Fri Apr 10 13:45:36 2009 -0400 > > activate mdmember > > diff --git a/storage/devices.py b/storage/devices.py > index 0d39d12..b801688 100644 > --- a/storage/devices.py > +++ b/storage/devices.py > @@ -2031,6 +2031,7 @@ class MDRaidArrayDevice(StorageDevice): > can be used to represent a partitionable device. > """ > _type = "mdarray" > + _devDir = "/dev/md" > > def __init__(self, name, level=None, minor=None, size=None, > memberDevices=None, totalDevices=None, bitmap=False, > diff --git a/storage/devicetree.py b/storage/devicetree.py > index 3f2ec18..6247042 100644 > --- a/storage/devicetree.py > +++ b/storage/devicetree.py > @@ -945,6 +945,12 @@ class DeviceTree(object): > > return device > > + def md_is_container(self, md_level): > + if md_level == "container": > + return True > + else: > + return False > + > def addUdevMDDevice(self, info): > name = udev_device_get_name(info) > log_method_call(self, name=name) > @@ -1296,13 +1302,17 @@ class DeviceTree(object): > > # find the first unused minor > minor = 0 > + > + if self.md_is_container(md_level): > + base = "imsm" > + else: > + base = "" > while True: > - if self.getDeviceByName("md%d" % minor): > - minor += 1 > - else: > - break > - > - md_name = "md%d" % minor > + if self.getDeviceByName("%s%d" % (base, minor)): > + minor += 1 > + else: > + break > + md_name = "%s%d" % (base, minor) > md_array = MDRaidArrayDevice(md_name, > level=md_level, > minor=minor, > @@ -1311,12 +1321,11 @@ 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)) > self._addDevice(md_array) > + try: > + 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 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list