[PATCH blivet] Update format of iscsi device becoming multipath member (#740105)

Radek Vykydal rvykydal at redhat.com
Mon Jul 22 14:19:23 UTC 2013


We repopulate device tree after add iscsi device dialog in which a login to
some target happened. One issue with this is that format of iscsi device
populated earlier that would make a multipath member together with iscsi device
added in later run of iscsi dialog is not updated to be of multipath_member
type.

So we'd need either 1) require adding of all multipath members in one add iscsi
dialog instance, which would require reworking UI to allow adding nodes of more
targets (ie targets with different IP reachable via different subnets) in one
iscsi dialog; or 2) update the original iscsi device format in devicetree.

This patch aims to achieve 2) although I am not sure if it fits into general
blivet's use logic and design so take it more as a demonstration of what I'd
like to achieve to make adding multipath iscsi targets in advanced storage UI
work.  I'd be careful to add special cases / hacks driven by use in Anaconda
into blivet now.
---
 blivet/devicetree.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 21227a4..7772c18 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1016,6 +1016,14 @@ class DeviceTree(object):
                 # make sure any device we found is an md device
                 device = None
 
+        # newly added iscsi device could make this one multipath member
+        if device and device.type == 'iscsi' and \
+            devicelibs.mpath.is_multipath_member(device.path) and \
+            device.format and device.format.type != "multipath_member":
+                log.debug("%s newly detected as multipath member, dropping old format" % device.name)
+                info["ID_FS_TYPE"] = "multipath_member"
+                device.format = formats.DeviceFormat()
+
         #
         # The first step is to either look up or create the device
         #
-- 
1.7.11.7



More information about the anaconda-patches mailing list