[libgovirt] Add ovirt_vm_pool_allocate_vm_async()



commit a13a0d782dc4ada2b2c1592ff1ba69c3c7a2f798
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Wed Dec 4 14:58:55 2013 +0100

    Add ovirt_vm_pool_allocate_vm_async()
    
    The implementation is fairly simple using the generic OvirtResource async
    helpers.

 govirt/govirt.sym      |    2 ++
 govirt/ovirt-vm-pool.c |   18 ++++++++++++++++++
 govirt/ovirt-vm-pool.h |    6 ++++++
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/govirt/govirt.sym b/govirt/govirt.sym
index 49636d5..4700446 100644
--- a/govirt/govirt.sym
+++ b/govirt/govirt.sym
@@ -93,6 +93,8 @@ GOVIRT_0.3.1 {
         ovirt_vm_pool_get_type;
         ovirt_vm_pool_new;
         ovirt_vm_pool_allocate_vm;
+        ovirt_vm_pool_allocate_vm_async;
+        ovirt_vm_pool_allocate_vm_finish;
 } GOVIRT_0.2.1;
 
 # .... define new API here using predicted next version number ....
diff --git a/govirt/ovirt-vm-pool.c b/govirt/ovirt-vm-pool.c
index 27edcd2..ebbf3ae 100644
--- a/govirt/ovirt-vm-pool.c
+++ b/govirt/ovirt-vm-pool.c
@@ -178,6 +178,24 @@ gboolean ovirt_vm_pool_allocate_vm(OvirtVmPool *vm_pool, OvirtProxy *proxy, GErr
 }
 
 
+void ovirt_vm_pool_allocate_vm_async(OvirtVmPool *vm_pool, OvirtProxy *proxy,
+                                     GCancellable *cancellable,
+                                     GAsyncReadyCallback callback,
+                                     gpointer user_data)
+{
+    ovirt_resource_invoke_action_async(OVIRT_RESOURCE(vm_pool), "allocatevm",
+                                       proxy, NULL, cancellable,
+                                       callback, user_data);
+}
+
+
+gboolean ovirt_vm_pool_allocate_vm_finish(OvirtVmPool *vm_pool,
+                                          GAsyncResult *result, GError **err)
+{
+    return ovirt_resource_action_finish(OVIRT_RESOURCE(vm_pool), result, err);
+}
+
+
 static gboolean vm_pool_set_size_from_xml(OvirtVmPool *vm_pool, RestXmlNode *node)
 {
     RestXmlNode *size_node;
diff --git a/govirt/ovirt-vm-pool.h b/govirt/ovirt-vm-pool.h
index e4245cb..ee2f55c 100644
--- a/govirt/ovirt-vm-pool.h
+++ b/govirt/ovirt-vm-pool.h
@@ -59,6 +59,12 @@ GType ovirt_vm_pool_get_type(void);
 OvirtVmPool *ovirt_vm_pool_new(void);
 
 gboolean ovirt_vm_pool_allocate_vm(OvirtVmPool *vm_pool, OvirtProxy *proxy, GError **error);
+void ovirt_vm_pool_allocate_vm_async(OvirtVmPool *vm_pool, OvirtProxy *proxy,
+                                     GCancellable *cancellable,
+                                     GAsyncReadyCallback callback,
+                                     gpointer user_data);
+gboolean ovirt_vm_pool_allocate_vm_finish(OvirtVmPool *vm_pool,
+                                          GAsyncResult *result, GError **err);
 
 G_END_DECLS
 


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