summaryrefslogtreecommitdiff
path: root/extras/path_id
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2009-04-16 22:46:18 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-04-16 22:46:18 +0200
commit09b2999210c6843a2a3de529dd316b741261e31c (patch)
tree6a3b3727382ec47d8dccaf9345c3bbc5fe9a1d0f /extras/path_id
parente2151b00e92dde5b9e2b06052b358c8101f29165 (diff)
path_id: support identification of Xen virtual block devices
Diffstat (limited to 'extras/path_id')
-rwxr-xr-xextras/path_id/path_id27
1 files changed, 27 insertions, 0 deletions
diff --git a/extras/path_id/path_id b/extras/path_id/path_id
index d21dea7011..7b4973fa03 100755
--- a/extras/path_id/path_id
+++ b/extras/path_id/path_id
@@ -129,6 +129,30 @@ handle_platform () {
RESULT=0
}
+handle_xen () {
+ local DEV=$1
+ cd -P $1
+ vbd_id=${DEV##*/}
+ host_dev_path=$DEV
+ while [ ! -z "$host_dev_path" ] ; do
+ case "$host_dev_path" in
+ */vbd*)
+ host_dev_path=${host_dev_path%/*}
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ if [ "$d" ]; then
+ d="xen-$vbd_id-$d"
+ else
+ d="xen-$vbd_id"
+ fi
+ D="$host_dev_path"
+ RESULT=0
+}
+
handle_serio () {
local DEV=$1
cd -P $1
@@ -532,6 +556,9 @@ handle_device () {
*/platform/*)
handle_platform "$D"
;;
+ */vbd-[0-9]*)
+ handle_xen "$D"
+ ;;
*/devices)
D=
;;