Blame libvirt-gobject/libvirt-gobject-storage-pool.h

Packit Service ea0369
/*
Packit Service ea0369
 * libvirt-gobject-storage_pool.c: libvirt gobject integration
Packit Service ea0369
 *
Packit Service ea0369
 * Copyright (C) 2010-2011 Red Hat, Inc.
Packit Service ea0369
 *
Packit Service ea0369
 * This library is free software; you can redistribute it and/or
Packit Service ea0369
 * modify it under the terms of the GNU Lesser General Public
Packit Service ea0369
 * License as published by the Free Software Foundation; either
Packit Service ea0369
 * version 2.1 of the License, or (at your option) any later version.
Packit Service ea0369
 *
Packit Service ea0369
 * This library is distributed in the hope that it will be useful,
Packit Service ea0369
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service ea0369
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service ea0369
 * Lesser General Public License for more details.
Packit Service ea0369
 *
Packit Service ea0369
 * You should have received a copy of the GNU Lesser General Public
Packit Service ea0369
 * License along with this library. If not, see
Packit Service ea0369
 * <http://www.gnu.org/licenses/>.
Packit Service ea0369
 *
Packit Service ea0369
 * Author: Daniel P. Berrange <berrange@redhat.com>
Packit Service ea0369
 */
Packit Service ea0369
Packit Service ea0369
#if !defined(__LIBVIRT_GOBJECT_H__) && !defined(LIBVIRT_GOBJECT_BUILD)
Packit Service ea0369
#error "Only <libvirt-gobject/libvirt-gobject.h> can be included directly."
Packit Service ea0369
#endif
Packit Service ea0369
Packit Service ea0369
#ifndef __LIBVIRT_GOBJECT_STORAGE_POOL_H__
Packit Service ea0369
#define __LIBVIRT_GOBJECT_STORAGE_POOL_H__
Packit Service ea0369
Packit Service ea0369
G_BEGIN_DECLS
Packit Service ea0369
Packit Service ea0369
#define GVIR_TYPE_STORAGE_POOL            (gvir_storage_pool_get_type ())
Packit Service ea0369
#define GVIR_STORAGE_POOL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_TYPE_STORAGE_POOL, GVirStoragePool))
Packit Service ea0369
#define GVIR_STORAGE_POOL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_TYPE_STORAGE_POOL, GVirStoragePoolClass))
Packit Service ea0369
#define GVIR_IS_STORAGE_POOL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_TYPE_STORAGE_POOL))
Packit Service ea0369
#define GVIR_IS_STORAGE_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_TYPE_STORAGE_POOL))
Packit Service ea0369
#define GVIR_STORAGE_POOL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_TYPE_STORAGE_POOL, GVirStoragePoolClass))
Packit Service ea0369
Packit Service ea0369
#define GVIR_TYPE_STORAGE_POOL_INFO       (gvir_storage_pool_info_get_type())
Packit Service ea0369
#define GVIR_TYPE_STORAGE_POOL_HANDLE     (gvir_storage_pool_handle_get_type())
Packit Service ea0369
Packit Service ea0369
typedef struct _GVirStoragePool GVirStoragePool;
Packit Service ea0369
typedef struct _GVirStoragePoolPrivate GVirStoragePoolPrivate;
Packit Service ea0369
typedef struct _GVirStoragePoolClass GVirStoragePoolClass;
Packit Service ea0369
Packit Service ea0369
struct _GVirStoragePool
Packit Service ea0369
{
Packit Service ea0369
    GObject parent;
Packit Service ea0369
Packit Service ea0369
    GVirStoragePoolPrivate *priv;
Packit Service ea0369
Packit Service ea0369
    /* Do not add fields to this struct */
Packit Service ea0369
};
Packit Service ea0369
Packit Service ea0369
struct _GVirStoragePoolClass
Packit Service ea0369
{
Packit Service ea0369
    GObjectClass parent_class;
Packit Service ea0369
Packit Service ea0369
    gpointer padding[20];
Packit Service ea0369
};
Packit Service ea0369
Packit Service ea0369
typedef enum {
Packit Service ea0369
    GVIR_STORAGE_POOL_STATE_INACTIVE     = 0, /* Not running */
Packit Service ea0369
    GVIR_STORAGE_POOL_STATE_BUILDING     = 1, /* Initializing pool, not available */
Packit Service ea0369
    GVIR_STORAGE_POOL_STATE_RUNNING      = 2, /* Running normally */
Packit Service ea0369
    GVIR_STORAGE_POOL_STATE_DEGRADED     = 3, /* Running degraded */
Packit Service ea0369
    GVIR_STORAGE_POOL_STATE_INACCESSIBLE = 4, /* Running, but not accessible */
Packit Service ea0369
} GVirStoragePoolState;
Packit Service ea0369
Packit Service ea0369
typedef struct _GVirStoragePoolInfo GVirStoragePoolInfo;
Packit Service ea0369
struct _GVirStoragePoolInfo
Packit Service ea0369
{
Packit Service ea0369
    GVirStoragePoolState state; /* the state */
Packit Service ea0369
    guint64 capacity;           /* Logical size bytes */
Packit Service ea0369
    guint64 allocation;         /* Current allocation bytes */
Packit Service ea0369
    guint64 available;          /* Remaining free space bytes */
Packit Service ea0369
};
Packit Service ea0369
Packit Service ea0369
GType gvir_storage_pool_get_type(void);
Packit Service ea0369
GType gvir_storage_pool_info_get_type(void);
Packit Service ea0369
GType gvir_storage_pool_handle_get_type(void);
Packit Service ea0369
Packit Service ea0369
const gchar *gvir_storage_pool_get_name(GVirStoragePool *pool);
Packit Service ea0369
const gchar *gvir_storage_pool_get_uuid(GVirStoragePool *pool);
Packit Service ea0369
gboolean gvir_storage_pool_get_active(GVirStoragePool *pool);
Packit Service ea0369
gboolean gvir_storage_pool_get_persistent(GVirStoragePool *pool);
Packit Service ea0369
Packit Service ea0369
GVirConfigStoragePool *gvir_storage_pool_get_config(GVirStoragePool *pool,
Packit Service ea0369
                                                    guint flags,
Packit Service ea0369
                                                    GError **err);
Packit Service ea0369
Packit Service ea0369
GVirStoragePoolInfo *gvir_storage_pool_get_info(GVirStoragePool *pool,
Packit Service ea0369
                                                GError **err);
Packit Service ea0369
Packit Service ea0369
gboolean gvir_storage_pool_refresh(GVirStoragePool *pool,
Packit Service ea0369
                                   GCancellable *cancellable,
Packit Service ea0369
                                   GError **err);
Packit Service ea0369
void gvir_storage_pool_refresh_async(GVirStoragePool *pool,
Packit Service ea0369
                                     GCancellable *cancellable,
Packit Service ea0369
                                     GAsyncReadyCallback callback,
Packit Service ea0369
                                     gpointer user_data);
Packit Service ea0369
gboolean gvir_storage_pool_refresh_finish(GVirStoragePool *pool,
Packit Service ea0369
                                          GAsyncResult *result,
Packit Service ea0369
                                          GError **err);
Packit Service ea0369
Packit Service ea0369
GList *gvir_storage_pool_get_volumes(GVirStoragePool *pool);
Packit Service ea0369
GVirStorageVol *gvir_storage_pool_get_volume(GVirStoragePool *pool,
Packit Service ea0369
                                             const gchar *name);
Packit Service ea0369
GVirStorageVol *gvir_storage_pool_create_volume
Packit Service ea0369
                                (GVirStoragePool *pool,
Packit Service ea0369
                                 GVirConfigStorageVol *conf,
Packit Service ea0369
                                 GError **err);
Packit Service ea0369
Packit Service ea0369
gboolean gvir_storage_pool_build (GVirStoragePool *pool,
Packit Service ea0369
                                  guint flags,
Packit Service ea0369
                                  GError **err);
Packit Service ea0369
void gvir_storage_pool_build_async (GVirStoragePool *pool,
Packit Service ea0369
                                    guint flags,
Packit Service ea0369
                                    GCancellable *cancellable,
Packit Service ea0369
                                    GAsyncReadyCallback callback,
Packit Service ea0369
                                    gpointer user_data);
Packit Service ea0369
gboolean gvir_storage_pool_build_finish(GVirStoragePool *pool,
Packit Service ea0369
                                        GAsyncResult *result,
Packit Service ea0369
                                        GError **err);
Packit Service ea0369
Packit Service ea0369
gboolean gvir_storage_pool_undefine (GVirStoragePool *pool,
Packit Service ea0369
                                     GError **err);
Packit Service ea0369
void gvir_storage_pool_undefine_async (GVirStoragePool *pool,
Packit Service ea0369
                                       GCancellable *cancellable,
Packit Service ea0369
                                       GAsyncReadyCallback callback,
Packit Service ea0369
                                       gpointer user_data);
Packit Service ea0369
gboolean gvir_storage_pool_undefine_finish(GVirStoragePool *pool,
Packit Service ea0369
                                           GAsyncResult *result,
Packit Service ea0369
                                           GError **err);
Packit Service ea0369
Packit Service ea0369
gboolean gvir_storage_pool_start (GVirStoragePool *pool,
Packit Service ea0369
                                  guint flags,
Packit Service ea0369
                                  GError **err);
Packit Service ea0369
void gvir_storage_pool_start_async (GVirStoragePool *pool,
Packit Service ea0369
                                    guint flags,
Packit Service ea0369
                                    GCancellable *cancellable,
Packit Service ea0369
                                    GAsyncReadyCallback callback,
Packit Service ea0369
                                    gpointer user_data);
Packit Service ea0369
gboolean gvir_storage_pool_start_finish(GVirStoragePool *pool,
Packit Service ea0369
                                        GAsyncResult *result,
Packit Service ea0369
                                        GError **err);
Packit Service ea0369
Packit Service ea0369
gboolean gvir_storage_pool_stop (GVirStoragePool *pool,
Packit Service ea0369
                                 GError **err);
Packit Service ea0369
void gvir_storage_pool_stop_async (GVirStoragePool *pool,
Packit Service ea0369
                                   GCancellable *cancellable,
Packit Service ea0369
                                   GAsyncReadyCallback callback,
Packit Service ea0369
                                   gpointer user_data);
Packit Service ea0369
gboolean gvir_storage_pool_stop_finish(GVirStoragePool *pool,
Packit Service ea0369
                                       GAsyncResult *result,
Packit Service ea0369
                                       GError **err);
Packit Service ea0369
Packit Service ea0369
gboolean gvir_storage_pool_delete (GVirStoragePool *pool,
Packit Service ea0369
                                   guint flags,
Packit Service ea0369
                                   GError **err);
Packit Service ea0369
void gvir_storage_pool_delete_async (GVirStoragePool *pool,
Packit Service ea0369
                                     guint flags,
Packit Service ea0369
                                     GCancellable *cancellable,
Packit Service ea0369
                                     GAsyncReadyCallback callback,
Packit Service ea0369
                                     gpointer user_data);
Packit Service ea0369
gboolean gvir_storage_pool_delete_finish(GVirStoragePool *pool,
Packit Service ea0369
                                         GAsyncResult *result,
Packit Service ea0369
                                         GError **err);
Packit Service ea0369
gboolean gvir_storage_pool_get_autostart(GVirStoragePool *pool,
Packit Service ea0369
                                         GError **err);
Packit Service ea0369
gboolean gvir_storage_pool_set_autostart(GVirStoragePool *pool,
Packit Service ea0369
                                         gboolean autostart,
Packit Service ea0369
                                         GError **err);
Packit Service ea0369
Packit Service ea0369
G_END_DECLS
Packit Service ea0369
Packit Service ea0369
#endif /* __LIBVIRT_GOBJECT_STORAGE_POOL_H__ */