GduPool

GduPool — Enumerate and monitor storage devices

Synopsis

                    GduPoolPrivate;
                    GduPool;
GduPool *           gdu_pool_new                        (void);
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);
GduPresentable *    gdu_pool_get_presentable_by_id      (GduPool *pool,
                                                         const gchar *id);
GList *             gdu_pool_get_devices                (GduPool *pool);
GList *             gdu_pool_get_presentables           (GduPool *pool);
GList *             gdu_pool_get_enclosed_presentables  (GduPool *pool,
                                                         GduPresentable *presentable);
void                gdu_pool_op_linux_md_start          (GduPool *pool,
                                                         GPtrArray *component_objpaths,
                                                         GduPoolLinuxMdStartCompletedFunc callback,
                                                         gpointer user_data);

Object Hierarchy

  GObject
   +----GduPool

Signals

  "device-added"                                   : Run Last
  "device-changed"                                 : Run Last
  "device-job-changed"                             : Run Last
  "device-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 DeviceKit-disks 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_get_daemon_version ()

char *              gdu_pool_get_daemon_version         (GduPool *pool);

Get the version of the DeviceKit-daemon on the system.

pool :

A GduPool.

Returns :

The version of DeviceKit-disks 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 DeviceKit-disks 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 DeviceKit-disks 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 GduDevice object for object_path.

pool :

the device pool

object_path :

the D-Bus object path

Returns :

A GduDevice 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_presentable_by_id ()

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

pool :

id :

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_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.

Signal Details

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 "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.