ia64/xen-unstable

changeset 18104:27078831a864

Check phy: block device existence

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jul 18 12:44:58 2008 +0100 (2008-07-18)
parents 0d88b4b86428
children 066ac1adb70c
files tools/examples/block
line diff
     1.1 --- a/tools/examples/block	Fri Jul 18 12:27:45 2008 +0100
     1.2 +++ b/tools/examples/block	Fri Jul 18 12:44:58 2008 +0100
     1.3 @@ -209,6 +209,14 @@ case "$command" in
     1.4          FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
     1.5          FRONTEND_UUID=$(xenstore_read_default \
     1.6              "/local/domain/$FRONTEND_ID/vm" 'unknown')
     1.7 +
     1.8 +        if [ -L "$dev" ]
     1.9 +        then
    1.10 +          dev=$(readlink -f "$dev") || fatal "$dev link does not exist."
    1.11 +        fi
    1.12 +        test -e "$dev" || fatal "$dev does not exist."
    1.13 +        test -b "$dev" || fatal "$dev is not a block device."
    1.14 +
    1.15          claim_lock "block"
    1.16          check_device_sharing "$dev" "$mode"
    1.17  	write_dev "$dev"