[gnome-boxes/wip/dont-create-pool-dir: 2/3] vm-creator: Ensure images dir even if pool is active



commit 6c6dd6dbe7f85114607704aa66a93dd000003ff1
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jul 15 16:28:47 2015 +0100

    vm-creator: Ensure images dir even if pool is active
    
    Seems it's possible for storage pool to remain active even if underlying
    directory is removed. Let's always ensure images directory exists.

 src/vm-creator.vala |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index f4eec60..66cb6e7 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -210,14 +210,14 @@ private class Boxes.VMCreator {
             var config = VMConfigurator.get_pool_config ();
             pool = connection.create_storage_pool (config, 0);
             yield pool.build_async (0, null);
-            yield pool.start_async (0, null);
-            yield pool.refresh_async (null);
             debug ("Created storage pool.");
-        } else if (pool.get_info ().state == StoragePoolState.INACTIVE) {
-            // Ensure pool directory exists in case user deleted it after pool creation
-            var pool_path = get_user_pkgdata ("images");
-            ensure_directory (pool_path);
+        }
+
+        // Ensure pool directory exists in case user deleted it after pool creation
+        var pool_path = get_user_pkgdata ("images");
+        ensure_directory (pool_path);
 
+        if (pool.get_info ().state == StoragePoolState.INACTIVE) {
             yield pool.start_async (0, null);
             yield pool.refresh_async (null);
         }


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