[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Allow parallel 32- and 64-bit Xen installations. Move xc_save, xc_restore,



# HG changeset patch
# User emellor@ewan
# Node ID 903d888579726e86dcd17aa047a44688be225bc8
# Parent  46bd7564125d7e91832d132979bd7e4b3af27b08
Allow parallel 32- and 64-bit Xen installations.  Move xc_save, xc_restore,
and xenconsole out of /usr/libexec/xen and into one of /usr/lib/xen/bin or
/usr/lib64/xen/bin.  Remove all the PATH hacking inside Xend, and rely upon
the PATH being set correctly from outside.  Added an auxbin module for
handling the hacky stuff.

Replace the few /usr/bin/python bang paths with /usr/bin/env python.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 46bd7564125d -r 903d88857972 Makefile
--- a/Makefile  Tue Oct 11 12:02:59 2005
+++ b/Makefile  Tue Oct 11 13:55:12 2005
@@ -179,7 +179,7 @@
        rm -rf $(D)/usr/$(LIBDIR)/libxenctrl* $(D)/usr/$(LIBDIR)/libxenguest*
        rm -rf $(D)/usr/$(LIBDIR)/libxenstore*
        rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/$(LIBDIR)/xen 
-       rm -rf $(D)/usr/libexec/xen
+       rm -rf $(D)/usr/$(LIBDIR)/xen/bin
        rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
        rm -rf $(D)/usr/share/doc/xen
        rm -rf $(D)/usr/share/xen
diff -r 46bd7564125d -r 903d88857972 tools/console/Makefile
--- a/tools/console/Makefile    Tue Oct 11 12:02:59 2005
+++ b/tools/console/Makefile    Tue Oct 11 13:55:12 2005
@@ -3,7 +3,7 @@
 include $(XEN_ROOT)/tools/Rules.mk
 
 DAEMON_INSTALL_DIR = /usr/sbin
-CLIENT_INSTALL_DIR = /usr/libexec/xen
+CLIENT_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
 
 INSTALL         = install
 INSTALL_PROG    = $(INSTALL) -m0755
diff -r 46bd7564125d -r 903d88857972 tools/misc/xend
--- a/tools/misc/xend   Tue Oct 11 12:02:59 2005
+++ b/tools/misc/xend   Tue Oct 11 13:55:12 2005
@@ -2,9 +2,10 @@
 #  -*- mode: python; -*-
 #============================================================================
 # Copyright (C) 2004 Mike Wray <mike.wray@xxxxxx>
+# Copyright (C) 2005 XenSource Ltd
 #============================================================================
 
-"""Xen management daemon. Lives in /usr/sbin.
+"""Xen management daemon.
    Provides console server and HTTP management api.
 
    Run:
@@ -67,14 +68,14 @@
 
 def start_xenstored():
     XENSTORED_TRACE = os.getenv("XENSTORED_TRACE")
-    cmd = "/usr/sbin/xenstored --pid-file=/var/run/xenstore.pid"
+    cmd = "xenstored --pid-file=/var/run/xenstore.pid"
     if XENSTORED_TRACE:
         cmd += " -T /var/log/xenstored-trace.log"
     s,o = commands.getstatusoutput(cmd)
 
 def start_consoled():
     if os.fork() == 0:
-        os.execvp('/usr/sbin/xenconsoled', ['/usr/sbin/xenconsoled'])
+        os.execvp('xenconsoled', ['xenconsoled'])
             
 def main():
     try:
diff -r 46bd7564125d -r 903d88857972 tools/python/xen/util/Brctl.py
--- a/tools/python/xen/util/Brctl.py    Tue Oct 11 12:02:59 2005
+++ b/tools/python/xen/util/Brctl.py    Tue Oct 11 13:55:12 2005
@@ -5,7 +5,6 @@
 import re
 import sys
 
-os.defpath = os.defpath + ':/sbin:/usr/sbin:/usr/local/sbin'
 CMD_IFCONFIG = 'ifconfig'
 CMD_ROUTE    = 'route'
 CMD_BRCTL    = 'brctl'
diff -r 46bd7564125d -r 903d88857972 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Tue Oct 11 12:02:59 2005
+++ b/tools/python/xen/xend/XendCheckpoint.py   Tue Oct 11 13:55:12 2005
@@ -14,6 +14,8 @@
 
 from xen.util.xpopen import xPopen3
 
+import xen.util.auxbin
+
 import xen.lowlevel.xc
 
 from xen.xend.xenstore.xsutil import IntroduceDomain
@@ -21,9 +23,11 @@
 from XendError import XendError
 from XendLogging import log
 
+
 SIGNATURE = "LinuxGuestRecord"
-PATH_XC_SAVE = "/usr/libexec/xen/xc_save"
-PATH_XC_RESTORE = "/usr/libexec/xen/xc_restore"
+XC_SAVE = "xc_save"
+XC_RESTORE = "xc_restore"
+
 
 sizeof_int = calcsize("i")
 sizeof_unsigned_long = calcsize("L")
@@ -64,7 +68,7 @@
         # enabled. Passing "0" simply uses the defaults compiled into
         # libxenguest; see the comments and/or code in xc_linux_save() for
         # more information.
-        cmd = [PATH_XC_SAVE, str(xc.handle()), str(fd),
+        cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(xc.handle()), str(fd),
                str(dominfo.getDomid()), "0", "0", str(int(live)) ]
         log.debug("[xc_save]: %s", string.join(cmd))
 
@@ -129,7 +133,7 @@
         store_evtchn = dominfo.store_channel
         console_evtchn = dominfo.console_channel
 
-        cmd = [PATH_XC_RESTORE, str(xc.handle()), str(fd),
+        cmd = [xen.util.auxbin.pathTo(XC_RESTORE), str(xc.handle()), str(fd),
                str(dominfo.getDomid()), str(nr_pfns),
                str(store_evtchn), str(console_evtchn)]
         log.debug("[xc_restore]: %s", string.join(cmd))
diff -r 46bd7564125d -r 903d88857972 tools/python/xen/xend/server/SrvDaemon.py
--- a/tools/python/xen/xend/server/SrvDaemon.py Tue Oct 11 12:02:59 2005
+++ b/tools/python/xen/xend/server/SrvDaemon.py Tue Oct 11 13:55:12 2005
@@ -38,7 +38,7 @@
         pythonex = '(?P<python>\S*python\S*)'
         cmdex = '(?P<cmd>.*)'
         procre = re.compile('^\s*' + pidex + '\s*' + pythonex + '\s*' + cmdex 
+ '$')
-        xendre = re.compile('^/usr/sbin/xend\s*(start|restart)\s*.*$')
+        xendre = re.compile('^\S+/xend\s*(start|restart)\s*.*$')
         procs = os.popen('ps -e -o pid,args 2>/dev/null')
         for proc in procs:
             pm = procre.match(proc)
diff -r 46bd7564125d -r 903d88857972 tools/python/xen/xend/sxp.py
--- a/tools/python/xen/xend/sxp.py      Tue Oct 11 12:02:59 2005
+++ b/tools/python/xen/xend/sxp.py      Tue Oct 11 13:55:12 2005
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #============================================================================
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of version 2.1 of the GNU Lesser General Public
diff -r 46bd7564125d -r 903d88857972 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Tue Oct 11 12:02:59 2005
+++ b/tools/python/xen/xm/create.py     Tue Oct 11 13:55:12 2005
@@ -14,11 +14,14 @@
 #============================================================================
 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@xxxxxx>
 # Copyright (C) 2005 Nguyen Anh Quynh <aquynh@xxxxxxxxx>
+# Copyright (C) 2005 XenSource Ltd
 #============================================================================
 
 """Domain creation.
 """
 import random
+import os
+import os.path
 import string
 import sys
 import socket
@@ -35,6 +38,9 @@
 from xen.util import blkif
 
 from xen.xm.opts import *
+
+import console
+
 
 gopts = Opts(use="""[options] [vars]
 
@@ -879,8 +885,7 @@
 
         dom = make_domain(opts, config)
         if opts.vals.console_autoconnect:
-            cmd = "/usr/libexec/xen/xenconsole %d" % dom
-            os.execvp('/usr/libexec/xen/xenconsole', cmd.split())
+            console.execConsole(dom)
         
 if __name__ == '__main__':
     main(sys.argv)
diff -r 46bd7564125d -r 903d88857972 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Oct 11 12:02:59 2005
+++ b/tools/python/xen/xm/main.py       Tue Oct 11 13:55:12 2005
@@ -37,6 +37,8 @@
 from xen.xend import PrettyPrint
 from xen.xend import sxp
 from xen.xm.opts import *
+
+import console
 
 
 shorthelp = """Usage: xm <subcommand> [args]
@@ -442,12 +444,11 @@
     from xen.xend.XendClient import server
     info = server.xend_domain(dom)
     domid = int(sxp.child_value(info, 'domid', '-1'))
-    cmd = "/usr/libexec/xen/xenconsole %d" % domid
-    os.execvp('/usr/libexec/xen/xenconsole', cmd.split())
-    console = sxp.child(info, "console")
+    console.execConsole(domid)
+
 
 def xm_top(args):
-    os.execv('/usr/sbin/xentop', ['/usr/sbin/xentop'])
+    os.execvp('xentop', ['xentop'])
 
 def xm_dmesg(args):
     
diff -r 46bd7564125d -r 903d88857972 tools/xcutils/Makefile
--- a/tools/xcutils/Makefile    Tue Oct 11 12:02:59 2005
+++ b/tools/xcutils/Makefile    Tue Oct 11 13:55:12 2005
@@ -15,7 +15,7 @@
 XEN_ROOT       = ../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-PROGRAMS_INSTALL_DIR   = /usr/libexec/xen
+PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
 
 INCLUDES += -I $(XEN_LIBXC)
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.