mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Check phy: block device existence
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This commit is contained in:
1 parent
ebf6792935
commit
cd3b21408f
1 file changed
+8
@@ -209,6 +209,14 @@ case "$command" in
|
||||
FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
|
||||
FRONTEND_UUID=$(xenstore_read_default \
|
||||
"/local/domain/$FRONTEND_ID/vm" 'unknown')
|
||||
|
||||
if [ -L "$dev" ]
|
||||
then
|
||||
dev=$(readlink -f "$dev") || fatal "$dev link does not exist."
|
||||
fi
|
||||
test -e "$dev" || fatal "$dev does not exist."
|
||||
test -b "$dev" || fatal "$dev is not a block device."
|
||||
|
||||
claim_lock "block"
|
||||
check_device_sharing "$dev" "$mode"
|
||||
write_dev "$dev"
|
||||
|
||||