Support KVM instances - allow /dev/vda to be detected as a disk.

This commit is contained in:
Robert Collins 2012-10-26 12:19:47 +13:00
parent f3eb459e32
commit bf3474c762

View File

@ -57,7 +57,7 @@ function prepend_dev() {
function whole_disk_name() { function whole_disk_name() {
local dev=`prepend_dev "$1"` local dev=`prepend_dev "$1"`
case "$dev" in case "$dev" in
/dev/sd*|/dev/hd*) /dev/sd*|/dev/hd*|/dev/vd*)
echo "$dev" | sed -e 's/[0-9]*$//' echo "$dev" | sed -e 's/[0-9]*$//'
;; ;;
/dev/cciss/*) /dev/cciss/*)
@ -74,7 +74,7 @@ function partition_name() {
local dev=`prepend_dev "$1"` local dev=`prepend_dev "$1"`
local part=$2 local part=$2
case "$dev" in case "$dev" in
/dev/sd*|/dev/hd*) /dev/sd*|/dev/hd*|/dev/vd*)
echo "${dev}${part}" echo "${dev}${part}"
;; ;;
/dev/cciss/*) /dev/cciss/*)