From: Ryan Harper <ryanh@us.ibm.com>
To: linux-hotplug@vger.kernel.org
Cc: john cooper <john.cooper@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>,
qemu-devel@nongnu.org, Ryan Harper <ryanh@us.ibm.com>
Subject: [Qemu-devel] [PATCH 1/2] Add virtio-blk support to path_id
Date: Fri, 25 Jun 2010 08:59:22 -0500 [thread overview]
Message-ID: <1277474363-6534-2-git-send-email-ryanh@us.ibm.com> (raw)
In-Reply-To: <1277474363-6534-1-git-send-email-ryanh@us.ibm.com>
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>
---
| 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
--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
next prev parent reply other threads:[~2010-06-25 17:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-25 13:59 [Qemu-devel] [PATCH v3 0/2] Add virtio-blk support to persistent-storage rules Ryan Harper
2010-06-25 13:59 ` Ryan Harper [this message]
2010-06-25 13:59 ` [Qemu-devel] [PATCH 2/2] Add virtio-blk by-id rules based on 'serial' attribute Ryan Harper
2010-06-29 15:29 ` [Qemu-devel] Re: [PATCH v3 0/2] Add virtio-blk support to persistent-storage rules Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277474363-6534-2-git-send-email-ryanh@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=john.cooper@redhat.com \
--cc=linux-hotplug@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).