WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Check phy: block device existence

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Check phy: block device existence
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Jul 2008 11:30:10 -0700
Delivery-date: Fri, 18 Jul 2008 11:30:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216381498 -3600
# Node ID 27078831a864c38172587d9abd42b50f81fd6b58
# Parent  0d88b4b86428d2ae6349b261cd6f4fbe94421a4a
Check phy: block device existence

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/examples/block |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -r 0d88b4b86428 -r 27078831a864 tools/examples/block
--- a/tools/examples/block      Fri Jul 18 12:27:45 2008 +0100
+++ b/tools/examples/block      Fri Jul 18 12:44:58 2008 +0100
@@ -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"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Check phy: block device existence, Xen patchbot-unstable <=