[gnome-boxes] libvirt-machine: Ensure status update



commit a5fd35c51e76895fa77af8b437526f8cb554655e
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu May 5 14:17:18 2016 +0100

    libvirt-machine: Ensure status update
    
    We were updating status on machine's state change, which assumes that
    domain configuration has already been updated and machine already has
    the latest configuration. Also the status is bound to OS state rather
    than machine's state so it didn't make much sense to bind the update of
    status to machine's state.
    
    Let's update the status on vm_creator property updates instead.

 src/libvirt-machine.vala |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index 111b8de..205d7a1 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -18,6 +18,9 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
             can_delete = !importing;
             under_construction = (value != null && !VMConfigurator.is_live_config (domain_config));
             notify_property ("importing");
+            if (value == null)
+                update_domain_config ();
+            update_status ();
         }
     }
     // If this machine is currently being imported
@@ -215,8 +218,6 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
             state = MachineState.SLEEPING;
         });
         notify["state"].connect (() => {
-            update_status ();
-
             if (state == MachineState.RUNNING) {
                 reconnect_display ();
                 set_stats_enable (true);


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