summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-11-06 14:22:26 +0100
committerHans de Goede <hdegoede@redhat.com>2009-11-09 22:19:23 +0100
commit8b5b8284b88a5cd259646e4f5d92bcfb9bcce06e (patch)
tree7ff1684810743259a92ba9772355e256795ddf09 /storage
parent187879d4f6ba41a79f77c1bf57c36bd7dc4f2f59 (diff)
downloadanaconda-8b5b8284b88a5cd259646e4f5d92bcfb9bcce06e.tar.gz
anaconda-8b5b8284b88a5cd259646e4f5d92bcfb9bcce06e.tar.xz
anaconda-8b5b8284b88a5cd259646e4f5d92bcfb9bcce06e.zip
Don't activate / de-activate dmraid sets on setup / teardown
Since BIOS RAID sets never change there is no need to deactivate them and later activate them again. This also fixes problems in case the followng happens: 1) raid sets get activated, pyblock creates device-mappings for partitions on the set. 2) The partition table changes while exectuing actions 3) the raid sets gets de-activated, because of devicetree.processActions() tearing down everything in response to a disklabel commit error caused by lvm or mdraid using a partiton 4) pyblock tries to remove the partition mappings as it has created them, but the partition table has changed, and when parted commits partition table changes of a dmraid set to disk, it also modifies the partitions device-mappings. pyblock tries to remove a non existing mapping -> backtrace.
Diffstat (limited to 'storage')
-rw-r--r--storage/devices.py23
1 files changed, 4 insertions, 19 deletions
diff --git a/storage/devices.py b/storage/devices.py
index bc8951f90..7b4b314d5 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2682,34 +2682,19 @@ class DMRaidArrayDevice(DiskDevice):
else:
self.sysfsPath = ''
- def teardown(self, recursive=None):
- """ Close, or tear down, a device. """
+ def deactivate(self):
+ """ Deactivate the raid set. """
log_method_call(self, self.name, status=self.status)
- if not self.exists:
- raise DeviceError("device has not been created", self.name)
-
- if self.format.exists:
- self.format.teardown()
- udev_settle(timeout=10)
-
# This call already checks if the set is not active.
self._raidSet.deactivate()
- def setup(self, intf=None):
- """ Open, or set up, a device. """
+ def activate(self):
+ """ Activate the raid set. """
log_method_call(self, self.name, status=self.status)
- if not self.exists:
- raise DeviceError("device has not been created", self.name)
-
# This call already checks if the set is active.
self._raidSet.activate(mknod=True)
-
udev_settle()
- # we always probe since the device may not be set up when we want
- # information about it
- self._size = self.currentSize
-
@property
def mediaPresent(self):
# Even if teared down we still want to show up in storage.disks