From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Weekes Subject: [PATCH] Fix stubdom-dm using "grep" improperly Date: Sun, 09 Jan 2011 21:09:52 -0800 Message-ID: <4D2A94A0.6030505@nuclearfallout.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010601050007000204050003" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010601050007000204050003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit stubdom-dm uses "grep" on "xm list" output to determine whether it is already running. The existing behavior is to use "grep $domname-dm" but this will result in a false-positive in the case of another domU running whose name ends with the full new name; for instance, if "abctest-dm" is running, a new "test-dm" will spin forever, waiting for it the end. Any easy fix is to have it use "grep -w" instead of "grep", searching for the whole word only. It also might be worth considering a switch to "xl list" from "xm list", here and in other places. This bug appears to exist in xen-4.0-testing, as well. Since it's a one-liner, a signed-off may not be needed, but just in case.. Signed-off-by: John Weekes --- a/xen-unstable.hg/stubdom/stubdom-dm 2010-08-10 23:20:26.187051097 -0500 +++ b/xen-unstable.hg/stubdom/stubdom-dm 2011-01-09 22:43:15.951806650 -0600 @@ -91,7 +91,7 @@ ############ # stubdomain # Wait for any previous stubdom to terminate -while xm list | grep $domname-dm +while xm list | grep -w $domname-dm do sleep 1 done --------------010601050007000204050003 Content-Type: text/x-patch; name="stubdom-dm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stubdom-dm.patch" --- a/xen-unstable.hg/stubdom/stubdom-dm 2010-08-10 23:20:26.187051097 -0500 +++ b/xen-unstable.hg/stubdom/stubdom-dm 2011-01-09 22:43:15.951806650 -0600 @@ -91,7 +91,7 @@ ############ # stubdomain # Wait for any previous stubdom to terminate -while xm list | grep $domname-dm +while xm list | grep -w $domname-dm do sleep 1 done --------------010601050007000204050003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010601050007000204050003--