Linux Hotplug development
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH 3/3] Add virtio-blk support to persistent-storage rules
Date: Thu, 03 Jun 2010 19:07:04 +0000	[thread overview]
Message-ID: <1275592024-2625-4-git-send-email-ryanh@us.ibm.com> (raw)

Using virtioblk_id add rules to extract drive serial numbers and generate
by-id links for the block device and partitions.

With these rules added, we now see the following symlinks in disk/by-id

% ls -al /dev/disk/by-id | grep vdb
lrwxrwxrwx. 1 root root   9 Jun  1 22:09 virtio-QM00001 -> ../../vda
lrwxrwxrwx. 1 root root  10 Jun  1 22:09 virtio-QM00001-part1 -> ../../vda1

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
 rules/rules.d/60-persistent-storage.rules |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
index 1f46041..b913758 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -30,6 +30,11 @@ KERNEL="cciss*", ENV{DEVTYPE}="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="s
 KERNEL="sd*|sr*|cciss*", ENV{DEVTYPE}="disk", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
 KERNEL="sd*|cciss*", ENV{DEVTYPE}="partition", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
 
+# virtioblk
+KERNEL="vd*[!0-9]", IMPORT{program}="virtioblk_id $tempnode"
+KERNEL="vd*[!0-9]", ENV{ID_VIRTIO_SERIAL}="?*", SYMLINK+="disk/by-id/virtio-$env{ID_VIRTIO_SERIAL}"
+KERNEL="vd*[0-9]", ENV{ID_VIRTIO_SERIAL}="?*", SYMLINK+="disk/by-id/virtio-$env{ID_VIRTIO_SERIAL}-part%n"
+
 # firewire
 KERNEL="sd*[!0-9]|sr*", ATTRS{ieee1394_id}="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
 KERNEL="sd*[0-9]", ATTRS{ieee1394_id}="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
-- 
1.6.3.3


             reply	other threads:[~2010-06-03 19:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03 19:07 Ryan Harper [this message]
2010-06-10 19:16 ` [PATCH 3/3] Add virtio-blk support to persistent-storage rules Ryan Harper

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=1275592024-2625-4-git-send-email-ryanh@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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