GVirStorageVol

GVirStorageVol

Synopsis

struct              GVirStorageVol;
struct              GVirStorageVolClass;
struct              GVirStorageVolInfo;
enum                GVirStorageVolResizeFlags;
enum                GVirStorageVolType;
gboolean            gvir_storage_vol_delete             (GVirStorageVol *vol,
                                                         guint flags,
                                                         GError **err);
GVirConfigStorageVol * gvir_storage_vol_get_config      (GVirStorageVol *vol,
                                                         guint flags,
                                                         GError **err);
GVirStorageVolInfo * gvir_storage_vol_get_info          (GVirStorageVol *vol,
                                                         GError **err);
const gchar *       gvir_storage_vol_get_name           (GVirStorageVol *vol);
const gchar *       gvir_storage_vol_get_path           (GVirStorageVol *vol,
                                                         GError **error);
gboolean            gvir_storage_vol_resize             (GVirStorageVol *vol,
                                                         guint64 capacity,
                                                         guint flags,
                                                         GError **err);

Object Hierarchy

  GObject
   +----GVirStorageVol
  GBoxed
   +----GVirStorageVolInfo

Properties

  "handle"                   GVirStorageVolHandle*  : Read / Write / Construct Only
  "pool"                     GVirStoragePool*      : Read / Write / Construct Only

Description

Details

struct GVirStorageVol

struct GVirStorageVol;

struct GVirStorageVolClass

struct GVirStorageVolClass {
    GObjectClass parent_class;

    gpointer padding[20];
};

struct GVirStorageVolInfo

struct GVirStorageVolInfo {
    GVirStorageVolType type; /* Type flags */
    guint64 capacity;        /* Logical size bytes */
    guint64 allocation;      /* Current allocation bytes */
};

enum GVirStorageVolResizeFlags

typedef enum {
    GVIR_STORAGE_VOL_RESIZE_NONE     = 0,
    GVIR_STORAGE_VOL_RESIZE_ALLOCATE = VIR_STORAGE_VOL_RESIZE_ALLOCATE,
    GVIR_STORAGE_VOL_RESIZE_DELTA    = VIR_STORAGE_VOL_RESIZE_DELTA,
    GVIR_STORAGE_VOL_RESIZE_SHRINK   = VIR_STORAGE_VOL_RESIZE_SHRINK,
} GVirStorageVolResizeFlags;

GVIR_STORAGE_VOL_RESIZE_NONE

No flags

GVIR_STORAGE_VOL_RESIZE_ALLOCATE

force allocation of new size

GVIR_STORAGE_VOL_RESIZE_DELTA

size is relative to current

GVIR_STORAGE_VOL_RESIZE_SHRINK

allow decrease in capacity. This combined with GVIR_STORAGE_VOL_RESIZE_DELTA, implies a negative delta.

enum GVirStorageVolType

typedef enum {
    GVIR_STORAGE_VOL_STATE_FILE  = 0, /* Regular file based volume */
    GVIR_STORAGE_VOL_STATE_BLOCK = 1, /* Block based volume */
    GVIR_STORAGE_VOL_STATE_DIR   = 2, /* Directory-passthrough based volume */
} GVirStorageVolType;

gvir_storage_vol_delete ()

gboolean            gvir_storage_vol_delete             (GVirStorageVol *vol,
                                                         guint flags,
                                                         GError **err);

Deletes the storage volume vol.

vol :

the storage volume to delete

flags :

the flags

err :

Return location for errors, or NULL

Returns :

TRUE on success, FALSE otherwise

gvir_storage_vol_get_config ()

GVirConfigStorageVol * gvir_storage_vol_get_config      (GVirStorageVol *vol,
                                                         guint flags,
                                                         GError **err);

vol :

the storage_vol

flags :

the flags Returns: (transfer full): the config

gvir_storage_vol_get_info ()

GVirStorageVolInfo * gvir_storage_vol_get_info          (GVirStorageVol *vol,
                                                         GError **err);

vol :

the storage_vol Returns: (transfer full): the info

gvir_storage_vol_get_name ()

const gchar *       gvir_storage_vol_get_name           (GVirStorageVol *vol);

gvir_storage_vol_get_path ()

const gchar *       gvir_storage_vol_get_path           (GVirStorageVol *vol,
                                                         GError **error);

gvir_storage_vol_resize ()

gboolean            gvir_storage_vol_resize             (GVirStorageVol *vol,
                                                         guint64 capacity,
                                                         guint flags,
                                                         GError **err);

Changes the capacity of the storage volume vol to capacity.

vol :

the storage volume to resize

capacity :

the new capacity of the volume

flags :

the flags. [type GVirStorageVolResizeFlags]

err :

Return location for errors, or NULL

Returns :

TRUE success, FALSE otherwise

Property Details

The "handle" property

  "handle"                   GVirStorageVolHandle*  : Read / Write / Construct Only

The storage_vol handle.


The "pool" property

  "pool"                     GVirStoragePool*      : Read / Write / Construct Only

The containing storage pool.