From: David Zeuthen Date: Fri, 12 Aug 2011 19:56:41 +0000 (-0400) Subject: Add work-around to identify firewire devices without serial/wwn as drives X-Git-Tag: upstream/2.1.2~480^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18c476fc84dd546a220a72e71e42063c53ad3267;p=platform%2Fupstream%2Fudisks2.git Add work-around to identify firewire devices without serial/wwn as drives Signed-off-by: David Zeuthen --- diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxdrive.c index 9fd1b5e..471ef28 100644 --- a/src/udiskslinuxdrive.c +++ b/src/udiskslinuxdrive.c @@ -1287,12 +1287,29 @@ udisks_linux_drive_should_include_device (GUdevDevice *device, } else { - const gchar *name = g_udev_device_get_name (device); + const gchar *name; + GUdevDevice *parent; + + name = g_udev_device_get_name (device); + /* workaround for missing serial/wwn on virtio-blk */ if (g_str_has_prefix (name, "vd")) - vpd = g_strdup (name); + { + vpd = g_strdup (name); + goto found; + } + + /* workaround for missing serial/wwn on firewire devices */ + parent = g_udev_device_get_parent_with_subsystem (device, "firewire", NULL); + if (parent != NULL) + { + vpd = g_strdup (name); + g_object_unref (parent); + goto found; + } } + found: if (vpd != NULL) { if (out_vpd != NULL)