From: David Zeuthen Date: Thu, 2 Apr 2009 19:14:43 +0000 (-0400) Subject: remove device-is-busy property X-Git-Tag: upstream/2.1.2~890 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1e9f821a896065262581535e0131870a8e78abf;p=platform%2Fupstream%2Fudisks2.git remove device-is-busy property This should never have been a property since - we are not really ready to make that kind of guarantee; another program may have the device open and then we're going to fail with EBUSY and return a Busy D-Bus error - it is computed on demand and that makes it difficult to determine when it changes value and thus trigger a PropertyChanged event Currently this property is not used by gnome-disk-utility. If it turns out that we need something like this we can add a Device.IsBusy() method. --- diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c index d909fb5..4650da6 100644 --- a/src/devkit-disks-device.c +++ b/src/devkit-disks-device.c @@ -155,7 +155,6 @@ enum PROP_DEVICE_SIZE, PROP_DEVICE_BLOCK_SIZE, PROP_DEVICE_IS_MOUNTED, - PROP_DEVICE_IS_BUSY, PROP_DEVICE_MOUNT_PATHS, PROP_DEVICE_MOUNTED_BY_UID, PROP_DEVICE_PRESENTATION_NAME, @@ -371,10 +370,6 @@ get_property (GObject *object, case PROP_DEVICE_IS_MOUNTED: g_value_set_boolean (value, device->priv->device_is_mounted); break; - case PROP_DEVICE_IS_BUSY: - /* this property is special; it's value is computed on demand */ - g_value_set_boolean (value, devkit_disks_device_local_is_busy (device)); - break; case PROP_DEVICE_MOUNT_PATHS: g_value_set_boxed (value, device->priv->device_mount_paths); break; @@ -812,10 +807,6 @@ devkit_disks_device_class_init (DevkitDisksDeviceClass *klass) g_param_spec_boolean ("device-is-mounted", NULL, NULL, FALSE, G_PARAM_READABLE)); g_object_class_install_property ( object_class, - PROP_DEVICE_IS_BUSY, - g_param_spec_boolean ("device-is-busy", NULL, NULL, FALSE, G_PARAM_READABLE)); - g_object_class_install_property ( - object_class, PROP_DEVICE_MOUNT_PATHS, g_param_spec_boxed ("device-mount-paths", NULL, NULL, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING), diff --git a/src/org.freedesktop.DeviceKit.Disks.Device.xml b/src/org.freedesktop.DeviceKit.Disks.Device.xml index 6465486..b4d4b50 100644 --- a/src/org.freedesktop.DeviceKit.Disks.Device.xml +++ b/src/org.freedesktop.DeviceKit.Disks.Device.xml @@ -1415,15 +1415,6 @@ TRUE if device is a cleartext device backed by a LUKS encrypted device. See luks-cleartext- properties for details. - - - TRUE if device is currently busy. Is set if the device is - in use; this can hapen, for example, if the device is - mounted, if another block device is claiming it (e.g. a - RAID drive) or if a job initiated from DeviceKit-disks is - pending. - - TRUE if the device is a Linux md RAID component. See linux-md-component- properties for details. diff --git a/tools/devkit-disks.c b/tools/devkit-disks.c index eedd4b8..c715678 100644 --- a/tools/devkit-disks.c +++ b/tools/devkit-disks.c @@ -365,7 +365,6 @@ typedef struct gboolean device_is_luks; gboolean device_is_luks_cleartext; gboolean device_is_mounted; - gboolean device_is_busy; gboolean device_is_linux_md_component; gboolean device_is_linux_md; char **device_mount_paths; @@ -522,8 +521,6 @@ collect_props (const char *key, const GValue *value, DeviceProperties *props) props->device_is_linux_md = g_value_get_boolean (value); else if (strcmp (key, "device-is-mounted") == 0) props->device_is_mounted = g_value_get_boolean (value); - else if (strcmp (key, "device-is-busy") == 0) - props->device_is_busy = g_value_get_boolean (value); else if (strcmp (key, "device-mount-paths") == 0) props->device_mount_paths = g_strdupv (g_value_get_boxed (value)); else if (strcmp (key, "device-mounted-by-uid") == 0) @@ -1005,7 +1002,6 @@ do_show_info (const char *object_path) g_print (" detection inhibited: %d\n", props->device_is_media_change_detection_inhibited); g_print (" is read only: %d\n", props->device_is_read_only); g_print (" is mounted: %d\n", props->device_is_mounted); - g_print (" is busy: %d\n", props->device_is_busy); g_print (" mount paths: "); for (n = 0; props->device_mount_paths != NULL && props->device_mount_paths[n] != NULL; n++) { if (n != 0)