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 > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 01-15-2010, 08:24 PM
Peter Jones
 
Default Add udev_device_get_multipath_name().

Add udev_device_get_multipath_name() to find the name of a consituent's
device, and also reorganize a little.
---
storage/udev.py | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index 42b27e6..2d1561f 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -155,10 +155,6 @@ def udev_device_get_label(udev_info):
""" Get the label from the device's format as reported by udev. """
return udev_info.get("ID_FS_LABEL")

-def udev_device_is_multipath_member(info):
- """ Return True if the device is part of a multipath. """
- return info.get("ID_FS_TYPE") == "multipath_member"
-
def udev_device_is_dm(info):
""" Return True if the device is a device-mapper device. """
return info.has_key("DM_NAME")
@@ -444,6 +440,16 @@ def udev_device_get_multipath_partition_disk(info):
diskname = udev_device_get_dmraid_partition_disk(info)
return diskname

+def udev_device_is_multipath_member(info):
+ """ Return True if the device is part of a multipath. """
+ return info.get("ID_FS_TYPE") == "multipath_member"
+
+def udev_device_get_multipath_name(info):
+ """ Return the name of the multipath that the device is a member of. """
+ if udev_device_is_multipath_member(info):
+ return info['ID_MPATH_NAME']
+ return None
+
# iscsi disks have ID_PATH in the form of:
# ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}-lun-${lun}
def udev_device_is_iscsi(info):
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-20-2010, 03:30 PM
Chris Lumens
 
Default Add udev_device_get_multipath_name().

> Add udev_device_get_multipath_name() to find the name of a consituent's
> device, and also reorganize a little.

With this patch, you can also make the following modification to
iw/filter_gui.py:

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 0167b29..ff7eff7 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -631,7 +631,8 @@ class FilterWindow(InstallWindow):
# However, we do need all the paths making up this
# multipath set.
paths = "
".join(map(udev_device_get_name, mpath))

- tuple = (mpath[0], True, _active(name), "", model,
+ tuple = (mpath[0], True, _active(name),
+ udev_device_get_multipath_name(mpath[0]), model,
str(mpath[0]["XXX_SIZE"]) + " MB",
udev_device_get_vendor(mpath[0]),
udev_device_get_bus(mpath[0]),

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-20-2010, 07:42 PM
Hans de Goede
 
Default Add udev_device_get_multipath_name().

Ack.

On 01/20/2010 10:16 PM, Peter Jones wrote:

Add udev_device_get_multipath_name() to find the name of a consituent's
device, and also reorganize a little. Also use this in FilterWindow()
---
iw/filter_gui.py | 3 ++-
storage/udev.py | 14 ++++++++++----
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 42ac4c1..171b46f 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -629,7 +629,8 @@ class FilterWindow(InstallWindow):
# However, we do need all the paths making up this multipath set.
paths = "
".join(map(udev_device_get_name, mpath))

- tuple = (mpath[0], True, _active(name), "", model,
+ tuple = (mpath[0], True, _active(name),
+ udev_device_get_multipath_name(mpath[0]), model
str(mpath[0]["XXX_SIZE"]) + " MB",
udev_device_get_vendor(mpath[0]),
udev_device_get_bus(mpath[0]),
diff --git a/storage/udev.py b/storage/udev.py
index 42b27e6..2d1561f 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -155,10 +155,6 @@ def udev_device_get_label(udev_info):
""" Get the label from the device's format as reported by udev. """
return udev_info.get("ID_FS_LABEL")

-def udev_device_is_multipath_member(info):
- """ Return True if the device is part of a multipath. """
- return info.get("ID_FS_TYPE") == "multipath_member"
-
def udev_device_is_dm(info):
""" Return True if the device is a device-mapper device. """
return info.has_key("DM_NAME")
@@ -444,6 +440,16 @@ def udev_device_get_multipath_partition_disk(info):
diskname = udev_device_get_dmraid_partition_disk(info)
return diskname

+def udev_device_is_multipath_member(info):
+ """ Return True if the device is part of a multipath. """
+ return info.get("ID_FS_TYPE") == "multipath_member"
+
+def udev_device_get_multipath_name(info):
+ """ Return the name of the multipath that the device is a member of. """
+ if udev_device_is_multipath_member(info):
+ return info['ID_MPATH_NAME']
+ return None
+
# iscsi disks have ID_PATH in the form of:
# ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}-lun-${lun}
def udev_device_is_iscsi(info):


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-20-2010, 08:16 PM
Peter Jones
 
Default Add udev_device_get_multipath_name().

Add udev_device_get_multipath_name() to find the name of a consituent's
device, and also reorganize a little. Also use this in FilterWindow()
---
iw/filter_gui.py | 3 ++-
storage/udev.py | 14 ++++++++++----
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 42ac4c1..171b46f 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -629,7 +629,8 @@ class FilterWindow(InstallWindow):
# However, we do need all the paths making up this multipath set.
paths = "
".join(map(udev_device_get_name, mpath))

- tuple = (mpath[0], True, _active(name), "", model,
+ tuple = (mpath[0], True, _active(name),
+ udev_device_get_multipath_name(mpath[0]), model
str(mpath[0]["XXX_SIZE"]) + " MB",
udev_device_get_vendor(mpath[0]),
udev_device_get_bus(mpath[0]),
diff --git a/storage/udev.py b/storage/udev.py
index 42b27e6..2d1561f 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -155,10 +155,6 @@ def udev_device_get_label(udev_info):
""" Get the label from the device's format as reported by udev. """
return udev_info.get("ID_FS_LABEL")

-def udev_device_is_multipath_member(info):
- """ Return True if the device is part of a multipath. """
- return info.get("ID_FS_TYPE") == "multipath_member"
-
def udev_device_is_dm(info):
""" Return True if the device is a device-mapper device. """
return info.has_key("DM_NAME")
@@ -444,6 +440,16 @@ def udev_device_get_multipath_partition_disk(info):
diskname = udev_device_get_dmraid_partition_disk(info)
return diskname

+def udev_device_is_multipath_member(info):
+ """ Return True if the device is part of a multipath. """
+ return info.get("ID_FS_TYPE") == "multipath_member"
+
+def udev_device_get_multipath_name(info):
+ """ Return the name of the multipath that the device is a member of. """
+ if udev_device_is_multipath_member(info):
+ return info['ID_MPATH_NAME']
+ return None
+
# iscsi disks have ID_PATH in the form of:
# ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}-lun-${lun}
def udev_device_is_iscsi(info):
--
1.6.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 07:00 PM.

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