Re: [PATCH 02/30] Make the allocation and grow code optional.

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks good.

On Wed, 16 Sep 2009, Joel Granados Moreno wrote:

* storage/partitioning.py (doPartitioning):  By default we run both the
grow code and the allocation code.  We could, If we were very careful,
avoid running either the allocation or the grow parts.
---
storage/partitioning.py |   14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 36cb861..d14a481 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -546,7 +546,7 @@ def getBestFreeSpaceRegion(disk, part_type, req_size,

    return best_free

-def doPartitioning(storage, exclusiveDisks=None):
+def doPartitioning(storage, exclusiveDisks=None, alloc=True, grow=True):
    """ Allocate and grow partitions.

        When this function returns without error, all PartitionDevice
@@ -562,8 +562,14 @@ def doPartitioning(storage, exclusiveDisks=None):
        Keyword arguments:

            exclusiveDisks -- list of names of disks to use
+            alloc -- Run partition allocation code
+            grow -- Run partition growth code

    """
+
+    if not alloc and not grow:
+        return
+
    anaconda = storage.anaconda
    disks = storage.disks
    if exclusiveDisks:
@@ -597,8 +603,10 @@ def doPartitioning(storage, exclusiveDisks=None):
        bootDev.req_bootable = True

    # FIXME: make sure non-existent partitions have empty parents list
-    allocatePartitions(disks, partitions)
-    growPartitions(disks, partitions)
+    if alloc:
+        allocatePartitions(disks, partitions)
+    if grow:
+        growPartitions(disks, partitions)
    # The number and thus the name of partitions may have changed now,
    # allocatePartitions() takes care of this for new partitions, but not
    # for pre-existing ones, so we update the name of all partitions here


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqy9LIACgkQ5hsjjIy1VklS6ACdGGMjpG++4d9xINIDzeiUEGVV
blwAoItyFpaQ2J5R7cpQbyf4Ex8bdzi4
=f3ft
-----END PGP SIGNATURE-----

_______________________________________________
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