All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Weekes <lists.xen@nuclearfallout.net>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] Fix stubdom-dm using "grep" improperly
Date: Sun, 09 Jan 2011 21:09:52 -0800	[thread overview]
Message-ID: <4D2A94A0.6030505@nuclearfallout.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

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 <lists.xen@nuclearfallout.net>

--- 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

[-- Attachment #2: stubdom-dm.patch --]
[-- Type: text/x-patch, Size: 337 bytes --]

--- 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

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2011-01-10  5:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10  5:09 John Weekes [this message]
2011-01-10  7:34 ` [PATCH] Fix stubdom-dm using "grep" improperly John Weekes
2011-01-11 16:42   ` [PATCH] Fix stubdom-dm using "grep" improperly [and 1 more messages] Ian Jackson
2011-01-11 16:59     ` Stefano Stabellini
2011-01-11 17:00       ` Ian Jackson
2011-01-11 18:15       ` John Weekes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2A94A0.6030505@nuclearfallout.net \
    --to=lists.xen@nuclearfallout.net \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.