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

5
sysutils/xentools3/DESCR Normal file
View File

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

View File

@@ -0,0 +1,17 @@
===========================================================================
$NetBSD: MESSAGE.NetBSD,v 1.2 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}/
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
===========================================================================

210
sysutils/xentools3/Makefile Normal file
View File

@@ -0,0 +1,210 @@
# $NetBSD: Makefile,v 1.35 2013/06/04 07:38:49 wiz Exp $
VERSION= 3.1.4
DISTNAME= xen-${VERSION}
PKGNAME= xentools3-${VERSION}
PKGREVISION= 15
CATEGORIES= sysutils
MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/
MAINTAINER= bouyer@NetBSD.org
HOMEPAGE= http://xen.org/
COMMENT= Userland Tools for Xen
#DEPENDS+= ${PYPKGPREFIX}-twisted-[0-9]*:../../net/py-twisted
DEPENDS+= ${PYPKGPREFIX}-readline-[0-9]*:../../devel/py-readline
DEPENDS+= ${PYPKGPREFIX}-curses>=0nb4:../../devel/py-curses
MAKE_JOBS_SAFE= no
PKG_SYSCONFSUBDIR= xen
ONLY_FOR_PLATFORM= Linux-2.[46]*-i386 Linux-2.[46]*-x86_64
ONLY_FOR_PLATFORM+= NetBSD-*-i386 NetBSD-*-x86_64
CONFLICTS+= libxen-[0-9]*
CONFLICTS+= xentools20-[0-9]*
CONFLICTS+= xentools30-* xentools33-*
CONFLICTS+= xenstoretools-*
WRKSRC= ${WRKDIR}/xen-${VERSION}/tools
CHECK_PORTABILITY_SKIP= examples/* xm-test/ramdisk/make-release.sh
EGDIR= ${PREFIX}/share/examples/xen
MESSAGE_SUBST= EGDIR=${EGDIR}
USE_TOOLS+= perl #for pod2man
USE_TOOLS+= gmake
MAKE_ENV+= CONFIG_NetBSD=yes
MAKE_ENV+= CONFIG_MBOOTPACK=no
MAKE_ENV+= EGDIR=${EGDIR:Q}
MAKE_ENV+= MV=${MV:Q} PYTHON=${PYTHONBIN:Q} SED=${SED:Q}
.if ${MACHINE_ARCH} == "i386"
MAKE_ENV+= XEN_TARGET_ARCH="x86_32" XEN_COMPILE_ARCH="x86_32"
.elif ${MACHINE_ARCH} == "x86_64"
MAKE_ENV+= XEN_TARGET_ARCH="x86_64" XEN_COMPILE_ARCH="x86_64"
.else
MAKE_ENV+= XEN_TARGET_ARCH="unsupported"
.endif
PY_PATCHPLIST= yes
PYTHON_PATCH_SCRIPTS+= misc/xm
PYTHON_PATCH_SCRIPTS+= misc/netfix
PYTHON_PATCH_SCRIPTS+= misc/xen-bugtool
PYTHON_PATCH_SCRIPTS+= misc/xencons
PYTHON_PATCH_SCRIPTS+= misc/xend
PYTHON_PATCH_SCRIPTS+= misc/xensymoops
PYTHON_PATCH_SCRIPTS+= misc/xen-python-path
PYTHON_PATCH_SCRIPTS+= pygrub/src/pygrub
PYTHON_PATCH_SCRIPTS+= python/xen/util/*.py
PYTHON_PATCH_SCRIPTS+= python/xen/xend/*.py
PYTHON_PATCH_SCRIPTS+= python/xen/xm/*.py
PYTHON_PATCH_SCRIPTS+= python/xen/util/*.py
PYTHON_PATCH_SCRIPTS+= python/*.py
PYTHON_PATCH_SCRIPTS+= security/python/xensec_gen/cgi-bin/policy.cgi
PYTHON_PATCH_SCRIPTS+= security/python/xensec_gen/*.py
PYTHON_PATCH_SCRIPTS+= security/python/*.py
PYTHON_PATCH_SCRIPTS+= security/*.py
PYTHON_PATCH_SCRIPTS+= xenmon/*.py
PYTHON_PATCH_SCRIPTS+= xentrace/xentrace_format
SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= ioemu/vl.c
SUBST_SED.paths= -e "s|/usr/sbin|${PREFIX}/sbin|g"
SUBST_MESSAGE.paths= Fixing hardcoded paths.
SUBST_CLASSES+= pathsvar
SUBST_STAGE.pathsvar= pre-configure
SUBST_FILES.pathsvar= examples/init.d/sysconfig.xendomains \
examples/xend-config.sxp \
python/xen/xend/server/relocate.py \
python/xen/xend/XendOptions.py \
security/Makefile security/python/xensec_gen/main.py \
xenstore/xs_lib.c
SUBST_SED.pathsvar= -e "s|/var/lib|${VARBASE}/run|g"
SUBST_CLASSES+= py
SUBST_STAGE.py= pre-configure
SUBST_FILES.py= pygrub/Makefile
SUBST_FILES.py+= python/Makefile
SUBST_FILES.py+= security/Makefile
SUBST_FILES.py+= ../xen/include/public/foreign/Makefile
SUBST_SED.py= -e "s,python,${PYTHONBIN},g"
SUBST_CLASSES+= conf
SUBST_STAGE.conf= pre-configure
SUBST_FILES.conf= python/xen/xend/XendOptions.py
SUBST_FILES.conf+= python/xen/xend/osdep.py
SUBST_FILES.conf+= python/xen/xm/create.py
SUBST_FILES.conf+= python/xen/xm/addlabel.py
SUBST_FILES.conf+= python/xen/xm/getlabel.py
SUBST_FILES.conf+= python/xen/xm/rmlabel.py
SUBST_SED.conf= -e "s,@XENDCONFDIR@,${PKG_SYSCONFDIR},g"
SUBST_CLASSES+= prefix
SUBST_STAGE.prefix= pre-configure
SUBST_FILES.prefix= python/xen/util/auxbin.py
SUBST_FILES.prefix+= python/xen/xend/osdep.py
SUBST_FILES.prefix+= misc/xen-python-path
SUBST_SED.prefix= -e "s,@PREFIX@,${PREFIX},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+= xenstore/xs_lib.c
SUBST_SED.proc= -e "s|/proc|/kern|g"
PROCPATH= /kern
.else
PROCPATH= /proc
.endif
RCD_SCRIPTS= xend xenbackendd xendomains
FILES_SUBST+= RCD_INTERPRETER=${PYTHONBIN:Q}
FILES_SUBST+= PROCPATH=${PROCPATH:Q}
FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
XEND_SCRIPTS= block vif-bridge vif-ip xen-subr
CONF_FILES= ${EGDIR}/xend-config.sxp \
${PKG_SYSCONFDIR}/xend-config.sxp
.for s in ${XEND_SCRIPTS}
CONF_FILES_PERMS+= ${EGDIR}/${s} ${PKG_SYSCONFDIR}/scripts/${s} \
${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
.endfor
OWN_DIRS= ${PKG_SYSCONFDIR}/scripts /var/log/xen
.include "../../mk/compiler.mk"
.if !empty(PKGSRC_COMPILER:Mclang)
EXTRA_HOSTCFLAGS+= -Wno-error=ignored-attributes -Wno-error=format-security
EXTRA_CFLAGS+= -Wno-error=ignored-attributes -no-integrated-as \
-Wno-error=tautological-compare -Wno-error=null-dereference \
-Wno-error=self-assign -Wno-error=sometimes-uninitialized
.endif
MAKE_ENV+= EXTRA_HOSTCFLAGS=${EXTRA_HOSTCFLAGS:Q} EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
pre-build:
.if !exists(/usr/include/xen/xenio.h)
${MKDIR} ${WRKSRC}/libxc/xen
${TEST} -f ${WRKSRC}/libxc/xen/xenio.h || \
${CP} ${FILESDIR}/xenio.h ${WRKSRC}/libxc/xen
${TEST} -f ${WRKSRC}/libxc/xen/xenio3.h || \
${CP} ${FILESDIR}/xenio3.h ${WRKSRC}/libxc/xen
.endif
${CP} ${FILESDIR}/NetBSD.mk ${WRKSRC}/../config/
pod2man ${WRKSRC}/../docs/man/xend-config.sxp.pod.5 |\
sed -e "s,@XENDCONFDIR@,${PKG_SYSCONFDIR},g" \
>${WRKDIR}/xend-config.sxp.5
pod2man ${WRKSRC}/../docs/man/xmdomain.cfg.pod.5 |\
sed -e "s,@XENDCONFDIR@,${PKG_SYSCONFDIR},g" \
>${WRKDIR}/xmdomain.cfg.5
pod2man ${WRKSRC}/../docs/man/xm.pod.1 |\
sed -e "s,@XENDCONFDIR@,${PKG_SYSCONFDIR},g" \
>${WRKDIR}/xm.1
.if ${OPSYS} == "NetBSD"
post-build:
cd ${FILESDIR}; for src in *-nbsd; do \
dst="$${src%-nbsd}"; \
${SED} -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g" \
-e "s|@PREFIX@|${PREFIX}|g" \
$$src > ${WRKSRC}/examples/$$dst; \
done
${CC} ${CFLAGS} ${LDFLAGS} \
-DVBD_SCRIPT=\"${PKG_SYSCONFDIR}/scripts/block\" \
-DLOG_FILE=\"${VARBASE}/log/xenbackendd.log\" \
-DPID_FILE=\"${VARBASE}/run/xenbackendd.pid\" \
-o ${WRKDIR}/xenbackendd.bin ${FILESDIR}/xenbackendd.c \
-I${WRKSRC}/libxc -L${WRKSRC}/libxc \
-I${WRKSRC}/xenstore -L${WRKSRC}/xenstore \
-lxenctrl -lxenstore
.endif
INSTALLATION_DIRS= ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${EGDIR}
post-install:
${INSTALL_PROGRAM} ${WRKDIR}/xenbackendd.bin ${DESTDIR}${PREFIX}/sbin/xenbackendd
for f in xend-config.sxp xmexample1 xmexample2 xmexample3 netbsd1; do \
${INSTALL_DATA} ${WRKSRC}/examples/$$f ${DESTDIR}${EGDIR}/$$f; \
done
.for s in ${XEND_SCRIPTS}
${INSTALL_SCRIPT} ${WRKSRC}/examples/${s} ${DESTDIR}${EGDIR}/${s}
.endfor
${RM} -rf ${DESTDIR}${PREFIX}/lib/xen
${INSTALL_DATA} ${WRKDIR}/xend-config.sxp.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
${INSTALL_DATA} ${WRKDIR}/xmdomain.cfg.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
${INSTALL_DATA} ${WRKDIR}/xm.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.include "../../lang/python/application.mk"
.include "../../lang/python/extension.mk"
.include "../../textproc/py-xml/buildlink3.mk"
#.include "../../devel/zlib/buildlink3.mk"
#.include "../../www/curl/buildlink3.mk"
.include "../../devel/ncurses/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

374
sysutils/xentools3/PLIST Normal file
View File

@@ -0,0 +1,374 @@
@comment $NetBSD: PLIST,v 1.4 2011/01/12 00:11:19 jym Exp $
bin/pygrub
bin/readnotes
bin/xc_restore
bin/xc_save
bin/xencons
bin/xenconsole
bin/xenperf
bin/xenstore-chmod
bin/xenstore-control
bin/xenstore-exists
bin/xenstore-list
bin/xenstore-ls
bin/xenstore-read
bin/xenstore-rm
bin/xenstore-write
bin/xen-detect
include/fsimage.h
include/fsimage_plugin.h
include/fsimage_grub.h
include/xenctrl.h
include/xenguest.h
include/xs.h
include/xs_lib.h
lib/fs/ext2fs/fsimage.so
lib/fs/fat/fsimage.so
lib/fs/iso9660/fsimage.so
lib/fs/reiserfs/fsimage.so
lib/fs/ufs/fsimage.so
lib/libfsimage.so
lib/libfsimage.so.1.0
lib/libfsimage.so.1.0.0
lib/libxenctrl.a
lib/libxenctrl.so
lib/libxenctrl.so.3.0
lib/libxenctrl.so.3.0.0
lib/libxenguest.a
lib/libxenguest.so
lib/libxenguest.so.3.0
lib/libxenguest.so.3.0.0
lib/libxenstore.a
lib/libxenstore.so
lib/libxenstore.so.3.0
lib/libxenstore.so.3.0.0
man/man1/xentop.1
man/man1/xm.1
man/man5/xend-config.sxp.5
man/man5/xmdomain.cfg.5
${PYSITELIB}/fsimage.so
${PYSITELIB}/grub/GrubConf.py
${PYSITELIB}/grub/GrubConf.pyc
${PYSITELIB}/grub/LiloConf.py
${PYSITELIB}/grub/LiloConf.pyc
${PYSITELIB}/grub/__init__.py
${PYSITELIB}/grub/__init__.pyc
${PYSITELIB}/xen/__init__.py
${PYSITELIB}/xen/__init__.pyc
${PYSITELIB}/xen/lowlevel/__init__.py
${PYSITELIB}/xen/lowlevel/__init__.pyc
${PYSITELIB}/xen/lowlevel/acm.so
${PYSITELIB}/xen/lowlevel/ptsname.so
${PYSITELIB}/xen/lowlevel/xc.so
${PYSITELIB}/xen/lowlevel/xs.so
${PYSITELIB}/xen/sv/CreateDomain.py
${PYSITELIB}/xen/sv/CreateDomain.pyc
${PYSITELIB}/xen/sv/DomInfo.py
${PYSITELIB}/xen/sv/DomInfo.pyc
${PYSITELIB}/xen/sv/GenTabbed.py
${PYSITELIB}/xen/sv/GenTabbed.pyc
${PYSITELIB}/xen/sv/HTMLBase.py
${PYSITELIB}/xen/sv/HTMLBase.pyc
${PYSITELIB}/xen/sv/Main.py
${PYSITELIB}/xen/sv/Main.pyc
${PYSITELIB}/xen/sv/NodeInfo.py
${PYSITELIB}/xen/sv/NodeInfo.pyc
${PYSITELIB}/xen/sv/RestoreDomain.py
${PYSITELIB}/xen/sv/RestoreDomain.pyc
${PYSITELIB}/xen/sv/Wizard.py
${PYSITELIB}/xen/sv/Wizard.pyc
${PYSITELIB}/xen/sv/__init__.py
${PYSITELIB}/xen/sv/__init__.pyc
${PYSITELIB}/xen/sv/util.py
${PYSITELIB}/xen/sv/util.pyc
${PYSITELIB}/xen/util/Brctl.py
${PYSITELIB}/xen/util/Brctl.pyc
${PYSITELIB}/xen/util/SSHTransport.py
${PYSITELIB}/xen/util/SSHTransport.pyc
${PYSITELIB}/xen/util/__init__.py
${PYSITELIB}/xen/util/__init__.pyc
${PYSITELIB}/xen/util/asserts.py
${PYSITELIB}/xen/util/asserts.pyc
${PYSITELIB}/xen/util/auxbin.py
${PYSITELIB}/xen/util/auxbin.pyc
${PYSITELIB}/xen/util/blkif.py
${PYSITELIB}/xen/util/blkif.pyc
${PYSITELIB}/xen/util/bugtool.py
${PYSITELIB}/xen/util/bugtool.pyc
${PYSITELIB}/xen/util/diagnose.py
${PYSITELIB}/xen/util/diagnose.pyc
${PYSITELIB}/xen/util/dictio.py
${PYSITELIB}/xen/util/dictio.pyc
${PYSITELIB}/xen/util/ip.py
${PYSITELIB}/xen/util/ip.pyc
${PYSITELIB}/xen/util/mac.py
${PYSITELIB}/xen/util/mac.pyc
${PYSITELIB}/xen/util/mkdir.py
${PYSITELIB}/xen/util/mkdir.pyc
${PYSITELIB}/xen/util/pci.py
${PYSITELIB}/xen/util/pci.pyc
${PYSITELIB}/xen/util/security.py
${PYSITELIB}/xen/util/security.pyc
${PYSITELIB}/xen/util/xmlrpcclient.py
${PYSITELIB}/xen/util/xmlrpcclient.pyc
${PYSITELIB}/xen/util/xmlrpclib2.py
${PYSITELIB}/xen/util/xmlrpclib2.pyc
${PYSITELIB}/xen/util/xpopen.py
${PYSITELIB}/xen/util/xpopen.pyc
${PYSITELIB}/xen/web/SrvBase.py
${PYSITELIB}/xen/web/SrvBase.pyc
${PYSITELIB}/xen/web/SrvDir.py
${PYSITELIB}/xen/web/SrvDir.pyc
${PYSITELIB}/xen/web/__init__.py
${PYSITELIB}/xen/web/__init__.pyc
${PYSITELIB}/xen/web/connection.py
${PYSITELIB}/xen/web/connection.pyc
${PYSITELIB}/xen/web/http.py
${PYSITELIB}/xen/web/http.pyc
${PYSITELIB}/xen/web/httpserver.py
${PYSITELIB}/xen/web/httpserver.pyc
${PYSITELIB}/xen/web/protocol.py
${PYSITELIB}/xen/web/protocol.pyc
${PYSITELIB}/xen/web/resource.py
${PYSITELIB}/xen/web/resource.pyc
${PYSITELIB}/xen/web/static.py
${PYSITELIB}/xen/web/static.pyc
${PYSITELIB}/xen/web/tcp.py
${PYSITELIB}/xen/web/tcp.pyc
${PYSITELIB}/xen/web/unix.py
${PYSITELIB}/xen/web/unix.pyc
${PYSITELIB}/xen/xend/Args.py
${PYSITELIB}/xen/xend/Args.pyc
${PYSITELIB}/xen/xend/PrettyPrint.py
${PYSITELIB}/xen/xend/PrettyPrint.pyc
${PYSITELIB}/xen/xend/Vifctl.py
${PYSITELIB}/xen/xend/Vifctl.pyc
${PYSITELIB}/xen/xend/XendAPI.py
${PYSITELIB}/xen/xend/XendAPI.pyc
${PYSITELIB}/xen/xend/XendAPIConstants.py
${PYSITELIB}/xen/xend/XendAPIConstants.pyc
${PYSITELIB}/xen/xend/XendAPIStore.py
${PYSITELIB}/xen/xend/XendAPIStore.pyc
${PYSITELIB}/xen/xend/XendAPIVersion.py
${PYSITELIB}/xen/xend/XendAPIVersion.pyc
${PYSITELIB}/xen/xend/XendAuthSessions.py
${PYSITELIB}/xen/xend/XendAuthSessions.pyc
${PYSITELIB}/xen/xend/XendBase.py
${PYSITELIB}/xen/xend/XendBase.pyc
${PYSITELIB}/xen/xend/XendBootloader.py
${PYSITELIB}/xen/xend/XendBootloader.pyc
${PYSITELIB}/xen/xend/XendCheckpoint.py
${PYSITELIB}/xen/xend/XendCheckpoint.pyc
${PYSITELIB}/xen/xend/XendClient.py
${PYSITELIB}/xen/xend/XendClient.pyc
${PYSITELIB}/xen/xend/XendConfig.py
${PYSITELIB}/xen/xend/XendConfig.pyc
${PYSITELIB}/xen/xend/XendConstants.py
${PYSITELIB}/xen/xend/XendConstants.pyc
${PYSITELIB}/xen/xend/XendDevices.py
${PYSITELIB}/xen/xend/XendDevices.pyc
${PYSITELIB}/xen/xend/XendDmesg.py
${PYSITELIB}/xen/xend/XendDmesg.pyc
${PYSITELIB}/xen/xend/XendDomain.py
${PYSITELIB}/xen/xend/XendDomain.pyc
${PYSITELIB}/xen/xend/XendDomainInfo.py
${PYSITELIB}/xen/xend/XendDomainInfo.pyc
${PYSITELIB}/xen/xend/XendError.py
${PYSITELIB}/xen/xend/XendError.pyc
${PYSITELIB}/xen/xend/XendLocalStorageRepo.py
${PYSITELIB}/xen/xend/XendLocalStorageRepo.pyc
${PYSITELIB}/xen/xend/XendLogging.py
${PYSITELIB}/xen/xend/XendLogging.pyc
${PYSITELIB}/xen/xend/XendMonitor.py
${PYSITELIB}/xen/xend/XendMonitor.pyc
${PYSITELIB}/xen/xend/XendNetwork.py
${PYSITELIB}/xen/xend/XendNetwork.pyc
${PYSITELIB}/xen/xend/XendNode.py
${PYSITELIB}/xen/xend/XendNode.pyc
${PYSITELIB}/xen/xend/XendOptions.py
${PYSITELIB}/xen/xend/XendOptions.pyc
${PYSITELIB}/xen/xend/XendPBD.py
${PYSITELIB}/xen/xend/XendPBD.pyc
${PYSITELIB}/xen/xend/XendPIF.py
${PYSITELIB}/xen/xend/XendPIF.pyc
${PYSITELIB}/xen/xend/XendPIFMetrics.py
${PYSITELIB}/xen/xend/XendPIFMetrics.pyc
${PYSITELIB}/xen/xend/XendProtocol.py
${PYSITELIB}/xen/xend/XendProtocol.pyc
${PYSITELIB}/xen/xend/XendQCoWStorageRepo.py
${PYSITELIB}/xen/xend/XendQCoWStorageRepo.pyc
${PYSITELIB}/xen/xend/XendStateStore.py
${PYSITELIB}/xen/xend/XendStateStore.pyc
${PYSITELIB}/xen/xend/XendStorageRepository.py
${PYSITELIB}/xen/xend/XendStorageRepository.pyc
${PYSITELIB}/xen/xend/XendTask.py
${PYSITELIB}/xen/xend/XendTask.pyc
${PYSITELIB}/xen/xend/XendTaskManager.py
${PYSITELIB}/xen/xend/XendTaskManager.pyc
${PYSITELIB}/xen/xend/XendVDI.py
${PYSITELIB}/xen/xend/XendVDI.pyc
${PYSITELIB}/xen/xend/XendVMMetrics.py
${PYSITELIB}/xen/xend/XendVMMetrics.pyc
${PYSITELIB}/xen/xend/XendVnet.py
${PYSITELIB}/xen/xend/XendVnet.pyc
${PYSITELIB}/xen/xend/__init__.py
${PYSITELIB}/xen/xend/__init__.pyc
${PYSITELIB}/xen/xend/arch.py
${PYSITELIB}/xen/xend/arch.pyc
${PYSITELIB}/xen/xend/balloon.py
${PYSITELIB}/xen/xend/balloon.pyc
${PYSITELIB}/xen/xend/encode.py
${PYSITELIB}/xen/xend/encode.pyc
${PYSITELIB}/xen/xend/image.py
${PYSITELIB}/xen/xend/image.pyc
${PYSITELIB}/xen/xend/osdep.py
${PYSITELIB}/xen/xend/osdep.pyc
${PYSITELIB}/xen/xend/server/BlktapController.py
${PYSITELIB}/xen/xend/server/BlktapController.pyc
${PYSITELIB}/xen/xend/server/ConsoleController.py
${PYSITELIB}/xen/xend/server/ConsoleController.pyc
${PYSITELIB}/xen/xend/server/DevController.py
${PYSITELIB}/xen/xend/server/DevController.pyc
${PYSITELIB}/xen/xend/server/SSLXMLRPCServer.py
${PYSITELIB}/xen/xend/server/SSLXMLRPCServer.pyc
${PYSITELIB}/xen/xend/server/SrvDaemon.py
${PYSITELIB}/xen/xend/server/SrvDaemon.pyc
${PYSITELIB}/xen/xend/server/SrvDmesg.py
${PYSITELIB}/xen/xend/server/SrvDmesg.pyc
${PYSITELIB}/xen/xend/server/SrvDomain.py
${PYSITELIB}/xen/xend/server/SrvDomain.pyc
${PYSITELIB}/xen/xend/server/SrvDomainDir.py
${PYSITELIB}/xen/xend/server/SrvDomainDir.pyc
${PYSITELIB}/xen/xend/server/SrvNode.py
${PYSITELIB}/xen/xend/server/SrvNode.pyc
${PYSITELIB}/xen/xend/server/SrvRoot.py
${PYSITELIB}/xen/xend/server/SrvRoot.pyc
${PYSITELIB}/xen/xend/server/SrvServer.py
${PYSITELIB}/xen/xend/server/SrvServer.pyc
${PYSITELIB}/xen/xend/server/SrvVnetDir.py
${PYSITELIB}/xen/xend/server/SrvVnetDir.pyc
${PYSITELIB}/xen/xend/server/SrvXendLog.py
${PYSITELIB}/xen/xend/server/SrvXendLog.pyc
${PYSITELIB}/xen/xend/server/XMLRPCServer.py
${PYSITELIB}/xen/xend/server/XMLRPCServer.pyc
${PYSITELIB}/xen/xend/server/__init__.py
${PYSITELIB}/xen/xend/server/__init__.pyc
${PYSITELIB}/xen/xend/server/blkif.py
${PYSITELIB}/xen/xend/server/blkif.pyc
${PYSITELIB}/xen/xend/server/iopif.py
${PYSITELIB}/xen/xend/server/iopif.pyc
${PYSITELIB}/xen/xend/server/irqif.py
${PYSITELIB}/xen/xend/server/irqif.pyc
${PYSITELIB}/xen/xend/server/netif.py
${PYSITELIB}/xen/xend/server/netif.pyc
${PYSITELIB}/xen/xend/server/params.py
${PYSITELIB}/xen/xend/server/params.pyc
${PYSITELIB}/xen/xend/server/pciif.py
${PYSITELIB}/xen/xend/server/pciif.pyc
${PYSITELIB}/xen/xend/server/pciquirk.py
${PYSITELIB}/xen/xend/server/pciquirk.pyc
${PYSITELIB}/xen/xend/server/relocate.py
${PYSITELIB}/xen/xend/server/relocate.pyc
${PYSITELIB}/xen/xend/server/tests/__init__.py
${PYSITELIB}/xen/xend/server/tests/__init__.pyc
${PYSITELIB}/xen/xend/server/tests/test_controllers.py
${PYSITELIB}/xen/xend/server/tests/test_controllers.pyc
${PYSITELIB}/xen/xend/server/tpmif.py
${PYSITELIB}/xen/xend/server/tpmif.pyc
${PYSITELIB}/xen/xend/server/usbif.py
${PYSITELIB}/xen/xend/server/usbif.pyc
${PYSITELIB}/xen/xend/server/vfbif.py
${PYSITELIB}/xen/xend/server/vfbif.pyc
${PYSITELIB}/xen/xend/sxp.py
${PYSITELIB}/xen/xend/sxp.pyc
${PYSITELIB}/xen/xend/tests/__init__.py
${PYSITELIB}/xen/xend/tests/__init__.pyc
${PYSITELIB}/xen/xend/tests/test_XendConfig.py
${PYSITELIB}/xen/xend/tests/test_XendConfig.pyc
${PYSITELIB}/xen/xend/tests/test_sxp.py
${PYSITELIB}/xen/xend/tests/test_sxp.pyc
${PYSITELIB}/xen/xend/tests/test_uuid.py
${PYSITELIB}/xen/xend/tests/test_uuid.pyc
${PYSITELIB}/xen/xend/uuid.py
${PYSITELIB}/xen/xend/uuid.pyc
${PYSITELIB}/xen/xend/xenstore/__init__.py
${PYSITELIB}/xen/xend/xenstore/__init__.pyc
${PYSITELIB}/xen/xend/xenstore/tests/__init__.py
${PYSITELIB}/xen/xend/xenstore/tests/__init__.pyc
${PYSITELIB}/xen/xend/xenstore/tests/stress_xs.py
${PYSITELIB}/xen/xend/xenstore/tests/stress_xs.pyc
${PYSITELIB}/xen/xend/xenstore/xstransact.py
${PYSITELIB}/xen/xend/xenstore/xstransact.pyc
${PYSITELIB}/xen/xend/xenstore/xsutil.py
${PYSITELIB}/xen/xend/xenstore/xsutil.pyc
${PYSITELIB}/xen/xend/xenstore/xswatch.py
${PYSITELIB}/xen/xend/xenstore/xswatch.pyc
${PYSITELIB}/xen/xm/XenAPI.py
${PYSITELIB}/xen/xm/XenAPI.pyc
${PYSITELIB}/xen/xm/__init__.py
${PYSITELIB}/xen/xm/__init__.pyc
${PYSITELIB}/xen/xm/addlabel.py
${PYSITELIB}/xen/xm/addlabel.pyc
${PYSITELIB}/xen/xm/cfgbootpolicy.py
${PYSITELIB}/xen/xm/cfgbootpolicy.pyc
${PYSITELIB}/xen/xm/console.py
${PYSITELIB}/xen/xm/console.pyc
${PYSITELIB}/xen/xm/create.py
${PYSITELIB}/xen/xm/create.pyc
${PYSITELIB}/xen/xm/dry-run.py
${PYSITELIB}/xen/xm/dry-run.pyc
${PYSITELIB}/xen/xm/dumppolicy.py
${PYSITELIB}/xen/xm/dumppolicy.pyc
${PYSITELIB}/xen/xm/getlabel.py
${PYSITELIB}/xen/xm/getlabel.pyc
${PYSITELIB}/xen/xm/help.py
${PYSITELIB}/xen/xm/help.pyc
${PYSITELIB}/xen/xm/labels.py
${PYSITELIB}/xen/xm/labels.pyc
${PYSITELIB}/xen/xm/loadpolicy.py
${PYSITELIB}/xen/xm/loadpolicy.pyc
${PYSITELIB}/xen/xm/main.py
${PYSITELIB}/xen/xm/main.pyc
${PYSITELIB}/xen/xm/makepolicy.py
${PYSITELIB}/xen/xm/makepolicy.pyc
${PYSITELIB}/xen/xm/migrate.py
${PYSITELIB}/xen/xm/migrate.pyc
${PYSITELIB}/xen/xm/new.py
${PYSITELIB}/xen/xm/new.pyc
${PYSITELIB}/xen/xm/opts.py
${PYSITELIB}/xen/xm/opts.pyc
${PYSITELIB}/xen/xm/resources.py
${PYSITELIB}/xen/xm/resources.pyc
${PYSITELIB}/xen/xm/rmlabel.py
${PYSITELIB}/xen/xm/rmlabel.pyc
${PYSITELIB}/xen/xm/shutdown.py
${PYSITELIB}/xen/xm/shutdown.pyc
${PYSITELIB}/xen/xm/tests/__init__.py
${PYSITELIB}/xen/xm/tests/__init__.pyc
${PYSITELIB}/xen/xm/tests/test_create.py
${PYSITELIB}/xen/xm/tests/test_create.pyc
${PYSITELIB}/xen/xm/xenapi_create.py
${PYSITELIB}/xen/xm/xenapi_create.pyc
sbin/netfix
sbin/xen-bugtool
sbin/xenbackendd
sbin/xenconsoled
sbin/xend
sbin/xenperf
sbin/xenstored
sbin/xentop
sbin/xen-python-path
sbin/xm
share/examples/rc.d/xenbackendd
share/examples/rc.d/xend
share/examples/rc.d/xendomains
share/examples/xen/block
share/examples/xen/netbsd1
share/examples/xen/vif-bridge
share/examples/xen/vif-ip
share/examples/xen/xen-subr
share/examples/xen/xend-config.sxp
share/examples/xen/xmexample1
share/examples/xen/xmexample2
share/examples/xen/xmexample3
share/xen/create.dtd

View File

@@ -0,0 +1,12 @@
# $NetBSD: buildlink3.mk,v 1.4 2009/03/20 19:25:26 joerg Exp $
BUILDLINK_TREE+= xentools3
.if !defined(XENTOOLS3_BUILDLINK3_MK)
XENTOOLS3_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.xentools3+= xentools3>=3.1.3
BUILDLINK_PKGSRCDIR.xentools3?= ../../sysutils/xentools3
.endif # XENTOOLS3_BUILDLINK3_MK
BUILDLINK_TREE+= -xentools3

View File

@@ -0,0 +1,68 @@
$NetBSD: distinfo,v 1.16 2013/04/11 19:57:52 joerg Exp $
SHA1 (xen-3.1.4.tar.gz) = 0d784662776239195df10b3f29d40350f9d0644d
RMD160 (xen-3.1.4.tar.gz) = c02ad2bd64e6306b127a4f37a8aa370dadc11859
Size (xen-3.1.4.tar.gz) = 6894493 bytes
SHA1 (patch-.._patch-Config.mk) = 5ce1a561c8e358ceff4187b7109702c85fa29af8
SHA1 (patch-aa) = dca8b8de73b9bdbb17f8245224575eb881cdf00d
SHA1 (patch-ab) = dcafc8b6c4cd1e4dfc6f4ec806fd8076b3104b86
SHA1 (patch-ac) = d6d895e0361194cd84da13c42e17e17efecae7dd
SHA1 (patch-ad) = 1d43550d5475538563129489e05b349337e77981
SHA1 (patch-al) = 87f2af4784a8c2266d40788fd572e282f100c7b0
SHA1 (patch-as) = 040208cc9bf1d7fecc120b5b140b8bc72f2f84cf
SHA1 (patch-au) = b2357fdaff2895a5e4da4371d72ccc3041c78a83
SHA1 (patch-av) = be2a1440126908996410f92a04ad479f8a2ca373
SHA1 (patch-aw) = b4425e0667ae1ee7f2007cfa38210c82a24144a0
SHA1 (patch-ax) = c2fd0f25ed00498039eececcfb467a236f608efa
SHA1 (patch-ba) = d1f028b099dce2a8b0f7edae64f05f2bb0a984a8
SHA1 (patch-bb) = d6705871ab5655719cac1df2daf03845a8d50fba
SHA1 (patch-bc) = c143c3c587f254af1552667a70e2fac1f0f9665e
SHA1 (patch-be) = dc8e2a96f39cb540eece35468e2e055201c80220
SHA1 (patch-bf) = 8b4ecb5cc6c92e3b52574f725f577df062c4f147
SHA1 (patch-bg) = 3d390a3155db6a1f9c910868b7f615c2f270dc4d
SHA1 (patch-bh) = c9719a85d84268fab81da989b06c7eca341bb6f9
SHA1 (patch-bo) = fa73382dbd674cf68cbef9ad265ecd55e6243896
SHA1 (patch-br) = d2ff0637133b75485431cce1bd7ec0695eeabb33
SHA1 (patch-bs) = 259e16912a1e0c1aed88eaada4fb786b82bc9f4c
SHA1 (patch-bt) = d1cfab2ccf14d3df0fdda4c4699258997d2eb5d2
SHA1 (patch-bw) = d4bdb0dcc48cabefb568042d3b58822f8251b1bd
SHA1 (patch-ca) = f999e8159c79ae6cd09004b8cac4ca36da93f79f
SHA1 (patch-cb) = 0bf2513749e28ff955caabd76bf79dd8280b61ed
SHA1 (patch-cc) = 3e618c7da953115e7b3c7fe07f17b75ef2c2bb34
SHA1 (patch-cd) = a692eea5dcbf90536ffbbd2b934772bdefda5664
SHA1 (patch-cf) = 05c5e86d33d31a2216c2751a2bf684c8d5d06746
SHA1 (patch-cg) = e01915fc13291920106318b30681719cd226ff53
SHA1 (patch-ch) = ebe2aedf1ecd1dce66f4a8a25ef5e83ee1d4c60d
SHA1 (patch-cj) = 5227c180e9ec2cf7146ade6f250f6bdff8f2bda1
SHA1 (patch-ck) = 3783d9b4b9344670bae2f35e2ac7f11e2ec9ce7b
SHA1 (patch-cm) = 802d395f1dc391a827487bbc9fcfe2bbd6af07de
SHA1 (patch-cn) = 40ae04194cca94b112133e962d4cf7487412925a
SHA1 (patch-co) = 44594dee06dcc6754760e73e7b5490dd81b96c41
SHA1 (patch-cp) = 1f774a6636ce6646fc83bab304e84ce2d8886db5
SHA1 (patch-cq) = 9d45b395050b47d3d2b98487673d37feb35df80c
SHA1 (patch-cr) = d5ccaddebdbe266ca2136b82a8e6968f636a2799
SHA1 (patch-cs) = 62b9f23e0172a59b9b23ae06ae147fb439029550
SHA1 (patch-ct) = 14259d4c223b12218a07f2a2860e2706d40157b8
SHA1 (patch-cu) = 90b4a39a037c6f2aeb694e1df8e7a7165b51cdbc
SHA1 (patch-cv) = 1fea2a1cd139e2e46655622ad5f02b37e1501e0b
SHA1 (patch-cw) = 7fad0847bb87beddb9330d067132d1f7fc784222
SHA1 (patch-cx) = eed56d9e4535f19a6fc2474765d85135fce15e63
SHA1 (patch-cy) = d8f7b3c7c1fcacb273fed2799b287de8f11a1399
SHA1 (patch-cz) = 5299209411763ceeed630c9a1fa08ecc9ac0ad0d
SHA1 (patch-da) = 8da2d7866ab17403ae6c50e3771b8e556c257ed4
SHA1 (patch-db) = 5f4262ce891d5109dab2418664eb05f58a8aa535
SHA1 (patch-dc) = 10875cd9267ea5d86b1402ca7f493c67cb57a739
SHA1 (patch-dd) = 66446a6d8293aa52da11dbd28455ae856c184d16
SHA1 (patch-de) = 7cf7fb63984833e8c6110dbbb4de82a6d5e91d32
SHA1 (patch-df) = e1d10ddb899d24d727d60ca49f5b382566d65d2c
SHA1 (patch-dg) = 298bbd22362ab880fea378935a99aef6f4613f27
SHA1 (patch-dh) = a9dfb5d6442096c2f0ee49143a002656ce790592
SHA1 (patch-di) = 9d6a5acde713e0b7471adbea2d55e55b3ac77881
SHA1 (patch-dj) = 354ee3ceb1b5ba9b02091de916c328e5a062cb87
SHA1 (patch-dk) = 5685f52835885635eacd305945653f817bbe8a2a
SHA1 (patch-dl) = 480b515da8773e4d3cfc305d74f833f16bb12750
SHA1 (patch-dm) = af4b849dfb54454e08acd0618afc0a81572bcbc3
SHA1 (patch-dn) = 1b6490b8f75ab9fe4d66d444fdacdde7db38131d
SHA1 (patch-libxc_xc__dom__x86.c) = 098e42cef3a5e34b1b4b941d9f8709e8a97e60f6
SHA1 (patch-python_xen_util_xmlrpcclient.py) = 227db87dee15cfb7bedd67d6c118983b4dae2e34
SHA1 (patch-python_xen_util_xmlrpclib2.py) = 0fc01ed0511ccff6942453f3592a6939b60ab0c0

View File

@@ -0,0 +1,2 @@
# $NetBSD: NetBSD.mk,v 1.1.1.1 2007/06/14 19:39:45 bouyer Exp $
include $(XEN_ROOT)/config/StdGNU.mk

View File

@@ -0,0 +1,88 @@
#!/bin/sh -e
# $NetBSD: block-nbsd,v 1.1.1.1 2007/06/14 19:39:45 bouyer Exp $
# Called by xenbackendd
# Usage: block xsdir_backend_path state
PATH=/bin:/usr/bin:@PREFIX@/bin:/sbin:/usr/sbin:@PREFIX@/sbin
export PATH
error() {
echo "$@" >&2
xenstore_write $xpath/hotplug-status error
exit 1
}
xpath=$1
xstatus=$2
xtype=$(xenstore-read "$xpath/type")
xparams=$(xenstore-read "$xpath/params")
case $xstatus in
6)
# device removed
case $xtype in
file)
vnd=$(xenstore-read "$xpath/vnd" || echo none)
if [ $vnd != none ]; then
vnconfig -u $vnd
fi
;;
phy)
;;
*)
echo "unknown type $xtype" >&2
;;
esac
xenstore-rm $xpath
exit 0
;;
2)
case $xtype in
file)
# Store the list of available vnd(4) devices in
#``available_disks'', and mark them as ``free''.
list=`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
# Configure the first free vnd(4) device.
for disk in $available_disks; do
eval status=\$$disk
if [ "$status" = "free" ] && \
vnconfig /dev/${disk}d $xparams >/dev/null; then
device=/dev/${disk}d
echo vnconfig /dev/${disk}d $xparams
break
fi
done
if [ x$device = x ] ; then
error "no available vnd device"
fi
echo xenstore-write $xpath/vnd $device
xenstore-write $xpath/vnd $device
;;
phy)
device=$xparams
;;
esac
physical_device=$(stat -f '%r' "$device")
echo xenstore-write $xpath/physical-device $physical_device
xenstore-write $xpath/physical-device $physical_device
echo xenstore-write $xpath/hotplug-status connected
xenstore-write $xpath/hotplug-status connected
exit 0
;;
*)
exit 0
;;
esac

View File

@@ -0,0 +1,61 @@
# -*- mode: python; -*-
#============================================================================
# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using 'xm create'.
# You use a separate script for each domain you want to create, or
# you can set the parameters for the domain on the xm command line.
#============================================================================
#----------------------------------------------------------------------------
# Kernel image file.
kernel = "/usr/pkg/etc/xen/kernels/netbsd-XEN3_DOMU.gz"
#kernel = "/usr/pkg/etc/xen/kernels/netbsd-INSTALL_XEN3_DOMU.gz"
# Initial memory allocation (in megabytes) for the new domain.
memory = 256
# A name for your domain. All domains must have different names.
name = "netbsd1"
#----------------------------------------------------------------------------
# network configuration.
# The mac address is optionnal, it will use a random one if not specified.
# By default we create a bridged configuration; when a vif is created
# the script @PKG_SYSCONFDIR@/scripts/vif-bridge is called to connect
# the bridge to the designated bridge (the bridge should already be up)
vif = [ 'mac=00:16:3e:00:00:11, bridge=bridge0' ]
#it's possible to use a different script when the vif is created;
# for example to use a routed setup instead of bridged:
# vif = [ 'mac=00:16:3e:00:00:11, ip=10.0.0.1 netmask 255.255.255.0, script=vif-ip' ]
#----------------------------------------------------------------------------
# Define the disk devices you want the domain to have access to, and
# what you want them accessible as.
# Each disk entry is of the form phy:UNAME,DEV,MODE
# where UNAME is the device, DEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.
# For NetBSD guest DEV doesn't matter, so we can just use increasing numbers
# here. For linux guests you have to use a linux device name (e.g. hda1)
# or the corresponding device number (e.g 0x301 for hda1)
disk = [ 'file:/home/domains/netbsd1,0x1,w' ]
#----------------------------------------------------------------------------
# exported PCI devices
# these devices have to be attched to the pciback driver; use
# pciback.hide=(bus:dev1.fun1)(bus:dev2.fun2)(...)
# on the dom0's kernel command line to force attach of PCI devices to
# pciback. bus and dev are 2-digit hex number, fun is a single digit
# the domU needs to be built with
# xpci* at xenbus ?
# pci* at xpci ?
# and the pci drivers to be used by the domU
#
# pci = [ 'bus:dev1.fun1', 'bus:dev2.fun2' ]
#----------------------------------------------------------------------------
# Boot parameters (e.g. -s, -a, ...)
extra = ""
#============================================================================

View File

@@ -0,0 +1,38 @@
#!/bin/sh -e
# $NetBSD: vif-bridge-nbsd,v 1.2 2011/01/12 00:11:19 jym Exp $
# Called by xenbackendd
# Usage: vif-bridge xsdir_backend_path state
dir=$(dirname $0)
. "$dir/xen-subr"
PATH=/bin:/usr/bin:@PREFIX@/bin:/sbin:/usr/sbin:@PREFIX@/sbin
export PATH
xpath=$1
xstatus=$2
case $xstatus in
6)
# device removed
xenstore-rm $xpath
exit 0
;;
2)
xbridge=$(xenstore-read "$xpath/bridge")
xfid=$(xenstore-read "$xpath/frontend-id")
xhandle=$(xenstore-read "$xpath/handle")
iface=$(xenstore_read_default "$xpath/vifname" "xvif$xfid.$xhandle")
echo ifconfig $iface up
ifconfig $iface up
brconfig $xbridge add $iface
echo brconfig $xbridge add $iface
xenstore-write $xpath/hotplug-status connected
echo xenstore-write $xpath/hotplug-status connected
exit 0
;;
*)
exit 0
;;
esac

View File

@@ -0,0 +1,36 @@
#!/bin/sh -e
# $NetBSD: vif-ip-nbsd,v 1.2 2011/01/12 00:11:19 jym Exp $
# Called by xenbackendd
# Usage: vif-ip xsdir_backend_path state
dir=$(dirname $0)
. "$dir/xen-subr"
PATH=/bin:/usr/bin:@PREFIX@/bin:/sbin:/usr/sbin:@PREFIX@/sbin
export PATH
xpath=$1
xstatus=$2
case $xstatus in
6)
# device removed
xenstore-rm $xpath
exit 0
;;
2)
xip=$(xenstore-read "$xpath/ip")
xfid=$(xenstore-read "$xpath/frontend-id")
xhandle=$(xenstore-read "$xpath/handle")
iface=$(xenstore_read_default "$xpath/vifname" "xvif$xfid.$xhandle")
echo ifconfig $iface $xip up
ifconfig $iface $xip up
xenstore-write $xpath/hotplug-status connected
echo xenstore-write $xpath/hotplug-status connected
exit 0
;;
*)
exit 0
;;
esac

View File

@@ -0,0 +1,11 @@
# $NetBSD: xen-subr-nbsd,v 1.1 2011/01/12 00:11:19 jym Exp $
#
# Contains commonly used functions which are used by Xen scripts
# xenstore_read_default path default
#
# Read the given path in XenStore. Return default if path does not exist
#
xenstore_read_default() {
xenstore-read "$1" 2>/dev/null || echo "$2"
}

View File

@@ -0,0 +1,319 @@
/* $NetBSD: xenbackendd.c,v 1.1.1.1 2007/06/14 19:39:45 bouyer Exp $ */
/*
* Copyright (C) 2006 Manuel bouyer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; under version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <getopt.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <string.h>
#include <syslog.h>
#include <stdarg.h>
#include <xenctrl.h>
#include <xs.h>
#define DEVTYPE_UNKNOWN 0
#define DEVTYPE_VIF 1
#define DEVTYPE_VBD 2
#define DOMAIN_PATH "/local/domain/0"
#ifndef VBD_SCRIPT
#define VBD_SCRIPT "/usr/pkg/etc/xen/scripts/block"
#endif
#ifndef LOG_FILE
#define LOG_FILE "/var/log/xenbackendd.log"
#endif
#ifndef PID_FILE
#define PID_FILE "/var/run/xenbackendd.pid"
#endif
struct xs_handle *xs;
int xc;
int xen_setup(void);
void dolog(int, const char *, ...);
void dodebug(const char *, ...);
void doexec(const char *, const char *, const char *);
void usage(void);
int fflag = 0;
int dflag = 0;
const char *vbd_script = NULL;
const char *log_file = NULL;
const char *pidfile = NULL;
int
main(int argc, char * const argv[])
{
char **vec;
unsigned int num;
int i;
char *s;
int state;
char *sstate;
char *p;
char buf[80];
int type = DEVTYPE_UNKNOWN;
extern char *optarg;
extern int optind;
int ch;
int debug_fd;
FILE *pidfile_f;
while ((ch = getopt(argc, argv, "dfl:p:s:")) != -1) {
switch (ch) {
case 'd':
dflag = 1;
break;
case 'f':
fflag = 1;
break;
case 'l':
log_file = optarg;
break;
case 'p':
pidfile = pidfile;
case 's':
vbd_script = optarg;
break;
default:
usage();
}
}
if (vbd_script == NULL)
vbd_script = VBD_SCRIPT;
if (pidfile == NULL)
pidfile = PID_FILE;
if (log_file == NULL)
log_file = LOG_FILE;
openlog("xenbackendd", LOG_PID | LOG_NDELAY, LOG_DAEMON);
if (fflag == 0) {
/* open log file */
debug_fd = open(log_file, O_RDWR | O_CREAT | O_TRUNC, 0644);
if (debug_fd == -1) {
dolog(LOG_ERR, "can't open %s: %s",
log_file, strerror(errno));
exit(1);
}
}
if (fflag == 0) {
/* daemonize */
pidfile_f = fopen(pidfile, "w");
if (pidfile_f == NULL) {
dolog(LOG_ERR, "can't open %s: %s",
pidfile, strerror(errno));
exit(1);
}
if (daemon(0, 0) < 0) {
dolog(LOG_ERR, "can't daemonize: %s",
strerror(errno));
exit(1);
}
fprintf(pidfile_f, "%d\n", (int)getpid());
fclose(pidfile_f);
/* retirect stderr to log file */
if (dup2(debug_fd, STDERR_FILENO) < 0) {
dolog(LOG_ERR, "can't redirect stderr to %s: %s\n",
log_file, strerror(errno));
exit(1);
}
/* also redirect stdout if we're in debug mode */
if (dflag) {
if (dup2(debug_fd, STDOUT_FILENO) < 0) {
dolog(LOG_ERR,
"can't redirect stdout to %s: %s\n",
log_file, strerror(errno));
exit(1);
}
}
close(debug_fd);
debug_fd = -1;
}
if (xen_setup() < 0) {
exit(1);
}
while (1) {
vec = xs_read_watch(xs, &num);
if (!vec) {
dolog(LOG_ERR, "xs_read_watch: NULL\n");
continue;
}
if (strlen(vec[XS_WATCH_PATH]) < sizeof("state"))
goto next1;
/* find last component of path, check if it's "state" */
p = &vec[XS_WATCH_PATH][
strlen(vec[XS_WATCH_PATH]) - sizeof("state")];
if (p[0] != '/')
goto next1;
p[0] = '\0';
p++;
if (strcmp(p, "state") != 0)
goto next1;
snprintf(buf, sizeof(buf), "%s/state", vec[XS_WATCH_PATH]);
sstate = xs_read(xs, XBT_NULL, buf, 0);
if (sstate == NULL) {
dolog(LOG_ERR,
"Failed to read %s (%s)", buf, strerror(errno));
goto next1;
}
state = atoi(sstate);
snprintf(buf, sizeof(buf), "%s/hotplug-status",
vec[XS_WATCH_PATH]);
s = xs_read(xs, XBT_NULL, buf, 0);
if (s != NULL && state != 6 /* XenbusStateClosed */)
goto next2;
if (strncmp(vec[XS_WATCH_PATH],
DOMAIN_PATH "/backend/vif",
strlen(DOMAIN_PATH "/backend/vif")) == 0)
type = DEVTYPE_VIF;
if (strncmp(vec[XS_WATCH_PATH],
DOMAIN_PATH "/backend/vbd",
strlen(DOMAIN_PATH "/backend/vbd")) == 0)
type = DEVTYPE_VBD;
switch(type) {
case DEVTYPE_VIF:
if (s)
free(s);
snprintf(buf, sizeof(buf), "%s/script",
vec[XS_WATCH_PATH]);
s = xs_read(xs, XBT_NULL, buf, 0);
if (s == NULL) {
dolog(LOG_ERR,
"Failed to read %s (%s)", buf,
strerror(errno));
goto next2;
}
doexec(s, vec[XS_WATCH_PATH], sstate);
break;
case DEVTYPE_VBD:
doexec(vbd_script, vec[XS_WATCH_PATH], sstate);
break;
default:
break;
}
next2:
if (s)
free(s);
free(sstate);
next1:
free(vec);
}
}
void
dolog(int pri, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
fflush(stderr);
va_start(ap, fmt);
vsyslog(pri, fmt, ap);
va_end(ap);
}
void
dodebug(const char *fmt, ...)
{
va_list ap;
if (dflag == 0)
return;
va_start(ap, fmt);
vfprintf(stdout, fmt, ap);
va_end(ap);
printf("\n");
fflush(stdout);
}
int
xen_setup(void)
{
xs = xs_daemon_open();
if (xs == NULL) {
dolog(LOG_ERR,
"Failed to contact xenstore (%s). Is it running?",
strerror(errno));
goto out;
}
xc = xc_interface_open();
if (xc == -1) {
dolog(LOG_ERR, "Failed to contact hypervisor (%s)",
strerror(errno));
goto out;
}
if (!xs_watch(xs, DOMAIN_PATH, "backend")) {
dolog(LOG_ERR, "xenstore watch on backend fails.");
goto out;
}
return 0;
out:
if (xs)
xs_daemon_close(xs);
if (xc != -1)
xc_interface_close(xc);
return -1;
}
void
doexec(const char *cmd, const char *arg1, const char *arg2)
{
dodebug("exec %s %s %s", cmd, arg1, arg2);
switch(vfork()) {
case -1:
dolog(LOG_ERR, "can't vfork: %s", strerror(errno));
break;
case 0:
execl(cmd, cmd, arg1, arg2, NULL);
dolog(LOG_ERR, "can't exec %s: %s", cmd, strerror(errno));
exit(1);
break;
default:
wait(NULL);
break;
}
}
void
usage()
{
fprintf(stderr, "usage: %s [-d] [-f] [-l log_file] [-p pif_file] [-s vbd_script]\n",
getprogname());
exit(1);
}

View File

@@ -0,0 +1,17 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: xenbackendd.sh,v 1.2 2011/10/07 22:37:06 shattered Exp $
#
# PROVIDE: xenbackendd
# REQUIRE: xend
$_rc_subr_loaded . /etc/rc.subr
name="xenbackendd"
rcvar=$name
command="@PREFIX@/sbin/${name}"
pidfile="/var/run/${name}.pid"
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,30 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: xend.sh,v 1.3 2009/01/17 12:31:10 bouyer Exp $
#
# PROVIDE: xend
# REQUIRE: DAEMON
. /etc/rc.subr
name="xend"
rcvar=$name
command="@PREFIX@/sbin/xend"
command_interpreter="@RCD_INTERPRETER@"
start_cmd="@ECHO@ Starting ${name}. && PATH=${PATH}:@PREFIX@/sbin ${command} start"
start_precmd="xen_precmd"
privcmd_path="@PROCPATH@/xen/privcmd"
xen_precmd()
{
if [ ! -f ${privcmd_path} ]; then
@ECHO@ "${name}: Cannot find ${privcmd_path}!"
exit 1
fi
mkdir -p /var/run/xend || exit 1
mkdir -p /var/run/xend/boot || exit 1
mkdir -p /var/run/xenstored || exit 1
}
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,136 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: xendomains.sh,v 1.2 2012/07/16 22:55:25 jym Exp $
#
# PROVIDE: xendomains
# REQUIRE: xenbackendd
# 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
if ! $cmdline; then
echo "Pre-hook \`\`$cmdline'' failed... skipping $domain."
continue
fi
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 __PKGSRC_PRIVCMD_H__
#define __PKGSRC_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 /* __PKGSRC_PRIVCMD_H__ */

View File

@@ -0,0 +1,89 @@
/* $NetBSD: xenio3.h,v 1.1.1.1 2007/06/14 19:39:45 bouyer Exp $ */
/******************************************************************************
* evtchn.h
*
* Interface to /dev/xen/evtchn.
*
* Copyright (c) 2003-2005, 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 __NetBSD_XENIO3_H__
#define __NetBSD_XENIO3_H__
/*
* Bind a fresh port to VIRQ @virq.
* Return allocated port.
*/
#define IOCTL_EVTCHN_BIND_VIRQ \
_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
struct ioctl_evtchn_bind_virq {
unsigned int virq;
unsigned int port;
};
/*
* Bind a fresh port to remote <@remote_domain, @remote_port>.
* Return allocated port.
*/
#define IOCTL_EVTCHN_BIND_INTERDOMAIN \
_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
struct ioctl_evtchn_bind_interdomain {
unsigned int remote_domain, remote_port;
unsigned int port;
};
/*
* Allocate a fresh port for binding to @remote_domain.
* Return allocated port.
*/
#define IOCTL_EVTCHN_BIND_UNBOUND_PORT \
_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
struct ioctl_evtchn_bind_unbound_port {
unsigned int remote_domain;
unsigned int port;
};
/*
* Unbind previously allocated @port.
*/
#define IOCTL_EVTCHN_UNBIND \
_IOW('E', 7, struct ioctl_evtchn_unbind)
struct ioctl_evtchn_unbind {
unsigned int port;
};
/*
* Send event to previously allocated @port.
*/
#define IOCTL_EVTCHN_NOTIFY \
_IOW('E', 8, struct ioctl_evtchn_notify)
struct ioctl_evtchn_notify {
unsigned int port;
};
/* Clear and reinitialise the event buffer. Clear error condition. */
#define IOCTL_EVTCHN_RESET \
_IO('E', 9)
#endif /* __NetBSD_XENIO3_H__ */

View File

@@ -0,0 +1,26 @@
$NetBSD: patch-.._patch-Config.mk,v 1.2 2013/04/11 19:57:52 joerg Exp $
--- ../Config.mk.orig 2011-12-07 10:40:48.000000000 +0000
+++ ../Config.mk
@@ -19,7 +19,7 @@ SHELL ?= /bin/sh
# Tools to run on system hosting the build
HOSTCC = gcc
HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
-HOSTCFLAGS += -fno-strict-aliasing
+HOSTCFLAGS += -fno-strict-aliasing ${EXTRA_HOSTCFLAGS}
HOSTCFLAGS_x86_32 = -m32
HOSTCFLAGS_x86_64 = -m64
HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
@@ -70,10 +70,11 @@ CFLAGS += -Wall -Wstrict-prototypes
# -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
# result of any casted expression causes a warning.
-CFLAGS += -Wno-unused-value
+CFLAGS += -Wno-unused-value -Wno-switch
HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
CFLAGS += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
+CFLAGS += ${EXTRA_CFLAGS}
LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))

View File

@@ -0,0 +1,59 @@
$NetBSD: patch-aa,v 1.2 2008/03/03 16:45:27 hannken Exp $
--- Makefile.orig 2008-01-31 11:06:54.000000000 +0100
+++ Makefile 2008-02-29 16:58:47.000000000 +0100
@@ -5,19 +5,12 @@ SUBDIRS-y :=
SUBDIRS-y += libxc
SUBDIRS-y += xenstore
SUBDIRS-y += misc
-SUBDIRS-y += examples
-SUBDIRS-y += xentrace
SUBDIRS-$(CONFIG_XCUTILS) += xcutils
-SUBDIRS-$(CONFIG_X86) += firmware
SUBDIRS-y += security
SUBDIRS-y += console
-SUBDIRS-y += xenmon
-SUBDIRS-y += guest-headers
SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
SUBDIRS-$(VTPM_TOOLS) += vtpm
SUBDIRS-y += xenstat
-SUBDIRS-y += libaio
-SUBDIRS-y += blktap
SUBDIRS-y += libfsimage
SUBDIRS-$(XENFB_TOOLS) += xenfb
SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
@@ -33,34 +26,27 @@ all: check
@set -e; for subdir in $(SUBDIRS-y); do \
$(MAKE) -C $$subdir $@; \
done
- $(MAKE) ioemu
.PHONY: install
install: check
@set -e; for subdir in $(SUBDIRS-y); do \
$(MAKE) -C $$subdir $@; \
done
- $(MAKE) ioemuinstall
- $(INSTALL_DIR) $(DESTDIR)/var/xen/dump
- $(INSTALL_DIR) $(DESTDIR)/var/log/xen
.PHONY: clean
clean: check_clean
@set -e; for subdir in $(SUBDIRS-y); do \
$(MAKE) -C $$subdir $@; \
done
- $(MAKE) ioemuclean
.PHONY: distclean
distclean: clean
.PHONY: check
check:
- $(MAKE) -C check
.PHONY: check_clean
check_clean:
- $(MAKE) -C check clean
.PHONY: ioemu ioemuinstall ioemuclean
ifeq ($(CONFIG_IOEMU),y)

View File

@@ -0,0 +1,284 @@
$NetBSD: patch-ab,v 1.3 2008/02/17 16:29:03 bouyer Exp $
--- libxc/xc_netbsd.c.orig 2008-02-17 15:12:36.000000000 +0100
+++ libxc/xc_netbsd.c 2008-02-17 15:20:03.000000000 +0100
@@ -0,0 +1,279 @@
+/******************************************************************************
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+
+#include "xc_private.h"
+
+#include <xen/memory.h>
+#include <xen/xenio3.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int xc_interface_open(void)
+{
+ int flags, saved_errno;
+ int fd = open("/kern/xen/privcmd", O_RDWR);
+
+ if ( fd == -1 )
+ {
+ PERROR("Could not obtain handle on privileged command interface");
+ return -1;
+ }
+
+ /* Although we return the file handle as the 'xc handle' the API
+ does not specify / guarentee that this integer is in fact
+ a file handle. Thus we must take responsiblity to ensure
+ it doesn't propagate (ie leak) outside the process */
+ if ( (flags = fcntl(fd, F_GETFD)) < 0 )
+ {
+ PERROR("Could not get file handle flags");
+ goto error;
+ }
+ flags |= FD_CLOEXEC;
+ if ( fcntl(fd, F_SETFD, flags) < 0 )
+ {
+ PERROR("Could not set file handle flags");
+ goto error;
+ }
+
+ return fd;
+
+ error:
+ saved_errno = errno;
+ close(fd);
+ errno = saved_errno;
+ return -1;
+}
+
+int xc_interface_close(int xc_handle)
+{
+ return close(xc_handle);
+}
+
+void *xc_map_foreign_batch(int xc_handle, uint32_t dom, int prot,
+ xen_pfn_t *arr, int num)
+{
+ privcmd_mmapbatch_t ioctlx;
+ void *addr;
+ addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
+ if ( addr == MAP_FAILED )
+ return NULL;
+
+ ioctlx.num=num;
+ ioctlx.dom=dom;
+ ioctlx.addr=(unsigned long)addr;
+ ioctlx.arr=arr;
+ if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
+ {
+ int saved_errno = errno;
+ perror("XXXXXXXX");
+ (void)munmap(addr, num*PAGE_SIZE);
+ errno = saved_errno;
+ return NULL;
+ }
+ return addr;
+
+}
+
+void *xc_map_foreign_range(int xc_handle, uint32_t dom,
+ int size, int prot,
+ unsigned long mfn)
+{
+ privcmd_mmap_t ioctlx;
+ privcmd_mmap_entry_t entry;
+ void *addr;
+ addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
+ if ( addr == MAP_FAILED )
+ return NULL;
+
+ ioctlx.num=1;
+ ioctlx.dom=dom;
+ ioctlx.entry=&entry;
+ entry.va=(unsigned long) addr;
+ entry.mfn=mfn;
+ entry.npages=(size+PAGE_SIZE-1)>>PAGE_SHIFT;
+ if ( ioctl(xc_handle, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
+ {
+ int saved_errno = errno;
+ (void)munmap(addr, size);
+ errno = saved_errno;
+ return NULL;
+ }
+ return addr;
+}
+
+int xc_map_foreign_ranges(int xc_handle, uint32_t dom,
+ privcmd_mmap_entry_t *entries, int nr)
+{
+ privcmd_mmap_t ioctlx;
+ int err;
+
+ ioctlx.num = nr;
+ ioctlx.dom = dom;
+ ioctlx.entry = entries;
+
+ err = ioctl(xc_handle, IOCTL_PRIVCMD_MMAP, &ioctlx);
+ if (err == 0)
+ return 0;
+ else
+ return -errno;
+}
+
+static int do_privcmd(int xc_handle, unsigned int cmd, unsigned long data)
+{
+ int err = ioctl(xc_handle, cmd, data);
+ if (err == 0)
+ return 0;
+ else
+ return -errno;
+}
+
+int do_xen_hypercall(int xc_handle, privcmd_hypercall_t *hypercall)
+{
+#ifdef __PKGSRC_PRIVCMD_H__
+ /* old IOCTL */
+ return do_privcmd(xc_handle,
+ IOCTL_PRIVCMD_HYPERCALL,
+ (unsigned long)hypercall);
+#else
+ int error = do_privcmd(xc_handle,
+ IOCTL_PRIVCMD_HYPERCALL,
+ (unsigned long)hypercall);
+ if (error)
+ return error;
+ else
+ return (hypercall->retval);
+#endif
+}
+
+#define EVTCHN_DEV_NAME "/dev/xenevt"
+
+int xc_evtchn_open(void)
+{
+ return open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
+}
+
+int xc_evtchn_close(int xce_handle)
+{
+ return close(xce_handle);
+}
+
+int xc_evtchn_fd(int xce_handle)
+{
+ return xce_handle;
+}
+
+int xc_evtchn_notify(int xce_handle, evtchn_port_t port)
+{
+ struct ioctl_evtchn_notify notify;
+
+ notify.port = port;
+
+ return ioctl(xce_handle, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(int xce_handle, int domid,
+ evtchn_port_t remote_port)
+{
+ struct ioctl_evtchn_bind_interdomain bind;
+ int ret;
+
+ bind.remote_domain = domid;
+ bind.remote_port = remote_port;
+
+ ret = ioctl(xce_handle, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ if (ret == 0)
+ return bind.port;
+ else
+ return -1;
+}
+
+int xc_evtchn_unbind(int xce_handle, evtchn_port_t port)
+{
+ struct ioctl_evtchn_unbind unbind;
+
+ unbind.port = port;
+
+ return ioctl(xce_handle, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xc_evtchn_bind_virq(int xce_handle, unsigned int virq)
+{
+ struct ioctl_evtchn_bind_virq bind;
+ int err;
+
+ bind.virq = virq;
+
+ err = ioctl(xce_handle, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+ if (err)
+ return -1;
+ else
+ return bind.port;
+}
+
+static int dorw(int fd, char *data, size_t size, int do_write)
+{
+ size_t offset = 0;
+ ssize_t len;
+
+ while ( offset < size )
+ {
+ if (do_write)
+ len = write(fd, data + offset, size - offset);
+ else
+ len = read(fd, data + offset, size - offset);
+
+ if ( len == -1 )
+ {
+ if ( errno == EINTR )
+ continue;
+ return -1;
+ }
+
+ offset += len;
+ }
+
+ return 0;
+}
+
+evtchn_port_or_error_t xc_evtchn_pending(int xce_handle)
+{
+ evtchn_port_t port;
+
+ if ( dorw(xce_handle, (char *)&port, sizeof(port), 0) == -1 )
+ return -1;
+
+ return port;
+}
+
+int xc_evtchn_unmask(int xce_handle, evtchn_port_t port)
+{
+ return dorw(xce_handle, (char *)&port, sizeof(port), 1);
+}
+
+/* Optionally flush file to disk and discard page cache */
+void discard_file_cache(int fd, int flush)
+{
+
+ if ( flush && (fsync(fd) < 0) )
+ {
+ /*PERROR("Failed to flush file: %s", strerror(errno));*/
+ }
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.2 2008/09/16 19:39:06 bouyer Exp $
--- libxc/xc_domain_save.c.orig 2007-05-27 13:35:43.000000000 +0200
+++ libxc/xc_domain_save.c 2007-05-27 13:35:53.000000000 +0200
@@ -620,7 +620,7 @@
}
if ( (m2p = mmap(NULL, m2p_size, prot,
- MAP_SHARED, xc_handle, 0)) == MAP_FAILED )
+ MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED )
{
ERROR("failed to mmap m2p");
return NULL;

View File

@@ -0,0 +1,159 @@
--- libxc/xc_private.c.orig 2008-04-25 15:03:12.000000000 +0200
+++ libxc/xc_private.c 2008-09-14 23:37:40.000000000 +0200
@@ -10,7 +10,12 @@
#include <stdarg.h>
#include <pthread.h>
-static __thread xc_error last_error = { XC_ERROR_NONE, ""};
+static pthread_key_t last_error_pkey;
+static pthread_once_t last_error_pkey_once = PTHREAD_ONCE_INIT;
+
+static pthread_key_t errbuf_pkey;
+static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
+
#if DEBUG
static xc_error_handler error_handler = xc_default_error_handler;
#else
@@ -23,15 +28,44 @@
fprintf(stderr, "ERROR %s: %s\n", desc, err->message);
}
+static void
+_xc_clean_last_error(void *m)
+{
+ if (m)
+ free(m);
+ pthread_setspecific(last_error_pkey, NULL);
+}
+
+static void
+_xc_init_last_error(void)
+{
+ pthread_key_create(&last_error_pkey, _xc_clean_last_error);
+}
+static xc_error *
+_xc_get_last_error(void) {
+ xc_error *last_error;
+
+ pthread_once(&last_error_pkey_once, _xc_init_last_error);
+
+ last_error = pthread_getspecific(last_error_pkey);
+ if (last_error == NULL) {
+ last_error = malloc(sizeof(xc_error));
+ pthread_setspecific(last_error_pkey, last_error);
+ }
+ return last_error;
+}
+
+
const xc_error *xc_get_last_error(void)
{
- return &last_error;
+ return _xc_get_last_error();
}
void xc_clear_last_error(void)
{
- last_error.code = XC_ERROR_NONE;
- last_error.message[0] = '\0';
+ xc_error *last_error = _xc_get_last_error();
+ last_error->code = XC_ERROR_NONE;
+ last_error->message[0] = '\0';
}
const char *xc_error_code_to_desc(int code)
@@ -64,9 +98,10 @@
static void _xc_set_error(int code, const char *msg)
{
- last_error.code = code;
- strncpy(last_error.message, msg, XC_MAX_ERROR_MSG_LEN - 1);
- last_error.message[XC_MAX_ERROR_MSG_LEN-1] = '\0';
+ xc_error *last_error = _xc_get_last_error();
+ last_error->code = code;
+ strncpy(last_error->message, msg, XC_MAX_ERROR_MSG_LEN - 1);
+ last_error->message[XC_MAX_ERROR_MSG_LEN-1] = '\0';
}
void xc_set_error(int code, const char *fmt, ...)
@@ -84,13 +119,19 @@
errno = saved_errno;
- if ( error_handler != NULL )
- error_handler(&last_error);
+ if ( error_handler != NULL ) {
+ xc_error *last_error = _xc_get_last_error();
+ error_handler(last_error);
+ }
}
int lock_pages(void *addr, size_t len)
{
int e = 0;
+ size_t offset = (u_long)addr & 0xfffUL;
+ addr -= offset;
+ len += offset;
+ len = (len + 0xfffUL) & ~0xfffUL; /* round up */
#ifndef __sun__
e = mlock(addr, len);
#endif
@@ -99,8 +140,10 @@
void unlock_pages(void *addr, size_t len)
{
+ void *laddr = (void *)((u_long)addr & ~0xfffUL);
+ size_t llen = (len + 0xfffUL) & ~0xfffUL;
#ifndef __sun__
- safe_munlock(addr, len);
+ safe_munlock(laddr, llen);
#endif
}
@@ -466,20 +509,43 @@
return new_mfn;
}
+static void
+_xc_clean_errbuf(void * m)
+{
+ if (m)
+ free(m);
+ pthread_setspecific(errbuf_pkey, NULL);
+}
+
+static void
+_xc_init_errbuf(void)
+{
+ pthread_key_create(&errbuf_pkey, _xc_clean_errbuf);
+}
+
char *safe_strerror(int errcode)
{
- static __thread char errbuf[32];
+#define XS_BUFSIZE 32
+ char *errbuf;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
char *strerror_str;
+ pthread_once(&errbuf_pkey_once, _xc_init_errbuf);
+
+ errbuf = pthread_getspecific(errbuf_pkey);
+ if (errbuf == NULL) {
+ errbuf = malloc(XS_BUFSIZE);
+ pthread_setspecific(errbuf_pkey, errbuf);
+ }
+
/*
* Thread-unsafe strerror() is protected by a local mutex. We copy
* the string to a thread-private buffer before releasing the mutex.
*/
pthread_mutex_lock(&mutex);
strerror_str = strerror(errcode);
- strncpy(errbuf, strerror_str, sizeof(errbuf));
- errbuf[sizeof(errbuf)-1] = '\0';
+ strncpy(errbuf, strerror_str, XS_BUFSIZE);
+ errbuf[XS_BUFSIZE-1] = '\0';
pthread_mutex_unlock(&mutex);
return errbuf;

View File

@@ -0,0 +1,28 @@
$NetBSD: patch-al,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- console/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ console/Makefile 2007-05-27 13:45:20.000000000 +0200
@@ -21,16 +21,17 @@
$(RM) client/*.o daemon/*.o
xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
- $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
+ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
$(SOCKET_LIBS) -lxenctrl -lxenstore
xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
- $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
+ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
$(SOCKET_LIBS) -lxenctrl -lxenstore
.PHONY: install
install: $(BIN)
- $(INSTALL_DIR) $(DESTDIR)/$(DAEMON_INSTALL_DIR)
- $(INSTALL_PROG) xenconsoled $(DESTDIR)/$(DAEMON_INSTALL_DIR)
- $(INSTALL_DIR) $(DESTDIR)/$(CLIENT_INSTALL_DIR)
- $(INSTALL_PROG) xenconsole $(DESTDIR)/$(CLIENT_INSTALL_DIR)
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_PROGRAM) xenconsoled ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) xenconsole ${DESTDIR}$(PREFIX)/bin
+

View File

@@ -0,0 +1,45 @@
$NetBSD: patch-as,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- libxc/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ libxc/Makefile 2007-05-27 13:46:42.000000000 +0200
@@ -23,6 +23,7 @@
CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
+CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
GUEST_SRCS-y :=
GUEST_SRCS-y += xg_private.c
@@ -102,19 +103,19 @@
.PHONY: install
install: build
- [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
- [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
- $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
- $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
- ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
- ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
- $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
-
- $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
- $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
- ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
- ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
- $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
+ $(BSD_INSTALL_LIB_DIR) ${DESTDIR}$(PREFIX)/lib
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(PREFIX)/include
+ $(BSD_INSTALL_LIB) libxenctrl.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib
+ $(BSD_INSTALL_LIB) libxenctrl.a ${DESTDIR}$(PREFIX)/lib
+ ln -sf libxenctrl.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib/libxenctrl.so.$(MAJOR)
+ ln -sf libxenctrl.so.$(MAJOR) ${DESTDIR}$(PREFIX)/lib/libxenctrl.so
+ $(BSD_INSTALL_DATA) xenctrl.h ${DESTDIR}$(PREFIX)/include
+
+ $(BSD_INSTALL_LIB) libxenguest.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib
+ $(BSD_INSTALL_LIB) libxenguest.a ${DESTDIR}$(PREFIX)/lib
+ ln -sf libxenguest.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib/libxenguest.so.$(MAJOR)
+ ln -sf libxenguest.so.$(MAJOR) ${DESTDIR}$(PREFIX)/lib/libxenguest.so
+ $(BSD_INSTALL_DATA) xenguest.h ${DESTDIR}$(PREFIX)/include
.PHONY: TAGS
TAGS:

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-au,v 1.2 2008/02/17 16:29:03 bouyer Exp $
--- libxc/xc_private.h.orig 2006-10-16 22:15:35.000000000 +0200
+++ libxc/xc_private.h 2006-10-16 22:16:09.000000000 +0200
@@ -15,7 +15,11 @@
#include "xenctrl.h"
+#ifdef __NetBSD__
+#include <xen/xenio.h>
+#else
#include <xen/sys/privcmd.h>
+#endif
/* valgrind cannot see when a hypercall has filled in some values. For this
reason, we must zero the privcmd_hypercall_t or domctl/sysctl instance

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-av,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- libxc/xg_private.h.orig 2006-10-16 22:15:35.000000000 +0200
+++ libxc/xg_private.h 2006-10-16 22:16:19.000000000 +0200
@@ -15,7 +15,6 @@
#include "xenguest.h"
#include "xc_private.h"
-#include <xen/sys/privcmd.h>
#include <xen/memory.h>
#include <xen/elfnote.h>

View File

@@ -0,0 +1,42 @@
$NetBSD: patch-aw,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- misc/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ misc/Makefile 2007-05-27 13:48:51.000000000 +0200
@@ -13,8 +13,10 @@
TARGETS-$(CONFIG_X86) += xen-detect
TARGETS := $(TARGETS-y)
-INSTALL_BIN = $(TARGETS) xencons
-INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf
+INSTALL_BIN = $(TARGETS)
+INSTALL_BIN_SCRIPT = xencons
+INSTALL_SBIN = xenperf
+INSTALL_SBIN_SCRIPT = netfix xm xen-bugtool xend xen-python-path
.PHONY: all
all: build
@@ -26,11 +28,13 @@
.PHONY: install
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
- $(MAKE) -C lomount install
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_PROGRAM) $(INSTALL_BIN) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_SCRIPT) $(INSTALL_BIN_SCRIPT) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) $(INSTALL_SBIN) ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_SCRIPT) $(INSTALL_SBIN_SCRIPT) ${DESTDIR}$(PREFIX)/sbin
+# $(MAKE) -C lomount install
# No sense in installing miniterm on the Xen box.
# $(MAKE) -C miniterm install
@@ -44,4 +48,4 @@
$(CC) -c $(CFLAGS) -o $@ $<
xenperf: %: %.o Makefile
- $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxenctrl
+ $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -L$(XEN_LIBXC) -lxenctrl

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-ax,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- misc/xend.orig 2006-10-17 15:33:55.000000000 +0200
+++ misc/xend 2006-10-17 15:38:47.000000000 +0200
@@ -94,8 +94,7 @@
os.execvp('xenconsoled', ['xenconsoled'])
def start_blktapctrl():
- if os.fork() == 0:
- os.execvp('blktapctrl', ['blktapctrl'])
+ ''
def main():
try:

View File

@@ -0,0 +1,47 @@
$NetBSD: patch-ba,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- python/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ python/Makefile 2007-05-27 14:33:00.000000000 +0200
@@ -12,7 +12,7 @@
POTFILE := $(PODIR)/xen-xm.pot
I18NSRCFILES = $(shell find xen/xm/ -name '*.py')
CATALOGS = $(patsubst %,xen/xm/messages/%.mo,$(LINGUAS))
-NLSDIR = /usr/share/locale
+NLSDIR = $(PREFIX)/share/locale
.PHONY: build buildpy
buildpy:
@@ -57,24 +57,24 @@
ifndef XEN_PYTHON_NATIVE_INSTALL
install: LIBPATH=$(shell PYTHONPATH=xen/util python -c "import auxbin; print auxbin.libpath()")
install: install-messages install-dtd
- CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr" --prefix="" --force --install-lib="$(DESTDIR)$(LIBPATH)/python"
+ python setup.py install --root=${DESTDIR}
else
install: install-messages install-dtd
- CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --force
+ python setup.py install --root=${DESTDIR}
endif
install-dtd: all
- $(INSTALL_DIR) $(DESTDIR)/usr/share/xen
- $(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)/usr/share/xen
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(PREFIX)/share/xen
+ $(BSD_INSTALL_DATA) xen/xm/create.dtd ${DESTDIR}$(PREFIX)/share/xen
install-messages: all
if which $(MSGFMT) >/dev/null ; then \
- mkdir -p $(DESTDIR)$(NLSDIR); \
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(NLSDIR); \
for l in $(LINGUAS); do \
- $(INSTALL_DIR) $(DESTDIR)$(NLSDIR)/$$l; \
- $(INSTALL_DIR) $(DESTDIR)$(NLSDIR)/$$l/LC_MESSAGES; \
- $(INSTALL_DATA) $(PODIR)/$$l.mo \
- $(DESTDIR)$(NLSDIR)/$$l/LC_MESSAGES/$(POPACKAGE).mo; \
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(NLSDIR)/$$l; \
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(NLSDIR)/$$l/LC_MESSAGES; \
+ $(BSD_INSTALL_DATA) ${DESTDIR}$(PODIR)/$$l.mo \
+ ${DESTDIR}$(NLSDIR)/$$l/LC_MESSAGES/$(POPACKAGE).mo; \
done ; \
fi

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-bb,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/xend/XendOptions.py.orig 2007-05-27 14:34:33.000000000 +0200
+++ python/xen/xend/XendOptions.py 2007-05-27 14:35:35.000000000 +0200
@@ -281,7 +281,7 @@
class XendOptionsFile(XendOptions):
"""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"

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-bc,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/xm/create.py.orig 2007-04-25 22:19:55.000000000 +0200
+++ python/xen/xm/create.py 2007-04-25 22:20:12.000000000 +0200
@@ -64,7 +64,7 @@
use="Quiet.")
gopts.opt('path', val='PATH',
- fn=set_value, default='.:/etc/xen',
+ fn=set_value, default='.:@XENDCONFDIR@',
use="Search path for configuration scripts. "
"The value of PATH is a colon-separated directory list.")
@@ -318,7 +318,7 @@
preferred instance number. The hotplug script will determine
which instance number will actually be assigned to the domain.
The associtation between virtual machine and the TPM instance
- number can be found in /etc/xen/vtpm.db. Use the backend in the
+ number can be found in @XENDCONFDIR@/vtpm.db. Use the backend in the
given domain.
The type parameter can be used to select a specific driver type
that the VM can use. To prevent a fully virtualized domain (HVM)

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-be,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/lowlevel/acm/acm.c.orig 2006-10-17 00:18:15.000000000 +0200
+++ python/xen/lowlevel/acm/acm.c 2006-10-17 00:18:25.000000000 +0200
@@ -26,10 +26,10 @@
#include <stdlib.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
+#include <xenctrl.h>
#include <xen/acm.h>
#include <xen/acm_ops.h>
-#include <xenctrl.h>
#define PERROR(_m, _a...) \
fprintf(stderr, "ERROR: " _m " (%d = %s)\n" , ## _a , \

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-bf,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/xm/addlabel.py.orig 2006-10-15 14:22:03.000000000 +0200
+++ python/xen/xm/addlabel.py 2006-10-19 21:51:26.000000000 +0200
@@ -133,7 +133,7 @@
if argv[2].lower() == "dom":
configfile = argv[3]
if configfile[0] != '/':
- for prefix in [".", "/etc/xen"]:
+ for prefix in [".", "@XENDCONFDIR@"]:
configfile = prefix + "/" + configfile
if os.path.isfile(configfile):
break

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-bg,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/xm/getlabel.py.orig 2006-10-15 14:22:03.000000000 +0200
+++ python/xen/xm/getlabel.py 2006-10-19 21:52:18.000000000 +0200
@@ -55,7 +55,7 @@
if configfile[0] == '/':
fd = open(configfile, "rb")
else:
- for prefix in [".", "/etc/xen"]:
+ for prefix in [".", "@XENDCONFDIR@"]:
abs_file = prefix + "/" + configfile
if os.path.isfile(abs_file):
fd = open(abs_file, "rb")

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-bh,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/xm/rmlabel.py.orig 2006-10-15 14:22:03.000000000 +0200
+++ python/xen/xm/rmlabel.py 2006-10-19 21:52:58.000000000 +0200
@@ -60,7 +60,7 @@
file = configfile
fd = open(file, "rb")
else:
- for prefix in [".", "/etc/xen"]:
+ for prefix in [".", "@XENDCONFDIR@"]:
file = prefix + "/" + configfile
if os.path.isfile(file):
fd = open(file, "rb")

View File

@@ -0,0 +1,25 @@
$NetBSD: patch-bo,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- xcutils/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ xcutils/Makefile 2007-05-27 14:37:57.000000000 +0200
@@ -24,7 +24,7 @@
PROGRAMS = xc_restore xc_save readnotes
-LDLIBS = -L$(XEN_LIBXC) -L$(XEN_XENSTORE) -lxenguest -lxenctrl -lxenstore
+LDLIBS = $(LDFLAGS) -L$(XEN_LIBXC) -L$(XEN_XENSTORE) -lxenguest -lxenctrl -lxenstore
.PHONY: all
all: build
@@ -37,9 +37,8 @@
.PHONY: install
install: build
- [ -d $(DESTDIR)$(PROGRAMS_INSTALL_DIR) ] || \
- $(INSTALL_DIR) $(DESTDIR)$(PROGRAMS_INSTALL_DIR)
- $(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(PROGRAMS_INSTALL_DIR)
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) $(PROGRAMS) ${DESTDIR}$(PREFIX)/bin
.PHONY: clean

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-br,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- xenstat/xentop/Makefile.orig 2007-01-08 16:00:52.000000000 +0100
+++ xenstat/xentop/Makefile 2007-04-25 18:43:18.000000000 +0200
@@ -33,9 +33,8 @@
.PHONY: install
install: xentop xentop.1
- $(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
- $(INSTALL_DIR) $(DESTDIR)$(man1dir)
- $(INSTALL_DATA) xentop.1 $(DESTDIR)$(man1dir)/xentop.1
+ $(BSD_INSTALL_PROGRAM) xentop ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_DATA) xentop.1 ${DESTDIR}$(PREFIX)/$(PKGMANDIR)/man1
endif

View File

@@ -0,0 +1,49 @@
$NetBSD: patch-bs,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- xenstore/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ xenstore/Makefile 2007-05-27 14:41:40.000000000 +0200
@@ -29,6 +29,7 @@
XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_linux.o
XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o
+XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_netbsd.o
XENSTORED_OBJS += $(XENSTORED_OBJS_y)
@@ -168,22 +169,20 @@
.PHONY: install
install: all
- $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
- $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
- $(INSTALL_DIR) $(DESTDIR)/usr/bin
- $(INSTALL_DIR) $(DESTDIR)/usr/sbin
- $(INSTALL_DIR) $(DESTDIR)/usr/include
- $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
- $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
- $(INSTALL_PROG) xenstore-control $(DESTDIR)/usr/bin
- $(INSTALL_PROG) xenstore-ls $(DESTDIR)/usr/bin
- $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
- $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
- ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenstore.so.$(MAJOR)
- ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenstore.so
- $(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
- $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
- $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_DATA_DIR) -p ${DESTDIR}$(PREFIX)/include
+ $(BSD_INSTALL_PROGRAM) xenstored ${DESTDIR}$(PREFIX)/sbin
+ $(BSD_INSTALL_PROGRAM) $(CLIENTS) ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) xenstore-control ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_PROGRAM) xenstore-ls ${DESTDIR}$(PREFIX)/bin
+ $(BSD_INSTALL_LIB_DIR) ${DESTDIR}$(PREFIX)/lib
+ $(BSD_INSTALL_LIB) libxenstore.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib
+ ln -sf libxenstore.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib/libxenstore.so.$(MAJOR)
+ ln -sf libxenstore.so.$(MAJOR) ${DESTDIR}$(PREFIX)/lib/libxenstore.so
+ $(BSD_INSTALL_LIB) libxenstore.a ${DESTDIR}$(PREFIX)/lib
+ $(BSD_INSTALL_DATA) xs.h ${DESTDIR}$(PREFIX)/include
+ $(BSD_INSTALL_DATA) xs_lib.h ${DESTDIR}$(PREFIX)/include
-include $(PROG_DEP)

View File

@@ -0,0 +1,78 @@
$NetBSD: patch-bt,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- /dev/null 2007-04-25 19:26:24.000000000 +0200
+++ xenstore/xenstored_netbsd.c 2007-04-25 19:28:19.000000000 +0200
@@ -0,0 +1,73 @@
+/******************************************************************************
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (C) 2005 Rusty Russell IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, version 2 of the
+ * License.
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+
+#include "xenstored_core.h"
+
+#define XENSTORED_PROC_KVA "/dev/xsd_kva"
+#define XENSTORED_PROC_PORT "/kern/xen/xsd_port"
+
+evtchn_port_t xenbus_evtchn(void)
+{
+ int fd;
+ int rc;
+ evtchn_port_t port;
+ char str[20];
+
+ fd = open(XENSTORED_PROC_PORT, O_RDONLY);
+ if (fd == -1)
+ return -1;
+
+ rc = read(fd, str, sizeof(str));
+ if (rc == -1)
+ {
+ int err = errno;
+ close(fd);
+ errno = err;
+ return -1;
+ }
+
+ str[rc] = '\0';
+ port = strtoul(str, NULL, 0);
+
+ close(fd);
+ return port;
+}
+
+void *xenbus_map(void)
+{
+ int fd;
+ void *addr;
+
+ fd = open(XENSTORED_PROC_KVA, O_RDWR);
+ if (fd == -1)
+ return NULL;
+
+ addr = mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
+ MAP_SHARED, fd, 0);
+
+ if (addr == MAP_FAILED)
+ addr = NULL;
+
+ close(fd);
+
+ return addr;
+}
+
+void xenbus_notify_running(void)
+{
+}

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-bw,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- xenstore/list.h.orig 2006-10-16 22:51:42.000000000 +0200
+++ xenstore/list.h 2006-10-16 22:51:57.000000000 +0200
@@ -3,6 +3,10 @@
/* Taken from Linux kernel code, but de-kernelized for userspace. */
#include <stddef.h>
+#undef LIST_HEAD_INIT
+#undef LIST_HEAD
+#undef INIT_LIST_HEAD
+
/*
* These are non-NULL pointers that will result in page faults
* under normal circumstances, used to verify that nobody uses

View File

@@ -0,0 +1,57 @@
$NetBSD: patch-ca,v 1.1 2008/03/08 13:59:39 bouyer Exp $
--- console/daemon/io.c.orig 2008-03-08 14:24:52.000000000 +0100
+++ console/daemon/io.c 2008-03-08 14:41:23.000000000 +0100
@@ -56,6 +56,7 @@
{
int domid;
int tty_fd;
+ int stty_fd;
bool is_dead;
struct buffer buffer;
struct domain *next;
@@ -160,6 +161,12 @@
char *data;
unsigned int len;
+ if ((dom->stty_fd = open(slave, O_RDONLY, 0)) == -1) {
+ dolog(LOG_ERR, "Failed to open slave tty %s for "
+ "domain-%d", slave, dom->domid);
+ goto out;
+ }
+
if (tcgetattr(master, &term) != -1) {
cfmakeraw(&term);
tcsetattr(master, TCSAFLUSH, &term);
@@ -444,6 +451,7 @@
{
if (d->tty_fd != -1) {
close(d->tty_fd);
+ close(d->stty_fd);
d->tty_fd = -1;
}
@@ -527,6 +535,7 @@
len = read(dom->tty_fd, msg, len);
if (len < 1) {
close(dom->tty_fd);
+ close(dom->stty_fd);
dom->tty_fd = -1;
if (domain_is_valid(dom->domid)) {
@@ -545,6 +554,7 @@
xc_evtchn_notify(dom->xce_handle, dom->local_port);
} else {
close(dom->tty_fd);
+ close(dom->stty_fd);
dom->tty_fd = -1;
shutdown_domain(dom);
}
@@ -564,6 +574,7 @@
dom->domid, len, errno);
close(dom->tty_fd);
+ close(dom->stty_fd);
dom->tty_fd = -1;
if (domain_is_valid(dom->domid)) {

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-cb,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- console/daemon/utils.c.orig 2006-10-16 22:55:37.000000000 +0200
+++ console/daemon/utils.c 2006-10-16 22:55:48.000000000 +0200
@@ -32,6 +32,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <string.h>
+#include <signal.h>
#include "xenctrl.h"
#include "utils.h"

View File

@@ -0,0 +1,24 @@
$NetBSD: patch-cc,v 1.3 2008/03/08 17:24:20 bouyer Exp $
--- console/client/main.c.orig 2007-05-18 16:45:21.000000000 +0200
+++ console/client/main.c 2007-05-27 14:43:14.000000000 +0200
@@ -34,7 +34,11 @@
#include <sys/select.h>
#include <err.h>
#include <errno.h>
+#ifndef __NetBSD__
#include <pty.h>
+#endif
+#include <string.h>
+
#include "xs.h"
@@ -289,6 +293,7 @@
err(errno, "Could not read tty from store");
}
+ init_term(spty, &attr);
init_term(STDIN_FILENO, &attr);
console_loop(spty, xs, path);
restore_term(STDIN_FILENO, &attr);

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-cd,v 1.2 2011/12/14 03:57:50 sbd Exp $
--- python/xen/util/auxbin.py.orig 2008-04-25 13:03:12.000000000 +0000
+++ python/xen/util/auxbin.py
@@ -16,9 +16,9 @@
#============================================================================
-LIB_32 = "/usr/lib"
-LIB_64 = "/usr/lib64"
-LIB_BIN_SUFFIX = "xen/bin"
+LIB_32 = "@PREFIX@/bin"
+LIB_64 = "@PREFIX@/bin"
+LIB_BIN_SUFFIX = ""
## The architectures on which the LIB_64 directory is used. This
# deliberately excludes ia64 and ppc64, and Solaris.

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-cf,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- xenstat/libxenstat/Makefile.orig 2007-05-18 16:45:21.000000000 +0200
+++ xenstat/libxenstat/Makefile 2007-05-27 14:45:56.000000000 +0200
@@ -31,6 +31,7 @@
OBJECTS-y=src/xenstat.o
OBJECTS-$(CONFIG_Linux) += src/xenstat_linux.o
OBJECTS-$(CONFIG_SunOS) += src/xenstat_solaris.o
+OBJECTS-$(CONFIG_NetBSD) += src/xenstat_netbsd.o
SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR)
WARN_FLAGS=-Wall -Werror
@@ -97,7 +98,7 @@
all-bindings: perl-bindings python-bindings
# The install-bindings target installs all the language bindings
-install-bindings: install-perl-bindings install-python-bindings
+install-bindings: install-python-bindings
$(BINDINGS): $(SHLIB) $(SHLIB_LINKS) src/xenstat.h

View File

@@ -0,0 +1,65 @@
$NetBSD: patch-cg,v 1.3 2013/04/11 19:57:52 joerg Exp $
--- xenstat/xentop/xentop.c.orig 2008-04-25 13:03:12.000000000 +0000
+++ xenstat/xentop/xentop.c
@@ -18,7 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <curses.h>
+#include <ncurses.h>
+#define vw_printw vwprintw
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
@@ -28,7 +29,11 @@
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
+#ifndef __NetBSD__
#include <linux/kdev_t.h>
+#else
+#include <stdarg.h>
+#endif
#include <xenstat.h>
@@ -251,7 +256,7 @@ static void fail(const char *str)
{
if(cwin != NULL && !isendwin())
endwin();
- fprintf(stderr, str);
+ fprintf(stderr, "%s", str);
exit(1);
}
@@ -752,10 +757,11 @@ void do_summary(void)
unsigned i, num_domains = 0;
unsigned long long used = 0;
xenstat_domain *domain;
+ time_t curt;
/* Print program name, current time, and number of domains */
- strftime(time_str, TIME_STR_LEN, TIME_STR_FORMAT,
- localtime(&curtime.tv_sec));
+ curt = curtime.tv_sec;
+ strftime(time_str, TIME_STR_LEN, TIME_STR_FORMAT, localtime(&curt));
num_domains = xenstat_node_num_domains(cur_node);
ver_str = xenstat_node_xen_version(cur_node);
print("xentop - %s Xen %s\n", time_str, ver_str);
@@ -921,6 +927,7 @@ void do_network(xenstat_domain *domain)
/* Output all VBD information */
void do_vbd(xenstat_domain *domain)
{
+#ifdef notyet
int i = 0;
xenstat_vbd *vbd;
unsigned num_vbds = 0;
@@ -952,6 +959,7 @@ void do_vbd(xenstat_domain *domain)
xenstat_vbd_rd_reqs(vbd),
xenstat_vbd_wr_reqs(vbd));
}
+#endif
}
static void top(void)

View File

@@ -0,0 +1,102 @@
$NetBSD: patch-ch,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- /dev/null 2007-05-27 19:36:35.000000000 +0200
+++ xenstat/libxenstat/src/xenstat_netbsd.c 2007-05-27 19:36:00.000000000 +0200
@@ -0,0 +1,97 @@
+/* libxenstat: statistics-collection library for Xen
+ * Copyright (C) International Business Machines Corp., 2005
+ * Authors: Josh Triplett <josht@us.ibm.com>
+ * Judy Fischbach <jfisch@us.ibm.com>
+ * David Hendricks <dhendrix@us.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <fcntl.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "xenstat_priv.h"
+
+#define SYSFS_VBD_PATH "/sys/devices/xen-backend/"
+
+struct priv_data {
+ FILE *procnetdev;
+ DIR *sysfsvbd;
+};
+
+static struct priv_data *
+get_priv_data(xenstat_handle *handle)
+{
+ if (handle->priv != NULL)
+ return handle->priv;
+
+ handle->priv = malloc(sizeof(struct priv_data));
+ if (handle->priv == NULL)
+ return (NULL);
+
+ ((struct priv_data *)handle->priv)->procnetdev = NULL;
+ ((struct priv_data *)handle->priv)->sysfsvbd = NULL;
+
+ return handle->priv;
+}
+
+/* Expected format of /proc/net/dev */
+static const char PROCNETDEV_HEADER[] =
+ "Inter-| Receive |"
+ " Transmit\n"
+ " face |bytes packets errs drop fifo frame compressed multicast|"
+ "bytes packets errs drop fifo colls carrier compressed\n";
+
+/* Collect information about networks */
+int xenstat_collect_networks(xenstat_node * node)
+{
+ /* XXX fixme: implement code to get stats from libkvm ! */
+ return 1;
+}
+
+/* Free network information in handle */
+void xenstat_uninit_networks(xenstat_handle * handle)
+{
+ struct priv_data *priv = get_priv_data(handle);
+ if (priv != NULL && priv->procnetdev != NULL)
+ fclose(priv->procnetdev);
+}
+
+static int read_attributes_vbd(const char *vbd_directory, const char *what, char *ret, int cap)
+{
+ /* XXX implement */
+ return 0;
+}
+
+/* Collect information about VBDs */
+int xenstat_collect_vbds(xenstat_node * node)
+{
+ return 1;
+}
+
+/* Free VBD information in handle */
+void xenstat_uninit_vbds(xenstat_handle * handle)
+{
+ struct priv_data *priv = get_priv_data(handle);
+ if (priv != NULL && priv->sysfsvbd != NULL)
+ closedir(priv->sysfsvbd);
+}

View File

@@ -0,0 +1,33 @@
$NetBSD: patch-cj,v 1.2 2008/03/03 16:45:27 hannken Exp $
--- python/xen/xend/osdep.py.orig 2008-01-31 11:06:54.000000000 +0100
+++ python/xen/xend/osdep.py 2008-03-02 13:38:39.000000000 +0100
@@ -22,15 +22,18 @@ import os
_scripts_dir = {
"Linux": "/etc/xen/scripts",
"SunOS": "/usr/lib/xen/scripts",
+ "NetBSD": "@XENDCONFDIR@/scripts",
}
_xend_autorestart = {
+ "NetBSD": True,
"Linux": True,
"SunOS": False,
}
_pygrub_path = {
- "SunOS": "/usr/lib/xen/bin/pygrub"
+ "SunOS": "/usr/lib/xen/bin/pygrub",
+ "NetBSD": "@PREFIX@/bin/pygrub",
}
_netback_type = {
@@ -93,7 +96,7 @@ _balloon_stat = {
def _get(var, default=None):
return var.get(os.uname()[0], default)
-scripts_dir = _get(_scripts_dir, "/etc/xen/scripts")
+scripts_dir = _get(_scripts_dir, "@XENDCONFDIR@/scripts")
xend_autorestart = _get(_xend_autorestart)
pygrub_path = _get(_pygrub_path, "/usr/bin/pygrub")
netback_type = _get(_netback_type, "netfront")

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-ck,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- xenstore/xs_lib.c.orig 2007-01-08 16:00:53.000000000 +0100
+++ xenstore/xs_lib.c 2007-04-26 13:16:40.000000000 +0200
@@ -79,8 +79,10 @@
if (s)
return s;
-#ifdef __linux__
+#if defined(__linux__)
return "/proc/xen/xenbus";
+#elif defined(__NetBSD__)
+ return "/kern/xen/xenbus";
#else
return "/dev/xen/xenbus";
#endif

View File

@@ -0,0 +1,47 @@
$NetBSD: patch-cm,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- ../docs/man/xend-config.sxp.pod.5.orig 2007-01-08 16:00:44.000000000 +0100
+++ ../docs/man/xend-config.sxp.pod.5 2007-04-28 19:21:52.000000000 +0200
@@ -4,7 +4,7 @@
=head1 SYNOPSIS
-/etc/xen/xend-config.sxp
+@XENDCONFDIR@/xend-config.sxp
=head1 DESCRIPTION
@@ -12,7 +12,7 @@
parameters which determine the behavior of the daemon at runtime.
The parameters are specified in S-expression format. See the example
-configuration file in I</etc/xen/xend-config.sxp> for details.
+configuration file in I<@XENDCONFDIR@/xend-config.sxp> for details.
=head1 OPTIONS
@@ -82,13 +82,13 @@
=item I<network-script>
-The name of the script in I</etc/xen/scripts> that will be run to
+The name of the script in I<@XENDCONFDIR@/scripts> that will be run to
setup the networking environment. This can be any name, but in
general is either I<network-bridge> or I<network-route>.
=item I<vif-script>
-The name of the script in I</etc/xen/scripts> that will be run to
+The name of the script in I<@XENDCONFDIR@/scripts> that will be run to
setup a virtual interface when it is created or destroyed. This needs
to (in general) work in unison with the I<network-script>.
@@ -113,7 +113,7 @@
The name of an application or script that can handle external device
migration, such as for example virtual TPM migration. An example
-script is I</etc/xen/scripts/external-device-migrate>.
+script is I<@XENDCONFDIR@/scripts/external-device-migrate>.
=back

View File

@@ -0,0 +1,36 @@
$NetBSD: patch-cn,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- ../docs/man/xmdomain.cfg.pod.5.orig 2007-01-08 16:00:44.000000000 +0100
+++ ../docs/man/xmdomain.cfg.pod.5 2007-04-28 19:21:52.000000000 +0200
@@ -4,9 +4,9 @@
=head1 SYNOPSIS
- /etc/xen/myxendomain
- /etc/xen/myxendomain2
- /etc/xen/auto/myxenautostarted
+ @XENDCONFDIR@/myxendomain
+ @XENDCONFDIR@/myxendomain2
+ @XENDCONFDIR@/auto/myxenautostarted
=head1 DESCRIPTION
@@ -14,14 +14,14 @@
domains to create from scratch. Each of these config files needs to
contain a number of required options, and may specify many more.
-Domain configuration files live in /etc/xen by default, if you store
+Domain configuration files live in @XENDCONFDIR@ by default, if you store
config files anywhere else the full path to the config file must be
specified in the I<xm create> command.
-/etc/xen/auto is a special case. Domain config files in that
+@XENDCONFDIR@/auto is a special case. Domain config files in that
directory will be started automatically at system boot if the
-xendomain init script is enabled. The contents of /etc/xen/auto
-should be symlinks to files in /etc/xen to allow I<xm create> to be
+xendomain init script is enabled. The contents of @XENDCONFDIR@/auto
+should be symlinks to files in @XENDCONFDIR@ to allow I<xm create> to be
used without full paths.
Options are specified by I<name = value> statements in the

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-co,v 1.2 2007/12/03 21:54:31 bouyer Exp $
--- ../docs/man/xm.pod.1.orig 2007-11-15 00:35:27.000000000 +0100
+++ ../docs/man/xm.pod.1 2007-12-03 12:44:09.000000000 +0100
@@ -76,7 +76,7 @@
I<name>=I<value> combinations.
I<configfile> can either be an absolute path to a file, or a relative
-path to a file located in /etc/xen.
+path to a file located in @XENDCONFDIR@.
Create will return B<as soon> as the domain is started. This B<does
not> mean the guest OS in the domain has actually booted, or is
@@ -101,7 +101,7 @@
xm create Fedora4
-This creates a domain with the file /etc/xen/Fedora4, and returns as
+This creates a domain with the file @XENDCONFDIR@/Fedora4, and returns as
soon as it is run.
=item I<without config file>
@@ -836,7 +836,7 @@
name pre-fix for the policy XML file. The preceding name parts are
translated into the local path pointing to the policy XML file
relative to the global policy root directory
-(/etc/xen/acm-security/policies). For example,
+(@XENDCONFDIR@/acm-security/policies). For example,
example.chwall_ste.client_v1 denotes the policy file
example/chwall_ste/client_v1-security_policy.xml relative to the
global policy root directory.
@@ -927,7 +927,7 @@
=over 4
This step creates client_v1.map and client_v1.bin files in
-/etc/xen/acm-security/policies/example/chwall_ste.
+@XENDCONFDIR@/acm-security/policies/example/chwall_ste.
xm makepolicy example.chwall_ste.client_v1

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-cp,v 1.1.1.1 2007/06/14 19:39:45 bouyer Exp $
--- ../xen/include/public/arch-x86/xen-x86_32.h.orig 2007-05-27 15:08:03.000000000 +0200
+++ ../xen/include/public/arch-x86/xen-x86_32.h 2007-05-27 15:08:44.000000000 +0200
@@ -103,7 +103,8 @@
(hnd).p = val; \
} while ( 0 )
#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
-#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
+#define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
+#define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
#endif
#ifndef __ASSEMBLY__

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-cq,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- ../xen/common/libelf/libelf-private.h.orig 2007-05-27 15:13:03.000000000 +0200
+++ ../xen/common/libelf/libelf-private.h 2007-05-27 15:14:20.000000000 +0200
@@ -33,6 +33,11 @@
#define bswap_16(x) BSWAP_16(x)
#define bswap_32(x) BSWAP_32(x)
#define bswap_64(x) BSWAP_64(x)
+#elif defined(__NetBSD__)
+#include <sys/bswap.h>
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
#else
#include <byteswap.h>
#endif

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-cr,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- libxc/xc_dom_core.c.orig 2007-05-27 15:17:22.000000000 +0200
+++ libxc/xc_dom_core.c 2007-05-27 15:17:39.000000000 +0200
@@ -122,7 +122,7 @@
memset(block, 0, sizeof(*block));
block->mmap_len = size;
block->mmap_ptr = mmap(NULL, block->mmap_len,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON,
-1, 0);
if ( block->mmap_ptr == MAP_FAILED )
{
@@ -354,7 +354,7 @@
{
mode = "anonymous memory";
phys->ptr = mmap(NULL, phys->count << page_shift,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON,
-1, 0);
if ( phys->ptr == MAP_FAILED )
{

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-cs,v 1.2 2007/12/03 21:54:31 bouyer Exp $
--- misc/xen-python-path.orig 2007-11-15 00:35:27.000000000 +0100
+++ misc/xen-python-path 2007-12-03 12:45:29.000000000 +0100
@@ -22,14 +22,14 @@
# take the first installed instance of auxbin that we find, and then run it
# to determine the correct path, appending that to sys.path.
-AUXBIN = 'xen/util/auxbin.py'
+AUXBIN = 'site-packages/xen/util/auxbin.py'
import os
import os.path
import sys
for p in ['python%s' % sys.version[:3], 'python']:
- for l in ['/usr/lib64', '/usr/lib']:
+ for l in ['@PREFIX@/lib']:
for k in ['', 'site-packages/']:
d = os.path.join(l, p, k)
if os.path.exists(os.path.join(d, AUXBIN)):

View File

@@ -0,0 +1,56 @@
$NetBSD: patch-ct,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- python/xen/xend/XendNode.py.orig 2007-05-18 16:45:21.000000000 +0200
+++ python/xen/xend/XendNode.py 2007-05-27 17:30:50.000000000 +0200
@@ -106,17 +106,15 @@
# We can run off the end of the cpuinfo list if domain0 does not
# have #vcpus == #pcpus. In that case we just replicate one that's
# in the hash table.
- if not cpuinfo.has_key(number):
- number = cpuinfo.keys()[0]
if arch.type == "x86":
self.cpus[u].update(
{ 'host' : self.uuid,
'features' : cpu_features,
- 'speed' : int(float(cpuinfo[number]['cpu MHz'])),
- 'vendor' : cpuinfo[number]['vendor_id'],
- 'modelname': cpuinfo[number]['model name'],
- 'stepping' : cpuinfo[number]['stepping'],
- 'flags' : cpuinfo[number]['flags'],
+ 'speed' : 0,
+ 'vendor' : 'unkown',
+ 'modelname': 'unkown',
+ 'stepping' : 'unkown',
+ 'flags' : 'unkown',
})
elif arch.type == "ia64":
self.cpus[u].update(
@@ -627,27 +625,7 @@
def parse_proc_cpuinfo():
cpuinfo = {}
- f = file('/proc/cpuinfo', 'r')
- try:
- p = -1
- d = {}
- for line in f:
- keyvalue = line.split(':')
- if len(keyvalue) != 2:
- continue
- key = keyvalue[0].strip()
- val = keyvalue[1].strip()
- if key == 'processor':
- if p != -1:
- cpuinfo[p] = d
- p = int(val)
- d = {}
- else:
- d[key] = val
- cpuinfo[p] = d
- return cpuinfo
- finally:
- f.close()
+ return cpuinfo
def instance():

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-cu,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- libxc/xc_dom_boot.c.orig 2007-05-27 17:55:28.000000000 +0200
+++ libxc/xc_dom_boot.c 2007-05-27 17:55:46.000000000 +0200
@@ -163,7 +163,7 @@
}
ptr = mmap(NULL, count << page_shift, PROT_READ | PROT_WRITE,
- MAP_SHARED, dom->guest_xc, 0);
+ MAP_SHARED | MAP_ANON, -1, 0);
if ( ptr == MAP_FAILED )
{
xc_dom_panic(XC_INTERNAL_ERROR,

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-cv,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
--- libxc/xc_hvm_build.c 2007-06-12 23:36:11.000000000 +0200
+++ libxc/xc_hvm_build.c.orig 2007-06-12 23:35:55.000000000 +0200
@@ -120,7 +120,7 @@
if ( entries == NULL )
goto err;
elf->dest = mmap(NULL, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE,
- MAP_SHARED, xch, 0);
+ MAP_ANON | MAP_SHARED, -1, 0);
if ( elf->dest == MAP_FAILED )
goto err;

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-cw,v 1.1 2007/11/17 16:45:32 bouyer Exp $
--- python/xen/xend/arch.py.orig 2007-11-17 16:30:03.000000000 +0100
+++ python/xen/xend/arch.py 2007-11-17 16:30:26.000000000 +0100
@@ -25,6 +25,7 @@
"i586": "x86",
"i686": "x86",
"x86_64": "x86",
+ "amd64": "x86",
"i86pc": "x86",
"ia64": "ia64",
"ppc": "powerpc",

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-cx,v 1.1 2007/12/03 21:54:31 bouyer Exp $
--- python/xen/xend/balloon.py.orig 2007-11-15 00:35:27.000000000 +0100
+++ python/xen/xend/balloon.py 2007-12-03 16:34:28.000000000 +0100
@@ -96,7 +96,6 @@
xoptions = XendOptions.instance()
dom0 = XendDomain.instance().privilegedDomain()
xc = xen.lowlevel.xc.xc()
- dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
try:
dom0_min_mem = xoptions.get_dom0_min_mem() * 1024
@@ -159,6 +158,7 @@
(need_mem, dom0_min_mem, dom0_min_mem,
free_mem + scrub_mem + dom0_alloc - dom0_min_mem))
else:
+ dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
dom0.setMemoryTarget(dom0_start_alloc_mb)
raise VmError(
('Not enough memory is available, and dom0 cannot'

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-cy,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/Makefile.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/Makefile 2008-03-01 11:52:28.000000000 +0000
@@ -2,7 +2,7 @@ XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
SUBDIRS-y = common ufs reiserfs iso9660 fat
-SUBDIRS-y += $(shell ./check-libext2fs)
+SUBDIRS-y += $(shell ${SHELL} check-libext2fs)
.PHONY: all
all install clean:

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-cz,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- libfsimage/Rules.mk.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/Rules.mk 2008-03-01 11:52:28.000000000 +0000
@@ -20,8 +20,8 @@ fs-all: $(FSLIB)
.PHONY: fs-install
fs-install: fs-all
- $(INSTALL_DIR) $(DESTDIR)/usr/$(FSDIR)
- $(INSTALL_PROG) $(FSLIB) $(DESTDIR)/usr/$(FSDIR)
+ $(BSD_INSTALL_LIB_DIR) ${DESTDIR}$(PREFIX)/lib/fs/$(FS)
+ $(BSD_INSTALL_LIB) $(FSLIB) ${DESTDIR}$(PREFIX)/lib/fs/$(FS)
$(FSLIB): $(PIC_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(SHLIB_CFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS)

View File

@@ -0,0 +1,36 @@
$NetBSD: patch-da,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- libfsimage/common/Makefile.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/common/Makefile 2008-03-01 11:52:28.000000000 +0000
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1.0
MINOR = 0
-CFLAGS += -Werror -Wp,-MD,.$(@F).d
+CFLAGS += -Werror -Wp,-MD,.$(@F).d -DFSIMAGE_FSDIR=\"$(PREFIX)/lib/fs\"
DEPS = .*.d
LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
@@ -22,14 +22,14 @@ all: $(LIB)
.PHONY: install
install: all
- [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
- [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
- $(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
- ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libfsimage.so.$(MAJOR)
- ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libfsimage.so
- $(INSTALL_DATA) fsimage.h $(DESTDIR)/usr/include
- $(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)/usr/include
- $(INSTALL_DATA) fsimage_grub.h $(DESTDIR)/usr/include
+ $(BSD_INSTALL_LIB_DIR) ${DESTDIR}$(PREFIX)/lib
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(PREFIX)/include
+ $(BSD_INSTALL_LIB) libfsimage.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib
+ ln -sf libfsimage.so.$(MAJOR).$(MINOR) ${DESTDIR}$(PREFIX)/lib/libfsimage.so.$(MAJOR)
+ ln -sf libfsimage.so.$(MAJOR) ${DESTDIR}$(PREFIX)/lib/libfsimage.so
+ $(BSD_INSTALL_DATA) fsimage.h ${DESTDIR}$(PREFIX)/include
+ $(BSD_INSTALL_DATA) fsimage_plugin.h ${DESTDIR}$(PREFIX)/include
+ $(BSD_INSTALL_DATA) fsimage_grub.h ${DESTDIR}$(PREFIX)/include
clean distclean:
rm -f $(PIC_OBJS) $(LIB)

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-db,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/common/fsimage_plugin.c.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/common/fsimage_plugin.c 2008-03-01 11:52:28.000000000 +0000
@@ -131,7 +131,10 @@ static int load_plugins(void)
int err;
int ret = -1;
-#ifdef __sun__
+#if defined(FSIMAGE_FSDIR)
+ if (fsdir == NULL)
+ fsdir = FSIMAGE_FSDIR;
+#elif defined(__sun__)
if (fsdir == NULL)
fsdir = "/usr/lib/fs";

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-dc,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/ext2fs/fsys_ext2fs.c.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/ext2fs/fsys_ext2fs.c 2008-03-01 11:52:28.000000000 +0000
@@ -594,7 +594,7 @@ ext2fs_dir (fsi_file_t *ffi, char *dirna
/* Find out how long our remaining name is. */
len = 0;
- while (dirname[len] && !isspace (dirname[len]))
+ while (dirname[len] && !isspace ((uint8_t)dirname[len]))
len++;
/* Get the symlink size. */
@@ -651,7 +651,7 @@ ext2fs_dir (fsi_file_t *ffi, char *dirna
}
/* if end of filename, INODE points to the file's inode */
- if (!*dirname || isspace (*dirname))
+ if (!*dirname || isspace ((uint8_t)*dirname))
{
if (!S_ISREG (INODE->i_mode))
{
@@ -678,7 +678,7 @@ ext2fs_dir (fsi_file_t *ffi, char *dirna
}
/* skip to next slash or end of filename (space) */
- for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/';
+ for (rest = dirname; (ch = *rest) && !isspace ((uint8_t)ch) && ch != '/';
rest++);
/* look through this directory and find the next filename component */

View File

@@ -0,0 +1,37 @@
$NetBSD: patch-dd,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/fat/fsys_fat.c.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/fat/fsys_fat.c 2008-03-01 11:52:29.000000000 +0000
@@ -301,7 +301,7 @@ fat_dir (fsi_file_t *ffi, char *dirname)
/* if we have a real file (and we're not just printing possibilities),
then this is where we want to exit */
- if (!*dirname || isspace (*dirname))
+ if (!*dirname || isspace ((uint8_t)*dirname))
{
if (attrib & FAT_ATTRIB_DIR)
{
@@ -325,7 +325,7 @@ fat_dir (fsi_file_t *ffi, char *dirname)
/* Directories don't have a file size */
filemax = INT_MAX;
- for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++);
+ for (rest = dirname; (ch = *rest) && !isspace ((uint8_t)ch) && ch != '/'; rest++);
*rest = 0;
@@ -426,12 +426,12 @@ fat_dir (fsi_file_t *ffi, char *dirname)
{
int i, j, c;
- for (i = 0; i < 8 && (c = filename[i] = tolower (dir_buf[i]))
+ for (i = 0; i < 8 && (c = filename[i] = tolower ((uint8_t)dir_buf[i]))
&& !isspace (c); i++);
filename[i++] = '.';
- for (j = 0; j < 3 && (c = filename[i + j] = tolower (dir_buf[8 + j]))
+ for (j = 0; j < 3 && (c = filename[i + j] = tolower ((uint8_t)dir_buf[8 + j]))
&& !isspace (c); j++);
if (j == 0)

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-de,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/iso9660/fsys_iso9660.c.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/iso9660/fsys_iso9660.c 2008-03-01 11:52:29.000000000 +0000
@@ -164,7 +164,7 @@ iso9660_dir (fsi_file_t *ffi, char *dirn
/* pathlen = strcspn(dirname, "/\n\t "); */
for (pathlen = 0 ;
dirname[pathlen]
- && !isspace(dirname[pathlen]) && dirname[pathlen] != '/' ;
+ && !isspace((uint8_t)dirname[pathlen]) && dirname[pathlen] != '/' ;
pathlen++)
;

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-df,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/reiserfs/fsys_reiserfs.c.orig 2008-01-31 10:06:54.000000000 +0000
+++ libfsimage/reiserfs/fsys_reiserfs.c 2008-03-01 11:52:29.000000000 +0000
@@ -1029,7 +1029,7 @@ reiserfs_dir (fsi_file_t *ffi, char *dir
/* Find out how long our remaining name is. */
len = 0;
- while (dirname[len] && !isspace (dirname[len]))
+ while (dirname[len] && !isspace ((uint8_t)dirname[len]))
len++;
if (filemax + len > sizeof (linkbuf) - 1)
@@ -1078,7 +1078,7 @@ reiserfs_dir (fsi_file_t *ffi, char *dir
/* if we have a real file (and we're not just printing possibilities),
then this is where we want to exit */
- if (! *dirname || isspace (*dirname))
+ if (! *dirname || isspace ((uint8_t)*dirname))
{
if (! S_ISREG (mode))
{
@@ -1109,7 +1109,7 @@ reiserfs_dir (fsi_file_t *ffi, char *dir
errnum = ERR_BAD_FILETYPE;
return 0;
}
- for (rest = dirname; (ch = *rest) && ! isspace (ch) && ch != '/'; rest++);
+ for (rest = dirname; (ch = *rest) && ! isspace ((uint8_t)ch) && ch != '/'; rest++);
*rest = 0;
# ifndef STAGE1_5

View File

@@ -0,0 +1,41 @@
$NetBSD: patch-dg,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/ufs/fsys_ufs.c.orig 2008-01-31 11:06:54.000000000 +0100
+++ libfsimage/ufs/fsys_ufs.c 2008-03-02 18:14:30.000000000 +0100
@@ -32,8 +32,9 @@
#define SUPERBLOCK ((struct fs *)(FSYS_BUF + 0x2000))
#define INODE ((struct icommon *)(FSYS_BUF + 0x1000))
#define DIRENT (FSYS_BUF + 0x4000)
+#define MAXBSIZE ((FSYS_BUFLEN - 0x4000) / 2)
#define INDIRBLK1 ((grub_daddr32_t *)(FSYS_BUF + 0x4000)) /* 2+ indir blk */
-#define INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x6000)) /* 1st indirect blk */
+#define INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x4000 + MAXBSIZE)) /* 1st indirect blk */
#define indirblk0 (*fsig_int1(ffi))
#define indirblk1 (*fsig_int2(ffi))
@@ -48,7 +49,8 @@ ufs_mount(fsi_file_t *ffi, const char *o
{
if (/*! IS_PC_SLICE_TYPE_SOLARIS(current_slice) || */
!devread(ffi, UFS_SBLOCK, 0, UFS_SBSIZE, (char *)SUPERBLOCK) ||
- SUPERBLOCK->fs_magic != UFS_MAGIC)
+ SUPERBLOCK->fs_magic != UFS_MAGIC ||
+ MAXBSIZE < SUPERBLOCK->fs_bsize)
return 0;
return 1;
@@ -72,13 +74,13 @@ ufs_dir(fsi_file_t *ffi, char *dirname)
while (*dirname == '/')
dirname++;
- while (inode && *dirname && !isspace(*dirname)) {
+ while (inode && *dirname && !isspace((uint8_t)*dirname)) {
if (!openi(ffi, inode))
return 0;
/* parse for next path component */
fname = dirname;
- while (*dirname && !isspace(*dirname) && *dirname != '/')
+ while (*dirname && !isspace((uint8_t)*dirname) && *dirname != '/')
dirname++;
ch = *dirname;
*dirname = 0; /* ensure null termination */

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-dh,v 1.2 2008/08/07 16:00:14 joerg Exp $
--- pygrub/Makefile.orig 2008-01-31 10:06:54.000000000 +0000
+++ pygrub/Makefile 2008-03-01 12:03:11.000000000 +0000
@@ -10,14 +10,12 @@ build:
.PHONY: install
ifndef XEN_PYTHON_NATIVE_INSTALL
-install: LIBPATH=$(shell PYTHONPATH=../python/xen/util python -c "import auxbin; print auxbin.libpath()")
+install: LIBPATH=$(shell PYTHONPATH=../py{}thon/xen/util python -c "import auxbin; print auxbin.libpath()")
install: all
- CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr" --prefix="" --install-lib="$(DESTDIR)$(LIBPATH)/python"
- $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
+ python setup.py install --root=${DESTDIR}
else
install: all
- CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)"
- $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
+ python setup.py install --root=${DESTDIR}
endif
.PHONY: clean

View File

@@ -0,0 +1,58 @@
$NetBSD: patch-di,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/common/fsimage_grub.c.orig 2008-01-31 11:06:54.000000000 +0100
+++ libfsimage/common/fsimage_grub.c 2008-03-01 18:59:27.000000000 +0100
@@ -204,6 +204,45 @@ int
fsig_devread(fsi_file_t *ffi, unsigned int sector, unsigned int offset,
unsigned int bufsize, char *buf)
{
+#ifdef __NetBSD__
+ off_t off;
+ ssize_t ret;
+ int n, r;
+ char tmp[512];
+
+ off = ffi->ff_fsi->f_off + ((off_t)sector * 512) + offset;
+
+ /*
+ * On NetBSD reads from a raw disk must be sector-aligned.
+ * Split the read into up to three parts to meet this requirement.
+ */
+
+ if ((n = (off & 511)) > 0) {
+ if ((r = 512 - n) > bufsize)
+ r = bufsize;
+ if ((ret = pread(ffi->ff_fsi->f_fd, tmp, 512, off - n)) < n + r)
+ return (0);
+ bcopy(tmp + n, buf, r);
+ buf += r;
+ bufsize -= r;
+ off += r;
+ }
+
+ if ((n = (bufsize & ~511)) > 0) {
+ if ((ret = pread(ffi->ff_fsi->f_fd, buf, n, off)) < n)
+ return (0);
+ buf += n;
+ bufsize -= n;
+ off += n;
+ }
+ if (bufsize > 0) {
+ if ((ret = pread(ffi->ff_fsi->f_fd, tmp, 512, off)) < bufsize)
+ return (0);
+ bcopy(tmp, buf, bufsize);
+ }
+
+ return (1);
+#else /* __NetBSD__ */
uint64_t off = ffi->ff_fsi->f_off + ((uint64_t)sector * 512) + offset;
ssize_t bytes_read = 0;
@@ -220,6 +259,7 @@ fsig_devread(fsi_file_t *ffi, unsigned i
}
return (1);
+#endif /* __NetBSD__ */
}
int

View File

@@ -0,0 +1,46 @@
$NetBSD: patch-dj,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- python/xen/xend/XendBootloader.py.orig 2008-01-31 11:06:54.000000000 +0100
+++ python/xen/xend/XendBootloader.py 2008-03-02 13:37:58.000000000 +0100
@@ -12,7 +12,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
-import os, select, errno, stat, signal
+import os, select, errno, stat, signal, tty
import random
import shlex
from xen.xend import sxp
@@ -43,6 +43,9 @@ def bootloader(blexec, disk, dom, quiet
log.error(msg)
raise VmError(msg)
+ if os.uname()[0] == "NetBSD" and disk.startswith('/dev/'):
+ disk = disk.replace("/dev/", "/dev/r")
+
mkdir.parents("/var/run/xend/boot/", stat.S_IRWXU)
while True:
@@ -63,12 +66,8 @@ def bootloader(blexec, disk, dom, quiet
# where we copy characters between the two master fds, as well as
# listening on the bootloader's fifo for the results.
- # Termios runes for very raw access to the pty master fds.
- attr = [ 0, 0, termios.CS8 | termios.CREAD | termios.CLOCAL,
- 0, 0, 0, [0] * 32 ]
-
(m1, s1) = pty.openpty()
- termios.tcsetattr(m1, termios.TCSANOW, attr)
+ tty.setraw(m1);
fcntl.fcntl(m1, fcntl.F_SETFL, os.O_NDELAY);
os.close(s1)
slavename = ptsname.ptsname(m1)
@@ -109,7 +108,7 @@ def bootloader(blexec, disk, dom, quiet
# record that this domain is bootloading
dom.bootloader_pid = child
- termios.tcsetattr(m2, termios.TCSANOW, attr)
+ tty.setraw(m2);
fcntl.fcntl(m2, fcntl.F_SETFL, os.O_NDELAY);
while True:
try:

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-dk,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- libfsimage/common/fsimage_grub.h.orig 2008-01-31 11:06:54.000000000 +0100
+++ libfsimage/common/fsimage_grub.h 2008-03-02 18:10:43.000000000 +0100
@@ -44,7 +44,7 @@ typedef struct fsig_plugin_ops {
} fsig_plugin_ops_t;
#define STAGE1_5
-#define FSYS_BUFLEN 0x8000
+#define FSYS_BUFLEN 0x40000
#define SECTOR_BITS 9
#define SECTOR_SIZE 0x200

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-dl,v 1.1 2008/03/03 16:45:27 hannken Exp $
--- pygrub/src/pygrub.orig 2008-03-02 18:25:22.000000000 +0100
+++ pygrub/src/pygrub 2008-03-03 12:15:22.000000000 +0100
@@ -240,10 +240,10 @@ class Grub:
if y > self.start_image + maxy:
break
if y == self.selected_image:
- attr = curses.A_REVERSE
- else:
- attr = 0
- self.entry_win.addstr(y + 1 - self.start_image, 2, i.title.ljust(70), attr)
+ self.entry_win.attron(curses.A_REVERSE)
+ self.entry_win.addstr(y + 1 - self.start_image, 2, i.title.ljust(70))
+ if y == self.selected_image:
+ self.entry_win.attroff(curses.A_REVERSE)
self.entry_win.refresh()
def edit_entry(self, origimg):
@@ -269,16 +269,17 @@ class Grub:
self.entry_win.box()
for idx in range(1, len(img.lines)):
# current line should be highlighted
- attr = 0
if idx == curline:
- attr = curses.A_REVERSE
+ self.entry_win.attron(curses.A_REVERSE)
# trim the line
l = img.lines[idx].ljust(70)
if len(l) > 70:
l = l[:69] + ">"
- self.entry_win.addstr(idx, 2, l, attr)
+ self.entry_win.addstr(idx, 2, l)
+ if idx == curline:
+ self.entry_win.attroff(curses.A_REVERSE)
self.entry_win.refresh()
c = self.screen.getch()

View File

@@ -0,0 +1,186 @@
$NetBSD: patch-dm,v 1.1 2009/03/05 19:43:32 bouyer Exp $
--- python/xen/util/pci.py.orig 2008-04-25 13:03:12.000000000 +0000
+++ python/xen/util/pci.py 2009-03-05 15:48:44.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/pkg/bin/python2.4
#
# PCI Device Information Class
# - Helps obtain information about which I/O resources a PCI device needs
@@ -6,52 +6,8 @@
# Author: Ryan Wilson <hap9@epoch.ncsc.mil>
import sys
-import os, os.path
-PROC_MNT_PATH = '/proc/mounts'
-PROC_PCI_PATH = '/proc/bus/pci/devices'
-PROC_PCI_NUM_RESOURCES = 7
-
-SYSFS_PCI_DEVS_PATH = '/bus/pci/devices'
-SYSFS_PCI_DEV_RESOURCE_PATH = '/resource'
-SYSFS_PCI_DEV_IRQ_PATH = '/irq'
-SYSFS_PCI_DEV_DRIVER_DIR_PATH = '/driver'
-SYSFS_PCI_DEV_VENDOR_PATH = '/vendor'
-SYSFS_PCI_DEV_DEVICE_PATH = '/device'
-SYSFS_PCI_DEV_SUBVENDOR_PATH = '/subsystem_vendor'
-SYSFS_PCI_DEV_SUBDEVICE_PATH = '/subsystem_device'
-
-PCI_BAR_IO = 0x01
-PCI_BAR_IO_MASK = ~0x03
-PCI_BAR_MEM_MASK = ~0x0f
-
-# Definitions from Linux: include/linux/pci.h
-def PCI_DEVFN(slot, func):
- return ((((slot) & 0x1f) << 3) | ((func) & 0x07))
-
-def find_sysfs_mnt():
- mounts_file = open(PROC_MNT_PATH,'r')
-
- for line in mounts_file:
- sline = line.split()
- if len(sline)<3:
- continue
-
- if sline[2]=='sysfs':
- return sline[1]
-
- return None
-
-class PciDeviceNotFoundError(Exception):
- def __init__(self,domain,bus,slot,func):
- self.domain = domain
- self.bus = bus
- self.slot = slot
- self.func = func
- self.name = "%04x:%02x:%02x.%01x"%(domain, bus, slot, func)
-
- def __str__(self):
- return ('PCI Device %s Not Found' % (self.name))
+KERN_PATH = '/kern/xen/pci/'
class PciDeviceParseError(Exception):
def __init__(self,msg):
@@ -69,94 +25,45 @@
self.irq = 0
self.iomem = []
self.ioports = []
- self.driver = None
+ self.driver = 'pciback'
self.vendor = None
self.device = None
self.subvendor = None
self.subdevice = None
- self.get_info_from_sysfs()
+ self.get_info_from_kern()
- def get_info_from_sysfs(self):
- try:
- sysfs_mnt = find_sysfs_mnt()
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to locate sysfs mount: %s (%d)' %
- (PROC_PCI_PATH, strerr, errno)))
+ def get_info_from_kern(self):
- if sysfs_mnt == None:
- return False
-
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_RESOURCE_PATH
+ path = KERN_PATH + self.name
+
try:
resource_file = open(path,'r')
- for i in range(PROC_PCI_NUM_RESOURCES):
- line = resource_file.readline()
- sline = line.split()
- if len(sline)<3:
- continue
-
- start = int(sline[0],16)
- end = int(sline[1],16)
- flags = int(sline[2],16)
- size = end-start+1
-
- if start!=0:
- if flags&PCI_BAR_IO:
- self.ioports.append( (start,size) )
+ for line in resource_file.readlines():
+ k, v = line.strip().split(':')
+ if k == 'vendor':
+ self.vendor = int(v.strip(), 16)
+ elif k == 'product':
+ self.device = int(v.strip(), 16)
+ elif k == 'subsys_vendor':
+ self.subvendor = int(v.strip(), 16)
+ elif k == 'subsys_product':
+ self.subdevice = int(v.strip(), 16)
+ elif k in ('I/O', 'mem'):
+ sline = map(str.strip, v.split('-'))
+
+ start = int(sline[0], 16)
+ end = int(sline[1], 16)
+ size = end - start + 1
+
+ if k == 'I/O':
+ self.ioports.append((start, size))
else:
- self.iomem.append( (start,size) )
-
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to open & read %s: %s (%d)' %
- (path, strerr, errno)))
-
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_IRQ_PATH
- try:
- self.irq = int(open(path,'r').readline())
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to open & read %s: %s (%d)' %
- (path, strerr, errno)))
+ self.iomem.append((start, size))
+ elif k == 'irq':
+ self.irq = int(v.strip())
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_DRIVER_DIR_PATH
- try:
- self.driver = os.path.basename(os.readlink(path))
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to read %s: %s (%d)' %
- (path, strerr, errno)))
-
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_VENDOR_PATH
- try:
- self.vendor = int(open(path,'r').readline(), 16)
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to open & read %s: %s (%d)' %
- (path, strerr, errno)))
-
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_DEVICE_PATH
- try:
- self.device = int(open(path,'r').readline(), 16)
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to open & read %s: %s (%d)' %
- (path, strerr, errno)))
-
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_SUBVENDOR_PATH
- try:
- self.subvendor = int(open(path,'r').readline(), 16)
- except IOError, (errno, strerr):
- raise PciDeviceParseError(('Failed to open & read %s: %s (%d)' %
- (path, strerr, errno)))
-
- path = sysfs_mnt+SYSFS_PCI_DEVS_PATH+'/'+ \
- self.name+SYSFS_PCI_DEV_SUBDEVICE_PATH
- try:
- self.subdevice = int(open(path,'r').readline(), 16)
except IOError, (errno, strerr):
raise PciDeviceParseError(('Failed to open & read %s: %s (%d)' %
(path, strerr, errno)))

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-dn,v 1.1 2009/03/05 19:43:32 bouyer Exp $
--- python/xen/xend/server/pciquirk.py.orig 2009-03-05 16:24:01.000000000 +0000
+++ python/xen/xend/server/pciquirk.py 2009-03-05 16:25:22.000000000 +0000
@@ -115,14 +115,14 @@
pci_perm_dev_config = ['']
else:
pci_perm_dev_config.insert(0, '')
- self.pci_perm_dev_config = pci_perm_dev_config
except Exception, ex:
raise XendError("Reading config file %s: %s" %
(PERMISSIVE_CONFIG_FILE,str(ex)))
else:
log.info("Config file does not exist: %s" % PERMISSIVE_CONFIG_FILE)
- self.pci_perm_dev_config = ['xend-pci-perm-devs']
+ pci_perm_dev_config = ['xend-pci-perm-devs']
+ self.pci_perm_dev_config = pci_perm_dev_config
devices = child_at(child(pci_perm_dev_config, 'unconstrained_dev_ids'),0)
if self.__matchPCIdev( devices ):
log.debug("Permissive mode enabled for PCI device [%s]" %

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-libxc_xc__dom__x86.c,v 1.1 2013/04/11 19:57:52 joerg Exp $
--- libxc/xc_dom_x86.c.orig 2013-03-25 20:08:33.000000000 +0000
+++ libxc/xc_dom_x86.c
@@ -418,7 +418,7 @@ static int start_info_x86_32(struct xc_d
xc_dom_printf("%s: called\n", __FUNCTION__);
memset(start_info, 0, sizeof(*start_info));
- sprintf(start_info->magic, dom->guest_type);
+ snprintf(start_info->magic, sizeof(start_info->magic), "%s", dom->guest_type);
start_info->nr_pages = dom->total_pages;
start_info->shared_info = shinfo << PAGE_SHIFT_X86;
start_info->pt_base = dom->pgtables_seg.vstart;
@@ -457,7 +457,7 @@ static int start_info_x86_64(struct xc_d
xc_dom_printf("%s: called\n", __FUNCTION__);
memset(start_info, 0, sizeof(*start_info));
- sprintf(start_info->magic, dom->guest_type);
+ snprintf(start_info->magic, sizeof(start_info->magic), "%s", dom->guest_type);
start_info->nr_pages = dom->total_pages;
start_info->shared_info = shinfo << PAGE_SHIFT_X86;
start_info->pt_base = dom->pgtables_seg.vstart;

View File

@@ -0,0 +1,28 @@
$NetBSD: patch-python_xen_util_xmlrpcclient.py,v 1.1 2012/05/14 15:39:52 manu Exp $
--- ../tools/python/xen/util/xmlrpcclient.py.orig 2012-05-14 17:14:52.000000000 +0200
+++ ../tools/python/xen/util/xmlrpcclient.py 2012-05-14 17:15:44.000000000 +0200
@@ -21,8 +21,9 @@
import socket
import string
import xmlrpclib
from types import StringTypes
+from sys import hexversion
try:
import SSHTransport
@@ -53,9 +54,12 @@
self.__handler = handler
return xmlrpclib.Transport.request(self, host, '/RPC2',
request_body, verbose)
def make_connection(self, host):
- return HTTPUnix(self.__handler)
+ if hexversion < 0x02070000:
+ return HTTPUnix(self.__handler)
+ else:
+ return HTTPUnixConnection(self.__handler)
# We need our own transport for HTTPS, because xmlrpclib.SafeTransport is
# broken -- it does not handle ERROR_ZERO_RETURN properly.

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-python_xen_util_xmlrpclib2.py,v 1.1 2012/05/14 15:39:52 manu Exp $
--- ../tools/python/xen/util/xmlrpclib2.py.orig 2012-05-14 17:15:51.000000000 +0200
+++ ../tools/python/xen/util/xmlrpclib2.py 2012-05-14 17:16:18.000000000 +0200
@@ -60,8 +60,9 @@
protocol_version = "HTTP/1.1"
def __init__(self, hosts_allowed, request, client_address, server):
self.hosts_allowed = hosts_allowed
+ self.disable_nagle_algorithm = False
SimpleXMLRPCRequestHandler.__init__(self, request, client_address,
server)
# this is inspired by SimpleXMLRPCRequestHandler's do_POST but differs