[gnome-boxes] system-importer: Ensure disk reability on import



commit a6e870ff8af634102f758c8319c8b120cd1a7591
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed May 25 15:50:19 2016 +0100

    system-importer: Ensure disk reability on import
    
    Ensuring disk readability involves elevation of privileges so if we do
    that on startup, we end up launching a polkit dialog even if user never
    uses the option of libvirt system VMs.
    
    While we should still check for disk images before showing the option to
    import their VMs from system libvirt, it's best if we only ensure their
    reabibility when user explicitly asks for import.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766727

 src/libvirt-system-importer.vala |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/libvirt-system-importer.vala b/src/libvirt-system-importer.vala
index 1014f95..268ebe7 100644
--- a/src/libvirt-system-importer.vala
+++ b/src/libvirt-system-importer.vala
@@ -66,6 +66,12 @@ private class Boxes.LibvirtSystemImporter: GLib.Object {
             }
         }
 
+        debug ("Fetched %u domains from system libvirt.", this.domains.length ());
+        if (this.domains.length () == 0)
+            throw new LibvirtSystemImporterError.NO_IMPORTS (_("No boxes to import"));
+    }
+
+    public async void import () {
         try {
             yield ensure_disks_readable (disk_paths);
         } catch (GLib.Error error) {
@@ -74,12 +80,6 @@ private class Boxes.LibvirtSystemImporter: GLib.Object {
             return;
         }
 
-        debug ("Fetched %u domains from system libvirt.", this.domains.length ());
-        if (this.domains.length () == 0)
-            throw new LibvirtSystemImporterError.NO_IMPORTS (_("No boxes to import"));
-    }
-
-    public async void import () {
         for (var i = 0; i < configs.length; i++)
             import_domain.begin (configs[i], disk_paths[i], null);
     }


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