diff options
author | David Zeuthen <davidz@redhat.com> | 2011-08-12 15:56:41 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2011-08-12 15:56:41 -0400 |
commit | 18c476fc84dd546a220a72e71e42063c53ad3267 (patch) | |
tree | 63e297f265bc2999ebcd26ddfcbfa01cf532b72f /src/udiskslinuxdrive.c | |
parent | d6b0b3c52e0bc1761521514b18e81d44fab0aaae (diff) |
Add work-around to identify firewire devices without serial/wwn as drives
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src/udiskslinuxdrive.c')
-rw-r--r-- | src/udiskslinuxdrive.c | 21 |
1 files 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) |