[gnome-boxes] Set post install config soon after starting domain



commit 93c1ef795463c8204f58b354f237de4afd0a8ab8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Jun 16 05:15:52 2012 +0300

    Set post install config soon after starting domain
    
    There is no need to wait for domain to shutdown first. Since our VMs are
    shared with all apps using libvirt, its a very real scenerio that first
    post-install reboot happens while Boxes is not runnnig: User launches the
    saved (in-installation) domain from another (libvirt-based) app. This
    patch fixes that.
    
    A small bonus of doing this is that it also makes the issue of libvirt
    events not getting in[1] much less severe (i-e Fedora installer wont keep
    installing over and over again).
    
    [1] https://bugzilla.redhat.com/show_bug.cgi?id=819617
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678888

 src/vm-creator.vala |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index 2fcef62..7a6e580 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -71,6 +71,8 @@ private class Boxes.VMCreator {
     public void launch_vm (LibvirtMachine machine, InstallerMedia install_media) throws GLib.Error {
         machine.domain.start (0);
 
+        post_install_setup (machine.domain);
+
         if (!(install_media is UnattendedInstaller) || !(install_media as UnattendedInstaller).express_install) {
             ulong signal_id = 0;
 
@@ -105,7 +107,11 @@ private class Boxes.VMCreator {
         var volume = get_storage_volume (connection, domain, null);
 
         if (guest_installed_os (volume)) {
-            post_install_setup (domain);
+            try {
+                domain.start (0);
+            } catch (GLib.Error error) {
+                warning ("Failed to start domain '%s': %s", domain.get_name (), error.message);
+            }
             domain.disconnect (stopped_id);
         } else {
             try {
@@ -129,9 +135,7 @@ private class Boxes.VMCreator {
         try {
             var config = domain.get_config (0);
             configurator.post_install_setup (config);
-
             domain.set_config (config);
-            domain.start (0);
         } catch (GLib.Error error) {
             warning ("Post-install setup failed for domain '%s': %s", domain.get_uuid (), error.message);
         }



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