summaryrefslogtreecommitdiffstats
path: root/storage/devicetree.py
Commit message (Collapse)AuthorAgeFilesLines
* Structure the repo layout so it matches final structure better and make isys ↵Martin Sivak2010-05-311-2262/+0
| | | | | | a real Python package. Also updates the build and autotools stuff to work with the new structure
* Give pre-existing mdraid arrays the proper name in the UI (#596227)Hans de Goede2010-05-261-1/+5
| | | | | mdadm --examine reports mdraid set names as /dev/md/# rather then /dev/md# for some sets.
* Setting up lvs should never failHans de Goede2010-05-191-7/+1
| | | | | As we only do lv handling for complete vgs now, setting up the lv should never fail.
* We no longer need to handle lvs which are part of an incomplete vgHans de Goede2010-05-191-48/+0
| | | | | | As we no longer add lvs which are part of an incomplete vg to the devicetree we don't need to handle this case any more in _handleInconsistencies.
* Store immutable info into the device for easier accessHans de Goede2010-05-191-5/+4
| | | | Related: rhbz#593642
* Delay setting up lvs until other devices are scannedHans de Goede2010-05-191-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lvs were setup (activated) as soon as the first pv of their vg was found, however now that our udev rules only look at pvs we need to delay setting them up atleast till we have all pvs (iow they are complete), as we need to have info about all lvs in a vg for our snapshot and stripe handling code. It is even necessary to delay setting up lvs till scanning all other devices is done: 1) We wont know if there are duplicate vg names until all pvs are scanned (and we dont want to activate lvs of vgs with duplicate vg names) 2) Our lvm device filter expression (which filters out ignored disks / parititions) wont be complete until all disks / pvs are scanned An example, lets take a machine connected through a SAN, trough this SAN it sees disks sda - sdj. Each of these 10 disks contains a standard (single disk) auto partition install, each with a vg name VolGroup, iow when we see all disk we see 10 vgs named VolGroup. But the user selects only sde in the filter ui. Lets assume we scan disks in order sda - sde (which is not always true) now when sde2 (the pv) gets scanned the lvm device filter expression has been set up to ignore sda - sdd. If we were to activate the lv at this point, lvm would still see disks sde - sdj, and bring up the lvs of one of the 6 remaining vgs, not necessarily choosing the vg on sde. If however we delay activating the lvs until all other devices are scanned, then the lvm device filter expression will filter out sda - sdd and sdf - sdj, so lvm only sees sde and thus do the right thing. Related: rhbz#591469
* Move creation of lv devices into its own functionHans de Goede2010-05-191-67/+72
| | | | | | | This is a preparation patches for properly handling identically named vgs, this patch makes no functional changes Related: rhbz#591469
* Handle devices that don't have a /dev/disk/by-path/ symlink (#563242)Peter Jones2010-05-131-4/+4
| | | | | | Looks like for non-disk devices, udev doesn't build a /dev/disk/by-path/ symlink, so we can't reliably use that. If we're in that case, just use device.path .
* Determine if an mdmember is biosraid earlier (#586298)Hans de Goede2010-05-121-4/+1
| | | | | | | | | | | | | | | | Currently kickstart installs to Intel (mdraid using) BIOS RAId sets with "clearpart --all" do not work. handleUdevDeviceFormat() calls shouldClear() to determine if format specific handling needs to be done and shouldClear() depends on the biosraid flag of the mdmember format to decide wether or not to clear mdmember formats with --all (through the format.hidden attribute). However the biosraid flag gets set by the format specific handling which gets skipped in this case because it has not been set yet. This patch fixes this by setting the biosraid property of the mdmember format earlier by passing it in into its __init__ method, which seems a much cleaner solution in general.
* Fix usage of deviceNameToDiskByPath in devicetree.py (#589967)David Cantrell2010-05-071-1/+3
| | | | Account for the recent changes in deviceNameToDiskByPath().
* Remove partitions after unpartitioned non-partition devices. (#588597)David Lehman2010-05-071-0/+8
| | | | | | | | | This basically removes a bunch of comparisons that would previously return 0. The problem is that the 0 return value is often used as a basis for further sorting, which can lead to incorrect ordering since python's sort function does not compare items exhaustively. Yes, I know. Topoligical sort is coming soon.
* Make deviceNameToDiskByPath check udev info instead of sysfsDavid Cantrell2010-05-041-3/+2
| | | | | | | | | | | Rather than scanning /dev/disk/by-path directly, check the udev database for the PATH_ID or ID_PATH or whatever it's called that gives us the devlink name that would appear in /dev/disk/by-path. Sometimes the links in /dev/disk/by-path do not appear because you have them already in /dev/disk/by-id (or not, who knows?). At any rate, stop checking the /dev/disk/by-path directory manually and just ask udev. Related: rhbz#560702
* Make sure we use 1.0 mdraid metadata when the set is used for boot (#584596)Hans de Goede2010-04-231-2/+3
|
* Add a preCommitFixup hook to StorageDevice classesHans de Goede2010-04-231-7/+6
| | | | | | | | | It turns out we need to do some fixup's before committing not only for PartitionDevices, but also for other devices. So add a generic preCommitFixup hook to StorageDevice classes, and replace resetPartedPartition with it. Related: rhbz#584596
* Prune resize and format create/migrate actions if destroying a device.David Lehman2010-04-221-2/+20
| | | | | | | | | | Also, only prune actions on a single device id at a time for destroy actions. Trying to handle several loops at once is messy and dangerous. Resolves: rhbz#575070 Resolves: rhbz#576710 Resolves: rhbz#568759 Related: rhbz#583290
* Add proper support for destruction of disklabels.David Lehman2010-04-151-4/+8
| | | | | With this patch we can destroy a disklabel of one type and then create a disklabel of a different type in the process of partitioning.
* Three small fixes to action sorting.David Lehman2010-04-151-16/+8
| | | | | | | | | 1) Destruction of partitions goes before destruction of partitioned devices. 2) Creation of two partitions on the same disk should be sorted by partition number, not name. 3) Resize of partitioned devices is not supported, so don't clutter the sorting function with code to handle it.
* Sort partition create actions before other unpartitioned devices. (#574379)David Lehman2010-04-061-0/+6
|
* Update format of cdrom devices when looking for repos on media (#566269)Radek Vykydal2010-03-241-0/+10
| | | | | | This is needed when repo location is changed to CD/DVD in repo UI and the media was inserted after last storage population (e.g. just during repo UI step).
* Keep a handle to devices' original format instance. (#565848)David Lehman2010-03-101-0/+1
| | | | | | | | | The original value of each device's format attribute is stored after the device is probed/scanned/detected. An optional/keyword argument, orig, is added to StorageDevice.setup so that the caller can specify whether to set up the device using the current/new formatting or the original formatting. StorageDevice.destroy methods automatically use the original formatting.
* Ignore probably-spurious disklabels on unpartitionable devices. (#567832)David Lehman2010-02-261-1/+5
|
* Revert "working on this"Peter Jones2010-02-261-14/+1
| | | | This reverts commit a24e722ebcb06c88f88605190caebdcf83236690.
* working on thisPeter Jones2010-02-261-1/+14
|
* Warn when ignoring BIOS RAID members (#560932)Hans de Goede2010-02-161-1/+12
| | | | | | | | | | | | | This patch adds a warning when ignoring BIOS RAID members because no complete set using them could be found. This patch also introduces a much needed InstallInterfaceBase class, as I didn't feel like adding the exact same code to all of cmdline.py, gui.py and text.py . Note that the ignoring of BIOS RAID members is checked in 2 places, as the filter UI can be skipped under certain circumstances (kickstart). The interface code checks for disks it has already warned about.
* Fix typo in action sorting. Disklabels before partitions. (#560017)David Lehman2010-02-031-2/+2
|
* Update exclusiveDisks when handling mdraid BIOSRAID in isIgnoredHans de Goede2010-01-221-2/+3
| | | | | | When checking for mdraid BIOSRAID sets in isIgnored and finding one, update the exclusiveDisks entry, so that the correct name is present for other usage of exclusiveDisks (such as in cleardisks_gui.py).
* MDRaidDevice does not have serial, vendor or bus argumentsHans de Goede2010-01-221-4/+6
|
* Make addUdevPartitionDevice add lvm filters for ignored partitionsHans de Goede2010-01-221-0/+6
| | | | | | When we ignore a partition because its disk cannot be found, or des not have a disklabel format, or is not partitionable, we should lvm to ignore the partition too.
* Remove BIOSRAID see if ignored again code from addUdevPartitionDeviceHans de Goede2010-01-221-8/+0
| | | | | | | Since addUdevPartitionDevice now checks that the disk the partition lives on has a disklabel format (which the member disks do not have), there is no reason to call isIgnored again, esp as isIgnored no longer does any partition -> disk checking.
* Remove special partition handling from isIgnoredHans de Goede2010-01-221-16/+0
| | | | | Remove special partition handling from isIgnored, addUdevPartitionDevice does all the necessary checking itself now a days.
* Special handling for mdraid BIOS RAID sets in exclusive disksHans de Goede2010-01-221-0/+16
| | | | | | | | | Special handling for mdraid external metadata sets (mdraid BIOSRAID): 1) The containers are intermediate devices which will never be in exclusiveDisks 2) Sets get added to exclusive disks with their dmraid set name by the filter ui. Note that making the ui use md names instead is not possible as the md names are simpy md# and we cannot predict the #
* Don't do exclusiveDisks checking for BIOS RAID membersHans de Goede2010-01-211-0/+1
| | | | | | | BIOS RAID members, and mdraid BIOS RAID containers are normally not in exclusiveDisks, only the sets they contain are. So do not do exclusiveDisks checking for them, as ignoring the members will result in the sets never being found.
* Create multipath.confPeter Jones2010-01-211-3/+23
| | | | | | | | Revamp this since multipath is now writing our rules for us. Use device.serial/device.vendor/device.model where appropriate, and don't give the device a braindead mode. Also change /when/ we write the files out.
* Make all StorageDevice-s support .vendor and .modelPeter Jones2010-01-201-2/+6
| | | | | | | | | | | | Not everything has one, but this makes them all at least show "None" instead of having to do the hasattr dance. Also, it now normally gets the info from udev rather than using parted's concatenated version (which fixes some minor UI problems as well as making it available at more places.) Also add a correct "model" method to MultipathDevice - we want to display the model for the underlying disk device, not "linux device mapper device" or whatnot.
* Multipath members should not be added to the ignored disk list.Peter Jones2010-01-201-2/+4
| | | | | We don't want multipath members ignored (yet), because we need addUdevDevice() to act on them.
* Use mpath names instead of serials to group them.Peter Jones2010-01-201-5/+3
| | | | | Since we're using the multipath tools, we don't need to group by serial. Also don't use the name generator.
* Use StorageError insead of enumerating all the different storage errors.Peter Jones2010-01-151-1/+1
| | | | | | devicetree.teardownAll() often causes storage errors which all get ignored, but we've been enumerating them individually. use their superclass instead.
* Check for disklabels on unpartitionable devices. (#539482)David Lehman2010-01-131-5/+22
| | | | | | If an unpartitionable device contains a disklabel we ignore any partitions on that device, but we want to show that the device does contain a partition table in UI.
* Ask about LVM inconsistencies only in storageinit step.Radek Vykydal2010-01-071-42/+14
| | | | | | | | | | | The patch does essentially the same thing as commit 31d5b8f4fec513e4f8e246e47e9fee75c701d07b for disk initialization question. The difference is that when user chooses LVM reinitialization, it is done immediately (not as planned action as with disk initialization) so the user wouldn't be asked again anyway without the patch (he would be asked if he chose to ignore). I also made one function more readable in the patch.
* Ask about disk initialization only in storageinit step.Radek Vykydal2010-01-071-37/+12
| | | | | | | | Don't ask again and again e.g. when going back and forth in custom partitioning UI. Related to bug #527711 which is itself fixed by another patch. (*) Answers are cached in InstallInterface classes. (*) Dialog callback is moved from storage code to InstallInterface classes.
* No need to special case ignoring of dmraid setsHans de Goede2009-12-161-3/+0
| | | | | | device.raidSet.name == device.name, so there is no need to specially add it to ignore disks, this will only lead to the raidset name being in ignoredDisks twice.
* Hide biosraid member devices that contain MDRaidMember formats.David Lehman2009-12-161-2/+8
| | | | This brings the behavior in line with other (dmraid) biosraid members.
* Move disklabel handling into handleUdevDeviceFormat with the others.David Lehman2009-12-161-15/+16
|
* Move identifyMultipaths from DeviceTree to devicelibs.Chris Lumens2009-12-111-93/+24
| | | | | | | | The return type has also changed. It now returns a tuple of a list of regular devices, a list of multipath sets, and a list of partition devices. This is necessary so the filtering UI can use the same knowledge that was in the DeviceTree object to know which devices are part of a multipath set and which are just standalone disks.
* Add a method to get the bus/interconnect from udev and store it on devices.Chris Lumens2009-12-111-1/+2
|
* Add a vendor getting udev method, though udev doesn't always know it.Chris Lumens2009-12-111-1/+7
|
* Add the serial number to all DiskDevices and subclasses.Chris Lumens2009-12-111-1/+1
|
* Rework udev_settle timeout handling (#544177)Hans de Goede2009-12-101-1/+1
| | | | | | | | | | | | | | | | | | 1) centralize the setting of the timeout parameter inside the udev_settle function. I do realize that the time needed for initially scanning all disks is much larger, then the time for scanning a single new partition when we are creating partitions. But since this is a timeout, and udevadm settle will exit as soon as the scanning is done, I see no reason not to have a single place to configure the timeout assuming the worst case scenario (the initial disk scan). This way we won't have these magic values sprinkled all over the code. 2) Given that in the past we've had bugs filed about anaconda taking many minutes to scan hardware on big iron machine and that our initial udev settle call will scan all disks, I think that udevadm's default timeout of 1 minutes is too low, so this patch sets the timeout to 5 minutes.
* Skip disklabel handling for biosraid and multipath members.David Lehman2009-12-091-1/+2
|
* Add support for whole-disk formatting.David Lehman2009-12-091-22/+27
| | | | Whole-disk formats are recognized but cannot be edited in any way.