[packages/xen] Another scripts locking patch, from upstream

jajcus jajcus at pld-linux.org
Sat Nov 17 14:34:48 CET 2012


commit 7abe351d55ff7aba8b3a3af2c48fef6ccc21fc99
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Sat Nov 17 12:52:45 2012 +0100

    Another scripts locking patch, from upstream
    
    http://xenbits.xen.org/hg/staging/xen-unstable.hg/rev/b3b03536789a
    
    Fixes starting VMs with more than one bridged interface

 xen-close_lockfd_after_lock_attempt.patch | 37 +++++++++++++++++++++++++++++++
 xen.spec                                  |  2 ++
 2 files changed, 39 insertions(+)
---
diff --git a/xen.spec b/xen.spec
index 7cc0a64..6d90d0d 100644
--- a/xen.spec
+++ b/xen.spec
@@ -87,6 +87,7 @@ Patch9:		xen-initscript.patch
 Patch10:	xen-quemu-softloat-c99.patch
 Patch11:	xen-qemu.patch
 Patch12:	xen-scripts-locking.patch
+Patch13:	xen-close_lockfd_after_lock_attempt.patch
 URL:		http://www.xen.org/products/xenhyp.html
 %{?with_opengl:BuildRequires:	OpenGL-devel}
 %{?with_sdl:BuildRequires:	SDL-devel >= 1.2.1}
@@ -372,6 +373,7 @@ Nadzorca Xen w postaci, która może być uruchomiona wprost z firmware
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 
 # stubdom sources
 ln -s %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} stubdom
diff --git a/xen-close_lockfd_after_lock_attempt.patch b/xen-close_lockfd_after_lock_attempt.patch
new file mode 100644
index 0000000..9295636
--- /dev/null
+++ b/xen-close_lockfd_after_lock_attempt.patch
@@ -0,0 +1,37 @@
+
+# HG changeset patch
+# User Olaf Hering <olaf at aepfle.de>
+# Date 1350549301 -3600
+# Node ID b3b03536789abbf2c4b7d62377034c1f14c6340c
+# Parent  019ca95dfa34efc71b1707f785b5112573e7d02e
+hotplug/Linux: close lockfd after lock attempt
+
+When a HVM guest is shutdown some of the 'remove' events can not claim
+the lock for some reason. Instead they try to grab the lock in a busy
+loop, until udev reaps the xen-hotplug-cleanup helper.
+After analyzing the resulting logfile its not obvious what the cause is.
+The only explanation is that bash (?) gets confused if the same lockfd
+is opened again and again. Closing it in each iteration seem to fix the
+issue.
+
+This was observed with sles11sp2 (bash 3.2) and 4.2 xend.
+
+Signed-off-by: Olaf Hering <olaf at aepfle.de>
+Acked-by: Ian Campbell <Ian.campbell at citrix.com>
+[ ijc -- added the comment ]
+Committed-by: Ian Campbell <ian.campbell at citrix.com>
+
+diff -r 019ca95dfa34 -r b3b03536789a tools/hotplug/Linux/locking.sh
+--- a/tools/hotplug/Linux/locking.sh	Thu Oct 18 09:35:00 2012 +0100
++++ b/tools/hotplug/Linux/locking.sh	Thu Oct 18 09:35:01 2012 +0100
+@@ -59,6 +59,9 @@ claim_lock()
+             print "y\n" if $fd_inum eq $file_inum;
+                              ' "$_lockfile" )
+         if [ x$rightfile = xy ]; then break; fi
++	# Some versions of bash appear to be buggy if the same
++	# $_lockfile is opened repeatedly. Close the current fd here.
++        eval "exec $_lockfd<&-"
+     done
+ }
+ 
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xen.git/commitdiff/291689a11152f9ea4bb81d2b0549fd0a5fedd10a



More information about the pld-cvs-commit mailing list