[NEW PATCH] BZ#726410 - Ignore patitioned device (again) (via gerrit-bot)

Dan Kenigsberg danken at redhat.com
Mon Aug 1 11:41:48 UTC 2011


New patch submitted by Dan Kenigsberg (danken at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/761

commit 7615679dab730197ddd636a286bb514fac5acc92
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date:   Thu Jul 28 16:51:10 2011 +0300

    BZ#726410 - Ignore patitioned device (again)
    
    Change-Id: I165dd0c867e155bde3971a3600cb20429095f05b

diff --git a/vdsm/storage/devicemapper.py b/vdsm/storage/devicemapper.py
index bf155bc..78e44a0 100644
--- a/vdsm/storage/devicemapper.py
+++ b/vdsm/storage/devicemapper.py
@@ -83,6 +83,9 @@ def isBlockDevice(devName):
     except OSError:
         return False
 
+def isPartitioned(devName):
+    devName = resolveDevName(devName)
+    return (len(getHolders(devName)) > 0)
 
 def getAllSlaves():
     deps = {}
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 55176c9..d9d8e21 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -719,6 +719,15 @@ class HSM:
                 if not typeFilter(dev):
                     continue
 
+                partitioned = devicemapper.isPartitioned(dev['guid'])
+                # One day we'll stop hiding partitioned devices and let
+                # the gui grey them out so users would not just wonder
+                # where is the device. Until that glorious day leave this
+                # here.
+                if partitioned:
+                    self.log.warning("Ignoring partitioned device %s", dev)
+                    continue
+
                 pvuuid = ""
                 vguuid = ""
 
@@ -727,11 +736,16 @@ class HSM:
                     pvuuid = pv.uuid
                     vguuid = pv.vg_uuid
 
-                devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid, 'vgUUID': vguuid,
-                        'vendorID': dev.get("vendor", ""), 'productID': dev.get("product", ""),
-                        'fwrev': dev.get("fwrev", ""), "serial" : dev.get("serial", ""),
-                        'capacity': dev.get("capacity", "0"), 'devtype': dev.get("devtype", ""),
-                        'pathstatus': dev.get("paths", []), 'pathlist': dev.get("connections", [])}
+                devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid,
+                        'vgUUID': vguuid, 'vendorID': dev.get("vendor", ""),
+                        'productID': dev.get("product", ""),
+                        'fwrev': dev.get("fwrev", ""),
+                        "serial" : dev.get("serial", ""),
+                        'capacity': dev.get("capacity", "0"),
+                        'devtype': dev.get("devtype", ""),
+                        'pathstatus': dev.get("paths", []),
+                        'pathlist': dev.get("connections", []),
+                        'partitioned': partitioned}
                 for path in devInfo["pathstatus"]:
                     path["lun"] = path["hbtl"].lun
                     del path["hbtl"]
@@ -739,8 +753,6 @@ class HSM:
                 devices.append(devInfo)
             except se.InvalidPhysDev:
                 pass
-            except se.PartitionedPhysDev:
-                self.log.warning("Ignore partitioned device %s", dev)
 
 
         return devices




More information about the vdsm-patches mailing list