mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@xensource.com>
This commit is contained in:
1 parent
490bab7b96
commit
af1b5637f4
10 files changed
+29
-19
No files matched your search
@@ -179,7 +179,7 @@ uninstall:
|
||||
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
|
||||
|
||||
@@ -3,7 +3,7 @@ XEN_ROOT=../..
|
||||
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
|
||||
|
||||
+4
-3
@@ -2,9 +2,10 @@
|
||||
# -*- mode: python; -*-
|
||||
#============================================================================
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
# 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 check_user():
|
||||
|
||||
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:
|
||||
|
||||
@@ -5,7 +5,6 @@ import os.path
|
||||
import re
|
||||
import sys
|
||||
|
||||
os.defpath = os.defpath + ':/sbin:/usr/sbin:/usr/local/sbin'
|
||||
CMD_IFCONFIG = 'ifconfig'
|
||||
CMD_ROUTE = 'route'
|
||||
CMD_BRCTL = 'brctl'
|
||||
|
||||
@@ -14,6 +14,8 @@ from struct import pack, unpack, calcsize
|
||||
|
||||
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 xen.xend.xenstore.xsutil import IntroduceDomain
|
||||
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 @@ def save(fd, dominfo, live):
|
||||
# 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 @@ def restore(xd, fd):
|
||||
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))
|
||||
|
||||
@@ -38,7 +38,7 @@ class Daemon:
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,11 +14,14 @@
|
||||
#============================================================================
|
||||
# Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
|
||||
# Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
# Copyright (C) 2005 XenSource Ltd
|
||||
#============================================================================
|
||||
|
||||
"""Domain creation.
|
||||
"""
|
||||
import random
|
||||
import os
|
||||
import os.path
|
||||
import string
|
||||
import sys
|
||||
import socket
|
||||
@@ -36,6 +39,9 @@ from xen.util import blkif
|
||||
|
||||
from xen.xm.opts import *
|
||||
|
||||
import console
|
||||
|
||||
|
||||
gopts = Opts(use="""[options] [vars]
|
||||
|
||||
Create a domain.
|
||||
@@ -879,8 +885,7 @@ def main(argv):
|
||||
|
||||
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)
|
||||
@@ -38,6 +38,8 @@ from xen.xend import PrettyPrint
|
||||
from xen.xend import sxp
|
||||
from xen.xm.opts import *
|
||||
|
||||
import console
|
||||
|
||||
|
||||
shorthelp = """Usage: xm <subcommand> [args]
|
||||
Control, list, and manipulate Xen guest instances
|
||||
@@ -442,12 +444,11 @@ def xm_console(args):
|
||||
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):
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ INSTALL_DIR = $(INSTALL) -d -m0755
|
||||
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)
|
||||
|
||||
|
||||