Re: [PATCH] Add a size attribute to mdraid arrays.

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

 



Looks good.

On 03/10/2009 03:04 PM, David Lehman wrote:
It doesn't account for metadata size, but that's supposed to be
something like 128K, so I'm hoping to get away without it.
---
  storage/devices.py |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 713449b..2ae643c 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1879,6 +1879,14 @@ class MDRaidArrayDevice(StorageDevice):
          #self.probe()

      @property
+    def size(self):
+        size = None
+        for device in self.devices:
+            if size is None or device.size<  size:
+                size = device.size
+        return size
+
+    @property
      def mdadmConfEntry(self):
          """ This array's mdadm.conf entry. """
          if not self.level or self.memberDevices is None or not self.uuid:


--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
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