diff options
author | David Zeuthen <davidz@redhat.com> | 2011-03-02 14:56:25 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2011-03-02 14:56:25 -0500 |
commit | 44041978ef781b828ae282a4893aad61a72aceea (patch) | |
tree | 05a872c1337d56981890275a8d0760429e4e1729 | |
parent | 108e4476ed323e19ac5d69e8854c74b6f2e606ff (diff) |
Rename Drive to LUN
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | data/org.freedesktop.UDisks2.xml | 6 | ||||
-rw-r--r-- | doc/udisks2-docs.xml | 2 | ||||
-rw-r--r-- | doc/udisks2-sections.txt | 22 | ||||
-rw-r--r-- | doc/udisks2.types | 2 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/types.h | 4 | ||||
-rw-r--r-- | src/udiskslinuxblock.c | 48 | ||||
-rw-r--r-- | src/udiskslinuxdrive.h | 47 | ||||
-rw-r--r-- | src/udiskslinuxlun.c (renamed from src/udiskslinuxdrive.c) | 266 | ||||
-rw-r--r-- | src/udiskslinuxlun.h | 47 | ||||
-rw-r--r-- | src/udiskslinuxprovider.c | 72 | ||||
-rw-r--r-- | tools/udisksctl.c | 74 |
13 files changed, 298 insertions, 298 deletions
diff --git a/Makefile.am b/Makefile.am index d914948..416e279 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ NULL = # NOTE: 'tests' subdir is disabled for now -SUBDIRS = data udisks src doc tools policy +SUBDIRS = data udisks src tools policy doc EXTRA_DIST = \ HACKING \ diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml index db23013..c16de69 100644 --- a/data/org.freedesktop.UDisks2.xml +++ b/data/org.freedesktop.UDisks2.xml @@ -16,7 +16,7 @@ <!-- ********************************************************************** --> - <interface name="org.freedesktop.UDisks2.Drive"> + <interface name="org.freedesktop.UDisks2.Lun"> <property name="Vendor" type="ay" access="read"/> <property name="Model" type="ay" access="read"/> <property name="Revision" type="ay" access="read"/> @@ -38,10 +38,10 @@ --> <property name="PreferredDevice" type="ay" access="read"/> - <!-- The org.freedesktop.UDisks2.Drive object that the block device belongs + <!-- The org.freedesktop.UDisks2.Lun object that the block device belongs to, or '/' if no such object exists. --> - <property name="Drive" type="o" access="read"/> + <property name="Lun" type="o" access="read"/> <!-- Properties related what's on the block device --> <property name="IdUsage" type="s" access="read"/> diff --git a/doc/udisks2-docs.xml b/doc/udisks2-docs.xml index ebb36f0..9e4a0c9 100644 --- a/doc/udisks2-docs.xml +++ b/doc/udisks2-docs.xml @@ -71,7 +71,7 @@ <xi:include href="xml/udisksdaemon.xml"/> <xi:include href="xml/udisksdaemonutil.xml"/> <xi:include href="xml/udiskslinuxblock.xml"/> - <xi:include href="xml/udiskslinuxdrive.xml"/> + <xi:include href="xml/udiskslinuxlun.xml"/> <xi:include href="xml/udisksmount.xml"/> <xi:include href="xml/udisksmountmonitor.xml"/> <xi:include href="xml/udiskspersistentstore.xml"/> diff --git a/doc/udisks2-sections.txt b/doc/udisks2-sections.txt index 6da18ce..2950842 100644 --- a/doc/udisks2-sections.txt +++ b/doc/udisks2-sections.txt @@ -102,19 +102,19 @@ udisks_linux_block_get_type </SECTION> <SECTION> -<FILE>udiskslinuxdrive</FILE> -<TITLE>UDisksLinuxDrive</TITLE> -UDisksLinuxDrive -udisks_linux_drive_new -udisks_linux_drive_uevent -udisks_linux_drive_get_daemon -udisks_linux_drive_get_devices +<FILE>udiskslinuxlun</FILE> +<TITLE>UDisksLinuxLun</TITLE> +UDisksLinuxLun +udisks_linux_lun_new +udisks_linux_lun_uevent +udisks_linux_lun_get_daemon +udisks_linux_lun_get_devices <SUBSECTION Standard> -UDISKS_TYPE_LINUX_DRIVE -UDISKS_LINUX_DRIVE -UDISKS_IS_LINUX_DRIVE +UDISKS_TYPE_LINUX_LUN +UDISKS_LINUX_LUN +UDISKS_IS_LINUX_LUN <SUBSECTION Private> -udisks_linux_drive_get_type +udisks_linux_lun_get_type </SECTION> <SECTION> diff --git a/doc/udisks2.types b/doc/udisks2.types index 9bf18d0..a2efe42 100644 --- a/doc/udisks2.types +++ b/doc/udisks2.types @@ -1,6 +1,6 @@ udisks_daemon_get_type udisks_linux_block_get_type -udisks_linux_drive_get_type +udisks_linux_lun_get_type udisks_base_job_get_type udisks_spawned_job_get_type udisks_threaded_job_get_type diff --git a/src/Makefile.am b/src/Makefile.am index 7a8c9b9..71f1118 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,7 @@ libudisks_daemon_la_SOURCES = \ udiskslinuxprovider.h udiskslinuxprovider.c \ udisksfstabprovider.h udisksfstabprovider.c \ udiskslinuxblock.h udiskslinuxblock.c \ - udiskslinuxdrive.h udiskslinuxdrive.c \ + udiskslinuxlun.h udiskslinuxlun.c \ udisksbasejob.h udisksbasejob.c \ udisksspawnedjob.h udisksspawnedjob.c \ udisksthreadedjob.h udisksthreadedjob.c \ @@ -64,7 +64,7 @@ libudisks_daemon_la_SOURCES = \ libudisks_daemon_la_CFLAGS = \ -I$(top_srcdir) \ - -DG_LOG_DOMAIN=\"udisks-daemon\" \ + -DG_LOG_DOMAIN=\"udisksd\" \ $(GLIB_CFLAGS) \ $(GIO_CFLAGS) \ $(GUDEV_CFLAGS) \ diff --git a/src/types.h b/src/types.h index 153973e..99b22fc 100644 --- a/src/types.h +++ b/src/types.h @@ -37,8 +37,8 @@ typedef struct _UDisksLinuxProvider UDisksLinuxProvider; struct _UDisksLinuxBlock; typedef struct _UDisksLinuxBlock UDisksLinuxBlock; -struct _UDisksLinuxDrive; -typedef struct _UDisksLinuxDrive UDisksLinuxDrive; +struct _UDisksLinuxLun; +typedef struct _UDisksLinuxLun UDisksLinuxLun; struct _UDisksFilesystemImpl; typedef struct _UDisksFilesystemImpl UDisksFilesystemImpl; diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c index bde5c44..e2b16cc 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c @@ -33,7 +33,7 @@ #include "udiskslinuxblock.h" #include "udisksmount.h" #include "udisksmountmonitor.h" -#include "udiskslinuxdrive.h" +#include "udiskslinuxlun.h" #include "udiskspersistentstore.h" /** @@ -387,8 +387,8 @@ block_device_connect (UDisksLinuxBlock *block) } static gchar * -find_drive (GDBusObjectManager *object_manager, - GUdevDevice *block_device) +find_lun (GDBusObjectManager *object_manager, + GUdevDevice *block_device) { const gchar *block_device_sysfs_path; gchar *ret; @@ -403,32 +403,32 @@ find_drive (GDBusObjectManager *object_manager, for (l = objects; l != NULL; l = l->next) { GDBusObject *object = G_DBUS_OBJECT (l->data); - UDisksLinuxDrive *drive; - GList *drive_devices; + UDisksLinuxLun *lun; + GList *lun_devices; GList *j; - if (!UDISKS_IS_LINUX_DRIVE (object)) + if (!UDISKS_IS_LINUX_LUN (object)) continue; - drive = UDISKS_LINUX_DRIVE (object); - drive_devices = udisks_linux_drive_get_devices (drive); + lun = UDISKS_LINUX_LUN (object); + lun_devices = udisks_linux_lun_get_devices (lun); - for (j = drive_devices; j != NULL; j = j->next) + for (j = lun_devices; j != NULL; j = j->next) { - GUdevDevice *drive_device = G_UDEV_DEVICE (j->data); - const gchar *drive_sysfs_path; + GUdevDevice *lun_device = G_UDEV_DEVICE (j->data); + const gchar *lun_sysfs_path; - drive_sysfs_path = g_udev_device_get_sysfs_path (drive_device); - if (g_str_has_prefix (block_device_sysfs_path, drive_sysfs_path)) + lun_sysfs_path = g_udev_device_get_sysfs_path (lun_device); + if (g_str_has_prefix (block_device_sysfs_path, lun_sysfs_path)) { ret = g_dbus_object_get_object_path (object); - g_list_foreach (drive_devices, (GFunc) g_object_unref, NULL); - g_list_free (drive_devices); + g_list_foreach (lun_devices, (GFunc) g_object_unref, NULL); + g_list_free (lun_devices); goto out; } } - g_list_foreach (drive_devices, (GFunc) g_object_unref, NULL); - g_list_free (drive_devices); + g_list_foreach (lun_devices, (GFunc) g_object_unref, NULL); + g_list_free (lun_devices); } out: @@ -479,7 +479,7 @@ block_device_update (UDisksLinuxBlock *block, UDisksBlockDevice *iface = UDISKS_BLOCK_DEVICE (_iface); GUdevDeviceNumber dev; GDBusObjectManager *object_manager; - gchar *drive_object_path; + gchar *lun_object_path; gchar *s; GList *mounts; GList *l; @@ -522,21 +522,21 @@ block_device_update (UDisksLinuxBlock *block, } udisks_block_device_set_preferred_device (iface, preferred_device_file); - /* Determine the drive this block device belongs to + /* Determine the lun this block device belongs to * * TODO: if this is slow we could have a cache or ensure that we * only do this once or something else */ object_manager = udisks_daemon_get_object_manager (block->daemon); - drive_object_path = find_drive (object_manager, block->device); - if (drive_object_path != NULL) + lun_object_path = find_lun (object_manager, block->device); + if (lun_object_path != NULL) { - udisks_block_device_set_drive (iface, drive_object_path); - g_free (drive_object_path); + udisks_block_device_set_lun (iface, lun_object_path); + g_free (lun_object_path); } else { - udisks_block_device_set_drive (iface, "/"); + udisks_block_device_set_lun (iface, "/"); } udisks_block_device_set_id_usage (iface, g_udev_device_get_property (block->device, "ID_FS_USAGE")); diff --git a/src/udiskslinuxdrive.h b/src/udiskslinuxdrive.h deleted file mode 100644 index 8ef5441..0000000 --- a/src/udiskslinuxdrive.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2007-2010 David Zeuthen <zeuthen@gmail.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef __UDISKS_LINUX_DRIVE_H__ -#define __UDISKS_LINUX_DRIVE_H__ - -#include "types.h" -#include <gudev/gudev.h> - -G_BEGIN_DECLS - -#define UDISKS_TYPE_LINUX_DRIVE (udisks_linux_drive_get_type ()) -#define UDISKS_LINUX_DRIVE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UDISKS_TYPE_LINUX_DRIVE, UDisksLinuxDrive)) -#define UDISKS_IS_LINUX_DRIVE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UDISKS_TYPE_LINUX_DRIVE)) - -GType udisks_linux_drive_get_type (void) G_GNUC_CONST; -UDisksLinuxDrive *udisks_linux_drive_new (UDisksDaemon *daemon, - GUdevDevice *device); -void udisks_linux_drive_uevent (UDisksLinuxDrive *drive, - const gchar *action, - GUdevDevice *device); -UDisksDaemon *udisks_linux_drive_get_daemon (UDisksLinuxDrive *drive); -GList *udisks_linux_drive_get_devices (UDisksLinuxDrive *drive); - -gboolean udisks_linux_drive_should_include_device (GUdevDevice *device, - gchar **out_vpd); - -G_END_DECLS - -#endif /* __UDISKS_LINUX_DRIVE_H__ */ diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxlun.c index ed06cdf..d39962b 100644 --- a/src/udiskslinuxdrive.c +++ b/src/udiskslinuxlun.c @@ -24,25 +24,25 @@ #include "udisksdaemon.h" #include "udisksdaemonutil.h" -#include "udiskslinuxdrive.h" +#include "udiskslinuxlun.h" /** - * SECTION:udiskslinuxdrive - * @title: UDisksLinuxDrive - * @short_description: Linux drives (ATA, SCSI, etc.) + * SECTION:udiskslinuxlun + * @title: UDisksLinuxLun + * @short_description: Linux LUNs (ATA, SCSI, Software RAID, etc.) * - * Object corresponding to a drive on Linux. + * Object corresponding to a LUN on Linux. */ -typedef struct _UDisksLinuxDriveClass UDisksLinuxDriveClass; +typedef struct _UDisksLinuxLunClass UDisksLinuxLunClass; /** - * UDisksLinuxDrive: + * UDisksLinuxLun: * - * The #UDisksLinuxDrive structure contains only private data and + * The #UDisksLinuxLun structure contains only private data and * should only be accessed using the provided API. */ -struct _UDisksLinuxDrive +struct _UDisksLinuxLun { GDBusObject parent_instance; @@ -52,10 +52,10 @@ struct _UDisksLinuxDrive GList *devices; /* interfaces */ - UDisksDrive *iface_drive; + UDisksLun *iface_lun; }; -struct _UDisksLinuxDriveClass +struct _UDisksLinuxLunClass { GDBusObjectClass parent_class; }; @@ -67,37 +67,37 @@ enum PROP_DEVICE }; -G_DEFINE_TYPE (UDisksLinuxDrive, udisks_linux_drive, G_TYPE_DBUS_OBJECT); +G_DEFINE_TYPE (UDisksLinuxLun, udisks_linux_lun, G_TYPE_DBUS_OBJECT); static void -udisks_linux_drive_finalize (GObject *object) +udisks_linux_lun_finalize (GObject *object) { - UDisksLinuxDrive *drive = UDISKS_LINUX_DRIVE (object); + UDisksLinuxLun *lun = UDISKS_LINUX_LUN (object); - /* note: we don't hold a ref to drive->daemon or drive->mount_monitor */ + /* note: we don't hold a ref to lun->daemon or lun->mount_monitor */ - g_list_foreach (drive->devices, (GFunc) g_object_unref, NULL); - g_list_free (drive->devices); + g_list_foreach (lun->devices, (GFunc) g_object_unref, NULL); + g_list_free (lun->devices); - if (drive->iface_drive != NULL) - g_object_unref (drive->iface_drive); + if (lun->iface_lun != NULL) + g_object_unref (lun->iface_lun); - if (G_OBJECT_CLASS (udisks_linux_drive_parent_class)->finalize != NULL) - G_OBJECT_CLASS (udisks_linux_drive_parent_class)->finalize (object); + if (G_OBJECT_CLASS (udisks_linux_lun_parent_class)->finalize != NULL) + G_OBJECT_CLASS (udisks_linux_lun_parent_class)->finalize (object); } static void -udisks_linux_drive_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) +udisks_linux_lun_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { - UDisksLinuxDrive *drive = UDISKS_LINUX_DRIVE (object); + UDisksLinuxLun *lun = UDISKS_LINUX_LUN (object); switch (prop_id) { case PROP_DAEMON: - g_value_set_object (value, udisks_linux_drive_get_daemon (drive)); + g_value_set_object (value, udisks_linux_lun_get_daemon (lun)); break; default: @@ -107,24 +107,24 @@ udisks_linux_drive_get_property (GObject *object, } static void -udisks_linux_drive_set_property (GObject *object, +udisks_linux_lun_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - UDisksLinuxDrive *drive = UDISKS_LINUX_DRIVE (object); + UDisksLinuxLun *lun = UDISKS_LINUX_LUN (object); switch (prop_id) { case PROP_DAEMON: - g_assert (drive->daemon == NULL); + g_assert (lun->daemon == NULL); /* we don't take a reference to the daemon */ - drive->daemon = g_value_get_object (value); + lun->daemon = g_value_get_object (value); break; case PROP_DEVICE: - g_assert (drive->devices == NULL); - drive->devices = g_list_prepend (NULL, g_value_dup_object (value)); + g_assert (lun->devices == NULL); + lun->devices = g_list_prepend (NULL, g_value_dup_object (value)); break; default: @@ -135,7 +135,7 @@ udisks_linux_drive_set_property (GObject *object, static void -udisks_linux_drive_init (UDisksLinuxDrive *drive) +udisks_linux_lun_init (UDisksLinuxLun *lun) { } @@ -153,9 +153,9 @@ find_construct_property (guint n_construct_properties, /* unless given, compute object path from sysfs path */ static GObject * -udisks_linux_drive_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties) +udisks_linux_lun_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_properties) { GObjectConstructParam *device_cp; GUdevDevice *device; @@ -166,15 +166,15 @@ udisks_linux_drive_constructor (GType type, device = G_UDEV_DEVICE (g_value_get_object (device_cp->value)); g_assert (device != NULL); - if (!udisks_linux_drive_should_include_device (device, NULL)) + if (!udisks_linux_lun_should_include_device (device, NULL)) { return NULL; } else { - return G_OBJECT_CLASS (udisks_linux_drive_parent_class)->constructor (type, - n_construct_properties, - construct_properties); + return G_OBJECT_CLASS (udisks_linux_lun_parent_class)->constructor (type, + n_construct_properties, + construct_properties); } } @@ -199,28 +199,28 @@ strip_and_replace_with_uscore (gchar *s) } static void -udisks_linux_drive_constructed (GObject *object) +udisks_linux_lun_constructed (GObject *object) { - UDisksLinuxDrive *drive = UDISKS_LINUX_DRIVE (object); + UDisksLinuxLun *lun = UDISKS_LINUX_LUN (object); gchar *vendor; gchar *model; gchar *serial; GString *str; /* initial coldplug */ - udisks_linux_drive_uevent (drive, "add", drive->devices->data); + udisks_linux_lun_uevent (lun, "add", lun->devices->data); /* compute the object path */ - vendor = g_strdup (udisks_drive_get_vendor (drive->iface_drive)); - model = g_strdup (udisks_drive_get_model (drive->iface_drive)); - serial = g_strdup (udisks_drive_get_serial (drive->iface_drive)); + vendor = g_strdup (udisks_lun_get_vendor (lun->iface_lun)); + model = g_strdup (udisks_lun_get_model (lun->iface_lun)); + serial = g_strdup (udisks_lun_get_serial (lun->iface_lun)); strip_and_replace_with_uscore (vendor); strip_and_replace_with_uscore (model); strip_and_replace_with_uscore (serial); - str = g_string_new ("/org/freedesktop/UDisks2/drives/"); + str = g_string_new ("/org/freedesktop/UDisks2/LUNs/"); if (vendor == NULL && model == NULL && serial == NULL) { - g_string_append (str, "drive"); + g_string_append (str, "lun"); } else { @@ -245,27 +245,27 @@ udisks_linux_drive_constructed (GObject *object) g_free (vendor); g_free (model); g_free (serial); - g_dbus_object_set_object_path (G_DBUS_OBJECT (drive), str->str); + g_dbus_object_set_object_path (G_DBUS_OBJECT (lun), str->str); g_string_free (str, TRUE); - if (G_OBJECT_CLASS (udisks_linux_drive_parent_class)->constructed != NULL) - G_OBJECT_CLASS (udisks_linux_drive_parent_class)->constructed (object); + if (G_OBJECT_CLASS (udisks_linux_lun_parent_class)->constructed != NULL) + G_OBJECT_CLASS (udisks_linux_lun_parent_class)->constructed (object); } static void -udisks_linux_drive_class_init (UDisksLinuxDriveClass *klass) +udisks_linux_lun_class_init (UDisksLinuxLunClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); - gobject_class->constructor = udisks_linux_drive_constructor; - gobject_class->finalize = udisks_linux_drive_finalize; - gobject_class->constructed = udisks_linux_drive_constructed; - gobject_class->set_property = udisks_linux_drive_set_property; - gobject_class->get_property = udisks_linux_drive_get_property; + gobject_class->constructor = udisks_linux_lun_constructor; + gobject_class->finalize = udisks_linux_lun_finalize; + gobject_class->constructed = udisks_linux_lun_constructed; + gobject_class->set_property = udisks_linux_lun_set_property; + gobject_class->get_property = udisks_linux_lun_get_property; /** - * UDisksLinuxDrive:daemon: + * UDisksLinuxLun:daemon: * * The #UDisksDaemon the object is for. */ @@ -281,7 +281,7 @@ udisks_linux_drive_class_init (UDisksLinuxDriveClass *klass) G_PARAM_STATIC_STRINGS)); /** - * UDisksLinuxDrive:device: + * UDisksLinuxLun:device: * * The #GUdevDevice for the object. Connect to the #GObject::notify * signal to get notified whenever this is updated. @@ -299,16 +299,16 @@ udisks_linux_drive_class_init (UDisksLinuxDriveClass *klass) } /** - * udisks_linux_drive_new: + * udisks_linux_lun_new: * @daemon: A #UDisksDaemon. - * @device: The #GUdevDevice for the sysfs drive device. + * @device: The #GUdevDevice for the sysfs scsi device. * - * Create a new drive object. + * Create a new lun object. * - * Returns: A #UDisksLinuxDrive object or %NULL if @device does not represent a drive. Free with g_object_unref(). + * Returns: A #UDisksLinuxLun object or %NULL if @device does not represent a lun. Free with g_object_unref(). */ -UDisksLinuxDrive * -udisks_linux_drive_new (UDisksDaemon *daemon, +UDisksLinuxLun * +udisks_linux_lun_new (UDisksDaemon *daemon, GUdevDevice *device) { GObject *object; @@ -316,60 +316,60 @@ udisks_linux_drive_new (UDisksDaemon *daemon, g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL); g_return_val_if_fail (G_UDEV_IS_DEVICE (device), NULL); - object = g_object_new (UDISKS_TYPE_LINUX_DRIVE, + object = g_object_new (UDISKS_TYPE_LINUX_LUN, "daemon", daemon, "device", device, NULL); if (object != NULL) - return UDISKS_LINUX_DRIVE (object); + return UDISKS_LINUX_LUN (object); else return NULL; } /** - * udisks_linux_drive_get_daemon: - * @drive: A #UDisksLinuxDrive. + * udisks_linux_lun_get_daemon: + * @lun: A #UDisksLinuxLun. * - * Gets the daemon used by @drive. + * Gets the daemon used by @lun. * - * Returns: A #UDisksDaemon. Do not free, the object is owned by @drive. + * Returns: A #UDisksDaemon. Do not free, the object is owned by @lun. */ UDisksDaemon * -udisks_linux_drive_get_daemon (UDisksLinuxDrive *drive) +udisks_linux_lun_get_daemon (UDisksLinuxLun *lun) { - g_return_val_if_fail (UDISKS_IS_LINUX_DRIVE (drive), NULL); - return drive->daemon; + g_return_val_if_fail (UDISKS_IS_LINUX_LUN (lun), NULL); + return lun->daemon; } /** - * udisks_linux_drive_get_devices: - * @drive: A #UDisksLinuxDrive. + * udisks_linux_lun_get_devices: + * @lun: A #UDisksLinuxLun. * - * Gets the current #GUdevDevice objects associated with @drive. + * Gets the current #GUdevDevice objects associated with @lun. * * Returns: A list of #GUdevDevice objects. Free each element with * g_object_unref(), then free the list with g_list_free(). */ GList * -udisks_linux_drive_get_devices (UDisksLinuxDrive *drive) +udisks_linux_lun_get_devices (UDisksLinuxLun *lun) { GList *ret; - g_return_val_if_fail (UDISKS_IS_LINUX_DRIVE (drive), NULL); - ret = g_list_copy (drive->devices); + g_return_val_if_fail (UDISKS_IS_LINUX_LUN (lun), NULL); + ret = g_list_copy (lun->devices); g_list_foreach (ret, (GFunc) g_object_ref, NULL); return ret; } /* ---------------------------------------------------------------------------------------------------- */ -typedef gboolean (*HasInterfaceFunc) (UDisksLinuxDrive *drive); -typedef void (*UpdateInterfaceFunc) (UDisksLinuxDrive *drive, +typedef gboolean (*HasInterfaceFunc) (UDisksLinuxLun *lun); +typedef void (*UpdateInterfaceFunc) (UDisksLinuxLun *lun, const gchar *uevent_action, GDBusInterface *interface); static void -update_iface (UDisksLinuxDrive *drive, +update_iface (UDisksLinuxLun *lun, const gchar *uevent_action, HasInterfaceFunc has_func, UpdateInterfaceFunc update_func, @@ -380,7 +380,7 @@ update_iface (UDisksLinuxDrive *drive, gboolean add; GDBusInterface **interface_pointer = _interface_pointer; - g_return_if_fail (drive != NULL); + g_return_if_fail (lun != NULL); g_return_if_fail (has_func != NULL); g_return_if_fail (update_func != NULL); g_return_if_fail (g_type_is_a (stub_type, G_TYPE_OBJECT)); @@ -389,7 +389,7 @@ update_iface (UDisksLinuxDrive *drive, g_return_if_fail (*interface_pointer == NULL || G_IS_DBUS_INTERFACE (*interface_pointer)); add = FALSE; - has = has_func (drive); + has = has_func (lun); if (*interface_pointer == NULL) { if (has) @@ -402,7 +402,7 @@ update_iface (UDisksLinuxDrive *drive, { if (!has) { - g_dbus_object_remove_interface (G_DBUS_OBJECT (drive), G_DBUS_INTERFACE (*interface_pointer)); + g_dbus_object_remove_interface (G_DBUS_OBJECT (lun), G_DBUS_INTERFACE (*interface_pointer)); g_object_unref (*interface_pointer); *interface_pointer = NULL; } @@ -410,33 +410,33 @@ update_iface (UDisksLinuxDrive *drive, if (*interface_pointer != NULL) { - update_func (drive, uevent_action, G_DBUS_INTERFACE (*interface_pointer)); + update_func (lun, uevent_action, G_DBUS_INTERFACE (*interface_pointer)); if (add) - g_dbus_object_add_interface (G_DBUS_OBJECT (drive), G_DBUS_INTERFACE (*interface_pointer)); + g_dbus_object_add_interface (G_DBUS_OBJECT (lun), G_DBUS_INTERFACE (*interface_pointer)); } } /* ---------------------------------------------------------------------------------------------------- */ -/* org.freedesktop.UDisks.Drive */ +/* org.freedesktop.UDisks.Lun */ static gboolean -drive_check (UDisksLinuxDrive *drive) +lun_check (UDisksLinuxLun *lun) { return TRUE; } static void -drive_update (UDisksLinuxDrive *drive, - const gchar *uevent_action, - GDBusInterface *_iface) +lun_update (UDisksLinuxLun *lun, + const gchar *uevent_action, + GDBusInterface *_iface) { - UDisksDrive *iface = UDISKS_DRIVE (_iface); + UDisksLun *iface = UDISKS_LUN (_iface); GUdevDevice *device; - if (drive->devices == NULL) + if (lun->devices == NULL) goto out; - device = G_UDEV_DEVICE (drive->devices->data); + device = G_UDEV_DEVICE (lun->devices->data); /* this is the _almost_ the same for both ATA and SCSI devices (cf. udev's ata_id and scsi_id) * but we special case since there are subtle differences... @@ -452,17 +452,17 @@ drive_update (UDisksLinuxDrive *drive, gchar *s; s = udisks_decode_udev_string (model); g_strstrip (s); - udisks_drive_set_model (iface, s); + udisks_lun_set_model (iface, s); g_free (s); } - udisks_drive_set_vendor (iface, g_udev_device_get_property (device, "")); - udisks_drive_set_revision (iface, g_udev_device_get_property (device, "ID_REVISION")); + udisks_lun_set_vendor (iface, g_udev_device_get_property (device, "")); + udisks_lun_set_revision (iface, g_udev_device_get_property (device, "ID_REVISION")); serial = g_udev_device_get_property (device, "ID_SERIAL_SHORT"); if (serial == NULL) serial = g_udev_device_get_property (device, "ID_SERIAL"); - udisks_drive_set_serial (iface, serial); - udisks_drive_set_wwn (iface, g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION")); + udisks_lun_set_serial (iface, serial); + udisks_lun_set_wwn (iface, g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION")); } else if (g_udev_device_get_property_as_boolean (device, "ID_SCSI")) { @@ -475,7 +475,7 @@ drive_update (UDisksLinuxDrive *drive, gchar *s; s = udisks_decode_udev_string (vendor); g_strstrip (s); - udisks_drive_set_vendor (iface, s); + udisks_lun_set_vendor (iface, s); g_free (s); } @@ -485,22 +485,22 @@ drive_update (UDisksLinuxDrive *drive, gchar *s; s = udisks_decode_udev_string (model); g_strstrip (s); - udisks_drive_set_model (iface, s); + udisks_lun_set_model (iface, s); g_free (s); } - udisks_drive_set_revision (iface, g_udev_device_get_property (device, "ID_REVISION")); - udisks_drive_set_serial (iface, g_udev_device_get_property (device, "ID_SCSI_SERIAL")); - udisks_drive_set_wwn (iface, g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION")); + udisks_lun_set_revision (iface, g_udev_device_get_property (device, "ID_REVISION")); + udisks_lun_set_serial (iface, g_udev_device_get_property (device, "ID_SCSI_SERIAL")); + udisks_lun_set_wwn (iface, g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION")); } else { /* generic fallback... */ - udisks_drive_set_vendor (iface, g_udev_device_get_property (device, "ID_VENDOR")); - udisks_drive_set_model (iface, g_udev_device_get_property (device, "ID_MODEL")); - udisks_drive_set_revision (iface, g_udev_device_get_property (device, "ID_REVISION")); - udisks_drive_set_serial (iface, g_udev_device_get_property (device, "ID_SERIAL_SHORT")); - udisks_drive_set_wwn (iface, g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION")); + udisks_lun_set_vendor (iface, g_udev_device_get_property (device, "ID_VENDOR")); + udisks_lun_set_model (iface, g_udev_device_get_property (device, "ID_MODEL")); + udisks_lun_set_revision (iface, g_udev_device_get_property (device, "ID_REVISION")); + udisks_lun_set_serial (iface, g_udev_device_get_property (device, "ID_SERIAL_SHORT")); + udisks_lun_set_wwn (iface, g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION")); } out: @@ -510,13 +510,13 @@ drive_update (UDisksLinuxDrive *drive, /* ---------------------------------------------------------------------------------------------------- */ static GList * -find_link_for_sysfs_path (UDisksLinuxDrive *drive, - const gchar *sysfs_path) +find_link_for_sysfs_path (UDisksLinuxLun *lun, + const gchar *sysfs_path) { GList *l; GList *ret; ret = NULL; - for (l = drive->devices; l != NULL; l = l->next) + for (l = lun->devices; l != NULL; l = l->next) { GUdevDevice *device = G_UDEV_DEVICE (l->data); if (g_strcmp0 (g_udev_device_get_sysfs_path (device), sysfs_path) == 0) @@ -530,36 +530,36 @@ find_link_for_sysfs_path (UDisksLinuxDrive *drive, } /** - * udisks_linux_drive_uevent: - * @drive: A #UDisksLinuxDrive. + * udisks_linux_lun_uevent: + * @lun: A #UDisksLinuxLun. * @action: Uevent action or %NULL * @device: A new #GUdevDevice device object or %NULL if the device hasn't changed. * - * Updates all information on interfaces on @drive. + * Updates all information on interfaces on @lun. */ void -udisks_linux_drive_uevent (UDisksLinuxDrive *drive, - const gchar *action, - GUdevDevice *device) +udisks_linux_lun_uevent (UDisksLinuxLun *lun, + const gchar *action, + GUdevDevice *device) { GList *link; - g_return_if_fail (UDISKS_IS_LINUX_DRIVE (drive)); + g_return_if_fail (UDISKS_IS_LINUX_LUN (lun)); g_return_if_fail (G_UDEV_IS_DEVICE (device)); - link = find_link_for_sysfs_path (drive, g_udev_device_get_sysfs_path (device)); + link = find_link_for_sysfs_path (lun, g_udev_device_get_sysfs_path (device)); if (g_strcmp0 (action, "remove") == 0) { if (link != NULL) { g_object_unref (G_UDEV_DEVICE (link->data)); - drive->devices = g_list_delete_link (drive->devices, link); + lun->devices = g_list_delete_link (lun->devices, link); } else { - udisks_daemon_log (drive->daemon, + udisks_daemon_log (lun->daemon, UDISKS_LOG_LEVEL_WARNING, - "Drive doesn't have device with sysfs path %s on remove event", + "Lun doesn't have device with sysfs path %s on remove event", g_udev_device_get_sysfs_path (device)); } } @@ -572,28 +572,28 @@ udisks_linux_drive_uevent (UDisksLinuxDrive *drive, } else { - drive->devices = g_list_append (drive->devices, g_object_ref (device)); + lun->devices = g_list_append (lun->devices, g_object_ref (device)); } } - update_iface (drive, action, drive_check, drive_update, - UDISKS_TYPE_DRIVE_STUB, &drive->iface_drive); + update_iface (lun, action, lun_check, lun_update, + UDISKS_TYPE_LUN_STUB, &lun->iface_lun); } /* ---------------------------------------------------------------------------------------------------- */ /* <internal> - * udisks_linux_drive_should_include_device: + * udisks_linux_lun_should_include_device: * @device: A #GUdevDevice. * @out_vpd: Return location for unique ID or %NULL. * - * Checks if we should even construct a #UDisksLinuxDrive for @device. + * Checks if we should even construct a #UDisksLinuxLun for @device. * * Returns: %TRUE if we should construct an object, %FALSE otherwise. */ gboolean -udisks_linux_drive_should_include_device (GUdevDevice *device, - gchar **out_vpd) +udisks_linux_lun_should_include_device (GUdevDevice *device, + gchar **out_vpd) { gboolean ret; gint type; diff --git a/src/udiskslinuxlun.h b/src/udiskslinuxlun.h new file mode 100644 index 0000000..1a90d79 --- /dev/null +++ b/src/udiskslinuxlun.h @@ -0,0 +1,47 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2007-2010 David Zeuthen <zeuthen@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __UDISKS_LINUX_LUN_H__ +#define __UDISKS_LINUX_LUN_H__ + +#include "types.h" +#include <gudev/gudev.h> + +G_BEGIN_DECLS + +#define UDISKS_TYPE_LINUX_LUN (udisks_linux_lun_get_type ()) +#define UDISKS_LINUX_LUN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UDISKS_TYPE_LINUX_LUN, UDisksLinuxLun)) +#define UDISKS_IS_LINUX_LUN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UDISKS_TYPE_LINUX_LUN)) + +GType udisks_linux_lun_get_type (void) G_GNUC_CONST; +UDisksLinuxLun *udisks_linux_lun_new (UDisksDaemon *daemon, + GUdevDevice *device); +void udisks_linux_lun_uevent (UDisksLinuxLun *lun, + const gchar *action, + GUdevDevice *device); +UDisksDaemon *udisks_linux_lun_get_daemon (UDisksLinuxLun *lun); +GList *udisks_linux_lun_get_devices (UDisksLinuxLun *lun); + +gboolean udisks_linux_lun_should_include_device (GUdevDevice *device, + gchar **out_vpd); + +G_END_DECLS + +#endif /* __UDISKS_LINUX_LUN_H__ */ diff --git a/src/udiskslinuxprovider.c b/src/udiskslinuxprovider.c index 80053f4..c354a54 100644 --- a/src/udiskslinuxprovider.c +++ b/src/udiskslinuxprovider.c @@ -26,7 +26,7 @@ #include "udisksprovider.h" #include "udiskslinuxprovider.h" #include "udiskslinuxblock.h" -#include "udiskslinuxdrive.h" +#include "udiskslinuxlun.h" /** * SECTION:udiskslinuxprovider @@ -34,7 +34,7 @@ * @short_description: Provider of Linux-specific objects * * This object is used to add/remove Linux specific objects. Right now - * it handles #UDisksLinuxBlock and #UDisksLinuxDrive objects. + * it handles #UDisksLinuxBlock and #UDisksLinuxLun objects. */ typedef struct _UDisksLinuxProviderClass UDisksLinuxProviderClass; @@ -54,9 +54,9 @@ struct _UDisksLinuxProvider /* maps from sysfs path to UDisksLinuxBlock objects */ GHashTable *sysfs_to_block; - /* maps from VPD (serial, wwn) and sysfs_path to UDisksLinuxDrive objects */ - GHashTable *vpd_to_drive; - GHashTable *sysfs_path_to_drive; + /* maps from VPD (serial, wwn) and sysfs_path to UDisksLinuxLun objects */ + GHashTable *vpd_to_lun; + GHashTable *sysfs_path_to_lun; /* maps from sysfs path to UDisksLinuxController objects */ GHashTable *sysfs_to_controller; @@ -80,8 +80,8 @@ udisks_linux_provider_finalize (GObject *object) UDisksLinuxProvider *provider = UDISKS_LINUX_PROVIDER (object); g_hash_table_unref (provider->sysfs_to_block); - g_hash_table_unref (provider->vpd_to_drive); - g_hash_table_unref (provider->sysfs_path_to_drive); + g_hash_table_unref (provider->vpd_to_lun); + g_hash_table_unref (provider->sysfs_path_to_lun); g_hash_table_unref (provider->sysfs_to_controller); g_object_unref (provider->gudev_client); @@ -124,14 +124,14 @@ udisks_linux_provider_constructed (GObject *object) g_str_equal, g_free, (GDestroyNotify) g_object_unref); - provider->vpd_to_drive = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, - (GDestroyNotify) g_object_unref); - provider->sysfs_path_to_drive = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, - NULL); + provider->vpd_to_lun = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + (GDestroyNotify) g_object_unref); + provider->sysfs_path_to_lun = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + NULL); provider->sysfs_to_controller = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, @@ -247,7 +247,7 @@ handle_scsi_uevent (UDisksLinuxProvider *provider, const gchar *action, GUdevDevice *device) { - UDisksLinuxDrive *drive; + UDisksLinuxLun *lun; UDisksDaemon *daemon; const gchar *sysfs_path; gchar *vpd; @@ -258,28 +258,28 @@ handle_scsi_uevent (UDisksLinuxProvider *provider, if (g_strcmp0 (action, "remove") == 0) { - drive = g_hash_table_lookup (provider->sysfs_path_to_drive, sysfs_path); - if (drive != NULL) + lun = g_hash_table_lookup (provider->sysfs_path_to_lun, sysfs_path); + if (lun != NULL) { GList *devices; - udisks_linux_drive_uevent (drive, action, device); + udisks_linux_lun_uevent (lun, action, device); - g_warn_if_fail (g_hash_table_remove (provider->sysfs_path_to_drive, sysfs_path)); + g_warn_if_fail (g_hash_table_remove (provider->sysfs_path_to_lun, sysfs_path)); - devices = udisks_linux_drive_get_devices (drive); + devices = udisks_linux_lun_get_devices (lun); if (devices == NULL) { gchar *object_path; const gchar *vpd; - vpd = g_object_get_data (G_OBJECT (drive), "x-vpd"); + vpd = g_object_get_data (G_OBJECT (lun), "x-vpd"); - object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (drive)); + object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (lun)); g_dbus_object_manager_unexport (udisks_daemon_get_object_manager (daemon), object_path); g_free (object_path); - g_warn_if_fail (g_hash_table_remove (provider->vpd_to_drive, vpd)); + g_warn_if_fail (g_hash_table_remove (provider->vpd_to_lun, vpd)); } g_list_foreach (devices, (GFunc) g_object_unref, NULL); g_list_free (devices); @@ -287,7 +287,7 @@ handle_scsi_uevent (UDisksLinuxProvider *provider, } else { - if (!udisks_linux_drive_should_include_device (device, &vpd)) + if (!udisks_linux_lun_should_include_device (device, &vpd)) goto out; if (vpd == NULL) @@ -298,23 +298,23 @@ handle_scsi_uevent (UDisksLinuxProvider *provider, g_udev_device_get_sysfs_path (device)); goto out; } - drive = g_hash_table_lookup (provider->vpd_to_drive, vpd); - if (drive != NULL) + lun = g_hash_table_lookup (provider->vpd_to_lun, vpd); + if (lun != NULL) { - if (g_hash_table_lookup (provider->sysfs_path_to_drive, sysfs_path) == NULL) - g_hash_table_insert (provider->sysfs_path_to_drive, g_strdup (sysfs_path), drive); - udisks_linux_drive_uevent (drive, action, device); + if (g_hash_table_lookup (provider->sysfs_path_to_lun, sysfs_path) == NULL) + g_hash_table_insert (provider->sysfs_path_to_lun, g_strdup (sysfs_path), lun); + udisks_linux_lun_uevent (lun, action, device); } else { - drive = udisks_linux_drive_new (daemon, device); - if (drive != NULL) + lun = udisks_linux_lun_new (daemon, device); + if (lun != NULL) { - g_object_set_data_full (G_OBJECT (drive), "x-vpd", g_strdup (vpd), g_free); + g_object_set_data_full (G_OBJECT (lun), "x-vpd", g_strdup (vpd), g_free); g_dbus_object_manager_export_and_uniquify (udisks_daemon_get_object_manager (daemon), - G_DBUS_OBJECT (drive)); - g_hash_table_insert (provider->vpd_to_drive, g_strdup (vpd), drive); - g_hash_table_insert (provider->sysfs_path_to_drive, g_strdup (sysfs_path), drive); + G_DBUS_OBJECT (lun)); + g_hash_table_insert (provider->vpd_to_lun, g_strdup (vpd), lun); + g_hash_table_insert (provider->sysfs_path_to_lun, g_strdup (sysfs_path), lun); } } } diff --git a/tools/udisksctl.c b/tools/udisksctl.c index 952f716..a636205 100644 --- a/tools/udisksctl.c +++ b/tools/udisksctl.c @@ -431,28 +431,28 @@ lookup_object_proxy_by_device (const gchar *device) } static GDBusObjectProxy * -lookup_object_proxy_by_drive (const gchar *drive) +lookup_object_proxy_by_lun (const gchar *lun) { GDBusObjectProxy *ret; GList *object_proxies; GList *l; - gchar *full_drive_object_path; + gchar *full_lun_object_path; ret = NULL; - full_drive_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/drives/%s", drive); + full_lun_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/LUNs/%s", lun); object_proxies = g_dbus_proxy_manager_get_all (manager); for (l = object_proxies; l != NULL; l = l->next) { GDBusObjectProxy *object_proxy = G_DBUS_OBJECT_PROXY (l->data); - UDisksDrive *drive; + UDisksLun *lun; - if (g_strcmp0 (g_dbus_object_proxy_get_object_path (object_proxy), full_drive_object_path) != 0) + if (g_strcmp0 (g_dbus_object_proxy_get_object_path (object_proxy), full_lun_object_path) != 0) continue; - drive = UDISKS_PEEK_DRIVE (object_proxy); - if (drive != NULL) + lun = UDISKS_PEEK_LUN (object_proxy); + if (lun != NULL) { ret = g_object_ref (object_proxy); goto out; @@ -462,7 +462,7 @@ lookup_object_proxy_by_drive (const gchar *drive) out: g_list_foreach (object_proxies, (GFunc) g_object_unref, NULL); g_list_free (object_proxies); - g_free (full_drive_object_path); + g_free (full_lun_object_path); return ret; } @@ -824,13 +824,13 @@ handle_command_mount_unmount (gint *argc, static gchar *opt_info_object = NULL; static gchar *opt_info_device = NULL; -static gchar *opt_info_drive = NULL; +static gchar *opt_info_lun = NULL; static const GOptionEntry command_info_entries[] = { { "object-path", 'p', 0, G_OPTION_ARG_STRING, &opt_info_object, "Object to get information about", NULL}, { "block-device", 'b', 0, G_OPTION_ARG_STRING, &opt_info_device, "Block device to get information about", NULL}, - { "drive", 'd', 0, G_OPTION_ARG_STRING, &opt_info_drive, "Drive to get information about", NULL}, + { "lun", 'l', 0, G_OPTION_ARG_STRING, &opt_info_lun, "LUN to get information about", NULL}, { NULL } }; @@ -846,18 +846,18 @@ handle_command_info (gint *argc, gchar *s; gboolean complete_objects; gboolean complete_devices; - gboolean complete_drives; + gboolean complete_luns; GList *l; GList *object_proxies; GDBusObjectProxy *object_proxy; UDisksBlockDevice *block; - UDisksDrive *drive; + UDisksLun *lun; guint n; ret = 1; opt_info_object = NULL; opt_info_device = NULL; - opt_info_drive = NULL; + opt_info_lun = NULL; modify_argv0_for_command (argc, argv, "info"); @@ -882,10 +882,10 @@ handle_command_info (gint *argc, remove_arg ((*argc) - 1, argc, argv); } - complete_drives = FALSE; - if (request_completion && (g_strcmp0 (completion_prev, "--drive") == 0 || g_strcmp0 (completion_prev, "-d") == 0)) + complete_luns = FALSE; + if (request_completion && (g_strcmp0 (completion_prev, "--lun") == 0 || g_strcmp0 (completion_prev, "-l") == 0)) { - complete_drives = TRUE; + complete_luns = TRUE; remove_arg ((*argc) - 1, argc, argv); } @@ -903,11 +903,11 @@ handle_command_info (gint *argc, if (request_completion && (opt_info_object == NULL && !complete_objects) && (opt_info_device == NULL && !complete_devices) && - (opt_info_drive == NULL && !complete_drives)) + (opt_info_lun == NULL && !complete_luns)) { g_print ("--object-path \n" "--block-device \n" - "--drive \n"); + "--lun \n"); } if (complete_objects) @@ -949,14 +949,14 @@ handle_command_info (gint *argc, goto out; } - if (complete_drives) + if (complete_luns) { object_proxies = g_dbus_proxy_manager_get_all (manager); for (l = object_proxies; l != NULL; l = l->next) { object_proxy = G_DBUS_OBJECT_PROXY (l->data); - drive = UDISKS_PEEK_DRIVE (object_proxy); - if (drive != NULL) + lun = UDISKS_PEEK_LUN (object_proxy); + if (lun != NULL) { const gchar *base; base = g_strrstr (g_dbus_object_proxy_get_object_path (object_proxy), "/") + 1; @@ -991,12 +991,12 @@ handle_command_info (gint *argc, goto out; } } - else if (opt_info_drive != NULL) + else if (opt_info_lun != NULL) { - object_proxy = lookup_object_proxy_by_drive (opt_info_drive); + object_proxy = lookup_object_proxy_by_lun (opt_info_lun); if (object_proxy == NULL) { - g_printerr ("Error looking up object for drive %s\n", opt_info_drive); + g_printerr ("Error looking up object for LUN %s\n", opt_info_lun); goto out; } } @@ -1019,7 +1019,7 @@ handle_command_info (gint *argc, g_option_context_free (o); g_free (opt_info_object); g_free (opt_info_device); - g_free (opt_info_drive); + g_free (opt_info_lun); return ret; } @@ -1430,8 +1430,8 @@ handle_command_monitor (gint *argc, /* ---------------------------------------------------------------------------------------------------- */ static GList * -find_block_devices_for_drive (GList *object_proxies, - const gchar *drive_object_path) +find_block_devices_for_lun (GList *object_proxies, + const gchar *lun_object_path) { GList *ret; GList *l; @@ -1446,7 +1446,7 @@ find_block_devices_for_drive (GList *object_proxies, if (block == NULL) continue; - if (g_strcmp0 (udisks_block_device_get_drive (block), drive_object_path) == 0) + if (g_strcmp0 (udisks_block_device_get_lun (block), lun_object_path) == 0) { ret = g_list_append (ret, g_object_ref (block)); } @@ -1529,7 +1529,7 @@ handle_command_status (gint *argc, object_proxies = g_dbus_proxy_manager_get_all (manager); - /* print all drives + /* print all LUNs * * We are guaranteed that, usually, * @@ -1548,7 +1548,7 @@ handle_command_status (gint *argc, for (l = object_proxies; l != NULL; l = l->next) { GDBusObjectProxy *object_proxy = G_DBUS_OBJECT_PROXY (l->data); - UDisksDrive *drive; + UDisksLun *lun; GList *block_devices; const gchar *vendor; const gchar *model; @@ -1559,12 +1559,12 @@ handle_command_status (gint *argc, gchar *block_device; GList *j; - drive = UDISKS_PEEK_DRIVE (object_proxy); - if (drive == NULL) + lun = UDISKS_PEEK_LUN (object_proxy); + if (lun == NULL) continue; str = g_string_new (NULL); - block_devices = find_block_devices_for_drive (object_proxies, g_dbus_object_proxy_get_object_path (object_proxy)); + block_devices = find_block_devices_for_lun (object_proxies, g_dbus_object_proxy_get_object_path (object_proxy)); for (j = block_devices; j != NULL; j = j->next) { UDisksBlockDevice *block = UDISKS_BLOCK_DEVICE (j->data); @@ -1586,10 +1586,10 @@ handle_command_status (gint *argc, g_list_foreach (block_devices, (GFunc) g_object_unref, NULL); g_list_free (block_devices); - vendor = udisks_drive_get_vendor (drive); - model = udisks_drive_get_model (drive); - revision = udisks_drive_get_revision (drive); - serial = udisks_drive_get_serial (drive); + vendor = udisks_lun_get_vendor (lun); + model = udisks_lun_get_model (lun); + revision = udisks_lun_get_revision (lun); + serial = udisks_lun_get_serial (lun); if (strlen (vendor) == 0) vendor = NULL; |