[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Avoid a race between Xend removing the vm entries corresponding to a domain,



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 0017df50cc87d2f29ba924ab422943ffd8f17465
# Parent  2d1aaebcbdf7c33e73540128bc4fcd0e0b347d42
Avoid a race between Xend removing the vm entries corresponding to a domain,
and the hotplug scripts checking whether that domain is still alive.  This
triggers the "xenstore-read: couldn't read path /local/domain/107/vm" message
in /var/log/xen-hotplug.log, followed by "Device XYZ is mounted in a guest
domain and so cannot be mounted now".

Closes bug #514.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 2d1aaebcbdf7 -r 0017df50cc87 tools/examples/block
--- a/tools/examples/block      Wed Mar  8 22:56:37 2006
+++ b/tools/examples/block      Wed Mar  8 22:56:49 2006
@@ -129,7 +129,14 @@
 same_vm()
 {
   local otherdom="$1"
-  local othervm=$(xenstore-read "/local/domain/$otherdom/vm")
+  # Note that othervm can be MISSING here, because Xend will be racing with
+  # the hotplug scripts -- the entries in /local/domain can be removed by
+  # Xend before the hotplug scripts have removed the entry in
+  # /local/domain/0/backend/.  In this case, we want to pretend that the
+  # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
+  # allowed.
+  local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
+                  "$FRONTEND_UUID")
 
   [ "$FRONTEND_UUID" == "$othervm" ]
 }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.