Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
The Xen virtual machine monitor allows running several virtual machines
on a single physical machine. The xentools20 package contains the
tools to create, destroy and control the virtual machines.
The xentools20 package contains the tools for Xen 2.0

View File

@@ -0,0 +1,17 @@
===========================================================================
$NetBSD: MESSAGE.NetBSD,v 1.3 2007/10/07 12:59:15 kano Exp $
Please ensure that the Xen-specific devices needed by xend(8) exist:
cd /dev && sh MAKEDEV xen
There are example configuration files for setting up a guest domain in:
${EGDIR}/xmexample[0-9]*
Please also refer to the the "NetBSD/xen How-To" for more information on
creating a Xen setup:
http://www.NetBSD.org/ports/xen/howto.html
===========================================================================

View File

@@ -0,0 +1,119 @@
# $NetBSD: Makefile,v 1.42 2013/02/06 23:23:54 jperkin Exp $
#
DISTNAME= xen-2.0.7-src
PKGNAME= xentools20-2.0.7
PKGREVISION= 17
CATEGORIES= sysutils
MASTER_SITES= http://www.cl.cam.ac.uk/research/srg/netos/xen/downloads/
EXTRACT_SUFX= .tgz
MAINTAINER= bouyer@NetBSD.org
HOMEPAGE= http://www.cl.cam.ac.uk/research/srg/netos/xen/
COMMENT= Userland Tools for Xen
LICENSE= gnu-gpl-v2
DEPENDS+= ${PYPKGPREFIX}-twisted-[0-9]*:../../net/py-twisted
PKG_SYSCONFSUBDIR= xen
ONLY_FOR_PLATFORM= Linux-2.[46]*-i386 NetBSD-*-i386
CONFLICTS+= libxen-[0-9]*
WRKSRC= ${WRKDIR}/xen-2.0/tools
EGDIR= ${PREFIX}/share/examples/xen
MESSAGE_SUBST= EGDIR=${EGDIR}
USE_TOOLS+= gmake
MAKE_ENV+= EGDIR=${EGDIR:Q}
MAKE_ENV+= MV=${MV:Q} PYTHON=${PYTHONBIN:Q} SED=${SED:Q}
PY_PATCHPLIST= yes
PYTHON_PATCH_SCRIPTS= python/xen/util/console_client.py
PYTHON_PATCH_SCRIPTS+= python/xen/xend/server/SrvServer.py
PYTHON_PATCH_SCRIPTS+= python/xen/xend/XendClient.py
PYTHON_PATCH_SCRIPTS+= python/xen/xend/sxp.py
PYTHON_PATCH_SCRIPTS+= xfrd/xfrdClient.py
PYTHON_PATCH_SCRIPTS+= misc/xensymoops
PYTHON_PATCH_SCRIPTS+= misc/xencons
PYTHON_PATCH_SCRIPTS+= misc/xm
PYTHON_PATCH_SCRIPTS+= misc/xensv
PYTHON_PATCH_SCRIPTS+= misc/netfix
PYTHON_PATCH_SCRIPTS+= misc/xend
PYTHON_PATCH_SCRIPTS+= xentrace/xentrace_format
SUBST_CLASSES+= paths py conf
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= python/xen/xend/server/SrvDaemon.py
SUBST_FILES.paths+= python/xen/xend/XendDomainInfo.py
SUBST_FILES.paths+= python/xen/sv/Daemon.py
SUBST_SED.paths= -e "s|/usr/sbin|${PREFIX}/sbin|g"
SUBST_MESSAGE.paths= Fixing hardcoded paths.
SUBST_STAGE.py= pre-configure
SUBST_FILES.py= python/Makefile
SUBST_SED.py= -e "s,python,${PYTHONBIN},g"
SUBST_STAGE.conf= pre-configure
SUBST_FILES.conf= python/xen/xend/XendRoot.py
SUBST_SED.conf= -e "s,@XENDCONFDIR@,${PKG_SYSCONFDIR},g"
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "NetBSD"
SUBST_CLASSES+= proc
SUBST_STAGE.proc= pre-configure
SUBST_FILES.proc= python/xen/xend/XendVnet.py
SUBST_FILES.proc+= libxc/xc_misc.c
SUBST_FILES.proc+= xentrace/xentrace.c
SUBST_SED.proc= -e "s|/proc|/kern|g"
PROCPATH= /kern
.else
PROCPATH= /proc
.endif
RCD_SCRIPTS= xend xendomains
FILES_SUBST+= RCD_INTERPRETER=${PYTHONBIN:Q}
FILES_SUBST+= PROCPATH=${PROCPATH:Q}
FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
XEND_SCRIPTS= network block-enbd vif-bridge block-file
CONF_FILES= ${EGDIR}/xend-config.sxp \
${PKG_SYSCONFDIR}/xend-config.sxp
.for s in ${XEND_SCRIPTS}
CONF_FILES_PERMS+= ${EGDIR}/${s} ${PKG_SYSCONFDIR}/${s} \
${ROOT_USER} ${ROOT_GROUP} 0755
.endfor
pre-build:
${MKDIR} ${WRKSRC}/libxc/xen/NetBSD
${CP} ${FILESDIR}/xenio.h ${WRKSRC}/libxc/xen/NetBSD
.if ${OPSYS} == "NetBSD"
post-build:
cd ${FILESDIR}; for src in *-nbsd; do \
dst="$${src%-nbsd}"; \
${SED} -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g" \
$$src > ${WRKSRC}/examples/$$dst; \
done
.endif
post-install:
${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
for f in xend-config.sxp xmexample1 xmexample2 xmexample3; do \
${INSTALL_DATA} ${WRKSRC}/examples/$$f ${DESTDIR}${EGDIR}/$$f; \
done
.for s in ${XEND_SCRIPTS}
${INSTALL_SCRIPT} ${WRKSRC}/examples/${s} ${DESTDIR}${EGDIR}/${s}
.endfor
.include "../../lang/python/application.mk"
.include "../../lang/python/extension.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../www/curl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

190
sysutils/xentools20/PLIST Normal file
View File

@@ -0,0 +1,190 @@
@comment $NetBSD: PLIST,v 1.9 2009/06/14 18:16:21 joerg Exp $
bin/xencons
bin/xenperf
include/xc.h
lib/libxc.a
lib/libxc.so
lib/libxc.so.2.0
lib/libxc.so.2.0.0
lib/libxutil.a
lib/libxutil.so
lib/libxutil.so.2.0
lib/libxutil.so.2.0.0
${PYSITELIB}/xen/__init__.py
${PYSITELIB}/xen/__init__.pyc
${PYSITELIB}/xen/lowlevel/__init__.py
${PYSITELIB}/xen/lowlevel/__init__.pyc
${PYSITELIB}/xen/lowlevel/xc.so
${PYSITELIB}/xen/lowlevel/xu.so
${PYSITELIB}/xen/sv/CreateDomain.py
${PYSITELIB}/xen/sv/DomInfo.py
${PYSITELIB}/xen/sv/DomList.py
${PYSITELIB}/xen/sv/GenTabbed.py
${PYSITELIB}/xen/sv/HTMLBase.py
${PYSITELIB}/xen/sv/Main.py
${PYSITELIB}/xen/sv/MigrateDomain.py
${PYSITELIB}/xen/sv/NodeInfo.py
${PYSITELIB}/xen/sv/RestoreDomain.py
${PYSITELIB}/xen/sv/SaveDomain.py
${PYSITELIB}/xen/sv/TabView.py
${PYSITELIB}/xen/sv/Wizard.py
${PYSITELIB}/xen/sv/__init__.py
${PYSITELIB}/xen/sv/params.py
${PYSITELIB}/xen/sv/util.py
${PYSITELIB}/xen/sv/CreateDomain.pyc
${PYSITELIB}/xen/sv/Daemon.py
${PYSITELIB}/xen/sv/Daemon.pyc
${PYSITELIB}/xen/sv/DomInfo.pyc
${PYSITELIB}/xen/sv/DomList.pyc
${PYSITELIB}/xen/sv/GenTabbed.pyc
${PYSITELIB}/xen/sv/HTMLBase.pyc
${PYSITELIB}/xen/sv/Main.pyc
${PYSITELIB}/xen/sv/MigrateDomain.pyc
${PYSITELIB}/xen/sv/NodeInfo.pyc
${PYSITELIB}/xen/sv/RestoreDomain.pyc
${PYSITELIB}/xen/sv/SaveDomain.pyc
${PYSITELIB}/xen/sv/TabView.pyc
${PYSITELIB}/xen/sv/Wizard.pyc
${PYSITELIB}/xen/sv/__init__.pyc
${PYSITELIB}/xen/sv/params.pyc
${PYSITELIB}/xen/sv/util.pyc
${PYSITELIB}/xen/util/Brctl.pyc
${PYSITELIB}/xen/util/__init__.pyc
${PYSITELIB}/xen/util/console_client.py
${PYSITELIB}/xen/util/console_client.pyc
${PYSITELIB}/xen/util/ip.pyc
${PYSITELIB}/xen/util/tempfile.pyc
${PYSITELIB}/xen/util/Brctl.py
${PYSITELIB}/xen/util/__init__.py
${PYSITELIB}/xen/util/ip.py
${PYSITELIB}/xen/util/tempfile.py
${PYSITELIB}/xen/xend/Args.py
${PYSITELIB}/xen/xend/Blkctl.py
${PYSITELIB}/xen/xend/EventServer.py
${PYSITELIB}/xen/xend/EventTypes.py
${PYSITELIB}/xen/xend/PrettyPrint.py
${PYSITELIB}/xen/xend/Vifctl.py
${PYSITELIB}/xen/xend/XendAsynchProtocol.py
${PYSITELIB}/xen/xend/XendConsole.py
${PYSITELIB}/xen/xend/XendDB.py
${PYSITELIB}/xen/xend/XendDmesg.py
${PYSITELIB}/xen/xend/XendDomain.py
${PYSITELIB}/xen/xend/XendError.py
${PYSITELIB}/xen/xend/XendMigrate.py
${PYSITELIB}/xen/xend/XendNode.py
${PYSITELIB}/xen/xend/XendProtocol.py
${PYSITELIB}/xen/xend/XendRoot.py
${PYSITELIB}/xen/xend/XendVnet.py
${PYSITELIB}/xen/xend/encode.py
${PYSITELIB}/xen/xend/Args.pyc
${PYSITELIB}/xen/xend/Blkctl.pyc
${PYSITELIB}/xen/xend/EventServer.pyc
${PYSITELIB}/xen/xend/EventTypes.pyc
${PYSITELIB}/xen/xend/PrettyPrint.pyc
${PYSITELIB}/xen/xend/Vifctl.pyc
${PYSITELIB}/xen/xend/XendAsynchProtocol.pyc
${PYSITELIB}/xen/xend/XendClient.py
${PYSITELIB}/xen/xend/XendClient.pyc
${PYSITELIB}/xen/xend/XendConsole.pyc
${PYSITELIB}/xen/xend/XendDB.pyc
${PYSITELIB}/xen/xend/XendDmesg.pyc
${PYSITELIB}/xen/xend/XendDomain.pyc
${PYSITELIB}/xen/xend/XendDomainInfo.py
${PYSITELIB}/xen/xend/XendDomainInfo.pyc
${PYSITELIB}/xen/xend/XendError.pyc
${PYSITELIB}/xen/xend/XendLogging.pyc
${PYSITELIB}/xen/xend/XendMigrate.pyc
${PYSITELIB}/xen/xend/XendNode.pyc
${PYSITELIB}/xen/xend/XendProtocol.pyc
${PYSITELIB}/xen/xend/XendRoot.pyc
${PYSITELIB}/xen/xend/XendVnet.pyc
${PYSITELIB}/xen/xend/__init__.pyc
${PYSITELIB}/xen/xend/XendLogging.py
${PYSITELIB}/xen/xend/__init__.py
${PYSITELIB}/xen/xend/util.py
${PYSITELIB}/xen/xend/encode.pyc
${PYSITELIB}/xen/xend/server/SrvBase.py
${PYSITELIB}/xen/xend/server/SrvConsole.py
${PYSITELIB}/xen/xend/server/SrvConsoleDir.py
${PYSITELIB}/xen/xend/server/SrvDaemon.py
${PYSITELIB}/xen/xend/server/SrvDeviceDir.py
${PYSITELIB}/xen/xend/server/SrvDir.py
${PYSITELIB}/xen/xend/server/SrvDmesg.py
${PYSITELIB}/xen/xend/server/SrvDomain.py
${PYSITELIB}/xen/xend/server/SrvDomainDir.py
${PYSITELIB}/xen/xend/server/SrvEventDir.py
${PYSITELIB}/xen/xend/server/SrvNode.py
${PYSITELIB}/xen/xend/server/SrvRoot.py
${PYSITELIB}/xen/xend/server/SrvServer.py
${PYSITELIB}/xen/xend/server/SrvVnetDir.py
${PYSITELIB}/xen/xend/server/SrvXendLog.py
${PYSITELIB}/xen/xend/server/blkif.py
${PYSITELIB}/xen/xend/server/channel.py
${PYSITELIB}/xen/xend/server/console.py
${PYSITELIB}/xen/xend/server/controller.py
${PYSITELIB}/xen/xend/server/domain.py
${PYSITELIB}/xen/xend/server/messages.py
${PYSITELIB}/xen/xend/server/netif.py
${PYSITELIB}/xen/xend/server/params.py
${PYSITELIB}/xen/xend/server/SrvBase.pyc
${PYSITELIB}/xen/xend/server/SrvConsole.pyc
${PYSITELIB}/xen/xend/server/SrvConsoleDir.pyc
${PYSITELIB}/xen/xend/server/SrvDaemon.pyc
${PYSITELIB}/xen/xend/server/SrvDeviceDir.pyc
${PYSITELIB}/xen/xend/server/SrvDir.pyc
${PYSITELIB}/xen/xend/server/SrvDmesg.pyc
${PYSITELIB}/xen/xend/server/SrvDomain.pyc
${PYSITELIB}/xen/xend/server/SrvDomainDir.pyc
${PYSITELIB}/xen/xend/server/SrvEventDir.pyc
${PYSITELIB}/xen/xend/server/SrvNode.pyc
${PYSITELIB}/xen/xend/server/SrvRoot.pyc
${PYSITELIB}/xen/xend/server/SrvServer.pyc
${PYSITELIB}/xen/xend/server/SrvVnetDir.pyc
${PYSITELIB}/xen/xend/server/SrvXendLog.pyc
${PYSITELIB}/xen/xend/server/__init__.py
${PYSITELIB}/xen/xend/server/__init__.pyc
${PYSITELIB}/xen/xend/server/blkif.pyc
${PYSITELIB}/xen/xend/server/channel.pyc
${PYSITELIB}/xen/xend/server/console.pyc
${PYSITELIB}/xen/xend/server/controller.pyc
${PYSITELIB}/xen/xend/server/domain.pyc
${PYSITELIB}/xen/xend/server/messages.pyc
${PYSITELIB}/xen/xend/server/netif.pyc
${PYSITELIB}/xen/xend/server/params.pyc
${PYSITELIB}/xen/xend/sxp.py
${PYSITELIB}/xen/xend/sxp.pyc
${PYSITELIB}/xen/xend/util.pyc
${PYSITELIB}/xen/xm/__init__.py
${PYSITELIB}/xen/xm/create.py
${PYSITELIB}/xen/xm/destroy.py
${PYSITELIB}/xen/xm/help.py
${PYSITELIB}/xen/xm/main.py
${PYSITELIB}/xen/xm/migrate.py
${PYSITELIB}/xen/xm/opts.py
${PYSITELIB}/xen/xm/shutdown.py
${PYSITELIB}/xen/xm/sysrq.py
${PYSITELIB}/xen/xm/__init__.pyc
${PYSITELIB}/xen/xm/create.pyc
${PYSITELIB}/xen/xm/destroy.pyc
${PYSITELIB}/xen/xm/help.pyc
${PYSITELIB}/xen/xm/main.pyc
${PYSITELIB}/xen/xm/migrate.pyc
${PYSITELIB}/xen/xm/opts.pyc
${PYSITELIB}/xen/xm/shutdown.pyc
${PYSITELIB}/xen/xm/sysrq.pyc
sbin/netfix
sbin/xend
sbin/xenperf
sbin/xensv
sbin/xfrd
sbin/xm
share/examples/rc.d/xend
share/examples/rc.d/xendomains
share/examples/xen/block-enbd
share/examples/xen/block-file
share/examples/xen/network
share/examples/xen/vif-bridge
share/examples/xen/xend-config.sxp
share/examples/xen/xmexample1
share/examples/xen/xmexample2
share/examples/xen/xmexample3

View File

@@ -0,0 +1,32 @@
$NetBSD: distinfo,v 1.15 2010/05/04 18:55:46 jym Exp $
SHA1 (xen-2.0.7-src.tgz) = 5317100e1e062961e3fee398fccbf023eb8f0337
RMD160 (xen-2.0.7-src.tgz) = db99fb49e592df7229d4d361c48bab1d23a1d725
Size (xen-2.0.7-src.tgz) = 2580390 bytes
SHA1 (patch-aa) = 2c3ca679003895f19f11dcd5038dbfa2de241a74
SHA1 (patch-ab) = ff0df4820e18310bd16ce649e5c8613d88321b35
SHA1 (patch-ac) = 282cfea5db2cdf418f43f3ea04168717fa0158d1
SHA1 (patch-ad) = 6f242d6ad89b4c019cd291313ba8eaa28ae3bfbb
SHA1 (patch-ae) = 673dac9ea547b77804f591139ffc409340b7b31a
SHA1 (patch-af) = 5467e64fbd49d6ca35718d42864ed7b44fe76df3
SHA1 (patch-ag) = 47882dc75a56daa5676e9786810f7edec8281e59
SHA1 (patch-ah) = ee33733289eb6337a2da166201392e3e17e53312
SHA1 (patch-ai) = 868588b3deff152b33489e3e5a24789b3311e1bd
SHA1 (patch-aj) = 91e5242851bedc2769e3729392d089499c0621a4
SHA1 (patch-ak) = ef3d96025784f6de42f0fa5dadb5ff97be47f4a5
SHA1 (patch-al) = d0ccc57b44a08eb787552a0680ea1eed4c1e1f55
SHA1 (patch-am) = 7392057d2da107e935775627afe2498a81903f71
SHA1 (patch-an) = 40e0798b8608a280e45f43b11f449c341b1f5a7b
SHA1 (patch-ap) = 1fb379e7b2ddb7f577d19bbc83cda35e5d265f99
SHA1 (patch-aq) = 96ac4caaa268069ee02962a917f85753515747be
SHA1 (patch-ar) = 850d88aa8b536f2470b967068afe924a03fc496c
SHA1 (patch-as) = 333da168af43dae9a4e8695409cbd006e7fcf097
SHA1 (patch-at) = 0964bc7dd23ff6fcd596d6a8564d9e3033f34563
SHA1 (patch-au) = a5eb7b34d43f57a3e1d4644e98ec571f30c56f5e
SHA1 (patch-av) = 8de5c95093571670f3eedf71684634f999ebda54
SHA1 (patch-aw) = cb66cce69dc7cecb478702108f2905a22ffc3aed
SHA1 (patch-ax) = b4a0b8e06ff7ab6424d5340ee35d8f62243f8e3c
SHA1 (patch-ay) = a77b39b508d05a8276550bccff02e770d27c3f42
SHA1 (patch-az) = 972708387e8f87a2283b123887d6062eabc8bd82
SHA1 (patch-ba) = cd2d822dd74d2d1c531822b1a98506b0964e87a5
SHA1 (patch-bb) = 980885a16c3408db8b7e196c8f6cc17bfd96fa19

View File

@@ -0,0 +1,70 @@
#!/bin/sh
#
# $NetBSD: block-file-nbsd,v 1.3 2006/04/18 15:29:36 jlam Exp $
#
# Usage: block-file bind file [flags]
#
# The file argument is the path to the file to which a vnd(4) device
# will be bound. The flags argument is an optional block of flags
# to modify how the file is bound to the vnd(4) device. The valid
# flags are:
#
# r bind the file as read-only
#
# Usage: block-file unbind node
#
# The node argument is the name of the device node to unbind.
#
case "$1" in
bind)
FILE="$2"
FLAGS="$3"
# Store the list of available vnd(4) devices in ``available_disks'',
# and mark them as ``free''.
#
list=`/bin/ls -1 /dev/vnd[0-9]*d | sed "s,/dev/vnd,,;s,d,," | sort -n`
for i in $list; do
disk="vnd$i"
available_disks="$available_disks $disk"
eval $disk=free
done
# Mark the used vnd(4) devices as ``used''.
for disk in `sysctl hw.disknames`; do
case $disk in
vnd[0-9]*) eval $disk=used ;;
esac
done
vnconfig_flags=
case "$FLAGS" in
*r*) vnconfig_flags="$vnconfig_flags -r" ;;
esac
# Configure the first free vnd(4) device.
for disk in $available_disks; do
eval status=\$$disk
vnconfig_cmd="vnconfig $vnconfig_flags /dev/${disk}d $FILE"
if [ "$status" = "free" ] && \
eval $vnconfig_cmd >/dev/null; then
echo /dev/${disk}d
exit 0
fi
done
exit 1
;;
unbind)
NODE="$2"
vnconfig -u $NODE
exit 0
;;
*)
echo "Unknown command: $1"
echo "Valid commands are: bind, unbind"
exit 1
;;
esac

View File

@@ -0,0 +1,55 @@
#!/bin/sh
#============================================================================
# $NetBSD: network-nbsd,v 1.1 2005/11/08 00:47:35 jlam Exp $
#
# @PKG_SYSCONFDIR@/network
#
# Script for starting and stopping the network configuration for the Xen
# domains. The xend(8) daemon calls a network script when it starts,
# before any guest domains are started. The xend(8) daemon also calls
# a network script when it stops. The script name to use is defined in
# @PKG_SYSCONFDIR@/xend-config.sxp in the ``network-script'' field.
#
# Usage: network start|stop|status [var=value ...]
#
# Actions:
# start Create the network configuration for the Xen domains.
# stop Destroy the network configuration for the Xen domains.
# status Print some network-related information, e.g. ifconfig
# and routes.
#
# This script may be customized so that the "start" action creates the
# bridge device(s) to which the guest domains' vifs should connect.
# However, it is simpler to create any network devices at system startup
# via /etc/ifconfig.* scripts, e.g. if dom0 has a bge0 device and we wish
# to create a bridge0 device:
#
# /etc/ifconfig.bridge0
# ------8<------8<------8<------8<------
# create
# !brconfig $int add bge0 stp bge0 up
# ------>8------>8------>8------>8------
#
#============================================================================
# Exit if anything goes wrong.
set -e
# First arg is the operation.
OP=$1; shift
# Pull variables in args into environment
for arg ; do export "${arg}" ; done
case $OP in
start|stop|status)
# Do nothing
;;
*)
echo 'Invalid command: ' $OP
echo 'Valid commands are: start, stop, status'
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,73 @@
#!/bin/sh
#============================================================================
# $NetBSD: vif-bridge-nbsd,v 1.3 2005/11/08 00:47:35 jlam Exp $
#
# @PKG_SYSCONFDIR@/vif-bridge
#
# Script for configuring a vif in bridged mode with a dom0 interface.
# The xend(8) daemon calls a vif script when bringing a vif up or down.
# The script name to use is defined in @PKG_SYSCONFDIR@/xend-config.sxp
# in the ``vif-script'' field.
#
# Usage: vif-bridge up|down [var=value ...]
#
# Actions:
# up Adds the vif interface to the bridge.
# down Removes the vif interface from the bridge.
#
# Variables:
# domain name of the domain the interface is on (required).
# vifq vif interface name (required).
# mac vif MAC address (required).
# bridge bridge to add the vif to (required).
#
# Example invocation:
#
# vif-bridge up domain=VM1 vif=xvif1.0 mac="ee:14:01:d0:ec:af" bridge=bridge0
#
#============================================================================
# Exit if anything goes wrong
set -e
echo "vif-bridge $*"
# Operation name.
OP=$1; shift
# Pull variables in args into environment
for arg ; do export "${arg}" ; done
# Required parameters. Fail if not set.
domain=${domain:?}
vif=${vif:?}
mac=${mac:?}
bridge=${bridge:?}
# Optional parameters. Set defaults.
ip=${ip:-''} # default to null (do nothing)
# Are we going up or down?
case $OP in
up) brcmd='add' ;;
down) brcmd='delete' ;;
*)
echo 'Invalid command: ' $OP
echo 'Valid commands are: up, down'
exit 1
;;
esac
# Don't do anything if the bridge is "null".
if [ "${bridge}" = "null" ] ; then
exit
fi
# Don't do anything if the bridge doesn't exist.
if ! ifconfig -l | grep "${bridge}" >/dev/null; then
exit
fi
# Add/remove vif to/from bridge.
ifconfig x${vif} $OP
brconfig ${bridge} ${brcmd} x${vif}

View File

@@ -0,0 +1,27 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: xend.sh,v 1.5 2005/11/08 00:47:35 jlam Exp $
#
# PROVIDE: xend
# REQUIRE: disks network
. /etc/rc.subr
name="xend"
rcvar=$name
command="@PREFIX@/sbin/xend"
command_interpreter="@RCD_INTERPRETER@"
start_cmd="@ECHO@ Starting ${name}. && ${command} start"
start_precmd="test_kern_privcmd"
privcmd_path="@PROCPATH@/xen/privcmd"
test_kern_privcmd()
{
if [ ! -f ${privcmd_path} ]; then
@ECHO@ "${name}: Cannot find ${privcmd_path}!"
exit 1
fi
}
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,134 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: xendomains.sh,v 1.2 2006/01/15 01:56:48 xtraeme Exp $
#
# PROVIDE: xendomains
# REQUIRE: xend
# KEYWORD: shutdown
#
# xendomains This required variable is a whitespace-separated
# list of domains, e.g., xendomains="dom1 dom2 dom3".
#
# xendomains_config This optional variable is a format string that
# represents the path to the configuration file for
# each domain. "%s" is substituted with the name of
# the domain. The default is "@PKG_SYSCONFDIR@/%s".
#
# xendomains_prehook This optional variable is a format string that
# represents the command to run, if it exists, before
# starting each domain. "%s" is substituted with the
# name of the domain. The default is
# "@PKG_SYSCONFDIR@/%s-pre".
#
# xendomains_posthook This optional variable is a format string that
# represents the command to run, if it exists, after
# stopping each domain. "%s" is substituted with the
# name of the domain. The default is
# "@PKG_SYSCONFDIR@/%s-post".
#
. /etc/rc.subr
name="xendomains"
ctl_command="@PREFIX@/sbin/xm"
start_cmd="xendomains_start"
stop_cmd="xendomains_stop"
list_cmd="xendomains_list"
extra_commands="list"
privcmd_path="@PROCPATH@/xen/privcmd"
xendomains_start()
{
[ -n "$xendomains" ] || return
if [ ! -f ${privcmd_path} ]; then
echo "${name}: Cannot find ${privcmd_path}!"
exit 1
fi
echo "Starting xen domains."
for domain in $xendomains; do
case "$domain" in
"") continue ;;
esac
# Start off by running the pre-hook script if it's present.
if [ -n "${xendomains_prehook}" ]; then
cmdline=`printf "${xendomains_prehook}" $domain`
cmd="${cmdline%% *}"
if [ -x "$cmd" ]; then
$cmdline || echo "Pre-hook \`\`$cmdline'' failed... skipping $domain."
continue
fi
fi
# Ask xend to create the domain.
if [ -n "${xendomains_config}" ]; then
file=`printf "${xendomains_config}" $domain`
if [ -f "$file" ]; then
${ctl_command} create "$file"
fi
fi
done
}
xendomains_list() {
# Output a whitespace-separated list of live guest domains.
${ctl_command} list | awk '
(FNR <= 2) { next }
($5 !~ /s/) { s = s " " $1 }
END { sub(" *", "", s); print s }'
}
xendomains_stop()
{
# Determine an appropriate timeout waiting for all domains to
# stop -- always wait at least 60s, and add 5s per active domain.
#
numdomains=$(xendomains_list | awk '{ print NF }')
[ $numdomains -gt 0 ] || return
timeout=$((60 + numdomains * 5))
# Ask xend to stop every domain, and poll xend every 10s up to the
# timeout period to check if all the domains are stopped. We
# consider a domain in the "s" (shutdown) state to be stopped.
#
echo "Stopping xen domains."
for domain in $(xendomains_list); do
${ctl_command} shutdown --halt $domain
done
while [ $timeout -gt 0 ]; do
livedomains=$(xendomains_list)
[ -n "$livedomains" ] || break
timeout=$((timeout - 10))
sleep 10
done
livedomains=$(xendomains_list)
if [ -n "$livedomains" ]; then
echo "Failed to stop: $livedomains"
else
echo "All domains stopped."
fi
# Finish off by running the post-hook script if it's present.
for domain in $xendomains; do
case "$domain" in
"") continue ;;
esac
if [ -n "${xendomains_posthook}" ]; then
cmdline=`printf "${xendomains_posthook}" $domain`
cmd="${cmdline%% *}"
if [ -x "$cmd" ]; then
$cmdline || echo "Post-hook \`\`$cmdline'' failed."
fi
fi
done
}
load_rc_config $name
: ${xendomains_config="@PKG_SYSCONFDIR@/%s"}
: ${xendomains_prehook="@PKG_SYSCONFDIR@/%s-pre"}
: ${xendomains_posthook="@PKG_SYSCONFDIR@/%s-post"}
run_rc_command "$1"

View File

@@ -0,0 +1,105 @@
/* NetBSD: xenio.h,v 1.3 2005/05/24 12:07:12 yamt Exp $ */
/******************************************************************************
* privcmd.h
*
* Copyright (c) 2003-2004, K A Fraser
*
* This file may be distributed separately from the Linux kernel, or
* incorporated into other software packages, subject to the following license:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this source file (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef __PRIVCMD_H__
#define __PRIVCMD_H__
/* Interface to /proc/xen/privcmd */
typedef struct privcmd_hypercall
{
unsigned long op;
unsigned long arg[5];
} privcmd_hypercall_t;
typedef struct privcmd_mmap_entry {
unsigned long va;
unsigned long mfn;
unsigned long npages;
} privcmd_mmap_entry_t;
typedef struct privcmd_mmap {
int num;
domid_t dom; /* target domain */
privcmd_mmap_entry_t *entry;
} privcmd_mmap_t;
typedef struct privcmd_mmapbatch {
int num; /* number of pages to populate */
domid_t dom; /* target domain */
unsigned long addr; /* virtual address */
unsigned long *arr; /* array of mfns - top nibble set on err */
} privcmd_mmapbatch_t;
typedef struct privcmd_blkmsg
{
unsigned long op;
void *buf;
int buf_size;
} privcmd_blkmsg_t;
/*
* @cmd: IOCTL_PRIVCMD_HYPERCALL
* @arg: &privcmd_hypercall_t
* Return: Value returned from execution of the specified hypercall.
*/
#define IOCTL_PRIVCMD_HYPERCALL \
_IOWR('P', 0, privcmd_hypercall_t)
#if defined(_KERNEL)
/* compat */
#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN_OLD \
_IO('P', 1)
#endif /* defined(_KERNEL) */
#define IOCTL_PRIVCMD_MMAP \
_IOW('P', 2, privcmd_mmap_t)
#define IOCTL_PRIVCMD_MMAPBATCH \
_IOW('P', 3, privcmd_mmapbatch_t)
#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \
_IOR('P', 4, unsigned long)
/*
* @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
* @arg: n/a
* Return: Port associated with domain-controller end of control event channel
* for the initial domain.
*/
#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
_IOR('P', 5, int)
/* Interface to /dev/xenevt */
/* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
#define EVTCHN_RESET _IO('E', 1)
/* EVTCHN_BIND: Bind to the specified event-channel port. */
#define EVTCHN_BIND _IOW('E', 2, unsigned long)
/* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
#define EVTCHN_UNBIND _IOW('E', 3, unsigned long)
#endif /* __PRIVCMD_H__ */

View File

@@ -0,0 +1,32 @@
$NetBSD: patch-aa,v 1.2 2005/05/24 16:02:08 xtraeme Exp $
--- Makefile.orig 2005-05-24 01:59:08.000000000 +0000
+++ Makefile 2005-05-24 01:59:28.000000000 +0000
@@ -5,24 +5,22 @@
SUBDIRS += libxutil
SUBDIRS += libxc
SUBDIRS += misc
-SUBDIRS += examples
-SUBDIRS += xentrace
SUBDIRS += python
SUBDIRS += xfrd
.PHONY: all install clean check check_clean
-all: check
+all:
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done
-install: check
+install:
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done
-clean: check_clean
+clean:
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-ab,v 1.2 2005/07/13 01:28:37 grant Exp $
--- libxc/xc_private.h.orig 2005-05-22 20:56:28.000000000 +1000
+++ libxc/xc_private.h
@@ -16,7 +16,11 @@
#include "xc.h"
+#ifdef __NetBSD__
+#include <xen/NetBSD/xenio.h>
+#else
#include <xen/linux/privcmd.h>
+#endif
#define _PAGE_PRESENT 0x001
#define _PAGE_RW 0x002

View File

@@ -0,0 +1,122 @@
$NetBSD: patch-ac,v 1.4 2006/11/22 00:12:34 seb Exp $
--- python/xen/lowlevel/xu/xu.c.orig 2005-08-03 23:57:58.000000000 +0000
+++ python/xen/lowlevel/xu/xu.c
@@ -15,7 +15,9 @@
#include <sys/socket.h>
#include <sys/mman.h>
#include <sys/poll.h>
+#ifndef __NetBSD__
#include <sys/sysmacros.h>
+#endif
#include <netinet/in.h>
#include <fcntl.h>
#include <unistd.h>
@@ -25,7 +27,11 @@
#include <xen/xen.h>
#include <xen/io/domain_controller.h>
+#ifdef __NetBSD__
+#include <xen/NetBSD/xenio.h>
+#else
#include <xen/linux/privcmd.h>
+#endif
#define XENPKG "xen.lowlevel.xu"
@@ -35,6 +41,9 @@
#endif
/* NB. The following should be kept in sync with the kernel's evtchn driver. */
+#ifdef __NetBSD__
+#define EVTCHN_DEV_NAME "/dev/xenevt"
+#else
#define EVTCHN_DEV_NAME "/dev/xen/evtchn"
#define EVTCHN_DEV_MAJOR 10
#define EVTCHN_DEV_MINOR 201
@@ -45,6 +54,7 @@
#define EVTCHN_BIND _IO('E', 2)
/* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
#define EVTCHN_UNBIND _IO('E', 3)
+#endif
/* Size of a machine page frame. */
#define PAGE_SIZE 4096
@@ -130,7 +140,11 @@ static PyObject *xu_notifier_bind(PyObje
if ( !PyArg_ParseTuple(args, "i", &idx) )
return NULL;
+#ifdef __NetBSD__
+ if ( ioctl(xun->evtchn_fd, EVTCHN_BIND, &idx) != 0 )
+#else
if ( ioctl(xun->evtchn_fd, EVTCHN_BIND, idx) != 0 )
+#endif
return PyErr_SetFromErrno(PyExc_IOError);
Py_INCREF(Py_None);
@@ -145,7 +159,11 @@ static PyObject *xu_notifier_unbind(PyOb
if ( !PyArg_ParseTuple(args, "i", &idx) )
return NULL;
+#ifdef __NetBSD__
+ if ( ioctl(xun->evtchn_fd, EVTCHN_UNBIND, &idx) != 0 )
+#else
if ( ioctl(xun->evtchn_fd, EVTCHN_UNBIND, idx) != 0 )
+#endif
return PyErr_SetFromErrno(PyExc_IOError);
Py_INCREF(Py_None);
@@ -192,13 +210,16 @@ staticforward PyTypeObject xu_notifier_t
static PyObject *xu_notifier_new(PyObject *self, PyObject *args)
{
xu_notifier_object *xun;
+#ifndef __NetBSD__
struct stat st;
+#endif
if ( !PyArg_ParseTuple(args, "") )
return NULL;
xun = PyObject_New(xu_notifier_object, &xu_notifier_type);
+#ifndef __NetBSD__
/* Make sure any existing device file links to correct device. */
if ( (lstat(EVTCHN_DEV_NAME, &st) != 0) ||
!S_ISCHR(st.st_mode) ||
@@ -206,14 +227,17 @@ static PyObject *xu_notifier_new(PyObjec
(void)unlink(EVTCHN_DEV_NAME);
reopen:
+#endif
xun->evtchn_fd = open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
if ( xun->evtchn_fd == -1 )
{
+#ifndef __NetBSD__
if ( (errno == ENOENT) &&
((mkdir("/dev/xen", 0755) == 0) || (errno == EEXIST)) &&
(mknod(EVTCHN_DEV_NAME, S_IFCHR|0600,
makedev(EVTCHN_DEV_MAJOR,EVTCHN_DEV_MINOR)) == 0) )
goto reopen;
+#endif
PyObject_Del((PyObject *)xun);
return PyErr_SetFromErrno(PyExc_IOError);
}
@@ -508,7 +532,7 @@ static PyObject *xu_message_get_payload(
return dict;
}
- return PyString_FromStringAndSize(xum->msg.msg, xum->msg.length);
+ return PyString_FromStringAndSize((char *)xum->msg.msg, xum->msg.length);
}
static PyObject *xu_message_get_header(PyObject *self, PyObject *args)
@@ -1110,7 +1134,8 @@ static PyObject *xu_port_new(PyObject *s
* The control-interface event channel for DOM0 is already set up.
* We use an ioctl to discover the port at our end of the channel.
*/
- port1 = ioctl(xup->xc_handle, IOCTL_PRIVCMD_INITDOMAIN_EVTCHN, NULL);
+ if (ioctl(xup->xc_handle, IOCTL_PRIVCMD_INITDOMAIN_EVTCHN, &port1))
+ port1 = -1;
port2 = -1; /* We don't need the remote end of the DOM0 link. */
if ( port1 < 0 )
{

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-ad,v 1.2 2005/05/24 16:02:08 xtraeme Exp $
--- xfrd/Makefile.orig 2005-05-24 00:25:29.000000000 +0000
+++ xfrd/Makefile 2005-05-24 00:26:27.000000000 +0000
@@ -11,7 +11,7 @@
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
-XFRD_INSTALL_DIR = /usr/sbin
+XFRD_INSTALL_DIR = $(PREFIX)/sbin
vpath %.h $(XEN_LIBXC)
INCLUDES += -I $(XEN_LIBXC)
@@ -50,7 +50,7 @@
XFRD_LIBS :=
XFRD_LIBS += -L $(XEN_LIBXC) -lxc
-XFRD_LIBS += -L $(XEN_LIBXUTIL) -lxutil
+XFRD_LIBS += -L $(XEN_LIBXUTIL) $(LDFLAGS) -lxutil
# zlib library.
XFRD_LIBS += -lz

View File

@@ -0,0 +1,63 @@
$NetBSD: patch-ae,v 1.3 2006/11/22 00:12:34 seb Exp $
--- xfrd/xfrd.c.orig 2005-08-03 23:57:58.000000000 +0000
+++ xfrd/xfrd.c
@@ -481,9 +481,9 @@ int xfr_hello(Conn *conn){
err = -EINVAL;
goto exit;
}
- err = intof(sxpr_childN(sxpr, 0, ONONE), &hello_major);
+ err = intof(sxpr_childN(sxpr, 0, ONONE), (int *)&hello_major);
if(err) goto exit;
- err = intof(sxpr_childN(sxpr, 1, ONONE), &hello_minor);
+ err = intof(sxpr_childN(sxpr, 1, ONONE), (int *)&hello_minor);
if(err) goto exit;
if(hello_major != major || hello_minor != minor){
eprintf("> Wanted protocol version %d.%d, got %d.%d",
@@ -646,7 +646,7 @@ int xfr_send_state(XfrState *state, Conn
if(!err) err = errcode;
} else if(sxpr_elementp(sxpr, oxfr_xfr_ok)){
// Ok - get the new domain id.
- err = intof(sxpr_childN(sxpr, 0, ONONE), &state->vmid_new);
+ err = intof(sxpr_childN(sxpr, 0, ONONE), (int *)&state->vmid_new);
xfr_error(peer, err);
} else {
// Anything else is invalid. But it may be too late.
@@ -917,7 +917,7 @@ int xfrd_service(Args *args, int peersoc
int n = 0;
dprintf("> xfr.migrate\n");
- err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
+ err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
if(err) goto exit;
err = stringof(sxpr_childN(sxpr, n++, ONONE), &state->vmconfig);
if(err) goto exit;
@@ -939,7 +939,7 @@ int xfrd_service(Args *args, int peersoc
int n = 0;
dprintf("> xfr.save\n");
- err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
+ err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
if(err) goto exit;
err = stringof(sxpr_childN(sxpr, n++, ONONE), &state->vmconfig);
if(err) goto exit;
@@ -965,7 +965,7 @@ int xfrd_service(Args *args, int peersoc
int n = 0;
dprintf("> xfr.xfr\n");
- err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
+ err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
if(err) goto exit;
err = xfr_recv(args, state, conn);
@@ -1230,8 +1230,8 @@ int main(int argc, char *argv[]){
#ifndef DEBUG
freopen(LOGFILE, "w+", stdout);
- fclose(stderr);
- stderr = stdout;
+ close(2);
+ dup2(1,2);
#endif
dprintf(">\n");
set_defaults(args);

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-af,v 1.2 2005/05/23 18:05:16 xtraeme Exp $
--- xfrd/select.c.orig 2005-01-12 13:22:21.000000000 +0100
+++ xfrd/select.c 2005-05-23 20:01:54.000000000 +0200
@@ -1,6 +1,8 @@
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
+#include <string.h>
+#include <sys/select.h>
#include "select.h"

View File

@@ -0,0 +1,25 @@
$NetBSD: patch-ag,v 1.3 2010/05/04 18:55:46 jym Exp $
--- misc/Makefile.orig 2005-05-24 00:28:15.000000000 +0000
+++ misc/Makefile 2005-05-24 00:30:05.000000000 +0000
@@ -24,10 +24,10 @@
$(MAKE) -C miniterm
install: build
- [ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
- [ -d $(DESTDIR)/usr/sbin ] || $(INSTALL_DIR) $(DESTDIR)/usr/sbin
- $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
- $(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin
+ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(PREFIX)/sbin
+ $(BSD_INSTALL_SCRIPT) $(INSTALL_BIN) $(DESTDIR)$(PREFIX)/bin
+ $(BSD_INSTALL_SCRIPT) $(INSTALL_SBIN) $(DESTDIR)$(PREFIX)/sbin
# No sense in installing miniterm on the Xen box.
# $(MAKE) -C miniterm install
@@ -39,4 +39,4 @@
$(CC) -c $(CFLAGS) -o $@ $<
$(TARGETS): %: %.o Makefile
- $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc -L$(XEN_LIBXUTIL) -lxutil
+ $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc -L$(XEN_LIBXUTIL) $(LDFLAGS) -lxutil

View File

@@ -0,0 +1,33 @@
$NetBSD: patch-ah,v 1.3 2010/05/04 18:55:46 jym Exp $
--- libxc/Makefile.orig 2005-05-24 00:31:07.000000000 +0000
+++ libxc/Makefile 2005-05-24 00:34:06.000000000 +0000
@@ -68,13 +68,13 @@
ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
install: build
- [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) $(DESTDIR)/usr/lib
- [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
- $(INSTALL_PROG) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib
- $(INSTALL_DATA) libxc.a $(DESTDIR)/usr/lib
- ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/libxc.so.$(MAJOR)
- ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/lib/libxc.so
- $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
+ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(PREFIX)/lib
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(PREFIX)/include
+ $(BSD_INSTALL_LIB) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)/lib
+ $(BSD_INSTALL_LIB) libxc.a $(DESTDIR)$(PREFIX)/lib
+ ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)/lib/libxc.so.$(MAJOR)
+ ln -sf libxc.so.$(MAJOR) $(DESTDIR)$(PREFIX)/lib/libxc.so
+ $(BSD_INSTALL_DATA) xc.h $(DESTDIR)$(PREFIX)/include
clean:
rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
@@ -97,6 +97,6 @@
ln -sf $< $@
libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
- $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
+ $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil $(LDFLAGS) -lxutil -lz
-include $(DEPS)

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ai,v 1.3 2006/11/22 00:12:34 seb Exp $
--- libxc/xc_linux_build.c.orig 2005-08-03 23:57:57.000000000 +0000
+++ libxc/xc_linux_build.c
@@ -324,7 +324,7 @@ static int setup_guestos(int xc_handle,
start_info->mod_start = vinitrd_start;
start_info->mod_len = initrd_len;
}
- strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
+ strncpy((char *)start_info->cmd_line, cmdline, MAX_CMDLINE);
start_info->cmd_line[MAX_CMDLINE-1] = '\0';
munmap(start_info, PAGE_SIZE);

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-aj,v 1.3 2010/05/04 18:55:46 jym Exp $
--- libxutil/Makefile.orig 2005-05-24 00:36:28.000000000 +0000
+++ libxutil/Makefile 2005-05-24 00:38:14.000000000 +0000
@@ -65,11 +65,11 @@
fi
install: build
- [ -d $(DESTDIR)/usr/lib ] || $(INSTALL_DIR) -p $(DESTDIR)/usr/lib
- $(INSTALL_PROG) libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib
- $(INSTALL_DATA) libxutil.a $(DESTDIR)/usr/lib
- ln -sf libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/libxutil.so.$(MAJOR)
- ln -sf libxutil.so.$(MAJOR) $(DESTDIR)/usr/lib/libxutil.so
+ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(PREFIX)/lib
+ $(BSD_INSTALL_LIB) libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)/lib
+ $(BSD_INSTALL_LIB) libxutil.a $(DESTDIR)$(PREFIX)/lib
+ ln -sf libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)/lib/libxutil.so.$(MAJOR)
+ ln -sf libxutil.so.$(MAJOR) $(DESTDIR)$(PREFIX)/lib/libxutil.so
clean:
$(RM) *.a *.so* *.o *.opic *.rpm

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ak,v 1.3 2010/05/04 18:55:46 jym Exp $
--- misc/miniterm/Makefile.orig 2005-05-24 00:38:57.000000000 +0000
+++ misc/miniterm/Makefile 2005-05-24 00:39:42.000000000 +0000
@@ -9,8 +9,8 @@
all: $(TARGET)
install: all
- [ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
- $(INSTALL_PROG) $(TARGET) $(DESTDIR)/usr/bin
+ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(PREFIX)/bin
clean:
$(RM) *.o $(TARGET) *~

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-al,v 1.3 2010/05/04 18:55:46 jym Exp $
--- python/Makefile.orig 2005-05-22 10:56:26.000000000 +0000
+++ python/Makefile 2005-05-24 01:26:40.000000000 +0000
@@ -4,14 +4,14 @@
all: build
build:
- CFLAGS="$(CFLAGS)" python setup.py build
+ python setup.py build
ifndef XEN_PYTHON_NATIVE_INSTALL
install: all
- CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr"
+ python setup.py install --root="$(DESTDIR)"
else
install: all
- CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)"
+ python setup.py install --root="$(DESTDIR)"
endif
clean:

View File

@@ -0,0 +1,10 @@
$NetBSD: patch-am,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $
--- x2d2/Makefile.orig 2005-01-22 18:45:34.000000000 +0100
+++ x2d2/Makefile 2005-01-22 18:45:09.000000000 +0100
@@ -19,4 +19,4 @@
$(RM) *.a *.so *.o *.rpm $(BIN)
$(BIN): $(OBJS)
- $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -lxc -lxutil -lpthread
+ $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) $(LDFLAGS) -lxc -lxutil -lpthread

View File

@@ -0,0 +1,47 @@
$NetBSD: patch-an,v 1.3 2006/11/22 00:12:34 seb Exp $
--- libxc/xc_plan9_build.c.orig 2005-08-03 23:57:57.000000000 +0000
+++ libxc/xc_plan9_build.c
@@ -108,14 +108,14 @@ void
plan9header(Exec * header)
{
/* header is big-endian */
- swabby(&header->magic, "magic");
- swabby(&header->text, "text");
- swabby(&header->data, "data");
- swabby(&header->bss, "bss");
- swabby(&header->syms, "syms");
- swabby(&header->entry, "entry");
- swabby(&header->spsz, "spsz");
- swabby(&header->pcsz, "pcsz");
+ swabby((unsigned long *)&header->magic, "magic");
+ swabby((unsigned long *)&header->text, "text");
+ swabby((unsigned long *)&header->data, "data");
+ swabby((unsigned long *)&header->bss, "bss");
+ swabby((unsigned long *)&header->syms, "syms");
+ swabby((unsigned long *)&header->entry, "entry");
+ swabby((unsigned long *)&header->spsz, "spsz");
+ swabby((unsigned long *)&header->pcsz, "pcsz");
}
@@ -205,8 +205,8 @@ setup_guestos(int xc_handle,
unsigned long ksize;
mmu_t *mmu = NULL;
int i;
- unsigned long first_page_after_kernel,
- first_data_page,
+ unsigned long first_page_after_kernel = 0,
+ first_data_page = 0,
page_array_page;
unsigned long cpu0pdb, cpu0pte, cpu0ptelast;
unsigned long /*last_pfn, */ tot_pte_pages;
@@ -431,7 +431,7 @@ setup_guestos(int xc_handle,
start_info->flags = 0;
DPRINTF((" control event channel is %d\n", control_evtchn));
start_info->domain_controller_evtchn = control_evtchn;
- strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
+ strncpy((char *)start_info->cmd_line, cmdline, MAX_CMDLINE);
start_info->cmd_line[MAX_CMDLINE - 1] = '\0';
munmap(start_info, PAGE_SIZE);

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ap,v 1.3 2006/11/22 00:12:34 seb Exp $
--- xfrd/lzi_stream.c.orig 2005-08-03 23:57:58.000000000 +0000
+++ xfrd/lzi_stream.c
@@ -242,7 +242,7 @@ int read_block(LZIState *s){
int err = 0, k = 0;
//dprintf(">\n");
if(s->eof) goto exit;
- err = unmarshal_uint32(s->io, &k);
+ err = unmarshal_uint32(s->io, (uint32_t *)&k);
if(err) goto exit;
if(k > s->inbuf_size){
err = -EINVAL;

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-aq,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $
--- x2d2/minixend.c.orig 2005-01-31 14:45:08.000000000 +0100
+++ x2d2/minixend.c 2005-01-31 14:46:00.000000000 +0100
@@ -913,10 +913,15 @@
xc_handle = xc_interface_open();
listen_fd = start_listening();
-
+#ifdef __NetBSD__
+ evtchn_fd = open("/dev/xenevt", O_RDWR);
+ if (evtchn_fd < 0)
+ err(1, "openning /dev/xenevt");
+#else
evtchn_fd = open("/dev/xen/evtchn", O_RDWR);
if (evtchn_fd < 0)
err(1, "openning /dev/xen/evtchn");
+#endif
dom0 = find_dom0();

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-ar,v 1.3 2006/11/22 00:12:34 seb Exp $
--- xfrd/marshal.c.orig 2005-08-03 23:57:58.000000000 +0000
+++ xfrd/marshal.c
@@ -166,7 +166,7 @@ int marshal_string(IOStream *io, char *s
int unmarshal_string(IOStream *io, char *s, uint32_t s_n){
int err = 0, val_n = 0;
//dprintf(">\n");
- err = unmarshal_uint32(io, &val_n);
+ err = unmarshal_uint32(io, (uint32_t *)&val_n);
if(err) goto exit;
if(val_n >= s_n){
err = -EINVAL;
@@ -184,7 +184,7 @@ int unmarshal_new_string(IOStream *io, c
int err = 0, val_n = 0;
char *val = NULL;
//dprintf(">\n");
- err = unmarshal_uint32(io, &val_n);
+ err = unmarshal_uint32(io, (uint32_t *)&val_n);
if(err) goto exit;
val = allocate(val_n + 1);
if(!val){

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-as,v 1.1 2005/05/23 22:02:04 bouyer Exp $
--- libxc/xc_private.c.orig 2005-01-12 13:22:19.000000000 +0100
+++ libxc/xc_private.c 2005-05-23 23:37:15.000000000 +0200
@@ -11,7 +11,7 @@
{
privcmd_mmapbatch_t ioctlx;
void *addr;
- addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_SHARED, xc_handle, 0);
+ addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
if ( addr != NULL )
{
ioctlx.num=num;
@@ -38,7 +38,7 @@
privcmd_mmap_t ioctlx;
privcmd_mmap_entry_t entry;
void *addr;
- addr = mmap(NULL, size, prot, MAP_SHARED, xc_handle, 0);
+ addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
if ( addr != NULL )
{
ioctlx.num=1;

View File

@@ -0,0 +1,24 @@
$NetBSD: patch-at,v 1.1 2005/05/24 16:02:08 xtraeme Exp $
--- python/xen/xend/XendRoot.py.orig 2005-05-24 06:36:02.000000000 +0200
+++ python/xen/xend/XendRoot.py 2005-05-24 06:36:47.000000000 +0200
@@ -28,16 +28,16 @@
dbroot_default = "/var/lib/xen/xend-db"
"""Default path to the config file."""
- config_default = "/etc/xen/xend-config.sxp"
+ config_default = "@XENDCONFDIR@/xend-config.sxp"
"""Environment variable used to override config_default."""
config_var = "XEND_CONFIG"
"""Where network control scripts live."""
- network_script_dir = "/etc/xen/scripts"
+ network_script_dir = "@XENDCONFDIR@"
"""Where block control scripts live."""
- block_script_dir = "/etc/xen/scripts"
+ block_script_dir = "@XENDCONFDIR@"
"""Default path to the log file. """
logfile_default = "/var/log/xend.log"

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-au,v 1.1 2005/08/19 13:06:31 bouyer Exp $
--- python/xen/xend/XendDomain.py.orig 2005-08-13 01:54:56.000000000 -0400
+++ python/xen/xend/XendDomain.py 2005-08-13 01:55:17.000000000 -0400
@@ -147,7 +147,10 @@
domid = str(d['dom'])
doms[domid] = d
dlist = []
- for config in self.domain_db.values():
+ domkeys = map(int, self.domain_db.keys())
+ domkeys.sort()
+ for domkey in domkeys:
+ config = self.domain_db.get(str(domkey))
domid = str(sxp.child_value(config, 'id'))
if domid in doms:
d_dom = self._new_domain(config, doms[domid])

View File

@@ -0,0 +1,35 @@
$NetBSD: patch-av,v 1.1 2005/09/10 15:54:39 bouyer Exp $
--- libxc/xc_linux_save.c.orig 2005-08-03 19:57:57.000000000 -0400
+++ libxc/xc_linux_save.c 2005-09-06 23:23:44.000000000 -0400
@@ -850,11 +850,10 @@
} /* end of the write out for this batch */
sent_this_iter += batch;
+ munmap(region_base, batch*PAGE_SIZE);
} /* end of this while loop for this iteration */
- munmap(region_base, batch*PAGE_SIZE);
-
skip:
total_sent += sent_this_iter;
@@ -950,7 +949,7 @@
for ( i = 0, j = 0; i < nr_pfns; i++ )
{
- if ( ! is_mapped(live_pfn_to_mfn_table[i]) )
+ if ( ! is_mapped(live_pfn_to_mfn_table[i]) && !test_bit(i, to_fix) )
j++;
}
@@ -962,7 +961,7 @@
for ( i = 0, j = 0; i < nr_pfns; )
{
- if ( ! is_mapped(live_pfn_to_mfn_table[i]) )
+ if ( ! is_mapped(live_pfn_to_mfn_table[i]) && !test_bit(i, to_fix) )
{
pfntab[j++] = i;
}

View File

@@ -0,0 +1,59 @@
$NetBSD: patch-aw,v 1.1 2005/09/16 18:14:49 bouyer Exp $
--- libxutil/file_stream.c.orig 2005-09-13 17:02:16.000000000 -0400
+++ libxutil/file_stream.c 2005-09-13 17:31:39.000000000 -0400
@@ -21,11 +21,13 @@
*/
#ifndef __KERNEL__
#include <stdio.h>
+#include <unistd.h>
#include <stdlib.h>
#include "allocate.h"
#include "file_stream.h"
static int file_read(IOStream *s, void *buf, size_t n);
+static int file_read_nbuf(IOStream *s, void* buf, size_t n);
static int file_write(IOStream *s, const void *buf, size_t n);
static int file_error(IOStream *s);
static int file_close(IOStream *s);
@@ -42,6 +44,16 @@
flush: file_flush,
};
+/** Methods used by a FILE* IOStream that's unbuffered. */
+static const IOMethods file_methods_nbuf = {
+ read: file_read_nbuf,
+ write: file_write,
+ error: file_error,
+ close: file_close,
+ free: file_free,
+ flush: file_flush,
+};
+
/** IOStream for stdin. */
static IOStream _iostdin = {
methods: &file_methods,
@@ -102,6 +114,7 @@
* @return 0 on success, non-zero otherwise
*/
int file_stream_setvbuf(IOStream *io, char *buf, int mode, size_t size){
+ io->methods = (mode == _IONBF) ? &file_methods_nbuf : &file_methods;
return setvbuf(get_file(io), buf, mode, size);
}
@@ -126,6 +139,15 @@
static int file_read(IOStream *s, void *buf, size_t n){
return fread(buf, 1, n, get_file(s));
}
+static int file_read_nbuf(IOStream *s, void *buf, size_t n){
+ int fd = fileno(get_file(s)), rv, nr=0;
+ while(n > nr) {
+ rv = read(fd, buf+nr, n-nr);
+ if (rv <= 0) break;
+ nr += rv;
+ }
+ return nr;
+}
/** Fush the underlying stream using fflush().
*

View File

@@ -0,0 +1,29 @@
$NetBSD: patch-ax,v 1.1 2006/10/15 23:34:02 seb Exp $
--- examples/network.orig 2005-08-03 23:57:57.000000000 +0000
+++ examples/network
@@ -158,7 +158,7 @@ show_status () {
}
op_start () {
- if [ "${bridge}" == "null" ] ; then
+ if [ "${bridge}" = "null" ] ; then
return
fi
@@ -190,13 +190,13 @@ op_start () {
# Attach the real interface to the bridge.
add_to_bridge ${bridge} ${netdev}
- if [ ${antispoof} == 'yes' ] ; then
+ if [ ${antispoof} = 'yes' ] ; then
antispoofing ${netdev} ${bridge}
fi
}
op_stop () {
- if [ "${bridge}" == "null" ] ; then
+ if [ "${bridge}" = "null" ] ; then
return
fi

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-ay,v 1.1 2006/10/15 23:34:02 seb Exp $
--- vnet/examples/network-vnet.orig 2005-08-03 23:57:58.000000000 +0000
+++ vnet/examples/network-vnet
@@ -154,7 +154,7 @@ vnet_insert () {
break
fi
done
- if [ "${mod_obj}" == "" ] ; then
+ if [ "${mod_obj}" = "" ] ; then
return
fi
if lsmod | grep -q ${module} ; then
@@ -166,7 +166,7 @@ vnet_insert () {
}
op_start () {
- if [ "${bridge}" == "null" ] ; then
+ if [ "${bridge}" = "null" ] ; then
return
fi
# Create the bridge and give it the interface IP addresses.
@@ -179,7 +179,7 @@ op_start () {
brctl addif ${bridge} ${netdev}
fi
- if [ ${antispoof} == 'yes' ] ; then
+ if [ ${antispoof} = 'yes' ] ; then
antispoofing ${netdev} ${bridge}
fi
@@ -187,7 +187,7 @@ op_start () {
}
op_stop () {
- if [ "${bridge}" == "null" ] ; then
+ if [ "${bridge}" = "null" ] ; then
return
fi
# Remove the interface from the bridge.

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-az,v 1.1 2006/10/15 23:34:02 seb Exp $
--- examples/vif-bridge.orig 2005-08-03 23:57:57.000000000 +0000
+++ examples/vif-bridge
@@ -70,7 +70,7 @@ case $OP in
esac
# Don't do anything if the bridge is "null".
-if [ "${bridge}" == "null" ] ; then
+if [ "${bridge}" = "null" ] ; then
exit
fi

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ba,v 1.1 2006/11/22 00:12:34 seb Exp $
--- xfrd/xdr.c.orig 2005-08-03 23:57:58.000000000 +0000
+++ xfrd/xdr.c
@@ -283,7 +283,7 @@ int unpack_sxpr(IOStream *io, Sxpr *x){
err = unpack_cons(io, &val);
break;
case T_BOOL:
- err = unpack_bool(io, &u);
+ err = unpack_bool(io, (int *)&u);
if(err) goto exit;
val = (u ? OTRUE : OFALSE);
break;

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-bb,v 1.1 2006/11/22 00:12:34 seb Exp $
--- xfrd/xen_domain.c.orig 2005-08-03 23:57:58.000000000 +0000
+++ xfrd/xen_domain.c
@@ -223,9 +223,11 @@ static int curlsetup(CURL **pcurl, struc
#else
// No progress meter.
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
+#if defined(CURLOPT_MUTE)
// Completely quiet.
curl_easy_setopt(curl, CURLOPT_MUTE, 1);
#endif
+#endif
// Set the URL.
curl_easy_setopt(curl, CURLOPT_URL, url);