From: Hannes Reinecke Date: Thu, 20 Mar 2008 22:53:48 +0000 (+0100) Subject: [libmultipath] Update discovery to work with new sysfs layout X-Git-Tag: 0.4.9~237 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88f88d11ecee7d753e9b43d67001d58c56789eb1;p=platform%2Fupstream%2Fmultipath-tools.git [libmultipath] Update discovery to work with new sysfs layout With the new sysfs layout the parent device of a block device it 'block', and only the parent of this is the 'real' parent. --- diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index a85a248..30c36e5 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -550,6 +550,9 @@ sysfs_pathinfo(struct path * pp) if (!parent) parent = pp->sysdev; + if (!strncmp(parent->kernel, "block",5)) + parent = sysfs_device_get_parent(parent); + condlog(3, "%s: subsystem = %s", pp->dev, parent->subsystem); if (!strncmp(parent->subsystem, "scsi",4))