Linux Hotplug development
 help / color / mirror / Atom feed
* [PATCH 2/3] Add virtio-blk support to path_id
@ 2010-06-03 19:07 Ryan Harper
  2010-06-10 19:16 ` Ryan Harper
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Harper @ 2010-06-03 19:07 UTC (permalink / raw)
  To: linux-hotplug

This patch adds a case handling path_id invoked on a virtio-blk device.
Currently path_id walks the parent path to virtio-pci but doesn't know
that it's the end of the path and exits without building the path (providing no
output resulting in no disk/by-path symlinks to virtio-blk devices).
This patch handles the virtio-pci path and updates the path accordingly.

/lib/udev/path_id --debug /block/vda
udev_device_new_from_syspath: device 0x2300120 has devpath '/devices/virtio-pci/virtio1/block/vda'
udev_device_new_from_syspath: device 0x2300380 has devpath '/devices/virtio-pci/virtio1'
udev_device_new_from_syspath: device 0x2300670 has devpath '/devices/virtio-pci'
ID_PATH=virtio-pci-virtio1

And with the current persistent-storage rules generates:

% ls -al /dev/disk/by-path | grep vda
lrwxrwxrwx. 1 root root   9 Jun  1 22:09 virtio-pci-virtio1 -> ../../vda

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
 extras/path_id/path_id.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/extras/path_id/path_id.c b/extras/path_id/path_id.c
index dcee378..c19bfd0 100644
--- a/extras/path_id/path_id.c
+++ b/extras/path_id/path_id.c
@@ -448,6 +448,9 @@ int main(int argc, char **argv)
 		} else if (strcmp(subsys, "xen") = 0) {
 			path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
 			parent = skip_subsystem(parent, "xen");
+		} else if (strcmp(subsys, "virtio") = 0) {
+			path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent));
+			parent = skip_subsystem(parent, "virtio");
 		}
 
 		parent = udev_device_get_parent(parent);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-10 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 19:07 [PATCH 2/3] Add virtio-blk support to path_id Ryan Harper
2010-06-10 19:16 ` Ryan Harper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox