summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorbad <bad@pkgsrc.org>2016-04-04 15:16:03 +0000
committerbad <bad@pkgsrc.org>2016-04-04 15:16:03 +0000
commit7adc59eb6d8e4872609cdb13ad9f0aceddedc0fd (patch)
treeca0a7f113e3a3bd7ccf0103cfd2951a6ee189ea9 /sysutils
parentd4e99d35b6cf04c70b8882212307cbdadbe4fb18 (diff)
downloadpkgsrc-7adc59eb6d8e4872609cdb13ad9f0aceddedc0fd.tar.gz
Lock only the minimal critical section in the block hotplug script.
Patch provided my Manuel Bouyer. Thanks!
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xentools42/distinfo4
-rw-r--r--sysutils/xentools42/patches/patch-hotplug_NetBSD_block54
2 files changed, 16 insertions, 42 deletions
diff --git a/sysutils/xentools42/distinfo b/sysutils/xentools42/distinfo
index 34624db2977..1e96adf2a95 100644
--- a/sysutils/xentools42/distinfo
+++ b/sysutils/xentools42/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.25 2016/04/04 15:13:15 bad Exp $
+$NetBSD: distinfo,v 1.26 2016/04/04 15:16:03 bad Exp $
SHA1 (ipxe-git-v1.0.0.tar.gz) = da052c8de5f3485fe0253c19cf52ed6d72528485
RMD160 (ipxe-git-v1.0.0.tar.gz) = dcd9b6eaafa1ce05c1ebf2a15f2f73ad7a8c5547
@@ -49,7 +49,7 @@ SHA1 (patch-firmware_etherboot_patches_series) = 2ced4e380f436a0287744e0a817ff24
SHA1 (patch-firmware_hvmloader_Makefile) = d4d9f34335a178f50e7fda52747cf6551ceeccc6
SHA1 (patch-firmware_hvmloader_util.h) = 8ec0efdf56b9f2ea66cac7e90cba4abf727d4605
SHA1 (patch-hotplug_NetBSD_Makefile) = efc7c4d5b2f4aa5d3de2c7f77427db77fd95898a
-SHA1 (patch-hotplug_NetBSD_block) = 61a1d5188abd280aa0960fffb6f43fd17bd6fb07
+SHA1 (patch-hotplug_NetBSD_block) = 8e0f2afeb9e29ffb9cd51823ec5f4f2c80e457c7
SHA1 (patch-hotplug_NetBSD_vif-bridge) = 7d01f15273c983c2cfe125e75800f9719961427c
SHA1 (patch-hotplug_NetBSD_vif-ip) = d3b0555f5ba0bfcbf0f7027eb5f74a84d0cf7c80
SHA1 (patch-hotplug_common_Makefile) = 3ee2fec5c4cb171c35c7e73379da4235b5ddca99
diff --git a/sysutils/xentools42/patches/patch-hotplug_NetBSD_block b/sysutils/xentools42/patches/patch-hotplug_NetBSD_block
index 5095cc42656..695d96002cf 100644
--- a/sysutils/xentools42/patches/patch-hotplug_NetBSD_block
+++ b/sysutils/xentools42/patches/patch-hotplug_NetBSD_block
@@ -1,4 +1,7 @@
-$NetBSD: patch-hotplug_NetBSD_block,v 1.1 2016/04/04 15:13:15 bad Exp $
+$NetBSD: patch-hotplug_NetBSD_block,v 1.2 2016/04/04 15:16:03 bad Exp $
+
+Use a lock around the allocation of an unused vnd because xl(1) starts
+the hotplug scripts in parallel.
--- hotplug/NetBSD/block.orig 2014-09-02 06:22:57.000000000 +0000
+++ hotplug/NetBSD/block
@@ -10,48 +13,19 @@ $NetBSD: patch-hotplug_NetBSD_block,v 1.1 2016/04/04 15:13:15 bad Exp $
PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
export PATH
-@@ -14,6 +15,7 @@ error() {
- echo "$@" >&2
- xenstore-write $xpath/hotplug-status error \
- $xpath/hotplug-error "$@"
-+ release_lock block
- exit 1
- }
-
-@@ -37,10 +39,12 @@ case $xstatus in
- # device removed
- case $xtype in
- file)
+@@ -62,6 +63,7 @@ case $xstatus in
+ available_disks="$available_disks $disk"
+ eval $disk=free
+ done
+ claim_lock block
- vnd=$(xenstore-read "$xpath/vnd" || echo none)
- if [ $vnd != none ]; then
- vnconfig -u $vnd
- fi
-+ release_lock block
- ;;
- phy)
- ;;
-@@ -52,6 +56,7 @@ case $xstatus in
- exit 0
- ;;
- 2)
-+ claim_lock block
- case $xtype in
- file)
- # Store the list of available vnd(4) devices in
-@@ -78,6 +83,7 @@ case $xstatus in
+ # Mark the used vnd(4) devices as ``used''.
+ for disk in `sysctl hw.disknames`; do
+ case $disk in
+@@ -77,6 +79,7 @@ case $xstatus in
+ break
fi
done
++ release_lock block
if [ x$device = x ] ; then
-+ release_lock block
error "no available vnd device"
fi
- xenstore-write $xpath/vnd $device
-@@ -89,6 +95,7 @@ case $xstatus in
- physical_device=$(stat -f '%r' "$device")
- xenstore-write $xpath/physical-device $physical_device
- xenstore-write $xpath/hotplug-status connected
-+ release_lock block
- exit 0
- ;;
- *)