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

 
 
LinkBack Thread Tools
 
Old 01-25-2010, 08:04 AM
Ales Kozumplik
 
Default Make storage.unusedMDFoo also check mdcontainer members

On 01/24/2010 11:37 AM, Hans de Goede wrote:

This becomes important when mixing regular and bios raid mdraid arrays.
---
storage/__init__.py | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index adb9f81..c127f4a 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -510,6 +510,13 @@ class Storage(object):
return arrays


Ack from me but someone more into storage should take a look as well.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-25-2010, 04:14 PM
David Lehman
 
Default Make storage.unusedMDFoo also check mdcontainer members

On Sun, 2010-01-24 at 11:37 +0100, Hans de Goede wrote:
> This becomes important when mixing regular and bios raid mdraid arrays.

Looks fine to me.

> ---
> storage/__init__.py | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/storage/__init__.py b/storage/__init__.py
> index adb9f81..c127f4a 100644
> --- a/storage/__init__.py
> +++ b/storage/__init__.py
> @@ -510,6 +510,13 @@ class Storage(object):
> return arrays
>
> @property
> + def mdcontainers(self):
> + """ A list of the MD containers in the device tree. """
> + arrays = self.devicetree.getDevicesByType("mdcontainer")
> + arrays.sort(key=lambda d: d.name)
> + return arrays
> +
> + @property
> def mdmembers(self):
> """ A list of the MD member devices in the device tree.
>
> @@ -526,7 +533,7 @@ class Storage(object):
> unused = []
> for member in self.mdmembers:
> used = False
> - for _array in self.mdarrays:
> + for _array in self.mdarrays + self.mdcontainers:
> if _array.dependsOn(member) and _array != array:
> used = True
> break
> @@ -540,7 +547,7 @@ class Storage(object):
> def unusedMDMinors(self):
> """ Return a list of unused minors for use in RAID. """
> raidMinors = range(0,32)
> - for array in self.mdarrays:
> + for array in self.mdarrays + self.mdcontainers:
> if array.minor is not None:
> raidMinors.remove(array.minor)
> return raidMinors
> @@ -630,7 +637,7 @@ class Storage(object):
> return _("You cannot delete a partition of a LDL formatted "
> "DASD.")
> elif device.format.type == "mdmember":
> - for array in self.mdarrays:
> + for array in self.mdarrays + self.mdcontainers:
> if array.dependsOn(device):
> if array.minor is not None:
> return _("This device is part of the RAID "


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

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