Re: [PATCH 5/7] Modify StorageDevice.fstabSpec() to use by-path for DASD (#526364).

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

 



On 10/08/2009 10:46 AM, David Cantrell wrote:
> On Thu, 8 Oct 2009, Hans de Goede wrote:
>> On 10/08/2009 10:21 AM, David Cantrell wrote:
>>> On Thu, 8 Oct 2009, Hans de Goede wrote:
>>>
>>>> sorry, but NACK,
>>>>
>>>> This sort of device specific handling should not be done in the
>>>> generic StorageDevice class, instead
>>>> devicetree.py: addUdevDiskDevice()
>>>> Should be teached to recognize DASD disks and add them with a type
>>>> of DASDDevice, and DASDDevice should override fstabSpec().
>>>>
>>>
>>> That was my original approach (which also explains the udev patches
>>> after this
>>> one), but DASDDevice extends DiskDevice. Where I need to override
>>> fstabSpec
>>> for DASD is in PartitionDevice. So I created a DASDPartitionDevice
>>> and did
>>> things that way, which looked pretty ugly to me, so I ended up doing
>>> this
>>> instead.
>>>
>>> DASDDevice is for /dev/dasda, /dev/dasdb, and so on. The partitions
>>> such as
>>> /dev/dasda1 or /dev/dasdb1 become PartitionDevice objects.
>>>
>>> I guess I'll go create the DASDPartitionDevice class anyway so I can
>>> override
>>> fstabSpec there.
>>>
>>
>>
>> Ah true, no please don't deriving from PartitionDevice is a bad idea
>> in general
>> (been there done that with dmraid)
> 
> Yeah, it doesn't seem nice.
> 
>> How about ?
>>
>> In PartitionDevice:
>>
>> @property
>> def fstabSpec(self):
>>    spec = self.path
>>    if self.disk and self.disk.type == "dasd":
>>        spec = deviceNameToDiskByPath(self.path)
>>    elif self.format and self.format.uuid:
>>        spec = "UUID=%s" % self.format.uuid
>>
>>    return spec
> 
> That's fine with me.  I'll move it in the patch and resend.

Hm, this looks like we just move the strange non-OO code from DiskDevice
to PartitionDevice. But then again, I trust Hans in saying that we
shouldn't subclass PartitionDevice, even though extending sounds like
the right OO way to do.

I got some more design ideas for this and dracutSetupString, more in a
while, or on a new day for you David.

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Erich Baier
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
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