From c5247980623a6d8b8127b583e248229c4ac69d62 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Thu, 2 Sep 2010 17:08:19 -0400 Subject: [PATCH] Export a couple of more BlockDevice properties Signed-off-by: David Zeuthen --- data/org.freedesktop.UDisks.xml | 6 +++++- src/linuxblock.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/data/org.freedesktop.UDisks.xml b/data/org.freedesktop.UDisks.xml index 9476361..e0b0ba8 100644 --- a/data/org.freedesktop.UDisks.xml +++ b/data/org.freedesktop.UDisks.xml @@ -13,7 +13,11 @@ - + + + + + diff --git a/src/linuxblock.c b/src/linuxblock.c index 3fedd7b..a1e5017 100644 --- a/src/linuxblock.c +++ b/src/linuxblock.c @@ -81,9 +81,21 @@ linux_block_update (LinuxBlock *block, /* org.freedesktop.UDisks.BlockDevice */ if (block->iface_block_device == NULL) { + GUdevDeviceNumber dev; + + dev = g_udev_device_get_device_number (block->device); + block->iface_block_device = udisks_block_device_stub_new (); - udisks_block_device_set_device_file (block->iface_block_device, - g_udev_device_get_device_file (block->device)); + udisks_block_device_set_device (block->iface_block_device, + g_udev_device_get_device_file (block->device)); + udisks_block_device_set_symlinks (block->iface_block_device, + g_udev_device_get_device_file_symlinks (block->device)); + udisks_block_device_set_major (block->iface_block_device, + major (dev)); + udisks_block_device_set_minor (block->iface_block_device, + minor (dev)); + udisks_block_device_set_size (block->iface_block_device, + g_udev_device_get_sysfs_attr_as_uint64 (block->device, "size") * 512); g_dbus_object_add_interface (block->object, G_DBUS_INTERFACE (block->iface_block_device)); } } -- 2.7.4