![]() |
![]() |
![]() |
Libvirt-gobject Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
struct GVirStorageVol; struct GVirStorageVolClass; enum GVirStorageVolType; enum GVirStorageVolResizeFlags; struct GVirStorageVolInfo; const gchar * gvir_storage_vol_get_name (GVirStorageVol *vol
); const gchar * gvir_storage_vol_get_path (GVirStorageVol *vol
,GError **error
); 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
); gboolean gvir_storage_vol_resize (GVirStorageVol *vol
,guint64 capacity
,guint flags
,GError **err
); gboolean gvir_storage_vol_download (GVirStorageVol *vol
,GVirStream *stream
,guint64 offset
,guint64 length
,guint flags
,GError **err
); gboolean gvir_storage_vol_upload (GVirStorageVol *vol
,GVirStream *stream
,guint64 offset
,guint64 length
,guint flags
,GError **err
);
"handle" GVirStorageVolHandle* : Read / Write / Construct Only "pool" GVirStoragePool* : Read / Write / Construct Only
struct GVirStorageVolClass { GObjectClass parent_class; gpointer padding[20]; };
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;
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;
No flags | |
force allocation of new size | |
size is relative to current | |
allow decrease in capacity. This combined with GVIR_STORAGE_VOL_RESIZE_DELTA, implies a negative delta. |
struct GVirStorageVolInfo { GVirStorageVolType type; /* Type flags */ guint64 capacity; /* Logical size bytes */ guint64 allocation; /* Current allocation bytes */ };
const gchar * gvir_storage_vol_get_path (GVirStorageVol *vol
,GError **error
);
gboolean gvir_storage_vol_delete (GVirStorageVol *vol
,guint flags
,GError **err
);
Deletes the storage volume vol
.
|
the storage volume to delete |
|
the flags |
|
Return location for errors, or NULL |
Returns : |
TRUE on success, FALSE otherwise |
GVirConfigStorageVol * gvir_storage_vol_get_config (GVirStorageVol *vol
,guint flags
,GError **err
);
|
the storage_vol |
|
the flags |
|
Place-holder for possible errors |
Returns : |
the config. The returned object should be
unreffed with g_object_unref() when no longer needed. [transfer full]
|
GVirStorageVolInfo * gvir_storage_vol_get_info (GVirStorageVol *vol
,GError **err
);
|
the storage_vol |
|
Place-holder for possible errors |
Returns : |
the info. The returned object should be
unreffed with g_object_unref() when no longer needed. [transfer full]
|
gboolean gvir_storage_vol_resize (GVirStorageVol *vol
,guint64 capacity
,guint flags
,GError **err
);
Changes the capacity of the storage volume vol
to capacity
.
|
the storage volume to resize |
|
the new capacity of the volume |
|
the flags. [type GVirStorageVolResizeFlags] |
|
Return location for errors, or NULL |
Returns : |
TRUE success, FALSE otherwise |
gboolean gvir_storage_vol_download (GVirStorageVol *vol
,GVirStream *stream
,guint64 offset
,guint64 length
,guint flags
,GError **err
);
|
the storage volume to download from |
|
stream to use as output |
|
position in vol to start reading from |
|
limit on amount of data to download, or 0 for downloading all data |
|
extra flags, not used yet, pass 0 |
Returns : |
TRUE of success, FALSE otherwise |
gboolean gvir_storage_vol_upload (GVirStorageVol *vol
,GVirStream *stream
,guint64 offset
,guint64 length
,guint flags
,GError **err
);
|
the storage volume to upload |
|
stream to use as input |
|
position in vol to start to write to |
|
limit on amount of data to upload, or 0 for uploading all data |
|
the flags, not set yet, pass 0 |
Returns : |
TRUE of success, FALSE otherwise |
"handle"
property "handle" GVirStorageVolHandle* : Read / Write / Construct Only
The storage_vol handle.
"pool"
property"pool" GVirStoragePool* : Read / Write / Construct Only
The containing storage pool.