ia64/xen-unstable

changeset 9451:74e33cc868cf

Fix bug 515 by adding a global lock around the hotplug scripts in the non-udev hotplug case only.

There are two possible root causes for 515, both of which are only problems in the non-udev hotplug case because udev uses udevsend which already implements the required serialisation.

1) Script concurrency.
2) Kernel reordering hotplug events.

This changeset fixes (1) but not (2). Since (1) is the problem that seems to be happening this is probably OK.

A fix for (2) for the hotplug case might be to add extra serialisation using state changes in the store but this would impact all the drivers and the code and extra complexity would be redundant once everyone had moved to udev. This doesn't seem worthwhile unless we actually start to see (2) happening.
author harry@localhost.localdomain
date Fri Mar 24 14:31:20 2006 +0100 (2006-03-24)
parents 33df7d4eff23
children af0573e9e525
files tools/examples/xen-backend.agent
line diff
     1.1 --- a/tools/examples/xen-backend.agent	Fri Mar 24 14:31:12 2006 +0100
     1.2 +++ b/tools/examples/xen-backend.agent	Fri Mar 24 14:31:20 2006 +0100
     1.3 @@ -2,6 +2,10 @@
     1.4  
     1.5  PATH=/etc/xen/scripts:$PATH
     1.6  
     1.7 +. /etc/xen/scripts/locking.sh
     1.8 +
     1.9 +claim_lock xenbus_hotplug_global
    1.10 +
    1.11  case "$XENBUS_TYPE" in
    1.12    vbd)
    1.13      /etc/xen/scripts/block "$ACTION"
    1.14 @@ -25,3 +29,5 @@ case "$ACTION" in
    1.15    offline)
    1.16      ;;
    1.17  esac
    1.18 +
    1.19 +release_lock xenbus_hotplug_global