[libgovirt] Deprecate VM-related OvirtProxy methods



commit d13b304f552fbd144d46f787c18bed5b72764bd5
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Fri Aug 23 16:17:28 2013 +0200

    Deprecate VM-related OvirtProxy methods
    
    They are now replaced by use of OvirtApi/OvirtCollection methods.

 examples/async-test.c           |   62 ++++++++++---
 examples/sync-test.c            |   16 +++-
 govirt/Makefile.am              |    1 +
 govirt/ovirt-proxy-deprecated.c |  196 +++++++++++++++++++++++++++++++++++++++
 govirt/ovirt-proxy-private.h    |    7 ++
 govirt/ovirt-proxy.c            |  160 -------------------------------
 govirt/ovirt-proxy.h            |   10 ++
 7 files changed, 276 insertions(+), 176 deletions(-)
---
diff --git a/examples/async-test.c b/examples/async-test.c
index f38da5b..3b3a9d9 100644
--- a/examples/async-test.c
+++ b/examples/async-test.c
@@ -27,6 +27,11 @@
 
 static GMainLoop *main_loop;
 
+typedef struct {
+    OvirtProxy *proxy;
+    const char *vm_name;
+} AsyncData;
+
 static gboolean
 authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
                 gboolean retrying, gpointer user_data)
@@ -42,6 +47,7 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
     return TRUE;
 }
 
+
 static void got_ticket_cb(GObject *source_object,
                           GAsyncResult *result,
                           gpointer user_data)
@@ -54,7 +60,6 @@ static void got_ticket_cb(GObject *source_object,
     guint secure_port;
     OvirtVmDisplayType type;
     gchar *ticket = NULL;
-    //GByteArray *ca_cert;
 
     g_debug("Got ticket");
     vm = OVIRT_VM(source_object);
@@ -86,6 +91,7 @@ static void got_ticket_cb(GObject *source_object,
     g_print("\tPort: %d\n", port);
     g_print("\tSecure port: %d\n", secure_port);
     g_print("\tTicket: %s\n", ticket);
+
     g_main_loop_quit(main_loop);
 }
 
@@ -95,18 +101,17 @@ static void vm_started_cb(GObject *source_object,
 {
     GError *error = NULL;
     OvirtVm *vm;
-    OvirtProxy *proxy;
+    AsyncData *data = (AsyncData *)user_data;
 
     g_debug("Started VM");
     vm = OVIRT_VM(source_object);
-    proxy = OVIRT_PROXY(user_data);
     ovirt_vm_start_finish(vm, result, &error);
     if (error != NULL) {
         g_debug("failed to start VM: %s", error->message);
         g_main_loop_quit(main_loop);
         return;
     }
-    ovirt_vm_get_ticket_async(vm, proxy, NULL, got_ticket_cb, proxy);
+    ovirt_vm_get_ticket_async(vm, data->proxy, NULL, got_ticket_cb, data);
 }
 
 static void vms_fetched_cb(GObject *source_object,
@@ -114,22 +119,23 @@ static void vms_fetched_cb(GObject *source_object,
                            gpointer user_data)
 {
     GError *error = NULL;
-    OvirtProxy *proxy;
+    OvirtCollection *vms;
     OvirtVm *vm;
     OvirtVmState state;
+    AsyncData *data = (AsyncData *)user_data;
 
     g_debug("Fetched VMs");
-    proxy = OVIRT_PROXY(source_object);
-    ovirt_proxy_fetch_vms_finish(proxy, result, &error);
+    vms = OVIRT_COLLECTION(source_object);
+    ovirt_collection_fetch_finish(vms, result, &error);
     if (error != NULL) {
         g_debug("failed to fetch VMs: %s", error->message);
         g_main_loop_quit(main_loop);
         return;
     }
 
-    vm = ovirt_proxy_lookup_vm(proxy, user_data);
+    vm = OVIRT_VM(ovirt_collection_lookup_resource(vms, data->vm_name));
     if (vm == NULL) {
-        g_debug("could not find VM '%s'", (char *)user_data);
+        g_debug("could not find VM '%s'", data->vm_name);
         g_main_loop_quit(main_loop);
         return;
     }
@@ -137,15 +143,40 @@ static void vms_fetched_cb(GObject *source_object,
     g_return_if_fail(vm != NULL);
     g_object_get(G_OBJECT(vm), "state", &state, NULL);
     if (state != OVIRT_VM_STATE_UP) {
-        ovirt_vm_start_async(vm, proxy, NULL, vm_started_cb, proxy);
+        ovirt_vm_start_async(vm, data->proxy, NULL, vm_started_cb, data);
         if (error != NULL) {
             g_debug("failed to start VM: %s", error->message);
             g_main_loop_quit(main_loop);
             return;
         }
     } else {
-        ovirt_vm_get_ticket_async(vm, proxy, NULL, got_ticket_cb, proxy);
+        ovirt_vm_get_ticket_async(vm, data->proxy, NULL, got_ticket_cb, data);
+    }
+}
+
+
+static void api_fetched_cb(GObject *source_object,
+                           GAsyncResult *result,
+                           gpointer user_data)
+{
+    GError *error = NULL;
+    OvirtProxy *proxy;
+    OvirtApi *api;
+    OvirtCollection *vms;
+
+    g_debug("Fetched API");
+    proxy = OVIRT_PROXY(source_object);
+    api = ovirt_proxy_fetch_api_finish(proxy, result, &error);
+    if (error != NULL) {
+        g_debug("failed to fetch api: %s", error->message);
+        g_main_loop_quit(main_loop);
+        return;
     }
+
+    vms = ovirt_api_get_vms(api);
+    g_assert(vms != NULL);
+
+    ovirt_collection_fetch_async(vms, proxy, NULL, vms_fetched_cb, user_data);
 }
 
 static void fetched_ca_cert_cb(GObject *source_object,
@@ -170,13 +201,14 @@ static void fetched_ca_cert_cb(GObject *source_object,
         return;
     }
     g_print("\tCA certificate: %p\n", ca_cert);
-    ovirt_proxy_fetch_vms_async(proxy, NULL, vms_fetched_cb, user_data);
+    ovirt_proxy_fetch_api_async(proxy, NULL, api_fetched_cb, user_data);
 }
 
 static gboolean start(gpointer user_data)
 {
     char **argv = (char **)user_data;
     OvirtProxy *proxy = NULL;
+    AsyncData *data;
 
     proxy = ovirt_proxy_new (argv[1]);
     if (proxy == NULL)
@@ -185,10 +217,12 @@ static gboolean start(gpointer user_data)
     g_signal_connect(G_OBJECT(proxy), "authenticate",
                      G_CALLBACK(authenticate_cb), NULL);
 
-
+    data = g_new0(AsyncData, 1);
+    data->proxy = proxy;
+    data->vm_name = argv[2];
     ovirt_proxy_fetch_ca_certificate_async(proxy, NULL,
                                            fetched_ca_cert_cb,
-                                           argv[2]);
+                                           data);
 
     return G_SOURCE_REMOVE;
 }
diff --git a/examples/sync-test.c b/examples/sync-test.c
index 77c3573..e07f8f6 100644
--- a/examples/sync-test.c
+++ b/examples/sync-test.c
@@ -25,6 +25,7 @@
 #include <govirt/govirt.h>
 #include "govirt/glib-compat.h"
 
+
 static gboolean
 authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
                 G_GNUC_UNUSED gboolean retrying, gpointer user_data)
@@ -39,8 +40,11 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
     return TRUE;
 }
 
+
 int main(int argc, char **argv)
 {
+    OvirtApi *api;
+    OvirtCollection *vms;
     OvirtProxy *proxy = NULL;
     OvirtVm *vm = NULL;
     OvirtVmDisplay *display = NULL;
@@ -74,13 +78,21 @@ int main(int argc, char **argv)
     }
     g_object_get(G_OBJECT(proxy), "ca-cert", &ca_cert, NULL);
 
-    ovirt_proxy_fetch_vms(proxy, &error);
+    api = ovirt_proxy_fetch_api(proxy, &error);
     if (error != NULL) {
         g_debug("failed to lookup %s: %s", argv[2], error->message);
         goto error;
     }
 
-    vm = ovirt_proxy_lookup_vm(proxy, argv[2]);
+    g_assert(api != NULL);
+    vms= ovirt_api_get_vms(api);
+    g_assert(vms != NULL);
+    ovirt_collection_fetch(vms, proxy, &error);
+    if (error != NULL) {
+        g_debug("failed to lookup %s: %s", argv[2], error->message);
+        goto error;
+    }
+    vm = OVIRT_VM(ovirt_collection_lookup_resource(vms, argv[2]));
     g_return_val_if_fail(vm != NULL, -1);
     g_object_get(G_OBJECT(vm), "state", &state, NULL);
     if (state != OVIRT_VM_STATE_UP) {
diff --git a/govirt/Makefile.am b/govirt/Makefile.am
index 652452d..f5ddf36 100644
--- a/govirt/Makefile.am
+++ b/govirt/Makefile.am
@@ -44,6 +44,7 @@ libgovirt_la_SOURCES =                                                \
        ovirt-collection.c                                      \
        ovirt-error.c                                           \
        ovirt-proxy.c                                           \
+       ovirt-proxy-deprecated.c                                \
        ovirt-resource.c                                        \
        ovirt-rest-call.c                                       \
        ovirt-utils.c                                           \
diff --git a/govirt/ovirt-proxy-deprecated.c b/govirt/ovirt-proxy-deprecated.c
new file mode 100644
index 0000000..0859544
--- /dev/null
+++ b/govirt/ovirt-proxy-deprecated.c
@@ -0,0 +1,196 @@
+/*
+ * ovirt-proxy-deprecated.c: Deprecated OvirtProxy methods
+ *
+ * Copyright (C) 2011, 2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Author: Christophe Fergeau <cfergeau redhat com>
+ */
+
+#undef OVIRT_DEBUG
+#include <config.h>
+
+#include "govirt.h"
+#include "govirt-private.h"
+
+#include <rest/rest-xml-node.h>
+
+
+static gboolean
+ovirt_proxy_parse_vms_xml(OvirtProxy *proxy, RestXmlNode *root, GError **error)
+{
+    OvirtCollection *collection;
+    GHashTable *resources;
+
+    collection = ovirt_collection_new_from_xml(root, OVIRT_TYPE_COLLECTION, "vms",
+                                               OVIRT_TYPE_VM, "vm", error);
+    if (collection == NULL) {
+        return FALSE;
+    }
+
+    resources = ovirt_collection_get_resources(collection);
+
+    if (proxy->priv->vms != NULL) {
+        g_hash_table_unref(proxy->priv->vms);
+        proxy->priv->vms = NULL;
+    }
+    if (resources != NULL) {
+        proxy->priv->vms = g_hash_table_ref(resources);
+    }
+
+    return TRUE;
+}
+
+
+gboolean ovirt_proxy_fetch_vms(OvirtProxy *proxy, GError **error)
+{
+    RestXmlNode *vms_node;
+
+    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), FALSE);
+
+    vms_node = ovirt_proxy_get_collection_xml(proxy, "vms", error);
+    if (vms_node == NULL)
+        return FALSE;
+
+    ovirt_proxy_parse_vms_xml(proxy, vms_node, error);
+
+    rest_xml_node_unref(vms_node);
+
+    return TRUE;
+}
+
+
+static gboolean fetch_vms_async_cb(OvirtProxy* proxy,
+                                   RestXmlNode *root_node,
+                                   gpointer user_data,
+                                   GError **error)
+{
+    return ovirt_proxy_parse_vms_xml(proxy, root_node, error);
+}
+
+/**
+ * ovirt_proxy_fetch_vms_async:
+ * @proxy: a #OvirtProxy
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ */
+void ovirt_proxy_fetch_vms_async(OvirtProxy *proxy,
+                                 GCancellable *cancellable,
+                                 GAsyncReadyCallback callback,
+                                 gpointer user_data)
+{
+    GSimpleAsyncResult *result;
+
+    g_return_if_fail(OVIRT_IS_PROXY(proxy));
+    g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
+
+    result = g_simple_async_result_new (G_OBJECT(proxy), callback,
+                                        user_data,
+                                        /* Not using the _async function
+                                         * name as is customary as this
+                                         * would trigger a deprecation
+                                         * warning */
+                                        fetch_vms_async_cb);
+    ovirt_proxy_get_collection_xml_async(proxy, "vms", result, cancellable,
+                                         fetch_vms_async_cb, NULL, NULL);
+}
+
+/**
+ * ovirt_proxy_fetch_vms_finish:
+ * @proxy: a #OvirtProxy
+ * @result: (transfer none): async method result
+ *
+ * Return value: (transfer none) (element-type OvirtVm): the list of
+ * #OvirtVm associated with #OvirtProxy. The returned list should not be
+ * freed nor modified, and can become invalid any time a #OvirtProxy call
+ * completes.
+ */
+GList *
+ovirt_proxy_fetch_vms_finish(OvirtProxy *proxy,
+                             GAsyncResult *result,
+                             GError **err)
+{
+    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
+    g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(proxy),
+                                                        fetch_vms_async_cb),
+                         NULL);
+
+    if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
+        return NULL;
+
+    if (proxy->priv->vms != NULL) {
+        return g_hash_table_get_values(proxy->priv->vms);
+    }
+
+    return NULL;
+}
+
+/**
+ * ovirt_proxy_lookup_vm:
+ * @proxy: a #OvirtProxy
+ * @vm_name: name of the virtual machine to lookup
+ *
+ * Looks up a virtual machine whose name is @name. If it cannot be found,
+ * NULL is returned. This method does not initiate any network activity,
+ * the remote VM list must have been fetched with ovirt_proxy_fetch_vms()
+ * or ovirt_proxy_fetch_vms_async() before calling this function.
+ *
+ * Return value: (transfer full): a #OvirtVm whose name is @name or NULL
+ */
+OvirtVm *ovirt_proxy_lookup_vm(OvirtProxy *proxy, const char *vm_name)
+{
+    OvirtVm *vm;
+
+    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
+    g_return_val_if_fail(vm_name != NULL, NULL);
+
+    if (proxy->priv->vms == NULL) {
+        return NULL;
+    }
+
+    vm = g_hash_table_lookup(proxy->priv->vms, vm_name);
+
+    if (vm == NULL) {
+        return NULL;
+    }
+
+    return g_object_ref(vm);
+}
+
+
+/**
+ * ovirt_proxy_get_vms:
+ *
+ * Gets the list of remote VMs from the proxy object.
+ * This method does not initiate any network activity, the remote VM list
+ * must have been fetched with ovirt_proxy_fetch_vms() or
+ * ovirt_proxy_fetch_vms_async() before calling this function.
+ *
+ * Return value: (transfer none) (element-type OvirtVm): the list of
+ * #OvirtVm associated with #OvirtProxy.
+ * The returned list should not be freed nor modified, and can become
+ * invalid any time a #OvirtProxy call completes.
+ */
+GList *ovirt_proxy_get_vms(OvirtProxy *proxy)
+{
+    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
+
+    if (proxy->priv->vms != NULL) {
+        return g_hash_table_get_values(proxy->priv->vms);
+    }
+
+    return NULL;
+}
diff --git a/govirt/ovirt-proxy-private.h b/govirt/ovirt-proxy-private.h
index 5c8df84..92010bc 100644
--- a/govirt/ovirt-proxy-private.h
+++ b/govirt/ovirt-proxy-private.h
@@ -29,6 +29,13 @@
 
 G_BEGIN_DECLS
 
+struct _OvirtProxyPrivate {
+    GHashTable *vms;
+    GByteArray *ca_cert;
+    gboolean admin_mode;
+    OvirtApi *api;
+};
+
 RestXmlNode *ovirt_proxy_get_collection_xml(OvirtProxy *proxy,
                                             const char *href,
                                             GError **error);
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 7fc5df5..0f0f631 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -39,13 +39,6 @@
 
 G_DEFINE_TYPE (OvirtProxy, ovirt_proxy, REST_TYPE_PROXY);
 
-struct _OvirtProxyPrivate {
-    GHashTable *vms;
-    GByteArray *ca_cert;
-    gboolean admin_mode;
-    OvirtApi *api;
-};
-
 #define OVIRT_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), OVIRT_TYPE_PROXY, OvirtProxyPrivate))
 
 enum {
@@ -137,47 +130,6 @@ static void dump_vm(OvirtVm *vm)
 }
 #endif
 
-static gboolean
-ovirt_proxy_parse_vms_xml(OvirtProxy *proxy, RestXmlNode *root, GError **error)
-{
-    OvirtCollection *collection;
-    GHashTable *resources;
-
-    collection = ovirt_collection_new_from_xml(root, OVIRT_TYPE_COLLECTION, "vms",
-                                               OVIRT_TYPE_VM, "vm", error);
-    if (collection == NULL) {
-        return FALSE;
-    }
-
-    resources = ovirt_collection_get_resources(collection);
-
-    if (proxy->priv->vms != NULL) {
-        g_hash_table_unref(proxy->priv->vms);
-        proxy->priv->vms = NULL;
-    }
-    if (resources != NULL) {
-        proxy->priv->vms = g_hash_table_ref(resources);
-    }
-
-    return TRUE;
-}
-
-gboolean ovirt_proxy_fetch_vms(OvirtProxy *proxy, GError **error)
-{
-    RestXmlNode *vms_node;
-
-    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), FALSE);
-
-    vms_node = ovirt_proxy_get_collection_xml(proxy, "vms", error);
-    if (vms_node == NULL)
-        return FALSE;
-
-    ovirt_proxy_parse_vms_xml(proxy, vms_node, error);
-
-    rest_xml_node_unref(vms_node);
-
-    return TRUE;
-}
 
 static const char *ovirt_rest_strip_api_base_dir(const char *path)
 {
@@ -402,94 +354,6 @@ void ovirt_proxy_get_collection_xml_async(OvirtProxy *proxy,
                           (GDestroyNotify)ovirt_proxy_get_collection_async_data_destroy);
 }
 
-static gboolean fetch_vms_async_cb(OvirtProxy* proxy,
-                                   RestXmlNode *root_node,
-                                   gpointer user_data,
-                                   GError **error)
-{
-    return ovirt_proxy_parse_vms_xml(proxy, root_node, error);
-}
-
-/**
- * ovirt_proxy_fetch_vms_async:
- * @proxy: a #OvirtProxy
- * @callback: (scope async): completion callback
- * @user_data: (closure): opaque data for callback
- */
-void ovirt_proxy_fetch_vms_async(OvirtProxy *proxy,
-                                 GCancellable *cancellable,
-                                 GAsyncReadyCallback callback,
-                                 gpointer user_data)
-{
-    GSimpleAsyncResult *result;
-
-    g_return_if_fail(OVIRT_IS_PROXY(proxy));
-    g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
-
-    result = g_simple_async_result_new (G_OBJECT(proxy), callback,
-                                        user_data,
-                                        ovirt_proxy_fetch_vms_async);
-    ovirt_proxy_get_collection_xml_async(proxy, "vms", result, cancellable,
-                                         fetch_vms_async_cb, NULL, NULL);
-}
-
-/**
- * ovirt_proxy_fetch_vms_finish:
- * @proxy: a #OvirtProxy
- * @result: (transfer none): async method result
- *
- * Return value: (transfer none) (element-type OvirtVm): the list of
- * #OvirtVm associated with #OvirtProxy. The returned list should not be
- * freed nor modified, and can become invalid any time a #OvirtProxy call
- * completes.
- */
-GList *
-ovirt_proxy_fetch_vms_finish(OvirtProxy *proxy,
-                             GAsyncResult *result,
-                             GError **err)
-{
-    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
-    g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(proxy),
-                                                        ovirt_proxy_fetch_vms_async),
-                         NULL);
-
-    if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
-        return NULL;
-
-    return ovirt_proxy_get_vms(proxy);
-}
-
-/**
- * ovirt_proxy_lookup_vm:
- * @proxy: a #OvirtProxy
- * @vm_name: name of the virtual machine to lookup
- *
- * Looks up a virtual machine whose name is @name. If it cannot be found,
- * NULL is returned. This method does not initiate any network activity,
- * the remote VM list must have been fetched with ovirt_proxy_fetch_vms()
- * or ovirt_proxy_fetch_vms_async() before calling this function.
- *
- * Return value: (transfer full): a #OvirtVm whose name is @name or NULL
- */
-OvirtVm *ovirt_proxy_lookup_vm(OvirtProxy *proxy, const char *vm_name)
-{
-    OvirtVm *vm;
-
-    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
-    g_return_val_if_fail(vm_name != NULL, NULL);
-
-    if (proxy->priv->vms == NULL) {
-        return NULL;
-    }
-
-    vm = g_hash_table_lookup(proxy->priv->vms, vm_name);
-
-    if (vm == NULL) {
-        return NULL;
-    }
-
-    return g_object_ref(vm);
-}
 
 static GFile *get_ca_cert_file(OvirtProxy *proxy)
 {
@@ -750,30 +614,6 @@ OvirtProxy *ovirt_proxy_new(const char *uri)
                         NULL);
 }
 
-/**
- * ovirt_proxy_get_vms:
- *
- * Gets the list of remote VMs from the proxy object.
- * This method does not initiate any network activity, the remote VM list
- * must have been fetched with ovirt_proxy_fetch_vms() or
- * ovirt_proxy_fetch_vms_async() before calling this function.
- *
- * Return value: (transfer none) (element-type OvirtVm): the list of
- * #OvirtVm associated with #OvirtProxy.
- * The returned list should not be freed nor modified, and can become
- * invalid any time a #OvirtProxy call completes.
- */
-GList *ovirt_proxy_get_vms(OvirtProxy *proxy)
-{
-    g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
-
-    if (proxy->priv->vms != NULL) {
-        return g_hash_table_get_values(proxy->priv->vms);
-    }
-
-    return NULL;
-}
-
 
 static void ovirt_proxy_set_api_from_xml(OvirtProxy *proxy,
                                          RestXmlNode *node,
diff --git a/govirt/ovirt-proxy.h b/govirt/ovirt-proxy.h
index 5c8537d..802a2d9 100644
--- a/govirt/ovirt-proxy.h
+++ b/govirt/ovirt-proxy.h
@@ -62,17 +62,27 @@ struct _OvirtProxyClass {
 GType ovirt_proxy_get_type(void);
 
 OvirtProxy *ovirt_proxy_new(const char *uri);
+
+G_DEPRECATED_FOR(ovirt_collection_lookup_resource)
 OvirtVm *ovirt_proxy_lookup_vm(OvirtProxy *proxy, const char *vm_name);
+
+G_DEPRECATED_FOR(ovirt_collection_get_resources)
 GList *ovirt_proxy_get_vms(OvirtProxy *proxy);
 
+G_DEPRECATED_FOR(ovirt_collection_fetch)
 gboolean ovirt_proxy_fetch_vms(OvirtProxy *proxy, GError **error);
+
+G_DEPRECATED_FOR(ovirt_collection_fetch_async)
 void ovirt_proxy_fetch_vms_async(OvirtProxy *proxy,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);
+
+G_DEPRECATED_FOR(ovirt_collection_fetch_finish)
 GList *ovirt_proxy_fetch_vms_finish(OvirtProxy *proxy,
                                     GAsyncResult *result,
                                     GError **err);
+
 gboolean ovirt_proxy_fetch_ca_certificate(OvirtProxy *proxy, GError **error);
 void ovirt_proxy_fetch_ca_certificate_async(OvirtProxy *proxy,
                                             GCancellable *cancellable,


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