WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2/3] UNTESTED: xend - Wait for child to exit on xenst

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2/3] UNTESTED: xend - Wait for child to exit on xenstored startup
From: Bastian Blank <bastian@xxxxxxxxxxxx>
Date: Wed, 26 Mar 2008 12:01:49 +0100
Delivery-date: Wed, 26 Mar 2008 04:02:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
# HG changeset patch
# User Bastian Blank <waldi@xxxxxxxxxx>
# Date 1206528849 -3600
# Node ID f5eb725e1b5ed106be403bb2fa20dc74f98bcfc0
# Parent  784e9c500e4e6b2d6a76b639d695c8eaa5c99b62
Wait for child to exit on xenstored startup.

Signed-off-by: Bastian Blank <waldi@xxxxxxxxxx>

diff -r 784e9c500e4e -r f5eb725e1b5e tools/misc/xend
--- a/tools/misc/xend   Wed Mar 26 11:54:09 2008 +0100
+++ b/tools/misc/xend   Wed Mar 26 11:54:09 2008 +0100
@@ -98,8 +98,14 @@ def start_xenstored():
     args = ['xenstored', "--pid-file", pidfname]
     if os.getenv("XENSTORED_TRACE"):
         args.extend(["-T", "/var/log/xen/xenstored-trace.log"])
-    if os.fork() == 0:
+    pid = os.fork()
+    if pid == 0:
         os.execvp('xenstored', args)
+    p, status = os.waitpid(pid, 0)
+    if os.WIFEXITED(status):
+        status = os.WEXITSTATUS(status)
+        if status:
+            raise RuntimeError("Failed to start xenstored: %d" % status)
 
 def start_consoled():
     if os.fork() == 0:
-- 
No one can guarantee the actions of another.
                -- Spock, "Day of the Dove", stardate unknown

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/3] UNTESTED: xend - Wait for child to exit on xenstored startup, Bastian Blank <=