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