From 18c476fc84dd546a220a72e71e42063c53ad3267 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Fri, 12 Aug 2011 15:56:41 -0400 Subject: [PATCH] Add work-around to identify firewire devices without serial/wwn as drives Signed-off-by: David Zeuthen --- src/udiskslinuxdrive.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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) -- 2.7.4