chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2151b0
)
path_id: support identification of Xen virtual block devices
author
Ian Campbell
<ijc@hellion.org.uk>
Thu, 16 Apr 2009 20:46:18 +0000
(22:46 +0200)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Thu, 16 Apr 2009 20:46:18 +0000
(22:46 +0200)
extras/path_id/path_id
patch
|
blob
|
history
diff --git
a/extras/path_id/path_id
b/extras/path_id/path_id
index d21dea70117b8fb91fe28fc80f42d504aedc73af..7b4973fa038a4df73f80b5e3258891430ed9a792 100755
(executable)
--- a/
extras/path_id/path_id
+++ b/
extras/path_id/path_id
@@
-129,6
+129,30
@@
handle_platform () {
RESULT=0
}
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
handle_serio () {
local DEV=$1
cd -P $1
@@
-532,6
+556,9
@@
handle_device () {
*/platform/*)
handle_platform "$D"
;;
*/platform/*)
handle_platform "$D"
;;
+ */vbd-[0-9]*)
+ handle_xen "$D"
+ ;;
*/devices)
D=
;;
*/devices)
D=
;;