[gnome-boxes/wip/show-ip: 5/9] machine: Async constructor



commit b252dbaa17109d2a06df4131f256fa8b129a2c86
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Jul 3 18:19:38 2015 +0100

    machine: Async constructor
    
    In the following patch, we'll need to make async calls.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744004

 src/libvirt-broker.vala  |    2 +-
 src/libvirt-machine.vala |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/libvirt-broker.vala b/src/libvirt-broker.vala
index 6f6a203..348c530 100644
--- a/src/libvirt-broker.vala
+++ b/src/libvirt-broker.vala
@@ -30,7 +30,7 @@ private class Boxes.LibvirtBroker : Boxes.Broker {
         if (machine != null)
             return machine; // Already added
 
-        machine = new LibvirtMachine (source, connection, domain);
+        machine = yield new LibvirtMachine (source, connection, domain);
         machine.suspend_at_exit = (connection == App.app.default_connection);
         App.app.collection.add_item (machine);
         domain.set_data<LibvirtMachine> ("machine", machine);
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index 4d0832d..f0752ed 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -133,9 +133,9 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
         connect_display.begin (Machine.ConnectFlags.NONE);
     }
 
-    public LibvirtMachine (CollectionSource source,
-                           GVir.Connection connection,
-                           GVir.Domain     domain) throws GLib.Error {
+    public async LibvirtMachine (CollectionSource source,
+                                 GVir.Connection connection,
+                                 GVir.Domain     domain) throws GLib.Error {
         var config = domain.get_config (GVir.DomainXMLFlags.INACTIVE);
         var item_name = config.get_title () ?? domain.get_name ();
         base (source, item_name);


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