[PATCH] Add MultipathDevice.updateSysfsPath()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



MultipathDevice needs its own .updateSysfsPath(), because self.name is
"mpath0" but the sysfs directory is /sys/class/block/dm-0 .

Hopefully dm-${MINOR} is good enough.
---
 storage/devices.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 3cc3aac..a0048f3 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2809,6 +2809,14 @@ class MultipathDevice(DiskDevice):
         self._isUp = False
         self._pyBlockMultiPath = None
 
+    def updateSysfsPath(self):
+        """ Update this device's sysfs path. """
+        log_method_call(self, self.name, status=self.status)
+        path = os.path.join("/sys/class/block", "dm-%d" % \
+                            (self._pyBlockMultiPath.bdev.minor,))
+        self.sysfsPath = os.path.realpath(path)[4:]
+        log.debug("%s sysfsPath set to %s" % (self.name, self.sysfsPath))
+
 class NoDevice(StorageDevice):
     """ A nodev device for nodev filesystems like tmpfs. """
     _type = "nodev"
-- 
1.6.5.rc2

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux