All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix sharing-check for blktap
@ 2008-04-22  0:02 Hirofumi Tsujimura
  0 siblings, 0 replies; only message in thread
From: Hirofumi Tsujimura @ 2008-04-22  0:02 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

Hi, all

This is a patch to run a 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.
In actuality , a sharing check function is not run
when a disk is removed with block(VBD).


Signed-off-by: Hirofumi Tsujimura <tsujimura.hirof@jp.fujitsu.com>
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>

Best Regards,
--
Hirofumi Tsujimura

[-- Attachment #2: fix_sharing-check_for_blktap.patch --]
[-- Type: text/plain, Size: 1596 bytes --]

# HG changeset patch
# User tsujimura.hirof@jp.fujitsu.com
# Date 1208420638 -32400
# Node ID 8de7969c0979a3b71983a5452a8c81aabbb3e7fe
# Parent  08e010c3f2519a585e2948871ab6be0fe25d93d4
run check_blktap_sharing() only when a disk is added to a guest with blktap.

Signed-off-by: Hirofumi Tsujimura <tsujimura.hirof@jp.fujitsu.com>
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>

diff -r 08e010c3f251 -r 8de7969c0979 tools/examples/blktap
--- a/tools/examples/blktap	Tue Apr 15 16:39:00 2008 +0100
+++ b/tools/examples/blktap	Thu Apr 17 17:23:58 2008 +0900
@@ -54,10 +54,6 @@
     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 @@
     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
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-22  0:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22  0:02 [PATCH] fix sharing-check for blktap Hirofumi Tsujimura

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.