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 > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-28-2009, 06:14 PM
Joel Granados Moreno
 
Default Meke dmraid devices recursive

For raid{10,01} to properly work pyblock needs to activate and
deactivate the dmraid sets properly. When activating it should activate
the leafs of the tree first. On deactivation it should start with the
root.

device.py - Added an activeMembers attribute that will hold the members
children that are activated by the activate function. On
acitvation the children get activated first. On
deactivation the father goes first and then the children.
This only applies for RaidSet objects.
---
device.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/device.py b/device.py
index df08edc..828f198 100644
--- a/device.py
+++ b/device.py
@@ -572,6 +572,7 @@ class RaidSet:
self._RaidSet__map = None
self._RaidSet__parts = []
self._RaidSet__name = rs.name
+ self._RaidSet__activeMembers = []
self.active = False
self.mknod = False

@@ -796,6 +797,13 @@ class RaidSet:
def activate(self, degradedOk=False, mknod=False):
if self.active:
return
+
+ # We put the active members in a list so we can deactivate them later.
+ for member in self.members:
+ if isinstance(member, RaidSet):
+ member.activate(degradedOk=degradedOk, mknod=mknod)
+ self._RaidSet__activeMembers.append(member)
+
if mknod:
try:
_os.unlink(self.prefix+self.name)
@@ -826,6 +834,11 @@ class RaidSet:
self.active = False
elif len(parts) > 0:
raise RuntimeError, "raidset has active partitions"
+
+ for activeMember in self._RaidSet__activeMembers:
+ activeMember.deactivate()
+ self._RaidSet__activateMembers = []
+
self.scanMemberParts()

def display(self, space=0, printer=lambda x,y: _sys.stdout.write("%s%s
" % (x*' ',y))):
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-29-2009, 12:25 PM
Hans de Goede
 
Default Meke dmraid devices recursive

Joel Granados Moreno wrote:

For raid{10,01} to properly work pyblock needs to activate and
deactivate the dmraid sets properly. When activating it should activate
the leafs of the tree first. On deactivation it should start with the
root.

device.py - Added an activeMembers attribute that will hold the members
children that are activated by the activate function. On
acitvation the children get activated first. On
deactivation the father goes first and then the children.
This only applies for RaidSet objects.
---
device.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)



Looks good.

Regards,

Hans



diff --git a/device.py b/device.py
index df08edc..828f198 100644
--- a/device.py
+++ b/device.py
@@ -572,6 +572,7 @@ class RaidSet:
self._RaidSet__map = None
self._RaidSet__parts = []
self._RaidSet__name = rs.name
+ self._RaidSet__activeMembers = []
self.active = False
self.mknod = False

@@ -796,6 +797,13 @@ class RaidSet:

def activate(self, degradedOk=False, mknod=False):
if self.active:
return
+
+ # We put the active members in a list so we can deactivate them later.
+ for member in self.members:
+ if isinstance(member, RaidSet):
+ member.activate(degradedOk=degradedOk, mknod=mknod)
+ self._RaidSet__activeMembers.append(member)
+
if mknod:
try:
_os.unlink(self.prefix+self.name)
@@ -826,6 +834,11 @@ class RaidSet:
self.active = False
elif len(parts) > 0:
raise RuntimeError, "raidset has active partitions"
+
+ for activeMember in self._RaidSet__activeMembers:
+ activeMember.deactivate()
+ self._RaidSet__activateMembers = []
+
self.scanMemberParts()

def display(self, space=0, printer=lambda x,y: _sys.stdout.write("%s%s
" % (x*' ',y))):


_______________________________________________
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 03:52 PM.

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