remove a lot of unnecessary errors
authorDavid Zeuthen <davidz@redhat.com>
Thu, 2 Apr 2009 19:37:43 +0000 (15:37 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Thu, 2 Apr 2009 19:37:43 +0000 (15:37 -0400)
For example it doesn't make sense to return this error

 org.freedesktop.DeviceKit.Disks.Error.NotPartition

since the client is already able to check in advance if the given
object really is a partition. So trim the error list to only contain
errors that the client can't predict. This leaves us with

 DEVKIT_DISKS_ERROR_FAILED,
 DEVKIT_DISKS_ERROR_BUSY,
 DEVKIT_DISKS_ERROR_CANCELLED,
 DEVKIT_DISKS_ERROR_INHIBITED,
 DEVKIT_DISKS_ERROR_INVALID_OPTION,
 DEVKIT_DISKS_ERROR_NOT_SUPPORTED,
 DEVKIT_DISKS_ERROR_ATA_SMART_WOULD_WAKEUP,

src/devkit-disks-daemon.c
src/devkit-disks-daemon.h
src/devkit-disks-device.c
src/org.freedesktop.DeviceKit.Disks.Device.xml
src/org.freedesktop.DeviceKit.Disks.xml

index 8e4b423..df6ebce 100644 (file)
@@ -147,33 +147,16 @@ devkit_disks_error_get_type (void)
 
         if (etype == 0)
         {
-                static const GEnumValue values[] =
-                        {
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_FAILED, "Failed"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_INHIBITED, "Inhibited"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_BUSY, "Busy"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_CANCELLED, "Cancelled"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_INVALID_OPTION, "InvalidOption"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_ALREADY_MOUNTED, "AlreadyMounted"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_MOUNTED, "NotMounted"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_CANCELLABLE, "NotCancellable"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_PARTITION, "NotPartition"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_PARTITION_TABLE, "NotPartitionTable"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_LABELED, "NotLabeled"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_FILESYSTEM, "NotFilesystem"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_LUKS, "NotLuks"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_LOCKED, "NotLocked"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_UNLOCKED, "NotUnlocked"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_LINUX_MD, "NotLinuxMd"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT, "NotLinuxMdComponent"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_DRIVE, "NotDrive"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_SUPPORTED, "NotSupported"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_FOUND, "NotFound"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_ATA_SMART_NOT_AVAILABLE, "AtaSmartNotAvailable"),
-                                ENUM_ENTRY (DEVKIT_DISKS_ERROR_ATA_SMART_WOULD_WAKEUP, "AtaSmartWouldWakeup"),
-
-                                { 0, 0, 0 }
-                        };
+                static const GEnumValue values[] = {
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_FAILED, "Failed"),
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_INHIBITED, "Inhibited"),
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_BUSY, "Busy"),
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_CANCELLED, "Cancelled"),
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_INVALID_OPTION, "InvalidOption"),
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_NOT_SUPPORTED, "NotSupported"),
+                        ENUM_ENTRY (DEVKIT_DISKS_ERROR_ATA_SMART_WOULD_WAKEUP, "AtaSmartWouldWakeup"),
+                        { 0, 0, 0 }
+                };
                 g_assert (DEVKIT_DISKS_NUM_ERRORS == G_N_ELEMENTS (values) - 1);
                 etype = g_enum_register_static ("DevkitDisksError", values);
         }
@@ -1325,7 +1308,7 @@ devkit_disks_daemon_find_device_by_device_file (DevkitDisksDaemon     *daemon,
                 dbus_g_method_return (context, object_path);
         } else {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_FOUND,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "No such device");
         }
 
index 81b5ea0..e631532 100644 (file)
@@ -53,26 +53,11 @@ struct DevkitDisksDaemonClass
 typedef enum
 {
         DEVKIT_DISKS_ERROR_FAILED,
-        DEVKIT_DISKS_ERROR_INHIBITED,
         DEVKIT_DISKS_ERROR_BUSY,
         DEVKIT_DISKS_ERROR_CANCELLED,
+        DEVKIT_DISKS_ERROR_INHIBITED,
         DEVKIT_DISKS_ERROR_INVALID_OPTION,
-        DEVKIT_DISKS_ERROR_ALREADY_MOUNTED,
-        DEVKIT_DISKS_ERROR_NOT_MOUNTED,
-        DEVKIT_DISKS_ERROR_NOT_CANCELLABLE,
-        DEVKIT_DISKS_ERROR_NOT_PARTITION,
-        DEVKIT_DISKS_ERROR_NOT_PARTITION_TABLE,
-        DEVKIT_DISKS_ERROR_NOT_LABELED,
-        DEVKIT_DISKS_ERROR_NOT_FILESYSTEM,
-        DEVKIT_DISKS_ERROR_NOT_LUKS,
-        DEVKIT_DISKS_ERROR_NOT_LOCKED,
-        DEVKIT_DISKS_ERROR_NOT_UNLOCKED,
-        DEVKIT_DISKS_ERROR_NOT_LINUX_MD,
-        DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT,
-        DEVKIT_DISKS_ERROR_NOT_DRIVE,
         DEVKIT_DISKS_ERROR_NOT_SUPPORTED,
-        DEVKIT_DISKS_ERROR_NOT_FOUND,
-        DEVKIT_DISKS_ERROR_ATA_SMART_NOT_AVAILABLE,
         DEVKIT_DISKS_ERROR_ATA_SMART_WOULD_WAKEUP,
         DEVKIT_DISKS_NUM_ERRORS
 } DevkitDisksError;
index 4650da6..92e5d9f 100644 (file)
@@ -4410,7 +4410,7 @@ devkit_disks_device_filesystem_mount (DevkitDisksDevice     *device,
 
         if (device->priv->id_usage == NULL ||
             strcmp (device->priv->id_usage, "filesystem") != 0) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_FILESYSTEM,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Not a mountable file system");
                 goto out;
         }
@@ -4450,7 +4450,7 @@ devkit_disks_device_filesystem_mount (DevkitDisksDevice     *device,
                 if (device->priv->id_type != NULL && strlen (device->priv->id_type)) {
                         fstype = g_strdup (device->priv->id_type);
                 } else {
-                        throw_error (context, DEVKIT_DISKS_ERROR_NOT_FILESYSTEM, "No file system type");
+                        throw_error (context, DEVKIT_DISKS_ERROR_FAILED, "No file system type");
                         goto out;
                 }
         } else {
@@ -4495,7 +4495,7 @@ devkit_disks_device_filesystem_mount (DevkitDisksDevice     *device,
         g_print ("**** USING MOUNT OPTIONS '%s' FOR DEVICE %s\n", mount_options, device->priv->device_file);
 
         if (device->priv->device_is_mounted) {
-                throw_error (context, DEVKIT_DISKS_ERROR_ALREADY_MOUNTED,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is already mounted");
                 goto out;
         }
@@ -4643,7 +4643,7 @@ devkit_disks_device_filesystem_unmount (DevkitDisksDevice     *device,
         if (!device->priv->device_is_mounted ||
             device->priv->device_mount_paths->len == 0) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_MOUNTED,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not mounted");
                 goto out;
         }
@@ -4859,7 +4859,7 @@ devkit_disks_device_filesystem_list_open_files (DevkitDisksDevice     *device,
         if (!device->priv->device_is_mounted ||
             device->priv->device_mount_paths->len == 0) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_MOUNTED,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not mounted");
                 goto out;
         }
@@ -4945,7 +4945,7 @@ devkit_disks_device_drive_eject (DevkitDisksDevice     *device,
                 goto out;
 
         if (!device->priv->device_is_drive) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_DRIVE,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a drive");
                 goto out;
         }
@@ -5262,7 +5262,7 @@ devkit_disks_device_partition_delete (DevkitDisksDevice     *device,
 
         if (!device->priv->device_is_partition) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_PARTITION,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a partition");
                 goto out;
         }
@@ -5721,7 +5721,7 @@ devkit_disks_device_job_cancel (DevkitDisksDevice     *device,
 
         if (!device->priv->job_is_cancellable) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_CANCELLABLE,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Job cannot be cancelled");
                 goto out;
         }
@@ -5996,7 +5996,7 @@ devkit_disks_device_partition_create (DevkitDisksDevice     *device,
 
         if (!device->priv->device_is_partition_table) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_PARTITION_TABLE,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not partitioned");
                 goto out;
         }
@@ -6177,7 +6177,7 @@ devkit_disks_device_partition_modify (DevkitDisksDevice     *device,
 
         if (!device->priv->device_is_partition) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_NOT_PARTITION,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a partition");
                 goto out;
         }
@@ -6621,13 +6621,13 @@ devkit_disks_device_luks_unlock_internal (DevkitDisksDevice        *device,
 
         if (device->priv->id_usage == NULL ||
             strcmp (device->priv->id_usage, "crypto") != 0) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LUKS,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Not a LUKS device");
                 goto out;
         }
 
         if (find_cleartext_device (device) != NULL) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LOCKED,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Cleartext device is already unlocked");
                 goto out;
         }
@@ -6890,14 +6890,14 @@ devkit_disks_device_luks_lock (DevkitDisksDevice     *device,
 
         if (device->priv->id_usage == NULL ||
             strcmp (device->priv->id_usage, "crypto") != 0) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LUKS,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Not a LUKS crypto device");
                 goto out;
         }
 
         cleartext_device = find_cleartext_device (device);
         if (cleartext_device == NULL) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_UNLOCKED,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Cleartext device is not unlocked");
                 goto out;
         }
@@ -7003,7 +7003,7 @@ devkit_disks_device_luks_change_passphrase (DevkitDisksDevice     *device,
 
         if (device->priv->id_usage == NULL ||
             strcmp (device->priv->id_usage, "crypto") != 0) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LUKS,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Not a LUKS crypto device");
                 goto out;
         }
@@ -7105,7 +7105,7 @@ devkit_disks_device_filesystem_set_label (DevkitDisksDevice     *device,
 
         if (device->priv->id_usage == NULL ||
             strcmp (device->priv->id_usage, "filesystem") != 0) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LABELED,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Not a mountable file system");
                 goto out;
         }
@@ -7584,7 +7584,7 @@ devkit_disks_device_drive_ata_smart_refresh_data (DevkitDisksDevice     *device,
 
         if (!device->priv->drive_ata_smart_is_available) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_ATA_SMART_NOT_AVAILABLE,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device does not support ATA SMART");
                 goto out;
         }
@@ -7675,7 +7675,7 @@ devkit_disks_device_drive_ata_smart_get_historical_data (DevkitDisksDevice     *
 
         if (!device->priv->drive_ata_smart_is_available) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_ATA_SMART_NOT_AVAILABLE,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device does not support ATA SMART");
                 goto out;
         }
@@ -7881,7 +7881,7 @@ devkit_disks_device_drive_ata_smart_initiate_selftest (DevkitDisksDevice     *de
 
         if (!device->priv->drive_ata_smart_is_available) {
                 throw_error (context,
-                             DEVKIT_DISKS_ERROR_ATA_SMART_NOT_AVAILABLE,
+                             DEVKIT_DISKS_ERROR_FAILED,
                              "Device does not support ATA SMART");
                 goto out;
         }
@@ -7969,7 +7969,7 @@ devkit_disks_device_linux_md_stop (DevkitDisksDevice     *device,
                 goto out;
 
         if (!device->priv->device_is_linux_md) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a Linux md drive");
                 goto out;
         }
@@ -8063,14 +8063,14 @@ devkit_disks_device_linux_md_add_component (DevkitDisksDevice     *device,
                 goto out;
 
         if (!device->priv->device_is_linux_md) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a Linux md drive");
                 goto out;
         }
 
         slave = devkit_disks_daemon_local_find_by_object_path (device->priv->daemon, component);
         if (slave == NULL) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_FOUND,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Component doesn't exist");
                 goto out;
         }
@@ -8281,14 +8281,14 @@ devkit_disks_device_linux_md_remove_component (DevkitDisksDevice     *device,
                 goto out;
 
         if (!device->priv->device_is_linux_md) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a Linux md drive");
                 goto out;
         }
 
         slave = devkit_disks_daemon_local_find_by_object_path (device->priv->daemon, component);
         if (slave == NULL) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_FOUND,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Component doesn't exist");
                 goto out;
         }
@@ -8299,7 +8299,7 @@ devkit_disks_device_linux_md_remove_component (DevkitDisksDevice     *device,
                         break;
         }
         if (n == (int) device->priv->linux_md_slaves->len) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_FOUND,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Component isn't part of the running array");
                 goto out;
         }
@@ -8540,13 +8540,13 @@ devkit_disks_daemon_linux_md_start (DevkitDisksDaemon     *daemon,
 
                 slave = devkit_disks_daemon_local_find_by_object_path (daemon, component_objpath);
                 if (slave == NULL) {
-                        throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT,
+                        throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                                      "Component %s doesn't exist", component_objpath);
                         goto out;
                 }
 
                 if (!slave->priv->device_is_linux_md_component) {
-                        throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT,
+                        throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                                      "%s is not a linux-md component", component_objpath);
                         goto out;
                 }
@@ -8554,7 +8554,7 @@ devkit_disks_daemon_linux_md_start (DevkitDisksDaemon     *daemon,
                 if (n == 0) {
                         uuid = g_strdup (slave->priv->linux_md_component_uuid);
                         if (uuid == NULL) {
-                                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT,
+                                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                                              "no uuid for one of the components");
                         }
                 } else {
@@ -8562,7 +8562,7 @@ devkit_disks_daemon_linux_md_start (DevkitDisksDaemon     *daemon,
                         this_uuid = slave->priv->linux_md_component_uuid;
 
                         if (this_uuid == NULL || strcmp (uuid, this_uuid) != 0) {
-                                throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT,
+                                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                                              "uuid mismatch between given components");
                                 goto out;
                         }
@@ -8620,7 +8620,7 @@ devkit_disks_daemon_linux_md_start (DevkitDisksDaemon     *daemon,
 
                 slave = devkit_disks_daemon_local_find_by_object_path (daemon, component_objpath);
                 if (slave == NULL) {
-                        throw_error (context, DEVKIT_DISKS_ERROR_NOT_LINUX_MD_COMPONENT,
+                        throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                                      "Component %s doesn't exist", component_objpath);
                         goto out;
                 }
@@ -8986,7 +8986,7 @@ devkit_disks_device_drive_inhibit_polling (DevkitDisksDevice     *device,
                 goto out;
 
         if (!device->priv->device_is_drive) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_DRIVE,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a drive");
                 goto out;
         }
@@ -9085,7 +9085,7 @@ devkit_disks_device_drive_poll_media (DevkitDisksDevice     *device,
                 goto out;
 
         if (!device->priv->device_is_drive) {
-                throw_error (context, DEVKIT_DISKS_ERROR_NOT_DRIVE,
+                throw_error (context, DEVKIT_DISKS_ERROR_FAILED,
                              "Device is not a drive");
                 goto out;
         }
index b4d4b50..0e5da56 100644 (file)
@@ -2,26 +2,12 @@
 "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" [
   <!ENTITY ERROR_FAILED "org.freedesktop.DeviceKit.Disks.Error.Failed">
-  <!ENTITY ERROR_INHIBITED "org.freedesktop.DeviceKit.Disks.Error.Inhibited">
   <!ENTITY ERROR_BUSY "org.freedesktop.DeviceKit.Disks.Error.Busy">
   <!ENTITY ERROR_CANCELLED "org.freedesktop.DeviceKit.Disks.Error.Cancelled">
+  <!ENTITY ERROR_INHIBITED "org.freedesktop.DeviceKit.Disks.Error.Inhibited">
   <!ENTITY ERROR_INVALID_OPTION "org.freedesktop.DeviceKit.Disks.Error.InvalidOption">
-  <!ENTITY ERROR_ALREADY_MOUNTED "org.freedesktop.DeviceKit.Disks.Error.AlreadyMounted">
-  <!ENTITY ERROR_NOT_MOUNTED "org.freedesktop.DeviceKit.Disks.Error.NotMounted">
-  <!ENTITY ERROR_NOT_CANCELLABLE "org.freedesktop.DeviceKit.Disks.Error.NotCancellable">
-  <!ENTITY ERROR_NOT_PARTITION "org.freedesktop.DeviceKit.Disks.Error.NotPartition">
-  <!ENTITY ERROR_NOT_PARTITION_TABLE "org.freedesktop.DeviceKit.Disks.Error.NotPartitionTable">
-  <!ENTITY ERROR_NOT_FILESYSTEM "org.freedesktop.DeviceKit.Disks.Error.NotFilesystem">
-  <!ENTITY ERROR_NOT_LUKS "org.freedesktop.DeviceKit.Disks.Error.NotLuks">
-  <!ENTITY ERROR_NOT_LOCKED "org.freedesktop.DeviceKit.Disks.Error.NotLocked">
-  <!ENTITY ERROR_NOT_UNLOCKED "org.freedesktop.DeviceKit.Disks.Error.NotUnlocked">
-  <!ENTITY ERROR_NOT_LINUX_MD "org.freedesktop.DeviceKit.Disks.Error.NotLinuxMd">
-  <!ENTITY ERROR_NOT_LINUX_MD_COMPONENT "org.freedesktop.DeviceKit.Disks.Error.NotLinuxMdComponent">
-  <!ENTITY ERROR_NOT_DRIVE "org.freedesktop.DeviceKit.Disks.Error.NotDrive">
   <!ENTITY ERROR_NOT_SUPPORTED "org.freedesktop.DeviceKit.Disks.Error.NotSupported">
-  <!ENTITY ERROR_NOT_FOUND "org.freedesktop.DeviceKit.Disks.Error.NotFound">
-  <!ENTITY ERROR_ATA_SMART_NOT_AVAILABLE "org.freedesktop.DeviceKit.Disks.Error.AtaSmartNotAvailable">
-  <!ENTITY ERROR_ATA_SMART_WOULD_WAKEUP "org.freedesktop.DeviceKit.Disks.Error.AtaSmartWouldWakeup">
+  <!ENTITY ERROR_ATA_SMART_WOULD_WAKEUP "org.freedesktop.DeviceKit.Disks.Error.NotFound">
   <!ENTITY ERROR_NOT_AUTHORIZED "org.freedesktop.PolicyKit.Error.NotAuthorized">
 ]>
 <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_FAILED;">if no job is pending</doc:error>
-          <doc:error name="&ERROR_NOT_CANCELLABLE;">if job is not cancellable</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device or a partition on it are busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
         </doc:errors>
       </doc:doc>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_PARTITION;">if the device is not a partition</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_PARTITION_TABLE;">if the device is not a partitition table</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the enclosing partition table device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_PARTITION;">if the device is not a partition</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
         </doc:errors>
       </doc:doc>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy and changing the label requires an unmounted file system</doc:error>
-          <doc:error name="&ERROR_FAILED;">if the file system doesn't support labels, the label is too long</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
         </doc:errors>
       </doc:doc>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_FILESYSTEM;">if the device is not a mountable file system</doc:error>
           <doc:error name="&ERROR_INVALID_OPTION;">if an invalid or malformed mount option was given</doc:error>
-          <doc:error name="&ERROR_ALREADY_MOUNTED;">if the device is already mounted</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
           <doc:error name="&ERROR_INVALID_OPTION;">if an invalid or malformed unmount option was given</doc:error>
-          <doc:error name="&ERROR_NOT_MOUNTED;">if the device is not mounted</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is mounted and the file system doesn't support online file system checking. See TODO for how to determine if a file system supports online fsck</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
         </doc:errors>
       </doc:doc>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is mounted and the file system doesn't support online file system checking. See TODO for how to determine if a file system supports online fsck</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
-          <doc:error name="&ERROR_NOT_FILESYSTEM;">if the device is not a mountable file system</doc:error>
-          <doc:error name="&ERROR_NOT_MOUNTED;">if the file system is not mounted</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LUKS;">if the device is not LUKS encrypted</doc:error>
-          <doc:error name="&ERROR_NOT_LOCKED;">if the device is already unlocked</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LUKS;">if the device is not LUKS encrypted</doc:error>
-          <doc:error name="&ERROR_NOT_UNLOCKED;">if the device is not unlocked</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LUKS;">if the device is not LUKS encrypted</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">component to add is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LINUX_MD;">device to add component to is not a Linux md RAID array</doc:error>
-          <doc:error name="&ERROR_NOT_FOUND;">given component doesn't exist</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">component to add is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LINUX_MD;">device to remove component from is not a Linux md RAID array</doc:error>
-          <doc:error name="&ERROR_NOT_FOUND;">given component is not part of the array</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">component to add is busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LINUX_MD;">device is not a Linux md RAID array</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
-          <doc:error name="&ERROR_NOT_DRIVE;">device is not a drive</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
           </doc:list>
         </doc:permission>
         <doc:errors>
-          <doc:error name="&ERROR_FAILED;">if an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if the device or a dependent device (e.g. partition or cleartext luks device) is busy (e.g. mounted)</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_DRIVE;">device is not a drive</doc:error>
-          <doc:error name="&ERROR_INVALID_OPTION;">if an invalid or malformed unmount option was given</doc:error>
+          <doc:error name="&ERROR_INVALID_OPTION;">if an invalid or malformed option was given</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_ATA_SMART_NOT_AVAILABLE;">if ATA SMART isn't available on the disk</doc:error>
-          <doc:error name="&ERROR_ATA_SMART_WOULD_WAKEUP;">If the disk is asleep and the nowakeup option was passed</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_ATA_SMART_WOULD_WAKEUP;">If the disk is sleeping and the <doc:tt>nowakeup</doc:tt> option was passed</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_ATA_SMART_NOT_AVAILABLE;">if ATA SMART isn't available on the disk</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
         </doc:errors>
       </doc:doc>
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_ATA_SMART_NOT_AVAILABLE;">device is not ATA SMART capable</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
index f4f7ef8..5fdda80 100644 (file)
@@ -2,25 +2,12 @@
 "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" [
   <!ENTITY ERROR_FAILED "org.freedesktop.DeviceKit.Disks.Error.Failed">
-  <!ENTITY ERROR_INHIBITED "org.freedesktop.DeviceKit.Disks.Error.Inhibited">
   <!ENTITY ERROR_BUSY "org.freedesktop.DeviceKit.Disks.Error.Busy">
   <!ENTITY ERROR_CANCELLED "org.freedesktop.DeviceKit.Disks.Error.Cancelled">
+  <!ENTITY ERROR_INHIBITED "org.freedesktop.DeviceKit.Disks.Error.Inhibited">
   <!ENTITY ERROR_INVALID_OPTION "org.freedesktop.DeviceKit.Disks.Error.InvalidOption">
-  <!ENTITY ERROR_ALREADY_MOUNTED "org.freedesktop.DeviceKit.Disks.Error.AlreadyMounted">
-  <!ENTITY ERROR_NOT_MOUNTED "org.freedesktop.DeviceKit.Disks.Error.NotMounted">
-  <!ENTITY ERROR_NOT_CANCELLABLE "org.freedesktop.DeviceKit.Disks.Error.NotCancellable">
-  <!ENTITY ERROR_NOT_PARTITION "org.freedesktop.DeviceKit.Disks.Error.NotPartition">
-  <!ENTITY ERROR_NOT_PARTITION_TABLE "org.freedesktop.DeviceKit.Disks.Error.NotPartitionTable">
-  <!ENTITY ERROR_NOT_FILESYSTEM "org.freedesktop.DeviceKit.Disks.Error.NotFilesystem">
-  <!ENTITY ERROR_NOT_LUKS "org.freedesktop.DeviceKit.Disks.Error.NotLuks">
-  <!ENTITY ERROR_NOT_LOCKED "org.freedesktop.DeviceKit.Disks.Error.NotLocked">
-  <!ENTITY ERROR_NOT_UNLOCKED "org.freedesktop.DeviceKit.Disks.Error.NotUnlocked">
-  <!ENTITY ERROR_NOT_LINUX_MD "org.freedesktop.DeviceKit.Disks.Error.NotLinuxMd">
-  <!ENTITY ERROR_NOT_LINUX_MD_COMPONENT "org.freedesktop.DeviceKit.Disks.Error.NotLinuxMdComponent">
-  <!ENTITY ERROR_NOT_DRIVE "org.freedesktop.DeviceKit.Disks.Error.NotDrive">
-  <!ENTITY ERROR_NOT_SMART_CAPABLE "org.freedesktop.DeviceKit.Disks.Error.NotSmartCapable">
   <!ENTITY ERROR_NOT_SUPPORTED "org.freedesktop.DeviceKit.Disks.Error.NotSupported">
-  <!ENTITY ERROR_NOT_FOUND "org.freedesktop.DeviceKit.Disks.Error.NotFound">
+  <!ENTITY ERROR_ATA_SMART_WOULD_WAKEUP "org.freedesktop.DeviceKit.Disks.Error.NotFound">
   <!ENTITY ERROR_NOT_AUTHORIZED "org.freedesktop.PolicyKit.Error.NotAuthorized">
 ]>
 <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
@@ -97,7 +84,7 @@
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
           <doc:error name="&ERROR_BUSY;">if one of the given components are busy</doc:error>
-          <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
+          <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LINUX_MD_COMPONENT;">one of the given components doesn't exist or is not a Linux md component</doc:error>
         </doc:errors>
       </doc:doc>
     </method>