From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harper Date: Thu, 10 Jun 2010 19:16:15 +0000 Subject: [PATCH 3/3] Add virtio-blk support to persistent-storage rules Message-Id: <1276197375-4524-4-git-send-email-ryanh@us.ibm.com> List-Id: References: <1275592024-2625-4-git-send-email-ryanh@us.ibm.com> In-Reply-To: <1275592024-2625-4-git-send-email-ryanh@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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 --- 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..da73526 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_SERIAL}="?*", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" +KERNEL="vd*[0-9]", ENV{ID_SERIAL}="?*", SYMLINK+="disk/by-id/virtio-$env{ID_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