WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Break out the hotplug cleanup code into xen-hotplug-clea

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Break out the hotplug cleanup code into xen-hotplug-cleanup. Claim the block
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Feb 2006 23:10:12 +0000
Delivery-date: Mon, 27 Feb 2006 23:11:36 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID b30564f4091490b280e97dbe432ec81e623609ec
# Parent  38d9f4cbbc1e4f26bc7d7a839db4852d6db48193
Break out the hotplug cleanup code into xen-hotplug-cleanup.  Claim the block
script's lock before doing the cleanup, to avoid a race that causes the message
"xenstore-list: could not list path backend/vbd/40" in /var/log/hotplug.log,
with a subsequent refusal to create the domain, after a domain reboot.

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

diff -r 38d9f4cbbc1e -r b30564f40914 tools/examples/Makefile
--- a/tools/examples/Makefile   Mon Feb 27 15:29:03 2006
+++ b/tools/examples/Makefile   Mon Feb 27 16:16:04 2006
@@ -27,6 +27,7 @@
 XEN_SCRIPTS += block
 XEN_SCRIPTS += block-enbd block-nbd
 XEN_SCRIPTS += vtpm vtpm-delete
+XEN_SCRIPTS += xen-hotplug-cleanup
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
diff -r 38d9f4cbbc1e -r b30564f40914 tools/examples/xen-backend.agent
--- a/tools/examples/xen-backend.agent  Mon Feb 27 15:29:03 2006
+++ b/tools/examples/xen-backend.agent  Mon Feb 27 16:16:04 2006
@@ -18,7 +18,7 @@
   add)
     ;;
   remove)
-    /etc/xen/scripts/xen-hotplug-cleanup.sh
+    /etc/xen/scripts/xen-hotplug-cleanup
     ;;
   online)
     ;;
diff -r 38d9f4cbbc1e -r b30564f40914 tools/examples/xen-backend.rules
--- a/tools/examples/xen-backend.rules  Mon Feb 27 15:29:03 2006
+++ b/tools/examples/xen-backend.rules  Mon Feb 27 16:16:04 2006
@@ -2,6 +2,4 @@
 SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm 
$env{ACTION}"
 SUBSYSTEM=="xen-backend", KERNEL=="vif*", ACTION=="online", RUN+="$env{script} 
online"
 SUBSYSTEM=="xen-backend", KERNEL=="vif*", ACTION=="offline", 
RUN+="$env{script} offline"
-SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/bin/bash -c 
'/usr/bin/xenstore-rm -t $$(/usr/bin/xenstore-read $env{XENBUS_PATH}/frontend)'"
-SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/usr/bin/xenstore-rm -t 
$env{XENBUS_PATH}"
-SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/usr/bin/xenstore-rm -t 
error/$env{XENBUS_PATH}"
+SUBSYSTEM=="xen-backend", ACTION=="remove", 
RUN+="/etc/xen/scripts/xen-hotplug-cleanup"
diff -r 38d9f4cbbc1e -r b30564f40914 tools/examples/xen-hotplug-cleanup
--- /dev/null   Mon Feb 27 15:29:03 2006
+++ b/tools/examples/xen-hotplug-cleanup        Mon Feb 27 16:16:04 2006
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+dir=$(dirname "$0")
+. "$dir/xen-hotplug-common.sh"
+
+# Claim the lock protecting /etc/xen/scripts/block.  This stops a race whereby
+# paths in the store would disappear underneath that script as it attempted to
+# read from the store checking for device sharing.
+# Any other scripts that do similar things will have to have their lock
+# claimed too.
+# This is pretty horrible, but there's not really a nicer way of solving this.
+claim_lock "block"
+
+# remove device frontend store entries
+xenstore-rm -t $(xenstore-read "$XENBUS_PATH/frontend") || true
+
+# remove device backend store entries
+xenstore-rm -t "$XENBUS_PATH"       || true
+xenstore-rm -t "error/$XENBUS_PATH" || true
+
+release_lock "block"

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Break out the hotplug cleanup code into xen-hotplug-cleanup. Claim the block, Xen patchbot -unstable <=