[gnome-boxes] libvirt-machine-props: create_snapshot() -> LibvirtMachine



commit 233e148547669eac31649ea6b27a80facd8ef1fb
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Dec 22 15:43:53 2015 +0000

    libvirt-machine-props: create_snapshot() -> LibvirtMachine
    
    Move create_snapshot() from LibvirtMachineProperties to LibvirtMachine.

 src/libvirt-machine-properties.vala |    9 ---------
 src/libvirt-machine.vala            |    9 +++++++++
 src/snapshots-property.vala         |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index a3ac5a0..1a86282 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -678,15 +678,6 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
         return machine.domain.get_snapshots ();
     }
 
-    public async GVir.DomainSnapshot create_snapshot () throws GLib.Error {
-        var config = new GVirConfig.DomainSnapshot ();
-        var now = new GLib.DateTime.now_local ();
-        config.set_name (now.format ("%F-%H-%M-%S"));
-        config.set_description (now.format ("%x, %X"));
-
-        return yield machine.domain.create_snapshot_async (config, 0, null);
-    }
-
     private void add_run_in_bg_property (ref List<Boxes.Property> list) {
         if (machine.connection != App.app.default_connection)
             return; // We only autosuspend machines on default connection so this property is N/A to other 
machines
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index 71d24ac..a8c4d0f 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -705,6 +705,15 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
         return null;
     }
 
+    public async GVir.DomainSnapshot create_snapshot () throws GLib.Error {
+        var config = new GVirConfig.DomainSnapshot ();
+        var now = new GLib.DateTime.now_local ();
+        config.set_name (now.format ("%F-%H-%M-%S"));
+        config.set_description (now.format ("%x, %X"));
+
+        return yield domain.create_snapshot_async (config, 0, null);
+    }
+
     private async void wait_for_save () {
         if (!saving)
             return;
diff --git a/src/snapshots-property.vala b/src/snapshots-property.vala
index 3032cee..970303e 100644
--- a/src/snapshots-property.vala
+++ b/src/snapshots-property.vala
@@ -122,7 +122,7 @@ private class Boxes.SnapshotsProperty : Boxes.Property {
             this.activity = _("Creating new snapshot…");
 
         try {
-            var new_snapshot = yield machine.properties.create_snapshot ();
+            var new_snapshot = yield machine.create_snapshot ();
             var new_row = new SnapshotListRow (new_snapshot, machine);
             new_row.notify["activity-message"].connect (row_activity_changed);
             snapshot_list.add (new_row);


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