Add support for Xen PV disks

Xen paravirtualised disks (supported by most modern kernels) have the
"xvd" prefix (e.g. xvda0).  The functions to strip partitions need to
match on Xen PV disks otherwise the device name is discarded.

Change-Id: I5539d2afba3fae30d1ddb49dcbf077113d38bbf7
Closes-Bug: #1498576
This commit is contained in:
Bob Ball 2015-09-22 11:57:43 +01:00
parent 21f5e6146c
commit b5794f3665

View File

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