--- libvirt-0.7.2.orig/debian/libvirt-bin.dirs +++ libvirt-0.7.2/debian/libvirt-bin.dirs @@ -0,0 +1,9 @@ +/etc/apparmor.d/abstractions +/etc/apparmor.d/force-complain +/etc/apparmor.d/libvirt +/etc/cron.daily +/usr/share/apport/package-hooks +/var/lib/libvirt/images +/var/lib/libvirt/boot +/var/cache/libvirt +/var/log/libvirt/qemu --- libvirt-0.7.2.orig/debian/libvirt-bin.preinst +++ libvirt-0.7.2/debian/libvirt-bin.preinst @@ -0,0 +1,38 @@ +#!/bin/sh +# preinst script for libvirt-bin +# +# see: dh_installdeb(1) + +set -e + +APP_PROFILE="usr.sbin.libvirtd" +APP_CONFFILE="/etc/apparmor.d/$APP_PROFILE" +APP_COMPLAIN="/etc/apparmor.d/force-complain/$APP_PROFILE" +if [ "$1" = "upgrade" ]; then + mkdir -p `dirname $APP_COMPLAIN` 2>/dev/null || true + if dpkg --compare-versions $2 lt "0.1.8-0ubuntu2" ; then + # force-complain for pre-apparmor upgrades + ln -sf $APP_CONFFILE $APP_COMPLAIN + elif dpkg --compare-versions $2 lt "0.6.1-0ubuntu6" ; then + if [ -e "$APP_CONFFILE" ]; then + md5sum="`md5sum \"$APP_CONFFILE\" | sed -e \"s/ .*//\"`" + pkg_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $APP_CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`" + if [ "$md5sum" = "$pkg_md5sum" ]; then + # force-complain on upgrade from pre-shipped profile and + # existing profile is same as in conffiles + ln -sf $APP_CONFFILE $APP_COMPLAIN + fi + else + # force-complain on upgrade from pre-shipped profile and + # there is no existing profile + ln -sf $APP_CONFFILE $APP_COMPLAIN + fi + fi +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- libvirt-0.7.2.orig/debian/libvirt-bin.init +++ libvirt-0.7.2/debian/libvirt-bin.init @@ -0,0 +1,170 @@ +#! /bin/sh +# +# Init script for libvirtd +# +# (c) 2007 Guido Guenther +# based on the skeletons that comes with dh_make +# +### BEGIN INIT INFO +# Provides: libvirt-bin libvirtd +# Required-Start: $network $local_fs +# Required-Stop: +# Should-Start: hal avahi +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: libvirt management daemon +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/libvirtd +NAME=libvirtd +DESC="libvirt management daemon" + +test -x $DAEMON || exit 0 +. /lib/lsb/init-functions + +PIDFILE=/var/run/$NAME.pid +DODTIME=1 # Time to wait for the server to die, in seconds + +# Include libvirtd defaults if available +if [ -f /etc/default/libvirt-bin ] ; then + . /etc/default/libvirt-bin +fi + +check_start_libvirtd_option() { + if [ ! "$start_libvirtd" = "yes" ]; then + log_warning_msg "Not starting libvirt management daemon libvirtd, disabled via /etc/default/libvirt-bin" + return 1 + else + return 0 + fi +} + +running_pid() +{ + # Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` + # Is this the expected child? + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() +{ +# Check if the process is running looking at /proc +# (works for all users) + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + # Obtain the pid and check it against the binary name + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +force_stop() { +# Forcefully kill the process + [ ! -f "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + [ -n "$DODTIME" ] && sleep "$DODTIME"s + if running ; then + kill -9 $pid + [ -n "$DODTIME" ] && sleep "$DODTIME"s + if running ; then + echo "Cannot kill $LABEL (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE + return 0 +} + +mkdir -p /var/run/libvirt +case "$1" in + start) + if check_start_libvirtd_option; then + log_daemon_msg "Starting $DESC" "$NAME" + if running ; then + log_progress_msg "already running" + log_end_msg 0 + exit 0 + fi + rm -f /var/run/libvirtd.pid + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec $DAEMON -- $libvirtd_opts + if running; then + log_end_msg 0 + else + log_end_msg 1 + fi + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if ! running ; then + log_progress_msg "not running" + log_end_msg 0 + exit 0 + fi + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + log_end_msg 0 + ;; + force-stop) + log_daemon_msg "Forcefully stopping $DESC" "$NAME" + force_stop + if ! running; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + restart) + if check_start_libvirtd_option; then + log_daemon_msg "Restarting $DESC" "$DAEMON" + start-stop-daemon --oknodo --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + [ -n "$DODTIME" ] && sleep $DODTIME + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON -- $libvirtd_opts + if running; then + log_end_msg 0 + else + log_end_msg 1 + fi + fi + ;; + reload|force-reload) + if running; then + log_daemon_msg "Reloading configuration of $DESC" "$NAME" + start-stop-daemon --stop --signal 1 --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + log_end_msg 0 + else + log_warning_msg "libvirtd not running, doing nothing." + fi + ;; + status) + log_daemon_msg "Checking status of $DESC" "$NAME" + if running ; then + log_progress_msg "running" + log_end_msg 0 + else + log_progress_msg "not running" + log_end_msg 1 + fi + ;; + *) + N=/etc/init.d/libvirt-bin + echo "Usage: $N {start|stop|restart|reload|force-reload|status|force-stop}" >&2 + exit 1 + ;; +esac + +exit 0 --- libvirt-0.7.2.orig/debian/compat +++ libvirt-0.7.2/debian/compat @@ -0,0 +1 @@ +7 --- libvirt-0.7.2.orig/debian/libvirt-bin.examples +++ libvirt-0.7.2/debian/libvirt-bin.examples @@ -0,0 +1,5 @@ +daemon/libvirtd.conf +daemon/libvirtd.policy-0 +daemon/libvirtd.policy-1 +daemon/libvirtd.sasl +debian/libvirt-suspendonreboot --- libvirt-0.7.2.orig/debian/libvirt0.symbols +++ libvirt-0.7.2/debian/libvirt0.symbols @@ -0,0 +1,28 @@ +libvirt.so.0 libvirt0 #MINVER# + *@LIBVIRT_0.0.3 0.0.3 + *@LIBVIRT_0.0.5 0.0.5 + *@LIBVIRT_0.1.0 0.1.0 + *@LIBVIRT_0.1.1 0.1.1 + *@LIBVIRT_0.1.4 0.1.4 + *@LIBVIRT_0.1.5 0.1.5 + *@LIBVIRT_0.1.9 0.1.9 + *@LIBVIRT_0.2.0 0.2.0 + *@LIBVIRT_0.2.1 0.2.1 + *@LIBVIRT_0.2.3 0.2.3 + *@LIBVIRT_0.3.0 0.3.0 + *@LIBVIRT_0.3.2 0.3.2 + *@LIBVIRT_0.3.3 0.3.3 + *@LIBVIRT_0.4.0 0.4.0 + *@LIBVIRT_0.4.1 0.4.1 + *@LIBVIRT_0.4.2 0.4.2 + *@LIBVIRT_0.4.5 0.4.5 + *@LIBVIRT_0.5.0 0.5.0 + *@LIBVIRT_0.6.0 0.6.0 + *@LIBVIRT_0.6.1 0.6.1 + *@LIBVIRT_0.6.3 0.6.3 + *@LIBVIRT_0.6.4 0.6.4 + *@LIBVIRT_0.6.5 0.6.5 + *@LIBVIRT_0.7.0 0.7.0 + *@LIBVIRT_0.7.1 0.7.1 + *@LIBVIRT_0.7.2 0.7.2 + *@LIBVIRT_PRIVATE_0.7.2 0.7.2 --- libvirt-0.7.2.orig/debian/libvirt-bin.manpages +++ libvirt-0.7.2/debian/libvirt-bin.manpages @@ -0,0 +1 @@ +tools/virsh.1 --- libvirt-0.7.2.orig/debian/libvirt-bin.cron.daily +++ libvirt-0.7.2/debian/libvirt-bin.cron.daily @@ -0,0 +1,34 @@ +#!/bin/sh +# +# clean out AppArmor profiles for virtual machines that no longer exist +# +set -e + +PROFILES_DIR="/etc/apparmor.d/libvirt" +AA_PROFILES="/sys/kernel/security/apparmor/profiles" + +uuids="" +remove_if_unused() { + uuid=`basename "$1" | sed 's/libvirt-//' | egrep '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'` || return + + # don't remove a profile for an existing VM + echo "$uuids" | grep -q "$uuid" && return + + # don't remove a loaded profile + if [ -e "$AA_PROFILES" ] && grep -q "$uuid" "$AA_PROFILES" ; then + return + fi + + find $PROFILES_DIR -name "libvirt-${uuid}*" -prune -type f -exec rm -f -- '{}' \; +} + +# read in all existing uuids +for i in `ls -1 /etc/libvirt/qemu/*.xml 2>/dev/null` ; do + uuid=`grep '' "$i" | sed 's#.*\(.*\).*#\1#'` + uuids="$uuids $uuid" +done + +for i in `ls -1 $PROFILES_DIR/libvirt-* 2>/dev/null` ; do + basename "$i" | egrep -q '\.' && continue + remove_if_unused "$i" || true +done --- libvirt-0.7.2.orig/debian/libvirt-doc.doc-base.libvirt-doc +++ libvirt-0.7.2/debian/libvirt-doc.doc-base.libvirt-doc @@ -0,0 +1,8 @@ +Document: libvirt-doc +Title: Libvirt the virtualization API +Abstract: Local copy of the web site of libvirt +Section: System/Administration + +Format: HTML +Index: /usr/share/doc/libvirt-doc/intro.html +Files: /usr/share/doc/libvirt-doc/*.html --- libvirt-0.7.2.orig/debian/libvirt0.install +++ libvirt-0.7.2/debian/libvirt0.install @@ -0,0 +1,2 @@ +usr/lib/libvirt.so.* + --- libvirt-0.7.2.orig/debian/libvirt-bin.libvirtd.logrotate +++ libvirt-0.7.2/debian/libvirt-bin.libvirtd.logrotate @@ -0,0 +1,9 @@ +/var/log/libvirt/qemu/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + copytruncate +} --- libvirt-0.7.2.orig/debian/control +++ libvirt-0.7.2/debian/control @@ -0,0 +1,100 @@ +Source: libvirt +Section: libs +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Libvirt Maintainers +Uploaders: Guido Günther +Build-Depends: cdbs (>= 0.4.43), debhelper (>= 7), libxml2-dev, libncurses5-dev, libreadline-dev, zlib1g-dev, libgnutls-dev, python-dev (>= 2.3.5-11), python-central (>= 0.5.6), quilt, libavahi-client-dev, libsasl2-dev, libxen3-dev [i386 amd64], lvm2, qemu [amd64 i386 powerpc sparc], open-iscsi, libparted1.8-dev, libselinux1-dev, libdevmapper-dev, uuid-dev, libhal-dev, module-init-tools, + policykit-1, + dpkg-dev (<< 1.15.3) | dpkg-dev (>> 1.15.3), + libapparmor-dev, libxml2-utils +XS-Python-Version: current +Build-Conflicts: dpkg-dev (= 1.15.3) +Vcs-Git: git://git.debian.org/git/pkg-libvirt/libvirt.git +Vcs-Browser: http://git.debian.org/?p=pkg-libvirt/libvirt.git +Homepage: http://libvirt.org +Standards-Version: 3.8.3 + +Package: libvirt-bin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, libvirt0 (= ${binary:Version}), logrotate, + hal, + bridge-utils, dnsmasq-base, netcat-openbsd, iptables +Enhances: qemu, kvm, xen +Section: admin +Recommends: qemu-kvm (>= 0.11.0-0ubuntu6) +Suggests: policykit-1, apparmor (>= 2.3+1289-0ubuntu14) +Description: the programs for the libvirt library + Libvirt is a C toolkit to interact with the virtualization capabilities + of recent versions of Linux (and other OSes). The library aims at providing + a long term stable C API for different virtualization mechanisms. It currently + supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox. + . + This package contains the supporting binaries to use with libvirt + +Package: libvirt0 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libvirt0-dbg (<< 0.4.2-6ubuntu1) +Replaces: libvirt0-dbg (<< 0.4.2-6ubuntu1) +Recommends: lvm2 +Description: library for interfacing with different virtualization systems + Libvirt is a C toolkit to interact with the virtualization capabilities + of recent versions of Linux (and other OSes). The library aims at providing + a long term stable C API for different virtualization mechanisms. It currently + supports QEMU, KVM, and XEN. + +Package: libvirt0-dbg +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libvirt0 (= ${binary:Version}) +Priority: extra +Section: debug +Description: library for interfacing with different virtualization systems + Libvirt is a C toolkit to interact with the virtualization capabilities + of recent versions of Linux (and other OSes). The library aims at providing + a long term stable C API for different virtualization mechanisms. It currently + supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox. + . + This package contains the debugging symbols. + +Package: libvirt-doc +Architecture: all +Section: doc +Depends: ${misc:Depends} +Suggests: devhelp +Description: documentation for the libvirt library + Libvirt is a C toolkit to interact with the virtualization capabilities + of recent versions of Linux (and other OSes). The library aims at providing + a long term stable C API for different virtualization mechanisms. It currently + supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox. + . + This package contains the documentation. + +Package: libvirt-dev +Architecture: any +Section: libdevel +Depends: ${misc:Depends}, libvirt0 (= ${binary:Version}), libxen3-dev [i386 amd64] +Recommends: pkg-config +Description: development files for the libvirt library + Libvirt is a C toolkit to interact with the virtualization capabilities + of recent versions of Linux (and other OSes). The library aims at providing + a long term stable C API for different virtualization mechanisms. It currently + supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox. + . + This package contains the header files and static libraries which are + needed for developing the applications with libvirt. + +Package: python-libvirt +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, libvirt0 (>= ${binary:Version}) +Provides: ${python:Provides} +Section: python +XB-Python-Version: ${python:Versions} +Description: libvirt Python bindings + Libvirt is a C toolkit to interact with the virtualization capabilities + of recent versions of Linux (and other OSes). The library aims at providing + a long term stable C API for different virtualization mechanisms. It currently + supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox. + . + This package contains Python bindings for the libvirt library + --- libvirt-0.7.2.orig/debian/libvirt-suspendonreboot +++ libvirt-0.7.2/debian/libvirt-suspendonreboot @@ -0,0 +1,48 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: libvirt-suspendonreboot +# Required-Start: libvirt-bin +# Required-Stop: libvirt-bin $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: suspend/resmum vms on reboot +### END INIT INFO +# (c) Andi Barth 2008 +# Distributable under the terms of the GNU GPL version 2. +# +# copy to /etc/init.d/libvirt-suspendonreboot and use +# update-rc.d libvirt-suspendonreboot defaults 29 71 +# to enable + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +suspenddir=/var/lib/libvirt/autosuspend + +case "$1" in + start) + for domain in ${suspenddir}/*dump; do + if [ -f $domain ]; then + domain=$(basename $domain .dump) + echo "resuming $domain ..." + virsh restore ${suspenddir}/${domain}.dump && rm ${suspenddir}/${domain}.dump + fi + done + ;; + stop) + for domain in /etc/libvirt/qemu/*xml; do + domain=$(basename $domain .xml) + state=$(virsh domstate $domain) + if [ "$state" = "running" ]; then + echo "suspending $domain ..." + virsh save ${domain} ${suspenddir}/${domain}.dump + fi + done + ;; + reload|force-reload|restart) + # No action, nothing to reload + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 + exit 1 +esac + --- libvirt-0.7.2.orig/debian/libvirt-bin.apport +++ libvirt-0.7.2/debian/libvirt-bin.apport @@ -0,0 +1,59 @@ +'''apport package hook for libvirt-bin + +(c) 2009 Canonical Ltd. +Author: +Jamie Strandboge + +''' + +from apport.hookutils import * +from os import path +import re + +def recent_kernlog(pattern): + '''Extract recent messages from kern.log or message which match a regex. + pattern should be a "re" object. ''' + lines = '' + if os.path.exists('/var/log/kern.log'): + file = '/var/log/kern.log' + elif os.path.exists('/var/log/messages'): + file = '/var/log/messages' + else: + return lines + + for line in open(file): + if pattern.search(line): + lines += line + return lines + +def recent_auditlog(pattern): + '''Extract recent messages from kern.log or message which match a regex. + pattern should be a "re" object. ''' + lines = '' + if os.path.exists('/var/log/audit/audit.log'): + file = '/var/log/audit/audit.log' + else: + return lines + + for line in open(file): + if pattern.search(line): + lines += line + return lines + +def add_info(report): + attach_conffiles(report, 'libvirt-bin') + attach_related_packages(report, ['apparmor', 'libapparmor1', + 'libapparmor-perl', 'apparmor-utils', 'auditd', 'libaudit0']) + + # get apparmor stuff. copied from source_apparmor.py until apport runs + # runs hooks via attach_related_packages + attach_file(report, '/proc/version_signature', 'ProcVersionSignature') + attach_file(report, '/proc/cmdline', 'ProcCmdline') + + sec_re = re.compile('audit\(|apparmor|selinux|security', re.IGNORECASE) + report['KernLog'] = recent_kernlog(sec_re) + + if os.path.exists("/var/log/audit"): + # this needs to be run as root + report['AuditLog'] = recent_auditlog(sec_re) + --- libvirt-0.7.2.orig/debian/libvirt-bin.default +++ libvirt-0.7.2/debian/libvirt-bin.default @@ -0,0 +1,11 @@ +# Defaults for libvirt-bin initscript (/etc/init.d/libvirt-bin) +# This is a POSIX shell fragment + +# Start libvirtd to handle qemu/kvm: +start_libvirtd="yes" + +# options passed to libvirtd, add "-l" to listen on tcp +libvirtd_opts="-d" + +# pass in location of kerberos keytab +#export KRB5_KTNAME=/etc/libvirt/libvirt.keytab --- libvirt-0.7.2.orig/debian/libvirt-doc.docs +++ libvirt-0.7.2/debian/libvirt-doc.docs @@ -0,0 +1,8 @@ +docs/*.rng +docs/*.png +docs/*.xml +docs/*.html +docs/*.gif +docs/html/ +docs/devhelp/ +examples/ --- libvirt-0.7.2.orig/debian/copyright +++ libvirt-0.7.2/debian/copyright @@ -0,0 +1,44 @@ +libvirt was initially debianized by Andrew Mitchell + +It was downloaded from http://libvirt.org/sources/ + +Upstream Author: + + Daniel Veillard or + +Copyright: + + 2005,2006 Red Hat, Inc + +Licenses: + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + + src/hash.c: + + Copyright (C) 2000 Bjorn Reese and Daniel Veillard. + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND + CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. + + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL'. --- libvirt-0.7.2.orig/debian/pycompat +++ libvirt-0.7.2/debian/pycompat @@ -0,0 +1 @@ +2 --- libvirt-0.7.2.orig/debian/libvirt-dev.install +++ libvirt-0.7.2/debian/libvirt-dev.install @@ -0,0 +1,4 @@ +usr/lib/libvirt.so +usr/lib/libvirt.a +usr/include/* +usr/lib/pkgconfig/* --- libvirt-0.7.2.orig/debian/libvirt-bin.install +++ libvirt-0.7.2/debian/libvirt-bin.install @@ -0,0 +1,13 @@ +usr/bin/* +usr/sbin/* +etc/apparmor.d/abstractions/libvirt-qemu +etc/apparmor.d/libvirt/TEMPLATE +etc/apparmor.d/usr.lib.libvirt.virt-aa-helper +etc/apparmor.d/usr.sbin.libvirtd +etc/libvirt/* +etc/sasl2/* +usr/share/polkit-1/* +usr/lib/libvirt/* +usr/share/augeas/* +usr/share/libvirt/* +usr/share/apport/package-hooks/source_libvirt-bin.py --- libvirt-0.7.2.orig/debian/libvirt-bin.postrm +++ libvirt-0.7.2/debian/libvirt-bin.postrm @@ -0,0 +1,47 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + if getent group libvirtd >/dev/null; then + delgroup libvirtd || true + fi + + rm -f /etc/apparmor.d/force-complain/usr.sbin.libvirtd >/dev/null 2>&1 || true + rm -f /etc/apparmor.d/disable/usr.sbin.libvirtd >/dev/null 2>&1 || true + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- libvirt-0.7.2.orig/debian/libvirt-doc.links +++ libvirt-0.7.2/debian/libvirt-doc.links @@ -0,0 +1 @@ +usr/share/doc/libvirt-doc/devhelp/ /usr/share/gtk-doc/html/libvirt --- libvirt-0.7.2.orig/debian/python-libvirt.install +++ libvirt-0.7.2/debian/python-libvirt.install @@ -0,0 +1,2 @@ +usr/lib/python*/*/*.so +usr/lib/python*/*/*.py --- libvirt-0.7.2.orig/debian/changelog +++ libvirt-0.7.2/debian/changelog @@ -0,0 +1,1452 @@ +libvirt (0.7.2-4ubuntu1) lucid; urgency=low + + * Merge from debian testing. Remaining changes: + - debian/control: + + Don't build-depend on QEmu + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables + to Depends of libvirt-bin + + Recommends qemu-kvm (>= 0.11.0-0ubuntu6) + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, + since we used to ship them as such + + We call libxen-dev libxen3-dev, so change all references + + Build-Depends on libxml2-utils + + Build-Depends on open-iscsi-utils instead of open-iscsi due to + LP: #414986 + - debian/postinst: + + rename the libvirt group to libvirtd + + add each admin user to the libvirtd group + - debian/libvirt-bin.postrm: rename the libvirt group to libvirtd + - debian/rules: add DEB_MAKE_CHECK_TARGET := check + - debian/patches/900[0-7]: updated/refreshed for new paths in 0.7.2 + - debian/patches/series: don't apply 0002-qemu-disable-network.diff.patch + - AppArmor integration: + + debian/control: Build-Depends on libapparmor-dev and Suggests + apparmor (>= 2.3+1289-0ubuntu14) + + debian/libvirt-bin.dirs: add /etc/apparmor.d/abstractions, + /etc/apparmor.d/force-complain, /etc/apparmor.d/libvirt, + /etc/cron.daily and /usr/share/apport/package-hooks + + add debian/libvirt-bin.cron.daily (LP: #438165) + + add debian/libvirt-bin.apport + + debian/libvirt-bin.install: install apparmor profiles, abstractions + and apport hook + + debian/postinst: reload apparmor profiles + + debian/libvirt-bin.postrm: remove apparmor symlinks on purge + + debian/libvirt-bin.preinst: added to force complain on certain + upgrades + + debian/README.Debian: add AppArmor section based on the upstream + documentation + + debian/rules: use --with-apparmor and copy apparmor and apport hook to + debian/tmp + - Dropped the following patches now included upstream: + + 0005-Close-logfile-fd-after-spawning-qemu.patch + + 9090-reenable-nonfile-labels.patch + + 9091-apparmor.patch + + 9092-apparmor-autoreconf.patch + * AppArmor integration updates: + - debian/apparmor/usr.sbin.libvirtd: allow libvirtd access to + /usr/lib/libvirt/* (LP: #480478) + - debian/apparmor/libvirt-qemu: allow guests access to + /etc/pki/libvirt-vnc/** (LP: #484562) + - debian/libvirt-bin.postinst: 0.7.2 moved /usr/bin/virt-aa-helper to + /usr/lib/libvirt, so the profile changed from usr.bin.virt-aa-helper + to usr.lib.libvirt.virt-aa-helper and needs to be migrated. If the user + made no changes to the old profile, remove it, otherwise, update the + paths, preserving the shipped usr.lib.libvirt.virt-aa-helper + - update to 0.7.4 version of the sVirt AppArmor driver (can be dropped in + 0.7.4): + + debian/patches/9008-apparmor-caps-mockup.patch + + debian/patches/9009-apparmor-lp453335.patch + + debian/patches/9010-apparmor-lp460271.patch + + debian/patches/9011-apparmor-code-cleanups.patch + - add virt-aa-helper-test and examples/apparmor that were omitted from the + upstream tarball (can be dropped in 0.7.5): + + debian/patches/9012-apparmor-add-virt-aa-helper-test.patch + + debian/patches/9013-apparmor-examples.patch + + debian/rules: add post-patches target to make virt-aa-helper-test + executable + * debian/patches/0005-Fix-SELinux-linking-issues.patch: updated to work + when both apparmor and selinux are available. This patch should be + dropped in 0.7.4. + * debian/patches/9007-default-config-test-case.patch: updated to not fail + if building in a deep directory + * debian/patches/9014-event-fuzz.patch: add a little fuzz to not be quite + so precise with expected expiry time. Fixes FTBFS with HZ=100 kernels. + Can be dropped in 0.7.5. + * debian/patches/9015-hal-startup-failure-is-nonfatal.patch: disable hal + driver if hald is not running instead of dying. Can be dropped in + 0.7.4. + * debian/control: temporarily remove Build-Depends on libcap-ng-dev, which + isn't available in Ubuntu main yet + * revert change to new source format 3.0 (quilt) since Launchpad can't + handle it yet (see LP: #293106) + + -- Jamie Strandboge Wed, 02 Dec 2009 09:22:21 -0600 + +libvirt (0.7.2-4) unstable; urgency=low + + * [213ca47] switch to new source format 3.0 (quilt) + * [f5a10e9] Depend on hal (Closes: #556730) + * [7d1422d] Drop build-dep on libpolkit-dbus-dev (Closes: #549500) + * [95ad85c] Depend on libcap-ng-dev for lxc driver. + + -- Guido Günther Wed, 25 Nov 2009 20:39:17 +0100 + +libvirt (0.7.2-3) unstable; urgency=low + + * [2c0aa82] Fix qemu:///session Backported from upsgtream's + 79218cdd9887b132eb0f29fe2048f89e90beae1 (Closes: #554869) + + -- Guido Günther Sat, 07 Nov 2009 12:50:54 +0100 + +libvirt (0.7.2-2) unstable; urgency=low + + [ Laurent Léonard ] + * [a9ea205] Change requirement of libvirt-bin in libvirt- suspendonreboot. + * [a4db804] Update debian/patches/0006-Don-t-let-parent-of-daemon- + exit-until-basic-initiali.patch. Fix use of an uninitialized variable that + was causing a bug on i386 systems. + * [59e1e53] Redo patches. + + [ Guido Günther ] + * upload to unstable + * [43f106a] Only remove masquerade roles for VIR_NETWORK_FORWARD_NAT + (Closes: #549949) - thanks to Rob S. Wolfram for testing + + -- Guido Günther Thu, 05 Nov 2009 20:44:21 +0100 + +libvirt (0.7.2-1) experimental; urgency=low + + [ Laurent Léonard ] + * [51a4814] Imported Upstream version 0.7.2 + * [12268f6] Update patches. + * [175d497] Fix SELinux linking issues. Pulled from upstream + 309acaa0230494b8ec08d03375c10238cb2daf55. + * [5cfdaf8] Update libvirt-doc docs. + * [dc2059f] Update libvirt-bin manpages. + * [a62a4a7] Update libvirt-bin examples. + * [9e38cbc] Update libvirt0 symbols. + * [412b12f] Make init.d script provide itself. + * [35451bf] Update debian/rules to support new example files. + * [43b7dac] Don't let parent of daemon exit until basic initialization is + done. + * [5a37e69] Make init.d provide libvirtd for backward compatibility. + + -- Guido Günther Mon, 26 Oct 2009 20:14:23 +0100 + +libvirt (0.7.1-2) unstable; urgency=low + + * [f5299d3] document changes and release 0.7.1-1 + * [f137c00] Allow for older versions of dpkg-dev to ease backports. + * [74f5832] Use Policykit 1.0 (Closes: #549500) + + -- Guido Günther Fri, 09 Oct 2009 20:32:02 +0200 + +libvirt (0.7.1-1) unstable; urgency=low + + [ Laurent Léonard ] + * [40fb620] Bump Debhelper version to 7. + * [e0e89f2] Bump Standards-Version to 3.8.3. + * [50a862f] Clean debian/rules. + * [e9c9906] Change build dependency on libreadline5-dev to + libreadline-dev. + * [b6cb738] Imported Upstream version 0.7.1 + * [780f6a7] Redo patches. + * [3d66f37] Update libvirt-bin examples. + * [c01ed84] Update libvirt0 symbols. + + -- Guido Günther Sat, 26 Sep 2009 17:15:02 +0200 + +libvirt (0.7.0-1ubuntu15) lucid; urgency=low + + * Run test suite at build time. + * Add libxml2-utils dependency. Needed by the test suite. + * Remove "Connecting to uri: " notice from virsh. It breaks the test + suite, the information is readily available with the "uri" command + inside virsh, and it's a usability delta with upstream, so + constantly causes confusion. + + -- Soren Hansen Fri, 27 Nov 2009 11:21:53 +0100 + +libvirt (0.7.0-1ubuntu14) lucid; urgency=low + + * debian/patches/9093-lp460271.patch: require absolute path for dynamic + added files (LP: #460271) + * debian/patches/9094-lp453335.patch: suppress confusing and misleading + apparmor denied message when kvm/qemu tries to open a libvirt specified + readonly file (such as a cdrom) with write permissions. libvirt uses the + readonly attribute for the security driver only, and has no way of telling + kvm/qemu that the device should be opened readonly. (LP: #453335) + * debian/apparmor/usr.sbin.libvirtd: allow 'inet dgram' for migration to + work (LP: #461528) + * debian/apparmor/usr.sbin.libvirtd: properly support qemu+tcp:// by + allowing 'inet6 stream' and 'inet6 dgram' (LP: #462000) + + -- Jamie Strandboge Mon, 09 Nov 2009 17:11:05 -0600 + +libvirt (0.7.0-1ubuntu13) karmic; urgency=low + + * allow save/restore to work in $HOME. This is a workaround until upstream + https://bugzilla.redhat.com/show_bug.cgi?id=529363 is fixed. (LP: #457716) + * debian/libvirt-bin.cron.daily: don't comlain if no domain XML definitions + or domain AppArmor profiles. Based on work by Loïc Minier. (LP: #457607) + + -- Jamie Strandboge Fri, 23 Oct 2009 03:52:33 -0500 + +libvirt (0.7.0-1ubuntu12) karmic; urgency=low + + * debian/apparmor/libvirt-qemu: a couple more fixes for pulseaudio + LP: #453329 + + -- Jamie Strandboge Fri, 16 Oct 2009 17:06:15 -0500 + +libvirt (0.7.0-1ubuntu11) karmic; urgency=low + + * debian/patches/9091-apparmor.patch: + - src/virt-aa-helper.c: update to parse XML for guest's architecture and + os.type rather than just trying to make something up. + - tests/virt-aa-helper-test: add some tests for the above and fix another + test + - LP: #448671 + + -- Jamie Strandboge Wed, 14 Oct 2009 14:55:20 -0500 + +libvirt (0.7.0-1ubuntu10) karmic; urgency=low + + * debian/patches/0005-Close-logfile-fd-after-spawning-qemu.patch: fix + egregious file descriptor leak with cherry-pick from upstream git, + LP: #438815 + + -- Dustin Kirkland Tue, 06 Oct 2009 18:57:22 -0500 + +libvirt (0.7.0-1ubuntu9) karmic; urgency=low + + * allow access for sound (LP: #437854) + - abstractions/libvirt-qemu: add very specific rules for allowing ALSA. We + do not use the audio abstraction because the virtual machine runs as root + and therefore DAC cannot be used as a fallback. + - debian/README.Debian: add some text to encourage review of the AppArmor + profiles and abstraction when using in production environments + * debian/libvirt-bin.cron.daily: added to clean out old profiles that are no + longer associated with a virtual machine definition (LP: #438165) + * debian/patches/9091-apparmor.patch: + - quote the pid, monitor and logfile in case any of them have weird + characters (complete fix for LP: #432810) + - support for disks + + -- Jamie Strandboge Mon, 05 Oct 2009 16:31:12 -0500 + +libvirt (0.7.0-1ubuntu8) karmic; urgency=low + + * debian/patches/9091-apparmor.patch: sync with upstream for maintenance, + licensing compliance with upstream and bug fixes: + - handle files with spaces in the name (LP: #432810) + - add serial, console, kernel and initrd support (LP: #432581) + - allow read only access to /boot, /vmlinuz and /initrd.img + - allow access to character devices (eg USB devices) + - have virt-aa-helper accept XML on stdin, which allows for adding + other devices in the future and helps ensure we always have the most + up to date definition + - update profile on attach and detach of devices (LP: #435527) + - add --dryrun option to virt-aa-helper, and greatly improve the + virt-aa-helper-test script + * revert workaround for LP: #431090 now that kernel, initrd, et al is + properly supported + * debian/apparmor/usr.sbin.libvirtd: add various capabilities + recommended by upstream to prevent potential regressions + + -- Jamie Strandboge Tue, 22 Sep 2009 20:04:58 -0500 + +libvirt (0.7.0-1ubuntu7) karmic; urgency=low + + * debian/apparmor/libvirt-qemu: add chown capability (LP: #434417) + + -- Jamie Strandboge Tue, 22 Sep 2009 08:03:21 -0500 + +libvirt (0.7.0-1ubuntu6) karmic; urgency=low + + * debian/apparmor/libvirt-qemu: workaround eucalyptus serial console, + kernel and initrd location. This should be removed after virt-aa-helper is + able to get these from XML. (LP: #431090) + + -- Jamie Strandboge Thu, 17 Sep 2009 11:35:42 -0500 + +libvirt (0.7.0-1ubuntu5) karmic; urgency=low + + * debian/apparmor/usr.sbin.libvirtd: switch to enforcing by default. Please + note that this was only in complain mode temporarily to work around kernel + bugs in the 2.6.31-9 kernel. Confinement of virtual machines (controlled + by /etc/apparmor.d/libvirt/TEMPLATE) was already in enforcing mode. + (LP: #427338) + * debian/README.Debian: update AppArmor section based on the upstream + documentation + + -- Jamie Strandboge Thu, 10 Sep 2009 08:05:45 -0500 + +libvirt (0.7.0-1ubuntu4) karmic; urgency=low + + * debian/libvirt-bin.postinst: add each admin user to libvirtd, + LP: #410226; note that this is only a partial fix, as admin users + added after libvirt's install will need to be individually added + to libvirtd; however, this should fix a huge number of + single-admin-user-in-default-Ubuntu-system annoyances + * debian/control: bump standards version + + -- Dustin Kirkland Tue, 08 Sep 2009 17:56:52 -0500 + +libvirt (0.7.0-1ubuntu3) karmic; urgency=low + + * debian/apparmor/libvirt-qemu: allow access to /dev/kqemu + * debian/apparmor/usr.bin.virt-aa-helper: use @{PROC} instead of /proc + + -- Jamie Strandboge Wed, 26 Aug 2009 12:19:24 -0500 + +libvirt (0.7.0-1ubuntu2) karmic; urgency=low + + * Add AppArmor support (LP: #388422): + - debian/patches/9090-reenable-nonfile-labels.patch: add back in + virDomainObjPtr argument to RestoreSecurityImageLabel since AppArmor + labels are not stored on disk + - debian/patches/9091-apparmor.patch: add AppArmor security driver + - debian/patches/9092-apparmor-autoreconf.patch: after installing libtool + and the build dependencies, run autoreconf to pull in changes to + Makefile.am and configure.in in 9091-apparmor.patch + - debian/rules: use --with-apparmor and copy debian/apparmor/* to + debian/tmp + - debian/control: Build-Depends on libapparmor-dev and Suggests apparmor + >= 2.3+1289-0ubuntu14 + - add profiles and abstractions to debian/apparmor. usr.sbin.libvirtd will + default to complain mode until LP: #401931 is sorted out + - debian/libvirt-bin.dirs: add /etc/apparmor.d/libvirt, + /etc/apparmor.d/abstractions, and /etc/apparmor.d/force-complain + - debian/libvirt-bin.install: install profiles and abstractions + - debian/libvirt-bin.preinst: newly added to force complain on certian + upgrades + - debian/libvirt-bin.postinst: (re)load profile + - debian/libvirt-bin.postrm: remove force-complain profile on purge + * 9006-increase-unix-socket-timeout.patch: + increase timeout waiting for unix socket in src/qemu_driver.c, set to 30 + seconds, which 10x longer than before, and matches the logoutput timeout + adjustment in 9003-increase-logoutput-timeout.patch. This is needed with + the new qemudOpenMonitorUnix() function introduced in 0.7.0. + * add apport hook: + - add debian/libvirt-bin.apport + - debian/libvirt-bin.dirs: add /usr/share/apport/package-hooks + - debian/libvirt-bin.install: add source_libvirt-bin.py + - debian/rules: install libvirt-bin.apport + + -- Jamie Strandboge Tue, 25 Aug 2009 11:51:42 -0500 + +libvirt (0.7.0-1ubuntu1) karmic; urgency=low + + * Merge from debian experimental, remaining changes: + - debian/control: + + Don't build-depend on QEmu. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables + to Depends of libvirt-bin. + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, + since we used to ship them as such. + + We call libxen-dev libxen3-dev, so change all references. + + Build-Depends on open-iscsi-utils instead of open-iscsi due to + LP: #414986 + - 9000-delayed_iff_up_bridge.patch: + Don't try to bring up the bridge before at least one interface has been + added to it. + - 9001-dont_clobber_existing_bridges.patch: + Assign the name of the virtual bridge dynamically to avoid interfering + with existing bridges. + - 9002-better_default_uri_virsh.patch: + Default to qemu:///system if the user has write access to the libvirt + socket, otherwise qemu:///session. + - 9003-increase-logoutput-timeout.patch: + increase timeout waiting for log output in src/qemu_driver.c, set to 30 + seconds, which 10x longer than before, and matches the disk-wait in + mdadm. (LP #344400) + - 9004-better-default-arch.patch: + If a domain does not specify its architecture, attempt to match the host. + (LP #344913) + - 9005-libvirtd-group-name.patch: + Rename libvirt group to libvirtd. + - rename the libvirt group to libvirtd in postinst/postrm + * Dropped the following patches from debian/patches (they don't apply any + more were not applied in 0.6.4-1ubuntu2): + - dynamic_bridge_names.patch + - event-loop-hang.diff + - more-flexible-emulator-on-x86.patch + - xen-events-handling-fix.diff + + -- Jamie Strandboge Thu, 13 Aug 2009 20:24:24 -0500 + +libvirt (0.7.0-1) experimental; urgency=low + + [ Laurent Léonard ] + * [4fb1a38] Imported Upstream version 0.7.0 + * [5578fd3] Drop 0005-Fix-PCI-device-hotplug-unplug-with-newer- + QEMU.patch. Fixed upstream. + * [9a8afd0] Redo patches. + * [937ab63] Update symbols. + * [b4bd1ea] Update section in doc-base control file. + + -- Guido Günther Sun, 09 Aug 2009 13:35:42 +0200 + +libvirt (0.6.5-3) unstable; urgency=low + + * [72a8eb6] Add a versioned dependency on dpkg-dev (Closes: #537316) + * [ae20998] fix Debian Xen path patch to also cover the testsuite + * [b2a1c47] New patch 0001-Fix-PCI-device-hotplug-unplug-with-newer- + QEMU.patch pulled from upstream 326ecb7. Fixes PCI hotplug with + newer kvm. + + -- Guido Günther Wed, 29 Jul 2009 12:17:52 +0200 + +libvirt (0.6.5-2) unstable; urgency=low + + * [45b9fdf] build-conflict on dpkg-dev (= 1.15.3) (Closes: #536673) + + -- Guido Günther Sun, 12 Jul 2009 15:03:08 +0200 + +libvirt (0.6.5-1) unstable; urgency=low + + [ Guido Günther ] + * [05e9a39] build-depend on policykit so polkit auth works with virsh + as well + + [ C.J. Adams-Collier ] + * [a161c5f] allow to qemu to emulate arm + + [ Guido Günther ] + * [b1e4c4b] Imported Upstream version 0.6.5 + * [e764583] change private symbols to 0.6.5 + * [f94fb48] drop 0005-allow-to-qemu-to-emulate-arm.patch fixed upstream. + * [7ad7896] bump standards version + * [e2c5867] tighten libvirt-bin's dependency on libvirt0 since libvirtd uses + private symbols + + -- Guido Günther Sun, 05 Jul 2009 13:07:53 +0200 + +libvirt (0.6.4-1ubuntu2) karmic; urgency=low + + * Also rename the libvirt group to libvirtd in postinst/postrm. + (LP: #392696) + + -- Soren Hansen Fri, 26 Jun 2009 22:49:45 +0200 + +libvirt (0.6.4-1ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: + + Don't build-depend on QEmu. + + Add "XS-Debian-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables + to Depends of libvirt-bin. + + s/interract/interact/g + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, + since we used to ship them as such. + - 9000-delayed_iff_up_bridge.patch: + Don't try to bring up the bridge before at least one interface has been + added to it. + - 9001-dont_clobber_existing_bridges.patch + Assign the name of the virtual bridge dynamically to avoid interfering + with existing bridges. + - 9002-better_default_uri_virsh.patch: + Default to qemu:///system if the user has write access to the libvirt + socket, otherwise qemu:///session. + - 9003-increase-logoutput-timeout.patch: + increase timeout waiting for log output in src/qemu_driver.c, set to 30 + seconds, which 10x longer than before, and matches the disk-wait in + mdadm. (LP #344400) + - 9004-better-default-arch.patch: + If a domain does not specify its architecture, attempt to match the host. + (LP #344913) + - 9005-libvirtd-group-name.patch: + Rename libvirt group to libvirtd. + - We call libxen-dev libxen3-dev, so change all references. + + -- Soren Hansen Mon, 22 Jun 2009 11:14:57 +0200 + +libvirt (0.6.4-1) unstable; urgency=low + + * [dd3adb2] Imported Upstream version 0.6.4 + * [2320162] update symbols file + * [89c9720] remove bashism (Closes: #530122) + * [30d86c1] drop patches fixed upstream: + 0005-don-t-crash-with-def-NULL.patch + 0006-Fix-QEMU-ARGV-detection-with-kvm-85.patch + 0007-Declare-support-for-QEMU-migration-in-capabilities.patch + + -- Guido Günther Thu, 04 Jun 2009 12:50:01 +0200 + +libvirt (0.6.3-4) unstable; urgency=low + + * [3607f2f] Install libvirt_lxc that got list somewhere between our + testbuilds. (Closes: #529578) + * [070ddd5] install augeas lense + * [c9b034d] install schema files + + -- Guido Günther Wed, 20 May 2009 14:33:18 +0200 + +libvirt (0.6.3-3) unstable; urgency=low + + * [4087b7d] disable lxc on ia64 to work around FTBFS until we have + access to a test machine + * [df5f5a0] pull some kvm/qemu related patches from upstream + (Closes: #529324) + + -- Guido Günther Tue, 19 May 2009 19:14:57 +0200 + +libvirt (0.6.3-2) unstable; urgency=low + + * [35898d3] fix crash when libvirt_lxc is called without arguments + * [449ca60] enable lxc support (Closes: #526718) - thanks to Daniel + Pittman for testing this + * [335a4e6] update description with supported virtualization solutions + * [92eba47] delay libvirt-bin start until after avahi + * [8ebd17d] update startup priorities due to changed libvirt-bin + startup priority. Also add an LSB header. (Closes: #526944) + + -- Guido Günther Thu, 07 May 2009 13:28:40 +0200 + +libvirt (0.6.3-1) unstable; urgency=low + + * [0cb2f83] Imported Upstream version 0.6.3 + * virtual box support + * [06fe518] 0001-remove-RHism.diff.patch: use invoke-rc.d + * [ec2fd52] drop patches merged upstream: + * 0003-allow-libvirt-group-to-access-the-socket.patch series + * 0004-fix-Debian-specific-path-to-hvm-loader.patch + * [6977bde] enable vbox support + * [93c4423] add symbols file + + -- Guido Günther Sun, 03 May 2009 23:33:28 +0200 + +libvirt (0.6.2-2) unstable; urgency=low + + * [031b9c1] Don't hardcode buffer size for getgrnam_r. Works around + #520744 and fixes possible problems with implementations having + _SC_GETGR_R_SIZE_MAX != 1024. + * [bbe7743] respect log priority for qemu domain logs (Closes: #524145) + * [a2e4cb0] don't rely on log_end_msg returning 0 this isn't the case + with splashy. (Closes: #523712) + * [ddfafda] move debug package into section debug + + -- Guido Günther Thu, 16 Apr 2009 15:28:31 +0200 + +libvirt (0.6.2-1) unstable; urgency=low + + * [99fd06c] Imported Upstream version 0.6.2 (Closes: #521785) + * [78cd5c8] drop /var/run/libvirt created by init script + * [2a7cb3b] move startup of libvirtd after hal (Closes: #522310) + * [b8707ed] bump standards version 0.8.1 (no changes necessary) + + -- Guido Günther Thu, 09 Apr 2009 22:48:57 +0200 + +libvirt (0.6.1-1) unstable; urgency=low + + * [3be7341] Imported Upstream version 0.6.1 + * [38fde15] rediff Debian specific patches + * [9b59a19] drop patches applied upstream: + * 0004-Don-t-hardcode-ssh-port.patch + * 0005-minimal-workaround-for-qemu-startup-race.patch + * [95d4b7f] drop patches backported from upstream + * 0009-libvirt_proxy-Fix-use-of-uninitalized-memory.patch + * [8171d83] build-dep on module-init-tools so configure can figure out + the path to modprobe + + -- Guido Günther Thu, 05 Mar 2009 13:58:41 +0100 + +libvirt (0.6.1-0ubuntu5) jaunty; urgency=low + + * Fix logic error when applying %d bridge name rewriting. (LP: #350780) + + -- Soren Hansen Thu, 16 Apr 2009 20:48:49 +0200 + +libvirt (0.6.1-0ubuntu4) jaunty; urgency=low + + [ Marc Deslauriers ] + * 0008-increase-logoutput-timeout.patch: increase timeout waiting + for log output in src/qemu_driver.c, set to 30 seconds, which 10x + longer than before, and matches the disk-wait in mdadm, LP: #344400 + + -- Dustin Kirkland Fri, 27 Mar 2009 10:57:53 -0500 + +libvirt (0.6.1-0ubuntu3) jaunty; urgency=low + + * Fix "libvirt's defaults are slightly less than sane" (LP: #344913) + - more-flexible-emulator-on-x86.patch (from upstream) + - default-arch.patch + + -- Soren Hansen Thu, 19 Mar 2009 00:23:14 +0100 + +libvirt (0.6.1-0ubuntu2) jaunty; urgency=low + + * Add fix for event loop hang (LP: #344195) + http://article.gmane.org/gmane.comp.emulators.libvirt/12437 + * Add fix for Xen events handling. + http://git.et.redhat.com/?p=libvirt.git;a=commit;h=124cfcbc2bcd1b71b51e720b9bfc7d8e69e8af89 + + -- Soren Hansen Fri, 13 Mar 2009 16:51:33 +0100 + +libvirt (0.6.1-0ubuntu1) jaunty; urgency=low + + * New upstream release. (FFe: LP: #339868) + * Dropped 0004-Don-t-hardcode-ssh-port.patch: Included upstream. + * Rewrote dynamic_bridge_names.patch to work with refactored upstream + bridging code. + + -- Soren Hansen Mon, 09 Mar 2009 11:18:01 +0100 + +libvirt (0.6.0-1ubuntu3) jaunty; urgency=low + + * No change rebuild for python2.6. + + -- Matthias Klose Wed, 25 Feb 2009 12:17:13 +0000 + +libvirt (0.6.0-1ubuntu2) jaunty; urgency=low + + * Accidentally dropped our changes to + 0003-allow-libvirt-group-to-access-the-socket.patch, causing the + group as which libvirtd expected to run to be wrong. Change it back + to "libvirtd" rather than "libvirt". (LP: #328093) + + -- Soren Hansen Wed, 11 Feb 2009 16:10:28 +0100 + +libvirt (0.6.0-1ubuntu1) jaunty; urgency=low + + * Merge with Debian experimental. Remaining changes: + - debian/control: + + Don't build-depend on QEmu. + + Add "XS-Debian-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables + to Depends of libvirt-bin. + + s/interract/interact/g + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, + since we used to ship them as such. + - Rename libvirt group to libvirtd. + - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge + before at least one interface has been added to it. + - dont_clobber_existing_bridges.patch: Assign the name of the virtual + bridge dynamically to avoid interfering with existing bridges. + - better_default_uri_virsh.patch: Default to qemu:///system if the + user has write access to the libvirt socket, otherwise + qemu:///session. + - We call libxen-dev libxen3-dev, so change all references. + - Included (but did not enable) opennebula patch (since it's not in + main yet). + + -- Soren Hansen Wed, 11 Feb 2009 01:01:42 +0100 + +libvirt (0.6.0-1) experimental; urgency=low + + * [30be86d] Imported Upstream version 0.6.0 + * [179781c] drop patches + * fixed upstream: + 0006-Fix-missing-read-only-access-checks-CVE-2008-5086.patch + * applied upstream: + 0004-Open-qemu-monitor-log-O_APPEND-instead-of-O_TRUNC.patch + 0005-qemu-fix-parallel-serial-mode-tcp-and-unix.patch + 0007-don-t-fail-on-missing-locales.patch + * [d80a176] adjust remaining patches to new upstream version + * [208c924] add minimal workaround for qemu startup race + * [6e8caa0] restart libvirt daemon on upgrades if possible + (Closes: #492694, #499008) + + -- Guido Günther Thu, 05 Feb 2009 18:40:10 +0100 + +libvirt (0.5.1-7) unstable; urgency=low + + * [1238706] Recommend dnsmasq-base instead of dnsmasq this keeps us + out of all the dnsmasq already running troubles. (Closes: #516443) - + thanks to Bin Zhang for the suggestion and the doc update + * [5c9dfd7] don't rotate empty logfiles (Closes: #517040) + * [1c9a023] libvirt_proxy: Fix use of uninitalized memory We currently + don't build this code (CVE-2009-0036). + * [4ea1ea9] fix path to hvmloader (Closes: #517059) + * [879b632] suggest devhelp + * [f22f1ef] add ${misc:Depends} + * [c6f579e] README.Debian: fix typo + + -- Guido Günther Thu, 26 Feb 2009 14:45:32 +0100 + +libvirt (0.5.1-6) unstable; urgency=low + + * upload to unstable + + -- Guido Günther Mon, 16 Feb 2009 21:27:21 +0100 + +libvirt (0.5.1-5) experimental; urgency=low + + * [d4a69d1] don't fail on missing locales (Closes: #512721) + * [cecac4c] don't hardcode ssh port - based on a patch by Adrian + Bridgett. (Closes: #513605) + * [4565a65] drop superflous headers and footers from remaining patches + + -- Guido Günther Fri, 30 Jan 2009 23:06:29 +0100 + +libvirt (0.5.1-4ubuntu1) jaunty; urgency=low + + * Merge with Debian experimental. + - debian/control: + + Don't build-depend on QEmu. + + Add "XS-Debian-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables + to Depends of libvirt-bin. + + s/interract/interact/g + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, + since we used to ship them as such. + - Rename libvirt group to libvirtd. + - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge + before at least one interface has been added to it. + - dont_clobber_existing_bridges.patch: Assign the name of the virtual + bridge dynamically to avoid interfering with existing bridges. + - better_default_uri_virsh.patch: Default to qemu:///system if the + user has write access to the libvirt socket, otherwise + qemu:///session. + - We call libxen-dev libxen3-dev, so change all references. + * Included (but did not enable) opennebula patch (since it's not in + the archive yet). + + -- Soren Hansen Thu, 08 Jan 2009 23:01:16 +0100 + +libvirt (0.5.1-4) experimental; urgency=low + + * [2fd5224] apply upstream patch for CVE-2008-5086 (Closes: #509106) + + -- Guido Günther Thu, 18 Dec 2008 16:12:00 +0100 + +libvirt (0.5.1-3) experimental; urgency=low + + * [d30438c] create libvirt log directory (Closes: #508129) + * [417a23c] qemu: fix parallel/serial mode "tcp" and "unix" + (Closes: #507608) + + -- Guido Günther Thu, 11 Dec 2008 12:38:01 +0100 + +libvirt (0.5.1-2) experimental; urgency=low + + * [4cd547b] create /var/run/libvirt (Closes: #507578) + * [fe96870] merge back master + * [d46313f] drop patches for issues fixed upstream + - 0007-also-look-for-usr-bin-kvm.patch + - 0008-Increase-initial-qemu-monitor-read-timeout.patch + - 0009-Open-qemu-monitor-log-O_APPEND-instead-of-O_TRUNC.patch + - 0010-raise-error-on-invalid-volume-format.patch + + -- Guido Günther Sat, 06 Dec 2008 10:37:12 +0100 + +libvirt (0.5.1-1) experimental; urgency=low + + * [d76b3a1] Imported Upstream version 0.5.1 (Closes: #507677, #507547) + * [2e550ae] enable hal for device enumeration + * [0d9116a] rotate qemu monitor logs (Closes: #507553) - thanks to + Harald Staub + * [5f85e66] depend on logrotate + * [6e955a3] open qemu monitor O_APPEND instead of O_TRUNC for logrotate + * [7dbea84] drop 0004-xen-prefer-xenstoraged-driver-for- + listDomains.patch - applied upstream + + -- Guido Günther Fri, 05 Dec 2008 09:36:54 +0100 + +libvirt (0.5.0-1) experimental; urgency=low + + * [717ef21] Imported Upstream version 0.5.0 + * [b7a1fbd] enable OpenVZ support (Closes: #504597) - thanks to Pierre + Chifflier for the patch + * [ee3590a] drop patches, fixed upstream: + * 0004-support-virtio-and-scsi-disks-in-qemudDomainBlockSta.patch + * 0005-fix-define-vs.-defined-typos.patch + * [f4f601f] bump shlibs to 0.5.0 + + -- Guido Günther Fri, 28 Nov 2008 16:40:38 +0100 + +libvirt (0.4.6-10) unstable; urgency=low + + * [5878698] cherry-pick patch for CVE-2008-5086 from experimental + + -- Guido Günther Thu, 18 Dec 2008 16:59:45 +0100 + +libvirt (0.4.6-9) unstable; urgency=low + + * [d30438c] create libvirt log directory (Closes: #508129) + + -- Guido Günther Mon, 08 Dec 2008 10:12:28 +0100 + +libvirt (0.4.6-8) unstable; urgency=low + + * [e771da9] drop superflous 0011-Fix-segfault-on-missing-volume- + format.patch - not needed. + + -- Guido Günther Fri, 05 Dec 2008 10:17:01 +0100 + +libvirt (0.4.6-7) unstable; urgency=low + + * [ea12bd9] create /var/run/libvirt fixes /var/run on tmpfs + (Closes: #507578) + * [97e5706] also look for /usr/bin/kvm (Closes: #507547) + * [311b4c1] increase initial qemu monitor read timeout + (Closes: #499720) + * [fbe4e00] open qemu monitor log O_APPEND instead of O_TRUNC + * [f8ce017] raise error on invalid volume format + * [40edcf8] rotate qemu monitor logs (Closes: #507553) - thanks to + Harald Staub + * [46ea43a] fix segfault on missing volume format (Closes: #507677) - + thanks to Daniel Veillard + * [ee377f3] bump shlibs version to 0.4.6 + * [504d55d] depend on logrotate + + -- Guido Günther Thu, 04 Dec 2008 17:50:45 +0100 + +libvirt (0.4.6-6) unstable; urgency=low + + * [ff8e9ae] README.Debian: clarify xen configuration + * [c07c68f] prefer xenstoraged driver for listDomains - avoids seeing "ghost + domains" due to bugs in several versions of the xen HV + + -- Guido Günther Thu, 27 Nov 2008 18:06:48 +0100 + +libvirt (0.4.6-5ubuntu2) jaunty; urgency=low + + * SECURITY UPDATE: fix privilege escalation due to missing read only + connection checks + - debian/patches/0009-CVE-2008-5086.patch: update functions in + src/libvirt.c to check against VIR_CONNECT_RO and return with operation + denied error + - CVE-2008-5086 + + -- Jamie Strandboge Tue, 16 Dec 2008 10:47:09 -0600 + +libvirt (0.4.6-5ubuntu1) jaunty; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: + + Don't build-depend on QEmu. + + Add "XS-Debian-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables to Depends + of libvirt-bin. + + s/interract/interact/g + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, since + we used to ship them as such. + - Create /var/run/libvirt in libvirt-bin's init script. + - Rename libvirt group to libvirtd. + - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge before at + least one interface has been added to it. + - dont_clobber_existing_bridges.patch: Assign the name of the virtual + bridge dynamically to avoid interfering with existing bridges. + - better_default_uri_virsh.patch: Default to qemu:///system if the user + has write access to the libvirt socket, otherwise qemu:///session. + - We call libxen-dev libxen3-dev, so change all references. + * Add qemu migration patch (from upstream git (adjusted for 0.4.6)). + * Add dynamic_bridge_names.patch to again support dynamic bridge names. + + -- Soren Hansen Tue, 18 Nov 2008 18:04:40 +0100 + +libvirt (0.4.6-5) unstable; urgency=low + + * [411ada3] add more details about dnsmasq vs. libvirtd (Closes: #504605) + * [2f8f07d] add default image dir virt-manager assumes they exist and + they're used in the SELinux policies too. (Closes: #505577) + * [9eb3a83] fix #define vs. #defined typos - affects non Linux architectures + and fixes the build with gcc 4.4 (Closes: #505607) - thanks to Martin + Michlmayr + * [0e21634] fix uploader + + -- Guido Günther Fri, 14 Nov 2008 14:54:48 +0100 + +libvirt (0.4.6-4) unstable; urgency=low + + * upload to unstable + * [50b27f5] add libvirt-suspendonreboot script (Closes: #501155) - + thanks to Andreas Barth + + -- Guido Günther Sat, 01 Nov 2008 19:33:36 +0100 + +libvirt (0.4.6-3) experimental; urgency=low + + * [8fa5a3c] add a versioned recommends on qemu (Closes: #501692) + * [d1539bc] recommend pkg-config + * [f08bb18] explain libvirt group (Closes: #501824) + + -- Guido Günther Sun, 12 Oct 2008 20:27:25 +0200 + +libvirt (0.4.6-2) experimental; urgency=low + + * [2039095] tighten libvirt dependency + * [06dbe8a] qemu/kvm: fix domain block stats for virtio and scsi devices + + -- Guido Günther Thu, 02 Oct 2008 22:03:05 +0200 + +libvirt (0.4.6-1) experimental; urgency=low + + * [e20d3d4] Imported Upstream version 0.4.6 + * [0c840ab] disable numactl + * [ca2c5cb] cleanup doc installation (Closes: #492075) + * [714ab94] drop 0004-for-kvm-determine-maxVCPUs-at-runtime.patch - applied + upstream + * [e7563a8] drop 0005-fix-crash-when-no-emulator-is-defined-for-kvm- + qemu.patch - fixed upstream + + -- Guido Guenther Thu, 25 Sep 2008 12:31:45 +0200 + +libvirt (0.4.5-2) experimental; urgency=low + + * [17647cd] libvirt-bin.default: add keytab default + * [0ef01e7] fix runtime vcpu detection (0004-for-kvm-determine- + maxVCPUs-at-runtime.patch) (Closes: #495950) + * [b91e1eb] don't crash when no emulator is defined (0005-fix-crash- + when-no-emulator-is-defined-for-kvm-qemu.patch) + + -- Guido Guenther Mon, 22 Sep 2008 20:11:04 +0200 + +libvirt (0.4.5-1) experimental; urgency=low + + * [ab8b4e6] Imported Upstream version 0.4.5 + * [4aaef27] tighten dependency on libvirt + * [fa253be] drop 0002-qemu-path.diff.patch - fixed upstream + * [87fc2db] drop 0005-check-for-the-existence-of-the-migrate- + command.patch applied upstream + * [bc311aa] drop 0006-wrong-open-failure-detection.patch applied + upstream + * [38e615d] rebase the remaining patches + * [9a04bb7] bump shlibs version to 0.4.5 + * [9fadd6f] disable LXC + * [179c869] build-dep on libselinux1-dev for selinux support + + -- Guido Guenther Thu, 18 Sep 2008 19:02:55 +0200 + +libvirt (0.4.4-3ubuntu3) intrepid; urgency=low + + * debian/patches/0008-lp287533.patch: allow 16 VCPUs when using kvm + (LP: #287533) + + -- Jamie Strandboge Wed, 22 Oct 2008 10:13:12 -0500 + +libvirt (0.4.4-3ubuntu2) intrepid; urgency=low + + * Make QEmu a suggested package of libvirt0 rather than a recommended one. + * Make kvm a recommended package of libvirt0. + + -- Soren Hansen Mon, 11 Aug 2008 16:18:03 +0200 + +libvirt (0.4.4-3ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: + + DebianMaintainerField + + Don't build-depend on QEmu. + + Add "XS-Original-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables to Depends + of libvirt-bin. + + s/interract/interact/g + + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg, since + we used to ship them as such. + - Create /var/run/libvirt in libvirt-bin's init script. + - Rename libvirt group to libvirtd. + - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge before at + least one interface has been added to it. + - dont_clobber_existing_bridges.patch: Assign the name of the virtual + bridge dynamically to avoid interfering with existing bridges. + - better_default_uri_virsh.patch: Default to qemu:///system if the user + has write access to the libvirt socket, otherwise qemu:///session. + - We call libxen-dev libxen3-dev, so change all references. + + -- Soren Hansen Mon, 11 Aug 2008 15:36:54 +0200 + +libvirt (0.4.4-3) unstable; urgency=low + + * upload to unstable + * [96c6727] add /var/cache/libvirt needed by qemuDriver for temporary + storage + * [794f95c] bump standards version to 3.8.0 + * [05184af] add README.source + + -- Guido Guenther Wed, 23 Jul 2008 11:30:31 -0400 + +libvirt (0.4.4-2) experimental; urgency=low + + * [facb983] README.Debian explain "default" network startup + * [395a510] add /var/lib/libvirt needed for the dnsmasq lease file + * [9c588ac] promote bridge-utils & dnsmasq to Recommends: since + they're needed for the default NAT network + * [9ed2cd4] recommend iptables - needed for the default NAT network + + -- Guido Guenther Wed, 23 Jul 2008 00:23:58 -0400 + +libvirt (0.4.4-1) experimental; urgency=low + + * [0ff1e68] new upstream version + * [2098f96] rebase patches for 0.4.4 + * [abbd15e] enable with-storage-disk now that we have parted1.8 + * [3942b25] start libvirtd by default + + -- Guido Guenther Fri, 27 Jun 2008 10:06:00 +0200 + +libvirt (0.4.4-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Drop nic-model, disk-bus, and ancient_parted.patch. They're all + upstream now (in some form). + - Add new libdevmapper-dev build-dependency. + + -- Soren Hansen Wed, 25 Jun 2008 18:51:21 +0200 + +libvirt (0.4.2-6ubuntu1) UNRELEASED; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: + + DebianMaintainerField + + Don't build-depend on QEmu. + + Add "XS-Original-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables to Depends + of libvirt-bin. + + s/interract/interact/g + - debian/libvirt-bin.default + + Make libvirtd start by default + - Add /var/lib/libvirt to libvirt-bin package. (dnsmasq needs it to store + its state info. + - Create /var/run/libvirt in libvirt-bin's init script. + - Rename libvirt group to libvirtd. + - Build iscsi and disk storage support. + - delayed_iff_up_bridge.patch: Don't try to bring up the bridge before at + least one interface has been added to it. + - dont_clobber_existing_bridges.patch: Assign the name of the virtual + bridge dynamically to avoid interfering with existing bridges. + - nic-model.patch: Add support for NIC configuration. + - disk-bus.patch: Add support for bus='foo' attributes for disk targets. + - better_default_uri_virsh.patch: Default to qemu:///system if the user + has write access to the libvirt socket, otherwise qemu:///session. + - ancient_parted.patch: Fix builds against libparted1.7 + - We call libxen-dev libxen3-dev, so change all references. + + -- Soren Hansen Wed, 25 Jun 2008 16:40:46 +0200 + +libvirt (0.4.2-6) unstable; urgency=low + + * reenable open-iscsi support - thanks to to the open-iscsi + maintainers for fixing this up + * build a libvirt0-dbg package + * register documentation with doc-base (Closes: #480294) - thanks to + Tzafrir Cohen for the patch + * control: fix typo + * README.Debian: explain debugging + + -- Guido Guenther Thu, 15 May 2008 18:04:20 +0200 + +libvirt (0.4.2-5ubuntu2) intrepid; urgency=low + + * We call libxen-dev libxen3-dev. + * Make libvirt-dev installable alongside libvirt0-dbg. + + -- Soren Hansen Fri, 02 May 2008 10:59:50 +0200 + +libvirt (0.4.2-5ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: + + DebianMaintainerField + + Don't build-depend on QEmu. + + Add "XS-Original-" prefix to Debian's Vcs headers. + + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables to Depends + of libvirt-bin. + + s/interract/interact/g + - Add libvirt0-dbg package + - debian/libvirt-bin.default + + Make libvirtd start by default + - Add /var/lib/libvirt to libvirt-bin package. (dnsmasq needs it to store + its state info. + - Create /var/run/libvirt in libvirt-bin's init script. + - Install PolicyKit and sasl stuff in libvirt-bin. + - Rename libvirt group to libvirtd. + - Build iscsi and disk storage support. + - delayed_iff_up_bridge.patch: Don't try to bring up the bridge before at + least one interface has been added to it. + - dont_clobber_existing_bridges.patch: Assign the name of the virtual + bridge dynamically to avoid interfering with existing bridges. + - nic-model.patch: Add support for NIC configuration. + - disk-bus.patch: Add support for bus='foo' attributes for disk targets. + - better_default_uri_virsh.patch: Default to qemu:///system if the user + has write access to the libvirt socket, otherwise qemu:///session. + - ancient_parted.patch: Fix builds against libparted1.7 + + -- Soren Hansen Fri, 02 May 2008 01:50:32 +0200 + +libvirt (0.4.2-5) unstable; urgency=low + + * no need to depend on python-all-dev we only build an extension for + the current python version + + -- Guido Guenther Tue, 22 Apr 2008 11:26:13 +0200 + +libvirt (0.4.2-4) unstable; urgency=low + + * only build-dep on qemu on architectures that have it + (Closes: #476290) + * the packages containing the daemon should suggest polkit + + -- Guido Guenther Fri, 18 Apr 2008 10:41:38 +0200 + +libvirt (0.4.2-3) unstable; urgency=low + + * drop the {build-,}dependency on open-iscsi too + * suggest policykit + + -- Guido Guenther Mon, 14 Apr 2008 15:27:20 +0200 + +libvirt (0.4.2-2) unstable; urgency=low + + * disable the iscsi storage backend until #423368 is fixed in unstable + * disable polkit authentication by default so the libvirt stays accessible + for members of the libvirt group + + -- Guido Guenther Mon, 14 Apr 2008 14:20:23 +0200 + +libvirt (0.4.2-1) unstable; urgency=low + + * drop no-mac.diff - applied upstream + * no need to explicitly link against libpthread + * always enable debugging + * add Homepage URL + * add Vcs-{Git,Browser} fields + * symlink devhelp docs + * enable policy kit + + -- Guido Guenther Fri, 11 Apr 2008 17:54:06 +0200 + +libvirt (0.4.1-1) experimental; urgency=low + + * new upstream version + * Xen 3.2 fixes + * storage pool support + * partition based storage pools are disabled, since this needs parted 1.8 + which is only in experimental + * update patches for new upstream release + * boot-dev-error.diff - applied upstream + * qemu-parse-error.diff - applied upstream + * qemu-path.diff - adjust to new hypervisor detection code + * rediff the rest + * new patches: + * no-mac.diff: don't set mac address on tun device since it breaks kvm + * bump shlibs version + + -- Guido Guenther Fri, 07 Mar 2008 10:17:21 +0100 + +libvirt (0.4.0-6) unstable; urgency=low + + * depend on libxen-dev (Closes:#467598) + * allow members of the libvirt group to manage virtual machines + + -- Guido Guenther Sun, 02 Mar 2008 16:11:49 +0100 + +libvirt (0.4.0-5) unstable; urgency=low + + * thanks to the xen maintainers Debian now has a working libxen-dev, so + enable xen support in the default build (Closes: #453826) + * recommend netcat-openbsd for unix domain socket support (Closes: #453627) + * README.Debian: document necessary xend options + * fix spelling of Python + + -- Guido Guenther Wed, 20 Feb 2008 11:14:22 +0100 + +libvirt (0.4.0-4) unstable; urgency=low + + * don't segfault on broken boot device configuration (Closes: #463686) + * don't segfault due to missing errorhandling in the XML parsing code + + -- Guido Guenther Tue, 05 Feb 2008 13:12:54 +0100 + +libvirt (0.4.0-3) unstable; urgency=low + + * add and remove the libvirt group for the socket + * be a bit more verbose on libvirtd reload + * depend on adduser since we add the libvirt user + * don't restart libvirtd on upgrades since it kills running qemus + * enable debugging via DEB_BUILD_OPTS + + -- Guido Guenther Sun, 03 Feb 2008 14:21:46 +0100 + +libvirt (0.4.0-2ubuntu8) hardy; urgency=low + + * disk-bus.patch: + - Add bus attribute to disk/target tags. Allows you to create virtio disks. + (LP: #213991) + * nic-model.patch: + - Add support to network interfaces. (LP: #213991) + * graceful_shutdown.patch: + - Rather than pulling the power from virtual machines, send an ACPI power + button event and let the OS handle it. + * better_default_uri_virsh.patch: + - Updated patch: Output connection URI to stderr instead of stdout to avoid + breaking scripts that use virsh. + + -- Soren Hansen Wed, 16 Apr 2008 10:35:03 +0200 + +libvirt (0.4.0-2ubuntu7) hardy; urgency=low + + * better_default_uri_virsh.patch: + - Make virsh connect to qemu:///system by default if the user has write + access to /var/run/libvirt/libvirt-sock and qemu:///session if not. + + -- Soren Hansen Tue, 01 Apr 2008 10:32:59 +0200 + +libvirt (0.4.0-2ubuntu6) hardy; urgency=low + + * *Actually* apply our patches to the -dbg version. + + -- Soren Hansen Tue, 11 Mar 2008 14:49:03 +0100 + +libvirt (0.4.0-2ubuntu5) hardy; urgency=low + + * Create /var/lib/libvirt in libvirt-bin. (LP: #191636) + + -- Soren Hansen Wed, 13 Feb 2008 22:17:33 +0100 + +libvirt (0.4.0-2ubuntu4) hardy; urgency=low + + * dont_clobber_existing_bridges.patch: + - Change bridge name from virbr0 to virbr%d, to ensure we never clobber + existing bridges. + * Add iptables dependency + + -- Soren Hansen Wed, 13 Feb 2008 00:53:20 +0100 + +libvirt (0.4.0-2ubuntu3) hardy; urgency=low + + * Build against libxen3-dev instead of libxen3.2-dev. + * libvirt-bin: + + Replace "Suggests: dnsmasq" with "Depends: dnsmasq-base". + + Add dependency on netcat-openbsd (to enable qemu+ssh:// style remote + management) + + -- Soren Hansen Fri, 08 Feb 2008 17:24:48 +0100 + +libvirt (0.4.0-2ubuntu2) hardy; urgency=low + + * Build against libxen-3.2 instead of 3.1. + * Bump bridge-utils from Suggests: to Depends:. + + -- Soren Hansen Tue, 05 Feb 2008 10:34:31 +0100 + +libvirt (0.4.0-2ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - DebianMaintainerField. + - Add libxen3.1-dev to enable Xen management. + - Add libpolkit-dbus-dev to enable polkit integration. + - Build libvirt0-dbg flavour. + - Start libvirtd by default. + - Install polkit policy. + - Install sasl config. + - Install sample qemu and libvirtd config. + - Create libvirtd group in postinst. + - libvirt-remote-ssh.patch: Fix foo+ssh:// urls. + - delayed_iff_up_bridge.patch: Don't try to IFF_UP the bridge interface + until an interface gets added to it. + * Create /var/run if it doesn't exist (LP: #178106). + + -- Soren Hansen Wed, 30 Jan 2008 16:43:11 +0100 + +libvirt (0.4.0-2) unstable; urgency=low + + * libvirt-bin.init: fix the reload target + * add configuration examples + + -- Guido Guenther Sat, 15 Dec 2007 18:59:11 +0100 + +libvirt (0.4.0-1) unstable; urgency=low + + * new upstream version + * enable sasl support + * leave policykit support disabled since it's not in unstable yet + * bump shlibs version + * remove CVS metadata + * rediff patches + * libvirtd-bin.init: libvirtd supports reload + + -- Guido Guenther Fri, 21 Dec 2007 16:49:13 +0100 + +libvirt (0.4.0-0ubuntu3) hardy; urgency=low + + * Clean up debian/rules (should reenable concurrent builds). + * Don't restart libvirt on upgrades (if there's a good reason, we'll + add it to postinst/prerm with checks for specific versions). + + -- Soren Hansen Fri, 18 Jan 2008 19:07:19 +0100 + +libvirt (0.4.0-0ubuntu2) hardy; urgency=low + + * IFF_UP'ing a bridge interface doesn't work until the first interface has + been added to it. + * Fix remote ssh connections. + + -- Soren Hansen Tue, 15 Jan 2008 10:53:25 +0100 + +libvirt (0.4.0-0ubuntu1) hardy; urgency=low + + * New upstream release. + * Don't change the default URI. It appears that too many applications + still depend on this broken behaviour. + * Change maintainer to ubuntu-core-dev. + + -- Soren Hansen Fri, 21 Dec 2007 11:24:02 +0100 + +libvirt (0.3.3-6ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Add libvirt0-dbg package. + - Start libvirtd by default. + - Create libvirtd group, and have libvirtd's sockets have group ownership + "libvirtd". + - Add libxen as a build-dependency to enable libvirt's Xen features. + + -- Soren Hansen Thu, 20 Dec 2007 11:28:00 +0100 + +libvirt (0.3.3-6) unstable; urgency=low + + * don't include precompiled examples in the doc package (Closes: #456825) + * remove RHism from manpage (Closes: #455859) + * bump standards version + + -- Guido Guenther Wed, 19 Dec 2007 13:45:58 +0100 + +libvirt (0.3.3-5.xen0) unstable; urgency=low + + * rebuild with xen support + + -- Guido Guenther Tue, 08 Jan 2008 11:00:24 +0100 + +libvirt (0.3.3-5) unstable; urgency=low + + * make libs match overrides + * move to team maintenance + * suggest dnsmasq and bridge-utils for qemu networking + * remove stale PID files + + -- Guido Guenther Thu, 13 Dec 2007 21:34:16 +0100 + +libvirt (0.3.3-4.xen0) unstable; urgency=low + + * UNRELEASED + * build with xen support + * debian/control: we also support xen + + -- Guido Guenther Thu, 06 Dec 2007 15:43:03 +0100 + +libvirt (0.3.3-4ubuntu5) hardy; urgency=low + + * Made default_uri a configurable. + + -- Soren Hansen Wed, 19 Dec 2007 00:56:31 +0100 + +libvirt (0.3.3-4ubuntu4) hardy; urgency=low + + * Add "Provides: libvirt0" to libvirt0-dbg. + * Make virsh understand that the default URI is not xen:///. + + -- Soren Hansen Wed, 19 Dec 2007 00:13:10 +0100 + +libvirt (0.3.3-4ubuntu3) hardy; urgency=low + + * Change default URI to qemu:///session + * Add libvirt0-dbg package, which is just like libvirt0, but built + with --enable-debug=yes. + + -- Soren Hansen Thu, 13 Dec 2007 21:37:39 +0100 + +libvirt (0.3.3-4ubuntu2) hardy; urgency=low + + * Start libvirtd by default. + * Create libvirtd group, and have libvirtd's sockets have group ownership + "libvirtd". + + -- Soren Hansen Thu, 13 Dec 2007 15:08:29 +0100 + +libvirt (0.3.3-4ubuntu1) hardy; urgency=low + + * Fakesync with Debian. + * Reenable Xen. + + -- Soren Hansen Thu, 06 Dec 2007 13:33:13 +0100 + +libvirt (0.3.3-4) unstable; urgency=low + + * put packages into the proper sections + * fix messed up Standards-Version (Closes: #453900) + + -- Guido Guenther Sun, 02 Dec 2007 14:50:11 +0100 + +libvirt (0.3.3-3.xen0) unstable; urgency=low + + * build with xen support - depend on our hacked up xen-utils for that + + -- Guido Guenther Sat, 01 Dec 2007 16:27:32 +0000 + +libvirt (0.3.3-3) unstable; urgency=low + + * add initscript to start libvirtd + + -- Guido Guenther Wed, 28 Nov 2007 10:30:29 +0100 + +libvirt (0.3.3-2) unstable; urgency=low + + * debian/copyright: + * update FSF address + * update upstream author and copyright information + * install the virsh manpage + * use binary:Version instead of Source-Version + + -- Guido Guenther Fri, 23 Nov 2007 22:31:26 +0100 + +libvirt (0.3.3-1) unstable; urgency=low + + * repackage for Debian (Closes: #384300) + * enable avahi + * build with qemu/kvm support + * disable xen support until #402249 is fixed + * disable qemu autonetwork for now, causes libvirtd to seqfault + * fix path to kvm + * switch off DH_VERBOSE + * thanks to the Ubuntu maintainers for their work! + + -- Guido Guenther Fri, 23 Nov 2007 01:58:56 +0100 + +libvirt (0.3.3-0ubuntu1) hardy; urgency=low + + * New upstream release. + * Update maintainer. + + -- Soren Hansen Wed, 14 Nov 2007 23:09:33 +0100 + +libvirt (0.3.0-0ubuntu2) gutsy; urgency=low + + * Add lingnutls-dev Build-Dep. + + -- Fabio M. Di Nitto Mon, 16 Jul 2007 12:10:41 +0200 + +libvirt (0.3.0-0ubuntu1) gutsy; urgency=low + + * Import new upstram release that can actually build on xen-3.1. + + -- Fabio M. Di Nitto Mon, 16 Jul 2007 10:23:04 +0200 + +libvirt (0.2.2-0ubuntu1) gutsy; urgency=low + + * Depends on libxen3.1-dev. + + -- Chuck Short Fri, 13 Jul 2007 11:04:00 -0400 + +libvirt (0.2.2-0ubuntu0) gutsy; urgency=low + + * New upstream version. + * Updated libvirt-bin.install, thanks to Marcelo Boveto Shima. + + -- Chuck Short Sun, 24 Jun 2007 09:54:54 -0400 + +libvirt (0.1.8-0ubuntu2) feisty; urgency=low + + * Rebuild for python2.5 as the default python version. + + -- Matthias Klose Fri, 12 Jan 2007 13:21:55 +0000 + +libvirt (0.1.8-0ubuntu1) feisty; urgency=low + + * Initial release + + -- Andrew Mitchell Mon, 23 Oct 2006 20:00:28 +1300 + --- libvirt-0.7.2.orig/debian/watch +++ libvirt-0.7.2/debian/watch @@ -0,0 +1,3 @@ +# format version number, currently 3; this line is compulsory! +version=3 +http://libvirt.org/sources/libvirt-([\d\.]*)\.tar\.gz --- libvirt-0.7.2.orig/debian/libvirt-bin.postinst +++ libvirt-0.7.2/debian/libvirt-bin.postinst @@ -0,0 +1,97 @@ +#!/bin/sh +# postinst script for libvirt-bin +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + if ! getent group libvirtd >/dev/null; then + addgroup --system libvirtd + fi + + # Add each admin user to the libvirtd group + for u in $(grep "^admin:" /etc/group | sed -e "s/^.*://" -e "s/,/ /g"); do + adduser "$u" libvirtd >/dev/null + done + + # libvirt from 0.6.0 on is safe to restart with running vms: + if [ -n "$2" ] && dpkg --compare-versions "$2" ge 0.6.0; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d libvirt-bin stop + else + /etc/init.d/libvirt-bin stop + fi + sleep 1 + fi + + if dpkg --compare-versions "$2" lt "0.6.1-2"; then + if [ -e /etc/rc2.d/S20libvirt-bin ] && \ + [ -e /etc/rc3.d/S20libvirt-bin ] && \ + [ -e /etc/rc4.d/S20libvirt-bin ] && \ + [ -e /etc/rc5.d/S20libvirt-bin ] && \ + [ -e /etc/rc0.d/K20libvirt-bin ] && \ + [ -e /etc/rc1.d/K20libvirt-bin ] && \ + [ -e /etc/rc6.d/K20libvirt-bin ]; then + update-rc.d -f libvirt-bin remove >/dev/null + fi + fi + + # 0.7.2 moved virt-aa-helper to /usr/lib/libvirt, so preserve + # the user changes (if any). If the old profile was changed, + # then update it for the new path, then move into place. + old_profile="/etc/apparmor.d/usr.bin.virt-aa-helper" + new_profile="/etc/apparmor.d/usr.lib.libvirt.virt-aa-helper" + if dpkg --compare-versions "$2" le "0.7.0-1ubuntu15"; then + sed -i "s#/usr/bin/virt-aa-helper#/usr/lib/libvirt/virt-aa-helper#g" "$old_profile" + old_md5sum="$(md5sum $old_profile | sed -e 's/ .*//')" + new_md5sum="$(md5sum $new_profile | sed -e 's/ .*//')" + if [ "$old_md5sum" = "$new_md5sum" ]; then + rm -f "$old_profile" + else + echo "Migrating user changes to $new_profile ..." + mv -f "$new_profile" "$new_profile".dpkg-new + mv -f "$old_profile" "$new_profile" + fi + fi + + profile="/etc/apparmor.d/usr.sbin.libvirtd" + if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then + apparmor_parser -r -W -T "$profile" || true + fi + profile="/etc/apparmor.d/usr.lib.libvirt.virt-aa-helper" + if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then + apparmor_parser -r -W -T "$profile" || true + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- libvirt-0.7.2.orig/debian/rules +++ libvirt-0.7.2/debian/rules @@ -0,0 +1,68 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM = pycentral + +ifneq (,$(findstring $(DEB_HOST_ARCH), i386 amd64)) + BUILD_XEN = --with-xen + BUILD_VBOX = --with-vbox +else + BUILD_XEN = --without-xen + BUILD_VBOX = --without-vbox +endif + +ifneq (,$(findstring $(DEB_HOST_ARCH), ia64)) + BUILD_LXC = --without-lxc +else + BUILD_LXC = --with-lxc +endif + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/class/python-distutils.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +DEB_CONFIGURE_EXTRA_FLAGS := \ + --disable-rpath \ + --with-qemu \ + --with-openvz \ + --with-avahi \ + --with-sasl \ + --with-polkit \ + --with-hal \ + --with-storage-fs \ + --with-storage-lvm \ + --with-storage-iscsi \ + --with-storage-disk \ + --with-init-scripts=none \ + --with-apparmor \ + --without-numactl \ + --enable-debug \ + $(BUILD_XEN) \ + $(BUILD_VBOX) \ + $(BUILD_LXC) + +DEB_COMPRESS_EXCLUDE = .o event-test hellolibvirt info1 suspend +DEB_DBG_PACKAGES = libvirt0-dbg +DEB_DBG_PACKAGE_libvirt0 = libvirt0-dbg +DEB_PYTHON_SETUP_CMD = /dev/null +DEB_DH_MAKESHLIBS_ARGS_libvirt0 += -V 'libvirt0 (>= 0.5.0)' +DEB_DH_INSTALLINIT_ARGS := --no-restart-on-upgrade -- defaults 28 72 +DEB_DH_INSTALLLOGROTATE_ARGS := --name=libvirtd +DEB_MAKE_CHECK_TARGET := check + +EXAMPLES=debian/libvirt-doc/usr/share/doc/libvirt-doc/examples/ + +build/libvirt-bin:: + mkdir -p debian/tmp/etc/apparmor.d/abstractions debian/tmp/etc/apparmor.d/libvirt + cp -f debian/apparmor/libvirt-qemu debian/tmp/etc/apparmor.d/abstractions + cp -f debian/apparmor/usr.lib.libvirt.virt-aa-helper debian/tmp/etc/apparmor.d + cp -f debian/apparmor/usr.sbin.libvirtd debian/tmp/etc/apparmor.d + cp -f debian/apparmor/TEMPLATE debian/tmp/etc/apparmor.d/libvirt + mkdir -p debian/tmp/usr/share/apport/package-hooks + cp -f debian/libvirt-bin.apport debian/tmp/usr/share/apport/package-hooks/source_libvirt-bin.py +binary-install/libvirt-doc:: + cd debian/libvirt-doc/usr/share/doc/libvirt-doc/examples && \ + find * -name "*.o" -type f -delete -o -name .libs -type d -exec rm -rf {} \; && \ + rm -f domain-events/events-c/event-test dominfo/info1 domsuspend/suspend hellolibvirt/hellolibvirt +post-patches:: + chmod 755 tests/virt-aa-helper-test --- libvirt-0.7.2.orig/debian/README.source +++ libvirt-0.7.2/debian/README.source @@ -0,0 +1,57 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To configure quilt to use debian/patches instead of patches, you want +either to export QUILT_PATCHES=debian/patches in your environment +or use this snippet in your ~/.quiltrc: + + for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + fi + done + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- libvirt-0.7.2.orig/debian/README.Debian +++ libvirt-0.7.2/debian/README.Debian @@ -0,0 +1,120 @@ +Xen +=== +To manage xen domains with libvirt you have to set: + +(xend-unix-server yes) + +in /etc/xen/xend-config.sxp. + +For xend HTTP access (not recommended) you also have to set: + +(xend-http-server yes) +# only allow access from localhost: +(xend-address localhost) + +Note that *every* user on the system has access to xend then. Better use +libvirtd to access xen with unprivileged users and add the users to the +"libvirt" group (see "Access Control" below). + +Debugging +========= +Use LIBVIRT_DEBUG=1 to enable libvirt's debugging output, e.g.: + +LIBVIRT_DEBUG=1 +export LIBVIRT_DEBUG +virt-manager + +The default NAT network +======================= +To ease network configuration libvirt defines a NATed network named "default". +VMs using this network end up in 192.168.122.1/24 and DHCP is provided to them +via dnsmasq. This network is not automatically started. To start it use: + + virsh net-start default + +To make the default network start automatically use: + + virsh net-autostart default + +In order for things to work this way you need to have the recommended packages +dnsmasq-base, bridge-utils and iptables installed. + +You don't need the package dnsmasq. However, if you install it, Debian's +default dnsmasq needs to be adjusted slightly to interoperate with libvirtd: + +cat </etc/dnsmasq.d/00_libvirtd.conf +# only bind to loopback by default +interface=lo +bind-interfaces +EOF + +This makes dnsmasq only bind to the loopback interface by default so libvirtd +can handle the virtual bridges. + +Access Control +============== +Access to the libvirt socket is controlled by membership in the "libvirt" group. +If you want to manage VMs as non root you need to add a user to that group. + + -- Guido Guenther Thu, 15 May 2008 14:13:03 +0100 + + +AppArmor Profile +---------------- +Libvirt now contains AppArmor integration when using KVM or QEMU using +libvirt's sVirt infrastructure. Libvirtd can be configured to launch virtual +machines that are confined by uniquely restrictive AppArmor profiles. This +feature significantly improves virtualization in Ubuntu by providing user-space +host protection as well as guest isolation. + +In the sVirt model, if a profile is loaded for the libvirtd daemon, then each +qemu:///system QEMU virtual machine will have a profile created for it when +the virtual machine is started if one does not already exist. This generated +profile is based on a template file and uses a profile name based on the UUID +of the QEMU virtual machine and contains rules allowing access to only the +files it needs to run, such as its disks, pid file and log files. Just before +the QEMU virtual machine is started, the libvirtd daemon will change into this +unique profile, preventing the QEMU process from accessing any file resources +that are present in another QEMU process or the host machine. + +The AppArmor sVirt implementation is flexible in that it allows a user to +customize the template file in /etc/apparmor.d/libvirt/TEMPLATE for +site-specific access for all newly created QEMU virtual machines. When a +new profile is generated, two files are created: + + /etc/apparmor.d/libvirt/libvirt- + /etc/apparmor.d/libvirt/libvirt-.files + +The former can be fine-tuned by the administrator to allow custom access for +this particular QEMU virtual machine, and the latter will be updated +appropriately when required file access changes, such as when a disk is added. +This flexibility allows for situations such as having one virtual machine in +complain mode with all others in enforce mode. + +Profiles for /usr/sbin/libvirtd, /usr/lib/libvirt/virt-aa-helper (a helper +program which the libvirtd daemon uses instead of manipulating AppArmor +directly), and /etc/apparmor.d/abstractions/libvirt-qemu are used to configure +AppArmor confinement with sVirt. Administrators of libvirt in production +environments are encouraged to review these files (especially 'libvirt-qemu') +to ensure that only the access required is given to the virtual machines. + +If the sVirt security model is active, then the node capabilities XML will +include its details. If a virtual machine is currently protected by the +security model, then the guest XML will include its assigned profile name. If +enabled at compile time, the sVirt security model will be activated if AppArmor +is available on the host OS and a profile for the libvirtd daemon is loaded +when libvirtd is started. To disable sVirt, and revert to the basic level of +AppArmor protection (host protection only), the /etc/libvirt/qemu.conf file can +be used to change the setting to security_driver="none". Users may also +disable AppArmor integration through AppArmor itself by performing: + +$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd +$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/usr.sbin.libvirtd + +If your system uses AppArmor, please note that the shipped profile works with +the default installation, and changes in your configuration may require changes +to the installed apparmor profile. Before filing a bug against this software, +please see https://wiki.ubuntu.com/DebuggingApparmor before filing a bug +against this software. + + -- Jamie Strandboge Thu, 10 Sep 2009 08:29:04 -0500 --- libvirt-0.7.2.orig/debian/apparmor/libvirt-qemu +++ libvirt-0.7.2/debian/apparmor/libvirt-qemu @@ -0,0 +1,114 @@ +# Last Modified: Wed Jul 8 09:57:41 2009 + + #include + #include + #include + + # required for reading disk images + capability dac_override, + capability dac_read_search, + capability chown, + + network inet stream, + network inet6 stream, + + /dev/net/tun rw, + /dev/kvm rw, + /dev/ptmx rw, + /dev/kqemu rw, + + # WARNING: uncommenting these gives the guest direct access to host hardware. + # This is required for USB pass through but is a security risk. You have been + # warned. + #/sys/bus/usb/devices/ r, + #/sys/devices/*/*/usb[0-9]*/** r, + #/dev/bus/usb/*/[0-9]* rw, + + # WARNING: this gives the guest direct access to host hardware and specific + # portions of shared memory. This is required for sound using ALSA with kvm, + # but may constitute a security risk. If your environment does not require + # the use of sound in your VMs, feel free to comment out or prepend 'deny' to + # the rules for files in /dev. + /dev/shm/ r, + /dev/shm/pulse-shm* r, + /dev/shm/pulse-shm* rwk, + /dev/snd/* rw, + capability ipc_lock, + # 'kill' is not required for sound and is a security risk. Do not enable + # unless you absolutely need it. + deny capability kill, + + /etc/pulse/client.conf r, + @{HOME}/.pulse-cookie rwk, + owner /root/.pulse-cookie rwk, + owner /root/.pulse/ rw, + owner /root/.pulse/* rw, + /usr/share/alsa/** r, + owner /tmp/pulse-*/ rw, + owner /tmp/pulse-*/* rw, + /var/lib/dbus/machine-id r, + + # access to firmware's etc + /usr/share/kvm/** r, + /usr/share/qemu/** r, + /usr/share/bochs/** r, + /usr/share/openbios/** r, + /usr/share/openhackware/** r, + /usr/share/proll/** r, + /usr/share/vgabios/** r, + + # access PKI infrastructure + /etc/pki/libvirt-vnc/** r, + + # the various binaries + /usr/bin/kvm rmix, + /usr/bin/qemu rmix, + /usr/bin/qemu-system-arm rmix, + /usr/bin/qemu-system-cris rmix, + /usr/bin/qemu-system-i386 rmix, + /usr/bin/qemu-system-m68k rmix, + /usr/bin/qemu-system-mips rmix, + /usr/bin/qemu-system-mips64 rmix, + /usr/bin/qemu-system-mips64el rmix, + /usr/bin/qemu-system-mipsel rmix, + /usr/bin/qemu-system-ppc rmix, + /usr/bin/qemu-system-ppc64 rmix, + /usr/bin/qemu-system-ppcemb rmix, + /usr/bin/qemu-system-sh4 rmix, + /usr/bin/qemu-system-sh4eb rmix, + /usr/bin/qemu-system-sparc rmix, + /usr/bin/qemu-system-sparc64 rmix, + /usr/bin/qemu-system-x86_64 rmix, + /usr/bin/qemu-alpha rmix, + /usr/bin/qemu-arm rmix, + /usr/bin/qemu-armeb rmix, + /usr/bin/qemu-cris rmix, + /usr/bin/qemu-i386 rmix, + /usr/bin/qemu-m68k rmix, + /usr/bin/qemu-mips rmix, + /usr/bin/qemu-mipsel rmix, + /usr/bin/qemu-ppc rmix, + /usr/bin/qemu-ppc64 rmix, + /usr/bin/qemu-ppc64abi32 rmix, + /usr/bin/qemu-sh4 rmix, + /usr/bin/qemu-sh4eb rmix, + /usr/bin/qemu-sparc rmix, + /usr/bin/qemu-sparc64 rmix, + /usr/bin/qemu-sparc32plus rmix, + /usr/bin/qemu-sparc64 rmix, + /usr/bin/qemu-x86_64 rmix, + + # for save and resume + /bin/dash rmix, + /bin/dd rmix, + /bin/cat rmix, + + # workaround https://launchpad.net/bugs/457716. The svirt driver does not + # relabel the state file (https://bugzilla.redhat.com/show_bug.cgi?id=529363) + # resulting in denied messages. The below works around this somewhat by + # allowing users to save state files in their home directories. We use + # 'owner' to make sure we don't overwrite the user's files. This will be + # removed when the upstream bug is fixed. + #include + owner @{HOME}/ r, + owner @{HOME}/** rw, --- libvirt-0.7.2.orig/debian/apparmor/usr.sbin.libvirtd +++ libvirt-0.7.2/debian/apparmor/usr.sbin.libvirtd @@ -0,0 +1,51 @@ +# Last Modified: Mon Jul 6 17:23:58 2009 +#include +@{LIBVIRT}="libvirt" + +/usr/sbin/libvirtd { + #include + + capability kill, + capability net_admin, + capability net_raw, + capability setgid, + capability sys_admin, + capability sys_module, + capability sys_ptrace, + capability sys_nice, + capability sys_chroot, + capability setuid, + capability dac_override, + capability dac_read_search, + capability fowner, + capability chown, + capability setpcap, + capability mknod, + + network inet stream, + network inet dgram, + network inet6 stream, + network inet6 dgram, + + # for now, use a very lenient profile since we want to first focus on + # confining the guests + /** rwmkl, + + /bin/* Ux, + /sbin/* Ux, + /usr/bin/* Ux, + /usr/sbin/* Ux, + + # force the use of virt-aa-helper + audit deny /sbin/apparmor_parser rwxl, + audit deny /etc/apparmor.d/libvirt/** wxl, + audit deny /sys/kernel/security/apparmor/features rwxl, + audit deny /sys/kernel/security/apparmor/matching rwxl, + audit deny /sys/kernel/security/apparmor/.* rwxl, + /sys/kernel/security/apparmor/profiles r, + /usr/lib/libvirt/* PUxr, + + # allow changing to our UUID-based named profiles + change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*, + +} --- libvirt-0.7.2.orig/debian/apparmor/usr.lib.libvirt.virt-aa-helper +++ libvirt-0.7.2/debian/apparmor/usr.lib.libvirt.virt-aa-helper @@ -0,0 +1,22 @@ +# Last Modified: Mon Jul 06 17:22:37 2009 +#include + +/usr/lib/libvirt/virt-aa-helper { + #include + + # needed for searching directories + capability dac_override, + capability dac_read_search, + + # needed for when disk is on a network filesystem + network inet, + + deny @{PROC}/[0-9]*/mounts r, + @{PROC}/filesystems r, + + /usr/lib/libvirt/virt-aa-helper mr, + /sbin/apparmor_parser Ux, + + /etc/apparmor.d/libvirt/* r, + /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw, +} --- libvirt-0.7.2.orig/debian/apparmor/TEMPLATE +++ libvirt-0.7.2/debian/apparmor/TEMPLATE @@ -0,0 +1,9 @@ +# +# This profile is for the domain whose UUID matches this file. +# + +#include + +profile LIBVIRT_TEMPLATE { + #include +} --- libvirt-0.7.2.orig/debian/patches/9000-delayed_iff_up_bridge.patch +++ libvirt-0.7.2/debian/patches/9000-delayed_iff_up_bridge.patch @@ -0,0 +1,26 @@ +Index: libvirt-0.7.2-3ubuntu1/src/util/bridge.c +=================================================================== +--- libvirt-0.7.2-3ubuntu1.orig/src/util/bridge.c 2009-09-23 07:04:38.000000000 -0500 ++++ libvirt-0.7.2-3ubuntu1/src/util/bridge.c 2009-11-30 17:15:02.000000000 -0600 +@@ -244,7 +244,10 @@ + const char *bridge, + const char *iface) + { +- return brAddDelInterface(ctl, SIOCBRADDIF, bridge, iface); ++ int ret; ++ if (ret = brAddDelInterface(ctl, SIOCBRADDIF, bridge, iface)) ++ return ret; ++ return brSetInterfaceUp(ctl, bridge, 1); + } + #else + int +@@ -571,7 +574,8 @@ + ifr.ifr_flags = flags; + + if (ioctl(ctl->fd, SIOCSIFFLAGS, &ifr) < 0) +- return errno; ++ /* Just smile and wave, boys... */ ++ return 0; + } + + return 0; --- libvirt-0.7.2.orig/debian/patches/9006-increase-unix-socket-timeout.patch +++ libvirt-0.7.2/debian/patches/9006-increase-unix-socket-timeout.patch @@ -0,0 +1,18 @@ +# +# Description: increase timeout for waiting on a Unix socket to avoid +# 'monitor socket did not show up.: No such file or directory' +# errors +# +Index: libvirt-0.7.2-3ubuntu1/src/qemu/qemu_driver.c +=================================================================== +--- libvirt-0.7.2-3ubuntu1.orig/src/qemu/qemu_driver.c 2009-11-30 17:21:21.000000000 -0600 ++++ libvirt-0.7.2-3ubuntu1/src/qemu/qemu_driver.c 2009-11-30 17:21:21.000000000 -0600 +@@ -967,7 +967,7 @@ + { + struct sockaddr_un addr; + int monfd; +- int timeout = 3; /* In seconds */ ++ int timeout = 30; /* In seconds */ + int ret, i = 0; + + if ((monfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { --- libvirt-0.7.2.orig/debian/patches/0003-allow-libvirt-group-to-access-the-socket.patch +++ libvirt-0.7.2/debian/patches/0003-allow-libvirt-group-to-access-the-socket.patch @@ -0,0 +1,49 @@ +From: Guido Guenther +Date: Thu, 26 Jun 2008 20:01:38 +0200 +Subject: [PATCH] allow libvirt group to access the socket + +--- + daemon/libvirtd.conf | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf +index 49de466..cc5f056 100644 +--- a/daemon/libvirtd.conf ++++ b/daemon/libvirtd.conf +@@ -78,7 +78,7 @@ + # without becoming root. + # + # This is restricted to 'root' by default. +-#unix_sock_group = "libvirt" ++unix_sock_group = "libvirt" + + # Set the UNIX socket permissions for the R/O socket. This is used + # for monitoring VM status only +@@ -95,7 +95,7 @@ + # + # If not using PolicyKit and setting group ownership for access + # control then you may want to relax this to: +-#unix_sock_rw_perms = "0770" ++unix_sock_rw_perms = "0770" + + # Set the name of the directory in which sockets will be found/created. + #unix_sock_dir = "/var/run/libvirt" +@@ -126,7 +126,7 @@ + # + # To restrict monitoring of domains you may wish to enable + # an authentication mechanism here +-#auth_unix_ro = "none" ++auth_unix_ro = "none" + + # Set an authentication scheme for UNIX read-write sockets + # By default socket permissions only allow root. If PolicyKit +@@ -135,7 +135,7 @@ + # + # If the unix_sock_rw_perms are changed you may wish to enable + # an authentication mechanism here +-#auth_unix_rw = "none" ++auth_unix_rw = "none" + + # Change the authentication scheme for TCP sockets. + # +-- --- libvirt-0.7.2.orig/debian/patches/0007-Only-remove-masquerade-roles-for-VIR_NETWORK_FORWARD.patch +++ libvirt-0.7.2/debian/patches/0007-Only-remove-masquerade-roles-for-VIR_NETWORK_FORWARD.patch @@ -0,0 +1,36 @@ +From: =?UTF-8?q?Guido=20G=C3=BCnther?= +Date: Thu, 5 Nov 2009 20:28:11 +0100 +Subject: [PATCH] Only remove masquerade roles for VIR_NETWORK_FORWARD_NAT + +Closes: #549949 +--- + src/network/bridge_driver.c | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c +index 95bc810..86ec392 100644 +--- a/src/network/bridge_driver.c ++++ b/src/network/bridge_driver.c +@@ -765,16 +765,15 @@ static void + networkRemoveIptablesRules(struct network_driver *driver, + virNetworkObjPtr network) { + if (network->def->forwardType != VIR_NETWORK_FORWARD_NONE) { +- iptablesRemoveForwardMasquerade(driver->iptables, +- network->def->network, +- network->def->forwardDev); +- +- if (network->def->forwardType == VIR_NETWORK_FORWARD_NAT) ++ if (network->def->forwardType == VIR_NETWORK_FORWARD_NAT) { ++ iptablesRemoveForwardMasquerade(driver->iptables, ++ network->def->network, ++ network->def->forwardDev); + iptablesRemoveForwardAllowRelatedIn(driver->iptables, + network->def->network, + network->def->bridge, + network->def->forwardDev); +- else if (network->def->forwardType == VIR_NETWORK_FORWARD_ROUTE) ++ } else if (network->def->forwardType == VIR_NETWORK_FORWARD_ROUTE) + iptablesRemoveForwardAllowIn(driver->iptables, + network->def->network, + network->def->bridge, +-- --- libvirt-0.7.2.orig/debian/patches/9015-hal-startup-failure-is-nonfatal.patch +++ libvirt-0.7.2/debian/patches/9015-hal-startup-failure-is-nonfatal.patch @@ -0,0 +1,45 @@ +From: Daniel P. Berrange +Subject: [PATCH] Don't return fatal error in HAL driver init if HAL isn't running +Origin: 7bed630dfbad2c42788c66506325375f825918ba + +The HAL driver returns a fatal error code in the case where HAL +is not running. This causes the entire libvirtd daemon to quit +which isn't desirable. Instead it should simply disable the HAL +driver + +* src/node_device/node_device_hal.c: Quietly disable HAL if it is + not running + +diff -Nur libvirt-0.7.2/src/node_device/node_device_hal.c libvirt-0.7.2.new/src/node_device/node_device_hal.c +--- libvirt-0.7.2/src/node_device/node_device_hal.c 2009-09-22 04:50:23.000000000 -0500 ++++ libvirt-0.7.2.new/src/node_device/node_device_hal.c 2009-12-02 07:42:04.350890241 -0600 +@@ -692,6 +692,7 @@ + DBusError err; + char **udi = NULL; + int num_devs, i; ++ int ret = -1; + + /* Ensure caps_tbl is sorted by capability name */ + qsort(caps_tbl, ARRAY_CARDINALITY(caps_tbl), sizeof(caps_tbl[0]), +@@ -728,7 +729,11 @@ + goto failure; + } + if (!libhal_ctx_init(hal_ctx, &err)) { +- VIR_ERROR0("libhal_ctx_init failed\n"); ++ VIR_ERROR0("libhal_ctx_init failed, haldaemon is probably not running\n"); ++ /* We don't want to show a fatal error here, ++ otherwise entire libvirtd shuts down when ++ hald isn't running */ ++ ret = 0; + goto failure; + } + +@@ -786,7 +791,7 @@ + nodeDeviceUnlock(driverState); + VIR_FREE(driverState); + +- return -1; ++ return ret; + } + + --- libvirt-0.7.2.orig/debian/patches/9004-better-default-arch.patch +++ libvirt-0.7.2/debian/patches/9004-better-default-arch.patch @@ -0,0 +1,18 @@ +Index: libvirt-0.7.2-3ubuntu1/src/conf/capabilities.c +=================================================================== +--- libvirt-0.7.2-3ubuntu1.orig/src/conf/capabilities.c 2009-10-13 09:17:26.000000000 -0500 ++++ libvirt-0.7.2-3ubuntu1/src/conf/capabilities.c 2009-11-30 17:19:22.000000000 -0600 +@@ -480,6 +480,13 @@ + const char *ostype) + { + int i; ++ /* Let's first see if we can match the host arch */ ++ for (i = 0 ; i < caps->nguests ; i++) { ++ if (STREQ(caps->guests[i]->ostype, ostype) ++ && STREQ(caps->guests[i]->arch.name, caps->host.arch)) ++ return caps->guests[i]->arch.name; ++ } ++ /* If we couldn't we just grab the first match */ + for (i = 0 ; i < caps->nguests ; i++) { + if (STREQ(caps->guests[i]->ostype, ostype)) + return 1; --- libvirt-0.7.2.orig/debian/patches/0004-fix-Debian-specific-path-to-hvm-loader.patch +++ libvirt-0.7.2/debian/patches/0004-fix-Debian-specific-path-to-hvm-loader.patch @@ -0,0 +1,88 @@ +From: =?UTF-8?q?Guido=20G=C3=BCnther?= +Date: Thu, 26 Feb 2009 14:29:58 +0100 +Subject: [PATCH] fix Debian specific path to hvm loader + +Closes: #517059 +--- + src/xen/xen_hypervisor.c | 2 +- + tests/xencapsdata/xen-i686-pae-hvm.xml | 2 +- + tests/xencapsdata/xen-ia64-be-hvm.xml | 2 +- + tests/xencapsdata/xen-ia64-hvm.xml | 2 +- + tests/xencapsdata/xen-x86_64-hvm.xml | 4 ++-- + 5 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c +index 3aa3c30..6f36fdc 100644 +--- a/src/xen/xen_hypervisor.c ++++ b/src/xen/xen_hypervisor.c +@@ -2218,7 +2218,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, + "/usr/lib64/xen/bin/qemu-dm" : + "/usr/lib/xen/bin/qemu-dm"), + (guest_archs[i].hvm ? +- "/usr/lib/xen/boot/hvmloader" : ++ "/usr/lib/xen-default/boot/hvmloader" : + NULL), + 1, + machines)) == NULL) { +diff --git a/tests/xencapsdata/xen-i686-pae-hvm.xml b/tests/xencapsdata/xen-i686-pae-hvm.xml +index 42b099c..2886c09 100644 +--- a/tests/xencapsdata/xen-i686-pae-hvm.xml ++++ b/tests/xencapsdata/xen-i686-pae-hvm.xml +@@ -34,7 +34,7 @@ + + 32 + /usr/lib/xen/bin/qemu-dm +- /usr/lib/xen/boot/hvmloader ++ /usr/lib/xen-default/boot/hvmloader + xenfv + + +diff --git a/tests/xencapsdata/xen-ia64-be-hvm.xml b/tests/xencapsdata/xen-ia64-be-hvm.xml +index 732b693..cf3dfc1 100644 +--- a/tests/xencapsdata/xen-ia64-be-hvm.xml ++++ b/tests/xencapsdata/xen-ia64-be-hvm.xml +@@ -31,7 +31,7 @@ + + 64 + /usr/lib/xen/bin/qemu-dm +- /usr/lib/xen/boot/hvmloader ++ /usr/lib/xen-default/boot/hvmloader + xenfv + + +diff --git a/tests/xencapsdata/xen-ia64-hvm.xml b/tests/xencapsdata/xen-ia64-hvm.xml +index ef48a95..871cd65 100644 +--- a/tests/xencapsdata/xen-ia64-hvm.xml ++++ b/tests/xencapsdata/xen-ia64-hvm.xml +@@ -28,7 +28,7 @@ + + 64 + /usr/lib/xen/bin/qemu-dm +- /usr/lib/xen/boot/hvmloader ++ /usr/lib/xen-default/boot/hvmloader + xenfv + + +diff --git a/tests/xencapsdata/xen-x86_64-hvm.xml b/tests/xencapsdata/xen-x86_64-hvm.xml +index 52c12c6..83dac3e 100644 +--- a/tests/xencapsdata/xen-x86_64-hvm.xml ++++ b/tests/xencapsdata/xen-x86_64-hvm.xml +@@ -31,7 +31,7 @@ + + 32 + /usr/lib64/xen/bin/qemu-dm +- /usr/lib/xen/boot/hvmloader ++ /usr/lib/xen-default/boot/hvmloader + xenfv + + +@@ -49,7 +49,7 @@ + + 64 + /usr/lib64/xen/bin/qemu-dm +- /usr/lib/xen/boot/hvmloader ++ /usr/lib/xen-default/boot/hvmloader + xenfv + + +-- --- libvirt-0.7.2.orig/debian/patches/9014-event-fuzz.patch +++ libvirt-0.7.2/debian/patches/9014-event-fuzz.patch @@ -0,0 +1,33 @@ +From: Daniel P. Berrange +Subject: [PATCH] Fix event test timer checks on kernels with HZ=100 +Origin: 32f021f2664290cffe34723c52435ac4a62fb365 + +On kernels with HZ=100, the resolution of sleeps in poll() is +quite bad. Doing a precise check on the expiry time vs the +current time will thus often thing the timer has not expired +even though we're within 10ms of the expected expiry time. This +then causes another pointless sleep in poll() for <10ms. Timers +do not need to have such precise expiration, so we treat a timer +as expired if it is within 20ms of the expected expiry time. This +also fixes the eventtest.c test suite on kernels with HZ=100 + +* daemon/event.c: Add 20ms fuzz when checking for timer expiry + +Index: libvirt-0.7.2/daemon/event.c +=================================================================== +--- libvirt-0.7.2.orig/daemon/event.c 2009-12-02 08:34:33.000000000 -0600 ++++ libvirt-0.7.2/daemon/event.c 2009-12-02 08:35:15.000000000 -0600 +@@ -413,7 +413,12 @@ + if (eventLoop.timeouts[i].deleted || eventLoop.timeouts[i].frequency < 0) + continue; + +- if (eventLoop.timeouts[i].expiresAt <= now) { ++ /* Add 20ms fuzz so we don't pointlessly spin doing ++ * <10ms sleeps, particularly on kernels with low HZ ++ * it is fine that a timer expires 20ms earlier than ++ * requested ++ */ ++ if (eventLoop.timeouts[i].expiresAt <= (now+20)) { + virEventTimeoutCallback cb = eventLoop.timeouts[i].cb; + int timer = eventLoop.timeouts[i].timer; + void *opaque = eventLoop.timeouts[i].opaque; --- libvirt-0.7.2.orig/debian/patches/9008-apparmor-caps-mockup.patch +++ libvirt-0.7.2/debian/patches/9008-apparmor-caps-mockup.patch @@ -0,0 +1,221 @@ +From: Jamie Strandboge +Subject: Fix virt-aa-helper when host and os.type arch differ +Origin: 308b85330ad49e2f030fe74aae917b6abbfb5bc3 + +* src/security/virt-aa-helper.c: get_definition() now calls the new + caps_mockup() function which will parse the XML for os.type, + os.type.arch and then sets the wordsize. These attributes are needed + only to get a valid virCapsPtr for virDomainDefParseString(). The -H + and -b options are now removed from virt-aa-helper (they weren't used + yet anyway). + +diff -Nur libvirt-0.7.2-3ubuntu1/src/security/virt-aa-helper.c libvirt-0.7.2-3ubuntu1.new/src/security/virt-aa-helper.c +--- libvirt-0.7.2-3ubuntu1/src/security/virt-aa-helper.c 2009-10-08 09:44:09.000000000 -0500 ++++ libvirt-0.7.2-3ubuntu1.new/src/security/virt-aa-helper.c 2009-11-30 17:26:26.500890662 -0600 +@@ -50,6 +50,7 @@ + virDomainDefPtr def; /* VM definition */ + virCapsPtr caps; /* VM capabilities */ + char *hvm; /* type of hypervisor (eg hvm, xen) */ ++ char *arch; /* machine architecture */ + int bits; /* bits in the guest */ + char *newdisk; /* newly added disk */ + } vahControl; +@@ -65,6 +66,7 @@ + virCapabilitiesFree(ctl->caps); + free(ctl->files); + free(ctl->hvm); ++ free(ctl->arch); + free(ctl->newdisk); + + return 0; +@@ -85,8 +87,6 @@ + " -R | --remove unload profile\n" + " -h | --help this help\n" + " -u | --uuid uuid (profile name)\n" +- " -H | --hvm hypervisor type\n" +- " -b | --bits architecture bits\n" + "\n", progname); + + fprintf(stdout, "This command is intended to be used by libvirtd " +@@ -551,35 +551,132 @@ + return 0; + } + ++/* Called from SAX on parsing errors in the XML. */ ++static void ++catchXMLError (void *ctx, const char *msg ATTRIBUTE_UNUSED, ...) ++{ ++ xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; ++ ++ if (ctxt) { ++ if (virGetLastError() == NULL && ++ ctxt->lastError.level == XML_ERR_FATAL && ++ ctxt->lastError.message != NULL) { ++ char *err_str = NULL; ++ if (virAsprintf(&err_str, "XML error at line %d: %s", ++ ctxt->lastError.line, ++ ctxt->lastError.message) == -1) ++ vah_error(NULL, 0, "Could not get XML error"); ++ else { ++ vah_error(NULL, 0, err_str); ++ VIR_FREE(err_str); ++ } ++ } ++ } ++} ++ ++/* ++ * Parse the xml we received to fill in the following: ++ * ctl->hvm ++ * ctl->arch ++ * ctl->bits ++ * ++ * These are suitable for setting up a virCapsPtr ++ */ ++static int ++caps_mockup(vahControl * ctl, const char *xmlStr) ++{ ++ int rc = -1; ++ xmlParserCtxtPtr pctxt = NULL; ++ xmlDocPtr xml = NULL; ++ xmlXPathContextPtr ctxt = NULL; ++ xmlNodePtr root; ++ ++ /* Set up a parser context so we can catch the details of XML errors. */ ++ pctxt = xmlNewParserCtxt (); ++ if (!pctxt || !pctxt->sax) ++ goto cleanup; ++ pctxt->sax->error = catchXMLError; ++ ++ xml = xmlCtxtReadDoc (pctxt, BAD_CAST xmlStr, "domain.xml", NULL, ++ XML_PARSE_NOENT | XML_PARSE_NONET | ++ XML_PARSE_NOWARNING); ++ if (!xml) { ++ if (virGetLastError() == NULL) ++ vah_error(NULL, 0, "failed to parse xml document"); ++ goto cleanup; ++ } ++ ++ if ((root = xmlDocGetRootElement(xml)) == NULL) { ++ vah_error(NULL, 0, "missing root element"); ++ goto cleanup; ++ } ++ ++ if (!xmlStrEqual(root->name, BAD_CAST "domain")) { ++ vah_error(NULL, 0, "incorrect root element"); ++ goto cleanup; ++ } ++ ++ if ((ctxt = xmlXPathNewContext(xml)) == NULL) { ++ vah_error(ctl, 0, "could not allocate memory"); ++ goto cleanup; ++ } ++ ctxt->node = root; ++ ++ ctl->hvm = virXPathString(NULL, "string(./os/type[1])", ctxt); ++ if (!ctl->hvm || STRNEQ(ctl->hvm, "hvm")) { ++ vah_error(ctl, 0, "os.type is not 'hvm'"); ++ goto cleanup; ++ } ++ ctl->arch = virXPathString(NULL, "string(./os/type[1]/@arch)", ctxt); ++ if (!ctl->arch) { ++ /* The XML we are given should have an arch, but in case it doesn't, ++ * just use the host's arch. ++ */ ++ struct utsname utsname; ++ ++ /* Really, this never fails - look at the man-page. */ ++ uname (&utsname); ++ if ((ctl->arch = strdup(utsname.machine)) == NULL) { ++ vah_error(ctl, 0, "could not allocate memory"); ++ goto cleanup; ++ } ++ } ++ if (STREQ(ctl->arch, "x86_64")) ++ ctl->bits = 64; ++ else ++ ctl->bits = 32; ++ ++ rc = 0; ++ ++ cleanup: ++ xmlFreeParserCtxt (pctxt); ++ xmlFreeDoc (xml); ++ xmlXPathFreeContext(ctxt); ++ ++ return rc; ++} ++ + static int + get_definition(vahControl * ctl, const char *xmlStr) + { + int rc = -1; +- struct utsname utsname; + virCapsGuestPtr guest; /* this is freed when caps is freed */ + + /* + * mock up some capabilities. We don't currently use these explicitly, + * but need them for virDomainDefParseString(). + */ ++ if (caps_mockup(ctl, xmlStr) != 0) ++ goto exit; + +- /* Really, this never fails - look at the man-page. */ +- uname (&utsname); +- +- /* set some defaults if not specified */ +- if (!ctl->bits) +- ctl->bits = 32; +- if (!ctl->hvm) +- ctl->hvm = strdup("hvm"); +- +- if ((ctl->caps = virCapabilitiesNew(utsname.machine, 1, 1)) == NULL) { ++ if ((ctl->caps = virCapabilitiesNew(ctl->arch, 1, 1)) == NULL) { + vah_error(ctl, 0, "could not allocate memory"); + goto exit; + } + + if ((guest = virCapabilitiesAddGuest(ctl->caps, + ctl->hvm, +- utsname.machine, ++ ctl->arch, + ctl->bits, + NULL, + NULL, +@@ -794,11 +891,8 @@ + {"replace", 0, 0, 'r'}, + {"remove", 0, 0, 'R'}, + {"uuid", 1, 0, 'u'}, +- {"hvm", 1, 0, 'H'}, +- {"bits", 1, 0, 'b'}, + {0, 0, 0, 0} + }; +- int bits; + + while ((arg = getopt_long(argc, argv, "acdDhrRH:b:u:f:", opt, + &idx)) != -1) { +@@ -806,13 +900,6 @@ + case 'a': + ctl->cmd = 'a'; + break; +- case 'b': +- bits = atoi(optarg); +- if (bits == 32 || bits == 64) +- ctl->bits = bits; +- else +- vah_error(ctl, 1, "invalid bits (should be 32 or 64)"); +- break; + case 'c': + ctl->cmd = 'c'; + break; +@@ -830,10 +917,6 @@ + vah_usage(); + exit(EXIT_SUCCESS); + break; +- case 'H': +- if ((ctl->hvm = strdup(optarg)) == NULL) +- vah_error(ctl, 1, "could not allocate memory for hvm"); +- break; + case 'r': + ctl->cmd = 'r'; + break; --- libvirt-0.7.2.orig/debian/patches/9010-apparmor-lp460271.patch +++ libvirt-0.7.2/debian/patches/9010-apparmor-lp460271.patch @@ -0,0 +1,40 @@ +From: Jamie Strandboge +Subject: [PATCH] AppArmor require absolute paths +Origin: dae7054b7697d30f2b88cd5dff3dfb954323d40b +Bug-Ubuntu: https://launchpad.net/bugs/460271 + +* src/security/virt-aa-helper.c: require absolute path for dynamic added + files. This is required by AppArmor and conveniently prevents adding + tcp consoles to the profile + +diff -Nur libvirt-0.7.2-3ubuntu1/src/security/virt-aa-helper.c libvirt-0.7.2-3ubuntu1.new/src/security/virt-aa-helper.c +--- libvirt-0.7.2-3ubuntu1/src/security/virt-aa-helper.c 2009-11-30 17:37:05.270891879 -0600 ++++ libvirt-0.7.2-3ubuntu1.new/src/security/virt-aa-helper.c 2009-11-30 17:37:35.770887115 -0600 +@@ -517,6 +517,10 @@ + if (strchr(path, '"') != NULL) + return 1; + ++ /* Require an absolute path */ ++ if (STRNEQLEN(path, "/", 1)) ++ return 1; ++ + if (!virFileExists(path)) + vah_warning("path does not exist, skipping file type checks"); + else { +@@ -718,6 +722,16 @@ + if (path == NULL) + return rc; + ++ /* Skip files without an absolute path. Not having one confuses the ++ * apparmor parser and this also ensures things like tcp consoles don't ++ * get added to the profile. ++ */ ++ if (STRNEQLEN(path, "/", 1)) { ++ vah_warning(path); ++ vah_warning(" skipped non-absolute path"); ++ return 0; ++ } ++ + if (virFileExists(path)) { + if ((tmp = realpath(path, NULL)) == NULL) { + vah_error(NULL, 0, path); --- libvirt-0.7.2.orig/debian/patches/9001-dont_clobber_existing_bridges.patch +++ libvirt-0.7.2/debian/patches/9001-dont_clobber_existing_bridges.patch @@ -0,0 +1,12 @@ +Index: libvirt-0.7.2-3ubuntu1/src/network/default.xml +=================================================================== +--- libvirt-0.7.2-3ubuntu1.orig/src/network/default.xml 2009-09-22 04:50:23.000000000 -0500 ++++ libvirt-0.7.2-3ubuntu1/src/network/default.xml 2009-11-30 17:17:07.000000000 -0600 +@@ -1,6 +1,6 @@ + + default +- ++ + + + --- libvirt-0.7.2.orig/debian/patches/9013-apparmor-examples.patch +++ libvirt-0.7.2/debian/patches/9013-apparmor-examples.patch @@ -0,0 +1,215 @@ +Author: Jamie Strandboge +Description: add examples/apparmor + These files were mistakenly ommitted from the upstream tarball + +Index: libvirt-0.7.2-3ubuntu1/examples/apparmor/libvirt-qemu +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libvirt-0.7.2-3ubuntu1/examples/apparmor/libvirt-qemu 2009-11-30 17:35:45.000000000 -0600 +@@ -0,0 +1,109 @@ ++# Last Modified: Fri Nov 6 16:41:59 2009 ++ ++ #include ++ #include ++ #include ++ ++ # required for reading disk images ++ capability dac_override, ++ capability dac_read_search, ++ capability chown, ++ ++ network inet stream, ++ network inet6 stream, ++ ++ /dev/net/tun rw, ++ /dev/kvm rw, ++ /dev/ptmx rw, ++ /dev/kqemu rw, ++ ++ # WARNING: uncommenting these gives the guest direct access to host hardware. ++ # This is required for USB pass through but is a security risk. You have been ++ # warned. ++ #/sys/bus/usb/devices/ r, ++ #/sys/devices/*/*/usb[0-9]*/** r, ++ #/dev/bus/usb/*/[0-9]* rw, ++ ++ # WARNING: this gives the guest direct access to host hardware and specific ++ # portions of shared memory. This is required for sound using ALSA with kvm, ++ # but may constitute a security risk. If your environment does not require ++ # the use of sound in your VMs, feel free to comment out or prepend 'deny' to ++ # the rules for files in /dev. ++ /dev/shm/ r, ++ /dev/shm/pulse-shm* r, ++ /dev/shm/pulse-shm* rwk, ++ /dev/snd/* rw, ++ capability ipc_lock, ++ # 'kill' is not required for sound and is a security risk. Do not enable ++ # unless you absolutely need it. ++ deny capability kill, ++ ++ /etc/pulse/client.conf r, ++ @{HOME}/.pulse-cookie rwk, ++ owner /root/.pulse-cookie rwk, ++ owner /root/.pulse/ rw, ++ owner /root/.pulse/* rw, ++ /usr/share/alsa/** r, ++ owner /tmp/pulse-*/ rw, ++ owner /tmp/pulse-*/* rw, ++ /var/lib/dbus/machine-id r, ++ ++ # access to firmware's etc ++ /usr/share/kvm/** r, ++ /usr/share/qemu/** r, ++ /usr/share/bochs/** r, ++ /usr/share/openbios/** r, ++ /usr/share/openhackware/** r, ++ /usr/share/proll/** r, ++ /usr/share/vgabios/** r, ++ ++ # the various binaries ++ /usr/bin/kvm rmix, ++ /usr/bin/qemu rmix, ++ /usr/bin/qemu-system-arm rmix, ++ /usr/bin/qemu-system-cris rmix, ++ /usr/bin/qemu-system-i386 rmix, ++ /usr/bin/qemu-system-m68k rmix, ++ /usr/bin/qemu-system-mips rmix, ++ /usr/bin/qemu-system-mips64 rmix, ++ /usr/bin/qemu-system-mips64el rmix, ++ /usr/bin/qemu-system-mipsel rmix, ++ /usr/bin/qemu-system-ppc rmix, ++ /usr/bin/qemu-system-ppc64 rmix, ++ /usr/bin/qemu-system-ppcemb rmix, ++ /usr/bin/qemu-system-sh4 rmix, ++ /usr/bin/qemu-system-sh4eb rmix, ++ /usr/bin/qemu-system-sparc rmix, ++ /usr/bin/qemu-system-sparc64 rmix, ++ /usr/bin/qemu-system-x86_64 rmix, ++ /usr/bin/qemu-alpha rmix, ++ /usr/bin/qemu-arm rmix, ++ /usr/bin/qemu-armeb rmix, ++ /usr/bin/qemu-cris rmix, ++ /usr/bin/qemu-i386 rmix, ++ /usr/bin/qemu-m68k rmix, ++ /usr/bin/qemu-mips rmix, ++ /usr/bin/qemu-mipsel rmix, ++ /usr/bin/qemu-ppc rmix, ++ /usr/bin/qemu-ppc64 rmix, ++ /usr/bin/qemu-ppc64abi32 rmix, ++ /usr/bin/qemu-sh4 rmix, ++ /usr/bin/qemu-sh4eb rmix, ++ /usr/bin/qemu-sparc rmix, ++ /usr/bin/qemu-sparc64 rmix, ++ /usr/bin/qemu-sparc32plus rmix, ++ /usr/bin/qemu-sparc64 rmix, ++ /usr/bin/qemu-x86_64 rmix, ++ ++ # for save and resume ++ /bin/dash rmix, ++ /bin/dd rmix, ++ /bin/cat rmix, ++ ++ # The svirt driver does not relabel the state file ++ # (https://bugzilla.redhat.com/show_bug.cgi?id=529363) resulting in denied ++ # messages. Uncommenting these lines can work around this somewhat by ++ # allowing users to save state files in the specified directory. We use ++ # 'owner' to make sure we don't overwrite the user's files. ++ #owner @{HOME}/libvirt-state-files/ r, ++ #owner @{HOME}/libvirt-state-files/** rw, +Index: libvirt-0.7.2-3ubuntu1/examples/apparmor/TEMPLATE +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libvirt-0.7.2-3ubuntu1/examples/apparmor/TEMPLATE 2009-11-30 17:35:45.000000000 -0600 +@@ -0,0 +1,9 @@ ++# ++# This profile is for the domain whose UUID matches this file. ++# ++ ++#include ++ ++profile LIBVIRT_TEMPLATE { ++ #include ++} +Index: libvirt-0.7.2-3ubuntu1/examples/apparmor/usr.lib.libvirt.virt-aa-helper +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libvirt-0.7.2-3ubuntu1/examples/apparmor/usr.lib.libvirt.virt-aa-helper 2009-11-30 17:35:45.000000000 -0600 +@@ -0,0 +1,22 @@ ++# Last Modified: Mon Jul 06 17:22:37 2009 ++#include ++ ++/usr/lib/libvirt/virt-aa-helper { ++ #include ++ ++ # needed for searching directories ++ capability dac_override, ++ capability dac_read_search, ++ ++ # needed for when disk is on a network filesystem ++ network inet, ++ ++ deny @{PROC}/[0-9]*/mounts r, ++ @{PROC}/filesystems r, ++ ++ /usr/lib/libvirt/virt-aa-helper mr, ++ /sbin/apparmor_parser Ux, ++ ++ /etc/apparmor.d/libvirt/* r, ++ /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw, ++} +Index: libvirt-0.7.2-3ubuntu1/examples/apparmor/usr.sbin.libvirtd +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libvirt-0.7.2-3ubuntu1/examples/apparmor/usr.sbin.libvirtd 2009-11-30 17:36:04.000000000 -0600 +@@ -0,0 +1,51 @@ ++# Last Modified: Wed Sep 23 23:23:58 2009 ++#include ++@{LIBVIRT}="libvirt" ++ ++/usr/sbin/libvirtd { ++ #include ++ ++ capability kill, ++ capability net_admin, ++ capability net_raw, ++ capability setgid, ++ capability sys_admin, ++ capability sys_module, ++ capability sys_ptrace, ++ capability sys_nice, ++ capability sys_chroot, ++ capability setuid, ++ capability dac_override, ++ capability dac_read_search, ++ capability fowner, ++ capability chown, ++ capability setpcap, ++ capability mknod, ++ ++ network inet stream, ++ network inet dgram, ++ network inet6 stream, ++ network inet6 dgram, ++ ++ # Very lenient profile for libvirtd since we want to first focus on confining ++ # the guests. Guests will have a very restricted profile. ++ /** rwmkl, ++ ++ /bin/* Ux, ++ /sbin/* Ux, ++ /usr/bin/* Ux, ++ /usr/sbin/* Ux, ++ ++ # force the use of virt-aa-helper ++ audit deny /sbin/apparmor_parser rwxl, ++ audit deny /etc/apparmor.d/libvirt/** wxl, ++ audit deny /sys/kernel/security/apparmor/features rwxl, ++ audit deny /sys/kernel/security/apparmor/matching rwxl, ++ audit deny /sys/kernel/security/apparmor/.* rwxl, ++ /sys/kernel/security/apparmor/profiles r, ++ /usr/lib/libvirt/* PUxr, ++ ++ # allow changing to our UUID-based named profiles ++ change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*, ++ ++} --- libvirt-0.7.2.orig/debian/patches/9002-better_default_uri_virsh.patch +++ libvirt-0.7.2/debian/patches/9002-better_default_uri_virsh.patch @@ -0,0 +1,56 @@ +Index: libvirt-0.7.2/tools/virsh.c +=================================================================== +--- libvirt-0.7.2.orig/tools/virsh.c 2009-12-01 13:13:52.000000000 -0600 ++++ libvirt-0.7.2/tools/virsh.c 2009-12-01 13:14:39.000000000 -0600 +@@ -58,6 +58,8 @@ + #define VSH_PROMPT_RW "virsh # " + #define VSH_PROMPT_RO "virsh > " + ++#include "remote_driver.h" ++ + #define GETTIMEOFDAY(T) gettimeofday(T, NULL) + #define DIFF_MSEC(T, U) \ + ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \ +@@ -8786,6 +8788,10 @@ + + if ((defaultConn = getenv("VIRSH_DEFAULT_CONNECT_URI"))) { + ctl->name = strdup(defaultConn); ++ } else if (!access(LIBVIRTD_PRIV_UNIX_SOCKET, W_OK)) { ++ ctl->name = strdup("qemu:///system"); ++ } else { ++ ctl->name = strdup("qemu:///session"); + } + + if (!vshParseArgv(ctl, argc, argv)) { +Index: libvirt-0.7.2/tools/Makefile.am +=================================================================== +--- libvirt-0.7.2.orig/tools/Makefile.am 2009-12-01 13:14:44.000000000 -0600 ++++ libvirt-0.7.2/tools/Makefile.am 2009-12-01 13:15:07.000000000 -0600 +@@ -45,9 +45,11 @@ + -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \ + -I../include -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ ++ -I$(top_srcdir)/src/remote \ + -I$(top_srcdir)/src/util \ + -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \ + -DLOCALEBASEDIR=\""$(datadir)/locale"\" \ ++ -DLOCAL_STATE_DIR=\""$(localstatedir)"\" \ + $(COVERAGE_CFLAGS) \ + $(LIBXML_CFLAGS) \ + $(READLINE_CFLAGS) +Index: libvirt-0.7.2/tools/Makefile.in +=================================================================== +--- libvirt-0.7.2.orig/tools/Makefile.in 2009-12-01 13:14:44.000000000 -0600 ++++ libvirt-0.7.2/tools/Makefile.in 2009-12-01 13:15:34.000000000 -0600 +@@ -898,9 +898,11 @@ + -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \ + -I../include -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ ++ -I$(top_srcdir)/src/remote \ + -I$(top_srcdir)/src/util \ + -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \ + -DLOCALEBASEDIR=\""$(datadir)/locale"\" \ ++ -DLOCAL_STATE_DIR=\""$(localstatedir)"\" \ + $(COVERAGE_CFLAGS) \ + $(LIBXML_CFLAGS) \ + $(READLINE_CFLAGS) --- libvirt-0.7.2.orig/debian/patches/0005-Fix-SELinux-linking-issues.patch +++ libvirt-0.7.2/debian/patches/0005-Fix-SELinux-linking-issues.patch @@ -0,0 +1,46 @@ +From: =?UTF-8?q?Laurent=20L=C3=A9onard?= +Date: Mon, 19 Oct 2009 21:16:34 +0200 +Subject: [PATCH] Fix SELinux linking issues. + +--- + src/Makefile.am | 2 ++ + src/Makefile.in | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +Index: libvirt-0.7.2/src/Makefile.am +=================================================================== +--- libvirt-0.7.2.orig/src/Makefile.am 2009-12-01 13:15:52.000000000 -0600 ++++ libvirt-0.7.2/src/Makefile.am 2009-12-01 14:27:40.000000000 -0600 +@@ -657,6 +657,8 @@ + libvirt_driver_security_la_LDFLAGS = + if WITH_SECDRIVER_SELINUX + libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES) ++libvirt_driver_security_la_CFLAGS += $(SELINUX_CFLAGS) ++libvirt_driver_security_la_LDFLAGS += $(SELINUX_LIBS) + endif + if WITH_SECDRIVER_APPARMOR + libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES) +Index: libvirt-0.7.2/src/Makefile.in +=================================================================== +--- libvirt-0.7.2.orig/src/Makefile.in 2009-12-01 13:15:52.000000000 -0600 ++++ libvirt-0.7.2/src/Makefile.in 2009-12-01 14:33:11.000000000 -0600 +@@ -114,6 +114,8 @@ + @HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_70 = $(DEVKIT_LIBS) + @WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_71 = -module -avoid-version + @WITH_SECDRIVER_SELINUX_TRUE@am__append_72 = $(SECURITY_DRIVER_SELINUX_SOURCES) ++@WITH_SECDRIVER_SELINUX_TRUE@am__append_82 = $(SELINUX_CFLAGS) ++@WITH_SECDRIVER_SELINUX_TRUE@am__append_83 = $(SELINUX_LIBS) + @WITH_SECDRIVER_APPARMOR_TRUE@am__append_73 = $(SECURITY_DRIVER_APPARMOR_SOURCES) + @WITH_SECDRIVER_APPARMOR_TRUE@am__append_74 = $(APPARMOR_CFLAGS) + @WITH_SECDRIVER_APPARMOR_TRUE@am__append_75 = $(APPARMOR_LIBS) +@@ -1909,8 +1911,8 @@ + libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES) \ + $(am__append_72) $(am__append_73) + libvirt_driver_security_la_CFLAGS = -I@top_srcdir@/src/conf \ +- $(am__append_74) +-libvirt_driver_security_la_LDFLAGS = $(am__append_75) ++ $(am__append_74) $(am__append_82) ++libvirt_driver_security_la_LDFLAGS = $(am__append_75) $(am__append_83) + BUILT_SOURCES = libvirt.syms + + # Empty source list - it merely links a bunch of convenience libs together --- libvirt-0.7.2.orig/debian/patches/0006-Don-t-let-parent-of-daemon-exit-until-basic-initiali.patch +++ libvirt-0.7.2/debian/patches/0006-Don-t-let-parent-of-daemon-exit-until-basic-initiali.patch @@ -0,0 +1,234 @@ +From: =?UTF-8?q?Laurent=20L=C3=A9onard?= +Date: Sun, 25 Oct 2009 01:36:36 +0200 +Subject: [PATCH] Don't let parent of daemon exit until basic initialization is done. + +--- + daemon/libvirtd.c | 118 +++++++++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 100 insertions(+), 18 deletions(-) + +diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c +index 78dfb2d..57ef4be 100644 +--- a/daemon/libvirtd.c ++++ b/daemon/libvirtd.c +@@ -185,6 +185,30 @@ static int max_client_requests = 5; + static sig_atomic_t sig_errors = 0; + static int sig_lasterrno = 0; + ++enum { ++ VIR_DAEMON_ERR_NONE = 0, ++ VIR_DAEMON_ERR_PIDFILE, ++ VIR_DAEMON_ERR_RUNDIR, ++ VIR_DAEMON_ERR_INIT, ++ VIR_DAEMON_ERR_SIGNAL, ++ VIR_DAEMON_ERR_PRIVS, ++ VIR_DAEMON_ERR_NETWORK, ++ VIR_DAEMON_ERR_CONFIG, ++ ++ VIR_DAEMON_ERR_LAST ++}; ++ ++VIR_ENUM_DECL(virDaemonErr) ++VIR_ENUM_IMPL(virDaemonErr, VIR_DAEMON_ERR_LAST, ++ "Initialization successful", ++ "Unable to obtain pidfile", ++ "Unable to create rundir", ++ "Unable to initialize libvirt", ++ "Unable to setup signal handlers", ++ "Unable to drop privileges", ++ "Unable to initialize network sockets", ++ "Unable to load configuration file") ++ + static void sig_handler(int sig, siginfo_t * siginfo, + void* context ATTRIBUTE_UNUSED) { + int origerrno; +@@ -375,7 +399,11 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED, + } + + +-static int qemudGoDaemon(void) { ++static int daemonForkIntoBackground(void) { ++ int statuspipe[2]; ++ if (pipe(statuspipe) < 0) ++ return -1; ++ + int pid = fork(); + switch (pid) { + case 0: +@@ -384,6 +412,8 @@ static int qemudGoDaemon(void) { + int stdoutfd = -1; + int nextpid; + ++ close(statuspipe[0]); ++ + if ((stdinfd = open("/dev/null", O_RDONLY)) < 0) + goto cleanup; + if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0) +@@ -407,7 +437,7 @@ static int qemudGoDaemon(void) { + nextpid = fork(); + switch (nextpid) { + case 0: +- return 0; ++ return statuspipe[1]; + case -1: + return -1; + default: +@@ -428,15 +458,29 @@ static int qemudGoDaemon(void) { + + default: + { +- int got, status = 0; +- /* We wait to make sure the next child forked +- successfully */ +- if ((got = waitpid(pid, &status, 0)) < 0 || ++ int got, exitstatus = 0; ++ int ret; ++ char status; ++ ++ close(statuspipe[1]); ++ ++ /* We wait to make sure the first child forked successfully */ ++ if ((got = waitpid(pid, &exitstatus, 0)) < 0 || + got != pid || +- status != 0) { ++ exitstatus != 0) { + return -1; + } +- _exit(0); ++ ++ /* Now block until the second child initializes successfully */ ++ again: ++ ret = read(statuspipe[0], &status, 1); ++ if (ret == -1 && errno == EINTR) ++ goto again; ++ ++ if (ret == 1 && status != 0) { ++ fprintf(stderr, "error: %s\n", virDaemonErrTypeToString(status)); ++ } ++ _exit(ret == 1 && status == 0 ? 0 : 1); + } + } + } +@@ -859,8 +903,6 @@ static struct qemud_server *qemudInitialize(int sigread) { + virEventUpdateTimeoutImpl, + virEventRemoveTimeoutImpl); + +- virStateInitialize(server->privileged); +- + return server; + } + +@@ -2842,6 +2884,7 @@ int main(int argc, char **argv) { + int sigpipe[2]; + const char *pid_file = NULL; + const char *remote_config_file = NULL; ++ int statuswrite = -1; + int ret = 1; + + struct option opts[] = { +@@ -2923,7 +2966,7 @@ int main(int argc, char **argv) { + + if (godaemon) { + char ebuf[1024]; +- if (qemudGoDaemon() < 0) { ++ if ((statuswrite = daemonForkIntoBackground()) < 0) { + VIR_ERROR(_("Failed to fork as daemon: %s"), + virStrerror(errno, ebuf, sizeof ebuf)); + goto error1; +@@ -2938,8 +2981,11 @@ int main(int argc, char **argv) { + + /* If we have a pidfile set, claim it now, exiting if already taken */ + if (pid_file != NULL && +- qemudWritePidFile (pid_file) < 0) ++ qemudWritePidFile (pid_file) < 0) { ++ pid_file = NULL; /* Prevent unlinking of someone else's pid ! */ ++ ret = VIR_DAEMON_ERR_PIDFILE; + goto error1; ++ } + + if (pipe(sigpipe) < 0 || + virSetNonBlock(sigpipe[0]) < 0 || +@@ -2973,7 +3019,8 @@ int main(int argc, char **argv) { + if (mkdir (rundir, 0755)) { + if (errno != EEXIST) { + VIR_ERROR0 (_("unable to create rundir")); +- return -1; ++ ret = VIR_DAEMON_ERR_RUNDIR; ++ goto error1; + } + } + } +@@ -2984,17 +3031,21 @@ int main(int argc, char **argv) { + * which is also passed into all libvirt stateful + * drivers + */ +- if (qemudSetupPrivs() < 0) ++ if (qemudSetupPrivs() < 0) { ++ ret = VIR_DAEMON_ERR_PRIVS; + goto error2; ++ } + + if (!(server = qemudInitialize(sigpipe[0]))) { +- ret = 2; ++ ret = VIR_DAEMON_ERR_INIT; + goto error2; + } + + /* Read the config file (if it exists). */ +- if (remoteReadConfigFile (server, remote_config_file) < 0) ++ if (remoteReadConfigFile (server, remote_config_file) < 0) { ++ ret = VIR_DAEMON_ERR_CONFIG; + goto error2; ++ } + + /* Change the group ownership of /var/run/libvirt to unix_sock_gid */ + if (unix_sock_dir && server->privileged) { +@@ -3013,15 +3064,46 @@ int main(int argc, char **argv) { + } + + if (!(server = qemudNetworkInit(server))) { +- ret = 2; ++ ret = VIR_DAEMON_ERR_NETWORK; + goto error2; + } + +- qemudRunLoop(server); ++ /* Tell parent of daemon that basic initialization is complete ++ * In particular we're ready to accept net connections & have ++ * written the pidfile ++ */ ++ if (statuswrite != -1) { ++ char status = 0; ++ while (write(statuswrite, &status, 1) == -1 && ++ errno == EINTR) ++ ; ++ close(statuswrite); ++ statuswrite = -1; ++ } ++ ++ /* Start the stateful HV drivers ++ * This is delibrately done after telling the parent process ++ * we're ready, since it can take a long time and this will ++ * seriously delay OS bootup process */ ++ if (virStateInitialize(server->privileged) < 0) { ++ VIR_ERROR0("Driver state initialization failed"); ++ goto error2; ++ } + ++ qemudRunLoop(server); + ret = 0; + + error2: ++ if (statuswrite != -1) { ++ if (ret != 0) { ++ /* Tell parent of daemon what failed */ ++ char status = ret; ++ while (write(statuswrite, &status, 1) == -1 && ++ errno == EINTR) ++ ; ++ } ++ close(statuswrite); ++ } + if (server) + qemudCleanup(server); + if (pid_file) +-- --- libvirt-0.7.2.orig/debian/patches/9009-apparmor-lp453335.patch +++ libvirt-0.7.2/debian/patches/9009-apparmor-lp453335.patch @@ -0,0 +1,25 @@ +From: Jamie Strandboge +Subject: [PATCH] AppArmor handling of accesses to readonly files +Origin: d0d4b8ad76d3e8a859ee90701a21a3f003a22c1f +Bug-Ubuntu: https://launchpad.net/bugs/453335 + +* src/security/virt-aa-helper.c: suppress confusing and misleading + apparmor denied message when kvm/qemu tries to open a libvirt specified + readonly file (such as a cdrom) with write permissions. libvirt uses + the readonly attribute for the security driver only, and has no way + of telling kvm/qemu that the device should be opened readonly + +diff -Nur libvirt-0.7.2-3ubuntu1/src/security/virt-aa-helper.c libvirt-0.7.2-3ubuntu1.new/src/security/virt-aa-helper.c +--- libvirt-0.7.2-3ubuntu1/src/security/virt-aa-helper.c 2009-11-30 17:38:32.362166195 -0600 ++++ libvirt-0.7.2-3ubuntu1.new/src/security/virt-aa-helper.c 2009-11-30 17:38:57.580891392 -0600 +@@ -755,6 +755,10 @@ + } + + virBufferVSprintf(buf, " \"%s\" %s,\n", tmp, perms); ++ if (readonly) { ++ virBufferVSprintf(buf, " # don't audit writes to readonly media\n"); ++ virBufferVSprintf(buf, " deny \"%s\" w,\n", tmp); ++ } + + clean: + free(tmp); --- libvirt-0.7.2.orig/debian/patches/series +++ libvirt-0.7.2/debian/patches/series @@ -0,0 +1,25 @@ +0001-remove-RHism.diff.patch +#0002-qemu-disable-network.diff.patch +0003-allow-libvirt-group-to-access-the-socket.patch +0004-fix-Debian-specific-path-to-hvm-loader.patch +0005-Fix-SELinux-linking-issues.patch +0006-Don-t-let-parent-of-daemon-exit-until-basic-initiali.patch +0007-Only-remove-masquerade-roles-for-VIR_NETWORK_FORWARD.patch +0008-Fix-qemu-session.patch +# Ubuntu specific patches: +9000-delayed_iff_up_bridge.patch +9001-dont_clobber_existing_bridges.patch +9002-better_default_uri_virsh.patch +9003-increase-logoutput-timeout.patch +9004-better-default-arch.patch +9005-libvirtd-group-name.patch +9006-increase-unix-socket-timeout.patch +9007-default-config-test-case.patch +9008-apparmor-caps-mockup.patch +9009-apparmor-lp453335.patch +9010-apparmor-lp460271.patch +9011-apparmor-code-cleanups.patch +9012-apparmor-add-virt-aa-helper-test.patch +9013-apparmor-examples.patch +9014-event-fuzz.patch +9015-hal-startup-failure-is-nonfatal.patch --- libvirt-0.7.2.orig/debian/patches/9003-increase-logoutput-timeout.patch +++ libvirt-0.7.2/debian/patches/9003-increase-logoutput-timeout.patch @@ -0,0 +1,13 @@ +Index: libvirt-0.7.2-3ubuntu1/src/qemu/qemu_driver.c +=================================================================== +--- libvirt-0.7.2-3ubuntu1.orig/src/qemu/qemu_driver.c 2009-10-13 15:53:29.000000000 -0500 ++++ libvirt-0.7.2-3ubuntu1/src/qemu/qemu_driver.c 2009-11-30 17:18:35.000000000 -0600 +@@ -1163,7 +1163,7 @@ + + ret = qemudReadLogOutput(conn, vm, logfd, buf, sizeof(buf), + qemudFindCharDevicePTYs, +- "console", 3); ++ "console", 30); + if (close(logfd) < 0) { + char ebuf[4096]; + VIR_WARN(_("Unable to close logfile: %s\n"), --- libvirt-0.7.2.orig/debian/patches/9005-libvirtd-group-name.patch +++ libvirt-0.7.2/debian/patches/9005-libvirtd-group-name.patch @@ -0,0 +1,13 @@ +Index: libvirt-0.6.4/daemon/libvirtd.conf +=================================================================== +--- libvirt-0.6.4.orig/daemon/libvirtd.conf 2009-06-22 11:37:54.420041463 +0200 ++++ libvirt-0.6.4/daemon/libvirtd.conf 2009-06-22 11:38:16.784083328 +0200 +@@ -78,7 +78,7 @@ + # without becoming root. + # + # This is restricted to 'root' by default. +-unix_sock_group = "libvirt" ++unix_sock_group = "libvirtd" + + # Set the UNIX socket permissions for the R/O socket. This is used + # for monitoring VM status only --- libvirt-0.7.2.orig/debian/patches/0008-Fix-qemu-session.patch +++ libvirt-0.7.2/debian/patches/0008-Fix-qemu-session.patch @@ -0,0 +1,55 @@ +From: =?UTF-8?q?Guido=20G=C3=BCnther?= +Date: Sat, 7 Nov 2009 12:48:54 +0100 +Subject: [PATCH] Fix qemu:///session + +Backported from upsgtream's 79218cdd9887b132eb0f29fe2048f89e90beae1 + +Closes: #554869 +--- + src/lxc/lxc_driver.c | 23 +++++++++++++---------- + 1 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c +index 0b614e3..db47555 100644 +--- a/src/lxc/lxc_driver.c ++++ b/src/lxc/lxc_driver.c +@@ -1600,12 +1600,21 @@ static int lxcStartup(int privileged) + * XXX remove this when valgrind is fixed + */ + ld = getenv("LD_PRELOAD"); +- if (ld && strstr(ld, "vgpreload")) +- return -1; ++ if (ld && strstr(ld, "vgpreload")) { ++ VIR_INFO0("Running under valgrind, disabling driver"); ++ return 0; ++ } + +- /* Check that the user is root */ ++ /* Check that the user is root, silently disable if not */ + if (!privileged) { +- return -1; ++ VIR_INFO0("Not running privileged, disabling driver"); ++ return 0; ++ } ++ ++ /* Check that this is a container enabled kernel */ ++ if (lxcContainerAvailable(0) < 0) { ++ VIR_INFO0("LXC support not available in this kernel, disabling driver"); ++ return 0; + } + + if (VIR_ALLOC(lxc_driver) < 0) { +@@ -1617,12 +1626,6 @@ static int lxcStartup(int privileged) + } + lxcDriverLock(lxc_driver); + +- /* Check that this is a container enabled kernel */ +- if (lxcContainerAvailable(0) < 0) { +- VIR_INFO0("LXC support not available in this kernel, disabling driver"); +- goto cleanup; +- } +- + if (VIR_ALLOC(lxc_driver->domainEventCallbacks) < 0) + goto cleanup; + if (!(lxc_driver->domainEventQueue = virDomainEventQueueNew())) +-- --- libvirt-0.7.2.orig/debian/patches/0001-remove-RHism.diff.patch +++ libvirt-0.7.2/debian/patches/0001-remove-RHism.diff.patch @@ -0,0 +1,22 @@ +From: Guido Guenther +Date: Fri, 7 Mar 2008 09:08:25 +0100 +Subject: [PATCH] remove-RHism.diff + +--- + tools/virsh.pod | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/tools/virsh.pod b/tools/virsh.pod +index 55ec64a..a39d1b5 100644 +--- a/tools/virsh.pod ++++ b/tools/virsh.pod +@@ -34,7 +34,7 @@ the program. + + All B operations rely upon the libvirt library. + For any virsh commands to run xend/qemu, or what ever virtual library that libvirt supports. For this reason you should start xend/qemu as a service when your system first boots using xen/qemu. This can usually be done using the command +-B . ++B . + + Most B commands require root privileges to run due to the + communications channels used to talk to the hypervisor. Running as +-- --- libvirt-0.7.2.orig/debian/patches/9007-default-config-test-case.patch +++ libvirt-0.7.2/debian/patches/9007-default-config-test-case.patch @@ -0,0 +1,26 @@ +Index: libvirt-0.7.2/tests/daemon-conf +=================================================================== +--- libvirt-0.7.2.orig/tests/daemon-conf 2009-10-07 05:40:00.000000000 -0500 ++++ libvirt-0.7.2/tests/daemon-conf 2009-12-01 16:07:14.000000000 -0600 +@@ -20,7 +20,7 @@ + conf="$abs_top_srcdir/daemon/libvirtd.conf" + + # Ensure that each commented out PARAMETER = VALUE line has the expected form. +-grep '[a-z_] *= *[^ ]' "$conf" | grep -vE '^#[a-z_]+ = ' \ ++grep '^#' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^#[a-z_]+ = ' \ + && { echo "$0: found unexpected lines (above) in $conf" 1>&2; exit 1; } + + # Start with the sample libvirtd.conf file, uncommenting all real directives. +@@ -81,8 +81,10 @@ + sleep $sleep_secs + kill $pid + +-# Expect an orderly shut-down and successful exit. +-wait $pid || fail=1 ++# Expect an orderly shut-down and successful exit, but do not fail if in a deep directory ++wait $pid || { ++ grep "qemudListenUnix:.* : Path .*/libvirt-sock too long for unix socket" log || fail=1 ++} + + # "cat log" would print this for non-root: + # Cannot set group when not running as root --- libvirt-0.7.2.orig/debian/patches/0002-qemu-disable-network.diff.patch +++ libvirt-0.7.2/debian/patches/0002-qemu-disable-network.diff.patch @@ -0,0 +1,38 @@ +From: Guido Guenther +Date: Fri, 7 Mar 2008 09:08:26 +0100 +Subject: [PATCH] qemu-disable-network.diff + +--- + src/Makefile.am | 3 --- + src/Makefile.in | 3 --- + 2 files changed, 0 insertions(+), 6 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index d0ef7d1..5963a73 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -878,9 +878,6 @@ if WITH_NETWORK + test -z "$(UUID)" || \ + sed -i -e "s,,\n $(UUID)," \ + $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml +- test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \ +- ln -s ../default.xml \ +- $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml + endif + + uninstall-local:: +diff --git a/src/Makefile.in b/src/Makefile.in +index f840a67..acbf648 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -3840,9 +3840,6 @@ install-data-local: + @WITH_NETWORK_TRUE@ test -z "$(UUID)" || \ + @WITH_NETWORK_TRUE@ sed -i -e "s,,\n $(UUID)," \ + @WITH_NETWORK_TRUE@ $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml +-@WITH_NETWORK_TRUE@ test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \ +-@WITH_NETWORK_TRUE@ ln -s ../default.xml \ +-@WITH_NETWORK_TRUE@ $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml + + uninstall-local:: + rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||: +-- --- libvirt-0.7.2.orig/debian/patches/9011-apparmor-code-cleanups.patch +++ libvirt-0.7.2/debian/patches/9011-apparmor-code-cleanups.patch @@ -0,0 +1,161 @@ +From: Jamie Strandboge +Subject: [PATCH] AppArmor code cleanups +Origin: 3cbc05012dd13cb6fff560d75e4c7e4b6c5089ab + +* src/security/security_apparmor.c: a few code cleanups following a + review on the list + +Index: libvirt-0.7.2/src/security/security_apparmor.c +=================================================================== +--- libvirt-0.7.2.orig/src/security/security_apparmor.c 2009-12-02 08:35:33.000000000 -0600 ++++ libvirt-0.7.2/src/security/security_apparmor.c 2009-12-02 08:45:23.000000000 -0600 +@@ -56,13 +56,16 @@ + int rc = -1; + + /* create string that is ' \0' for accurate matching */ +- if (virAsprintf(&tmp, "%s ", str) == -1) ++ if (virAsprintf(&tmp, "%s ", str) == -1) { ++ virReportOOMError(NULL); + return rc; ++ } + + if (check_enforcing != 0) { + /* create string that is ' (enforce)\0' for accurate matching */ + if (virAsprintf(&etmp, "%s (enforce)", str) == -1) { + VIR_FREE(tmp); ++ virReportOOMError(NULL); + return rc; + } + } +@@ -71,8 +74,6 @@ + virReportSystemError(NULL, errno, + _("Failed to read AppArmor profiles list " + "\'%s\'"), APPARMOR_PROFILES_PATH); +- if (check_enforcing != 0) +- VIR_FREE(etmp); + goto clean; + } + +@@ -81,12 +82,12 @@ + if (check_enforcing != 0) { + if (rc == 0 && strstr(content, etmp) != NULL) + rc = 1; /* return '1' if loaded and enforcing */ +- VIR_FREE(etmp); + } + + VIR_FREE(content); + clean: + VIR_FREE(tmp); ++ VIR_FREE(etmp); + + return rc; + } +@@ -104,32 +105,30 @@ + static int + profile_status_file(const char *str) + { +- char profile[PATH_MAX]; ++ char *profile = NULL; + char *content = NULL; + char *tmp = NULL; + int rc = -1; + int len; + +- if (snprintf(profile, PATH_MAX, "%s/%s", APPARMOR_DIR "/libvirt", str) +- > PATH_MAX - 1) { +- virSecurityReportError(NULL, VIR_ERR_ERROR, +- "%s", _("profile name exceeds maximum length")); +- } +- +- if (!virFileExists(profile)) { ++ if (virAsprintf(&profile, "%s/%s", APPARMOR_DIR "/libvirt", str) == -1) { ++ virReportOOMError(NULL); + return rc; + } + ++ if (!virFileExists(profile)) ++ goto failed; ++ + if ((len = virFileReadAll(profile, MAX_FILE_LEN, &content)) < 0) { + virReportSystemError(NULL, errno, + _("Failed to read \'%s\'"), profile); +- return rc; ++ goto failed; + } + + /* create string that is ' flags=(complain)\0' */ + if (virAsprintf(&tmp, " %s flags=(complain)", str) == -1) { + virReportOOMError(NULL); +- goto clean; ++ goto failed; + } + + if (strstr(content, tmp) != NULL) +@@ -137,8 +136,9 @@ + else + rc = 1; + ++ failed: + VIR_FREE(tmp); +- clean: ++ VIR_FREE(profile); + VIR_FREE(content); + + return rc; +@@ -164,7 +164,7 @@ + + xml = virDomainDefFormat(conn, vm->def, VIR_DOMAIN_XML_SECURE); + if (!xml) +- goto failed; ++ goto clean; + + if (profile_status_file(profile) >= 0) + create = false; +@@ -214,7 +214,6 @@ + clean: + VIR_FREE(xml); + +- failed: + if (pipefd[0] > 0) + close(pipefd[0]); + if (pipefd[1] > 0) +@@ -281,26 +280,30 @@ + static int + AppArmorSecurityDriverProbe(void) + { +- char template[PATH_MAX]; ++ char *template = NULL; ++ int rc = SECURITY_DRIVER_DISABLE; + + if (use_apparmor() < 0) +- return SECURITY_DRIVER_DISABLE; ++ return rc; + + /* see if template file exists */ +- if (snprintf(template, PATH_MAX, "%s/TEMPLATE", +- APPARMOR_DIR "/libvirt") > PATH_MAX - 1) { +- virSecurityReportError(NULL, VIR_ERR_ERROR, +- "%s", _("template too large")); +- return SECURITY_DRIVER_DISABLE; ++ if (virAsprintf(&template, "%s/TEMPLATE", ++ APPARMOR_DIR "/libvirt") == -1) { ++ virReportOOMError(NULL); ++ return rc; + } + + if (!virFileExists(template)) { + virSecurityReportError(NULL, VIR_ERR_ERROR, + _("template \'%s\' does not exist"), template); +- return SECURITY_DRIVER_DISABLE; ++ goto clean; + } ++ rc = SECURITY_DRIVER_ENABLE; + +- return SECURITY_DRIVER_ENABLE; ++ clean: ++ VIR_FREE(template); ++ ++ return rc; + } + + /* Security driver initialization. DOI is for 'Domain of Interpretation' and is --- libvirt-0.7.2.orig/debian/patches/9012-apparmor-add-virt-aa-helper-test.patch +++ libvirt-0.7.2/debian/patches/9012-apparmor-add-virt-aa-helper-test.patch @@ -0,0 +1,283 @@ +Author: Jamie Strandboge +Description: add tests/virt-aa-helper-test + This file was mistakenly ommitted from the upstream tarball + +diff -Nur libvirt-0.7.2-3ubuntu1/tests/virt-aa-helper-test libvirt-0.7.2-3ubuntu1.new/tests/virt-aa-helper-test +--- libvirt-0.7.2-3ubuntu1/tests/virt-aa-helper-test 1969-12-31 18:00:00.000000000 -0600 ++++ libvirt-0.7.2-3ubuntu1.new/tests/virt-aa-helper-test 2009-11-30 17:24:11.500898656 -0600 +@@ -0,0 +1,275 @@ ++#!/bin/sh ++set -e ++ ++test_hostdev="no" ++if [ "$1" = "test_hostdev" ]; then ++ test_hostdev="yes" ++ shift ++fi ++ ++output="/dev/null" ++use_valgrind="" ++ld_library_path="../src/.libs/" ++if [ ! -z "$1" ] && [ "$1" = "-d" ]; then ++ output="/dev/stdout" ++ shift ++fi ++ ++exe="../src/virt-aa-helper" ++if [ ! -z "$1" ]; then ++ if [ "$1" = "-v" ]; then ++ use_valgrind="yes" ++ shift ++ fi ++ if [ -n "$1" ]; then ++ exe="$1" ++ shift ++ fi ++fi ++ ++if [ ! -x "$exe" ]; then ++ echo "Could not find '$exe'" ++ exit 1 ++fi ++ ++echo "testing `basename $exe`" >$output ++if [ "$use_valgrind" = "yes" ]; then ++ exe="valgrind --error-exitcode=2 --track-origins=yes $exe" ++fi ++ ++extra_args="--dryrun" ++errors=0 ++ ++tmpdir=`mktemp -d` ++trap "rm -rf $tmpdir" EXIT HUP INT QUIT TERM ++ ++template_xml="$tmpdir/template.xml" ++test_xml="$tmpdir/test.xml" ++ ++uuid="00000000-0000-0000-0000-0123456789ab" ++disk1="$tmpdir/1.img" ++disk2="$tmpdir/2.img" ++relative_disk1="$tmpdir/./../`basename $tmpdir`//./1.img" ++nonexistent="$tmpdir/nonexistant.img" ++bad_disk="/etc/passwd" ++valid_uuid="libvirt-$uuid" ++nonexistent_uuid="libvirt-00000000-0000-0000-0000-000000000001" ++ ++cat > "$template_xml" < ++ virt-aa-helper-test ++ ###UUID### ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/kvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++EOM ++ ++touch "$disk1" "$disk2" ++ ++testme() { ++ expected="$1" ++ outstr="$2" ++ args="$3" ++ input="" ++ ++ if [ -n "$4" ]; then ++ input="$4" ++ if [ ! -e "$input" ]; then ++ echo "FAIL: could not find $input" >$output ++ echo "FAIL: could not find $input" ++ echo " '$extra_args $args': " ++ errors=$(($errors + 1)) ++ fi ++ fi ++ ++ echo -n " $outstr: " >$output ++ echo -n " '$extra_args $args" >$output ++ if [ -n "$input" ]; then ++ echo -n " < $input" >$output ++ fi ++ echo "': " >$output ++ set +e ++ if [ -n "$input" ]; then ++ LD_LIBRARY_PATH="$ld_library_path" $exe $extra_args $args < $input >$output 2>&1 ++ else ++ LD_LIBRARY_PATH="$ld_library_path" $exe $extra_args $args >$output 2>&1 ++ fi ++ rc="$?" ++ set -e ++ if [ "$rc" = "$expected" ]; then ++ echo "pass" >$output ++ else ++ echo "FAIL: exited with '$rc'" >$output ++ echo "FAIL: exited with '$rc'" ++ echo -n " $outstr: " ++ echo " '$extra_args $args': " ++ errors=$(($errors + 1)) ++ #exit $rc ++ fi ++} ++ ++# Expected failures ++echo "Expected failures:" >$output ++testme "1" "invalid arg" "-z" ++testme "1" "invalid case" "-A" ++testme "1" "not enough args" "-c" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" > "$test_xml" ++testme "1" "no -u with -c" "-c" "$test_xml" ++testme "1" "bad uuid (bad digit)" "-c -u libvirt-00000000-0000-0000-0000-00000000000g" "$test_xml" ++testme "1" "bad uuid (too long)" "-c -u ${valid_uuid}abcdef" "$test_xml" ++testme "1" "bad uuid (too short)" "-c -u libvirt-00000000-0000-0000-0000-0123456789a" "$test_xml" ++testme "1" "non-matching uuid" "-c -u libvirt-00000000-0000-0000-0000-00000000000a" "$test_xml" ++testme "1" "missing uuid" "-c -u" "$test_xml" ++testme "1" "no -u with -R" "-R" ++testme "1" "non-existent uuid" "-R -u $nonexistent_uuid" ++testme "1" "no -u with -r" "-r" ++testme "1" "old '-n' option" "-c -n foo -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$bad_disk,g" > "$test_xml" ++testme "1" "bad disk" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$bad_disk,g" | sed "s,,,g" > "$test_xml" ++testme "1" "bad disk2" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++testme "1" "malformed xml" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,/boot/initrd,g" > "$test_xml" ++testme "1" "disk in /boot" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,/boot/initrd,g" > "$test_xml" ++testme "1" "-r with invalid -f" "-r -u $valid_uuid -f $bad_disk" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" > "$test_xml" ++testme "1" "-c with malformed xml" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,hvm,,g" > "$test_xml" ++testme "1" "-c with no os.type" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,hvm,hvm,g" > "$test_xml" ++testme "1" "-c with no architecture" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,hvm,hvm_invalid,g" > "$test_xml" ++testme "1" "-c with invalid hvm" "-c -u $valid_uuid" "$test_xml" ++ ++ ++echo "Expected pass:" >$output ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" > "$test_xml" ++testme "0" "create (x86_64)" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,arch='x86_64',arch='i686',g" > "$test_xml" ++testme "0" "create (i686)" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,arch='x86_64',arch='ppc',g" > "$test_xml" ++testme "0" "create (ppc)" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++testme "0" "create multiple disks" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###',${disk1}'/> "$test_xml" ++testme "0" "create (readonly)" "-c -u $valid_uuid" "$test_xml" ++ ++if [ "$test_hostdev" = "yes" ]; then ++ cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,
,g" > "$test_xml" ++ testme "0" "create hostdev (USB)" "-c -u $valid_uuid" "$test_xml" ++ ++ cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,
,g" > "$test_xml" ++ testme "0" "create hostdev (PCI)" "-c -u $valid_uuid" "$test_xml" ++fi ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$nonexistent,g" > "$test_xml" ++testme "0" "create (non-existent disk)" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$relative_disk1,g" > "$test_xml" ++testme "0" "create (relative path)" "-c -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk2,g" > "$test_xml" ++testme "0" "replace" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$nonexistent,g" > "$test_xml" ++testme "0" "replace (non-existent disk)" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" > "$test_xml" ++testme "0" "replace (adding disk)" "-r -u $valid_uuid -f $disk2" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" > "$test_xml" ++testme "0" "replace (adding non-existent disk)" "-r -u $valid_uuid -f $nonexistent" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++testme "0" "disk (empty cdrom)" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++testme "0" "serial" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++testme "0" "serial (pty)" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++touch "$tmpdir/console.log" ++testme "0" "console" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,,g" > "$test_xml" ++testme "0" "console (pty)" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,$tmpdir/kernel,g" > "$test_xml" ++touch "$tmpdir/kernel" ++testme "0" "kernel" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,$tmpdir/initrd,g" > "$test_xml" ++touch "$tmpdir/initrd" ++testme "0" "initrd" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,/boot/kernel,g" > "$test_xml" ++testme "0" "kernel in /boot" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,/boot/initrd,g" > "$test_xml" ++testme "0" "initrd in /boot" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,/vmlinuz,g" > "$test_xml" ++testme "0" "kernel is /vmlinuz" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,/initrd/ramdisk,g" > "$test_xml" ++testme "0" "initrd is /initrd/ramdisk" "-r -u $valid_uuid" "$test_xml" ++ ++cat "$template_xml" | sed "s,###UUID###,$uuid,g" | sed "s,###DISK###,$disk1,g" | sed "s,,/initrd.img,g" > "$test_xml" ++testme "0" "initrd is /initrd.img" "-r -u $valid_uuid" "$test_xml" ++ ++testme "0" "help" "-h" ++ ++echo "" >$output ++if [ "$errors" != "0" ]; then ++ echo "FAIL: $errors error(s)" >$output ++ exit 1 ++fi ++echo PASS >$output