Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   Use create() rather than setup when we create a new mpath device. (http://www.linux-archive.org/ubuntu-kernel-team/309952-use-create-rather-than-setup-when-we-create-new-mpath-device.html)

Peter Jones 01-15-2010 08:23 PM

Use create() rather than setup when we create a new mpath device.
 
Create is the right thing to call here; we need it to do things like set
self.exists and do createParents(). Also revamp MultipathDevice.status
since we now can create it in realtime like everything else does.
---
storage/devices.py | 9 ++++++++-
storage/devicetree.py | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 8d74fa7..e350053 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2973,7 +2973,14 @@ class MultipathDevice(DMDevice):

@property
def status(self):
- return self._isUp
+ """ The device's status (True means active). """
+ if not self.exists:
+ return False
+
+ if not os.path.exists(self.path):
+ return False
+
+ return True

@property
def wwid(self):
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 1c241ab..82f6686 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1914,7 +1914,7 @@ class DeviceTree(object):
# upon them.
for mp in self.__multipaths.values():
log.info("adding mpath device %s" % mp.name)
- mp.setup()
+ mp.create()
self._addDevice(mp)

# Now, loop and scan for devices that have appeared since the two above
--
1.6.5.2

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

Peter Jones 01-15-2010 10:24 PM

Use create() rather than setup when we create a new mpath device.
 
> When you find a device that exists you should instantiate the FooDevice
> with exists=True.

In that case, here's a new set of patches to supplant #9, #10, and #16
from before.

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


All times are GMT. The time now is 07:08 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.