Skip to content

Commit

Permalink
stubdom: Fix stubdom-dm using "grep" improperly
Browse files Browse the repository at this point in the history
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 <[email protected]>
Committed-by: Ian Jackson <[email protected]>
  • Loading branch information
John Weekes committed Jan 11, 2011
1 parent b3c8bef commit 1676d94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stubdom/stubdom-dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1676d94

Please sign in to comment.