-->
<property name="CryptoBackingDevice" type="o" access="read"/>
+ <!-- HintPartitionable:
+ If %TRUE, the device is normally expected to be
+ partitionable. Devices for which this is not the case include
+ floppy drives, optical drives and LVM logical volumes.
+ -->
+ <property name="HintPartitionable" type="b" access="read"/>
+
<!-- HintSystem: If %TRUE, the device is considered a <emphasis>system device</emphasis>.
System devices are devices that require additional permissions to access.
udisks_block_get_size
udisks_block_get_read_only
udisks_block_get_symlinks
+udisks_block_get_hint_partitionable
udisks_block_get_hint_system
udisks_block_get_hint_ignore
udisks_block_get_hint_auto
udisks_block_set_size
udisks_block_set_read_only
udisks_block_set_symlinks
+udisks_block_set_hint_partitionable
udisks_block_set_hint_system
udisks_block_set_hint_ignore
udisks_block_set_hint_auto
UDisksDrive *drive)
{
UDisksBlock *iface = UDISKS_BLOCK (block);
+ gboolean hint_partitionable;
gboolean hint_system;
gboolean hint_ignore;
gboolean hint_auto;
const gchar *device_file;
/* very conservative defaults */
+ hint_partitionable = TRUE;
hint_system = TRUE;
hint_ignore = FALSE;
hint_auto = FALSE;
else
{
if (g_str_has_prefix (device_file, "/dev/fd"))
- hint_system = FALSE;
+ {
+ hint_system = FALSE;
+ hint_partitionable = FALSE;
+ }
}
+ /* CD-ROM media / drives are not partitionable, at least not here on Linux */
+ if (g_udev_device_get_property_as_boolean (device, "ID_CDROM"))
+ hint_partitionable = FALSE;
+
+ /* device-mapper devices are not partitionable (TODO: for multipath, they are via kpartx(8) hacks) */
+ if (g_str_has_prefix (g_udev_device_get_name (device), "dm-"))
+ hint_partitionable = FALSE;
+
/* TODO: set ignore to TRUE for physical paths belonging to a drive with multiple paths */
/* override from udev properties */
hint_icon_name = g_udev_device_get_property (device, "UDISKS_ICON_NAME");
/* ... and scene! */
+ udisks_block_set_hint_partitionable (iface, hint_partitionable);
udisks_block_set_hint_system (iface, hint_system);
udisks_block_set_hint_ignore (iface, hint_ignore);
udisks_block_set_hint_auto (iface, hint_auto);