--- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.xend.init +++ xen-3.3-3.3.0/debian/xen-utils-3.3.xend.init @@ -0,0 +1,56 @@ +#!/bin/bash +### BEGIN INIT INFO +# Provides: xend +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: XEN control daemon +# Description: XEN control daemon +### END INIT INFO + +if ! grep -q "control_d" /proc/xen/capabilities ; then + exit 0 +fi + +# Wait for Xend to be up +function await_daemons_up +{ + i=1 + rets=10 + xend status + while [ $? -ne 0 -a $i -lt $rets ]; do + sleep 1 + echo -n . + i=$(($i + 1)) + xend status + done +} + +case "$1" in + start) + xend start + await_daemons_up + ;; + stop) + xend stop + ;; + status) + xend status + ;; + reload) + xend reload + ;; + restart|force-reload) + xend restart + await_daemons_up + ;; + *) + # do not advertise unreasonable commands that there is no reason + # to use with this device + echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}" + exit 1 +esac + +exit $? + --- xen-3.3-3.3.0.orig/debian/rules +++ xen-3.3-3.3.0/debian/rules @@ -0,0 +1,203 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) +srcver := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}') +VERSION := 3.3.0 +MAJOR := 3.3 +BUILD_DIR = debian/build +STAMPS_DIR = debian/stamps + +LDFLAGS := +export LDFLAGS + +export DH_OPTIONS + +ifneq (,$(filter $(DEB_HOST_ARCH), i386 lpia)) +ARCH := XEN_TARGET_ARCH=x86_32 +endif +ifneq (,$(amd64, $(DEB_HOST_ARCH))) +ARCH := XEN_TARGET_ARCH=x86_64 +endif + +setup: $(STAMPS_DIR)/setup +$(STAMPS_DIR)/setup: $(BUILD_DIR) $(STAMPS_DIR) setup-docs setup-hypervisor setup-tools setup-headers + dh_testdir + touch $@ + +srcfiles := $(filter-out debian, $(wildcard * .[^.]*)) +$(STAMPS_DIR)/setup-patch: + @rm -rf $(BUILD_DIR)/source + mkdir $(BUILD_DIR)/source + cp -a $(srcfiles) $(BUILD_DIR)/source + cd $(BUILD_DIR)/source/ ; QUILT_PATCHES=$(CURDIR)/debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2 + touch $@ + +$(STAMPS_DIR)/setup-docs: $(STAMPS_DIR)/setup-patch + @rm -rf $(BUILD_DIR)/build-docs + cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-docs + touch $@ + +$(STAMPS_DIR)/setup-hypervisor: $(STAMPS_DIR)/setup-patch + @rm -rf $(BUILD_DIR)/build-hypervisor + cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-hypervisor + touch $@ + +$(STAMPS_DIR)/setup-headers: $(STAMPS_DIR)/setup-patch + @rm -rf $(BUILD_DIR)/build-headers + cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-headers + touch $@ + +$(STAMPS_DIR)/setup-libs: $(STAMPS_DIR)/setup-patch + @rm -rf $(BUILD_DIR)/build-libs + cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-libs + touch $@ + +$(STAMPS_DIR)/setup-tools: $(STAMPS_DIR)/setup-patch + @rm -rf $(BUILD_DIR)/build-tools + cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-tools + touch $@ + +build: $(STAMPS_DIR)/build +$(STAMPS_DIR)/build: $(BUILD_DIR) $(STAMPS_DIR) $(STAMPS_DIR)/setup build-docs build-hypervisor build-tools + dh_testdir + touch $@ + +build-indep: + +$(STAMPS_DIR)/build-%: DIR=$(BUILD_DIR)/$(@F) + +$(STAMPS_DIR)/build-docs: $(STAMPS_DIR)/setup-docs + $(MAKE) -C $(DIR)/docs + touch $@ + +$(STAMPS_DIR)/build-hypervisor: $(STAMPS_DIR)/setup-hypervisor + $(MAKE) -C $(DIR)/xen $(ARCH) + touch $@ + +$(STAMPS_DIR)/build-tools: $(STAMPS_DIR)/setup-tools + $(MAKE) -C $(DIR)/tools + touch $@ + +setup-docs:: $(STAMPS_DIR)/setup-docs +build-docs:: $(STAMPS_DIR)/build-docs +setup-headers:: $(STAMPS_DIR)/setup-headers +build-headers:: $(STAMPS_DIR)/build-headers +setup-libs:: $(STAMPS_DIR)/setup-libs +build-libs:: $(STAMPS_DIR)/build-libs +build-hypervisor:: $(STAMPS_DIR)/build-hypervisor +setup-hypervisor:: $(STAMPS_DIR)/setup-hypervisor +ifneq (,$(filter amd64 i386 ia64 lpia, $(DEB_HOST_ARCH))) +build-tools:: $(STAMPS_DIR)/build-tools +install-tools-check:: install-tools +setup-tools:: $(STAMPS_DIR)/setup-tools +endif + +$(BUILD_DIR) $(STAMPS_DIR): + @[ -d $@ ] || mkdir $@ + +# This is to make dpatch-edit-patch work +unpatch: clean + +clean: + dh_testdir + rm -rf $(BUILD_DIR) $(STAMPS_DIR) + -rm debian/xen-utils-$(MAJOR).udev + dh_clean + +install-arch: install-hypervisor install-tools-check install-libs install-headers + +install-indep: install-docs + +install-docs: DH_OPTIONS = -pxen-docs-$(MAJOR) +install-docs: + dh_testdir + dh_testroot + + $(MAKE) -C $(BUILD_DIR)/build-docs/docs install DESTDIR=$(CURDIR)/debian/tmp + dh_install --sourcedir=debian/tmp + +install-hypervisor: + dh_testdir + dh_testroot + + mkdir debian/xen-hypervisor-$(MAJOR)/boot -p + cp $(BUILD_DIR)/build-hypervisor/xen/xen.gz debian/xen-hypervisor-$(MAJOR)/boot/xen-$(MAJOR).gz + +install-tools: DH_OPTIONS = -pxen-utils-$(MAJOR) -ppython-xen-${MAJOR} +install-tools: + dh_testdir + dh_testroot + + $(MAKE) -C $(BUILD_DIR)/build-tools/tools install XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=$(CURDIR)/debian/tmp DISTDIR=$(CURDIR)/debian/tmp + dh_install --sourcedir=debian/tmp + + cp $(CURDIR)/debian/tmp/etc/udev/xen-backend.rules debian/xen-utils-$(MAJOR).udev + +install-libs: DH_OPTIONS = -plibxen3 +install-libs: + dh_testdir + dh_testroot + + $(MAKE) -C $(BUILD_DIR)/build-tools/tools install XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=$(CURDIR)/debian/tmp DISTDIR=$(CURDIR)/debian/tmp + dh_install --sourcedir=debian/tmp + +install-headers: DH_OPTIONS = -plibxen3-dev +install-headers: + dh_testdir + dh_testroot + + $(MAKE) -C $(BUILD_DIR)/build-headers/xen install DESTDIR=$(CURDIR)/debian/tmp + $(MAKE) -C $(BUILD_DIR)/build-headers/tools install XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=$(CURDIR)/debian/tmp DISTDIR=$(CURDIR)/debian/tmp + + install $(BUILD_DIR)/build-headers/tools/xenstore/xs*.h $(CURDIR)/debian/tmp/usr/include + install -d $(CURDIR)/debian/tmp/usr/include/xen/linux + dh_install --sourcedir=debian/tmp + + +# Build architecture-independent files here. +binary-indep: install-indep + dh_testdir + dh_testroot + dh_installchangelogs -i + dh_installdocs -i + dh_installexamples -i + dh_link -i + dh_strip -i + dh_compress -i -X.pdf + dh_fixperms -i + dh_installdeb -i + dh_shlibdeps -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. +binary-arch: install-arch + dh_testdir + dh_testroot + dh_installchangelogs -s + dh_installdocs -s + dh_installexamples -s + dh_installinit -p xen-utils-$(MAJOR) --name xend -R -- defaults 20 21 + dh_installinit -p xen-utils-$(MAJOR) --name xendomains --no-restart-on-upgrade -- defaults 21 20 + dh_installudev + dh_installman -s + dh_link -s + dh_strip -s + dh_compress -s + dh_fixperms -s + dh_pycentral -s + #dh_python -s + dh_makeshlibs -s + dh_installdeb -s + dh_shlibdeps -s + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- xen-3.3-3.3.0.orig/debian/pycompat +++ xen-3.3-3.3.0/debian/pycompat @@ -0,0 +1,2 @@ +2 + --- xen-3.3-3.3.0.orig/debian/libxen3.install +++ xen-3.3-3.3.0/debian/libxen3.install @@ -0,0 +1,2 @@ +usr/lib/lib*.so.* +usr/lib/fs/*/fsimage.so --- xen-3.3-3.3.0.orig/debian/copyright +++ xen-3.3-3.3.0/debian/copyright @@ -0,0 +1,251 @@ +Xen was initially debianized by Adam Heath + +It was downloaded from http://www.cl.cam.ac.uk/netos/xen + +The project is partially hosted on sourceforge. It's homepage on sf redirects +to the above url. Part of the development is carried on at http://www.xensource.com + +Copyright: + + This package 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 dated June, 1991. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +This is the header of Xen 3.0 upstream COPYING file which clarifies a bit how +the licence is meant to be applied. The file continues with the complete text +of the GNU General Public Licence version 2, which is not included here as it +can be found on Debian GNU/Linux systems in `/usr/share/common-licenses/GPL-2'. + + + XEN NOTICE + ========== + +This license does *not* cover guest operating systems that use +Xen services via normal hypercalls - this is merely considered normal +use of Xen, and does *not* fall under the heading of "derived work". +Also note that the GPL below is copyrighted by the Free Software +Foundation, but the instance of code that it refers to (the Xen +virtual machine monitor) is copyrighted by me and others who actually +wrote it. + +Further note that the guest-OS interfacing header files, which +includes all files within the subdirectory include/public, are +*not* covered by the GPL but by a much weaker license: + include/public/COPYING + +Also note that the only valid version of the GPL as far as Xen is +concerned is _this_ particular version of the license (i.e., *only* +v2, not v2.2 or v3.x or whatever), unless explicitly otherwise +stated. + + -- Keir Fraser (on behalf of the Xen team) + +===================================================================== + + +As an exception, for the convenience of users who want to port other operating +systems to Xen, some files are licensed under a BSD-style licence. This licence +applies to all the files under the xen/include/public directory inside the +upstream tarball. This is the content of the COPYING file in that directory: + + +XEN NOTICE +========== + +This copyright applies to all files within this subdirectory. All +other files in the Xen source distribution are covered by version 2 of +the GNU General Public License. + + -- Keir Fraser (on behalf of the Xen team) + +===================================================================== + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (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. + + +And this, for reference, is the list of the files it applies to: + +xen/include/public/acm.h +xen/include/public/acm_ops.h +xen/include/public/arch-ia64.h +xen/include/public/arch-x86_32.h +xen/include/public/arch-x86_64.h +xen/include/public/dom0_ops.h +xen/include/public/event_channel.h +xen/include/public/grant_table.h +xen/include/public/hvm/hvm_info_table.h +xen/include/public/hvm/ioreq.h +xen/include/public/hvm/vmx_assist.h +xen/include/public/io/blkif.h +xen/include/public/io/console.h +xen/include/public/io/netif.h +xen/include/public/io/ring.h +xen/include/public/io/tpmif.h +xen/include/public/io/xenbus.h +xen/include/public/io/xs_wire.h +xen/include/public/memory.h +xen/include/public/nmi.h +xen/include/public/physdev.h +xen/include/public/sched.h +xen/include/public/sched_ctl.h +xen/include/public/trace.h +xen/include/public/vcpu.h +xen/include/public/version.h +xen/include/public/xen.h + +and all the files under tools/python/logging + +===================================================================== +There are other exceptions: +===================================================================== + +The files under extras/mini-os are under a BSD licence. + +The following files are under the LGPL licence version 2.1, which on a Debian +system resides in /usr/share/common-licenses/LGPL-2.1. Unless explicitely +specified only version 2.1 of the licence can be used. + +tools/examples/block-common.sh +tools/examples/locking.sh +tools/examples/logging.sh +tools/examples/vif-common.sh +tools/examples/vtpm-hotplug-common.sh +tools/examples/xen-hotplug-common.sh +tools/examples/xen-network-common.sh +tools/examples/xen-script-common.sh +tools/firmware/rombios/apmbios.S +tools/firmware/rombios/rombios.c +ioemu/COPYING.LIB +ioemu/cpu-all.h +ioemu/cpu-defs.h +ioemu/cpu.h +ioemu/exec-all.h +ioemu/exec.c +ioemu/hw/fmopl.c +ioemu/target-i386-dm/helper2.c +ioemu/thunk.c +ioemu/thunk.h + +all the files under tools/firmware/vgabios (licence v2.1 or above) +all the files under tools/python/xen +all the files under tools/xenstore +all the files under tools/vnet +all the files under tools/xenstat + +===================================================================== +tools/vtpm_manager license + +Copyright (c) 2005, Intel Corp. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +===================================================================== +Files tools/python/ license + + This software is Copyright (c) Zope Corporation (tm) and + Contributors. All rights reserved. + +This license has been certified as open source. It has also +been designated as GPL compatible by the Free Software +Foundation (FSF). + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the +following conditions are met: + +1. Redistributions in source code must retain the above + copyright notice, this list of conditions, and the following + disclaimer. + +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions, and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +3. The name Zope Corporation (tm) must not be used to + endorse or promote products derived from this software + without prior written permission from Zope Corporation. + +4. The right to distribute this software or to use it for + any purpose does not give you the right to use Servicemarks + (sm) or Trademarks (tm) of Zope Corporation. Use of them is + covered in a separate agreement (see + http://www.zope.com/Marks). + +5. If any files are modified, you must cause the modified + files to carry prominent notices stating that you changed + the files and the date of any change. + +Disclaimer + + THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS'' + AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL ZOPE CORPORATION OR ITS CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + +This software consists of contributions made by Zope +Corporation and many individuals on behalf of Zope +Corporation. Specific attributions are listed in the +accompanying credits file. + --- xen-3.3-3.3.0.orig/debian/libxen3-dev.install +++ xen-3.3-3.3.0/debian/libxen3-dev.install @@ -0,0 +1,4 @@ +usr/include/xen/* +usr/include/* +usr/lib/lib*.so +usr/lib/lib*.a --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.xendomains.default +++ xen-3.3-3.3.0/debian/xen-utils-3.3.xendomains.default @@ -0,0 +1,137 @@ +## Path: System/xen +## Description: xen domain start/stop on boot +## Type: string +## Default: +# +# The xendomains script can send SysRq requests to domains on shutdown. +# If you don't want to MIGRATE, SAVE, or SHUTDOWN, this may be a possibility +# to do a quick and dirty shutdown ("s e i u o") or at least sync the disks +# of the domains ("s"). +# +XENDOMAINS_SYSRQ="" + +## Type: integer +## Default: 100000 +# +# If XENDOMAINS_SYSRQ is set, this variable determines how long to wait +# (in microseconds) after each SysRq, so the domain has a chance to react. +# If you want to a quick'n'dirty shutdown via SysRq, you may want to set +# it to a relatively high value (1200000). +# +XENDOMAINS_USLEEP=100000 + +## Type: integer +## Default: 5000000 +# +# When creating a guest domain, it is sensible to allow a little time for it +# to get started before creating another domain or proceeding through the +# boot process. Without this, the booting guests will thrash the disk as they +# start up. This timeout (in microseconds) specifies the delay after guest +# domain creation. +# +XENDOMAINS_CREATE_USLEEP=5000000 + +## Type: string +## Default: "" +# +# Set this to a non-empty string if you want to migrate virtual machines +# on shutdown. The string will be passed to the xm migrate DOMID command +# as is: It should contain the target IP address of the physical machine +# to migrate to and optionally parameters like --live. Leave empty if +# you don't want to try virtual machine relocation on shutdown. +# If migration succeeds, neither SAVE nor SHUTDOWN will be executed for +# that domain. +# +XENDOMAINS_MIGRATE="" + +## Type: string +## Default: /var/lib/xen/save +# +# Directory to save running domains to when the system (dom0) is +# shut down. Will also be used to restore domains from if # XENDOMAINS_RESTORE +# is set (see below). Leave empty to disable domain saving on shutdown +# (e.g. because you rather shut domains down). +# If domain saving does succeed, SHUTDOWN will not be executed. +# +XENDOMAINS_SAVE=/var/lib/xen/save + +## Type: string +## Default: "--halt --wait" +# +# If neither MIGRATE nor SAVE were enabled or if they failed, you can +# try to shut down a domain by sending it a shutdown request. To do this, +# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting +# for the domain to be really down. Leave empty to skip domain shutdown. +# +XENDOMAINS_SHUTDOWN="--halt --wait" + +## Type: string +## Default: "--all --halt --wait" +# +# After we have gone over all virtual machines (resp. all automatically +# started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq, +# migrated, saved and/or shutdown according to the settings above, we +# might want to shutdown the virtual machines that are still running +# for some reason or another. To do this, set this variable to +# "--all --halt --wait", it will be passed to xm shutdown. +# Leave it empty not to do anything special here. +# (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY +# is set.) +# +XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait" + +## Type: boolean +## Default: true +# +# This variable determines whether saved domains from XENDOMAINS_SAVE +# will be restored on system startup. +# +XENDOMAINS_RESTORE=true + +## Type: string +## Default: /etc/xen/auto +# +# This variable sets the directory where domains configurations +# are stored that should be started on system startup automatically. +# Leave empty if you don't want to start domains automatically +# (or just don't place any xen domain config files in that dir). +# Note that the script tries to be clever if both RESTORE and AUTO are +# set: It will first restore saved domains and then only start domains +# in AUTO which are not running yet. +# Note that the name matching is somewhat fuzzy. +# +XENDOMAINS_AUTO=/etc/xen/auto + +## Type: boolean +## Default: false +# +# If this variable is set to "true", only the domains started via config +# files in XENDOMAINS_AUTO will be treated according to XENDOMAINS_SYSRQ, +# XENDOMAINS_MIGRATE, XENDOMAINS_SAVE, XENDMAINS_SHUTDOWN; otherwise +# all running domains will be. +# Note that the name matching is somewhat fuzzy. +# +XENDOMAINS_AUTO_ONLY=false + +## Type: integer +## Default: 300 +# +# On xendomains stop, a number of xm commands (xm migrate, save, shutdown, +# shutdown --all) may be executed. In the worst case, these commands may +# stall forever, which will prevent a successful shutdown of the machine. +# If this variable is non-zero, the script will set up a watchdog timer +# for every of these xm commands and time it out after the number of seconds +# specified by this variable. +# Note that SHUTDOWN_ALL will not be called if no virtual machines or only +# zombies are still running, so you don't need to enable this timeout just +# for the zombie case. +# The setting should be large enough to make sure that migrate/save/shutdown +# can succeed. If you do live migrations, keep in mind that live migration +# of a 1GB machine over Gigabit ethernet may actually take something like +# 100s (assuming that live migration uses 10% of the network # bandwidth). +# Depending on the virtual machine, a shutdown may also require a significant +# amount of time. So better setup this variable to a huge number and hope the +# watchdog never fires. +# +XENDOMAINS_STOP_MAXWAIT=300 + --- xen-3.3-3.3.0.orig/debian/compat +++ xen-3.3-3.3.0/debian/compat @@ -0,0 +1 @@ +4 --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.postinst +++ xen-3.3-3.3.0/debian/xen-utils-3.3.postinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + XENSTORED_DIR="/var/lib/xenstored" + [ ! -d "${XENSTORED_DIR}" ] && install -d -m 0700 "${XENSTORED_DIR}" + install -d -m 2750 -g adm /var/log/xen + + ;; + +abort-upgrade|abort-remove|abort-deconfigure) + ;; + +*) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- xen-3.3-3.3.0.orig/debian/xen-hypervisor-3.3.postinst +++ xen-3.3-3.3.0/debian/xen-hypervisor-3.3.postinst @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +case "$1" in + configure) + if command -v update-grub > /dev/null && [ -d /boot/grub ]; then + update-grub || : + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.README.Debian +++ xen-3.3-3.3.0/debian/xen-utils-3.3.README.Debian @@ -0,0 +1,95 @@ +Xen for Debian +-------------- + +* About /lib/tls: + + Since Xen guest machines have to work in non-contiguous areas of memory, + they cannot support a segmented glibc efficiently. If your glibc is + segmented Xen will have to emulate the support, with a high performance + penalty. To solve this problem you just have to execute this command: + + mv /lib/tls /lib/tls.disabled + + Unfortunately we cannot do this ourselves when you install Xen or at any + other time, without breaking the Debian Policy and thus provoke the Wrath of + the Gods. We know that this solution is not optimal, especially because + every time you upgrade the glibc package /lib/tls will be restored, and + you'll have to + + rm -rf /lib/tls.disabled + mv /lib/tls /lib/tls.disabled + + again. We'll be working towards a better solution, but for now this is it. + Please remember to always keep your system tls disabled. + + +* About the kernel: + + Unfortunately for now we cannot provide precompiled Linux Kernels with the + xen patch applied and configured to work in a Domain 0 or in an unprivileged + domain. The only thing we can give you is the patch, which is included in + the linux-patch-xen package. You are expected to install this package, + download a 2.6.12 kernel from kernel.org (this is the version supported by + xen right now. The patch will make it a 2.6.12.6+xen kernel) and roll your + own kernel. + + After you've done so you can add a section similar to this one to your + /boot/grub/menu.lst file in order to boot your xen system. (Only grub is + supported on Xen systems, if you're a LILO fan we're sorry, there's no way + you can use Xen without switching, and probably there will never be) + + title Debian Xen+GNU/Linux + root (hd0,0) + kernel /boot/xen.gz + module /boot/xen-linux-2.6.12.6xeno003 root=/dev/sda1 ro console=tty0 + boot + + Of course you have this example supplying your own kernel path and root + device in the module line in order to have a working Xen system after a + reboot. + + We will provide a "roll your own xen kernel" manual and example config files + later on. We also hope to be able to provide complete Xen kernels, sooner or + later, so don't despair! (Well, do, since in the meantime you have to do it + yourself anyway, if you want to try Xen... But don't give up now, compiling + a kernel is not hard, and trying Xen is worth learning how to do it!) + +* About networking: + + By default Xen modifies your networking configuration, creating a bridge. + To avoid breaking a machine's connection to the network the debian package + doesn't touch the network configuration unless requested. On the other hand + xen needs to connect the guest domains somewhere, in order for them to have + networking, and expects that the xen bridge exists. You should hand-tune + your networking configuration by editing /etc/xen/xend-config.sxp and + possibly /etc/network/interfaces to decide how to connect your domains to + the network. + +* About loop devices: + + If you plan hosting virtual domains with file backed block devices (ie. the + ones xen-tools creates by default) be careful about two issues: + + 1. Maximum number of loop devices + By default the loop driver supports a maximum of 8 loop devices. Of + course since every xen domain uses at least two (one for the data and one + for the swap) this number is absolutely insufficient. You should increase + it by adding a file named local-loop in /etc/modprobe.d containing the + string "options loop max_loop=128", if the loop driver is compiled as a + module, or by appending the string max_loop=128 to your kernel parameters + if the driver is in-kernel. Of course you can increase or decrease the + number 128 as you see fit. + + 2. Driver loading (only if loop is compiled as a module) + Normally the loop driver gets loaded when the first loop device is + accessed. When using udev, though, the loop devices get created only + after the driver gets loaded. This means that xen will fail if the loop + driver is not already loaded when it tries to start a file-backed virtual + domain. To fix this just add "loop" in your /etc/modules file, thus + forcing it to be loaded at boot time. + + +Kindly yours, + +Guido Trotter, for the Debian Xen Team. +(with a litte help from Ralph Passgang) --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.install +++ xen-3.3-3.3.0/debian/xen-utils-3.3.install @@ -0,0 +1,11 @@ +usr/sbin/* +usr/bin/* +usr/share/xen/* +etc/xen/auto +etc/xen/scripts +etc/xen/xend* +var/log/xen +usr/share/man/* +usr/lib/xen/* +usr/share/xen/qemu/* +etc/xen/qemu-ifup --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.postrm +++ xen-3.3-3.3.0/debian/xen-utils-3.3.postrm @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "$1" in +purge) + XENSTORED_DIR="/var/lib/xenstored" + [ -d "${XENSTORED_DIR}" ] && rm -r "${XENSTORED_DIR}" + ;; + +remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + +*) + echo "postrm called with unknown argument \`$1'" >&2 + exit + ;; +esac + +#DEBHELPER# + +exit 0 --- xen-3.3-3.3.0.orig/debian/xen-hypervisor-3.3.postrm +++ xen-3.3-3.3.0/debian/xen-hypervisor-3.3.postrm @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +case "$1" in + remove) + if command -v update-grub > /dev/null && [ -d /boot/grub ]; then + update-grub || : + fi + ;; + + purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- xen-3.3-3.3.0.orig/debian/changelog +++ xen-3.3-3.3.0/debian/changelog @@ -0,0 +1,810 @@ +xen-3.3 (3.3.0-1ubuntu14) natty; urgency=low + + * debian/control: added db-d on ghostscript. This fixes a FTBFS because of + missing ps2pdf command. + * gcc-4.5-fix.diff: fix FTBFS with gcc 4.5 with error: case value '3' not in + enumerated type 'const enum xs_perm_type' (LP: #720909) + + -- Fabrice Coutadeur Fri, 11 Mar 2011 07:02:22 +0000 + +xen-3.3 (3.3.0-1ubuntu13) natty; urgency=low + + * Rebuild to add support for python 2.7. + + -- Matthias Klose Fri, 03 Dec 2010 00:17:12 +0000 + +xen-3.3 (3.3.0-1ubuntu12) maverick; urgency=low + + * debian/patches/add_missing_header.diff + + Add missing include to fix implicit declaration of function + 'mkdir' error and hence FTBFS (LP: #596890) + + -- Bhavani Shankar Mon, 21 Jun 2010 19:34:44 +0530 + +xen-3.3 (3.3.0-1ubuntu11) karmic; urgency=low + + * debian/patches/fix-libxc-warning.diff: Fix an FTBFS by + conditionalizing out a spurious warning in libxc (LP: #393376). + + -- Evan Broder Mon, 29 Jun 2009 03:41:17 -0400 + +xen-3.3 (3.3.0-1ubuntu10) karmic; urgency=low + + * debian/patches/use-python-2.6.diff: Pass --install-layout=deb for the + brave new Python 2.6 world. + * Also rebuild for Python 2.6. (LP: #362691) + * debian/patches/suppress-python-2.6-warnings.diff: Patch out a few + DeprecationWarnings introduced in Python 2.6 + * debian/patches/gcc-4.4-fixes.diff: Fix some inline assembly to build + with gcc 4.4 + * debian/control: Make sure a dependency on a specific Python version + gets added. + * debian/control: Fix the Replaces line for libxen3 and libxen3-dev (LP: + #286450) + * debian/control: Fix a lintian warning in libxen3-dev's dependencies. + * debian/rules: Don't clean out debian/tmp between install stages. This + reunites some manpages with their long-lost packages. (LP: #346003) + * debian/rules: Clean up the debian/xen-utils-3.3.udev file created as + part of the build process. + * debian/rules: Restart xend after the upgrade is complete to be sure + pycentral installed the modules. + + -- Evan Broder Sat, 16 May 2009 18:01:24 -0400 + +xen-3.3 (3.3.0-1ubuntu9) jaunty; urgency=low + + * debian/xen-utils-3.3.install: Don't install udev rules this way + * debian/rules: Instead copy so debhelper can find them and use + dh_installudev to do the heavy lifting. + * debian/xen-utils-3.3.preinst: Remove symlink on upgrade, remove old + rules files if unmodified otherwise move to new filename. + * debian/xen-utils-3.3.postinst: Don't create symlink + * debian/xen-utils-3.3.postrm: No symlink to remove + * Bump build-depend on debhelper to install udev rules into + /lib/udev/rules.d, bump dependency on udev to get correct version. + + -- Scott James Remnant Tue, 13 Jan 2009 17:01:29 +0000 + +xen-3.3 (3.3.0-1ubuntu8) jaunty; urgency=low + + * debian/xen-utils-3.3.xendomains.init: fix cut bug (LP: #216761). + Patch by Carl Fooks + + -- Evan Broder Sat, 13 Dec 2008 12:35:28 -0500 + +xen-3.3 (3.3.0-1ubuntu7) intrepid; urgency=low + + * debian/libxen3.install: remove usr/lib/lib* + debian/libxen3-dev.install: add usr/lib/lib.*a + Install lib*.so and lib.*a only with the -dev package (LP: #264554). + + -- Michael Bienia Tue, 30 Sep 2008 17:30:43 +0200 + +xen-3.3 (3.3.0-1ubuntu6) intrepid; urgency=low + + * Update xen-ubuntu-fixes.diff. + + -- Chuck Short Sat, 13 Sep 2008 10:59:17 -0400 + +xen-3.3 (3.3.0-1ubuntu5) intrepid; urgency=low + + * debian/libxen3.install: Update for missing libraries. + + -- Chuck Short Wed, 03 Sep 2008 13:05:39 -0400 + +xen-3.3 (3.3.0-1ubuntu4) intrepid; urgency=low + + * debian/patches/fix-ioemu-amd64.diff: Make sure qemu-dm is installed + in the right place. + + -- Chuck Short Wed, 27 Aug 2008 09:22:31 -0400 + +xen-3.3 (3.3.0-1ubuntu3) intrepid; urgency=low + + * debian/control: Take xenner into account. (LP: #261783) + + -- Chuck Short Wed, 27 Aug 2008 08:49:27 -0400 + +xen-3.3 (3.3.0-1ubuntu2) intrepid; urgency=low + + * Update to xen-3.3.0 final. + + -- Chuck Short Tue, 26 Aug 2008 15:06:07 -0400 + +xen-3.3 (3.3.0-1ubuntu1) intrepid; urgency=low + + * Initial release based on 3.3.0-rc4. + * Dropped all previous patches since their were no longer needed. + * Re-diffed debian/patches/xen-ubuntu-fixes.diff + + -- Chuck Short Thu, 14 Aug 2008 10:28:57 -0400 + +xen-3.2 (3.2.0-0ubuntu10) hardy; urgency=low + + * debian/xen-utils-3.2.xendomains.init + - fix cut in the init script. (LP: #208300) + * debian/xen-utils-3.2.install (LP: #201765) + - fixed missing /etc/xen/qemu-ifup + * debian/patches/xen-ubuntu-fixes.diff + - Added fixes from xen-3.1 + * debian/xen-utils-3.2.xend.init + - Disable loading of modules since they are builtin into the kernel. + + -- Chuck Short Thu, 03 Apr 2008 15:28:08 -0400 + +xen-3.2 (3.2.0-0ubuntu9) hardy; urgency=low + + * Fixed typo in debian/rules. Init scripts are back. (LP: #191875) + * Disabled suse patches. (LP: #199533) + * Dont conflict with libxen3.0 (LP: #199467) + + -- Chuck Short Thu, 13 Mar 2008 07:24:42 -0400 + +xen-3.2 (3.2.0-0ubuntu8) hardy; urgency=low + + * Removed python-xml from depends. (LP: #199014) + * Conflict with python-xen-3.1. (LP: #196020) + + -- Chuck Short Thu, 06 Mar 2008 09:08:08 -0500 + +xen-3.2 (3.2.0-0ubuntu7) hardy; urgency=low + + * Really re-add the init script. + + -- Chuck Short Sun, 24 Feb 2008 08:52:21 -0500 + +xen-3.2 (3.2.0-0ubuntu6) hardy; urgency=low + + * Clear LDFLAGS values that might be set in the environment because + the Xen build uses them in a non-standard way. Thanks to Steve Langasek. + + -- Chuck Short Thu, 21 Feb 2008 07:07:18 -0500 + +xen-3.2 (3.2.0-0ubuntu5) hardy; urgency=low + + * Readded init script. (LP: #191875) + + -- Chuck Short Fri, 15 Feb 2008 19:58:12 -0500 + +xen-3.2 (3.2.0-0ubuntu4) hardy; urgency=low + + * Renamed libxen3.2 to libxen3. + + -- Chuck Short Wed, 06 Feb 2008 08:51:32 -0500 + +xen-3.2 (3.2.0-0ubuntu3) hardy; urgency=low + + * Fix FTBFS of xen-docs. + * Fix typo in python-xen-3.2.install. (LP: #187665) + + -- Chuck Short Thu, 31 Jan 2008 08:00:01 -0500 + +xen-3.2 (3.2.0-0ubuntu2) hardy; urgency=low + + * Updated to 3.2 final. + * Added build dependency on libxml2-dev. + + -- Chuck SHort Wed, 30 Jan 2008 12:22:26 -0500 + +xen-3.2 (3.2.0-0ubuntu1) hardy; urgency=low + + * Initial release based on 3.2.0 rc4. + * Updated build-depends. + * Added pciutils-dev to build-depends. + * Dropped xen-ioemu now in xen-utils. + * Dropped xen-docs. + * Dropped security fixes since it is now apart of upstream. + * Moved from dpatch in-favour of quilt. + + -- Chuck Short Fri, 11 Jan 2008 14:28:08 -0500 + +xen-3.1 (3.1.0-0ubuntu19) hardy; urgency=low + + * tools/examples/Makefile: call udevadm instead of udevinfo and thus + simply version comparisons + * tools/check/check_udev, install, install.sh: likewise + + -- Scott James Remnant Fri, 14 Dec 2007 16:50:48 +0000 + +xen-3.1 (3.1.0-0ubuntu18) gutsy; urgency=low + + * SECURITY UPDATE: Fix for ne200 in qemu + * Add xen-qemu-ne2000-CVE-2007-1321.dpatch: upstream fixes to fix qeumu ne2000 + * CVE-2007-1321 + + -- Chuck Short Wed, 10 Oct 2007 11:24:50 -0400 + +xen-3.1 (3.1.0-0ubuntu17) gutsy; urgency=low + + * Fix network bridge due to ifplugd changes (LP: #144711) + * Fix HVM so that mouse doesnt get stuck on the left side of the screen. + (LP: #140963) + + -- Chuck Short Sat, 06 Oct 2007 13:18:06 -0400 + +xen-3.1 (3.1.0-0ubuntu16) gutsy; urgency=low + + * SECURITY UPDATE: guest root can escape to host after reboot. + * Add pygrub-sanitize.dpatch: upstream fixes to protect pygrub + from possible malicious content in guest grub config file. + * References + CVE-2007-4993 + + -- Kees Cook Fri, 05 Oct 2007 10:10:53 -0700 + +xen-3.1 (3.1.0-0ubuntu15) gutsy; urgency=low + + * Build for lpia (still to do: add -mtune=i586). + * Avoid warning when built with gcc-4.2. + + -- Matthias Klose Thu, 23 Aug 2007 18:17:11 +0000 + +xen-3.1 (3.1.0-0ubuntu14) gutsy; urgency=low + + * Fix python libraries typo. + + -- Chuck Short Sun, 12 Aug 2007 06:41:28 -0400 + +xen-3.1 (3.1.0-0ubuntu13) gutsy; urgency=low + + * Fix xen-docs FTBFS. + + -- Chuck Short Mon, 06 Aug 2007 19:03:30 -0400 + +xen-3.1 (3.1.0-0ubuntu12) gutsy; urgency=low + + * lintian fixes. + * Various build fixes (Closes: #127405) + * Fix amd64 ftbfs (Closes: 128032) + * Fix python-xen-3.1 issue. (Closes: #128809) + * Fix missing xen-docs (Closes: #128881) + + -- Chuck Short Sun, 05 Aug 2007 21:18:09 -0400 + +xen-3.1 (3.1.0-0ubuntu11) gutsy; urgency=low + + * Bug fixes for (#127699) + + -- Chuck Short Mon, 23 Jul 2007 19:24:25 -0400 + +xen-3.1 (3.1.0-0ubuntu10) gutsy; urgency=low + + * Force rebuild for stupid typo again. + + -- Chuck Short Sun, 22 Jul 2007 07:02:38 -0400 + +xen-3.1 (3.1.0-0ubuntu9) gutsy; urgency=low + + * Fixes various typos found corrected by me. + + -- Chuck Short Sat, 21 Jul 2007 17:25:44 -0400 + +xen-3.1 (3.1.0-0ubuntu8) gutsy; urgency=low + + * Re-enabled amd64. + + -- Chuck Short Mon, 16 Jul 2007 23:02:42 +0000 + +xen-3.1 (3.1.0-0ubuntu7) gutsy; urgency=low + + * Temporarily disabled amd64 support. Since there is no kernel for it. + * Removed non-pae versions. + + -- Chuck Short Fri, 06 Jul 2007 10:16:26 -0400 + +xen-3.1 (3.1.0-0ubuntu6) gutsy; urgency=low + + * Fix various issues found by pitti. + * Updated debian/rules. + + -- Chuck Short Sun, 23 Jun 2007 08:52:15 -0400 + +xen-3.1 (3.1.0-0ubuntu5) gutsy; urgency=low + + * For real this time. + + -- Chuck Short Thu, 21 Jun 2007 21:33:32 -0400 + +xen-3.1 (3.1.0-0ubuntu4) gutsy; urgency=low + + * Fix FTBFS for AMD64. + + -- Chuck Short Thu, 21 Jun 2007 13:40:45 -0400 + +xen-3.1 (3.1.0-0ubuntu3) gutsy; urgency=low + + * Changes by Chuck Short: + * Re-enabled xen-docs. + * Added patch to disable pdf and ps docs since they were + not being built properly. + * Re-enabled non-pae xen hypervisor. + * Added patch to hardcode the configuration of XENFB. + * Updated debian/control. + + * Merged from xen-unstable.hg + * [DOCS] - fix docs when missing doxygen. + + -- Chuck Short Tue, 19 Jun 2007 20:37:17 -0400 + +xen-3.1 (3.1.0-0ubuntu2) gutsy; urgency=low + + * Fix FTBFS. + * Fixed typo in debian/control. + * Added build depends on texlive-latex-base + + * Merged from xen-unstable.hg + * [TOOLS] - Fix for waiting for devices to disconnect during the + end stage of migration. + * [XEND] - Tear down domain if device hotplug fails during startup. + * [VTPM] - Fix bug where enabling vtpm causes installation error. + * [XEND] - Give "xm start" a -c parameter for connecting to the + console. + * [XEND] - Fix checkname so that it detects duplicate domains. + * [HVM] - Prevent usb driver crashes in Windows. + * [XEND] - Fix duplicate random MAC generation. + * [LIBXC] - Fix fully-virtualized core dumps for 32-bit guests. + * [XENTOP] - Fix -b option (batch mode). + * [XENAPI] - Fix segfault in libxenapi. + * [HVM] - Fix for BSOD when "migrating" from Intel to AMD. + + -- Chuck Short Thu, 14 Jun 2007 20:00:43 -0400 + +xen-3.1 (3.1.0-0ubuntu1) gutsy; urgency=low + + * Resynchronized with debian: + * Dropped amd64-libdir-fixes. + * Dropped fedora-sync. + * Dropped noblktap. + * Dropped pygrub-fix-corruption. + * Dropped xen-console-select-vuln. + * Dropped xen-scripts. + * Added prefix-utils. + * Added prefix-ioemu. + * Updated debian/rules to make it more saner. + * Added XENFB tools support. + * Updated to xen-3.1 final. + + -- Chuck Short Wed, 2 May 2007 13:04:43 -0400 + +xen-3.0 (3.0.3-0ubuntu10) feisty; urgency=low + + * SECURITY UPDATE: local guest can read arbitrary files from host. + * debian/patches/xen-console-select-vuln.dpatch: remove console selection. + * References + http://bugzilla.redhat.com/bugzilla/attachment.cgi?id=149043 + CVE-2007-0998 + + -- Kees Cook Fri, 23 Mar 2007 10:21:46 -0700 + + +xen-3.0 (3.0.3-0ubuntu9) feisty; urgency=low + + * Remove depends on libreiserfs0.3-dev completely, disabling support, + but making this build. + + -- Tollef Fog Heen Wed, 14 Mar 2007 08:42:50 +0100 + +xen-3.0 (3.0.3-0ubuntu8) feisty; urgency=low + + * Build-depend on libreiserfs0.3-dev to fix FTBFS. + + -- Tollef Fog Heen Mon, 12 Mar 2007 16:16:27 +0100 + +xen-3.0 (3.0.3-0ubuntu7) feisty; urgency=low + + * Updated xend init script. (Closes #89133). + * Include pygrub (Closes: #85067). + * Resynchronize with redhat. + + -- Chuck Short Fri, 9 Mar 2007 19:07:12 -0500 + +xen-3.0 (3.0.3-0ubuntu6) feisty; urgency=low + + * Updated xen-utils. + * Set xen-docs to all architectures. + + -- Chuck Short Mon, 12 Feb 2007 12:58:03 -0500 + +xen-3.0 (3.0.3-0ubuntu5) feisty; urgency=low + + * Added dependency on libncurses5-devel. + * Readed blktap support. + + -- Chuck Short Mon, 29 Jan 2007 10:43:16 -0500 + +xen-3.0 (3.0.3-0ubuntu4) feisty; urgency=low + + * Added patches stolen from fedora. + * Dropped xen-vnc-password patch. + + -- Chuck Short Wed, 17 Jan 2007 13:08:21 -0500 + +xen-3.0 (3.0.3-0ubuntu3) feisty; urgency=low + + * Resynchronize with debian. + - Pathces: + - Dropped manpages, xen-ioemu-config, and amd64-fixes. + - Added prefix-ioemu, prefix-utils. + - Updated *.install to conside with the new patches that were added. + - Added xen-hypervisor*.install to configure grub when the hypervisor is + installed. + - Updated build-depends. + * Dropped xend-unix-socket.dpatch. Closes (#71789). + + + -- Chuck Short Mon, 8 Jan 2007 19:55:10 -0500 + +xen-3.0 (3.0.3-0ubuntu1) edgy; urgency=low + + * Update to Xen 3.0.3 final. + + -- Chuck Short Tue, 17 Oct 2006 20:17:59 -0400 + +xen-3.0 (3.0.3~rc5-0ubuntu1) edgy; urgency=low + + * Update to Xen 3.0.3 RC5. This should hopefully be the last release + candiate before 3.0.3 is released. + * Added patch from Andrew Mitchell to remove udev rules symlink. + + -- Chuck Short Sat, 14 Oct 2006 10:44:33 -0400 + +xen-3.0 (3.0.3~rc2-0ubuntu1) edgy; urgency=low + + * Update to Xen 3.0.3 RC2 + * Add python-xen3.0 dependency to xen-utils-3.0 (Malone: #63902 + + -- Andrew Mitchell Thu, 5 Oct 2006 16:42:00 +1300 + +xen-3.0 (3.0.3~rc1) edgy; urgency=low + + Changes by Chuck Short: + + * Updated to release candidate. + * Droped compiler_fixes patch no longer needed. + + Changes by Andrew Mitchell: + + * Add libxen3.0 & libxen3.0-dev packages. + * Enable xend-unix-server & xend-unix-path in default config. + + -- Chuck Short Sat, 30 Sep 2006 20:25:53 -0400 + +xen-3.0 (3.0.2+hg111412-5) edgy; urgency=low + + * Fix various issues that were hunted down by reading the forums. Please + open bugs in launchpad so that they can be tracked. + * Removed qemu-ifup from xen-utils. + + -- Chuck Short Tue, 19 Sep 2006 20:28:06 -0400 + +xen-3.0 (3.0.2+hg111412-4) edgy; urgency=low + + * Fix xen-ioemu. (Closes #61121) + * Added patchxen-ioemu-config.dpatch so that our ioemu is more closer to + debian. + + -- Chuck Short Mon, 18 Sep 2006 21:40:20 -0400 + +xen-3.0 (3.0.2+hg111412-3) edgy; urgency=low + + * Fix FTBFS. + + -- Chuck Short Mon, 11 Sep 2006 06:57:22 -0400 + +xen-3.0 (3.0.2+hg111412-2) edgy; urgency=low + + * Removed blktabctrl. + * Changed init script to load the necessary modules when Xen starts. + + -- Chuck Short Sun, 10 Sep 2006 17:49:39 -0400 + +xen-3.0 (3.0.2+hg111412-1) edgy; urgency=low + + * New version, based off of changeset 11412. + * Dropped libdir patch and compile_date patch. + * Refactored ubuntu-fixes. + + -- Chuck Short Sun, 3 Sep 2006 19:49:50 -0400 + +xen-3.0 (3.0.2+hg11127-9) edgy; urgency=low + + * Fix thinko. (Closes: #58076) + + -- Chuck Short Fri, 1 Sep 2006 08:35:30 -0400 + +xen-3.0 (3.0.2+hg11127-8) edgy; urgency=low + + * Added missing blktapctrl. [#57859] + + -- Chuck Short Sun, 27 Aug 2006 09:41:51 -0400 + +xen-3.0 (3.0.2+hg11127-7) edgy; urgency=low + + * Fix dependency problem on amd64 + + -- Chuck Short Sun, 13 Aug 2006 19:07:30 -0400 + +xen-3.0 (3.0.2+hg11127-6) edgy; urgency=low + + * Added amd64 support. + * Added suggestion for better error detection. (Closes: #55217). + * Added patch from Ian for better xen hotplug scripts performance + improvement. (Closes #55218). + * Added libc6-dev-amd64 as a build-depends for amd64. + + -- Chuck Short Mon, 7 Aug 2006 18:57:26 -0400 + +xen-3.0 (3.0.2+hg11127-5) edgy; urgency=low + + * Fixed overzealus removal of amd64. + + -- Chuck Short Wed, 2 Aug 2006 18:14:22 -0400 + +xen-3.0 (3.0.2+hg11127-4) edgy; urgency=low + + * Removed amd64 support for now since it is not building properly. + + -- Chuck Short Wed, 2 Aug 2006 10:43:13 -0400 + +xen-3.0 (3.0.2+hg11127-3) edgy; urgency=low + + * Changed /etc/xen/scripts to use bash. + * Create /var/run/xend and /var/run/xenstored when running the + xend init script. + + -- Chuck Short Tue, 1 Aug 2006 19:34:46 -0400 + +xen-3.0 (3.0.2+hg11127-2) edgy; urgency=low + + * Added missing shared object files. + + -- Chuck Short Sat, 29 Jul 2006 22:32:26 -0400 + +xen-3.0 (3.0.2+hg11127-1) edgy; urgency=low + + * Initial ubuntu release. + * Updated hg snapshot 1174. + * Added compilation fixes. + * Resynchronized debian's patches. + * Fixed preious FTBFS. + + -- Chuck Short Sat, 22 Jul 2006 18:09:07 +0000 + +xen-3.0 (3.0.2+hg9697-1) unstable; urgency=low + + [ Guido Trotter ] + * Update Standards Version + * Merge upstream fixes trunk (upstream 3.0.2-3 + a couple of fixes) + [ Bastian Blank ] + * Add xen-ioemu-3.0 package to support HVM guests (closes: #368496) + + -- Guido Trotter Wed, 31 May 2006 10:50:05 +0200 + +xen-3.0 (3.0.2+hg9681-1) unstable; urgency=low + + * Update xen-hypervisor-3.0-i386 and xen-hypervisor-3.0-i386-pae + descriptions, specifying what the difference between the two packages is + (closes: #366019) + * Merge upstream fixes trunk + + -- Guido Trotter Thu, 18 May 2006 15:25:02 +0200 + +xen-3.0 (3.0.2+hg9656-1) unstable; urgency=low + + * Merge upstream fixes trunk + - This includes a fix for CVE-2006-1056 + + -- Guido Trotter Thu, 27 Apr 2006 17:34:03 +0200 + +xen-3.0 (3.0.2+hg9651-1) unstable; urgency=low + + * Merge upstream fixes trunk + * Fix PAE disabled in pae build (Closes: #364875) + + -- Julien Danjou Wed, 26 Apr 2006 13:19:39 +0200 + +xen-3.0 (3.0.2+hg9646-1) unstable; urgency=low + + [ Guido Trotter ] + * Merge upstream fixes trunk + + [ Bastian Blank ] + * debian/patches/libdir.dpatch: Update to make xm save work + + -- Julien Danjou Mon, 24 Apr 2006 18:02:07 +0200 + +xen-3.0 (3.0.2+hg9611-1) unstable; urgency=low + + * Merge upstream bug fixes + * Fix bug with xend init.d script + + -- Julien Danjou Wed, 12 Apr 2006 17:35:35 +0200 + +xen-3.0 (3.0.2+hg9598-1) unstable; urgency=low + + * New upstream release + * Fix copyright file + + -- Julien Danjou Mon, 10 Apr 2006 17:02:55 +0200 + +xen-3.0 (3.0.1+hg8762-1) unstable; urgency=low + + * The "preserve our homes" release + * Now cooperatively maintained by the Debian Xen Team + * New upstream release (closes: #327493, #342249) + * Build depend on transfig (closes: #321157) + * Use gcc rather than gcc-3.4 to compile (closes: #323698) + * Split xen-hypervisor-3.0 and xen-utils-3.0 + * Build both normal and pae hypervisor packages + * Change maintainer and add uploaders field + * Add force-reload support for init script xendomains + * Remove dependency against bash + * Bump standards version to 3.6.2.2 + * xen-utils-3.0 conflicts and replaces xen + * Add dpatch structure to the package + * Remove build-dependency on gcc (it's build essential anyway) + * Make SrvServer.py not executable + * Create NEWS.Debian file with important upgrade notices + * Update copyright file + * Remove the linux-patch-xen package + * Removed useless build-dependencies: libncurses5-dev, wget + * Changed xendomains config path to /etc/default + * xen-utils-3.0 now provides xen-utils and xen-hypervisor-3.0-i386 & + xen-hypervisor-3.0-i386-pae & xen-hypervizor-amd64 now provide + xen-hypervisor + * Made xen-utils-3.0.postinst more fault-tolerant, so that upgrading + xen2 -> xen3 don't fail because of a running xen2 hypervisor + * Updated the "Replaces & Conflicts" + * Install only and correctly udev files + * Compile date is no more in current locale + * Add patch which add the debian version and maintainer in the version + string and removes the banner. + * Don't install unusable cruft in xen-utils + * Remove libxen packages (no stable API/ABI) + + -- Julien Danjou Wed, 5 Apr 2006 16:05:07 +0200 + +xen (2.0.6-1) unstable; urgency=low + + * Patches applied upstream: non-xen-init-exit.patch, add-build.patch, + python-install.patch, disable-html-docs.patch. + * New upstream released. Closes: #311336. + * Remove comparison to UML from xen short description. Closes: #317066. + * Make packages conflicts with 1.2 doc debs. Closes: #304285. + * Add iproute to xen depends, as it uses /bin/ip. Closes: #300488, + #317468. + + -- Adam Heath Wed, 06 Jul 2005 12:35:50 -0500 + +xen (2.0.5-3) experimental; urgency=low + + * Change priority/section to match the overrides file. + + -- Adam Heath Fri, 18 Mar 2005 12:43:50 -0600 + +xen (2.0.5-2) experimental; urgency=low + + * Mike McCallister , + Tommi Virtanen , Tom Hibbert : + Fix missing '.' in update-rc.d call in xen.postinst. Closes: #299384 + + -- Adam Heath Fri, 18 Mar 2005 11:39:56 -0600 + +xen (2.0.5-1) experimental; urgency=low + + * New upstream. + * Remove pic-lib.patch, tools-misc-TARGETS.patch, and clean-mttr.patch + as they have been applied upstream(in various forms). + * xend now starts at priority 20, stops at 21, while xendomains starts + at 21, and stops at 20. + + -- Adam Heath Fri, 11 Mar 2005 14:33:33 -0600 + +xen (2.0.4-4) experimental; urgency=low + + * Bah, major booboo. Add /boot to debian/xen.install, so xen.gz will + get shipped. Reported by Clint Adams . + + -- Adam Heath Tue, 15 Feb 2005 13:00:57 -0600 + +xen (2.0.4-3) experimental; urgency=low + + * Fix file overlap(/usr/share/doc/xen/examples/*) between xen and + xen-docs. Reported by Tupshin Harper . + + -- Adam Heath Sun, 06 Feb 2005 01:22:45 -0600 + +xen (2.0.4-2) experimental; urgency=low + + * Fix kernel patch generation. It was broken when I integrated with + debian's kernel source. I used a symlink, and diff doesn't follow + those. + + -- Adam Heath Sat, 05 Feb 2005 18:16:35 -0600 + +xen (2.0.4-1) experimental; urgency=low + + * New upstream. + * xen.deb can now install on a plain kernel; that is, the init scripts + exit successfully if /proc/xen/privcmd doesn't exist. This allows + for dual-boot setups. + * Manpages do not yet exist xend, xenperf, xensv, xfrd, nor xm. xend + xfrd are daemons, and take little if any options. I've not had a need + to use xenperf nor xensv yet. xm has nice built in help(xm help). + * Upstream now requires either linux 2.4.29, or 2.6.10. Since 2.4.29 is + not yet in debian, disable the 2.4 patch generation. Closes: #271245. + * Not certain how the kernel-patch-xen was empty. It's not now, with + the repackaging. Closes: #272299. + * Xen no longer produces kernel images, so problems about missing features + are no longer valid. Closes: #253924. + * Acknowledge nmu bugs: + * No longer build-depend on gcc 3.3, as the default gcc works. Closes: + #243048. + + -- Adam Heath Sat, 05 Feb 2005 18:04:27 -0600 + +xen (2.0.3-0.1) unstable; urgency=low + + * Changes from Tommi Virtanen: + * Added dh-kpatches and libcurl3-dev to Build-Depends. + * Add /etc/xen/sv/params.py and /etc/xen/xend/params.py. + * Add xmexample1 and xmexample2 to xen/doc/examples. + + -- Adam Heath Wed, 26 Jan 2005 10:55:07 -0600 + +xen (2.0.3-0) unstable; urgency=low + + * New upstream. Closes: #280733. + * Repackaged from scratch. + * Using unreleased patch management system. See debian/README.build. + * After extracting the .dsc, there are no special steps needed + * Those wanting to change the source, use the normal procedures for + any package, including using interdiff(or other tool) to send a + patch to me or the bts. + * No longer try to do anything fancy with regard to the layout of the + built kernels. Now, only patches are distributed. Please make use of + the xen support in kernel-package. + * Early preview release to #debian-devel. + + -- Adam Heath Tue, 25 Jan 2005 13:24:54 -0600 + +xen (1.2-4.1) unstable; urgency=high + + * NMU + * Remove gcc-3.2 from Build-Depends as isn't used during build + (Closes: #243048) + + -- Frank Lichtenheld Sat, 21 Aug 2004 17:42:28 +0200 + +xen (1.2-4) unstable; urgency=low + + * Added xen-docs.README.Debian, which explains the kernel image layout, + and contains references on the locations differ from what is mentioned + by the upstream documentation. Closes: #230345. + + -- Adam Heath Fri, 26 Mar 2004 17:36:41 -0600 + +xen (1.2-3) unstable; urgency=low + + * Add kernel-source-2.4.25 and kernel-patch-debian-2.4.25 to + Build-Depends-Indep. + + -- Adam Heath Tue, 23 Mar 2004 20:14:39 -0600 + +xen (1.2-2) unstable; urgency=low + + * xen: moved /boot/xen.gz to /usr/lib/kernels/xen-i386/images/vmlinuz + * kernel-image, kernel-modules: swapped i386/xeno to xeno/i386 in + /usr/lib/kernels. + * Add kernel-patch-nfs-swap deb. + * Apply additional patches to kernel-image-xen: + * nfs-group + * nfs-swap + + -- Adam Heath Thu, 04 Mar 2004 12:47:47 -0600 + +xen (1.2-1) unstable; urgency=low + + * Initial version. + + -- Adam Heath Tue, 02 Mar 2004 13:21:52 -0600 --- xen-3.3-3.3.0.orig/debian/control +++ xen-3.3-3.3.0/debian/control @@ -0,0 +1,71 @@ +Source: xen-3.3 +Section: misc +Priority: extra +Maintainer: Chuck Short +Build-Depends: debhelper (>= 7.0.17ubuntu2), libcurl3-dev, python-central (>= 0.5.6), python-all-dev, transfig, libsdl1.2-dev, libvncserver-dev, libjpeg-dev, bzip2, bcc, quilt, lsb-release, libc6-dev-i386 [amd64], libncurses5-dev, pciutils-dev, libxml2-dev,graphviz, gs-common, texlive-fonts-recommended, texlive-latex-recommended, ghostscript +XS-Python-Version: all +Standards-Version: 3.7.3.0 + +Package: xen-hypervisor-3.3 +Architecture: i386 amd64 +Provides: xen-hypervisor, xen-hypervisor-i386, xen-hypervisor-amd64 +Description: The Xen Hypervisor for i386 and amd64. + The hypervisor is the "core" for XEN itself. It gets booted by the boot loader + and controls cpu and memory, sharing them between your administrative domain + (Domain 0) and the virtual guest systems. + . + In order to boot a XEN system along with this package you also need a kernel + specifically crafted to work as the Domain 0, mediating hardware access for + XEN itself. An example config file for this kernel and documentation on how + to build it can be found in the xen-docs package. + . + This version of the hypervisor is built with support for systems with up to + 4GB of memory. If you have more please install the -pae version instead. + +Package: xen-utils-3.3 +Architecture: i386 amd64 +Depends: ${shlibs:Depends}, ${python:Depends}, python-xen-3.3, xen-hypervisor-3.3 | xenner, iproute, udev (>= 136-1) +Recommends: bridge-utils, libc6-xen +Provides: xen-utils +Conflicts: xen-utils, xen, libxen-python, libxen2.0, libxen2.0-dev, xen-utils-3.0 +Replaces: xen-utils-3.0 +XB-Python-Version: ${python:Versions} +Description: XEN administrative tools + The userspace tools to manage a system virtualized through the XEN virtual + machine monitor. + +Package: xen-docs-3.3 +Architecture: amd64 i386 +Replaces: xen-docs-3.0 +Description: documentation for XEN, a Virtual Machine Monitor + This package contains all the large documentation files for XEN. This + includes a description interface(both the api, and a nice explanation of + how XEN works). It also contains the VBD and Xeno howtos. + +Package: libxen3-dev +Architecture: amd64 i386 +Replaces: xen-utils-3.0 (<= 3.0.2+hg111412-5), libxen3.1-dev, libxen3.2-dev, libxen3.0-dev +Conflicts: libxen3.0-dev, libxen3.1-dev, libxen3.2-dev +Depends: libxen3 (= ${binary:Version}) +Description: headers for Xen, a Virtual Machine Monitor + This package provides headers for interfacing with the Xen hypervisor and + related libraries. + +Package: libxen3 +Architecture: amd64 i386 +Replaces: xen-utils-3.0 (<= 3.0.2+hg111412-5), libxen3.1, libxen3.2 +Conflicts: libxen3.2 +Depends: ${shlibs:Depends} +Description: library interface for Xen, a Virtual Machine Monitor + library interface for Xen, a Virtual Machine Monitor. This package + provides the libraries for interfacing with the Xen hypervisor. + +Package: python-xen-3.3 +Architecture: amd64 i386 +Depends: ${python:Depends}, python-dev +Replaces: xen-utils-3.0 (<= 3.0.2+hg111412-5), python-xen3.0, python-xen-3.2, python-xen-3.1 +Conflicts: python-xen3.0, python3.2 +XB-Python-Version: ${python:Versions} +Description: python bindings for Xen, a Virtual Machine Monitor + python bindings for Xen, a Virtual Machine Monitor. This package + provides the python bindings for xen, used for tools such as libvirt. --- xen-3.3-3.3.0.orig/debian/python-xen-3.3.install +++ xen-3.3-3.3.0/debian/python-xen-3.3.install @@ -0,0 +1 @@ +usr/lib/python* --- xen-3.3-3.3.0.orig/debian/docs +++ xen-3.3-3.3.0/debian/docs @@ -0,0 +1 @@ +README --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.xendomains.init +++ xen-3.3-3.3.0/debian/xen-utils-3.3.xendomains.init @@ -0,0 +1,516 @@ +#!/bin/bash +# +# /etc/init.d/xendomains +# Start / stop domains automatically when domain 0 boots / shuts down. +# +# chkconfig: 345 99 00 +# description: Start / stop Xen domains. +# +# This script offers fairly basic functionality. It should work on Redhat +# but also on LSB-compliant SuSE releases and on Debian with the LSB package +# installed. (LSB is the Linux Standard Base) +# +# Based on the example in the "Designing High Quality Integrated Linux +# Applications HOWTO" by Avi Alkalay +# +# +### BEGIN INIT INFO +# Provides: xendomains +# Required-Start: $syslog $remote_fs xend +# Should-Start: +# Required-Stop: $syslog $remote_fs xend +# Should-Stop: +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Start/stop secondary xen domains +# Description: Start / stop domains automatically when domain 0 +# boots / shuts down. +### END INIT INFO + +# Correct exit code would probably be 5, but it's enough +# if xend complains if we're not running as privileged domain +if ! [ -e /proc/xen/privcmd ]; then + exit 0 +fi + +LOCKFILE=/var/lock/xendomains +XENDOM_CONFIG=/etc/default/xendomains + +test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +. $XENDOM_CONFIG + +# Use the SUSE rc_ init script functions; +# emulate them on LSB, RH and other systems +if test -e /etc/rc.status; then + # SUSE rc script library + . /etc/rc.status +else + _cmd=$1 + declare -a _SMSG + if test "${_cmd}" = "status"; then + _SMSG=(running dead dead unused unknown) + _RC_UNUSED=3 + else + _SMSG=(done failed failed missed failed skipped unused failed failed) + _RC_UNUSED=6 + fi + if test -e /etc/init.d/functions; then + # REDHAT + . /etc/init.d/functions + echo_rc() + { + #echo -n " [${_SMSG[${_RC_RV}]}] " + if test ${_RC_RV} = 0; then + success " [${_SMSG[${_RC_RV}]}] " + else + failure " [${_SMSG[${_RC_RV}]}] " + fi + } + elif test -e /lib/lsb/init-functions; then + # LSB + . /lib/lsb/init-functions + if alias log_success_msg >/dev/null 2>/dev/null; then + echo_rc() + { + echo " [${_SMSG[${_RC_RV}]}] " + } + else + echo_rc() + { + if test ${_RC_RV} = 0; then + log_success_msg " [${_SMSG[${_RC_RV}]}] " + else + log_failure_msg " [${_SMSG[${_RC_RV}]}] " + fi + } + fi + else + # emulate it + echo_rc() + { + echo " [${_SMSG[${_RC_RV}]}] " + } + fi + rc_reset() { _RC_RV=0; } + rc_failed() + { + if test -z "$1"; then + _RC_RV=1; + elif test "$1" != "0"; then + _RC_RV=$1; + fi + return ${_RC_RV} + } + rc_check() + { + return rc_failed $? + } + rc_status() + { + rc_failed $? + if test "$1" = "-r"; then _RC_RV=0; shift; fi + if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi + if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi + if test "$1" = "-v"; then echo_rc; shift; fi + if test "$1" = "-r"; then _RC_RV=0; shift; fi + return ${_RC_RV} + } + rc_exit() { exit ${_RC_RV}; } + rc_active() + { + if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi + if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi + return 1 + } +fi + +if ! which usleep >&/dev/null +then + usleep() + { + if [ -n "$1" ] + then + sleep $(( $1 / 1000000 )) + fi + } +fi + +# Reset status of this service +rc_reset + +## +# Returns 0 (success) if the given parameter names a directory, and that +# directory is not empty. +# +contains_something() +{ + if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ] + then + return 0 + else + return 1 + fi +} + +# read name from xen config file +rdname() +{ + NM=$(xm create --quiet --dryrun --defconfig "$1" | + sed -n 's/^.*(name \(.*\))$/\1/p') +} + +rdnames() +{ + NAMES= + if ! contains_something "$XENDOMAINS_AUTO" + then + return + fi + for dom in $XENDOMAINS_AUTO/*; do + rdname $dom + if test -z $NAMES; then + NAMES=$NM; + else + NAMES="$NAMES|$NM" + fi + done +} + +parseln() +{ + name=`echo "$1" | cut -d\ -f1` + name=${name%% *} + rest=`echo "$1" | cut -d\ -f2-` + read id mem cpu vcpu state tm < <(echo "$rest") +} + +is_running() +{ + rdname $1 + RC=1 + while read LN; do + parseln "$LN" + if test "$id" = "0"; then continue; fi + case $name in + ($NM) + RC=0 + ;; + esac + done < <(xm list | grep -v '^Name') + return $RC +} + +start() +{ + if [ -f $LOCKFILE ]; then + echo -n "xendomains already running (lockfile exists)" + return; + fi + + saved_domains=" " + if [ "$XENDOMAINS_RESTORE" = "true" ] && + contains_something "$XENDOMAINS_SAVE" + then + mkdir -p $(dirname "$LOCKFILE") + touch $LOCKFILE + echo -n "Restoring Xen domains:" + saved_domains=`ls $XENDOMAINS_SAVE` + for dom in $XENDOMAINS_SAVE/*; do + echo -n " ${dom##*/}" + xm restore $dom + if [ $? -ne 0 ]; then + rc_failed $? + echo -n '!' + else + # mv $dom ${dom%/*}/.${dom##*/} + rm $dom + fi + done + echo . + fi + + if contains_something "$XENDOMAINS_AUTO" + then + touch $LOCKFILE + echo -n "Starting auto Xen domains:" + # We expect config scripts for auto starting domains to be in + # XENDOMAINS_AUTO - they could just be symlinks to files elsewhere + + # Create all domains with config files in XENDOMAINS_AUTO. + # TODO: We should record which domain name belongs + # so we have the option to selectively shut down / migrate later + # If a domain statefile from $XENDOMAINS_SAVE matches a domain name + # in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't + # restore correctly it requires administrative attention. + for dom in $XENDOMAINS_AUTO/*; do + echo -n " ${dom##*/}" + shortdom=$(echo $dom | sed -n 's/^.*\/\(.*\)$/\1/p') + echo $saved_domains | grep -w $shortdom > /dev/null + if [ $? -eq 0 ] || is_running $dom; then + echo -n "(skip)" + else + xm create --quiet --defconfig $dom + if [ $? -ne 0 ]; then + rc_failed $? + echo -n '!' + else + usleep $XENDOMAINS_CREATE_USLEEP + fi + fi + done + fi +} + +all_zombies() +{ + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + if test "$state" != "-b---d" -a "$state" != "-----d"; then + return 1; + fi + done < <(xm list | grep -v '^Name') + return 0 +} + +# Wait for max $XENDOMAINS_STOP_MAXWAIT for xm $1 to finish; +# if it has not exited by that time kill it, so the init script will +# succeed within a finite amount of time; if $2 is nonnull, it will +# kill the command as well as soon as no domain (except for zombies) +# are left (used for shutdown --all). +watchdog_xm() +{ + if test -z "$XENDOMAINS_STOP_MAXWAIT" -o "$XENDOMAINS_STOP_MAXWAIT" = "0"; then + exit + fi + usleep 20000 + for no in `seq 0 $XENDOMAINS_STOP_MAXWAIT`; do + # exit if xm save/migrate/shutdown is finished + PSAX=`ps axlw | grep "xm $1" | grep -v grep` + if test -z "$PSAX"; then exit; fi + echo -n "."; sleep 1 + # go to kill immediately if there's only zombies left + if all_zombies && test -n "$2"; then break; fi + done + sleep 1 + read PSF PSUID PSPID PSPPID < <(echo "$PSAX") + # kill xm $1 + kill $PSPID >/dev/null 2>&1 +} + +stop() +{ + # Collect list of domains to shut down + if test "$XENDOMAINS_AUTO_ONLY" = "true"; then + rdnames + fi + echo -n "Shutting down Xen domains:" + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + echo -n " $name" + if test "$XENDOMAINS_AUTO_ONLY" = "true"; then + case $name in + ($NAMES) + # nothing + ;; + (*) + echo -n "(skip)" + continue + ;; + esac + fi + # XENDOMAINS_SYSRQ chould be something like just "s" + # or "s e i u" or even "s e s i u o" + # for the latter, you should set XENDOMAINS_USLEEP to 1200000 or so + if test -n "$XENDOMAINS_SYSRQ"; then + for sysrq in $XENDOMAINS_SYSRQ; do + echo -n "(SR-$sysrq)" + xm sysrq $id $sysrq + if test $? -ne 0; then + rc_failed $? + echo -n '!' + fi + # usleep just ignores empty arg + usleep $XENDOMAINS_USLEEP + done + fi + if test "$state" = "-b---d" -o "$state" = "-----d"; then + echo -n "(zomb)" + continue + fi + if test -n "$XENDOMAINS_MIGRATE"; then + echo -n "(migr)" + watchdog_xm migrate & + WDOG_PID=$! + xm migrate $id $XENDOMAINS_MIGRATE + if test $? -ne 0; then + rc_failed $? + echo -n '!' + kill $WDOG_PID >/dev/null 2>&1 + else + kill $WDOG_PID >/dev/null 2>&1 + continue + fi + fi + if test -n "$XENDOMAINS_SAVE"; then + echo -n "(save)" + watchdog_xm save & + WDOG_PID=$! + mkdir -p "$XENDOMAINS_SAVE" + xm save $id $XENDOMAINS_SAVE/$name + if test $? -ne 0; then + rc_failed $? + echo -n '!' + kill $WDOG_PID >/dev/null 2>&1 + else + kill $WDOG_PID >/dev/null 2>&1 + continue + fi + fi + if test -n "$XENDOMAINS_SHUTDOWN"; then + # XENDOMAINS_SHUTDOWN should be "--halt --wait" + echo -n "(shut)" + watchdog_xm shutdown & + WDOG_PID=$! + xm shutdown $id $XENDOMAINS_SHUTDOWN + if test $? -ne 0; then + rc_failed $? + echo -n '!' + fi + kill $WDOG_PID >/dev/null 2>&1 + fi + done < <(xm list | grep -v '^Name') + + # NB. this shuts down ALL Xen domains (politely), not just the ones in + # AUTODIR/* + # This is because it's easier to do ;-) but arguably if this script is run + # on system shutdown then it's also the right thing to do. + if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then + # XENDOMAINS_SHUTDOWN_ALL should be "--all --halt --wait" + echo -n " SHUTDOWN_ALL " + watchdog_xm shutdown 1 & + WDOG_PID=$! + xm shutdown $XENDOMAINS_SHUTDOWN_ALL + if test $? -ne 0; then + rc_failed $? + echo -n '!' + fi + kill $WDOG_PID >/dev/null 2>&1 + fi + + # Unconditionally delete lock file + rm -f $LOCKFILE +} + +check_domain_up() +{ + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + case $name in + ($1) + return 0 + ;; + esac + done < <(xm list | grep -v "^Name") + return 1 +} + +check_all_auto_domains_up() +{ + if ! contains_something "$XENDOMAINS_AUTO" + then + return 0 + fi + missing= + for nm in $XENDOMAINS_AUTO/*; do + rdname $nm + found=0 + if check_domain_up "$NM"; then + echo -n " $name" + else + missing="$missing $NM" + fi + done + if test -n "$missing"; then + echo -n " MISS AUTO:$missing" + return 1 + fi + return 0 +} + +check_all_saved_domains_up() +{ + if ! contains_something "$XENDOMAINS_SAVE" + then + return 0 + fi + missing=`/bin/ls $XENDOMAINS_SAVE` + echo -n " MISS SAVED: " $missing + return 1 +} + +# This does NOT necessarily restart all running domains: instead it +# stops all running domains and then boots all the domains specified in +# AUTODIR. If other domains have been started manually then they will +# not get restarted. +# Commented out to avoid confusion! + +restart() +{ + stop + start +} + +reload() +{ + restart +} + + +case "$1" in + start) + start + rc_status + if test -f $LOCKFILE; then rc_status -v; fi + ;; + + stop) + stop + rc_status -v + ;; + + restart) + restart + ;; + reload) + reload + ;; + force-reload) + reload + ;; + status) + echo -n "Checking for xendomains:" + if test ! -f $LOCKFILE; then + rc_failed 3 + else + check_all_auto_domains_up + rc_status + check_all_saved_domains_up + rc_status + fi + rc_status -v + ;; + + *) + echo "Usage: $0 {start|stop|restart|reload|status}" + rc_failed 3 + rc_status -v + ;; +esac + +rc_exit --- xen-3.3-3.3.0.orig/debian/xen-utils-3.3.preinst +++ xen-3.3-3.3.0/debian/xen-utils-3.3.preinst @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +if [ "$1" = install ] || [ "$1" = upgrade ]; then + if [ -L "/etc/udev/rules.d/z60_xen-backend.rules"]; then + rm -f "/etc/udev/rules.d/z60_xen-backend.rules" + fi + + if [ -e "/etc/udev/xen-backend.rules" ]; then + if [ "`md5sum \"/etc/udev/xen-backend.rules\" | sed -e \"s/ .*//\"`" = \ + "`dpkg-query -W -f='${Conffiles}' xen-utils-3.3 | sed -n -e \"\\\\' /etc/udev/xen-backend.rules's/.* //p\"`" ] + then + rm -f "/etc/udev/xen-backend.rules" + else + mv "/etc/udev/xen-backend.rules" "/etc/udev/rules.d/40-xen-utils-3.3.rules" + fi + fi +fi + +#DEBHELPER# --- xen-3.3-3.3.0.orig/debian/patches/xen-snapshot-3.3.0.diff +++ xen-3.3-3.3.0/debian/patches/xen-snapshot-3.3.0.diff @@ -0,0 +1,1611 @@ +diff -r 2c63cf7b042d -r 566ee473fc27 .hgignore +--- a/.hgignore Tue Aug 12 10:23:34 2008 +0100 ++++ b/.hgignore Fri Aug 22 10:45:30 2008 +0100 +@@ -90,20 +90,16 @@ + ^stubdom/gcc-.*$ + ^stubdom/include$ + ^stubdom/ioemu$ +-^stubdom/libxc$ ++^stubdom/libxc-.*$ + ^stubdom/lwip-.*$ + ^stubdom/mini-os-.*$ +-^stubdom/mk-headers$ ++^stubdom/mk-headers-.*$ + ^stubdom/newlib-.*$ + ^stubdom/pciutils-.*$ + ^stubdom/zlib-.*$ +-^stubdom/grub-cvs$ +-^stubdom/grub/stage2$ +-^stubdom/grub/netboot$ +-^stubdom/grub/dirs$ ++^stubdom/grub-.*$ + ^stubdom/lwip/ + ^stubdom/ioemu/ +-^stubdom/grub-upstream/ + ^tools/.*/build/lib.*/.*\.py$ + ^tools/blktap/Makefile\.smh$ + ^tools/blktap/drivers/blktapctrl$ +diff -r 2c63cf7b042d -r 566ee473fc27 .hgtags +--- a/.hgtags Tue Aug 12 10:23:34 2008 +0100 ++++ b/.hgtags Fri Aug 22 10:45:30 2008 +0100 +@@ -29,3 +29,7 @@ + dde12ff94c96331668fe38a7b09506fa94d03c34 3.3.0-rc2 + 57fca3648f25dcc085ee380954342960a7979987 3.3.0-rc3 + 96d0a48e87ee46ba7b73e8c906a7e2e0baf60e2e 3.3.0-rc4 ++b4dba6a0e97cb6dd080fa566468e3cc972c34d7a 3.3.0-rc5 ++bc372510f1794ee41a8b0501cc84f8a65d05e094 3.3.0-rc6 ++daf1193bcd11345d566a4747fe1f12c90b44452c 3.3.0-rc7 ++18eff064c628c5b1c8cec49b5de265395843e5b1 RELEASE-3.3.0 +diff -r 2c63cf7b042d -r 566ee473fc27 Config.mk +--- a/Config.mk Tue Aug 12 10:23:34 2008 +0100 ++++ b/Config.mk Fri Aug 22 10:45:30 2008 +0100 +@@ -80,7 +80,8 @@ + FLASK_ENABLE ?= n + ACM_SECURITY ?= n + +-QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-unstable.git ++QEMU_TAG=xen-3.3.0 ++QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-3.3-testing.git + + # Specify which qemu-dm to use. This may be `ioemu' to use the old + # Mercurial in-tree version, or a local directory, or a git URL. +diff -r 2c63cf7b042d -r 566ee473fc27 Makefile +--- a/Makefile Tue Aug 12 10:23:34 2008 +0100 ++++ b/Makefile Fri Aug 22 10:45:30 2008 +0100 +@@ -22,6 +22,9 @@ + $(MAKE) -C xen build + $(MAKE) -C tools build + $(MAKE) -C stubdom build ++ifeq (x86_64,$(XEN_TARGET_ARCH)) ++ XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub ++endif + $(MAKE) -C docs build + + # The test target is for unit tests that can run without an installation. Of +@@ -71,6 +74,9 @@ + .PHONY: install-stubdom + install-stubdom: + $(MAKE) -C stubdom install ++ifeq (x86_64,$(XEN_TARGET_ARCH)) ++ XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub ++endif + + .PHONY: install-docs + install-docs: +@@ -109,6 +115,9 @@ + $(MAKE) -C xen clean + $(MAKE) -C tools clean + $(MAKE) -C stubdom crossclean ++ifeq (x86_64,$(XEN_TARGET_ARCH)) ++ XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom crossclean ++endif + $(MAKE) -C docs clean + + # clean, but blow away kernel build tree plus tarballs +@@ -117,6 +126,9 @@ + $(MAKE) -C xen distclean + $(MAKE) -C tools distclean + $(MAKE) -C stubdom distclean ++ifeq (x86_64,$(XEN_TARGET_ARCH)) ++ XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean ++endif + $(MAKE) -C docs distclean + rm -rf dist patches/tmp + for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done +diff -r 2c63cf7b042d -r 566ee473fc27 extras/mini-os/Makefile +--- a/extras/mini-os/Makefile Tue Aug 12 10:23:34 2008 +0100 ++++ b/extras/mini-os/Makefile Fri Aug 22 10:45:30 2008 +0100 +@@ -66,8 +66,8 @@ + # lwIP library + LWC := $(shell find $(LWIPDIR)/ -type f -name '*.c') + LWC := $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC)) +-LWC += lwip-arch.c lwip-net.c + LWO := $(patsubst %.c,%.o,$(LWC)) ++LWO += $(addprefix $(OBJ_DIR)/,lwip-arch.o lwip-net.o) + + $(OBJ_DIR)/lwip.a: $(LWO) + $(RM) $@ +@@ -79,7 +79,7 @@ + OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS)) + + ifeq ($(libc),y) +-APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc -whole-archive -lxenguest -lxenctrl -no-whole-archive ++APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(XEN_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive + APP_LDLIBS += -lpci + APP_LDLIBS += -lz + APP_LDLIBS += -lm +diff -r 2c63cf7b042d -r 566ee473fc27 stubdom/Makefile +--- a/stubdom/Makefile Tue Aug 12 10:23:34 2008 +0100 ++++ b/stubdom/Makefile Fri Aug 22 10:45:30 2008 +0100 +@@ -90,9 +90,9 @@ + NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a + .PHONY: cross-newlib + cross-newlib: $(NEWLIB_STAMPFILE) +-$(NEWLIB_STAMPFILE): mk-headers newlib-$(NEWLIB_VERSION) +- mkdir -p newlib-build +- ( cd newlib-build && \ ++$(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION) ++ mkdir -p newlib-$(XEN_TARGET_ARCH) ++ ( cd newlib-$(XEN_TARGET_ARCH) && \ + CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \ + $(MAKE) && \ + DESTDIR= $(MAKE) install ) +@@ -104,12 +104,15 @@ + zlib-$(ZLIB_VERSION).tar.gz: + $(WGET) $(ZLIB_URL)/$@ + ++zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz ++ tar xzf $< ++ mv zlib-$(ZLIB_VERSION) $@ ++ + ZLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libz.a + .PHONY: cross-zlib + cross-zlib: $(ZLIB_STAMPFILE) +-$(ZLIB_STAMPFILE): zlib-$(ZLIB_VERSION).tar.gz $(NEWLIB_STAMPFILE) +- tar xzf $< +- ( cd zlib-$(ZLIB_VERSION) && \ ++$(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) ++ ( cd $< && \ + CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \ + $(MAKE) libz.a && \ + $(MAKE) install ) +@@ -121,16 +124,17 @@ + pciutils-$(LIBPCI_VERSION).tar.bz2: + $(WGET) $(LIBPCI_URL)/$@ + +-pciutils-$(LIBPCI_VERSION): pciutils-$(LIBPCI_VERSION).tar.bz2 ++pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2 + tar xjf $< ++ mv pciutils-$(LIBPCI_VERSION) $@ + patch -d $@ -p1 < pciutils.patch + touch $@ + + LIBPCI_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpci.a + .PHONY: cross-libpci + cross-libpci: $(LIBPCI_STAMPFILE) +-$(LIBPCI_STAMPFILE): pciutils-$(LIBPCI_VERSION) $(NEWLIB_STAMPFILE) $(ZLIB_STAMPFILE) +- ( cd pciutils-$(LIBPCI_VERSION) && \ ++$(LIBPCI_STAMPFILE): pciutils-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) $(ZLIB_STAMPFILE) ++ ( cd $< && \ + cp ../libpci.config.h lib/config.h && \ + echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \ + cp ../libpci.config.mak lib/config.mk && \ +@@ -147,8 +151,9 @@ + lwip-$(LWIP_VERSION).tar.gz: + $(WGET) $(LWIP_URL)/$@ + +-lwip: lwip-$(LWIP_VERSION).tar.gz ++lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz + tar xzf $< ++ mv lwip $@ + patch -d $@ -p0 < lwip.patch-cvs + touch $@ + +@@ -159,7 +164,7 @@ + .PHONY: $(CROSS_ROOT) + $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci + +-mk-headers: ++mk-headers-$(XEN_TARGET_ARCH): + mkdir -p include/xen && \ + ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) include/xen && \ + ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \ +@@ -168,13 +173,13 @@ + ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*)) include/xen-foreign/ && \ + $(MAKE) -C include/xen-foreign/ && \ + ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign ) +- mkdir -p libxc +- [ -h libxc/Makefile ] || ( cd libxc && \ ++ mkdir -p libxc-$(XEN_TARGET_ARCH) ++ [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \ + ln -sf ../$(XEN_ROOT)/tools/libxc/*.h . && \ + ln -sf ../$(XEN_ROOT)/tools/libxc/*.c . && \ + ln -sf ../$(XEN_ROOT)/tools/libxc/Makefile . ) +- mkdir -p libxc/$(XEN_TARGET_ARCH) +- [ -h libxc/$(XEN_TARGET_ARCH) ] || ( cd libxc/$(XEN_TARGET_ARCH) && \ ++ mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ++ [ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \ + ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \ + ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \ + ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . ) +@@ -195,9 +200,9 @@ + [ ! -h ioemu/config-host.h ] || rm -f ioemu/config-host.h + [ ! -h ioemu/config-host.mak ] || rm -f ioemu/config-host.mak + $(MAKE) -C $(MINI_OS) links +- touch mk-headers ++ touch mk-headers-$(XEN_TARGET_ARCH) + +-TARGETS_MINIOS=$(addprefix mini-os-,$(TARGETS)) ++TARGETS_MINIOS=$(addprefix mini-os-$(XEN_TARGET_ARCH)-,$(TARGETS)) + $(TARGETS_MINIOS): mini-os-%: + [ -d $@ ] || \ + for i in $$(cd $(MINI_OS) ; find . -type d) ; do \ +@@ -209,9 +214,9 @@ + ####### + + .PHONY: libxc +-libxc: libxc/libxenctrl.a libxc/libxenguest.a +-libxc/libxenctrl.a libxc/libxenguest.a:: cross-zlib +- CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C libxc ++libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a ++libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a:: cross-zlib ++ CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C libxc-$(XEN_TARGET_ARCH) + + ####### + # ioemu +@@ -223,12 +228,12 @@ + [ -f ioemu/config-host.mak ] || \ + ( cd ioemu ; \ + XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh configure --prefix=/usr --enable-stubdom $(IOEMU_OPTIONS)) +- CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip TOOLS= ++ CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS= + else + [ -f ioemu/config-host.mak ] || \ + ( cd ioemu ; \ + CONFIG_STUBDOM=yes XEN_ROOT=$(abspath $(XEN_ROOT)) XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh ./xen-setup --cc=$(CC) --disable-gcc-check $(IOEMU_OPTIONS)) +- CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip TOOLS= CONFIG_STUBDOM=yes ++ CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS= CONFIG_STUBDOM=yes + endif + + ###### +@@ -237,7 +242,7 @@ + + .PHONY: caml + caml: $(CROSS_ROOT) +- CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip ++ CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) + + ### + # C +@@ -245,7 +250,7 @@ + + .PHONY: c + c: $(CROSS_ROOT) +- CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip ++ CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) + + ###### + # Grub +@@ -263,7 +268,8 @@ + + .PHONY: grub + grub: grub-upstream $(CROSS_ROOT) +- CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ ++ mkdir -p grub-$(XEN_TARGET_ARCH) ++ CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH) + + ######## + # minios +@@ -275,21 +281,21 @@ + else + ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a + endif +-ioemu-stubdom: mini-os-ioemu lwip libxc ioemu +- DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip APP_OBJS="$(APP_OBJS)" ++ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc ioemu ++ DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)" + + CAMLLIB = $(shell ocamlc -where) + .PHONY: caml-stubdom +-caml-stubdom: mini-os-caml lwip libxc caml +- DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_CAML $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a" ++caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc caml ++ DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_CAML $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a" + + .PHONY: c-stubdom +-c-stubdom: mini-os-c lwip libxc c +- DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_C $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip APP_OBJS=$(CURDIR)/c/main.a ++c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c ++ DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_C $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a + + .PHONY: pv-grub +-pv-grub: mini-os-grub libxc grub +- DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_GRUB $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub/main.a ++pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub ++ DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_GRUB $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a + + ######### + # install +@@ -309,11 +315,11 @@ + $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/bin" + $(INSTALL_PROG) stubdom-dm "$(DESTDIR)/usr/lib/xen/bin" + $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot" +- $(INSTALL_DATA) mini-os-ioemu/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/ioemu-stubdom.gz" ++ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/ioemu-stubdom.gz" + + install-grub: pv-grub + $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot" +- $(INSTALL_DATA) mini-os-grub/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/pv-grub.gz" ++ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/pv-grub-$(XEN_TARGET_ARCH).gz" + + ####### + # clean +@@ -322,30 +328,30 @@ + # Only clean the libxc/ioemu/mini-os part + .PHONY: clean + clean: +- rm -fr mini-os-ioemu +- rm -fr mini-os-c +- rm -fr mini-os-caml +- rm -fr mini-os-grub ++ rm -fr mini-os-$(XEN_TARGET_ARCH)-ioemu ++ rm -fr mini-os-$(XEN_TARGET_ARCH)-c ++ rm -fr mini-os-$(XEN_TARGET_ARCH)-caml ++ rm -fr mini-os-$(XEN_TARGET_ARCH)-grub + $(MAKE) -C caml clean + $(MAKE) -C c clean +- $(MAKE) -C grub clean +- [ ! -d libxc ] || $(MAKE) -C libxc clean ++ rm -fr grub-$(XEN_TARGET_ARCH) ++ [ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) -C libxc-$(XEN_TARGET_ARCH) clean + [ ! -d ioemu ] || $(MAKE) -C ioemu clean + + # clean the cross-compilation result + .PHONY: crossclean + crossclean: clean + rm -fr $(CROSS_ROOT) +- rm -fr newlib-build +- rm -fr zlib-$(ZLIB_VERSION) pciutils-$(LIBPCI_VERSION) +- rm -fr libxc ioemu +- rm -f mk-headers ++ rm -fr newlib-$(XEN_TARGET_ARCH) ++ rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH) ++ rm -fr libxc-$(XEN_TARGET_ARCH) ioemu ++ rm -f mk-headers-$(XEN_TARGET_ARCH) + + # clean patched sources + .PHONY: patchclean + patchclean: crossclean + rm -fr newlib-$(NEWLIB_VERSION) +- rm -fr lwip ++ rm -fr lwip-$(XEN_TARGET_ARCH) + rm -fr grub-upstream + + # clean downloads +diff -r 2c63cf7b042d -r 566ee473fc27 stubdom/grub/Makefile +--- a/stubdom/grub/Makefile Tue Aug 12 10:23:34 2008 +0100 ++++ b/stubdom/grub/Makefile Fri Aug 22 10:45:30 2008 +0100 +@@ -3,7 +3,7 @@ + include $(XEN_ROOT)/Config.mk + vpath %.c ../grub-upstream + +-BOOT=boot-$(XEN_TARGET_ARCH).o ++BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o + + DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc -I$(XEN_ROOT)/tools/include -I. + DEF_CPPFLAGS += -I../grub-upstream/stage1 +@@ -17,7 +17,7 @@ + DEF_CPPFLAGS += -DPRESET_MENU_STRING='""' + DEF_CPPFLAGS += -DPACKAGE='"grubdom"' -DVERSION='"0.97"' + +-all: main.a ++all: $(OBJ_DIR)/main.a + + STAGE2_SOURCES=builtins.c char_io.c cmdline.c common.c console.c disk_io.c graphics.c gunzip.c md5.c serial.c stage2.c terminfo.c tparm.c + +@@ -59,16 +59,26 @@ + + $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__ + +-OBJS = $(NETBOOT_SOURCES:.c=.o) $(STAGE2_SOURCES:.c=.o) kexec.o mini-os.o ++PV_GRUB_SOURCES = kexec.c mini-os.c + +-dirs: +- mkdir -p netboot stage2 ++SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES) ++ ++OBJS = $(addprefix $(OBJ_DIR)/,$(SOURCES:.c=.o)) ++ ++$(OBJ_DIR)/dirs: ++ mkdir -p $(OBJ_DIR)/netboot $(OBJ_DIR)/stage2 + touch $@ + +-$(OBJS): dirs ++$(OBJS): $(OBJ_DIR)/dirs + +-main.a: $(BOOT) $(OBJS) ++$(OBJ_DIR)/main.a: $(BOOT) $(OBJS) + $(AR) cr $@ $^ ++ ++$(OBJ_DIR)/%.o: %.c ++ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ ++ ++$(OBJ_DIR)/%.o: %.S ++ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + + clean: + rm -fr dirs *.a *.o stage2 netboot +diff -r 2c63cf7b042d -r 566ee473fc27 tools/ioemu/hw/pass-through.c +--- a/tools/ioemu/hw/pass-through.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/ioemu/hw/pass-through.c Fri Aug 22 10:45:30 2008 +0100 +@@ -1423,7 +1423,7 @@ + for ( i = 0; i < PCI_NUM_REGIONS; i++ ) + { + e_size = assigned_device->bases[i].e_size; +- if ( e_size == 0 ) ++ if ( (e_size == 0) || (assigned_device->bases[i].e_physbase == -1) ) + continue; + + type = d->io_regions[i].type; +diff -r 2c63cf7b042d -r 566ee473fc27 tools/ioemu/hw/pass-through.h +--- a/tools/ioemu/hw/pass-through.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/ioemu/hw/pass-through.h Fri Aug 22 10:45:30 2008 +0100 +@@ -120,6 +120,7 @@ + int enabled; + int total_entries; + int bar_index; ++ uint64_t table_base; + uint32_t table_off; + uint64_t mmio_base_addr; + int mmio_index; +diff -r 2c63cf7b042d -r 566ee473fc27 tools/ioemu/hw/pt-msi.c +--- a/tools/ioemu/hw/pt-msi.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/ioemu/hw/pt-msi.c Fri Aug 22 10:45:30 2008 +0100 +@@ -38,8 +38,8 @@ + } + + if ( xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq, +- dev->pci_dev->dev << 3 | dev->pci_dev->func, +- dev->pci_dev->bus, 0, 1) ) ++ dev->pci_dev->dev << 3 | dev->pci_dev->func, ++ dev->pci_dev->bus, 0, 0) ) + { + PT_LOG("error map msi\n"); + return -1; +@@ -121,7 +121,8 @@ + { + ret = xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq, + dev->pci_dev->dev << 3 | dev->pci_dev->func, +- dev->pci_dev->bus, entry_nr, 0); ++ dev->pci_dev->bus, entry_nr, ++ dev->msix->table_base); + if ( ret ) + { + PT_LOG("error map msix entry %x\n", entry_nr); +@@ -183,7 +184,7 @@ + entry = &msix->msix_entry[entry_nr]; + offset = ((addr - msix->mmio_base_addr) % 16) / 4; + +- if ( offset != 3 && msix->enabled && entry->io_mem[3] & 0x1 ) ++ if ( offset != 3 && msix->enabled && !(entry->io_mem[3] & 0x1) ) + { + PT_LOG("can not update msix entry %d since MSI-X is already \ + function now.\n", entry_nr); +@@ -196,7 +197,7 @@ + + if ( offset == 3 ) + { +- if ( !(val & 0x1) ) ++ if ( msix->enabled && !(val & 0x1) ) + pt_msix_update_one(dev, entry_nr); + mask_physical_msix_entry(dev, entry_nr, entry->io_mem[3] & 0x1); + } +@@ -280,7 +281,6 @@ + uint8_t id; + uint16_t control; + int i, total_entries, table_off, bar_index; +- uint64_t bar_base; + struct pci_dev *pd = dev->pci_dev; + + id = pci_read_byte(pd, pos + PCI_CAP_LIST_ID); +@@ -314,18 +314,14 @@ + table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE); + bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR; + table_off &= table_off & ~PCI_MSIX_BIR; +- bar_base = pci_read_long(pd, 0x10 + 4 * bar_index); +- if ( (bar_base & 0x6) == 0x4 ) +- { +- bar_base &= ~0xf; +- bar_base += (uint64_t)pci_read_long(pd, 0x10 + 4 * (bar_index + 1)) << 32; +- } +- PT_LOG("get MSI-X table bar base %lx\n", bar_base); ++ dev->msix->table_base = dev->pci_dev->base_addr[bar_index]; ++ PT_LOG("get MSI-X table bar base %llx\n", ++ (unsigned long long)dev->msix->table_base); + + dev->msix->fd = open("/dev/mem", O_RDWR); + dev->msix->phys_iomem_base = mmap(0, total_entries * 16, + PROT_WRITE | PROT_READ, MAP_SHARED | MAP_LOCKED, +- dev->msix->fd, bar_base + table_off); ++ dev->msix->fd, dev->msix->table_base + table_off); + PT_LOG("mapping physical MSI-X table to %lx\n", + (unsigned long)dev->msix->phys_iomem_base); + return 0; +diff -r 2c63cf7b042d -r 566ee473fc27 tools/libxc/xc_domain_restore.c +--- a/tools/libxc/xc_domain_restore.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/libxc/xc_domain_restore.c Fri Aug 22 10:45:30 2008 +0100 +@@ -372,7 +372,7 @@ + } + + /* We want zeroed memory so use calloc rather than malloc. */ +- p2m = calloc(p2m_size, MAX(guest_width, sizeof (xen_pfn_t))); ++ p2m = calloc(p2m_size, sizeof(xen_pfn_t)); + pfn_type = calloc(p2m_size, sizeof(unsigned long)); + + region_mfn = xg_memalign(PAGE_SIZE, ROUNDUP( +@@ -1178,16 +1178,16 @@ + } + + /* If the domain we're restoring has a different word size to ours, +- * we need to repack the p2m appropriately */ ++ * we need to adjust the live_p2m assignment appropriately */ + if ( guest_width > sizeof (xen_pfn_t) ) + for ( i = p2m_size - 1; i >= 0; i-- ) +- ((uint64_t *)p2m)[i] = p2m[i]; ++ ((uint64_t *)live_p2m)[i] = p2m[i]; + else if ( guest_width < sizeof (xen_pfn_t) ) + for ( i = 0; i < p2m_size; i++ ) +- ((uint32_t *)p2m)[i] = p2m[i]; +- +- memcpy(live_p2m, p2m, ROUNDUP(p2m_size * guest_width, PAGE_SHIFT)); +- munmap(live_p2m, ROUNDUP(p2m_size * guest_width, PAGE_SHIFT)); ++ ((uint32_t *)live_p2m)[i] = p2m[i]; ++ else ++ memcpy(live_p2m, p2m, p2m_size * sizeof(xen_pfn_t)); ++ munmap(live_p2m, P2M_FL_ENTRIES * PAGE_SIZE); + + DPRINTF("Domain ready to be built.\n"); + rc = 0; +diff -r 2c63cf7b042d -r 566ee473fc27 tools/libxc/xc_physdev.c +--- a/tools/libxc/xc_physdev.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/libxc/xc_physdev.c Fri Aug 22 10:45:30 2008 +0100 +@@ -51,7 +51,7 @@ + int devfn, + int bus, + int entry_nr, +- int msi_type) ++ uint64_t table_base) + { + int rc; + struct physdev_map_pirq map; +@@ -63,10 +63,10 @@ + map.type = MAP_PIRQ_TYPE_MSI; + map.index = index; + map.pirq = *pirq; +- map.msi_info.devfn = devfn; +- map.msi_info.bus = bus; +- map.msi_info.entry_nr = entry_nr; +- map.msi_info.msi = msi_type; ++ map.bus = bus; ++ map.devfn = devfn; ++ map.entry_nr = entry_nr; ++ map.table_base = table_base; + + rc = do_physdev_op(xc_handle, PHYSDEVOP_map_pirq, &map); + +diff -r 2c63cf7b042d -r 566ee473fc27 tools/libxc/xenctrl.h +--- a/tools/libxc/xenctrl.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/libxc/xenctrl.h Fri Aug 22 10:45:30 2008 +0100 +@@ -917,7 +917,7 @@ + int devfn, + int bus, + int entry_nr, +- int msi_type); ++ uint64_t table_base); + + int xc_physdev_unmap_pirq(int xc_handle, + int domid, +diff -r 2c63cf7b042d -r 566ee473fc27 tools/misc/xend +--- a/tools/misc/xend Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/misc/xend Fri Aug 22 10:45:30 2008 +0100 +@@ -77,6 +77,10 @@ + hline() + raise CheckError("invalid user") + ++def start_daemon(daemon, *args): ++ if os.fork() == 0: ++ os.execvp(daemon, (daemon,) + args) ++ + def start_xenstored(): + pidfname = "/var/run/xenstore.pid" + try: +@@ -102,13 +106,15 @@ + s,o = commands.getstatusoutput(cmd) + + def start_consoled(): +- if os.fork() == 0: +- os.execvp('xenconsoled', ['xenconsoled']) ++ XENCONSOLED_TRACE = os.getenv("XENCONSOLED_TRACE") ++ args = "" ++ if XENCONSOLED_TRACE: ++ args += "--log=" + XENCONSOLED_TRACE ++ start_daemon("xenconsoled", args) + + def start_blktapctrl(): +- if os.fork() == 0: +- os.execvp('blktapctrl', ['blktapctrl']) +- ++ start_daemon("blktapctrl", "") ++ + def main(): + try: + check_logging() +diff -r 2c63cf7b042d -r 566ee473fc27 tools/python/xen/xend/XendConfig.py +--- a/tools/python/xen/xend/XendConfig.py Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/python/xen/xend/XendConfig.py Fri Aug 22 10:45:30 2008 +0100 +@@ -448,7 +448,7 @@ + self['platform']['hpet'] = 0 + if 'loader' not in self['platform']: + # Old configs may have hvmloader set as PV_kernel param +- if self.has_key('PV_kernel'): ++ if self.has_key('PV_kernel') and self['PV_kernel'] != '': + self['platform']['loader'] = self['PV_kernel'] + self['PV_kernel'] = '' + else: +diff -r 2c63cf7b042d -r 566ee473fc27 tools/python/xen/xend/XendPIF.py +--- a/tools/python/xen/xend/XendPIF.py Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/python/xen/xend/XendPIF.py Fri Aug 22 10:45:30 2008 +0100 +@@ -101,7 +101,7 @@ + def linux_get_mac(device): + return _linux_get_pif_param(device, 'link/ether') + +-def _linux_get_pif_parm(device, param_name): ++def _linux_get_pif_param(device, param_name): + ip_get_dev_data = 'ip link show %s' % device + rc, output = commands.getstatusoutput(ip_get_dev_data) + if rc == 0: +diff -r 2c63cf7b042d -r 566ee473fc27 tools/python/xen/xend/server/pciif.py +--- a/tools/python/xen/xend/server/pciif.py Tue Aug 12 10:23:34 2008 +0100 ++++ b/tools/python/xen/xend/server/pciif.py Fri Aug 22 10:45:30 2008 +0100 +@@ -290,8 +290,12 @@ + + self.CheckSiblingDevices(fe_domid, dev) + +- if arch.type != "ia64": +- dev.do_FLR() ++ # We don't do FLR when we create domain and hotplug device into guest, ++ # namely, we only do FLR when we destroy domain or hotplug device from ++ # guest. This is mainly to work around the race condition in hotplug code ++ # paths. See the changeset's description for details. ++ # if arch.type != "ia64": ++ # dev.do_FLR() + + PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain, + bus, slot, func) +diff -r 2c63cf7b042d -r 566ee473fc27 unmodified_drivers/linux-2.6/platform-pci/evtchn.c +--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Fri Aug 22 10:45:30 2008 +0100 +@@ -107,39 +107,8 @@ + + void unmask_evtchn(int port) + { +- unsigned int cpu; +- shared_info_t *s = shared_info_area; +- vcpu_info_t *vcpu_info; +- +- cpu = get_cpu(); +- vcpu_info = &s->vcpu_info[cpu]; +- +- /* Slow path (hypercall) if this is a non-local port. We only +- ever bind event channels to vcpu 0 in HVM guests. */ +- if (unlikely(cpu != 0)) { +- evtchn_unmask_t op = { .port = port }; +- VOID(HYPERVISOR_event_channel_op(EVTCHNOP_unmask, +- &op)); +- put_cpu(); +- return; +- } +- +- synch_clear_bit(port, &s->evtchn_mask[0]); +- +- /* +- * The following is basically the equivalent of +- * 'hw_resend_irq'. Just like a real IO-APIC we 'lose the +- * interrupt edge' if the channel is masked. +- */ +- if (synch_test_bit(port, &s->evtchn_pending[0]) && +- !synch_test_and_set_bit(port / BITS_PER_LONG, +- &vcpu_info->evtchn_pending_sel)) { +- vcpu_info->evtchn_upcall_pending = 1; +- if (!vcpu_info->evtchn_upcall_mask) +- force_evtchn_callback(); +- } +- +- put_cpu(); ++ evtchn_unmask_t op = { .port = port }; ++ VOID(HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &op)); + } + EXPORT_SYMBOL(unmask_evtchn); + +@@ -357,12 +326,6 @@ + return IRQ_HANDLED; + } + +-void force_evtchn_callback(void) +-{ +- VOID(HYPERVISOR_xen_version(0, NULL)); +-} +-EXPORT_SYMBOL(force_evtchn_callback); +- + void irq_resume(void) + { + int evtchn, irq; +diff -r 2c63cf7b042d -r 566ee473fc27 xen/Makefile +--- a/xen/Makefile Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/Makefile Fri Aug 22 10:45:30 2008 +0100 +@@ -2,7 +2,7 @@ + # All other places this is stored (eg. compile.h) should be autogenerated. + export XEN_VERSION = 3 + export XEN_SUBVERSION = 3 +-export XEN_EXTRAVERSION ?= .0-rc5-pre$(XEN_VENDORVERSION) ++export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION) + export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) + -include xen-version + +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/ia64/vmx/vmx_hypercall.c +--- a/xen/arch/ia64/vmx/vmx_hypercall.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/ia64/vmx/vmx_hypercall.c Fri Aug 22 10:45:30 2008 +0100 +@@ -251,6 +251,10 @@ + break; + } + ++ case HVMOP_set_mem_type: ++ rc = -ENOSYS; ++ break; ++ + default: + gdprintk(XENLOG_INFO, "Bad HVM op %ld.\n", op); + rc = -ENOSYS; +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/ia64/xen/vhpt.c +--- a/xen/arch/ia64/xen/vhpt.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/ia64/xen/vhpt.c Fri Aug 22 10:45:30 2008 +0100 +@@ -526,6 +526,8 @@ + /* NB. There is no race because all vcpus are paused. */ + if (is_hvm_domain(d)) { + for_each_vcpu (d, v) { ++ if (!v->is_initialised) ++ continue; + /* XXX: local_flush_tlb_all is called redundantly */ + thash_purge_all(v); + } +@@ -533,6 +535,8 @@ + NULL, 1, 1); + } else if (HAS_PERVCPU_VHPT(d)) { + for_each_vcpu (d, v) { ++ if (!v->is_initialised) ++ continue; + vcpu_purge_tr_entry(&PSCBX(v,dtlb)); + vcpu_purge_tr_entry(&PSCBX(v,itlb)); + vcpu_vhpt_flush(v); +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/cpu/mcheck/mce.h +--- a/xen/arch/x86/cpu/mcheck/mce.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/cpu/mcheck/mce.h Fri Aug 22 10:45:30 2008 +0100 +@@ -26,5 +26,5 @@ + void x86_mcinfo_dump(struct mc_info *mi); + + /* Global variables */ +-extern int mce_disabled __initdata; ++extern int mce_disabled; + extern unsigned int nr_mce_banks; +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/hvm/emulate.c +--- a/xen/arch/x86/hvm/emulate.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/hvm/emulate.c Fri Aug 22 10:45:30 2008 +0100 +@@ -207,9 +207,13 @@ + struct hvm_emulate_ctxt *hvmemul_ctxt) + { + struct vcpu *curr = current; +- unsigned long pfn, npfn, done, todo, i; ++ unsigned long pfn, npfn, done, todo, i, offset = addr & ~PAGE_MASK; ++ int reverse; + +- /* Clip repetitions to a sensible maximum. */ ++ /* ++ * Clip repetitions to a sensible maximum. This avoids extensive looping in ++ * this function while still amortising the cost of I/O trap-and-emulate. ++ */ + *reps = min_t(unsigned long, *reps, 4096); + + /* With no paging it's easy: linear == physical. */ +@@ -219,48 +223,54 @@ + return X86EMUL_OKAY; + } + +- *paddr = addr & ~PAGE_MASK; ++ /* Reverse mode if this is a backwards multi-iteration string operation. */ ++ reverse = (hvmemul_ctxt->ctxt.regs->eflags & X86_EFLAGS_DF) && (*reps > 1); + +- /* Get the first PFN in the range. */ +- if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == INVALID_GFN ) ++ if ( reverse && ((PAGE_SIZE - offset) < bytes_per_rep) ) ++ { ++ /* Do page-straddling first iteration forwards via recursion. */ ++ paddr_t _paddr; ++ unsigned long one_rep = 1; ++ int rc = hvmemul_linear_to_phys( ++ addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt); ++ if ( rc != X86EMUL_OKAY ) ++ return rc; ++ pfn = _paddr >> PAGE_SHIFT; ++ } ++ else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == INVALID_GFN ) + { + hvm_inject_exception(TRAP_page_fault, pfec, addr); + return X86EMUL_EXCEPTION; + } + +- /* If the range does not straddle a page boundary then we're done. */ +- done = PAGE_SIZE - (addr & ~PAGE_MASK); ++ done = reverse ? bytes_per_rep + offset : PAGE_SIZE - offset; + todo = *reps * bytes_per_rep; +- if ( done >= todo ) +- goto done; +- +- addr += done; + for ( i = 1; done < todo; i++ ) + { + /* Get the next PFN in the range. */ ++ addr += reverse ? -PAGE_SIZE : PAGE_SIZE; + npfn = paging_gva_to_gfn(curr, addr, &pfec); + + /* Is it contiguous with the preceding PFNs? If not then we're done. */ +- if ( (npfn == INVALID_GFN) || (npfn != (pfn + i)) ) ++ if ( (npfn == INVALID_GFN) || (npfn != (pfn + (reverse ? -i : i))) ) + { + done /= bytes_per_rep; + if ( done == 0 ) + { ++ ASSERT(!reverse); + if ( npfn != INVALID_GFN ) + return X86EMUL_UNHANDLEABLE; +- hvm_inject_exception(TRAP_page_fault, pfec, addr); ++ hvm_inject_exception(TRAP_page_fault, pfec, addr & PAGE_MASK); + return X86EMUL_EXCEPTION; + } + *reps = done; + break; + } + +- addr += PAGE_SIZE; + done += PAGE_SIZE; + } + +- done: +- *paddr |= (paddr_t)pfn << PAGE_SHIFT; ++ *paddr = ((paddr_t)pfn << PAGE_SHIFT) | offset; + return X86EMUL_OKAY; + } + +@@ -268,7 +278,8 @@ + static int hvmemul_virtual_to_linear( + enum x86_segment seg, + unsigned long offset, +- unsigned int bytes, ++ unsigned int bytes_per_rep, ++ unsigned long *reps, + enum hvm_access_type access_type, + struct hvm_emulate_ctxt *hvmemul_ctxt, + unsigned long *paddr) +@@ -282,21 +293,50 @@ + return X86EMUL_OKAY; + } + ++ /* ++ * Clip repetitions to avoid overflow when multiplying by @bytes_per_rep. ++ * The chosen maximum is very conservative but it's what we use in ++ * hvmemul_linear_to_phys() so there is no point in using a larger value. ++ */ ++ *reps = min_t(unsigned long, *reps, 4096); ++ + reg = hvmemul_get_seg_reg(seg, hvmemul_ctxt); +- okay = hvm_virtual_to_linear_addr( +- seg, reg, offset, bytes, access_type, +- hvmemul_ctxt->ctxt.addr_size, paddr); + +- if ( !okay ) ++ if ( (hvmemul_ctxt->ctxt.regs->eflags & X86_EFLAGS_DF) && (*reps > 1) ) + { +- hvmemul_ctxt->exn_pending = 1; +- hvmemul_ctxt->exn_vector = TRAP_gp_fault; +- hvmemul_ctxt->exn_error_code = 0; +- hvmemul_ctxt->exn_insn_len = 0; +- return X86EMUL_EXCEPTION; ++ /* ++ * x86_emulate() clips the repetition count to ensure we don't wrap ++ * the effective-address index register. Hence this assertion holds. ++ */ ++ ASSERT(offset >= ((*reps - 1) * bytes_per_rep)); ++ okay = hvm_virtual_to_linear_addr( ++ seg, reg, offset - (*reps - 1) * bytes_per_rep, ++ *reps * bytes_per_rep, access_type, ++ hvmemul_ctxt->ctxt.addr_size, paddr); ++ *paddr += (*reps - 1) * bytes_per_rep; ++ if ( hvmemul_ctxt->ctxt.addr_size != 64 ) ++ *paddr = (uint32_t)*paddr; ++ } ++ else ++ { ++ okay = hvm_virtual_to_linear_addr( ++ seg, reg, offset, *reps * bytes_per_rep, access_type, ++ hvmemul_ctxt->ctxt.addr_size, paddr); + } + +- return X86EMUL_OKAY; ++ if ( okay ) ++ return X86EMUL_OKAY; ++ ++ /* If this is a string operation, emulate each iteration separately. */ ++ if ( *reps != 1 ) ++ return X86EMUL_UNHANDLEABLE; ++ ++ /* This is a singleton operation: fail it with an exception. */ ++ hvmemul_ctxt->exn_pending = 1; ++ hvmemul_ctxt->exn_vector = TRAP_gp_fault; ++ hvmemul_ctxt->exn_error_code = 0; ++ hvmemul_ctxt->exn_insn_len = 0; ++ return X86EMUL_EXCEPTION; + } + + static int __hvmemul_read( +@@ -314,7 +354,7 @@ + int rc; + + rc = hvmemul_virtual_to_linear( +- seg, offset, bytes, access_type, hvmemul_ctxt, &addr); ++ seg, offset, bytes, &reps, access_type, hvmemul_ctxt, &addr); + if ( rc != X86EMUL_OKAY ) + return rc; + +@@ -406,7 +446,7 @@ + int rc; + + rc = hvmemul_virtual_to_linear( +- seg, offset, bytes, hvm_access_write, hvmemul_ctxt, &addr); ++ seg, offset, bytes, &reps, hvm_access_write, hvmemul_ctxt, &addr); + if ( rc != X86EMUL_OKAY ) + return rc; + +@@ -470,7 +510,7 @@ + int rc; + + rc = hvmemul_virtual_to_linear( +- dst_seg, dst_offset, *reps * bytes_per_rep, hvm_access_write, ++ dst_seg, dst_offset, bytes_per_rep, reps, hvm_access_write, + hvmemul_ctxt, &addr); + if ( rc != X86EMUL_OKAY ) + return rc; +@@ -503,7 +543,7 @@ + int rc; + + rc = hvmemul_virtual_to_linear( +- src_seg, src_offset, *reps * bytes_per_rep, hvm_access_read, ++ src_seg, src_offset, bytes_per_rep, reps, hvm_access_read, + hvmemul_ctxt, &addr); + if ( rc != X86EMUL_OKAY ) + return rc; +@@ -538,13 +578,13 @@ + int rc; + + rc = hvmemul_virtual_to_linear( +- src_seg, src_offset, *reps * bytes_per_rep, hvm_access_read, ++ src_seg, src_offset, bytes_per_rep, reps, hvm_access_read, + hvmemul_ctxt, &saddr); + if ( rc != X86EMUL_OKAY ) + return rc; + + rc = hvmemul_virtual_to_linear( +- dst_seg, dst_offset, *reps * bytes_per_rep, hvm_access_write, ++ dst_seg, dst_offset, bytes_per_rep, reps, hvm_access_write, + hvmemul_ctxt, &daddr); + if ( rc != X86EMUL_OKAY ) + return rc; +@@ -792,11 +832,11 @@ + { + struct hvm_emulate_ctxt *hvmemul_ctxt = + container_of(ctxt, struct hvm_emulate_ctxt, ctxt); +- unsigned long addr; ++ unsigned long addr, reps = 1; + int rc; + + rc = hvmemul_virtual_to_linear( +- seg, offset, 1, hvm_access_none, hvmemul_ctxt, &addr); ++ seg, offset, 1, &reps, hvm_access_none, hvmemul_ctxt, &addr); + + if ( rc == X86EMUL_OKAY ) + hvm_funcs.invlpg_intercept(addr); +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/hvm/svm/emulate.c +--- a/xen/arch/x86/hvm/svm/emulate.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/hvm/svm/emulate.c Fri Aug 22 10:45:30 2008 +0100 +@@ -71,6 +71,7 @@ + MAKE_INSTR(VMCALL, 3, 0x0f, 0x01, 0xd9); + MAKE_INSTR(HLT, 1, 0xf4); + MAKE_INSTR(INT3, 1, 0xcc); ++MAKE_INSTR(RDTSC, 2, 0x0f, 0x31); + + static const u8 *opc_bytes[INSTR_MAX_COUNT] = + { +@@ -81,7 +82,8 @@ + [INSTR_WRMSR] = OPCODE_WRMSR, + [INSTR_VMCALL] = OPCODE_VMCALL, + [INSTR_HLT] = OPCODE_HLT, +- [INSTR_INT3] = OPCODE_INT3 ++ [INSTR_INT3] = OPCODE_INT3, ++ [INSTR_RDTSC] = OPCODE_RDTSC + }; + + static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len) +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/hvm/svm/svm.c +--- a/xen/arch/x86/hvm/svm/svm.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/hvm/svm/svm.c Fri Aug 22 10:45:30 2008 +0100 +@@ -1128,6 +1128,17 @@ + hvm_hlt(regs->eflags); + } + ++static void svm_vmexit_do_rdtsc(struct cpu_user_regs *regs) ++{ ++ unsigned int inst_len; ++ ++ if ( (inst_len = __get_instruction_length(current, INSTR_RDTSC)) == 0 ) ++ return; ++ __update_guest_eip(regs, inst_len); ++ ++ hvm_rdtsc_intercept(regs); ++} ++ + static void wbinvd_ipi(void *info) + { + wbinvd(); +@@ -1344,7 +1355,7 @@ + break; + + case VMEXIT_RDTSC: +- hvm_rdtsc_intercept(regs); ++ svm_vmexit_do_rdtsc(regs); + break; + + case VMEXIT_RDTSCP: +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/ioport_emulate.c +--- a/xen/arch/x86/ioport_emulate.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/ioport_emulate.c Fri Aug 22 10:45:30 2008 +0100 +@@ -72,6 +72,14 @@ + }, + { + .callback = proliant_quirk, ++ .ident = "HP ProLiant DL7xx", ++ .matches = { ++ DMI_MATCH(DMI_BIOS_VENDOR, "HP"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"), ++ }, ++ }, ++ { ++ .callback = proliant_quirk, + .ident = "HP ProLiant ML3xx", + .matches = { + DMI_MATCH(DMI_BIOS_VENDOR, "HP"), +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/mm.c +--- a/xen/arch/x86/mm.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/mm.c Fri Aug 22 10:45:30 2008 +0100 +@@ -163,7 +163,8 @@ + #define l1_disallow_mask(d) \ + ((d != dom_io) && \ + (rangeset_is_empty((d)->iomem_caps) && \ +- rangeset_is_empty((d)->arch.ioport_caps)) ? \ ++ rangeset_is_empty((d)->arch.ioport_caps) && \ ++ !has_arch_pdevs(d)) ? \ + L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS)) + + #ifdef CONFIG_COMPAT +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/mm/shadow/common.c +--- a/xen/arch/x86/mm/shadow/common.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/mm/shadow/common.c Fri Aug 22 10:45:30 2008 +0100 +@@ -3357,23 +3357,45 @@ + } + } + +- /* If we're removing a superpage mapping from the p2m, remove all the +- * MFNs covered by it from the shadows too. */ ++ /* If we're removing a superpage mapping from the p2m, we need to check ++ * all the pages covered by it. If they're still there in the new ++ * scheme, that's OK, but otherwise they must be unshadowed. */ + if ( level == 2 && (l1e_get_flags(*p) & _PAGE_PRESENT) && + (l1e_get_flags(*p) & _PAGE_PSE) ) + { + unsigned int i; +- mfn_t mfn = _mfn(l1e_get_pfn(*p)); ++ cpumask_t flushmask; ++ mfn_t omfn = _mfn(l1e_get_pfn(*p)); ++ mfn_t nmfn = _mfn(l1e_get_pfn(new)); ++ l1_pgentry_t *npte = NULL; + p2m_type_t p2mt = p2m_flags_to_type(l1e_get_flags(*p)); +- if ( p2m_is_valid(p2mt) && mfn_valid(mfn) ) ++ if ( p2m_is_valid(p2mt) && mfn_valid(omfn) ) + { ++ cpus_clear(flushmask); ++ ++ /* If we're replacing a superpage with a normal L1 page, map it */ ++ if ( (l1e_get_flags(new) & _PAGE_PRESENT) ++ && !(l1e_get_flags(new) & _PAGE_PSE) ++ && mfn_valid(nmfn) ) ++ npte = map_domain_page(mfn_x(nmfn)); ++ + for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ ) + { +- sh_remove_all_shadows_and_parents(v, mfn); +- if ( sh_remove_all_mappings(v, mfn) ) +- flush_tlb_mask(d->domain_dirty_cpumask); +- mfn = _mfn(mfn_x(mfn) + 1); ++ if ( !npte ++ || !p2m_is_ram(p2m_flags_to_type(l1e_get_flags(npte[i]))) ++ || l1e_get_pfn(npte[i]) != mfn_x(omfn) ) ++ { ++ /* This GFN->MFN mapping has gone away */ ++ sh_remove_all_shadows_and_parents(v, omfn); ++ if ( sh_remove_all_mappings(v, omfn) ) ++ cpus_or(flushmask, flushmask, d->domain_dirty_cpumask); ++ } ++ omfn = _mfn(mfn_x(omfn) + 1); + } ++ flush_tlb_mask(flushmask); ++ ++ if ( npte ) ++ unmap_domain_page(npte); + } + } + +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/mm/shadow/multi.c +--- a/xen/arch/x86/mm/shadow/multi.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/mm/shadow/multi.c Fri Aug 22 10:45:30 2008 +0100 +@@ -1415,6 +1415,13 @@ + mfn_t new_gmfn = shadow_l1e_get_mfn(new_sl1e); + #endif + ASSERT(sl1e != NULL); ++ ++#if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC ++ if ( mfn_valid(new_gmfn) && mfn_oos_may_write(new_gmfn) ++ && ((shadow_l1e_get_flags(new_sl1e) & (_PAGE_RW|_PAGE_PRESENT)) ++ == (_PAGE_RW|_PAGE_PRESENT)) ) ++ oos_fixup_add(v, new_gmfn, sl1mfn, pgentry_ptr_to_slot(sl1e)); ++#endif + + old_sl1e = *sl1e; + +@@ -1434,14 +1441,6 @@ + else + { + shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d); +-#if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC +- if ( mfn_valid(new_gmfn) && mfn_oos_may_write(new_gmfn) +- && (shadow_l1e_get_flags(new_sl1e) & _PAGE_RW) ) +- { +- oos_fixup_add(v, new_gmfn, sl1mfn, pgentry_ptr_to_slot(sl1e)); +- } +-#endif +- + } + } + } +@@ -3181,14 +3180,9 @@ + rc = guest_walk_tables(v, va, &gw, regs->error_code); + + #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) ++ regs->error_code &= ~PFEC_page_present; + if ( !(rc & _PAGE_PRESENT) ) + regs->error_code |= PFEC_page_present; +- else if ( regs->error_code & PFEC_page_present ) +- { +- SHADOW_ERROR("OOS paranoia: Something is wrong in guest TLB" +- " flushing. Have fun debugging it.\n"); +- regs->error_code &= ~PFEC_page_present; +- } + #endif + + if ( rc != 0 ) +@@ -3295,6 +3289,16 @@ + if ( sh_mfn_is_a_page_table(gmfn) + && ft == ft_demand_write ) + sh_unsync(v, gmfn); ++ ++ if ( unlikely(d->is_shutting_down) ) ++ { ++ /* We might end up with a crashed domain here if ++ * sh_remove_shadows() in a previous sh_resync() call has ++ * failed. We cannot safely continue since some page is still ++ * OOS but not in the hash table anymore. */ ++ shadow_unlock(d); ++ return 0; ++ } + #endif /* OOS */ + + /* Calculate the shadow entry and write it */ +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/mm/shadow/private.h +--- a/xen/arch/x86/mm/shadow/private.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/mm/shadow/private.h Fri Aug 22 10:45:30 2008 +0100 +@@ -213,15 +213,14 @@ + }; + }; + +-/* The structure above *must* be the same size as a struct page_info ++/* The structure above *must* be no larger than a struct page_info + * from mm.h, since we'll be using the same space in the frametable. + * Also, the mbz field must line up with the owner field of normal + * pages, so they look properly like anonymous/xen pages. */ + static inline void shadow_check_page_struct_offsets(void) { +- BUILD_BUG_ON(sizeof (struct shadow_page_info) +- != sizeof (struct page_info)); +- BUILD_BUG_ON(offsetof(struct shadow_page_info, mbz) +- != offsetof(struct page_info, u.inuse._domain)); ++ BUILD_BUG_ON(sizeof (struct shadow_page_info) > sizeof (struct page_info)); ++ BUILD_BUG_ON(offsetof(struct shadow_page_info, mbz) != ++ offsetof(struct page_info, u.inuse._domain)); + }; + + /* Shadow type codes */ +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/msi.c +--- a/xen/arch/x86/msi.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/msi.c Fri Aug 22 10:45:30 2008 +0100 +@@ -490,28 +490,6 @@ + return 0; + } + +-static u64 pci_resource_start(struct pci_dev *dev, u8 bar_index) +-{ +- u64 bar_base; +- u32 reg_val; +- u8 bus = dev->bus; +- u8 slot = PCI_SLOT(dev->devfn); +- u8 func = PCI_FUNC(dev->devfn); +- +- reg_val = pci_conf_read32(bus, slot, func, +- PCI_BASE_ADDRESS_0 + 4 * bar_index); +- bar_base = reg_val & PCI_BASE_ADDRESS_MEM_MASK; +- if ( ( reg_val & PCI_BASE_ADDRESS_MEM_TYPE_MASK ) == +- PCI_BASE_ADDRESS_MEM_TYPE_64 ) +- { +- reg_val = pci_conf_read32(bus, slot, func, +- PCI_BASE_ADDRESS_0 + 4 * (bar_index + 1)); +- bar_base |= ((u64)reg_val) << 32; +- } +- +- return bar_base; +-} +- + /** + * msix_capability_init - configure device's MSI-X capability + * @dev: pointer to the pci_dev data structure of MSI-X device function +@@ -522,7 +500,7 @@ + * single MSI-X irq. A return of zero indicates the successful setup of + * requested MSI-X entries with allocated irqs or non-zero for otherwise. + **/ +-static int msix_capability_init(struct pci_dev *dev, int vector, int entry_nr) ++static int msix_capability_init(struct pci_dev *dev, struct msi_info *msi) + { + struct msi_desc *entry; + int pos; +@@ -549,7 +527,7 @@ + table_offset = pci_conf_read32(bus, slot, func, msix_table_offset_reg(pos)); + bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK); + table_offset &= ~PCI_MSIX_FLAGS_BIRMASK; +- phys_addr = pci_resource_start(dev, bir) + table_offset; ++ phys_addr = msi->table_base + table_offset; + idx = msix_fixmap_alloc(); + if ( idx < 0 ) + { +@@ -561,11 +539,11 @@ + + entry->msi_attrib.type = PCI_CAP_ID_MSIX; + entry->msi_attrib.is_64 = 1; +- entry->msi_attrib.entry_nr = entry_nr; ++ entry->msi_attrib.entry_nr = msi->entry_nr; + entry->msi_attrib.maskbit = 1; + entry->msi_attrib.masked = 1; + entry->msi_attrib.pos = pos; +- entry->vector = vector; ++ entry->vector = msi->vector; + entry->dev = dev; + entry->mask_base = base; + +@@ -589,24 +567,25 @@ + * indicates the successful setup of an entry zero with the new MSI + * irq or non-zero for otherwise. + **/ +-static int __pci_enable_msi(u8 bus, u8 devfn, int vector) ++static int __pci_enable_msi(struct msi_info *msi) + { + int status; + struct pci_dev *pdev; + +- pdev = pci_lock_pdev(bus, devfn); ++ pdev = pci_lock_pdev(msi->bus, msi->devfn); + if ( !pdev ) + return -ENODEV; + +- if ( find_msi_entry(pdev, vector, PCI_CAP_ID_MSI) ) ++ if ( find_msi_entry(pdev, msi->vector, PCI_CAP_ID_MSI) ) + { + spin_unlock(&pdev->lock); +- dprintk(XENLOG_WARNING, "vector %d has already mapped to MSI on device \ +- %02x:%02x.%01x.\n", vector, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); ++ dprintk(XENLOG_WARNING, "vector %d has already mapped to MSI on " ++ "device %02x:%02x.%01x.\n", msi->vector, msi->bus, ++ PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn)); + return 0; + } + +- status = msi_capability_init(pdev, vector); ++ status = msi_capability_init(pdev, msi->vector); + spin_unlock(&pdev->lock); + return status; + } +@@ -659,37 +638,37 @@ + * of irqs available. Driver should use the returned value to re-send + * its request. + **/ +-static int __pci_enable_msix(u8 bus, u8 devfn, int vector, int entry_nr) ++static int __pci_enable_msix(struct msi_info *msi) + { + int status, pos, nr_entries; + struct pci_dev *pdev; + u16 control; +- u8 slot = PCI_SLOT(devfn); +- u8 func = PCI_FUNC(devfn); ++ u8 slot = PCI_SLOT(msi->devfn); ++ u8 func = PCI_FUNC(msi->devfn); + +- pdev = pci_lock_pdev(bus, devfn); ++ pdev = pci_lock_pdev(msi->bus, msi->devfn); + if ( !pdev ) + return -ENODEV; + +- pos = pci_find_cap_offset(bus, slot, func, PCI_CAP_ID_MSIX); +- control = pci_conf_read16(bus, slot, func, msi_control_reg(pos)); ++ pos = pci_find_cap_offset(msi->bus, slot, func, PCI_CAP_ID_MSIX); ++ control = pci_conf_read16(msi->bus, slot, func, msi_control_reg(pos)); + nr_entries = multi_msix_capable(control); +- if (entry_nr > nr_entries) ++ if (msi->entry_nr > nr_entries) + { + spin_unlock(&pdev->lock); + return -EINVAL; + } + +- if ( find_msi_entry(pdev, vector, PCI_CAP_ID_MSIX) ) ++ if ( find_msi_entry(pdev, msi->vector, PCI_CAP_ID_MSIX) ) + { + spin_unlock(&pdev->lock); +- dprintk(XENLOG_WARNING, "vector %d has already mapped to MSIX on \ +- device %02x:%02x.%01x.\n", vector, bus, +- PCI_SLOT(devfn), PCI_FUNC(devfn)); ++ dprintk(XENLOG_WARNING, "vector %d has already mapped to MSIX on " ++ "device %02x:%02x.%01x.\n", msi->vector, msi->bus, ++ PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn)); + return 0; + } + +- status = msix_capability_init(pdev, vector, entry_nr); ++ status = msix_capability_init(pdev, msi); + spin_unlock(&pdev->lock); + return status; + } +@@ -727,13 +706,12 @@ + spin_unlock(&dev->lock); + } + +-int pci_enable_msi(u8 bus, u8 devfn, int vector, int entry_nr, int msi) ++int pci_enable_msi(struct msi_info *msi) + { +- ASSERT(spin_is_locked(&irq_desc[vector].lock)); +- if ( msi ) +- return __pci_enable_msi(bus, devfn, vector); +- else +- return __pci_enable_msix(bus, devfn, vector, entry_nr); ++ ASSERT(spin_is_locked(&irq_desc[msi->vector].lock)); ++ ++ return msi->table_base ? __pci_enable_msix(msi) : ++ __pci_enable_msi(msi); + } + + void pci_disable_msi(int vector) +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/physdev.c +--- a/xen/arch/x86/physdev.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/physdev.c Fri Aug 22 10:45:30 2008 +0100 +@@ -66,6 +66,7 @@ + { + int ret = 0; + int old_vector, old_pirq; ++ struct msi_info msi; + + if ( d == NULL ) + return -EINVAL; +@@ -115,10 +116,14 @@ + vector); + desc->handler = &pci_msi_type; + +- ret = pci_enable_msi(map->msi_info.bus, +- map->msi_info.devfn, vector, +- map->msi_info.entry_nr, +- map->msi_info.msi); ++ msi.bus = map->bus; ++ msi.devfn = map->devfn; ++ msi.entry_nr = map->entry_nr; ++ msi.table_base = map->table_base; ++ msi.vector = vector; ++ ++ ret = pci_enable_msi(&msi); ++ + spin_unlock_irqrestore(&desc->lock, flags); + if ( ret ) + goto done; +@@ -139,7 +144,7 @@ + int ret = 0; + int vector; + +- if ( d == NULL || pirq < 0 || pirq > NR_PIRQS ) ++ if ( d == NULL || pirq < 0 || pirq >= NR_PIRQS ) + return -EINVAL; + + if ( !IS_PRIV(current->domain) ) +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/smpboot.c +--- a/xen/arch/x86/smpboot.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/smpboot.c Fri Aug 22 10:45:30 2008 +0100 +@@ -325,7 +325,7 @@ + */ + wait_for_init_deassert(&init_deasserted); + +- if ( x2apic_is_available() ) ++ if ( x2apic_enabled ) + enable_x2apic(); + + /* +diff -r 2c63cf7b042d -r 566ee473fc27 xen/arch/x86/x86_emulate/x86_emulate.c +--- a/xen/arch/x86/x86_emulate/x86_emulate.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/arch/x86/x86_emulate/x86_emulate.c Fri Aug 22 10:45:30 2008 +0100 +@@ -679,6 +679,15 @@ + #define put_rep_prefix(reps_completed) ({ \ + if ( rep_prefix ) \ + __put_rep_prefix(&_regs, ctxt->regs, ad_bytes, reps_completed); \ ++}) ++ ++/* Clip maximum repetitions so that the index register only just wraps. */ ++#define truncate_ea_and_reps(ea, reps, bytes_per_rep) ({ \ ++ unsigned long __todo = (ctxt->regs->eflags & EF_DF) ? (ea) : ~(ea); \ ++ __todo = truncate_word(__todo, ad_bytes); \ ++ __todo = (__todo / (bytes_per_rep)) + 1; \ ++ (reps) = (__todo < (reps)) ? __todo : (reps); \ ++ truncate_word((ea), ad_bytes); \ + }) + + /* Compatibility function: read guest memory, zero-extend result to a ulong. */ +@@ -2385,7 +2394,7 @@ + unsigned int port = (uint16_t)_regs.edx; + dst.bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes; + dst.mem.seg = x86_seg_es; +- dst.mem.off = truncate_ea(_regs.edi); ++ dst.mem.off = truncate_ea_and_reps(_regs.edi, nr_reps, dst.bytes); + if ( (rc = ioport_access_check(port, dst.bytes, ctxt, ops)) != 0 ) + goto done; + if ( (nr_reps > 1) && (ops->rep_ins != NULL) && +@@ -2414,11 +2423,11 @@ + unsigned long nr_reps = get_rep_prefix(); + unsigned int port = (uint16_t)_regs.edx; + dst.bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes; ++ ea.mem.off = truncate_ea_and_reps(_regs.esi, nr_reps, dst.bytes); + if ( (rc = ioport_access_check(port, dst.bytes, ctxt, ops)) != 0 ) + goto done; + if ( (nr_reps > 1) && (ops->rep_outs != NULL) && +- ((rc = ops->rep_outs(ea.mem.seg, truncate_ea(_regs.esi), +- port, dst.bytes, ++ ((rc = ops->rep_outs(ea.mem.seg, ea.mem.off, port, dst.bytes, + &nr_reps, ctxt)) != X86EMUL_UNHANDLEABLE) ) + { + if ( rc != 0 ) +@@ -2569,7 +2578,7 @@ + unsigned long nr_reps = get_rep_prefix(); + dst.bytes = (d & ByteOp) ? 1 : op_bytes; + dst.mem.seg = x86_seg_es; +- dst.mem.off = truncate_ea(_regs.edi); ++ dst.mem.off = truncate_ea_and_reps(_regs.edi, nr_reps, dst.bytes); + if ( (nr_reps > 1) && (ops->rep_movs != NULL) && + ((rc = ops->rep_movs(ea.mem.seg, truncate_ea(_regs.esi), + dst.mem.seg, dst.mem.off, dst.bytes, +diff -r 2c63cf7b042d -r 566ee473fc27 xen/common/domctl.c +--- a/xen/common/domctl.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/common/domctl.c Fri Aug 22 10:45:30 2008 +0100 +@@ -99,6 +99,7 @@ + + info->domain = d->domain_id; + info->nr_online_vcpus = 0; ++ info->ssidref = 0; + + /* + * - domain is marked as blocked only if all its vcpus are blocked +diff -r 2c63cf7b042d -r 566ee473fc27 xen/drivers/passthrough/io.c +--- a/xen/drivers/passthrough/io.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/drivers/passthrough/io.c Fri Aug 22 10:45:30 2008 +0100 +@@ -74,6 +74,9 @@ + if ( pt_irq_bind->irq_type == PT_IRQ_TYPE_MSI ) + { + int pirq = pt_irq_bind->machine_irq; ++ ++ if ( pirq < 0 || pirq >= NR_IRQS ) ++ return -EINVAL; + + if ( !(hvm_irq_dpci->mirq[pirq].flags & HVM_IRQ_DPCI_VALID ) ) + { +diff -r 2c63cf7b042d -r 566ee473fc27 xen/drivers/passthrough/vtd/iommu.c +--- a/xen/drivers/passthrough/vtd/iommu.c Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/drivers/passthrough/vtd/iommu.c Fri Aug 22 10:45:30 2008 +0100 +@@ -1789,7 +1789,8 @@ + memset(domid_bitmap, 0, domid_bitmap_size / 8); + set_bit(0, domid_bitmap); + +- init_vtd_hw(); ++ if ( init_vtd_hw() ) ++ goto error; + + register_keyhandler('V', dump_iommu_info, "dump iommu info"); + +diff -r 2c63cf7b042d -r 566ee473fc27 xen/include/asm-x86/event.h +--- a/xen/include/asm-x86/event.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/include/asm-x86/event.h Fri Aug 22 10:45:30 2008 +0100 +@@ -69,12 +69,7 @@ + /* No arch specific virq definition now. Default to global. */ + static inline int arch_virq_is_global(int virq) + { +- switch (virq) { +- case VIRQ_MCA: +- return 1; +- default: +- return 1; +- } ++ return 1; + } + + #endif +diff -r 2c63cf7b042d -r 566ee473fc27 xen/include/asm-x86/hvm/svm/emulate.h +--- a/xen/include/asm-x86/hvm/svm/emulate.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/include/asm-x86/hvm/svm/emulate.h Fri Aug 22 10:45:30 2008 +0100 +@@ -30,6 +30,7 @@ + INSTR_VMCALL, + INSTR_HLT, + INSTR_INT3, ++ INSTR_RDTSC, + INSTR_MAX_COUNT /* Must be last - Number of instructions supported */ + }; + +diff -r 2c63cf7b042d -r 566ee473fc27 xen/include/asm-x86/msi.h +--- a/xen/include/asm-x86/msi.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/include/asm-x86/msi.h Fri Aug 22 10:45:30 2008 +0100 +@@ -54,6 +54,14 @@ + #define MAX_MSIX_PAGES 32 + #endif + ++struct msi_info { ++ int bus; ++ int devfn; ++ int vector; ++ int entry_nr; ++ uint64_t table_base; ++}; ++ + struct msi_msg { + u32 address_lo; /* low 32 bits of msi message address */ + u32 address_hi; /* high 32 bits of msi message address */ +@@ -64,7 +72,7 @@ + extern void mask_msi_irq(unsigned int irq); + extern void unmask_msi_irq(unsigned int irq); + extern void set_msi_irq_affinity(unsigned int irq, cpumask_t mask); +-extern int pci_enable_msi(u8 bus, u8 devfn, int vector, int entry_nr, int msi); ++extern int pci_enable_msi(struct msi_info *msi); + extern void pci_disable_msi(int vector); + extern void pci_cleanup_msi(struct pci_dev *pdev); + +diff -r 2c63cf7b042d -r 566ee473fc27 xen/include/public/physdev.h +--- a/xen/include/public/physdev.h Tue Aug 12 10:23:34 2008 +0100 ++++ b/xen/include/public/physdev.h Fri Aug 22 10:45:30 2008 +0100 +@@ -136,10 +136,13 @@ + /* IN or OUT */ + int pirq; + /* IN */ +- struct { +- int bus, devfn, entry_nr; +- int msi; /* 0 - MSIX 1 - MSI */ +- } msi_info; ++ int bus; ++ /* IN */ ++ int devfn; ++ /* IN */ ++ int entry_nr; ++ /* IN */ ++ uint64_t table_base; + }; + typedef struct physdev_map_pirq physdev_map_pirq_t; + DEFINE_XEN_GUEST_HANDLE(physdev_map_pirq_t); --- xen-3.3-3.3.0.orig/debian/patches/gcc-4.4-fixes.diff +++ xen-3.3-3.3.0/debian/patches/gcc-4.4-fixes.diff @@ -0,0 +1,13 @@ +Index: xen-3.3-3.3.0/xen/arch/x86/hvm/vpic.c +=================================================================== +--- xen-3.3-3.3.0.orig/xen/arch/x86/hvm/vpic.c 2009-05-14 12:03:55.000000000 -0400 ++++ xen-3.3-3.3.0/xen/arch/x86/hvm/vpic.c 2009-05-14 12:04:11.000000000 -0400 +@@ -56,7 +56,7 @@ + + /* prio = ffs(mask ROR vpic->priority_add); */ + asm ( "ror %%cl,%b1 ; bsf %1,%0" +- : "=r" (prio) : "r" ((uint32_t)mask), "c" (vpic->priority_add) ); ++ : "=r" (prio) : "q" ((uint32_t)mask), "c" (vpic->priority_add) ); + return prio; + } + --- xen-3.3-3.3.0.orig/debian/patches/series +++ xen-3.3-3.3.0/debian/patches/series @@ -0,0 +1,9 @@ +gcc-4.5-fix.diff +xen-snapshot-3.3.0.diff +xen-ubuntu-fixes.diff +fix-ioemu-amd64.diff +use-python-2.6.diff +suppress-python-2.6-warnings.diff +gcc-4.4-fixes.diff +fix-libxc-warning.diff +add_missing_header.diff --- xen-3.3-3.3.0.orig/debian/patches/add_missing_header.diff +++ xen-3.3-3.3.0/debian/patches/add_missing_header.diff @@ -0,0 +1,12 @@ +Index: xen-3.3-3.3.0/tools/blktap/drivers/blktapctrl.c +=============================================================== +--- xen-3.3-3.3.0.orig/tools/blktap/drivers/blktapctrl.c ++++ xen-3.3-3.3.0/tools/blktap/drivers/blktapctrl.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include + + #include "blktaplib.h" + #include "blktapctrl.h" --- xen-3.3-3.3.0.orig/debian/patches/suppress-python-2.6-warnings.diff +++ xen-3.3-3.3.0/debian/patches/suppress-python-2.6-warnings.diff @@ -0,0 +1,50 @@ +Index: xen-3.3-3.3.0/tools/python/xen/util/acmpolicy.py +=================================================================== +--- xen-3.3-3.3.0.orig/tools/python/xen/util/acmpolicy.py 2009-05-16 18:00:31.000000000 -0400 ++++ xen-3.3-3.3.0/tools/python/xen/util/acmpolicy.py 2009-05-16 18:49:42.000000000 -0400 +@@ -17,7 +17,10 @@ + #============================================================================ + + import os +-import sha ++try: ++ from hashlib import sha1 ++except: ++ from sha import sha as sha1 + import stat + import array + import struct +@@ -1103,7 +1106,7 @@ + + def hash(self): + """ Calculate a SAH1 hash of the XML policy """ +- return sha.sha(self.toxml()) ++ return sha1(self.toxml()) + + def save(self): + ### Save the XML policy into a file ### +Index: xen-3.3-3.3.0/tools/python/xen/xend/XendAPI.py +=================================================================== +--- xen-3.3-3.3.0.orig/tools/python/xen/xend/XendAPI.py 2009-05-16 18:00:31.000000000 -0400 ++++ xen-3.3-3.3.0/tools/python/xen/xend/XendAPI.py 2009-05-16 18:49:42.000000000 -0400 +@@ -18,7 +18,10 @@ + import inspect + import os + import Queue +-import sets ++try: ++ set() ++except NameError: ++ from sets import Set as set + import string + import sys + import traceback +@@ -116,7 +119,7 @@ + def event_register(session, reg_classes): + if session not in event_registrations: + event_registrations[session] = { +- 'classes' : sets.Set(), ++ 'classes' : set(), + 'queue' : Queue.Queue(EVENT_QUEUE_LENGTH), + 'next-id' : 1 + } --- xen-3.3-3.3.0.orig/debian/patches/fix-libxc-warning.diff +++ xen-3.3-3.3.0/debian/patches/fix-libxc-warning.diff @@ -0,0 +1,14 @@ +Index: xen-3.3-3.3.0/tools/libxc/xc_core.c +=================================================================== +--- xen-3.3-3.3.0.orig/tools/libxc/xc_core.c 2009-06-29 03:40:03.000000000 -0400 ++++ xen-3.3-3.3.0/tools/libxc/xc_core.c 2009-06-29 03:40:29.000000000 -0400 +@@ -324,7 +324,8 @@ + struct xen_dumpcore_elfnote_none_desc none; + + elfnote_init(&elfnote); +- memset(&none, 0, sizeof(none)); ++ if ( sizeof(none) != 0 ) ++ memset(&none, 0, sizeof(none)); + + elfnote.descsz = sizeof(none); + elfnote.type = XEN_ELFNOTE_DUMPCORE_NONE; --- xen-3.3-3.3.0.orig/debian/patches/xen-ubuntu-fixes.diff +++ xen-3.3-3.3.0/debian/patches/xen-ubuntu-fixes.diff @@ -0,0 +1,155 @@ +diff -Naur xen-3.3-3.3.0.orig/config/StdGNU.mk xen-3.3-3.3.0/config/StdGNU.mk +--- xen-3.3-3.3.0.orig/config/StdGNU.mk 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/config/StdGNU.mk 2008-09-13 10:32:41.000000000 -0400 +@@ -25,7 +25,7 @@ + BINDIR = $(PREFIX)/bin + INCLUDEDIR = $(PREFIX)/include + LIBLEAFDIR = lib +-LIBLEAFDIR_x86_64 = lib64 ++LIBLEAFDIR_x86_64 = lib + LIBDIR = $(PREFIX)/$(LIBLEAFDIR) + LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64) + MANDIR = $(PREFIX)/share/man +diff -Naur xen-3.3-3.3.0.orig/Config.mk xen-3.3-3.3.0/Config.mk +--- xen-3.3-3.3.0.orig/Config.mk 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/Config.mk 2008-09-13 10:32:41.000000000 -0400 +@@ -84,7 +84,7 @@ + + # Specify which qemu-dm to use. This may be `ioemu' to use the old + # Mercurial in-tree version, or a local directory, or a git URL. +-# CONFIG_QEMU ?= ioemu ++CONFIG_QEMU ?= ioemu + # CONFIG_QEMU ?= ../qemu-xen.git + ifeq ($(XEN_TARGET_ARCH),ia64) + CONFIG_QEMU ?= ioemu +diff -Naur xen-3.3-3.3.0.orig/docs/Makefile xen-3.3-3.3.0/docs/Makefile +--- xen-3.3-3.3.0.orig/docs/Makefile 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/docs/Makefile 2008-09-13 10:32:41.000000000 -0400 +@@ -21,7 +21,7 @@ + all: build + + .PHONY: build +-build: ps pdf html man-pages ++build: man-pages + @if which $(DOT) 1>/dev/null 2>/dev/null ; then \ + $(MAKE) -C xen-api build ; else \ + echo "Graphviz (dot) not installed; skipping xen-api." ; fi +@@ -83,10 +83,10 @@ + rm -rf $(DESTDIR)$(DOCDIR) + $(INSTALL_DIR) $(DESTDIR)$(DOCDIR) + +- $(MAKE) -C xen-api install ++# $(MAKE) -C xen-api install + +- cp -dR ps $(DESTDIR)$(DOCDIR) +- cp -dR pdf $(DESTDIR)$(DOCDIR) ++# cp -dR ps $(DESTDIR)$(DOCDIR) ++# cp -dR pdf $(DESTDIR)$(DOCDIR) + $(INSTALL_DIR) $(DESTDIR)$(MANDIR) + cp -dR man1 $(DESTDIR)$(MANDIR) + cp -dR man5 $(DESTDIR)$(MANDIR) +diff -Naur xen-3.3-3.3.0.orig/install.sh xen-3.3-3.3.0/install.sh +--- xen-3.3-3.3.0.orig/install.sh 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/install.sh 2008-09-13 10:32:41.000000000 -0400 +@@ -27,8 +27,8 @@ + echo "Installing Xen from '$src' to '$dst'..." + (cd $src; tar -cf - * ) | tar -C "$tmp" -xf - + +-[ -x "$(which udevinfo)" ] && \ +- UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/') ++[ -x "$(which udevadm)" ] && \ ++ UDEV_VERSION=$(udevadm -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/') + + if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then + echo " - installing for udev-based system" +diff -Naur xen-3.3-3.3.0.orig/tools/check/check_udev xen-3.3-3.3.0/tools/check/check_udev +--- xen-3.3-3.3.0.orig/tools/check/check_udev 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/check/check_udev 2008-09-13 10:32:41.000000000 -0400 +@@ -8,8 +8,8 @@ + has_or_fail vnconfig + ;; + Linux) +- has_or_fail udevinfo +- [ "`udevinfo -V | awk '{print $NF}'`" -ge 59 ] 2>/dev/null || \ ++ has_or_fail udevadm ++ [ "`udevadm -V | awk '{print $NF}'`" -ge 59 ] 2>/dev/null || \ + has hotplug || \ + fail "udev is too old, upgrade to version 59 or later" + ;; +diff -Naur xen-3.3-3.3.0.orig/tools/ioemu/patches/xen-build xen-3.3-3.3.0/tools/ioemu/patches/xen-build +--- xen-3.3-3.3.0.orig/tools/ioemu/patches/xen-build 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/ioemu/patches/xen-build 2008-09-13 10:32:41.000000000 -0400 +@@ -190,7 +190,7 @@ + ;; + x86_64|amd64) + cpu="x86_64" +-+ libdir="lib64" +++ libdir="lib" + ;; + *) + cpu="unknown" +diff -Naur xen-3.3-3.3.0.orig/tools/libxc/xc_dom_x86.c xen-3.3-3.3.0/tools/libxc/xc_dom_x86.c +--- xen-3.3-3.3.0.orig/tools/libxc/xc_dom_x86.c 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/libxc/xc_dom_x86.c 2008-09-13 10:32:41.000000000 -0400 +@@ -418,7 +418,7 @@ + xc_dom_printf("%s: called\n", __FUNCTION__); + + memset(start_info, 0, sizeof(*start_info)); +- snprintf(start_info->magic, sizeof(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 @@ + xc_dom_printf("%s: called\n", __FUNCTION__); + + memset(start_info, 0, sizeof(*start_info)); +- snprintf(start_info->magic, sizeof(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; +diff -Naur xen-3.3-3.3.0.orig/tools/xenstat/xentop/xentop.c xen-3.3-3.3.0/tools/xenstat/xentop/xentop.c +--- xen-3.3-3.3.0.orig/tools/xenstat/xentop/xentop.c 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/xenstat/xentop/xentop.c 2008-09-13 10:32:41.000000000 -0400 +@@ -254,7 +254,7 @@ + { + if(cwin != NULL && !isendwin()) + endwin(); +- fprintf(stderr, str); ++ fprintf(stderr, "%s", str); + exit(1); + } + +diff -Naur xen-3.3-3.3.0.orig/xen/drivers/char/console.c xen-3.3-3.3.0/xen/drivers/char/console.c +--- xen-3.3-3.3.0.orig/xen/drivers/char/console.c 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/xen/drivers/char/console.c 2008-09-13 10:32:41.000000000 -0400 +@@ -919,7 +919,7 @@ + console_start_sync(); + printk("\n****************************************\n"); + printk("Panic on CPU %d:\n", smp_processor_id()); +- printk(buf); ++ printk("%s", buf); + printk("****************************************\n\n"); + if ( opt_noreboot ) + printk("Manual reset required ('noreboot' specified)\n"); +diff -Naur xen-3.3-3.3.0.orig/xen/tools/symbols.c xen-3.3-3.3.0/xen/tools/symbols.c +--- xen-3.3-3.3.0.orig/xen/tools/symbols.c 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/xen/tools/symbols.c 2008-09-13 10:32:41.000000000 -0400 +@@ -74,14 +74,14 @@ + static int read_symbol(FILE *in, struct sym_entry *s) + { + char str[500]; +- char *sym, stype; ++ char *sym, stype, *temp; + int rc; + + rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str); + if (rc != 3) { + if (rc != EOF) { + /* skip line */ +- fgets(str, 500, in); ++ temp = fgets(str, 500, in); + } + return -1; + } --- xen-3.3-3.3.0.orig/debian/patches/fix-ioemu-amd64.diff +++ xen-3.3-3.3.0/debian/patches/fix-ioemu-amd64.diff @@ -0,0 +1,36 @@ +diff -Naur xen-3.3-3.3.0.orig/tools/ioemu/configure xen-3.3-3.3.0/tools/ioemu/configure +--- xen-3.3-3.3.0.orig/tools/ioemu/configure 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/ioemu/configure 2008-08-27 09:14:03.000000000 -0400 +@@ -42,7 +42,7 @@ + ;; + x86_64) + cpu="x86_64" +- [ `uname -s` = "Linux" ] && libdir="lib64" ++ [ `uname -s` = "Linux" ] && libdir="lib" + ;; + *) + cpu="unknown" +diff -Naur xen-3.3-3.3.0.orig/tools/ioemu/patches/qemu-target-i386-dm xen-3.3-3.3.0/tools/ioemu/patches/qemu-target-i386-dm +--- xen-3.3-3.3.0.orig/tools/ioemu/patches/qemu-target-i386-dm 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/ioemu/patches/qemu-target-i386-dm 2008-08-27 09:14:51.000000000 -0400 +@@ -1395,7 +1395,7 @@ + +#!/bin/sh + + + +if [ "`arch`" = "x86_64" ]; then +-+ LIBDIR="lib64" +++ LIBDIR="lib" + +else + + LIBDIR="lib" + +fi +diff -Naur xen-3.3-3.3.0.orig/tools/ioemu/x86_64.ld xen-3.3-3.3.0/tools/ioemu/x86_64.ld +--- xen-3.3-3.3.0.orig/tools/ioemu/x86_64.ld 2008-08-12 05:23:34.000000000 -0400 ++++ xen-3.3-3.3.0/tools/ioemu/x86_64.ld 2008-08-27 09:15:22.000000000 -0400 +@@ -2,7 +2,7 @@ + OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") + OUTPUT_ARCH(i386:x86-64) + ENTRY(_start) +-SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); ++SEARCH_DIR("/lib"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); + SECTIONS + { + /* Read-only sections, merged into text segment: */ --- xen-3.3-3.3.0.orig/debian/patches/use-python-2.6.diff +++ xen-3.3-3.3.0/debian/patches/use-python-2.6.diff @@ -0,0 +1,39 @@ +Index: xen-3.3-3.3.0/tools/python/Makefile +=================================================================== +--- xen-3.3-3.3.0.orig/tools/python/Makefile 2009-05-17 10:00:51.000000000 -0400 ++++ xen-3.3-3.3.0/tools/python/Makefile 2009-05-17 10:00:53.000000000 -0400 +@@ -80,7 +80,7 @@ + CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr" --prefix="" --force --install-lib="$(DESTDIR)$(LIBPATH)/python" + else + install: install-messages install-dtd +- CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --force ++ CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --force --install-layout=deb + endif + + install-dtd: all +Index: xen-3.3-3.3.0/tools/misc/xen-python-path +=================================================================== +--- xen-3.3-3.3.0.orig/tools/misc/xen-python-path 2009-05-17 10:00:51.000000000 -0400 ++++ xen-3.3-3.3.0/tools/misc/xen-python-path 2009-05-17 10:00:53.000000000 -0400 +@@ -35,7 +35,7 @@ + + for l in list: + for p in ['python%s' % sys.version[:3], 'python']: +- for k in ['', 'site-packages/']: ++ for k in ['', 'site-packages/', 'dist-packages/']: + d = os.path.join(l, p, k) + if os.path.exists(os.path.join(d, AUXBIN)): + sys.path.append(d) +Index: xen-3.3-3.3.0/tools/pygrub/Makefile +=================================================================== +--- xen-3.3-3.3.0.orig/tools/pygrub/Makefile 2009-05-17 10:01:06.000000000 -0400 ++++ xen-3.3-3.3.0/tools/pygrub/Makefile 2009-05-17 10:02:14.000000000 -0400 +@@ -16,7 +16,7 @@ + $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot + else + install: all +- CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" ++ CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --install-layout=deb + $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot + endif + --- xen-3.3-3.3.0.orig/debian/patches/gcc-4.5-fix.diff +++ xen-3.3-3.3.0/debian/patches/gcc-4.5-fix.diff @@ -0,0 +1,17 @@ +Description: Fix FTBFS with gcc 4.5 with error: case value '3' not in enumerated + type 'const enum xs_perm_type' +Origin: upstream, http://xen.1045712.n5.nabble.com/xen-3-4-testing-xenstore-Resolve-gcc4-5-type-error-td2621940.html + +Index: xen-3.3-3.3.0/tools/xenstore/xs_lib.c +=================================================================== +--- xen-3.3-3.3.0.orig/tools/xenstore/xs_lib.c 2011-03-12 06:19:49.436254000 +0000 ++++ xen-3.3-3.3.0/tools/xenstore/xs_lib.c 2011-03-12 06:19:44.416254001 +0000 +@@ -149,7 +149,7 @@ + bool xs_perm_to_string(const struct xs_permissions *perm, + char *buffer, size_t buf_len) + { +- switch (perm->perms) { ++ switch ((int)perm->perms) { + case XS_PERM_WRITE: + *buffer = 'w'; + break; --- xen-3.3-3.3.0.orig/debian/scripts/network-dummy +++ xen-3.3-3.3.0/debian/scripts/network-dummy @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 0