--- libvirt-0.4.6.orig/debian/README.Debian +++ libvirt-0.4.6/debian/README.Debian @@ -0,0 +1,56 @@ +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 "Acess 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, bridge-utils and iptables installed. However Debian's default dnsmasq +configuration conflicts with the way libvirtd wants to invoke it. You have two +possibilities: + + * don't start dnsmasq via /etc/init.d/dnsmasq during system startup and let + libvirtd handle dnsmasq completely + + * use "interface=lo" and "bind-interfaces" in dnsmasq.conf + +See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504605 for more information. + +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 --- libvirt-0.4.6.orig/debian/README.source +++ libvirt-0.4.6/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.4.6.orig/debian/changelog +++ libvirt-0.4.6/debian/changelog @@ -0,0 +1,370 @@ +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-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-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.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-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-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.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-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.4.6.orig/debian/compat +++ libvirt-0.4.6/debian/compat @@ -0,0 +1 @@ +5 --- libvirt-0.4.6.orig/debian/control +++ libvirt-0.4.6/debian/control @@ -0,0 +1,88 @@ +Source: libvirt +Section: libs +Priority: optional +Maintainer: Debian Libvirt Maintainers +Uploaders: Guido Günther +Build-Depends: cdbs (>= 0.4.43), debhelper (>= 5.0.38), libxml2-dev, libncurses5-dev, libreadline5-dev, zlib1g-dev, libgnutls-dev, python-dev (>= 2.3.5-11), python-central (>= 0.5.6), quilt, libavahi-client-dev, libsasl2-dev, libxen-dev [i386 amd64], lvm2, qemu [amd64 i386 powerpc sparc], libpolkit-dbus-dev, open-iscsi, libparted1.8-dev, libselinux1-dev +XS-Python-Version: current +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.0 + +Package: libvirt-bin +Architecture: any +Depends: ${shlibs:Depends}, adduser, libvirt0 (>= ${binary:Version}), logrotate +Enhances: qemu, kvm, xen +Section: admin +Recommends: netcat-openbsd, bridge-utils, dnsmasq, iptables, qemu (>= 0.9.1) +Suggests: policykit +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, and XEN. + . + This package contains the supporting binaries to use with libvirt + +Package: libvirt0 +Architecture: any +Depends: ${shlibs:Depends} +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}, libvirt0 (= ${binary:Version}) +Priority: extra +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. + . + This package contains the debugging symbols. + +Package: libvirt-doc +Architecture: all +Section: doc +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, and XEN. + . + This package contains the documentation. + +Package: libvirt-dev +Architecture: any +Section: libdevel +Depends: libvirt0 (= ${binary:Version}), libxen-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, and XEN. + . + 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}, ${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, and XEN. + . + This package contains Python bindings for the libvirt library + --- libvirt-0.4.6.orig/debian/copyright +++ libvirt-0.4.6/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.4.6.orig/debian/libvirt-bin.default +++ libvirt-0.4.6/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.4.6.orig/debian/libvirt-bin.dirs +++ libvirt-0.4.6/debian/libvirt-bin.dirs @@ -0,0 +1,4 @@ +/var/run/libvirt +/var/lib/libvirt/images +/var/lib/libvirt/boot +/var/cache/libvirt --- libvirt-0.4.6.orig/debian/libvirt-bin.examples +++ libvirt-0.4.6/debian/libvirt-bin.examples @@ -0,0 +1,5 @@ +qemud/libvirtd.policy +qemud/libvirtd.sasl +qemud/libvirtd.conf +debian/libvirt-suspendonreboot + --- libvirt-0.4.6.orig/debian/libvirt-bin.init +++ libvirt-0.4.6/debian/libvirt-bin.init @@ -0,0 +1,159 @@ +#! /bin/sh +# +# Init skript for libvirtd +# +# (c) 2007 Guido Guenther +# based on the skeletons that comes with dh_make +# +### BEGIN INIT INFO +# Provides: libvirtd +# Required-Start: $network $local_fs +# Required-Stop: +# 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 + +set -e + +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 + running && log_end_msg 0 || log_end_msg 1 + 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 + ! running && log_end_msg 0 || log_end_msg 1 + ;; + 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 + running && log_end_msg 0 || log_end_msg 1 + 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.4.6.orig/debian/libvirt-bin.install +++ libvirt-0.4.6/debian/libvirt-bin.install @@ -0,0 +1,5 @@ +usr/bin/* +usr/sbin/* +etc/libvirt/* +etc/sasl2/* +usr/share/PolicyKit/* --- libvirt-0.4.6.orig/debian/libvirt-bin.manpages +++ libvirt-0.4.6/debian/libvirt-bin.manpages @@ -0,0 +1 @@ +virsh.1 --- libvirt-0.4.6.orig/debian/libvirt-bin.postinst +++ libvirt-0.4.6/debian/libvirt-bin.postinst @@ -0,0 +1,44 @@ +#!/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 libvirt >/dev/null; then + addgroup --system libvirt + 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.4.6.orig/debian/libvirt-bin.postrm +++ libvirt-0.4.6/debian/libvirt-bin.postrm @@ -0,0 +1,45 @@ +#!/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 libvirt >/dev/null; then + delgroup libvirt || true + fi + + ;; + 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.4.6.orig/debian/libvirt-dev.install +++ libvirt-0.4.6/debian/libvirt-dev.install @@ -0,0 +1,4 @@ +usr/lib/libvirt.so +usr/lib/libvirt.a +usr/include/* +usr/lib/pkgconfig/* --- libvirt-0.4.6.orig/debian/libvirt-doc.doc-base.libvirt-doc +++ libvirt-0.4.6/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: Administration + +Format: HTML +Index: /usr/share/doc/libvirt-doc/intro.html +Files: /usr/share/doc/libvirt-doc/*.html --- libvirt-0.4.6.orig/debian/libvirt-doc.docs +++ libvirt-0.4.6/debian/libvirt-doc.docs @@ -0,0 +1,8 @@ +docs/*.rng +docs/*.png +docs/*.xml +docs/*.html +docs/*.gif +docs/examples/ +docs/html/ +docs/devhelp/ --- libvirt-0.4.6.orig/debian/libvirt-doc.links +++ libvirt-0.4.6/debian/libvirt-doc.links @@ -0,0 +1 @@ +usr/share/doc/libvirt-doc/devhelp/ /usr/share/gtk-doc/html/libvirt --- libvirt-0.4.6.orig/debian/libvirt0.install +++ libvirt-0.4.6/debian/libvirt0.install @@ -0,0 +1,2 @@ +usr/lib/libvirt.so.* + --- libvirt-0.4.6.orig/debian/pycompat +++ libvirt-0.4.6/debian/pycompat @@ -0,0 +1 @@ +2 --- libvirt-0.4.6.orig/debian/python-libvirt.install +++ libvirt-0.4.6/debian/python-libvirt.install @@ -0,0 +1,2 @@ +usr/lib/python*/*/*.so +usr/lib/python*/*/*.py --- libvirt-0.4.6.orig/debian/rules +++ libvirt-0.4.6/debian/rules @@ -0,0 +1,44 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM=pycentral +DEB_DH_INSTALL_SOURCEDIR = debian/tmp + +ifneq (,$(findstring $(DEB_HOST_ARCH), i386 amd64)) + BUILD_XEN=--with-xen +else + BUILD_XEN=--without-xen +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 \ + --without-openvz \ + --without-lxc \ + --with-avahi \ + --with-sasl \ + --with-polkit \ + --with-storage-fs \ + --with-storage-lvm \ + --with-storage-iscsi \ + --with-storage-disk \ + --with-init-scripts=none \ + --without-numactl \ + --enable-debug \ + $(BUILD_XEN) + +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.4.6)' +DEB_DH_INSTALLINIT_ARGS := --no-restart-on-upgrade +DEB_DH_INSTALLLOGROTATE_ARGS := --name=libvirtd + +EXAMPLES=debian/libvirt-doc/usr/share/doc/libvirt-doc/examples/ + +binary-install/libvirt-doc:: + cd $(EXAMPLES) && rm -rf .libs *.o info1 suspend ../html/CVS --- libvirt-0.4.6.orig/debian/watch +++ libvirt-0.4.6/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.4.6.orig/debian/libvirt-suspendonreboot +++ libvirt-0.4.6/debian/libvirt-suspendonreboot @@ -0,0 +1,41 @@ +#! /bin/bash + +# (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 21 19 +# 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.4.6.orig/debian/libvirt-bin.libvirtd.logrotate +++ libvirt-0.4.6/debian/libvirt-bin.libvirtd.logrotate @@ -0,0 +1,8 @@ +/var/log/libvirt/qemu/*.log { + daily + missingok + rotate 7 + compress + delaycompress + copytruncate +} --- libvirt-0.4.6.orig/debian/patches/series +++ libvirt-0.4.6/debian/patches/series @@ -0,0 +1,11 @@ +0001-remove-RHism.diff.patch +0002-qemu-disable-network.diff.patch +0003-allow-libvirt-group-to-access-the-socket.patch +0004-support-virtio-and-scsi-disks-in-qemudDomainBlockSta.patch +0005-fix-define-vs.-defined-typos.patch +0006-xen-prefer-xenstoraged-driver-for-listDomains.patch +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 +0011-Fix-segfault-on-missing-volume-format.patch --- libvirt-0.4.6.orig/debian/patches/0001-remove-RHism.diff.patch +++ libvirt-0.4.6/debian/patches/0001-remove-RHism.diff.patch @@ -0,0 +1,25 @@ +From dd53d550311316241c3999ff5573ab88d9825319 Mon Sep 17 00:00:00 2001 +From: Guido Guenther +Date: Fri, 7 Mar 2008 09:08:25 +0100 +Subject: [PATCH] remove-RHism.diff + +--- + virsh.1 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/virsh.1 b/virsh.1 +index 063dde7..751c6aa 100644 +--- a/virsh.1 ++++ b/virsh.1 +@@ -164,7 +164,7 @@ the program. + .IX Header "NOTES" + All \fBvirsh\fR 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 +-\&\fBservice start libvirtd\fR . ++\&\fB/etc/init.d/libvirt-bin start\fR . + .PP + Most \fBvirsh\fR commands require root privileges to run due to the + communications channels used to talk to the hypervisor. Running as +-- +1.5.6.5 + --- libvirt-0.4.6.orig/debian/patches/0002-qemu-disable-network.diff.patch +++ libvirt-0.4.6/debian/patches/0002-qemu-disable-network.diff.patch @@ -0,0 +1,41 @@ +From f7cfb3813be36f8178392e0d313935d4fd97e49a Mon Sep 17 00:00:00 2001 +From: Guido Guenther +Date: Fri, 7 Mar 2008 09:08:26 +0100 +Subject: [PATCH] qemu-disable-network.diff + +--- + qemud/Makefile.am | 3 --- + qemud/Makefile.in | 3 --- + 2 files changed, 0 insertions(+), 6 deletions(-) + +diff --git a/qemud/Makefile.am b/qemud/Makefile.am +index 5d6ff63..29ff58c 100644 +--- a/qemud/Makefile.am ++++ b/qemud/Makefile.am +@@ -107,9 +107,6 @@ install-data-local: install-init install-data-sasl install-data-polkit + $(DESTDIR)$(sysconfdir)/$(default_xml_dest) + sed -i -e "s,,\n $(UUID)," \ + $(DESTDIR)$(sysconfdir)/$(default_xml_dest) +- test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \ +- ln -s ../default.xml \ +- $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml + mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu + mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt + mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt +diff --git a/qemud/Makefile.in b/qemud/Makefile.in +index 6b7cefe..7293b86 100644 +--- a/qemud/Makefile.in ++++ b/qemud/Makefile.in +@@ -1092,9 +1092,6 @@ remote_protocol.c: remote_protocol.h + @WITH_LIBVIRTD_TRUE@ $(DESTDIR)$(sysconfdir)/$(default_xml_dest) + @WITH_LIBVIRTD_TRUE@ sed -i -e "s,,\n $(UUID)," \ + @WITH_LIBVIRTD_TRUE@ $(DESTDIR)$(sysconfdir)/$(default_xml_dest) +-@WITH_LIBVIRTD_TRUE@ test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \ +-@WITH_LIBVIRTD_TRUE@ ln -s ../default.xml \ +-@WITH_LIBVIRTD_TRUE@ $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml + @WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu + @WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt + @WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt +-- +1.5.6.5 + --- libvirt-0.4.6.orig/debian/patches/0003-allow-libvirt-group-to-access-the-socket.patch +++ libvirt-0.4.6/debian/patches/0003-allow-libvirt-group-to-access-the-socket.patch @@ -0,0 +1,52 @@ +From 1dcda30d8561d13c6f6aa18c98a0403990033d35 Mon Sep 17 00:00:00 2001 +From: Guido Guenther +Date: Thu, 26 Jun 2008 20:01:38 +0200 +Subject: [PATCH] allow libvirt group to access the socket + +--- + qemud/libvirtd.conf | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/qemud/libvirtd.conf b/qemud/libvirtd.conf +index c323185..cff232d 100644 +--- a/qemud/libvirtd.conf ++++ b/qemud/libvirtd.conf +@@ -75,7 +75,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 +@@ -92,7 +92,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" + + + +@@ -122,7 +122,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 +@@ -131,7 +131,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. + # +-- +1.5.6.5 + --- libvirt-0.4.6.orig/debian/patches/0004-support-virtio-and-scsi-disks-in-qemudDomainBlockSta.patch +++ libvirt-0.4.6/debian/patches/0004-support-virtio-and-scsi-disks-in-qemudDomainBlockSta.patch @@ -0,0 +1,38 @@ +From b52ad525b45385d20a827becc055621c70a12b3b Mon Sep 17 00:00:00 2001 +From: Guido Guenther +Date: Thu, 2 Oct 2008 21:12:20 +0200 +Subject: [PATCH] support virtio and scsi disks in qemudDomainBlockStats + +--- + src/qemu_driver.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/src/qemu_driver.c b/src/qemu_driver.c +index 9d8f75a..58530aa 100644 +--- a/src/qemu_driver.c ++++ b/src/qemu_driver.c +@@ -3416,6 +3416,8 @@ qemudDomainBlockStats (virDomainPtr dom, + * hd[a-] to ide0-hd[0-] + * cdrom to ide1-cd0 + * fd[a-] to floppy[0-] ++ * vd[a-] to virtio[0-] ++ * sd[a-] to scsi0-hd[0-] + */ + if (STRPREFIX (path, "hd") && c_islower(path[2])) + snprintf (qemu_dev_name, sizeof (qemu_dev_name), +@@ -3425,6 +3427,12 @@ qemudDomainBlockStats (virDomainPtr dom, + else if (STRPREFIX (path, "fd") && c_islower(path[2])) + snprintf (qemu_dev_name, sizeof (qemu_dev_name), + "floppy%d", path[2] - 'a'); ++ else if (STRPREFIX (path, "vd") && c_islower(path[2])) ++ snprintf (qemu_dev_name, sizeof (qemu_dev_name), ++ "virtio%d", path[2] - 'a'); ++ else if (STRPREFIX (path, "sd") && c_islower(path[2])) ++ snprintf (qemu_dev_name, sizeof (qemu_dev_name), ++ "scsi0-hd%d", path[2] - 'a'); + else { + qemudReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_ARG, + _("invalid path: %s"), path); +-- +1.6.0.1 + --- libvirt-0.4.6.orig/debian/patches/0005-fix-define-vs.-defined-typos.patch +++ libvirt-0.4.6/debian/patches/0005-fix-define-vs.-defined-typos.patch @@ -0,0 +1,69 @@ +From 049aa77897ca49732101e39ccd63b6fc8a29a94c Mon Sep 17 00:00:00 2001 +From: Martin Michlmayr +Date: Fri, 14 Nov 2008 14:50:32 +0100 +Subject: [PATCH] fix #define vs. #defined typos + +affects non linux architectures and fixes the build with gcc 4.4 + +Closes: #505607 +--- + src/xen_internal.c | 8 ++++---- + src/xs_internal.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/xen_internal.c b/src/xen_internal.c +index 3cfc5e3..d80ecfb 100644 +--- a/src/xen_internal.c ++++ b/src/xen_internal.c +@@ -73,7 +73,7 @@ typedef struct v1_hypercall_struct + #define XEN_V1_IOCTL_HYPERCALL_CMD \ + _IOC(_IOC_NONE, 'P', 0, sizeof(v1_hypercall_t)) + typedef v1_hypercall_t hypercall_t; +-#elif define(__sun__) ++#elif defined(__sun__) + typedef privcmd_hypercall_t hypercall_t; + #else + #error "unsupported platform" +@@ -338,7 +338,7 @@ lock_pages(void *addr, size_t len) + { + #ifdef __linux__ + return (mlock(addr, len)); +-#elif define(__sun) ++#elif defined(__sun) + return (0); + #endif + } +@@ -348,7 +348,7 @@ unlock_pages(void *addr, size_t len) + { + #ifdef __linux__ + return (munlock(addr, len)); +-#elif define(__sun) ++#elif defined(__sun) + return (0); + #endif + } +@@ -664,7 +664,7 @@ typedef struct xen_op_v2_dom xen_op_v2_dom; + #define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd" + #define HYPERVISOR_CAPABILITIES "/sys/hypervisor/properties/capabilities" + #define CPUINFO "/proc/cpuinfo" +-#elif define(__sun__) ++#elif defined(__sun__) + #define XEN_HYPERVISOR_SOCKET "/dev/xen/privcmd" + #define HYPERVISOR_CAPABILITIES "" + #define CPUINFO "/dev/cpu/self/cpuid" +diff --git a/src/xs_internal.c b/src/xs_internal.c +index 316604a..3cb67db 100644 +--- a/src/xs_internal.c ++++ b/src/xs_internal.c +@@ -34,7 +34,7 @@ + + #ifdef __linux__ + #define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd" +-#elif define(__sun__) ++#elif defined(__sun__) + #define XEN_HYPERVISOR_SOCKET "/dev/xen/privcmd" + #else + #error "unsupported platform" +-- +1.6.0.3 + --- libvirt-0.4.6.orig/debian/patches/0006-xen-prefer-xenstoraged-driver-for-listDomains.patch +++ libvirt-0.4.6/debian/patches/0006-xen-prefer-xenstoraged-driver-for-listDomains.patch @@ -0,0 +1,116 @@ +From 20cd80189d752d5dc630afa8d29a3ebf0ac51649 Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Guido=20G=C3=BCnther?= +Date: Wed, 26 Nov 2008 10:54:51 +0100 +Subject: [PATCH] xen: prefer xenstoraged driver for listDomains + +at least Debian's xen 3.2.1 reports ghost ids of already shutdown domains when +using the HV driver. +--- + src/proxy_internal.c | 3 +-- + src/proxy_internal.h | 2 ++ + src/xen_unified.c | 29 +++++++++++++++++++++++------ + src/xend_internal.c | 2 +- + src/xend_internal.h | 1 + + 5 files changed, 28 insertions(+), 9 deletions(-) + +diff --git a/src/proxy_internal.c b/src/proxy_internal.c +index 1378559..daf1193 100644 +--- a/src/proxy_internal.c ++++ b/src/proxy_internal.c +@@ -37,7 +37,6 @@ static int xenProxyOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr aut + static int xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer); + static int xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info); + static char *xenProxyGetCapabilities(virConnectPtr conn); +-static int xenProxyListDomains(virConnectPtr conn, int *ids, int maxids); + static int xenProxyNumOfDomains(virConnectPtr conn); + static unsigned long xenProxyDomainGetMaxMemory(virDomainPtr domain); + static int xenProxyDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info); +@@ -581,7 +580,7 @@ xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer) + * + * Returns the number of domain found or -1 in case of error + */ +-static int ++int + xenProxyListDomains(virConnectPtr conn, int *ids, int maxids) + { + virProxyPacket req; +diff --git a/src/proxy_internal.h b/src/proxy_internal.h +index 0e66c1c..693b10b 100644 +--- a/src/proxy_internal.h ++++ b/src/proxy_internal.h +@@ -94,4 +94,6 @@ extern virDomainPtr xenProxyLookupByName(virConnectPtr conn, + + extern char * xenProxyDomainDumpXML(virDomainPtr domain, + int flags); ++extern int xenProxyListDomains(virConnectPtr conn, int *ids, ++ int maxids); + #endif /* __LIBVIR_PROXY_H__ */ +diff --git a/src/xen_unified.c b/src/xen_unified.c +index 5807391..0fb5d73 100644 +--- a/src/xen_unified.c ++++ b/src/xen_unified.c +@@ -485,14 +485,31 @@ static int + xenUnifiedListDomains (virConnectPtr conn, int *ids, int maxids) + { + GET_PRIVATE(conn); +- int i, ret; ++ int ret; + +- for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) +- if (priv->opened[i] && drivers[i]->listDomains) { +- ret = drivers[i]->listDomains (conn, ids, maxids); +- if (ret >= 0) return ret; +- } ++ /* Try xenstore. */ ++ if (priv->opened[XEN_UNIFIED_XS_OFFSET]) { ++ ret = xenStoreListDomains (conn, ids, maxids); ++ if (ret >= 0) return ret; ++ } + ++ /* Try HV. */ ++ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { ++ ret = xenHypervisorListDomains (conn, ids, maxids); ++ if (ret >= 0) return ret; ++ } ++ ++ /* Try xend. */ ++ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { ++ ret = xenDaemonListDomains (conn, ids, maxids); ++ if (ret >= 0) return ret; ++ } ++ ++ /* Try proxy. */ ++ if (priv->opened[XEN_UNIFIED_PROXY_OFFSET]) { ++ ret = xenProxyListDomains (conn, ids, maxids); ++ if (ret >= 0) return ret; ++ } + return -1; + } + +diff --git a/src/xend_internal.c b/src/xend_internal.c +index 2e1a8d1..9f1ad42 100644 +--- a/src/xend_internal.c ++++ b/src/xend_internal.c +@@ -3455,7 +3455,7 @@ xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer) + * + * Returns the number of domain found or -1 in case of error + */ +-static int ++int + xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids) + { + struct sexpr *root = NULL; +diff --git a/src/xend_internal.h b/src/xend_internal.h +index 12fa379..af90290 100644 +--- a/src/xend_internal.h ++++ b/src/xend_internal.h +@@ -178,5 +178,6 @@ int xenDaemonDomainMigratePrepare (virConnectPtr dconn, char **cookie, int *cook + int xenDaemonDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, const char *uri, unsigned long flags, const char *dname, unsigned long resource); + + int xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, unsigned long long offset, size_t size, void *buffer); ++int xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids); + + #endif /* __XEND_INTERNAL_H_ */ +-- +1.6.0.3 + --- libvirt-0.4.6.orig/debian/patches/0007-also-look-for-usr-bin-kvm.patch +++ libvirt-0.4.6/debian/patches/0007-also-look-for-usr-bin-kvm.patch @@ -0,0 +1,24 @@ +From de516e669fcc0e4d1268698dd0a48e9c79da1eaf Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Guido=20G=C3=BCnther?= +Date: Thu, 4 Dec 2008 11:51:13 +0100 +Subject: [PATCH] also look for /usr/bin/kvm + +--- + src/qemu_driver.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/src/qemu_driver.c b/src/qemu_driver.c +index 58530aa..0d5e768 100644 +--- a/src/qemu_driver.c ++++ b/src/qemu_driver.c +@@ -1749,6 +1749,7 @@ static const char *qemudProbe(void) + { + if ((virFileExists("/usr/bin/qemu")) || + (virFileExists("/usr/bin/qemu-kvm")) || ++ (virFileExists("/usr/bin/kvm")) || + (virFileExists("/usr/bin/xenner"))) { + if (getuid() == 0) { + return("qemu:///system"); +-- +1.6.0.3 + --- libvirt-0.4.6.orig/debian/patches/0008-Increase-initial-qemu-monitor-read-timeout.patch +++ libvirt-0.4.6/debian/patches/0008-Increase-initial-qemu-monitor-read-timeout.patch @@ -0,0 +1,64 @@ +From b797c0fc100d75b8252b594670d007db888a10bd Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Mon, 1 Dec 2008 17:36:51 -0500 +Subject: [PATCH] Increase initial qemu monitor read timeout + +Closes: #499720 +--- + src/qemu_driver.c | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/src/qemu_driver.c b/src/qemu_driver.c +index 0d5e768..ffe2dd2 100644 +--- a/src/qemu_driver.c ++++ b/src/qemu_driver.c +@@ -418,9 +418,9 @@ qemudReadMonitorOutput(virConnectPtr conn, + char *buf, + int buflen, + qemudHandlerMonitorOutput func, +- const char *what) ++ const char *what, ++ int timeout) + { +-#define MONITOR_TIMEOUT 3000 + int got = 0; + buf[0] = '\0'; + +@@ -446,7 +446,7 @@ qemudReadMonitorOutput(virConnectPtr conn, + return -1; + } + +- ret = poll(&pfd, 1, MONITOR_TIMEOUT); ++ ret = poll(&pfd, 1, timeout); + if (ret == 0) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("Timed out while reading %s startup output"), what); +@@ -480,7 +480,6 @@ qemudReadMonitorOutput(virConnectPtr conn, + _("Out of space while reading %s startup output"), what); + return -1; + +-#undef MONITOR_TIMEOUT + } + + static int +@@ -526,7 +525,7 @@ static int qemudOpenMonitor(virConnectPtr conn, + driver, vm, monfd, + buf, sizeof(buf), + qemudCheckMonitorPrompt, +- "monitor"); ++ "monitor", 10000); + + /* Keep monitor open upon success */ + if (ret == 0) +@@ -640,7 +639,7 @@ static int qemudWaitForMonitor(virConnectPtr conn, + driver, vm, vm->stderr_fd, + buf, sizeof(buf), + qemudFindCharDevicePTYs, +- "console"); ++ "console", 3000); + + buf[sizeof(buf)-1] = '\0'; + +-- +1.6.0.3 + --- libvirt-0.4.6.orig/debian/patches/0009-Open-qemu-monitor-log-O_APPEND-instead-of-O_TRUNC.patch +++ libvirt-0.4.6/debian/patches/0009-Open-qemu-monitor-log-O_APPEND-instead-of-O_TRUNC.patch @@ -0,0 +1,27 @@ +From 1aa12b4920dba52405fcdde02953e3ca15cec398 Mon Sep 17 00:00:00 2001 +From: Harald Staub +Date: Tue, 2 Dec 2008 13:14:33 +0100 +Subject: [PATCH] Open qemu monitor log O_APPEND instead of O_TRUNC + +makes logrotate work (O_APPEND) and keeps old log information (!O_TRUNC) +(#507553) +--- + src/qemu_driver.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/qemu_driver.c b/src/qemu_driver.c +index ffe2dd2..c9bf8d7 100644 +--- a/src/qemu_driver.c ++++ b/src/qemu_driver.c +@@ -894,7 +894,7 @@ static int qemudStartVMDaemon(virConnectPtr conn, + return -1; + } + +- if ((vm->logfile = open(logfile, O_CREAT | O_TRUNC | O_WRONLY, ++ if ((vm->logfile = open(logfile, O_CREAT | O_APPEND | O_WRONLY, + S_IRUSR | S_IWUSR)) < 0) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("failed to create logfile %s: %s"), +-- +1.6.0.3 + --- libvirt-0.4.6.orig/debian/patches/0010-raise-error-on-invalid-volume-format.patch +++ libvirt-0.4.6/debian/patches/0010-raise-error-on-invalid-volume-format.patch @@ -0,0 +1,25 @@ +From ed71be2693133d640b4a99eb4b6f90c51bdffff8 Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Guido=20G=C3=BCnther?= +Date: Thu, 4 Dec 2008 16:22:52 +0100 +Subject: [PATCH] raise error on invalid volume format + +--- + src/storage_conf.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/src/storage_conf.c b/src/storage_conf.c +index 29d74c8..f0d2b94 100644 +--- a/src/storage_conf.c ++++ b/src/storage_conf.c +@@ -753,6 +753,8 @@ virStorageVolDefParseDoc(virConnectPtr conn, + if (options->formatFromString) { + char *format = virXPathString(conn, "string(/volume/target/format/@type)", ctxt); + if ((ret->target.format = (options->formatFromString)(conn, format)) < 0) { ++ virStorageReportError(conn, VIR_ERR_XML_ERROR, ++ _("unknown volume format type %s"), format); + VIR_FREE(format); + goto cleanup; + } +-- +1.6.0.3 + --- libvirt-0.4.6.orig/debian/patches/0011-Fix-segfault-on-missing-volume-format.patch +++ libvirt-0.4.6/debian/patches/0011-Fix-segfault-on-missing-volume-format.patch @@ -0,0 +1,29 @@ +From 9533ab9556ddf15435944ec03f6ab1730fb2e279 Mon Sep 17 00:00:00 2001 +From: Daniel Veillard +Date: Thu, 4 Dec 2008 16:26:31 +0100 +Subject: [PATCH] Fix segfault on missing volume format + +Closes: #507677 +--- + src/storage_conf.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/src/storage_conf.c b/src/storage_conf.c +index f0d2b94..c22889f 100644 +--- a/src/storage_conf.c ++++ b/src/storage_conf.c +@@ -752,6 +752,11 @@ virStorageVolDefParseDoc(virConnectPtr conn, + ret->target.path = virXPathString(conn, "string(/volume/target/path)", ctxt); + if (options->formatFromString) { + char *format = virXPathString(conn, "string(/volume/target/format/@type)", ctxt); ++ if (format == NULL) { ++ virStorageReportError(conn, VIR_ERR_XML_ERROR, ++ _("cannot guess missing format type for target")); ++ goto cleanup; ++ } + if ((ret->target.format = (options->formatFromString)(conn, format)) < 0) { + virStorageReportError(conn, VIR_ERR_XML_ERROR, + _("unknown volume format type %s"), format); +-- +1.6.0.3 +