[gnome-boxes] vm-creator: Don't start the domain twice



commit a366a72d5aab61c75d976647ddd82f145c5ba379
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Jul 6 03:00:53 2012 +0300

    vm-creator: Don't start the domain twice
    
    This gets rid of the annoying error on the console:
    
    (gnome-boxes:30293): Boxes-WARNING **: libvirt-machine.vala:47: Unable
    to start domain: Requested operation is not valid: domain is already
    running
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679482

 src/vm-creator.vala |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index 7300a04..a3bdcca 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -49,10 +49,6 @@ private class Boxes.VMCreator {
     }
 
     public void launch_vm (LibvirtMachine machine) throws GLib.Error {
-        machine.domain.start (0);
-
-        set_post_install_config (machine);
-
         if (!(install_media is UnattendedInstaller) || !(install_media as UnattendedInstaller).express_install) {
             ulong signal_id = 0;
 
@@ -60,13 +56,16 @@ private class Boxes.VMCreator {
                 if (App.app.ui_state != UIState.COLLECTION)
                     return;
 
-                App.app.select_item (machine);
+                App.app.select_item (machine); // This also starts the domain for us
                 App.app.fullscreen = true;
                 App.app.disconnect (signal_id);
 
                 return;
             });
-        }
+        } else
+            machine.domain.start (0);
+
+        set_post_install_config (machine);
 
         state_changed_id = machine.notify["state"].connect (on_machine_state_changed);
         machine.vm_creator = this;



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