[gnome-boxes] libvirt-machine: Sync clock on restore



commit 9e200650650c85acba80c52631fecd70798e8f68
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Nov 23 22:57:08 2015 +0000

    libvirt-machine: Sync clock on restore
    
    On restoring a libvirt VM from saved state, try to sync the guest clock
    with host clock. This will only work if Qemu guest agent is running
    inside the guest.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758321

 src/libvirt-machine.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index c136731..71d24ac 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -599,6 +599,14 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
                 else
                     throw new Boxes.Error.START_FAILED (error.message);
             }
+
+            if (restore) {
+                try {
+                    yield domain.set_time_async (null, 0, null);
+                } catch (GLib.Error error) {
+                    debug ("Failed to update clock on %s: %s", name, error.message);
+                }
+            }
         }
     }
 


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