[gnome-boxes/gnome-3-20] system-importer: Ensure disk reability on import
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/gnome-3-20] system-importer: Ensure disk reability on import
- Date: Wed, 25 May 2016 14:59:45 +0000 (UTC)
commit cec7c7fc8f9b1d2c542da7e4e8a023abd5d4bbbd
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 b273b47..f70144b 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]