FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 12-01-2010, 03:39 PM
Chris Lumens
 
Default Generalize some of the device-mapper partition handling.

> pyanaconda/storage/devicetree.py | 13 +++----------
> pyanaconda/storage/udev.py | 13 ++++++++++++-
> 2 files changed, 15 insertions(+), 11 deletions(-)

Despite having more code, this is a good one because it's clearer code.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-16-2011, 01:39 PM
Ales Kozumplik
 
Default Generalize some of the device-mapper partition handling.

From: David Lehman <dlehman@redhat.com>

Related: rhbz#709653
---
storage/devicetree.py | 13 +++----------
storage/udev.py | 9 ++++++++-
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 773667b..0d48dda 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -950,8 +950,7 @@ class DeviceTree(object):
# udev/sysfs, we have to define what is a disk in terms of what is
# not a disk.
if udev_device_is_disk(info) and
- not udev_device_is_dmraid_partition(info, self) and
- not udev_device_is_multipath_partition(info, self) and
+ not udev_device_is_dm_partition(info) and
not udev_device_is_dm_lvm(info) and
not udev_device_is_dm_crypt(info) and
not (udev_device_is_md(info) and
@@ -1026,12 +1025,7 @@ class DeviceTree(object):
# try to get the device again now that we've got all the slaves
device = self.getDeviceByName(name)

- if device is None:
- if udev_device_is_multipath_partition(info):
- diskname = udev_device_get_dm_partition_disk(info)
- disk = self.getDeviceByName(diskname)
- return self.addUdevPartitionDevice(info, disk=disk)
- elif udev_device_is_dmraid_partition(info):
+ if device is None and udev_device_is_dm_partition(info):
diskname = udev_device_get_dm_partition_disk(info)
disk = self.getDeviceByName(diskname)
return self.addUdevPartitionDevice(info, disk=disk)
@@ -1301,8 +1295,7 @@ class DeviceTree(object):
#
if udev_device_is_multipath_member(info) and device is None:
device = self.addUdevDiskDevice(info)
- elif udev_device_is_dm(info) and
- devicelibs.dm.dm_is_multipath(info):
+ elif udev_device_is_dm(info) and udev_device_is_dm_mpath(info):
log.debug("%s is a multipath device" % name)
self.addUdevDMDevice(info)
elif udev_device_is_dm(info):
diff --git a/storage/udev.py b/storage/udev.py
index de91c6d..b23e6c6 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -437,7 +437,7 @@ def udev_device_is_dm_raid(info):
return udev_device_dm_subsystem_match(info, "dmraid")

def udev_device_is_dm_mpath(info):
- """ Return True if the device is an. """
+ """ Return True if the device is a multipath device. """
return udev_device_dm_subsystem_match(info, "mpath")

def udev_device_is_biosraid(info):
@@ -468,6 +468,13 @@ def udev_device_get_dm_partition_disk(info):

return info["DM_NAME"][_index]

+def udev_device_is_dm_partition(info):
+ if not udev_device_is_dm(info):
+ return False
+
+ diskname = udev_device_get_dm_partition_disk(info)
+ return diskname not in ("", None)
+
def udev_device_is_dmraid_partition(info):
if not udev_device_is_dm_raid(info):
return False
--
1.7.5.2

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

Thread Tools




All times are GMT. The time now is 11:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org