aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hotplug
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-08-19 13:11:33 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-08-19 13:11:33 +0100
commitb6cd10140c7d93c8ccf168c13a8455f2e878639c (patch)
tree2783dc050ad228834766b5cf120de5a415595b46 /tools/hotplug
parentc88b1e06d5ad6d24b5cb0cb6f80ae35d94002ef5 (diff)
downloadxen-b6cd10140c7d93c8ccf168c13a8455f2e878639c.tar.gz
xen-b6cd10140c7d93c8ccf168c13a8455f2e878639c.tar.bz2
xen-b6cd10140c7d93c8ccf168c13a8455f2e878639c.zip
hotplug scripts: better same_vm checks
currently the function same_vm in block-common.sh is the one responsible for detecting if two block devices can be used at the same time by two VMs. This can be allowed in few specific cases: when the two VMs are actually the same VM and when the two VMs are the guest and its stubdomain. We need to expand these exceptions to handle properly save restore issues: this patch adds to the exceptions the case when two VMs are the same VM because of save\restore races, and when two VMs are the guest and the stubdomain of the previous guest, again during save\restore. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'tools/hotplug')
-rw-r--r--tools/hotplug/Linux/block-common.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/hotplug/Linux/block-common.sh b/tools/hotplug/Linux/block-common.sh
index efedbf50d4..cc374efeb4 100644
--- a/tools/hotplug/Linux/block-common.sh
+++ b/tools/hotplug/Linux/block-common.sh
@@ -112,6 +112,14 @@ same_vm()
"$FRONTEND_UUID")
local target=$(xenstore_read_default "/local/domain/$FRONTEND_ID/target" \
"-1")
- [ "$FRONTEND_UUID" = "$othervm" -o "$target" = "$otherdom" ]
+ local otarget=$(xenstore_read_default "/local/domain/$otherdom/target" \
+ "-1")
+ local otvm=$(xenstore_read_default "/local/domain/$otarget/vm" \
+ "-1")
+ otvm=${otvm%-1}
+ othervm=${othervm%-1}
+ local frontend_uuid=${FRONTEND_UUID%-1}
+
+ [ "$frontend_uuid" = "$othervm" -o "$target" = "$otherdom" -o "$frontend_uuid" = "$otvm" ]
}