UDisksLinuxDevice: UDisks Reference Manual

## UDisksLinuxDevice UDisksLinuxDevice — Low-level devices on Linux |

## Functions

UDisksLinuxDevice * | udisks_linux_device_new_sync ()
gboolean | udisks_linux_device_reprobe_sync ()
gchar * | udisks_linux_device_read_sysfs_attr ()
gint | udisks_linux_device_read_sysfs_attr_as_int ()
guint64 | udisks_linux_device_read_sysfs_attr_as_uint64 ()
gboolean | udisks_linux_device_subsystem_is_nvme ()
gboolean | udisks_linux_device_nvme_is_fabrics ()

## Types and Values

| UDisksLinuxDevice

## Object Hierarchy

        GObject
        ╰── UDisksLinuxDevice

## Description

Types and functions used to record information obtained from the udev database as well as by probing the device.

## Functions

### udisks_linux_device_new_sync ()

    UDisksLinuxDevice *
    udisks_linux_device_new_sync (GUdevDevice *udev_device);

Creates a new UDisksLinuxDevice from `udev_device` which includes probing the device for more information, if applicable.

The calling thread may be blocked for a non-trivial amount of time while the probing is underway.

#### Parameters

udev_device | A GUdevDevice. |

#### Returns

A UDisksLinuxDevice.

### udisks_linux_device_reprobe_sync ()

    gboolean
    udisks_linux_device_reprobe_sync (UDisksLinuxDevice *device,
                                      GCancellable *cancellable,
                                      GError **error);

Forcibly reprobe information on `device` . The calling thread may be blocked for a non-trivial amount of time while the probing is underway.

#### Parameters

device | A UDisksLinuxDevice. |
cancellable | A GCancellable or `NULL`. | [allow-none]
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if reprobing succeeded, `FALSE` otherwise.

### udisks_linux_device_read_sysfs_attr ()

    gchar *
    udisks_linux_device_read_sysfs_attr (UDisksLinuxDevice *device,
                                         const gchar *attr,
                                         GError **error);

Read a sysfs attribute within the device sysfs hierarchy. The `attr` can be a path relative to the `device` base sysfs path.

#### Parameters

device | A UDisksLinuxDevice. |
attr | Attribute name (a path). |
error | Return location for error or `NULL`. |

#### Returns

Attribute contents or `NULL` if unavailable. Free with `g_free()`.

[transfer full]

### udisks_linux_device_read_sysfs_attr_as_int ()

    gint
    udisks_linux_device_read_sysfs_attr_as_int
                                   (UDisksLinuxDevice *device,
                                    const gchar *attr,
                                    GError **error);

Read a sysfs attribute within the device sysfs hierarchy. The `attr` can be a path relative to the `device` base sysfs path.

#### Parameters

device | A UDisksLinuxDevice. |
attr | Attribute name (a path). |
error | Return location for error or `NULL`. |

#### Returns

Numerical attribute value or 0 on error.

### udisks_linux_device_read_sysfs_attr_as_uint64 ()

    guint64
    udisks_linux_device_read_sysfs_attr_as_uint64
                                   (UDisksLinuxDevice *device,
                                    const gchar *attr,
                                    GError **error);

Read a sysfs attribute within the device sysfs hierarchy. The `attr` can be a path relative to the `device` base sysfs path.

#### Parameters

device | A UDisksLinuxDevice. |
attr | Attribute name (a path). |
error | Return location for error or `NULL`. |

#### Returns

Numerical attribute value or 0 on error.

### udisks_linux_device_subsystem_is_nvme ()

    gboolean
    udisks_linux_device_subsystem_is_nvme (UDisksLinuxDevice *device);

Walks up the device hierarchy and checks if `device` is part of a NVMe topology.

#### Parameters

device | A UDisksLinuxDevice. |

#### Returns

`TRUE` in case of a NVMe device, `FALSE` otherwise.

### udisks_linux_device_nvme_is_fabrics ()

    gboolean
    udisks_linux_device_nvme_is_fabrics (UDisksLinuxDevice *device);

Determines whether `device` is a NVMe over Fabrics device.

#### Parameters

device | A UDisksLinuxDevice. |

#### Returns

`TRUE` in case of a NVMeoF device, `FALSE` otherwise.

## Types and Values

### UDisksLinuxDevice

    typedef struct {
      GUdevDevice *udev_device;
      guchar *ata_identify_device_data;
      guchar *ata_identify_packet_device_data;
      BDNVMEControllerInfo *nvme_ctrl_info;
      BDNVMENamespaceInfo *nvme_ns_info;
    } UDisksLinuxDevice;

Object containing information about a device on Linux. This is essentially an instance of GUdevDevice plus additional data - such as ATA IDENTIFY data - obtained via probing the device at discovery and uevent "change" time.

#### Members

GUdevDevice *`udev_device`; | A GUdevDevice. |
guchar *`ata_identify_device_data`; | 512-byte array containing the result of the IDENTIFY DEVICE command or `NULL`. |
guchar *`ata_identify_packet_device_data`; | 512-byte array containing the result of the IDENTIFY PACKET DEVICE command or `NULL`. |
BDNVMEControllerInfo *`nvme_ctrl_info`; | A BDNVMEControllerInfo data in case of a NVMe Controller. |
BDNVMENamespaceInfo *`nvme_ns_info`; | A BDNVMENamespaceInfo data in case of a NVMe Namespace. |