From: John Weekes Date: Fri, 14 Jan 2011 08:04:48 +0000 (+0000) Subject: stubdom: Fix stubdom-dm using "grep" improperly X-Git-Tag: 4.0.2-rc2~16 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=05be17cde6e61d165191b8606e1af0b3354974f7;p=people%2Fvhanquez%2Fxen.git stubdom: Fix stubdom-dm using "grep" improperly 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. Signed-off-by: John Weekes Committed-by: Ian Jackson xen-unstable changeset: 22714:6852e3e7ef58 xen-unstable date: Tue Jan 11 16:42:41 2011 +0000 --- diff --git a/stubdom/stubdom-dm b/stubdom/stubdom-dm index c85fa5363..05d07ac0d 100644 --- a/stubdom/stubdom-dm +++ b/stubdom/stubdom-dm @@ -91,7 +91,7 @@ trap term SIGHUP ############ # 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