ia64/xen-unstable

changeset 18323:644a9d219973

xend: Allow xenconsoled to be passed arguments at startup

Attached patch allows to pass arguments to xenconsoled
via XENCONSOLED_TRACE env. variable analogous to xenstored.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Aug 13 13:42:30 2008 +0100 (2008-08-13)
parents 60af813ea458
children 0638a5c2cc9f
files tools/misc/xend
line diff
     1.1 --- a/tools/misc/xend	Wed Aug 13 13:40:38 2008 +0100
     1.2 +++ b/tools/misc/xend	Wed Aug 13 13:42:30 2008 +0100
     1.3 @@ -77,6 +77,10 @@ def check_user():
     1.4          hline()
     1.5          raise CheckError("invalid user")
     1.6  
     1.7 +def start_daemon(daemon, *args):
     1.8 +    if os.fork() == 0:
     1.9 +        os.execvp(daemon, (daemon,) + args)
    1.10 +
    1.11  def start_xenstored():
    1.12      pidfname = "/var/run/xenstore.pid"
    1.13      try:
    1.14 @@ -102,13 +106,15 @@ def start_xenstored():
    1.15      s,o = commands.getstatusoutput(cmd)
    1.16  
    1.17  def start_consoled():
    1.18 -    if os.fork() == 0:
    1.19 -        os.execvp('xenconsoled', ['xenconsoled'])
    1.20 +    XENCONSOLED_TRACE = os.getenv("XENCONSOLED_TRACE")
    1.21 +    args = ""
    1.22 +    if XENCONSOLED_TRACE:
    1.23 +        args += "--log=" + XENCONSOLED_TRACE
    1.24 +    start_daemon("xenconsoled", args)
    1.25  
    1.26  def start_blktapctrl():
    1.27 -    if os.fork() == 0:
    1.28 -        os.execvp('blktapctrl', ['blktapctrl'])
    1.29 -            
    1.30 +    start_daemon("blktapctrl", "")
    1.31 +
    1.32  def main():
    1.33      try:
    1.34          check_logging()