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] hotplug scripts: Fix sharing check for bl

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hotplug scripts: Fix sharing check for blktap
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 22 Apr 2008 07:10:46 -0700
Delivery-date: Tue, 22 Apr 2008 07:37:11 -0700
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1208856572 -3600
# Node ID 5e3baace443f0481a4129deb0de017aa72092815
# Parent  d9a74b8e9b1a345cc3d82efb837014e5658522c2
hotplug scripts: Fix sharing check for blktap

Run check_blktap_sharing() only when a disk is added to guest with blktap.
A check_blktap_sharing() doesn't have to be run when a disk is removed.

Signed-off-by: Hirofumi Tsujimura <tsujimura.hirof@xxxxxxxxxxxxxx>
Signed-off-by: Takanori Kasai <kasai.takanori@xxxxxxxxxxxxxx>
---
 tools/examples/blktap |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff -r d9a74b8e9b1a -r 5e3baace443f tools/examples/blktap
--- a/tools/examples/blktap     Tue Apr 22 10:27:04 2008 +0100
+++ b/tools/examples/blktap     Tue Apr 22 10:29:32 2008 +0100
@@ -54,10 +54,6 @@ check_blktap_sharing()
     echo 'ok'
 }
 
-FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
-FRONTEND_UUID=$(xenstore_read "/local/domain/$FRONTEND_ID/vm")
-mode=$(xenstore_read "$XENBUS_PATH/mode")
-mode=$(canonicalise_mode "$mode")
 
 t=$(xenstore_read_default "$XENBUS_PATH/type" 'MISSING')
 if [ -n "$t" ]
@@ -77,15 +73,21 @@ else
     file="$p"
 fi
 
-if [ "$mode" != '!' ] 
-then
-    result=$(check_blktap_sharing "$file" "$mode")
-    [ "$result" = 'ok' ] || ebusy "$file already in use by other domain"
-fi
-
 if [ "$command" = 'add' ]
 then
     [ -e "$file" ] || { fatal $file does not exist; }
+
+    FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
+    FRONTEND_UUID=$(xenstore_read "/local/domain/$FRONTEND_ID/vm")
+    mode=$(xenstore_read "$XENBUS_PATH/mode")
+    mode=$(canonicalise_mode "$mode")
+
+    if [ "$mode" != '!' ] 
+    then
+        result=$(check_blktap_sharing "$file" "$mode")
+        [ "$result" = 'ok' ] || ebusy "$file already in use by other domain"
+    fi
+
     success
 fi
 

_______________________________________________
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] hotplug scripts: Fix sharing check for blktap, Xen patchbot-unstable <=