GduPool

GduPool — Enumerate and monitor storage devices

Synopsis

                    GduPoolPrivate;
                    GduPool;
GduPool *           gdu_pool_new                        (void);
GduPool *           gdu_pool_new_for_address            (const gchar *ssh_user_name,
                                                         const gchar *ssh_address,
                                                         GError **error);
const gchar *       gdu_pool_get_ssh_user_name          (GduPool *pool);
const gchar *       gdu_pool_get_ssh_address            (GduPool *pool);
char *              gdu_pool_get_daemon_version         (GduPool *pool);
gboolean            gdu_pool_is_daemon_inhibited        (GduPool *pool);
gboolean            gdu_pool_supports_luks_devices      (GduPool *pool);
GList *             gdu_pool_get_known_filesystems      (GduPool *pool);
GduKnownFilesystem * gdu_pool_get_known_filesystem_by_id
                                                        (GduPool *pool,
                                                         const char *id);
GduDevice *         gdu_pool_get_by_object_path         (GduPool *pool,
                                                         const char *object_path);
GduDevice *         gdu_pool_get_by_device_file         (GduPool *pool,
                                                         const char *device_file);
GduPresentable *    gdu_pool_get_volume_by_device       (GduPool *pool,
                                                         GduDevice *device);
GduPresentable *    gdu_pool_get_drive_by_device        (GduPool *pool,
                                                         GduDevice *device);
GduLinuxMdDrive *   gdu_pool_get_linux_md_drive_by_uuid (GduPool *pool,
                                                         const gchar *uuid);
GduPresentable *    gdu_pool_get_presentable_by_id      (GduPool *pool,
                                                         const gchar *id);
gboolean            gdu_pool_has_presentable            (GduPool *pool,
                                                         GduPresentable *presentable);
GList *             gdu_pool_get_devices                (GduPool *pool);
GList *             gdu_pool_get_presentables           (GduPool *pool);
GList *             gdu_pool_get_enclosed_presentables  (GduPool *pool,
                                                         GduPresentable *presentable);
GduAdapter *        gdu_pool_get_adapter_by_object_path (GduPool *pool,
                                                         const char *object_path);
GList *             gdu_pool_get_adapters               (GduPool *pool);
GduExpander *       gdu_pool_get_expander_by_object_path
                                                        (GduPool *pool,
                                                         const char *object_path);
GList *             gdu_pool_get_expanders              (GduPool *pool);
GduPort *           gdu_pool_get_port_by_object_path    (GduPool *pool,
                                                         const char *object_path);
GList *             gdu_pool_get_ports                  (GduPool *pool);
GduPresentable *    gdu_pool_get_hub_by_object_path     (GduPool *pool,
                                                         const gchar *object_path);
void                gdu_pool_op_linux_md_start          (GduPool *pool,
                                                         GPtrArray *component_objpaths,
                                                         GduPoolLinuxMdStartCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_md_create         (GduPool *pool,
                                                         GPtrArray *component_objpaths,
                                                         const gchar *level,
                                                         guint64 stripe_size,
                                                         const gchar *name,
                                                         GduPoolLinuxMdCreateCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_vg_start     (GduPool *pool,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2VGStartCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_vg_stop      (GduPool *pool,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2VGStopCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_lv_start     (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2VGStartCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_vg_set_name  (GduPool *pool,
                                                         const gchar *uuid,
                                                         const gchar *new_name,
                                                         GduPoolLinuxLvm2VGSetNameCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_lv_set_name  (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *uuid,
                                                         const gchar *new_name,
                                                         GduPoolLinuxLvm2LVSetNameCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_lv_remove    (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2LVRemoveCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_lv_create    (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *name,
                                                         guint64 size,
                                                         guint num_stripes,
                                                         guint64 stripe_size,
                                                         guint num_mirrors,
                                                         const char *fstype,
                                                         const char *fslabel,
                                                         const char *encrypt_passphrase,
                                                         gboolean fs_take_ownership,
                                                         GduPoolLinuxLvm2LVCreateCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_vg_add_pv    (GduPool *pool,
                                                         const gchar *uuid,
                                                         const gchar *physical_volume_object_path,
                                                         GduPoolLinuxLvm2VGAddPVCompletedFunc callback,
                                                         gpointer user_data);
void                gdu_pool_op_linux_lvm2_vg_remove_pv (GduPool *pool,
                                                         const gchar *vg_uuid,
                                                         const gchar *pv_uuid,
                                                         GduPoolLinuxLvm2VGRemovePVCompletedFunc callback,
                                                         gpointer user_data);

Object Hierarchy

  GObject
   +----GduPool

Signals

  "adapter-added"                                  : Run Last
  "adapter-changed"                                : Run Last
  "adapter-removed"                                : Run Last
  "device-added"                                   : Run Last
  "device-changed"                                 : Run Last
  "device-job-changed"                             : Run Last
  "device-removed"                                 : Run Last
  "disconnected"                                   : Run Last
  "expander-added"                                 : Run Last
  "expander-changed"                               : Run Last
  "expander-removed"                               : Run Last
  "port-added"                                     : Run Last
  "port-changed"                                   : Run Last
  "port-removed"                                   : Run Last
  "presentable-added"                              : Run Last
  "presentable-changed"                            : Run Last
  "presentable-job-changed"                        : Run Last
  "presentable-removed"                            : Run Last

Description

The GduPool object represents a connection to the udisks daemon.

Details

GduPoolPrivate

typedef struct _GduPoolPrivate GduPoolPrivate;


GduPool

typedef struct _GduPool GduPool;


gdu_pool_new ()

GduPool *           gdu_pool_new                        (void);

Create a new GduPool object.

Returns :

A GduPool object. Caller must free this object using g_object_unref().

gdu_pool_new_for_address ()

GduPool *           gdu_pool_new_for_address            (const gchar *ssh_user_name,
                                                         const gchar *ssh_address,
                                                         GError **error);

ssh_user_name :

ssh_address :

error :

Returns :


gdu_pool_get_ssh_user_name ()

const gchar *       gdu_pool_get_ssh_user_name          (GduPool *pool);

pool :

Returns :


gdu_pool_get_ssh_address ()

const gchar *       gdu_pool_get_ssh_address            (GduPool *pool);

pool :

Returns :


gdu_pool_get_daemon_version ()

char *              gdu_pool_get_daemon_version         (GduPool *pool);

Get the version of the udisks on the system.

pool :

A GduPool.

Returns :

The version of udisks daemon. Caller must free this string using g_free().

gdu_pool_is_daemon_inhibited ()

gboolean            gdu_pool_is_daemon_inhibited        (GduPool *pool);

Checks if the daemon is currently inhibited.

pool :

A GduPool.

Returns :

TRUE if the daemon is inhibited.

gdu_pool_supports_luks_devices ()

gboolean            gdu_pool_supports_luks_devices      (GduPool *pool);

Determine if the udisks daemon supports LUKS encrypted devices.

pool :

A GduPool.

Returns :

TRUE only if the daemon supports LUKS encrypted devices.

gdu_pool_get_known_filesystems ()

GList *             gdu_pool_get_known_filesystems      (GduPool *pool);

Get a list of file systems known to the udisks daemon.

pool :

A GduPool.

Returns :

A GList of GduKnownFilesystem objects. Caller must free this (unref all objects, then use g_list_free()).

gdu_pool_get_known_filesystem_by_id ()

GduKnownFilesystem * gdu_pool_get_known_filesystem_by_id
                                                        (GduPool *pool,
                                                         const char *id);

Looks up a known file system by id.

pool :

A GduPool.

id :

Identifier for the file system, e.g. ext3 or vfat.

Returns :

A GduKnownFilesystem object or NULL if file system corresponding to id exists. Caller must free this object using g_object_unref().

gdu_pool_get_by_object_path ()

GduDevice *         gdu_pool_get_by_object_path         (GduPool *pool,
                                                         const char *object_path);

Looks up GduPort object for object_path.

pool :

the pool

object_path :

the D-Bus object path

Returns :

A GduPort object for object_path, otherwise NULL. Caller must unref this object using g_object_unref().

gdu_pool_get_by_device_file ()

GduDevice *         gdu_pool_get_by_device_file         (GduPool *pool,
                                                         const char *device_file);

Looks up GduDevice object for device_file.

pool :

the device pool

device_file :

the UNIX block special device file, e.g. /dev/sda1.

Returns :

A GduDevice object for object_path, otherwise NULL. Caller must unref this object using g_object_unref().

gdu_pool_get_volume_by_device ()

GduPresentable *    gdu_pool_get_volume_by_device       (GduPool *pool,
                                                         GduDevice *device);

Given device, find the GduVolume object for it.

pool :

A GduPool.

device :

A GduDevice.

Returns :

A GduVolume object or NULL if no device isn't a volume. Caller must free this object with g_object_unref().

gdu_pool_get_drive_by_device ()

GduPresentable *    gdu_pool_get_drive_by_device        (GduPool *pool,
                                                         GduDevice *device);

Given device, find the GduDrive object for it.

pool :

A GduPool.

device :

A GduDevice.

Returns :

A GduDrive object or NULL if no device isn't a drive. Caller must free this object with g_object_unref().

gdu_pool_get_linux_md_drive_by_uuid ()

GduLinuxMdDrive *   gdu_pool_get_linux_md_drive_by_uuid (GduPool *pool,
                                                         const gchar *uuid);

pool :

uuid :

Returns :


gdu_pool_get_presentable_by_id ()

GduPresentable *    gdu_pool_get_presentable_by_id      (GduPool *pool,
                                                         const gchar *id);

pool :

id :

Returns :


gdu_pool_has_presentable ()

gboolean            gdu_pool_has_presentable            (GduPool *pool,
                                                         GduPresentable *presentable);

pool :

presentable :

Returns :


gdu_pool_get_devices ()

GList *             gdu_pool_get_devices                (GduPool *pool);

Get a list of all devices. The returned list is topologically sorted, e.g. for any device A with a dependency on a device B, A is guaranteed to appear after B.

pool :

A GduPool.

Returns :

A GList of GduDevice objects. Caller must free this (unref all objects, then use g_list_free()).

gdu_pool_get_presentables ()

GList *             gdu_pool_get_presentables           (GduPool *pool);

Get a list of all presentables.

pool :

A GduPool

Returns :

A GList of objects implementing the GduPresentable interface. Caller must free this (unref all objects, then use g_list_free()).

gdu_pool_get_enclosed_presentables ()

GList *             gdu_pool_get_enclosed_presentables  (GduPool *pool,
                                                         GduPresentable *presentable);

pool :

presentable :

Returns :


gdu_pool_get_adapter_by_object_path ()

GduAdapter *        gdu_pool_get_adapter_by_object_path (GduPool *pool,
                                                         const char *object_path);

Looks up GduAdapter object for object_path.

pool :

the pool

object_path :

the D-Bus object path

Returns :

A GduAdapter object for object_path, otherwise NULL. Caller must unref this object using g_object_unref().

gdu_pool_get_adapters ()

GList *             gdu_pool_get_adapters               (GduPool *pool);

Get a list of all adapters.

pool :

A GduPool.

Returns :

A GList of GduAdapter objects. Caller must free this (unref all objects, then use g_list_free()).

gdu_pool_get_expander_by_object_path ()

GduExpander *       gdu_pool_get_expander_by_object_path
                                                        (GduPool *pool,
                                                         const char *object_path);

Looks up GduExpander object for object_path.

pool :

the pool

object_path :

the D-Bus object path

Returns :

A GduExpander object for object_path, otherwise NULL. Caller must unref this object using g_object_unref().

gdu_pool_get_expanders ()

GList *             gdu_pool_get_expanders              (GduPool *pool);

Get a list of all expanders.

pool :

A GduPool.

Returns :

A GList of GduExpander objects. Caller must free this (unref all objects, then use g_list_free()).

gdu_pool_get_port_by_object_path ()

GduPort *           gdu_pool_get_port_by_object_path    (GduPool *pool,
                                                         const char *object_path);

pool :

object_path :

Returns :


gdu_pool_get_ports ()

GList *             gdu_pool_get_ports                  (GduPool *pool);

Get a list of all ports.

pool :

A GduPool.

Returns :

A GList of GduPort objects. Caller must free this (unref all objects, then use g_list_free()).

gdu_pool_get_hub_by_object_path ()

GduPresentable *    gdu_pool_get_hub_by_object_path     (GduPool *pool,
                                                         const gchar *object_path);

pool :

object_path :

Returns :


gdu_pool_op_linux_md_start ()

void                gdu_pool_op_linux_md_start          (GduPool *pool,
                                                         GPtrArray *component_objpaths,
                                                         GduPoolLinuxMdStartCompletedFunc callback,
                                                         gpointer user_data);

Starts a Linux md Software Array.

pool :

A GduPool.

component_objpaths :

A GPtrArray of object paths.

callback :

Callback function.

user_data :

User data to pass to callback.

gdu_pool_op_linux_md_create ()

void                gdu_pool_op_linux_md_create         (GduPool *pool,
                                                         GPtrArray *component_objpaths,
                                                         const gchar *level,
                                                         guint64 stripe_size,
                                                         const gchar *name,
                                                         GduPoolLinuxMdCreateCompletedFunc callback,
                                                         gpointer user_data);

Creates a Linux md Software Array.

pool :

A GduPool.

component_objpaths :

A GPtrArray of object paths.

level :

RAID level.

stripe_size :

name :

Name of array.

callback :

Callback function.

user_data :

User data to pass to callback.

gdu_pool_op_linux_lvm2_vg_start ()

void                gdu_pool_op_linux_lvm2_vg_start     (GduPool *pool,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2VGStartCompletedFunc callback,
                                                         gpointer user_data);

pool :

uuid :

callback :

user_data :


gdu_pool_op_linux_lvm2_vg_stop ()

void                gdu_pool_op_linux_lvm2_vg_stop      (GduPool *pool,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2VGStopCompletedFunc callback,
                                                         gpointer user_data);

pool :

uuid :

callback :

user_data :


gdu_pool_op_linux_lvm2_lv_start ()

void                gdu_pool_op_linux_lvm2_lv_start     (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2VGStartCompletedFunc callback,
                                                         gpointer user_data);

pool :

group_uuid :

uuid :

callback :

user_data :


gdu_pool_op_linux_lvm2_vg_set_name ()

void                gdu_pool_op_linux_lvm2_vg_set_name  (GduPool *pool,
                                                         const gchar *uuid,
                                                         const gchar *new_name,
                                                         GduPoolLinuxLvm2VGSetNameCompletedFunc callback,
                                                         gpointer user_data);

pool :

uuid :

new_name :

callback :

user_data :


gdu_pool_op_linux_lvm2_lv_set_name ()

void                gdu_pool_op_linux_lvm2_lv_set_name  (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *uuid,
                                                         const gchar *new_name,
                                                         GduPoolLinuxLvm2LVSetNameCompletedFunc callback,
                                                         gpointer user_data);

pool :

group_uuid :

uuid :

new_name :

callback :

user_data :


gdu_pool_op_linux_lvm2_lv_remove ()

void                gdu_pool_op_linux_lvm2_lv_remove    (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *uuid,
                                                         GduPoolLinuxLvm2LVRemoveCompletedFunc callback,
                                                         gpointer user_data);

pool :

group_uuid :

uuid :

callback :

user_data :


gdu_pool_op_linux_lvm2_lv_create ()

void                gdu_pool_op_linux_lvm2_lv_create    (GduPool *pool,
                                                         const gchar *group_uuid,
                                                         const gchar *name,
                                                         guint64 size,
                                                         guint num_stripes,
                                                         guint64 stripe_size,
                                                         guint num_mirrors,
                                                         const char *fstype,
                                                         const char *fslabel,
                                                         const char *encrypt_passphrase,
                                                         gboolean fs_take_ownership,
                                                         GduPoolLinuxLvm2LVCreateCompletedFunc callback,
                                                         gpointer user_data);

pool :

group_uuid :

name :

size :

num_stripes :

stripe_size :

num_mirrors :

fstype :

fslabel :

encrypt_passphrase :

fs_take_ownership :

callback :

user_data :


gdu_pool_op_linux_lvm2_vg_add_pv ()

void                gdu_pool_op_linux_lvm2_vg_add_pv    (GduPool *pool,
                                                         const gchar *uuid,
                                                         const gchar *physical_volume_object_path,
                                                         GduPoolLinuxLvm2VGAddPVCompletedFunc callback,
                                                         gpointer user_data);

pool :

uuid :

physical_volume_object_path :

callback :

user_data :


gdu_pool_op_linux_lvm2_vg_remove_pv ()

void                gdu_pool_op_linux_lvm2_vg_remove_pv (GduPool *pool,
                                                         const gchar *vg_uuid,
                                                         const gchar *pv_uuid,
                                                         GduPoolLinuxLvm2VGRemovePVCompletedFunc callback,
                                                         gpointer user_data);

pool :

vg_uuid :

pv_uuid :

callback :

user_data :

Signal Details

The "adapter-added" signal

void                user_function                      (GduPool    *pool,
                                                        GduAdapter *adapter,
                                                        gpointer    user_data)      : Run Last

Emitted when adapter is added to pool.

pool :

The GduPool emitting the signal.

adapter :

The GduAdapter that was added.

user_data :

user data set when the signal handler was connected.

The "adapter-changed" signal

void                user_function                      (GduPool    *pool,
                                                        GduAdapter *adapter,
                                                        gpointer    user_data)      : Run Last

Emitted when adapter is changed.

pool :

The GduPool emitting the signal.

adapter :

A GduAdapter.

user_data :

user data set when the signal handler was connected.

The "adapter-removed" signal

void                user_function                      (GduPool    *pool,
                                                        GduAdapter *adapter,
                                                        gpointer    user_data)      : Run Last

Emitted when adapter is removed from pool. Recipients should release references to adapter.

pool :

The GduPool emitting the signal.

adapter :

The GduAdapter that was removed.

user_data :

user data set when the signal handler was connected.

The "device-added" signal

void                user_function                      (GduPool   *pool,
                                                        GduDevice *device,
                                                        gpointer   user_data)      : Run Last

Emitted when device is added to pool.

pool :

The GduPool emitting the signal.

device :

The GduDevice that was added.

user_data :

user data set when the signal handler was connected.

The "device-changed" signal

void                user_function                      (GduPool   *pool,
                                                        GduDevice *device,
                                                        gpointer   user_data)      : Run Last

Emitted when device is changed.

pool :

The GduPool emitting the signal.

device :

A GduDevice.

user_data :

user data set when the signal handler was connected.

The "device-job-changed" signal

void                user_function                      (GduPool   *pool,
                                                        GduDevice *device,
                                                        gpointer   user_data)      : Run Last

Emitted when job status on device changes.

pool :

The GduPool emitting the signal.

device :

A GduDevice.

user_data :

user data set when the signal handler was connected.

The "device-removed" signal

void                user_function                      (GduPool   *pool,
                                                        GduDevice *device,
                                                        gpointer   user_data)      : Run Last

Emitted when device is removed from pool. Recipients should release references to device.

pool :

The GduPool emitting the signal.

device :

The GduDevice that was removed.

user_data :

user data set when the signal handler was connected.

The "disconnected" signal

void                user_function                      (GduPool *pool,
                                                        gpointer user_data)      : Run Last

Emitted when the underlying connection has been disconnected.

If you hold a reference to pool, now is a good time to give it up.

pool :

The GduPool emitting the signal.

user_data :

user data set when the signal handler was connected.

The "expander-added" signal

void                user_function                      (GduPool     *pool,
                                                        GduExpander *expander,
                                                        gpointer     user_data)      : Run Last

Emitted when expander is added to pool.

pool :

The GduPool emitting the signal.

expander :

The GduExpander that was added.

user_data :

user data set when the signal handler was connected.

The "expander-changed" signal

void                user_function                      (GduPool     *pool,
                                                        GduExpander *expander,
                                                        gpointer     user_data)      : Run Last

Emitted when expander is changed.

pool :

The GduPool emitting the signal.

expander :

A GduExpander.

user_data :

user data set when the signal handler was connected.

The "expander-removed" signal

void                user_function                      (GduPool     *pool,
                                                        GduExpander *expander,
                                                        gpointer     user_data)      : Run Last

Emitted when expander is removed from pool. Recipients should release references to expander.

pool :

The GduPool emitting the signal.

expander :

The GduExpander that was removed.

user_data :

user data set when the signal handler was connected.

The "port-added" signal

void                user_function                      (GduPool *pool,
                                                        GduPort *port,
                                                        gpointer user_data)      : Run Last

Emitted when port is added to pool.

pool :

The GduPool emitting the signal.

port :

The GduPort that was added.

user_data :

user data set when the signal handler was connected.

The "port-changed" signal

void                user_function                      (GduPool *pool,
                                                        GduPort *port,
                                                        gpointer user_data)      : Run Last

Emitted when port is changed.

pool :

The GduPool emitting the signal.

port :

A GduPort.

user_data :

user data set when the signal handler was connected.

The "port-removed" signal

void                user_function                      (GduPool *pool,
                                                        GduPort *port,
                                                        gpointer user_data)      : Run Last

Emitted when port is removed from pool. Recipients should release references to port.

pool :

The GduPool emitting the signal.

port :

The GduPort that was removed.

user_data :

user data set when the signal handler was connected.

The "presentable-added" signal

void                user_function                      (GduPool        *pool,
                                                        GduPresentable *presentable,
                                                        gpointer        user_data)        : Run Last

Emitted when presentable is added to pool.

pool :

The GduPool emitting the signal.

presentable :

The GduPresentable that was added.

user_data :

user data set when the signal handler was connected.

The "presentable-changed" signal

void                user_function                      (GduPool        *pool,
                                                        GduPresentable *presentable,
                                                        gpointer        user_data)        : Run Last

Emitted when presentable changes.

pool :

The GduPool emitting the signal.

presentable :

A GduPresentable.

user_data :

user data set when the signal handler was connected.

The "presentable-job-changed" signal

void                user_function                      (GduPool        *pool,
                                                        GduPresentable *presentable,
                                                        gpointer        user_data)        : Run Last

Emitted when job status on presentable changes.

pool :

The GduPool emitting the signal.

presentable :

A GduPresentable.

user_data :

user data set when the signal handler was connected.

The "presentable-removed" signal

void                user_function                      (GduPool        *pool,
                                                        GduPresentable *presentable,
                                                        gpointer        user_data)        : Run Last

Emitted when presentable is removed from pool. Recipients should release references to presentable.

pool :

The GduPool emitting the signal.

presentable :

The GduPresentable that was removed.

user_data :

user data set when the signal handler was connected.