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] [BLKTAP] Fix hotplug script to check if s

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [BLKTAP] Fix hotplug script to check if specified file exists.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 09 Nov 2006 18:40:18 +0000
Delivery-date: Thu, 09 Nov 2006 10:40:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID d173b32f54abe6b66010f0ee56648f6d52f9c44f
# Parent  233ce78de4e42a8db2107fbd0c859e23ce341fb7
[BLKTAP] Fix hotplug script to check if specified file exists.

Now users will see the following error:

[root@bebop ~]# xm create -c 128
Using config file "/etc/xen/128".
Error: Device 51713 (tap) could not be connected.
/tmp/128.img does not exist

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
---
 tools/examples/blktap |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletion(-)

diff -r 233ce78de4e4 -r d173b32f54ab tools/examples/blktap
--- a/tools/examples/blktap     Thu Nov 09 13:30:16 2006 +0000
+++ b/tools/examples/blktap     Thu Nov 09 13:43:21 2006 +0000
@@ -4,12 +4,26 @@
 
 dir=$(dirname "$0")
 . "$dir/xen-hotplug-common.sh"
+. "$dir/block-common.sh"
 
 findCommand "$@"
 
+t=$(xenstore_read_default "$XENBUS_PATH/type" 'MISSING')
+if [ -n "$t" ]
+then
+    p=$(xenstore_read "$XENBUS_PATH/params")
+    # if we have a ':', chew from head including :
+    if echo $p | grep -q \:
+    then
+        p=${p#*:}
+    fi
+fi
+file=$(readlink -f "$p") || ebusy "$p does not exist."
+
 if [ "$command" = 'add' ]
 then
-  success
+    [ -e "$file" ] || { ebusy $file does not exist; }
+    success
 fi
 
 exit 0

_______________________________________________
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] [BLKTAP] Fix hotplug script to check if specified file exists., Xen patchbot-unstable <=