[gnome-boxes/gnome-3-20] libvirt-machine: Ensure status update



commit 0ba866c1aecd4856b95ebfc9437135cc7274deb9
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 d5bf256..306da93 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
@@ -213,8 +216,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]