source: trunk/packages/xen-3.1/xen-3.1/tools/examples/xen-hotplug-cleanup @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 767 bytes
Line 
1#! /bin/bash
2
3dir=$(dirname "$0")
4. "$dir/xen-hotplug-common.sh"
5
6# Claim the lock protecting /etc/xen/scripts/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.
12claim_lock "block"
13
14# remove device frontend store entries
15xenstore-rm -t \
16  $(xenstore-read "$XENBUS_PATH/frontend" 2>/dev/null) 2>/dev/null || true
17
18# remove device backend store entries
19xenstore-rm -t "$XENBUS_PATH"        2>/dev/null || true
20xenstore-rm -t "error/$XENBUS_PATH"  2>/dev/null || true
21
22release_lock "block"
Note: See TracBrowser for help on using the repository browser.