Re: [PATCH 3/3] filled in hasFreeDiskSpace (#683632)

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

 



On 07/01/2011 09:39 AM, David Lehman wrote:
On Thu, 2011-06-30 at 15:29 -0400, David Cantrell wrote:
(cherry picked from commit ac906ab97788ef7c8b5a4422a6d371700ca48948)

There's an issue with this patch that I saw on master: it says there's
no free space if all free space is taken up by growable partition
requests. So if you create one partition on an empty disk of size 10
with grow to fill this function will then find no free space. For it to
really work it should be called in between allocatePartitions and
growPartitions and the return value should be stored until the next call
to allocatePartitions.

As discussed on IRC, reassigning this one to you. You understand it WAY better than I do.


Dave

---
  storage/partitioning.py |   24 +++++++++++++++++-------
  1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 3f39d18..b9da732 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -1667,14 +1667,24 @@ def hasFreeDiskSpace(storage, exclusiveDisks=None):
         the disks.  False otherwise.

      """
-    # FIXME: This function needs to be implemented.  It is used, at least, by
-    # iw/partition_gui.py.  It should be implemented after the new
-    # doPartitioning code is commited for fedora 13.  Since it returns True
-    # the user will always be able to access the create partition screen. If
-    # no partition can be created, the user will go back to the previous
-    # storage state after seeing a warning message.
-    return True

+    hasFreeSpace = False
+    disks = storage.partitioned
+
+    if exclusiveDisks:
+        disks = [d for d in disks if d.name in exclusiveDisks]
+
+    for disk in disks:
+        if storage.config.clearPartDisks and \
+           (disk.name not in storage.config.clearPartDisks):
+            continue
+
+        for part in disk.format.partedDisk.getFreeSpacePartitions():
+            if part.getSize(unit="MB")>= 100:
+                hasFreeSpace = True
+                break
+
+    return hasFreeSpace

  def lvCompare(lv1, lv2):
      """ More specifically defined lvs come first.


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



--
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
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