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/
Home Products Support Community News


[Xen-devel] [PATCH] better same_vm checks

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] better same_vm checks
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Tue, 18 Aug 2009 17:33:45 +0100
Delivery-date: Tue, 18 Aug 2009 09:32:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
Hi all,
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
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@xxxxxxxxxxxxx>


diff -r 8b0f1f37e145 tools/hotplug/Linux/block-common.sh
--- a/tools/hotplug/Linux/block-common.sh       Sun Aug 16 08:46:08 2009 +0100
+++ b/tools/hotplug/Linux/block-common.sh       Tue Aug 18 17:32:27 2009 +0100
@@ -112,6 +112,14 @@
   local target=$(xenstore_read_default  "/local/domain/$FRONTEND_ID/target"   \
-  [ "$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" ]

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] better same_vm checks, Stefano Stabellini <=