| Storaged Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | ||||
StoragedLinuxDriveObject; StoragedLinuxDriveObject * storaged_linux_drive_object_new (StoragedDaemon *daemon,StoragedLinuxDevice *device); void storaged_linux_drive_object_uevent (StoragedLinuxDriveObject *object,const gchar *action,StoragedLinuxDevice *device); StoragedDaemon * storaged_linux_drive_object_get_daemon (StoragedLinuxDriveObject *object); StoragedLinuxBlockObject * storaged_linux_drive_object_get_block (StoragedLinuxDriveObject *object,gboolean get_hw); StoragedLinuxDevice * storaged_linux_drive_object_get_device (StoragedLinuxDriveObject *object,gboolean get_hw); GList * storaged_linux_drive_object_get_devices (StoragedLinuxDriveObject *object); GList * storaged_linux_drive_object_get_siblings (StoragedLinuxDriveObject *object); gboolean storaged_linux_drive_object_housekeeping (StoragedLinuxDriveObject *object,guint secs_since_last,GCancellable *cancellable,GError **error); gboolean storaged_linux_drive_object_is_not_in_use (StoragedLinuxDriveObject *object,GCancellable *cancellable,GError **error);
GObject
+----GDBusObjectSkeleton
+----StoragedObjectSkeleton
+----StoragedLinuxDriveObject
"daemon" StoragedDaemon* : Read / Write / Construct Only "device" StoragedLinuxDevice* : Write / Construct Only
typedef struct _StoragedLinuxDriveObject StoragedLinuxDriveObject;
The StoragedLinuxDriveObject structure contains only private data and should only be accessed using the provided API.
StoragedLinuxDriveObject * storaged_linux_drive_object_new (StoragedDaemon *daemon,StoragedLinuxDevice *device);
Create a new drive object.
|
A StoragedDaemon. |
|
The StoragedLinuxDevice for the sysfs block device. |
Returns : |
A StoragedLinuxDriveObject object or NULL if device does not represent a drive. Free with g_object_unref(). |
void storaged_linux_drive_object_uevent (StoragedLinuxDriveObject *object,const gchar *action,StoragedLinuxDevice *device);
Updates all information on interfaces on drive.
|
A StoragedLinuxDriveObject. |
|
Uevent action or NULL
|
|
A StoragedLinuxDevice device object or NULL if the device hasn't changed. |
StoragedDaemon * storaged_linux_drive_object_get_daemon
(StoragedLinuxDriveObject *object);
Gets the daemon used by object.
|
A StoragedLinuxDriveObject. |
Returns : |
A StoragedDaemon. Do not free, the object is owned by object. |
StoragedLinuxBlockObject * storaged_linux_drive_object_get_block (StoragedLinuxDriveObject *object,gboolean get_hw);
Gets a StoragedLinuxBlockObject representing a block device associated with object.
|
A StoragedLinuxDriveObject. |
|
If the drive is multipath, set to TRUE to get a path device instead of the multipath device. |
Returns : |
A StoragedLinuxBlockObject or NULL. The returned object
must be freed with g_object_unref(). |
StoragedLinuxDevice * storaged_linux_drive_object_get_device (StoragedLinuxDriveObject *object,gboolean get_hw);
Gets one of the StoragedLinuxDevice object associated with object.
If get_hw is TRUE and object represents a multipath device then
one of the paths is returned rather than the multipath device. This
is useful if you e.g. need to configure the physical hardware.
|
A StoragedLinuxDriveObject. |
|
If the drive is multipath, set to TRUE to get a path device instead of the multipath device. |
Returns : |
A StoragedLinuxDevice or NULL. The returned object must be freed
with g_object_unref(). |
GList * storaged_linux_drive_object_get_devices
(StoragedLinuxDriveObject *object);
Gets the current StoragedLinuxDevice objects associated with object.
|
A StoragedLinuxDriveObject. |
Returns : |
A list of StoragedLinuxDevice objects. Free each element with
g_object_unref(), then free the list with g_list_free(). |
GList * storaged_linux_drive_object_get_siblings
(StoragedLinuxDriveObject *object);
Gets the siblings for object, if any.
|
A StoragedLinuxDriveObject. |
Returns : |
A list of StoragedLinuxDriveObject
instances. The returned list should be freed with g_list_free() after each element has been
freed with g_object_unref(). [transfer full][element-type StoragedLinuxDriveObject]
|
gboolean storaged_linux_drive_object_housekeeping (StoragedLinuxDriveObject *object,guint secs_since_last,GCancellable *cancellable,GError **error);
Called periodically (every ten minutes or so) to perform housekeeping tasks such as refreshing ATA SMART data.
The function runs in a dedicated thread and is allowed to perform blocking I/O.
Long-running tasks should periodically check cancellable to see if
they have been cancelled.
|
A StoragedLinuxDriveObject. |
|
Number of seconds sincex the last housekeeping or 0 if the first housekeeping ever. |
|
A GCancellable or NULL. |
|
Return location for error or NULL. |
Returns : |
TRUE if the operation succeeded, FALSE if error is set. |
gboolean storaged_linux_drive_object_is_not_in_use (StoragedLinuxDriveObject *object,GCancellable *cancellable,GError **error);
Checks if the drive represented by object is in use and sets
error if so.
|
A StoragedLinuxDriveObject. |
|
A GCancellable or NULL. [allow-none]
|
|
A GError or NULL. |
Returns : |
TRUE if object is not is use, FALSE if error is set. |
"daemon" property"daemon" StoragedDaemon* : Read / Write / Construct Only
The StoragedDaemon the object is for.
"device" property"device" StoragedLinuxDevice* : Write / Construct Only
The StoragedLinuxDevice for the object. Connect to the "notify" signal to get notified whenever this is updated.