fix sharing-check for blktap
PATCH 1/1 fix sharing-check for blktap
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 <[email protected]>
Signed-off-by Takanori Kasai <[email protected]>
Best Regards,
--
Hirofumi Tsujimura
# HG changeset patch
# User [email protected]
# 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 <[email protected]>
Signed-off-by Takanori Kasai <[email protected]>
tools/examples/blktap +12 -10
@@ -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
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel