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 > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 01-15-2010, 08:23 PM
Peter Jones
 
Default Tear down devices breadth-first instead of depth first.

This way we do "sda1 sda2 sda" instead of "sda1 sda sda2 sda", which
means "sda" doesn't have to have the ability to do partial teardowns.
---
storage/devicetree.py | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 99af7c6..0059a20 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1946,11 +1946,15 @@ class DeviceTree(object):

def teardownAll(self):
""" Run teardown methods on all devices. """
- for device in self.leaves:
- try:
- device.teardown(recursive=True)
- except StorageError as e:
- log.info("teardown of %s failed: %s" % (device.name, e))
+ candidates = self.leaves
+ parents = []
+ while candidates:
+ for candidate in candidates:
+ parents.extend(candidate.parents)
+ if candidate.exists:
+ candidate.teardown()
+ candidates = parents
+ parents = []

def setupAll(self):
""" Run setup methods on all devices. """
--
1.6.5.2

_______________________________________________
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 01:38 AM.

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