[gnome-boxes] Don't always allocate twice the storage



commit 300c4cd76c1788b77d2247f61776e0f92b42a1c8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Nov 17 00:01:17 2011 +0200

    Don't always allocate twice the storage
    
    Only allocation twice the storage when allocating minimum required for
    the OS.

 src/os-database.vala |    2 +-
 src/vm-creator.vala  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/os-database.vala b/src/os-database.vala
index 5ddcde6..dd254e7 100644
--- a/src/os-database.vala
+++ b/src/os-database.vala
@@ -82,7 +82,7 @@ private class Boxes.OSDatabase {
         if (recommended != null && recommended.storage > 0)
             resources.storage = recommended.storage;
         else if (minimum != null && minimum.storage > 0)
-            resources.storage = int64.max (minimum.storage, resources.storage);
+            resources.storage = int64.max (minimum.storage * 2, resources.storage);
 
         return resources;
     }
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index 0b7ea58..e419fab 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -96,7 +96,7 @@ private class Boxes.VMCreator {
         for (var i = 1; pool.get_volume (volume_name) != null; i++)
             volume_name = name + "-" + i.to_string () + ".qcow2";
 
-        var storage_str = (storage / GIBIBYTES * 2).to_string ();
+        var storage_str = (storage / GIBIBYTES).to_string ();
         var xml = "<volume>\n" +
                   "  <name>" + volume_name + "</name>\n" +
                   "  <capacity unit='G'>" + storage_str + "</capacity>\n" +



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