chiark / gitweb /
Add virtio-blk support to path_id
[elogind.git] / extras / path_id / path_id.c
index 53720e0fe2c947d42e838ab1378d3e983bca7dbd..c19bfd0f8d59fae57a74d1ba88ab47748efc6f08 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * compose persisistent device path
+ * compose persistent device path
  *
  * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
  *
- * Log based on Hannes Reinecke's shell script.
+ * Logic based on Hannes Reinecke's shell script.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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);