ia64/xen-unstable

view tools/hotplug/Linux/xen-hotplug-cleanup @ 19818:415505139333

Get rid of hardcoded pathes for stubdom and hotplug scripts

- Have the buid system generate a file which exports the install paths
for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
macro
in Config.mk to avoid maintenance of three duplicates each with its
own
tweaks and bugs
- Export gmake variables into ioemu as shell variables
for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
install directory
- Adjust stubdom-dm to use the install directories

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 17:25:51 2009 +0100 (2009-06-23)
parents c9a35fb19e75
children
line source
1 #! /bin/bash
3 dir=$(dirname "$0")
4 . "$dir/xen-hotplug-common.sh"
6 # Claim the lock protecting ${XEN_SCRIPT_DIR}/block. This stops a race whereby
7 # paths in the store would disappear underneath that script as it attempted to
8 # read from the store checking for device sharing.
9 # Any other scripts that do similar things will have to have their lock
10 # claimed too.
11 # This is pretty horrible, but there's not really a nicer way of solving this.
12 claim_lock "block"
14 # split backend/DEVCLASS/VMID/DEVID on slashes
15 path_array=( ${XENBUS_PATH//\// } )
16 # get /vm/UUID path
17 vm=$(xenstore_read_default "/local/domain/${path_array[2]}/vm" "")
18 # construct /vm/UUID/device/DEVCLASS/DEVID
19 if [ "$vm" != "" ]; then
20 vm_dev="$vm/device/${path_array[1]}/${path_array[3]}"
21 else
22 vm_dev=
23 fi
25 # remove device frontend store entries
26 xenstore-rm -t \
27 $(xenstore-read "$XENBUS_PATH/frontend" 2>/dev/null) 2>/dev/null || true
29 # remove device backend store entries
30 xenstore-rm -t "$XENBUS_PATH" 2>/dev/null || true
31 xenstore-rm -t "error/$XENBUS_PATH" 2>/dev/null || true
33 # remove device path from /vm/UUID
34 [ "$vm_dev" != "" ] && xenstore-rm -t "$vm_dev" 2>/dev/null || true
36 release_lock "block"