Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   mpath: do not deactivate mpath partitions in teardown(). (http://www.linux-archive.org/gentoo-user/417561-mpath-do-not-deactivate-mpath-partitions-teardown.html)

Ales Kozumplik 08-24-2010 04:32 PM

mpath: do not deactivate mpath partitions in teardown().
 
This should be a part of 5c83bbf01800ca86d1c8e4cd95d14480165b344c that
does the same thing for mpath devices.

Related: rhbz#624175
---
storage/devices.py | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 82a46f8..dfe6371 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1402,17 +1402,24 @@ class PartitionDevice(StorageDevice):
self.originalFormat.teardown()
if self.format.exists:
self.format.teardown()
- if self.parents[0].type == 'dm-multipath':
- devmap = block.getMap(major=self.major, minor=self.minor)
- if devmap:
- try:
- block.removeDeviceMap(devmap)
- except Exception as e:
- raise DeviceTeardownError("failed to tear down device-mapper partition %s: %s" % (self.name, e))
- udev_settle()

StorageDevice.teardown(self, recursive=recursive)

+ def deactivate(self):
+ """
+ This is never called. For instructional purposes only.
+
+ We do not want multipath partitions disappearing upon their teardown().
+ """
+ if self.parents[0].type == 'dm-multipath':
+ devmap = block.getMap(major=self.major, minor=self.minor)
+ if devmap:
+ try:
+ block.removeDeviceMap(devmap)
+ except Exception as e:
+ raise DeviceTeardownError("failed to tear down device-mapper partition %s: %s" % (self.name, e))
+ udev_settle()
+
def _getSize(self):
""" Get the device's size. """
size = self._size
--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

David Cantrell 08-24-2010 04:47 PM

mpath: do not deactivate mpath partitions in teardown().
 
On Tue, 24 Aug 2010, Ales Kozumplik wrote:


This should be a part of 5c83bbf01800ca86d1c8e4cd95d14480165b344c that
does the same thing for mpath devices.

Related: rhbz#624175
---
storage/devices.py | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 82a46f8..dfe6371 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1402,17 +1402,24 @@ class PartitionDevice(StorageDevice):
self.originalFormat.teardown()
if self.format.exists:
self.format.teardown()
- if self.parents[0].type == 'dm-multipath':
- devmap = block.getMap(major=self.major, minor=self.minor)
- if devmap:
- try:
- block.removeDeviceMap(devmap)
- except Exception as e:
- raise DeviceTeardownError("failed to tear down device-mapper partition %s: %s" % (self.name, e))
- udev_settle()

StorageDevice.teardown(self, recursive=recursive)

+ def deactivate(self):
+ """
+ This is never called. For instructional purposes only.
+
+ We do not want multipath partitions disappearing upon their teardown().
+ """
+ if self.parents[0].type == 'dm-multipath':
+ devmap = block.getMap(major=self.major, minor=self.minor)
+ if devmap:
+ try:
+ block.removeDeviceMap(devmap)
+ except Exception as e:
+ raise DeviceTeardownError("failed to tear down device-mapper partition %s: %s" % (self.name, e))
+ udev_settle()
+
def _getSize(self):
""" Get the device's size. """
size = self._size



Ack.

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 09:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.