ia64/xen-unstable

changeset 9091:b2d3117cc7ed

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@xensource.com>
author emellor@leeni.uk.xensource.com
date Thu Mar 02 01:59:28 2006 +0100 (2006-03-02)
parents 6734682d2fd0
children 849723752858
files tools/examples/block
line diff
     1.1 --- a/tools/examples/block	Wed Mar 01 23:41:43 2006 +0100
     1.2 +++ b/tools/examples/block	Thu Mar 02 01:59:28 2006 +0100
     1.3 @@ -129,7 +129,14 @@ check_sharing()
     1.4  same_vm()
     1.5  {
     1.6    local otherdom="$1"
     1.7 -  local othervm=$(xenstore-read "/local/domain/$otherdom/vm")
     1.8 +  # Note that othervm can be MISSING here, because Xend will be racing with
     1.9 +  # the hotplug scripts -- the entries in /local/domain can be removed by
    1.10 +  # Xend before the hotplug scripts have removed the entry in
    1.11 +  # /local/domain/0/backend/.  In this case, we want to pretend that the
    1.12 +  # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
    1.13 +  # allowed.
    1.14 +  local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
    1.15 +                  "$FRONTEND_UUID")
    1.16  
    1.17    [ "$FRONTEND_UUID" == "$othervm" ]
    1.18  }