xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: xen-devel@lists.xenproject.org
Cc: "Ian Campbell" <ian.campbell@citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Luis R. Rodriguez" <mcgrof@suse.com>,
	"Jan Rękorajski" <baggins@pld-linux.org>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Jacek Konieczny" <jajcus@jajcus.net>,
	"M A Young" <m.a.young@durham.ac.uk>
Subject: [PATCH v2 2/7] xencommons: use the retry limit instead of implementing our own timeout
Date: Wed, 19 Mar 2014 13:58:48 -0700	[thread overview]
Message-ID: <1395262733-11885-3-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1395262733-11885-1-git-send-email-mcgrof@do-not-panic.com>

From: "Luis R. Rodriguez" <mcgrof@suse.com>

xenstore-read now has support to retry opening the xenstored a certain
amount of times, once each second, use that instead of implementing our
own timeout.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/hotplug/Linux/init.d/xencommons | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
index 4ebd636..68d874e 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -54,9 +54,6 @@ if test -f /proc/xen/capabilities && \
 fi
 
 do_start () {
-        local time=0
-	local timeout=30
-
 	modprobe xen-evtchn 2>/dev/null
 	modprobe xen-gntdev 2>/dev/null
 	modprobe xen-gntalloc 2>/dev/null
@@ -93,17 +90,11 @@ do_start () {
 		    echo "No xenstored found"
 		    exit 1
 		fi
-
-		# Wait for xenstored to actually come up, timing out after 30 seconds
-                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
-                    echo -n .
-		    time=$(($time+1))
-                    sleep 1
-                done
-		echo
-
-		# Exit if we timed out
-		if ! [ $time -lt $timeout ] ; then
+		# We try opening the xenstored socket every second up to the
+		# limit specified, if it hasn't opened by then assume
+		# failure.
+                ${BINDIR}/xenstore-read -l 30 -s / >/dev/null 2>&1
+		if [ $? -ne 0 ] ; then
 		    echo Could not start xenstored
 		    exit 1
 		fi
-- 
1.9.0


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

  parent reply	other threads:[~2014-03-19 20:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 20:58 [PATCH v2 0/7] xen: add systemd files Luis R. Rodriguez
2014-03-19 20:58 ` [PATCH v2 1/7] xenstore-read: add support for a retry open limit on xenstored Luis R. Rodriguez
2014-03-21 15:21   ` Ian Campbell
2014-03-21 15:22     ` Ian Jackson
2014-03-22  1:36       ` Luis R. Rodriguez
2014-03-22  1:33     ` Luis R. Rodriguez
2014-03-24  9:57       ` Ian Campbell
2014-03-21 15:40   ` David Vrabel
2014-03-21 16:01     ` Ian Campbell
2014-03-22  1:43       ` Luis R. Rodriguez
2014-03-24 10:01         ` Ian Campbell
2014-03-22  1:41     ` Luis R. Rodriguez
2014-03-19 20:58 ` Luis R. Rodriguez [this message]
2014-03-21 15:24   ` [PATCH v2 2/7] xencommons: use the retry limit instead of implementing our own timeout Ian Campbell
2014-03-19 20:58 ` [PATCH v2 3/7] tools/xendomains: make xl the default Luis R. Rodriguez
2014-03-21 15:26   ` Ian Campbell
2014-03-19 20:58 ` [PATCH v2 4/7] tools/xendomains: remove old redhat check Luis R. Rodriguez
2014-03-21 15:28   ` Ian Campbell
2014-03-22  1:56     ` Luis R. Rodriguez
2014-03-19 20:58 ` [PATCH v2 5/7] tools/xendomains: do space cleanups Luis R. Rodriguez
2014-03-21 15:29   ` Ian Campbell
2014-03-19 20:58 ` [PATCH v2 6/7] tools/xendomains: move to sbin and use init helper Luis R. Rodriguez
2014-03-19 22:03   ` Olaf Hering
2014-03-22  2:00     ` Luis R. Rodriguez
2014-03-21 15:34   ` Ian Campbell
2014-03-22  2:17     ` Luis R. Rodriguez
2014-03-24 10:09       ` Ian Campbell
2014-04-28  5:11         ` Luis R. Rodriguez
2014-04-28  9:15           ` Ian Campbell
2014-04-28 10:47             ` Luis R. Rodriguez
2014-03-19 20:58 ` [PATCH v2 7/7] systemd: add support initial xen systemd service files Luis R. Rodriguez
2014-03-19 21:05   ` Luis R. Rodriguez
2014-03-21 10:08   ` Ian Campbell
2014-03-22  2:26     ` Luis R. Rodriguez
2014-03-24 10:11       ` Ian Campbell
2014-03-24 16:36         ` Luis R. Rodriguez
2014-04-28  5:12         ` Luis R. Rodriguez

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=1395262733-11885-3-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=baggins@pld-linux.org \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jajcus@jajcus.net \
    --cc=m.a.young@durham.ac.uk \
    --cc=mcgrof@suse.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).