This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] stubdom: Fix stubdom-dm using "grep" impr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] stubdom: Fix stubdom-dm using "grep" improperly
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 07:59:43 -0800
Delivery-date: Mon, 17 Jan 2011 08:13:52 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User John Weekes <lists.xen@xxxxxxxxxxxxxxxxxx>
# Date 1294764161 0
# Node ID 6852e3e7ef58bd1db90af1edeb42c6cf24318fc8
# Parent  7674b78a6c0d2208ae3b47e0cd5d52fc567b7555
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 <lists.xen@xxxxxxxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
 stubdom/stubdom-dm |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 7674b78a6c0d -r 6852e3e7ef58 stubdom/stubdom-dm
--- a/stubdom/stubdom-dm        Tue Jan 11 16:31:47 2011 +0000
+++ b/stubdom/stubdom-dm        Tue Jan 11 16:42:41 2011 +0000
@@ -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
        sleep 1

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] stubdom: Fix stubdom-dm using "grep" improperly, Xen patchbot-unstable <=