--- libvirt-0.6.1.orig/debian/libvirt-bin.libvirtd.logrotate
+++ libvirt-0.6.1/debian/libvirt-bin.libvirtd.logrotate
@@ -0,0 +1,8 @@
+/var/log/libvirt/qemu/*.log {
+        daily
+        missingok
+        rotate 7
+        compress
+        delaycompress
+        copytruncate
+}
--- libvirt-0.6.1.orig/debian/libvirt-bin.examples
+++ libvirt-0.6.1/debian/libvirt-bin.examples
@@ -0,0 +1,5 @@
+qemud/libvirtd.policy
+qemud/libvirtd.sasl
+qemud/libvirtd.conf
+debian/libvirt-suspendonreboot
+
--- libvirt-0.6.1.orig/debian/rules
+++ libvirt-0.6.1/debian/rules
@@ -0,0 +1,45 @@
+#!/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              \
+	--with-openvz            \
+	--without-lxc            \
+	--with-avahi             \
+	--with-sasl              \
+	--with-polkit		 \
+        --with-hal		 \
+        --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.5.0)'
+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.6.1.orig/debian/libvirt-bin.postinst
+++ libvirt-0.6.1/debian/libvirt-bin.postinst
@@ -0,0 +1,53 @@
+#!/bin/sh
+# postinst script for libvirt-bin
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# 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 libvirtd
+	fi
+
+	# 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
+	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.6.1.orig/debian/compat
+++ libvirt-0.6.1/debian/compat
@@ -0,0 +1 @@
+5
--- libvirt-0.6.1.orig/debian/libvirt-bin.postrm
+++ libvirt-0.6.1/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:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# 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.6.1.orig/debian/libvirt-bin.manpages
+++ libvirt-0.6.1/debian/libvirt-bin.manpages
@@ -0,0 +1 @@
+virsh.1
--- libvirt-0.6.1.orig/debian/pycompat
+++ libvirt-0.6.1/debian/pycompat
@@ -0,0 +1 @@
+2
--- libvirt-0.6.1.orig/debian/libvirt-bin.default
+++ libvirt-0.6.1/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.6.1.orig/debian/control
+++ libvirt-0.6.1/debian/control
@@ -0,0 +1,90 @@
+Source: libvirt
+Section: libs
+Priority: optional
+Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+Uploaders: Guido Günther <agx@sigxcpu.org>
+XSBC-Original-Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers@lists.alioth.debian.org>
+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, libxen3-dev [i386 amd64], lvm2, libpolkit-dbus-dev, open-iscsi, libparted1.8-dev, libselinux1-dev, libdevmapper-dev, uuid-dev, libhal-dev
+XS-Python-Version: current
+XS-Debian-Vcs-Git: git://git.debian.org/git/pkg-libvirt/libvirt.git
+XS-Debian-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, bridge-utils, dnsmasq-base, netcat-openbsd, iptables
+Enhances: qemu, kvm, xen
+Section: admin
+Recommends: kvm
+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
+Conflicts: libvirt0-dbg (<< 0.4.2-6ubuntu1)
+Replaces: libvirt0-dbg (<< 0.4.2-6ubuntu1)
+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}) , libxen3-dev [i386 amd64]
+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.6.1.orig/debian/libvirt-bin.dirs
+++ libvirt-0.6.1/debian/libvirt-bin.dirs
@@ -0,0 +1,5 @@
+/var/run/libvirt
+/var/lib/libvirt/images
+/var/lib/libvirt/boot
+/var/cache/libvirt
+/var/log/libvirt/qemu
--- libvirt-0.6.1.orig/debian/copyright
+++ libvirt-0.6.1/debian/copyright
@@ -0,0 +1,44 @@
+libvirt was initially debianized by Andrew Mitchell <ajmitch@ubuntu.com>
+
+It was downloaded from http://libvirt.org/sources/
+
+Upstream Author:
+  
+   Daniel Veillard      <veillard@redhat.com> or <daniel@veillard.com>
+
+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.6.1.orig/debian/README.source
+++ libvirt-0.6.1/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 <patch>
+
+where <patch> 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 <file>
+
+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 <patch> /path/to/patch
+    quilt push -a
+
+(add -p 0 to quilt import if needed). <patch> 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 <patch>
+
+You may need to run quilt pop -a to unapply patches first before running
+this command.
--- libvirt-0.6.1.orig/debian/python-libvirt.install
+++ libvirt-0.6.1/debian/python-libvirt.install
@@ -0,0 +1,2 @@
+usr/lib/python*/*/*.so
+usr/lib/python*/*/*.py
--- libvirt-0.6.1.orig/debian/README.Debian
+++ libvirt-0.6.1/debian/README.Debian
@@ -0,0 +1,57 @@
+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
+needs to be adjusted slightly to interoperate with libvirtd:
+
+cat <<EOF >/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 <agx@sigxcpu.org>  Thu, 15 May 2008 14:13:03 +0100
--- libvirt-0.6.1.orig/debian/libvirt-suspendonreboot
+++ libvirt-0.6.1/debian/libvirt-suspendonreboot
@@ -0,0 +1,41 @@
+#! /bin/bash
+
+# (c) Andi Barth <aba@not.so.argh.org> 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.6.1.orig/debian/changelog
+++ libvirt-0.6.1/debian/changelog
@@ -0,0 +1,878 @@
+libvirt (0.6.1-0ubuntu5.1) jaunty-proposed; urgency=low
+
+  * debian/patches/event-handling-fix-rh499698-lp362288.patch: cherry pick
+    from upstream; fixes critical, destructive bug whereby calling
+    'virsh destroy foo' kills foo, plus another vm; LP: #362288
+
+ -- Dustin Kirkland <kirkland@ubuntu.com>  Thu, 16 Jul 2009 18:45:28 -0500
+
+libvirt (0.6.1-0ubuntu5) jaunty; urgency=low
+
+  * Fix logic error when applying %d bridge name rewriting. (LP: #350780)
+
+ -- Soren Hansen <soren@ubuntu.com>  Thu, 16 Apr 2009 20:48:49 +0200
+
+libvirt (0.6.1-0ubuntu4) jaunty; urgency=low
+
+  [ Marc Deslauriers <marc.deslauriers@ubuntu.com> ]
+  * 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 <kirkland@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  Mon, 09 Mar 2009 11:18:01 +0100
+
+libvirt (0.6.0-1ubuntu3) jaunty; urgency=low
+
+  * No change rebuild for python2.6.
+
+ -- Matthias Klose <doko@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  Thu, 05 Feb 2009 18:40:10 +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 <agx@sigxcpu.org>  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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  Fri, 28 Nov 2008 16:40:38 +0100
+
+libvirt (0.4.6-9) unstable; urgency=low
+
+  * [d30438c] create libvirt log directory (Closes: #508129)
+
+ -- Guido Günther <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <jamie@ubuntu.com>  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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <jamie@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <soren@ubuntu.com>  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 <model type='foo'/> 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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <soren@ubuntu.com>  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 <model type='foo'/> 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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <model type='foo'/> 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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <agx@sigxcpu.org>  Wed, 19 Dec 2007 13:45:58 +0100
+
+libvirt (0.3.3-5.xen0) unstable; urgency=low
+
+  * rebuild with xen support
+
+ -- Guido Guenther <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  Thu, 06 Dec 2007 15:43:03 +0100
+
+libvirt (0.3.3-4ubuntu5) hardy; urgency=low
+
+  * Made default_uri a configurable.
+
+ -- Soren Hansen <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  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 <soren@ubuntu.com>  Thu, 13 Dec 2007 15:08:29 +0100
+
+libvirt (0.3.3-4ubuntu1) hardy; urgency=low
+
+  * Fakesync with Debian.
+  * Reenable Xen.
+
+ -- Soren Hansen <soren@ubuntu.com>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  Sat, 01 Dec 2007 16:27:32 +0000
+
+libvirt (0.3.3-3) unstable; urgency=low
+
+  * add initscript to start libvirtd
+
+ -- Guido Guenther <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  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 <agx@sigxcpu.org>  Fri, 23 Nov 2007 01:58:56 +0100
+
+libvirt (0.3.3-0ubuntu1) hardy; urgency=low
+
+  * New upstream release.
+  * Update maintainer.
+
+ -- Soren Hansen <soren@ubuntu.com>  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 <fabbione@ubuntu.com>  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 <fabbione@ubuntu.com>  Mon, 16 Jul 2007 10:23:04 +0200
+
+libvirt (0.2.2-0ubuntu1) gutsy; urgency=low
+
+  * Depends on libxen3.1-dev.
+
+ -- Chuck Short <zulcss@ubuntu.com>  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 <zulcss@ubuntu.com>  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 <doko@ubuntu.com>  Fri, 12 Jan 2007 13:21:55 +0000
+
+libvirt (0.1.8-0ubuntu1) feisty; urgency=low
+
+  * Initial release
+
+ -- Andrew Mitchell <ajmitch@ubuntu.com>  Mon, 23 Oct 2006 20:00:28 +1300
+
--- libvirt-0.6.1.orig/debian/libvirt-doc.doc-base.libvirt-doc
+++ libvirt-0.6.1/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.6.1.orig/debian/libvirt-doc.links
+++ libvirt-0.6.1/debian/libvirt-doc.links
@@ -0,0 +1 @@
+usr/share/doc/libvirt-doc/devhelp/	/usr/share/gtk-doc/html/libvirt
--- libvirt-0.6.1.orig/debian/libvirt-doc.docs
+++ libvirt-0.6.1/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.6.1.orig/debian/libvirt-dev.install
+++ libvirt-0.6.1/debian/libvirt-dev.install
@@ -0,0 +1,4 @@
+usr/lib/libvirt.so
+usr/lib/libvirt.a
+usr/include/*
+usr/lib/pkgconfig/*
--- libvirt-0.6.1.orig/debian/libvirt-bin.install
+++ libvirt-0.6.1/debian/libvirt-bin.install
@@ -0,0 +1,5 @@
+usr/bin/*
+usr/sbin/*
+etc/libvirt/*
+etc/sasl2/*
+usr/share/PolicyKit/*
--- libvirt-0.6.1.orig/debian/libvirt0.install
+++ libvirt-0.6.1/debian/libvirt0.install
@@ -0,0 +1,2 @@
+usr/lib/libvirt.so.*
+
--- libvirt-0.6.1.orig/debian/watch
+++ libvirt-0.6.1/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.6.1.orig/debian/libvirt-bin.init
+++ libvirt-0.6.1/debian/libvirt-bin.init
@@ -0,0 +1,159 @@
+#! /bin/sh
+#
+# Init skript for libvirtd
+#
+# (c) 2007 Guido Guenther <agx@sigxcpu.org>
+# 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.6.1.orig/debian/patches/0008-increase-logoutput-timeout.patch
+++ libvirt-0.6.1/debian/patches/0008-increase-logoutput-timeout.patch
@@ -0,0 +1,12 @@
+diff -Nur libvirt-0.6.1/src/qemu_driver.c libvirt-0.6.1.new/src/qemu_driver.c
+--- libvirt-0.6.1/src/qemu_driver.c	2009-03-16 23:49:06.000000000 -0400
++++ libvirt-0.6.1.new/src/qemu_driver.c	2009-03-16 23:49:21.000000000 -0400
+@@ -952,7 +952,7 @@
+ 
+     ret = qemudReadLogOutput(conn, vm, logfd, buf, sizeof(buf),
+                              qemudFindCharDevicePTYs,
+-                             "console", 3);
++                             "console", 30);
+     if (close(logfd) < 0) {
+         char ebuf[1024];
+         VIR_WARN(_("Unable to close logfile: %s\n"),
--- libvirt-0.6.1.orig/debian/patches/event-loop-hang.diff
+++ libvirt-0.6.1/debian/patches/event-loop-hang.diff
@@ -0,0 +1,87 @@
+On Thu, Mar 12, 2009 at 10:04:50PM +0000, Nick Moffitt wrote:
+> Daniel Veillard:
+> >  As was reported on IRC and found by Dan Berrange, sometimes Xen event
+> >  handling could start to go wild and block processing of requests in
+> > the daemon.
+> > 
+> >  The fault at least on libvirt side is that we didn't filter out non
+> > read/write event requests when asking for watches in the xenstore. The
+> > provided patch seems to work for the person who reported the original
+> > problem,
+> 
+> It seems to work, although it may not have solved my problem:
+> 
+> 	http://dpaste.com/13740/
+> 
+> There are five backed-up pause requests on this server, and it seems
+> that four of them may be stuck in the xenstore code (apologies for the
+> lack of debugging symbols on there.  I really ought to get a debug
+> package built, or haul over an unstripped version of libxenstore.so 3.2
+> from somewhere).
+
+Ok, turns out the original patch (though worthwhile) was a red herring.
+The core problem was that the event loop was getting confused when we
+removed a monitored file handle. It would then start running the wrong
+event handler callbacks. So the xenstore watch handler got called even
+though no watch was pending :-( This also caused clients to get stuck
+because the watch detecting end-of-file on the socket wasn't getting
+called.
+
+The patch fixes the loop which dispatches callbacks, so that it does
+not assume the index into 'nfds' matches the index in 'handles'. They
+have to be tracked indepedantly, to take account of deleted handles.
+
+Daniel
+
+Index: qemud/event.c
+===================================================================
+RCS file: /data/cvs/libvirt/qemud/event.c,v
+retrieving revision 1.19
+diff -u -p -r1.19 event.c
+--- qemud/event.c	17 Feb 2009 09:44:18 -0000	1.19
++++ qemud/event.c	13 Mar 2009 15:31:33 -0000
+@@ -409,25 +409,26 @@ static int virEventDispatchTimeouts(void
+  * Returns 0 upon success, -1 if an error occurred
+  */
+ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
+-    int i;
++    int i, n;
+ 
+-    for (i = 0 ; i < nfds ; i++) {
++    for (i = 0, n = 0 ; i < eventLoop.handlesCount && n < nfds ; i++) {
+         if (eventLoop.handles[i].deleted) {
+             EVENT_DEBUG("Skip deleted %d", eventLoop.handles[i].fd);
+             continue;
+         }
+ 
+-        if (fds[i].revents) {
++        if (fds[n].revents) {
+             virEventHandleCallback cb = eventLoop.handles[i].cb;
+             void *opaque = eventLoop.handles[i].opaque;
+-            int hEvents = virPollEventToEventHandleType(fds[i].revents);
+-            EVENT_DEBUG("Dispatch %d %d %p", fds[i].fd,
+-                        fds[i].revents, eventLoop.handles[i].opaque);
++            int hEvents = virPollEventToEventHandleType(fds[n].revents);
++            EVENT_DEBUG("Dispatch %d %d %p", fds[n].fd,
++                        fds[n].revents, eventLoop.handles[i].opaque);
+             virEventUnlock();
+             (cb)(eventLoop.handles[i].watch,
+-                 fds[i].fd, hEvents, opaque);
++                 fds[n].fd, hEvents, opaque);
+             virEventLock();
+         }
++        n++;
+     }
+ 
+     return 0;
+
+-- 
+|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
+|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
+|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
+|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
+
+--
+Libvir-list mailing list
+Libvir-list@redhat.com
+https://www.redhat.com/mailman/listinfo/libvir-list
--- libvirt-0.6.1.orig/debian/patches/0005-minimal-workaround-for-qemu-startup-race.patch
+++ libvirt-0.6.1/debian/patches/0005-minimal-workaround-for-qemu-startup-race.patch
@@ -0,0 +1,22 @@
+From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
+Date: Sat, 31 Jan 2009 14:54:36 +0100
+Subject: [PATCH] minimal workaround for qemu startup race
+
+---
+ src/qemu_driver.c |    2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu_driver.c b/src/qemu_driver.c
+index 09f69bf..b2f2b47 100644
+--- a/src/qemu_driver.c
++++ b/src/qemu_driver.c
+@@ -674,8 +674,6 @@ qemudReadMonitorOutput(virConnectPtr conn,
+                                  _("Failure while reading %s startup output"), what);
+                 return -1;
+             }
+-        } else if (ret == 0) {
+-            return 0;
+         } else {
+             got += ret;
+             buf[got] = '\0';
+-- 
--- libvirt-0.6.1.orig/debian/patches/opennebula.diff
+++ libvirt-0.6.1/debian/patches/opennebula.diff
@@ -0,0 +1,1900 @@
+Index: libvirt-0.5.1/configure.in
+===================================================================
+--- libvirt-0.5.1.orig/configure.in	2009-01-08 22:51:34.332438504 +0100
++++ libvirt-0.5.1/configure.in	2009-01-08 22:51:52.247450957 +0100
+@@ -174,6 +174,8 @@
+ AC_ARG_WITH([remote],
+ [  --with-remote           add remote driver support (on)],[],[with_remote=yes])
+ AC_ARG_WITH([libvirtd],
++AC_ARG_WITH([one],
++[  --with-one              add ONE support (on)],[],[with_one=yes])
+ [  --with-libvirtd         add libvirtd support (on)],[],[with_libvirtd=yes])
+ 
+ dnl
+@@ -349,6 +351,19 @@
+ AC_SUBST([XEN_LIBS])
+ 
+ dnl
++dnl OpenNebula driver Compilation setting
++dnl
++
++if test "$with_one" = "yes" ; then
++LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_ONE -I$ONE_LOCATION/include"
++ONE_LIBS="-L/usr/local/lib -lxmlrpc_client++ -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc++ -lxmlrpc_client -lxmlrpc_util -L$ONE_LOCATION/lib -loneapi"
++AC_SUBST([ONE_LIBS])
++AC_DEFINE_UNQUOTED([WITH_ONE],1,[whether Open Nebula Driver is enabled])
++fi
++AM_CONDITIONAL([WITH_ONE],[test "$with_one" = "yes"])
++
++
++
+ dnl check for kernel headers required by xen_inotify
+ dnl
+ if test "$with_xen" != "yes"; then
+@@ -1273,6 +1288,7 @@
+ AC_MSG_NOTICE([  OpenVZ: $with_openvz])
+ AC_MSG_NOTICE([     LXC: $with_lxc])
+ AC_MSG_NOTICE([    Test: $with_test])
++AC_MSG_NOTICE([     ONE: $with_one])
+ AC_MSG_NOTICE([  Remote: $with_remote])
+ AC_MSG_NOTICE([ Network: $with_network])
+ AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
+@@ -1339,6 +1355,9 @@
+ AC_MSG_NOTICE([  devkit: no])
+ fi
+ AC_MSG_NOTICE([])
++if test "$with_one" = "yes" ; then
++AC_MSG_NOTICE([  one: $ONE_LIBS])
++fi
+ AC_MSG_NOTICE([Test suite])
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([  Coverage: $enable_coverage])
+Index: libvirt-0.5.1/include/libvirt/virterror.h
+===================================================================
+--- libvirt-0.5.1.orig/include/libvirt/virterror.h	2009-01-08 22:52:04.463436158 +0100
++++ libvirt-0.5.1/include/libvirt/virterror.h	2009-01-08 22:52:14.068464871 +0100
+@@ -61,6 +61,7 @@
+     VIR_FROM_UML,       /* Error at the UML driver */
+     VIR_FROM_NODEDEV, /* Error from node device monitor */
+     VIR_FROM_XEN_INOTIFY, /* Error from xen inotify layer */
++    VIR_FROM_ONE,
+ } virErrorDomain;
+ 
+ 
+Index: libvirt-0.5.1/src/domain_conf.c
+===================================================================
+--- libvirt-0.5.1.orig/src/domain_conf.c	2009-01-08 22:52:27.435438046 +0100
++++ libvirt-0.5.1/src/domain_conf.c	2009-01-08 22:53:20.911476133 +0100
+@@ -52,7 +52,8 @@
+               "ldom",
+               "test",
+               "vmware",
+-              "hyperv")
++              "hyperv",
++              "one")
+ 
+ VIR_ENUM_IMPL(virDomainBoot, VIR_DOMAIN_BOOT_LAST,
+               "fd",
+Index: libvirt-0.5.1/src/domain_conf.h
+===================================================================
+--- libvirt-0.5.1.orig/src/domain_conf.h	2009-01-08 22:52:27.531439074 +0100
++++ libvirt-0.5.1/src/domain_conf.h	2009-01-08 22:53:26.423438826 +0100
+@@ -47,6 +47,7 @@
+     VIR_DOMAIN_VIRT_TEST,
+     VIR_DOMAIN_VIRT_VMWARE,
+     VIR_DOMAIN_VIRT_HYPERV,
++    VIR_DOMAIN_VIRT_ONE,
+ 
+     VIR_DOMAIN_VIRT_LAST,
+ };
+Index: libvirt-0.5.1/src/driver.h
+===================================================================
+--- libvirt-0.5.1.orig/src/driver.h	2009-01-08 22:52:35.132437247 +0100
++++ libvirt-0.5.1/src/driver.h	2009-01-08 22:53:43.492436144 +0100
+@@ -20,6 +20,7 @@
+     VIR_DRV_OPENVZ = 5,
+     VIR_DRV_LXC = 6,
+     VIR_DRV_UML = 7,
++    VIR_DRV_ONE = 8,
+ } virDrvNo;
+ 
+ 
+Index: libvirt-0.5.1/src/libvirt.c
+===================================================================
+--- libvirt-0.5.1.orig/src/libvirt.c	2009-01-08 22:52:40.024437626 +0100
++++ libvirt-0.5.1/src/libvirt.c	2009-01-08 22:53:54.648437115 +0100
+@@ -54,6 +54,9 @@
+ #ifdef WITH_OPENVZ
+ #include "openvz_driver.h"
+ #endif
++#ifdef WITH_ONE
++#include "one_driver.h"
++#endif
+ #endif
+ 
+ /*
+@@ -311,6 +314,9 @@
+  * @info: extra information string
+  *
+  * Handle an error at the connection level
++#ifdef WITH_ONE
++    if (oneRegister() == -1) return -1;
++#endif
+  */
+ static void
+ virLibConnError(virConnectPtr conn, virErrorNumber error, const char *info)
+@@ -774,6 +780,10 @@
+ #endif
+ #if WITH_REMOTE
+         if (STRCASEEQ(type, "Remote"))
++#if WITH_ONE
++        if (STRCASEEQ(type, "ONE"))
++            *typeVer = LIBVIR_VERSION_NUMBER;
++#endif
+             *typeVer = remoteVersion();
+ #endif
+         if (*typeVer == 0) {
+Index: libvirt-0.5.1/src/Makefile.am
+===================================================================
+--- libvirt-0.5.1.orig/src/Makefile.am	2009-01-08 22:57:20.339464746 +0100
++++ libvirt-0.5.1/src/Makefile.am	2009-01-08 22:57:24.471466998 +0100
+@@ -130,6 +130,9 @@
+ UML_DRIVER_SOURCES =						\
+ 		uml_conf.c uml_conf.h				\
+ 		uml_driver.c uml_driver.h
++ONE_DRIVER_SOURCES =						\
++		one_conf.c one_conf.h				\
++		one_driver.c one_driver.h
+ 
+ NETWORK_DRIVER_SOURCES =					\
+ 		network_driver.h network_driver.c
+@@ -298,6 +301,14 @@
+ libvirt_driver_uml_la_SOURCES = $(UML_DRIVER_SOURCES)
+ endif
+ 
++if WITH_ONE
++noinst_LTLIBRARIES += libvirt_driver_one.la
++libvirt_la_LIBADD  += libvirt_driver_one.la
++libvirt_driver_one_la_SOURCES = $(ONE_DRIVER_SOURCES)
++libvirt_driver_one_la_LDFLAGS = $(ONE_LIBS)
++libvirt_driver_one_la_CFLAGS  = "-DWITH_ONE"
++endif
++
+ if WITH_NETWORK
+ if WITH_DRIVER_MODULES
+ mod_LTLIBRARIES += libvirt_driver_network.la
+@@ -380,6 +391,7 @@
+ 		$(LXC_DRIVER_SOURCES)				\
+ 		$(UML_DRIVER_SOURCES)				\
+ 		$(OPENVZ_DRIVER_SOURCES)			\
++		$(ONE_DRIVER_SOURCES)				\
+ 		$(NETWORK_DRIVER_SOURCES)			\
+ 		$(STORAGE_DRIVER_SOURCES)			\
+ 		$(STORAGE_DRIVER_FS_SOURCES)			\
+Index: libvirt-0.5.1/src/Makefile.in
+===================================================================
+--- libvirt-0.5.1.orig/src/Makefile.in	2009-01-08 22:58:07.580436084 +0100
++++ libvirt-0.5.1/src/Makefile.in	2009-01-08 22:58:24.508458222 +0100
+@@ -57,31 +57,33 @@
+ @WITH_DRIVER_MODULES_TRUE@@WITH_UML_TRUE@am__append_21 = libvirt_driver_uml.la
+ @WITH_DRIVER_MODULES_FALSE@@WITH_UML_TRUE@am__append_22 = libvirt_driver_uml.la
+ @WITH_DRIVER_MODULES_TRUE@@WITH_UML_TRUE@am__append_23 = -module -avoid-version
+-@WITH_DRIVER_MODULES_TRUE@@WITH_NETWORK_TRUE@am__append_24 = libvirt_driver_network.la
+-@WITH_DRIVER_MODULES_FALSE@@WITH_NETWORK_TRUE@am__append_25 = libvirt_driver_network.la
+-@WITH_DRIVER_MODULES_TRUE@@WITH_STORAGE_DIR_TRUE@am__append_26 = libvirt_driver_storage.la
+-@WITH_DRIVER_MODULES_FALSE@@WITH_STORAGE_DIR_TRUE@am__append_27 = libvirt_driver_storage.la
+-@WITH_STORAGE_DIR_TRUE@am__append_28 = $(STORAGE_DRIVER_SOURCES) \
++@WITH_ONE_TRUE@am__append_24 = libvirt_driver_one.la
++@WITH_ONE_TRUE@am__append_25 = libvirt_driver_one.la
++@WITH_DRIVER_MODULES_TRUE@@WITH_NETWORK_TRUE@am__append_26 = libvirt_driver_network.la
++@WITH_DRIVER_MODULES_FALSE@@WITH_NETWORK_TRUE@am__append_27 = libvirt_driver_network.la
++@WITH_DRIVER_MODULES_TRUE@@WITH_STORAGE_DIR_TRUE@am__append_28 = libvirt_driver_storage.la
++@WITH_DRIVER_MODULES_FALSE@@WITH_STORAGE_DIR_TRUE@am__append_29 = libvirt_driver_storage.la
++@WITH_STORAGE_DIR_TRUE@am__append_30 = $(STORAGE_DRIVER_SOURCES) \
+ @WITH_STORAGE_DIR_TRUE@	$(STORAGE_DRIVER_FS_SOURCES)
+-@WITH_STORAGE_LVM_TRUE@am__append_29 = $(STORAGE_DRIVER_LVM_SOURCES)
+-@WITH_STORAGE_ISCSI_TRUE@am__append_30 = $(STORAGE_DRIVER_ISCSI_SOURCES)
+-@WITH_STORAGE_DISK_TRUE@am__append_31 = $(STORAGE_DRIVER_DISK_SOURCES)
++@WITH_STORAGE_LVM_TRUE@am__append_31 = $(STORAGE_DRIVER_LVM_SOURCES)
++@WITH_STORAGE_ISCSI_TRUE@am__append_32 = $(STORAGE_DRIVER_ISCSI_SOURCES)
++@WITH_STORAGE_DISK_TRUE@am__append_33 = $(STORAGE_DRIVER_DISK_SOURCES)
+ 
+ # Needed to keep automake quiet about conditionals
+-@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_32 = libvirt_driver_nodedev.la
+-@WITH_DRIVER_MODULES_FALSE@@WITH_NODE_DEVICES_TRUE@am__append_33 = libvirt_driver_nodedev.la
+-@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_34 = $(NODE_DEVICE_DRIVER_HAL_SOURCES)
+-@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_35 = $(HAL_CFLAGS)
+-@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_36 = $(HAL_LIBS)
+-@HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_37 = $(NODE_DEVICE_DRIVER_DEVKIT_SOURCES)
+-@HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_38 = $(DEVKIT_CFLAGS)
+-@HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_39 = $(DEVKIT_LIBS)
+-@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_40 = -module -avoid-version
++@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_34 = libvirt_driver_nodedev.la
++@WITH_DRIVER_MODULES_FALSE@@WITH_NODE_DEVICES_TRUE@am__append_35 = libvirt_driver_nodedev.la
++@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_36 = $(NODE_DEVICE_DRIVER_HAL_SOURCES)
++@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_37 = $(HAL_CFLAGS)
++@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_38 = $(HAL_LIBS)
++@HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_39 = $(NODE_DEVICE_DRIVER_DEVKIT_SOURCES)
++@HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_40 = $(DEVKIT_CFLAGS)
++@HAVE_DEVKIT_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_41 = $(DEVKIT_LIBS)
++@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_42 = -module -avoid-version
+ bin_PROGRAMS = virsh$(EXEEXT)
+-@WITH_WIN_ICON_TRUE@am__append_41 = virsh_win_icon.$(OBJEXT)
++@WITH_WIN_ICON_TRUE@am__append_43 = virsh_win_icon.$(OBJEXT)
+ libexec_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
+-@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am__append_42 = libvirt_parthelper
+-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@am__append_43 = libvirt_lxc
++@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am__append_44 = libvirt_parthelper
++@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@am__append_45 = libvirt_lxc
+ subdir = src
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ 	$(srcdir)/libvirt_sym.version.in
+@@ -247,12 +249,24 @@
+ @WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am_libvirt_driver_nodedev_la_rpath =  \
+ @WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@	-rpath \
+ @WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@	$(moddir)
++libvirt_driver_one_la_LIBADD =
++am__libvirt_driver_one_la_SOURCES_DIST = one_conf.c one_conf.h \
++	one_driver.c one_driver.h
++am__objects_13 = libvirt_driver_one_la-one_conf.lo \
++	libvirt_driver_one_la-one_driver.lo
++@WITH_ONE_TRUE@am_libvirt_driver_one_la_OBJECTS = $(am__objects_13)
++libvirt_driver_one_la_OBJECTS = $(am_libvirt_driver_one_la_OBJECTS)
++libvirt_driver_one_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
++	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
++	$(libvirt_driver_one_la_CFLAGS) $(CFLAGS) \
++	$(libvirt_driver_one_la_LDFLAGS) $(LDFLAGS) -o $@
++@WITH_ONE_TRUE@am_libvirt_driver_one_la_rpath =
+ libvirt_driver_openvz_la_LIBADD =
+ am__libvirt_driver_openvz_la_SOURCES_DIST = openvz_conf.c \
+ 	openvz_conf.h openvz_driver.c openvz_driver.h
+-am__objects_13 = openvz_conf.lo openvz_driver.lo
++am__objects_14 = openvz_conf.lo openvz_driver.lo
+ @WITH_OPENVZ_TRUE@am_libvirt_driver_openvz_la_OBJECTS =  \
+-@WITH_OPENVZ_TRUE@	$(am__objects_13)
++@WITH_OPENVZ_TRUE@	$(am__objects_14)
+ libvirt_driver_openvz_la_OBJECTS =  \
+ 	$(am_libvirt_driver_openvz_la_OBJECTS)
+ libvirt_driver_openvz_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+@@ -264,9 +278,9 @@
+ libvirt_driver_qemu_la_LIBADD =
+ am__libvirt_driver_qemu_la_SOURCES_DIST = qemu_conf.c qemu_conf.h \
+ 	qemu_driver.c qemu_driver.h
+-am__objects_14 = libvirt_driver_qemu_la-qemu_conf.lo \
++am__objects_15 = libvirt_driver_qemu_la-qemu_conf.lo \
+ 	libvirt_driver_qemu_la-qemu_driver.lo
+-@WITH_QEMU_TRUE@am_libvirt_driver_qemu_la_OBJECTS = $(am__objects_14)
++@WITH_QEMU_TRUE@am_libvirt_driver_qemu_la_OBJECTS = $(am__objects_15)
+ libvirt_driver_qemu_la_OBJECTS = $(am_libvirt_driver_qemu_la_OBJECTS)
+ libvirt_driver_qemu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
+@@ -279,10 +293,10 @@
+ am__libvirt_driver_remote_la_SOURCES_DIST = gnutls_1_0_compat.h \
+ 	remote_internal.c remote_internal.h ../qemud/remote_protocol.c \
+ 	../qemud/remote_protocol.h
+-am__objects_15 = libvirt_driver_remote_la-remote_internal.lo \
++am__objects_16 = libvirt_driver_remote_la-remote_internal.lo \
+ 	libvirt_driver_remote_la-remote_protocol.lo
+ @WITH_REMOTE_TRUE@am_libvirt_driver_remote_la_OBJECTS =  \
+-@WITH_REMOTE_TRUE@	$(am__objects_15)
++@WITH_REMOTE_TRUE@	$(am__objects_16)
+ libvirt_driver_remote_la_OBJECTS =  \
+ 	$(am_libvirt_driver_remote_la_OBJECTS)
+ libvirt_driver_remote_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+@@ -299,18 +313,18 @@
+ 	storage_backend_logical.h storage_backend_logical.c \
+ 	storage_backend_iscsi.h storage_backend_iscsi.c \
+ 	storage_backend_disk.h storage_backend_disk.c
+-am__objects_16 = storage_driver.lo storage_backend.lo
+-am__objects_17 = storage_backend_fs.lo
+-@WITH_STORAGE_DIR_TRUE@am__objects_18 = $(am__objects_16) \
+-@WITH_STORAGE_DIR_TRUE@	$(am__objects_17)
+-am__objects_19 = storage_backend_logical.lo
+-@WITH_STORAGE_LVM_TRUE@am__objects_20 = $(am__objects_19)
+-am__objects_21 = storage_backend_iscsi.lo
+-@WITH_STORAGE_ISCSI_TRUE@am__objects_22 = $(am__objects_21)
+-am__objects_23 = storage_backend_disk.lo
+-@WITH_STORAGE_DISK_TRUE@am__objects_24 = $(am__objects_23)
+-am_libvirt_driver_storage_la_OBJECTS = $(am__objects_18) \
+-	$(am__objects_20) $(am__objects_22) $(am__objects_24)
++am__objects_17 = storage_driver.lo storage_backend.lo
++am__objects_18 = storage_backend_fs.lo
++@WITH_STORAGE_DIR_TRUE@am__objects_19 = $(am__objects_17) \
++@WITH_STORAGE_DIR_TRUE@	$(am__objects_18)
++am__objects_20 = storage_backend_logical.lo
++@WITH_STORAGE_LVM_TRUE@am__objects_21 = $(am__objects_20)
++am__objects_22 = storage_backend_iscsi.lo
++@WITH_STORAGE_ISCSI_TRUE@am__objects_23 = $(am__objects_22)
++am__objects_24 = storage_backend_disk.lo
++@WITH_STORAGE_DISK_TRUE@am__objects_25 = $(am__objects_24)
++am_libvirt_driver_storage_la_OBJECTS = $(am__objects_19) \
++	$(am__objects_21) $(am__objects_23) $(am__objects_25)
+ libvirt_driver_storage_la_OBJECTS =  \
+ 	$(am_libvirt_driver_storage_la_OBJECTS)
+ libvirt_driver_storage_la_LINK = $(LIBTOOL) --tag=CC \
+@@ -323,8 +337,8 @@
+ @WITH_DRIVER_MODULES_TRUE@@WITH_STORAGE_DIR_TRUE@	$(moddir)
+ libvirt_driver_test_la_LIBADD =
+ am__libvirt_driver_test_la_SOURCES_DIST = test.c test.h
+-am__objects_25 = test.lo
+-@WITH_TEST_TRUE@am_libvirt_driver_test_la_OBJECTS = $(am__objects_25)
++am__objects_26 = test.lo
++@WITH_TEST_TRUE@am_libvirt_driver_test_la_OBJECTS = $(am__objects_26)
+ libvirt_driver_test_la_OBJECTS = $(am_libvirt_driver_test_la_OBJECTS)
+ libvirt_driver_test_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+@@ -335,9 +349,9 @@
+ libvirt_driver_uml_la_LIBADD =
+ am__libvirt_driver_uml_la_SOURCES_DIST = uml_conf.c uml_conf.h \
+ 	uml_driver.c uml_driver.h
+-am__objects_26 = libvirt_driver_uml_la-uml_conf.lo \
++am__objects_27 = libvirt_driver_uml_la-uml_conf.lo \
+ 	libvirt_driver_uml_la-uml_driver.lo
+-@WITH_UML_TRUE@am_libvirt_driver_uml_la_OBJECTS = $(am__objects_26)
++@WITH_UML_TRUE@am_libvirt_driver_uml_la_OBJECTS = $(am__objects_27)
+ libvirt_driver_uml_la_OBJECTS = $(am_libvirt_driver_uml_la_OBJECTS)
+ libvirt_driver_uml_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
+@@ -352,16 +366,16 @@
+ 	xen_unified.c xen_unified.h xend_internal.c xend_internal.h \
+ 	xm_internal.c xm_internal.h xs_internal.c xs_internal.h \
+ 	xen_inotify.c xen_inotify.h
+-@WITH_XEN_INOTIFY_TRUE@am__objects_27 =  \
++@WITH_XEN_INOTIFY_TRUE@am__objects_28 =  \
+ @WITH_XEN_INOTIFY_TRUE@	libvirt_driver_xen_la-xen_inotify.lo
+-am__objects_28 = libvirt_driver_xen_la-proxy_internal.lo \
++am__objects_29 = libvirt_driver_xen_la-proxy_internal.lo \
+ 	libvirt_driver_xen_la-sexpr.lo \
+ 	libvirt_driver_xen_la-xen_internal.lo \
+ 	libvirt_driver_xen_la-xen_unified.lo \
+ 	libvirt_driver_xen_la-xend_internal.lo \
+ 	libvirt_driver_xen_la-xm_internal.lo \
+-	libvirt_driver_xen_la-xs_internal.lo $(am__objects_27)
+-@WITH_XEN_TRUE@am_libvirt_driver_xen_la_OBJECTS = $(am__objects_28)
++	libvirt_driver_xen_la-xs_internal.lo $(am__objects_28)
++@WITH_XEN_TRUE@am_libvirt_driver_xen_la_OBJECTS = $(am__objects_29)
+ libvirt_driver_xen_la_OBJECTS = $(am_libvirt_driver_xen_la_OBJECTS)
+ libvirt_driver_xen_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
+@@ -372,19 +386,19 @@
+ @WITH_DRIVER_MODULES_TRUE@@WITH_XEN_TRUE@	-rpath $(moddir)
+ am__DEPENDENCIES_1 = libvirt_util.la libvirt_driver.la $(am__append_4) \
+ 	$(am__append_7) $(am__append_11) $(am__append_15) \
+-	../gnulib/lib/libgnu.la
++	$(am__append_25) ../gnulib/lib/libgnu.la
+ libvirt_test_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+-am__objects_29 =
+-am_libvirt_test_la_OBJECTS = $(am__objects_29)
++am__objects_30 =
++am_libvirt_test_la_OBJECTS = $(am__objects_30)
+ libvirt_test_la_OBJECTS = $(am_libvirt_test_la_OBJECTS)
+ libvirt_test_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libvirt_test_la_CFLAGS) \
+ 	$(CFLAGS) $(libvirt_test_la_LDFLAGS) $(LDFLAGS) -o $@
+ libvirt_util_la_LIBADD =
+-am__objects_30 = bridge.lo buf.lo conf.lo event.lo hash.lo iptables.lo \
++am__objects_31 = bridge.lo buf.lo conf.lo event.lo hash.lo iptables.lo \
+ 	memory.lo qparams.lo uuid.lo util.lo virterror.lo logging.lo \
+ 	xml.lo
+-am_libvirt_util_la_OBJECTS = $(am__objects_30)
++am_libvirt_util_la_OBJECTS = $(am__objects_31)
+ libvirt_util_la_OBJECTS = $(am_libvirt_util_la_OBJECTS)
+ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+ @WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am__EXEEXT_1 = libvirt_parthelper$(EXEEXT)
+@@ -400,24 +414,24 @@
+ 	virterror_internal.h logging.c logging.h xml.c xml.h \
+ 	capabilities.c capabilities.h domain_conf.c domain_conf.h \
+ 	nodeinfo.h nodeinfo.c
+-am__objects_31 = libvirt_lxc-lxc_conf.$(OBJEXT) \
++am__objects_32 = libvirt_lxc-lxc_conf.$(OBJEXT) \
+ 	libvirt_lxc-lxc_container.$(OBJEXT) \
+ 	libvirt_lxc-lxc_controller.$(OBJEXT) \
+ 	libvirt_lxc-veth.$(OBJEXT) libvirt_lxc-cgroup.$(OBJEXT)
+-am__objects_32 = libvirt_lxc-bridge.$(OBJEXT) \
++am__objects_33 = libvirt_lxc-bridge.$(OBJEXT) \
+ 	libvirt_lxc-buf.$(OBJEXT) libvirt_lxc-conf.$(OBJEXT) \
+ 	libvirt_lxc-event.$(OBJEXT) libvirt_lxc-hash.$(OBJEXT) \
+ 	libvirt_lxc-iptables.$(OBJEXT) libvirt_lxc-memory.$(OBJEXT) \
+ 	libvirt_lxc-qparams.$(OBJEXT) libvirt_lxc-uuid.$(OBJEXT) \
+ 	libvirt_lxc-util.$(OBJEXT) libvirt_lxc-virterror.$(OBJEXT) \
+ 	libvirt_lxc-logging.$(OBJEXT) libvirt_lxc-xml.$(OBJEXT)
+-am__objects_33 = libvirt_lxc-capabilities.$(OBJEXT) \
++am__objects_34 = libvirt_lxc-capabilities.$(OBJEXT) \
+ 	libvirt_lxc-domain_conf.$(OBJEXT) \
+ 	libvirt_lxc-nodeinfo.$(OBJEXT)
+ @WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@am_libvirt_lxc_OBJECTS =  \
+-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@	$(am__objects_31) \
+ @WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@	$(am__objects_32) \
+-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@	$(am__objects_33)
++@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@	$(am__objects_33) \
++@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@	$(am__objects_34)
+ libvirt_lxc_OBJECTS = $(am_libvirt_lxc_OBJECTS)
+ am__DEPENDENCIES_2 =
+ @WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@libvirt_lxc_DEPENDENCIES =  \
+@@ -427,9 +441,9 @@
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libvirt_lxc_CFLAGS) \
+ 	$(CFLAGS) $(libvirt_lxc_LDFLAGS) $(LDFLAGS) -o $@
+ am__libvirt_parthelper_SOURCES_DIST = parthelper.c
+-am__objects_34 = libvirt_parthelper-parthelper.$(OBJEXT)
++am__objects_35 = libvirt_parthelper-parthelper.$(OBJEXT)
+ @WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am_libvirt_parthelper_OBJECTS =  \
+-@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@	$(am__objects_34)
++@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@	$(am__objects_35)
+ libvirt_parthelper_OBJECTS = $(am_libvirt_parthelper_OBJECTS)
+ @WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@libvirt_parthelper_DEPENDENCIES = $(am__DEPENDENCIES_2)
+ libvirt_parthelper_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+@@ -440,7 +454,7 @@
+ virsh_OBJECTS = $(am_virsh_OBJECTS)
+ virsh_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
+ 	libvirt.la ../gnulib/lib/libgnu.la $(am__DEPENDENCIES_2) \
+-	$(am__append_41)
++	$(am__append_43)
+ virsh_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ 	--mode=link $(CCLD) $(virsh_CFLAGS) $(CFLAGS) $(virsh_LDFLAGS) \
+ 	$(LDFLAGS) -o $@
+@@ -460,6 +474,7 @@
+ 	$(libvirt_driver_lxc_la_SOURCES) \
+ 	$(libvirt_driver_network_la_SOURCES) \
+ 	$(libvirt_driver_nodedev_la_SOURCES) \
++	$(libvirt_driver_one_la_SOURCES) \
+ 	$(libvirt_driver_openvz_la_SOURCES) \
+ 	$(libvirt_driver_qemu_la_SOURCES) \
+ 	$(libvirt_driver_remote_la_SOURCES) \
+@@ -473,6 +488,7 @@
+ 	$(am__libvirt_driver_lxc_la_SOURCES_DIST) \
+ 	$(am__libvirt_driver_network_la_SOURCES_DIST) \
+ 	$(am__libvirt_driver_nodedev_la_SOURCES_DIST) \
++	$(am__libvirt_driver_one_la_SOURCES_DIST) \
+ 	$(am__libvirt_driver_openvz_la_SOURCES_DIST) \
+ 	$(am__libvirt_driver_qemu_la_SOURCES_DIST) \
+ 	$(am__libvirt_driver_remote_la_SOURCES_DIST) \
+@@ -834,6 +850,7 @@
+ NUMACTL_LIBS = @NUMACTL_LIBS@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
++ONE_LIBS = @ONE_LIBS@
+ PACKAGE = @PACKAGE@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+ PACKAGE_NAME = @PACKAGE_NAME@
+@@ -1044,10 +1061,11 @@
+ 	$(TEST_DRIVER_SOURCES) $(REMOTE_DRIVER_SOURCES) \
+ 	$(XEN_DRIVER_SOURCES) $(QEMU_DRIVER_SOURCES) \
+ 	$(LXC_DRIVER_SOURCES) $(UML_DRIVER_SOURCES) \
+-	$(OPENVZ_DRIVER_SOURCES) $(NETWORK_DRIVER_SOURCES) \
+-	$(STORAGE_DRIVER_SOURCES) $(STORAGE_DRIVER_FS_SOURCES) \
+-	$(STORAGE_DRIVER_LVM_SOURCES) $(STORAGE_DRIVER_ISCSI_SOURCES) \
+-	$(STORAGE_DRIVER_DISK_SOURCES) $(NODE_DEVICE_DRIVER_SOURCES) \
++	$(OPENVZ_DRIVER_SOURCES) $(ONE_DRIVER_SOURCES) \
++	$(NETWORK_DRIVER_SOURCES) $(STORAGE_DRIVER_SOURCES) \
++	$(STORAGE_DRIVER_FS_SOURCES) $(STORAGE_DRIVER_LVM_SOURCES) \
++	$(STORAGE_DRIVER_ISCSI_SOURCES) $(STORAGE_DRIVER_DISK_SOURCES) \
++	$(NODE_DEVICE_DRIVER_SOURCES) \
+ 	$(NODE_DEVICE_DRIVER_HAL_SOURCES) \
+ 	$(NODE_DEVICE_DRIVER_DEVKIT_SOURCES) \
+ 	$(STORAGE_HELPER_DISK_SOURCES) $(LXC_CONTROLLER_SOURCES)
+@@ -1055,8 +1073,8 @@
+ moddir = $(libdir)/libvirt/drivers
+ mod_LTLIBRARIES = $(am__append_2) $(am__append_5) $(am__append_9) \
+ 	$(am__append_13) $(am__append_16) $(am__append_19) \
+-	$(am__append_21) $(am__append_24) $(am__append_26) \
+-	$(am__append_32)
++	$(am__append_21) $(am__append_26) $(am__append_28) \
++	$(am__append_34)
+ 
+ # These files are not related to driver APIs. Simply generic
+ # helper APIs for various purposes
+@@ -1147,6 +1165,10 @@
+ 		uml_conf.c uml_conf.h				\
+ 		uml_driver.c uml_driver.h
+ 
++ONE_DRIVER_SOURCES = \
++		one_conf.c one_conf.h				\
++		one_driver.c one_driver.h
++
+ NETWORK_DRIVER_SOURCES = \
+ 		network_driver.h network_driver.c
+ 
+@@ -1199,11 +1221,11 @@
+ noinst_LTLIBRARIES = libvirt_util.la libvirt_driver.la $(am__append_3) \
+ 	$(am__append_6) $(am__append_10) $(am__append_14) \
+ 	$(am__append_17) $(am__append_20) $(am__append_22) \
+-	$(am__append_25) $(am__append_27) $(am__append_33) \
+-	libvirt_test.la
++	$(am__append_24) $(am__append_27) $(am__append_29) \
++	$(am__append_35) libvirt_test.la
+ libvirt_la_LIBADD = libvirt_util.la libvirt_driver.la $(am__append_4) \
+ 	$(am__append_7) $(am__append_11) $(am__append_15) \
+-	@CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
++	$(am__append_25) @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
+ libvirt_util_la_SOURCES = \
+ 		$(UTIL_SOURCES)
+ 
+@@ -1247,14 +1269,17 @@
+ @WITH_UML_TRUE@libvirt_driver_uml_la_LDFLAGS = $(NUMACTL_LIBS) \
+ @WITH_UML_TRUE@	$(am__append_23)
+ @WITH_UML_TRUE@libvirt_driver_uml_la_SOURCES = $(UML_DRIVER_SOURCES)
++@WITH_ONE_TRUE@libvirt_driver_one_la_SOURCES = $(ONE_DRIVER_SOURCES)
++@WITH_ONE_TRUE@libvirt_driver_one_la_LDFLAGS = $(ONE_LIBS)
++@WITH_ONE_TRUE@libvirt_driver_one_la_CFLAGS = "-DWITH_ONE"
+ # Stateful, so linked to daemon instead
+ #libvirt_la_LIBADD += libvirt_driver_network.la
+ @WITH_DRIVER_MODULES_TRUE@@WITH_NETWORK_TRUE@libvirt_driver_network_la_LDFLAGS = -module -avoid-version
+ @WITH_NETWORK_TRUE@libvirt_driver_network_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
+ 
+ # Needed to keep automake quiet about conditionals
+-libvirt_driver_storage_la_SOURCES = $(am__append_28) $(am__append_29) \
+-	$(am__append_30) $(am__append_31)
++libvirt_driver_storage_la_SOURCES = $(am__append_30) $(am__append_31) \
++	$(am__append_32) $(am__append_33)
+ # Stateful, so linked to daemon instead
+ #libvirt_la_LIBADD += libvirt_driver_storage.la
+ @WITH_DRIVER_MODULES_TRUE@@WITH_STORAGE_DIR_TRUE@libvirt_driver_storage_la_LDFLAGS = -module -avoid-version
+@@ -1262,12 +1287,12 @@
+ #libvirt_la_LIBADD += libvirt_driver_nodedev.la
+ @WITH_NODE_DEVICES_TRUE@libvirt_driver_nodedev_la_SOURCES =  \
+ @WITH_NODE_DEVICES_TRUE@	$(NODE_DEVICE_DRIVER_SOURCES) \
+-@WITH_NODE_DEVICES_TRUE@	$(am__append_34) $(am__append_37)
++@WITH_NODE_DEVICES_TRUE@	$(am__append_36) $(am__append_39)
+ @WITH_NODE_DEVICES_TRUE@libvirt_driver_nodedev_la_CFLAGS =  \
+-@WITH_NODE_DEVICES_TRUE@	$(am__append_35) $(am__append_38)
++@WITH_NODE_DEVICES_TRUE@	$(am__append_37) $(am__append_40)
+ @WITH_NODE_DEVICES_TRUE@libvirt_driver_nodedev_la_LDFLAGS =  \
+-@WITH_NODE_DEVICES_TRUE@	$(am__append_36) $(am__append_39) \
+-@WITH_NODE_DEVICES_TRUE@	$(am__append_40)
++@WITH_NODE_DEVICES_TRUE@	$(am__append_38) $(am__append_41) \
++@WITH_NODE_DEVICES_TRUE@	$(am__append_42)
+ 
+ # Empty source list - it merely links a bunch of convenience libs together
+ libvirt_la_SOURCES = 
+@@ -1301,7 +1326,7 @@
+ 
+ virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
+ virsh_LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) libvirt.la \
+-	../gnulib/lib/libgnu.la $(VIRSH_LIBS) $(am__append_41)
++	../gnulib/lib/libgnu.la $(VIRSH_LIBS) $(am__append_43)
+ virsh_CFLAGS = $(COVERAGE_CFLAGS) $(READLINE_CFLAGS)
+ BUILT_SOURCES = virsh-net-edit.c virsh-pool-edit.c
+ @WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
+@@ -1427,6 +1452,8 @@
+ 	$(libvirt_driver_network_la_LINK) $(am_libvirt_driver_network_la_rpath) $(libvirt_driver_network_la_OBJECTS) $(libvirt_driver_network_la_LIBADD) $(LIBS)
+ libvirt_driver_nodedev.la: $(libvirt_driver_nodedev_la_OBJECTS) $(libvirt_driver_nodedev_la_DEPENDENCIES) 
+ 	$(libvirt_driver_nodedev_la_LINK) $(am_libvirt_driver_nodedev_la_rpath) $(libvirt_driver_nodedev_la_OBJECTS) $(libvirt_driver_nodedev_la_LIBADD) $(LIBS)
++libvirt_driver_one.la: $(libvirt_driver_one_la_OBJECTS) $(libvirt_driver_one_la_DEPENDENCIES) 
++	$(libvirt_driver_one_la_LINK) $(am_libvirt_driver_one_la_rpath) $(libvirt_driver_one_la_OBJECTS) $(libvirt_driver_one_la_LIBADD) $(LIBS)
+ libvirt_driver_openvz.la: $(libvirt_driver_openvz_la_OBJECTS) $(libvirt_driver_openvz_la_DEPENDENCIES) 
+ 	$(libvirt_driver_openvz_la_LINK) $(am_libvirt_driver_openvz_la_rpath) $(libvirt_driver_openvz_la_OBJECTS) $(libvirt_driver_openvz_la_LIBADD) $(LIBS)
+ libvirt_driver_qemu.la: $(libvirt_driver_qemu_la_OBJECTS) $(libvirt_driver_qemu_la_DEPENDENCIES) 
+@@ -1538,6 +1565,8 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_nodedev_la-node_device.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_nodedev_la-node_device_devkit.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_nodedev_la-node_device_hal.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_one_la-one_conf.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_one_la-one_driver.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_qemu_la-qemu_conf.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_qemu_la-qemu_driver.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_remote_la-remote_internal.Plo@am__quote@
+@@ -1717,6 +1746,20 @@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_nodedev_la_CFLAGS) $(CFLAGS) -c -o libvirt_driver_nodedev_la-node_device_devkit.lo `test -f 'node_device_devkit.c' || echo '$(srcdir)/'`node_device_devkit.c
+ 
++libvirt_driver_one_la-one_conf.lo: one_conf.c
++@am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_one_la_CFLAGS) $(CFLAGS) -MT libvirt_driver_one_la-one_conf.lo -MD -MP -MF $(DEPDIR)/libvirt_driver_one_la-one_conf.Tpo -c -o libvirt_driver_one_la-one_conf.lo `test -f 'one_conf.c' || echo '$(srcdir)/'`one_conf.c
++@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libvirt_driver_one_la-one_conf.Tpo $(DEPDIR)/libvirt_driver_one_la-one_conf.Plo
++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='one_conf.c' object='libvirt_driver_one_la-one_conf.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_one_la_CFLAGS) $(CFLAGS) -c -o libvirt_driver_one_la-one_conf.lo `test -f 'one_conf.c' || echo '$(srcdir)/'`one_conf.c
++
++libvirt_driver_one_la-one_driver.lo: one_driver.c
++@am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_one_la_CFLAGS) $(CFLAGS) -MT libvirt_driver_one_la-one_driver.lo -MD -MP -MF $(DEPDIR)/libvirt_driver_one_la-one_driver.Tpo -c -o libvirt_driver_one_la-one_driver.lo `test -f 'one_driver.c' || echo '$(srcdir)/'`one_driver.c
++@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libvirt_driver_one_la-one_driver.Tpo $(DEPDIR)/libvirt_driver_one_la-one_driver.Plo
++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='one_driver.c' object='libvirt_driver_one_la-one_driver.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_one_la_CFLAGS) $(CFLAGS) -c -o libvirt_driver_one_la-one_driver.lo `test -f 'one_driver.c' || echo '$(srcdir)/'`one_driver.c
++
+ libvirt_driver_qemu_la-qemu_conf.lo: qemu_conf.c
+ @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_qemu_la_CFLAGS) $(CFLAGS) -MT libvirt_driver_qemu_la-qemu_conf.lo -MD -MP -MF $(DEPDIR)/libvirt_driver_qemu_la-qemu_conf.Tpo -c -o libvirt_driver_qemu_la-qemu_conf.lo `test -f 'qemu_conf.c' || echo '$(srcdir)/'`qemu_conf.c
+ @am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libvirt_driver_qemu_la-qemu_conf.Tpo $(DEPDIR)/libvirt_driver_qemu_la-qemu_conf.Plo
+Index: libvirt-0.5.1/configure
+===================================================================
+--- libvirt-0.5.1.orig/configure	2009-01-08 22:59:01.084438479 +0100
++++ libvirt-0.5.1/configure	2009-01-08 22:59:07.472460140 +0100
+@@ -1239,6 +1239,9 @@
+ WITH_XEN_FALSE
+ XEN_CFLAGS
+ XEN_LIBS
++ONE_LIBS
++WITH_ONE_TRUE
++WITH_ONE_FALSE
+ WITH_XEN_INOTIFY_TRUE
+ WITH_XEN_INOTIFY_FALSE
+ PKG_CONFIG
+@@ -2006,6 +2009,15 @@
+   --with-lxc              add Linux Container support (on)
+   --with-test             add test driver support (on)
+   --with-remote           add remote driver support (on)
++
++  --with-one              add ONE support (on)
++# Check whether --with-one was given.
++if test "${with_one+set}" = set; then
++  withval=$with_one;
++else
++  with_one=yes
++fi
++
+   --with-libvirtd         add libvirtd support (on)
+   --with-remote-pid-file=pidfile|none
+                           PID file for libvirtd
+@@ -5270,11 +5282,13 @@
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+-#include <stdio.h>
++#include <sys/types.h> /* for off_t */
++     #include <stdio.h>
+ int
+ main ()
+ {
+-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
++int (*fp) (FILE *, off_t, int) = fseeko;
++     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+   ;
+   return 0;
+ }
+@@ -5314,11 +5328,13 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ #define _LARGEFILE_SOURCE 1
+-#include <stdio.h>
++#include <sys/types.h> /* for off_t */
++     #include <stdio.h>
+ int
+ main ()
+ {
+-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
++int (*fp) (FILE *, off_t, int) = fseeko;
++     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+   ;
+   return 0;
+ }
+@@ -25252,7 +25268,7 @@
+   ;;
+ *-*-irix6*)
+   # Find out which ABI we are using.
+-  echo '#line 25255 "configure"' > conftest.$ac_ext
++  echo '#line 25271 "configure"' > conftest.$ac_ext
+   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+   ac_status=$?
+@@ -27806,11 +27822,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:27809: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:27825: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:27813: \$? = $ac_status" >&5
++   echo "$as_me:27829: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -28096,11 +28112,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:28099: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:28115: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:28103: \$? = $ac_status" >&5
++   echo "$as_me:28119: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -28200,11 +28216,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:28203: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:28219: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:28207: \$? = $ac_status" >&5
++   echo "$as_me:28223: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -30551,7 +30567,7 @@
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<EOF
+-#line 30554 "configure"
++#line 30570 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -30651,7 +30667,7 @@
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<EOF
+-#line 30654 "configure"
++#line 30670 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -33071,11 +33087,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:33074: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:33090: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:33078: \$? = $ac_status" >&5
++   echo "$as_me:33094: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -33175,11 +33191,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:33178: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:33194: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:33182: \$? = $ac_status" >&5
++   echo "$as_me:33198: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -34739,11 +34755,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:34742: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:34758: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:34746: \$? = $ac_status" >&5
++   echo "$as_me:34762: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -34843,11 +34859,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:34846: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:34862: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:34850: \$? = $ac_status" >&5
++   echo "$as_me:34866: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -37032,11 +37048,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:37035: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:37051: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:37039: \$? = $ac_status" >&5
++   echo "$as_me:37055: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -37322,11 +37338,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:37325: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:37341: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:37329: \$? = $ac_status" >&5
++   echo "$as_me:37345: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -37426,11 +37442,11 @@
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:37429: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:37445: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:37433: \$? = $ac_status" >&5
++   echo "$as_me:37449: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -42679,6 +42695,28 @@
+ 
+ 
+ 
++
++if test "$with_one" = "yes" ; then
++LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_ONE -I$ONE_LOCATION/include"
++ONE_LIBS="-L/usr/local/lib -lxmlrpc_client++ -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc++ -lxmlrpc_client -lxmlrpc_util -L$ONE_LOCATION/lib -loneapi"
++
++
++cat >>confdefs.h <<_ACEOF
++#define WITH_ONE 1
++_ACEOF
++
++fi
++ if test "$with_one" = "yes"; then
++  WITH_ONE_TRUE=
++  WITH_ONE_FALSE='#'
++else
++  WITH_ONE_TRUE='#'
++  WITH_ONE_FALSE=
++fi
++
++
++
++
+ if test "$with_xen" != "yes"; then
+     with_xen_inotify=no
+ fi
+@@ -50716,6 +50754,13 @@
+ Usually this means the macro was only invoked conditionally." >&2;}
+    { (exit 1); exit 1; }; }
+ fi
++if test -z "${WITH_ONE_TRUE}" && test -z "${WITH_ONE_FALSE}"; then
++  { { echo "$as_me:$LINENO: error: conditional \"WITH_ONE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"WITH_ONE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++   { (exit 1); exit 1; }; }
++fi
+ if test -z "${WITH_XEN_INOTIFY_TRUE}" && test -z "${WITH_XEN_INOTIFY_FALSE}"; then
+   { { echo "$as_me:$LINENO: error: conditional \"WITH_XEN_INOTIFY\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+@@ -52063,6 +52108,9 @@
+ WITH_XEN_FALSE!$WITH_XEN_FALSE$ac_delim
+ XEN_CFLAGS!$XEN_CFLAGS$ac_delim
+ XEN_LIBS!$XEN_LIBS$ac_delim
++ONE_LIBS!$ONE_LIBS$ac_delim
++WITH_ONE_TRUE!$WITH_ONE_TRUE$ac_delim
++WITH_ONE_FALSE!$WITH_ONE_FALSE$ac_delim
+ WITH_XEN_INOTIFY_TRUE!$WITH_XEN_INOTIFY_TRUE$ac_delim
+ WITH_XEN_INOTIFY_FALSE!$WITH_XEN_INOTIFY_FALSE$ac_delim
+ PKG_CONFIG!$PKG_CONFIG$ac_delim
+@@ -52075,9 +52123,6 @@
+ SASL_CFLAGS!$SASL_CFLAGS$ac_delim
+ SASL_LIBS!$SASL_LIBS$ac_delim
+ POLKIT_CFLAGS!$POLKIT_CFLAGS$ac_delim
+-POLKIT_LIBS!$POLKIT_LIBS$ac_delim
+-POLKIT_AUTH!$POLKIT_AUTH$ac_delim
+-HAVE_POLKIT_TRUE!$HAVE_POLKIT_TRUE$ac_delim
+ _ACEOF
+ 
+   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+@@ -52119,6 +52164,9 @@
+ ac_delim='%!_!# '
+ for ac_last_try in false false false false false :; do
+   cat >conf$$subs.sed <<_ACEOF
++POLKIT_LIBS!$POLKIT_LIBS$ac_delim
++POLKIT_AUTH!$POLKIT_AUTH$ac_delim
++HAVE_POLKIT_TRUE!$HAVE_POLKIT_TRUE$ac_delim
+ HAVE_POLKIT_FALSE!$HAVE_POLKIT_FALSE$ac_delim
+ AVAHI_CFLAGS!$AVAHI_CFLAGS$ac_delim
+ AVAHI_LIBS!$AVAHI_LIBS$ac_delim
+@@ -52213,9 +52261,6 @@
+ HAVE_DEVKIT_TRUE!$HAVE_DEVKIT_TRUE$ac_delim
+ HAVE_DEVKIT_FALSE!$HAVE_DEVKIT_FALSE$ac_delim
+ WITH_NODE_DEVICES_TRUE!$WITH_NODE_DEVICES_TRUE$ac_delim
+-WITH_NODE_DEVICES_FALSE!$WITH_NODE_DEVICES_FALSE$ac_delim
+-LIBOBJS!$LIBOBJS$ac_delim
+-LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+ 
+   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+@@ -52257,13 +52302,16 @@
+ ac_delim='%!_!# '
+ for ac_last_try in false false false false false :; do
+   cat >conf$$subs.sed <<_ACEOF
++WITH_NODE_DEVICES_FALSE!$WITH_NODE_DEVICES_FALSE$ac_delim
++LIBOBJS!$LIBOBJS$ac_delim
++LTLIBOBJS!$LTLIBOBJS$ac_delim
+ gl_LIBOBJS!$gl_LIBOBJS$ac_delim
+ gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim
+ gltests_LIBOBJS!$gltests_LIBOBJS$ac_delim
+ gltests_LTLIBOBJS!$gltests_LTLIBOBJS$ac_delim
+ _ACEOF
+ 
+-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 4; then
++  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then
+     break
+   elif $ac_last_try; then
+     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+@@ -52998,6 +53046,8 @@
+ echo "$as_me:      LXC: $with_lxc" >&6;}
+ { echo "$as_me:$LINENO:     Test: $with_test" >&5
+ echo "$as_me:     Test: $with_test" >&6;}
++{ echo "$as_me:$LINENO:      ONE: $with_one" >&5
++echo "$as_me:      ONE: $with_one" >&6;}
+ { echo "$as_me:$LINENO:   Remote: $with_remote" >&5
+ echo "$as_me:   Remote: $with_remote" >&6;}
+ { echo "$as_me:$LINENO:  Network: $with_network" >&5
+@@ -53103,6 +53153,10 @@
+ fi
+ { echo "$as_me:$LINENO: " >&5
+ echo "$as_me: " >&6;}
++if test "$with_one" = "yes" ; then
++{ echo "$as_me:$LINENO:   one: $ONE_LIBS" >&5
++echo "$as_me:   one: $ONE_LIBS" >&6;}
++fi
+ { echo "$as_me:$LINENO: Test suite" >&5
+ echo "$as_me: Test suite" >&6;}
+ { echo "$as_me:$LINENO: " >&5
+Index: libvirt-0.5.1/src/one_conf.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libvirt-0.5.1/src/one_conf.c	2009-01-08 22:59:17.843438436 +0100
+@@ -0,0 +1,130 @@
++/*----------------------------------------------------------------------------------*/
++/* Copyright 2002-2008, Distributed Systems Architecture Group, Universidad   
++ * Complutense de Madrid (dsa-research.org)                                   
++ *                                                                            
++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
++ */ 
++/*-----------------------------------------------------------------------------------*/
++
++
++/* includes */
++#include <config.h>
++
++#include <sys/utsname.h>
++
++#include "virterror_internal.h"
++#include "one_conf.h"
++
++virCapsPtr oneCapsInit(void){
++
++ 	struct utsname utsname;
++    virCapsPtr caps;
++    virCapsGuestPtr guest;
++
++    uname(&utsname);
++
++    if ((caps = virCapabilitiesNew(utsname.machine,
++                                   0, 0)) == NULL)
++        goto no_memory;
++
++    virCapabilitiesSetMacPrefix(caps, (unsigned char[]){ 0x52, 0x54, 0x00 });
++
++    if ((guest = virCapabilitiesAddGuest(caps,
++                                         "hvm",
++                                         utsname.machine,
++                                         sizeof(int) == 4 ? 32 : 8,
++                                         NULL,
++                                         NULL,
++                                         0,
++                                         NULL)) == NULL)
++        goto no_memory;
++
++    if (virCapabilitiesAddGuestDomain(guest,
++                                      "one",
++                                      NULL,
++                                      NULL,
++                                      0,
++                                      NULL) == NULL)
++        goto no_memory;
++    return caps;
++
++no_memory:
++    virCapabilitiesFree(caps);
++    return NULL;
++
++}
++
++int oneSubmitVM(virConnectPtr conn ATTRIBUTE_UNUSED ,one_driver_t* driver  ,virDomainObjPtr vm)
++{	
++	FILE* fd=NULL;
++	char path[20];
++    int oneid;
++	sprintf(path,"/tmp/onetempl%d",driver->nextid);	
++	if(!(fd=fopen(path,"w")  ) ){
++		 perror("temporal description file:");
++		 return 0;
++	}
++
++	if(xmlOneTemplate(vm->def,fd)){
++		unlink(path);
++        fclose(fd);
++        return -1;
++         }
++	fclose(fd);
++	if( (oneid=c_oneAllocate(path))<0 )
++			{
++			oneError(conn, NULL, VIR_ERR_OPERATION_FAILED,
++                        "Error submitting virtual machine to ONE");
++            unlink(path);             
++        	return -1;
++			};
++
++//    unlink(path);
++    return oneid;
++};
++
++ int xmlOneTemplate(virDomainDefPtr def, FILE* fd){
++
++	//set name:
++	fprintf(fd,"NAME = %s \n",def->name);
++    //set vcpu
++    fprintf(fd,"CPU = %ld \n",(def->vcpus));
++    //set memory:
++	fprintf(fd,"MEMORY = %ld \n",(def->maxmem)/1000);
++	
++    fprintf(fd,"OS = [\n  kernel   = \"%s\",\n  initrd   = \"%s\",\n",def->os.kernel,def->os.initrd);
++    if(def->os.cmdline) fprintf(fd,"  kernel_cmd = \"%s\",\n",def->os.cmdline);
++    fprintf(fd,"  root     = \"%s\" ]\n",def->os.root);
++
++//set Disks & NICS
++    int i;
++    for(i=0 ;i<def->ndisks;i++){
++ 		fprintf(fd,"DISK = [ \n  source   = \"%s\",\n  target   = \"%s\",",def->disks[i]->src,def->disks[i]->dst);
++		if(def->disks[i]->readonly) fprintf(fd,"\n  readonly = \"yes\"]\n");
++		else fprintf(fd,"\n  readonly = \"no\"]\n");
++        }
++    
++    for(i=0;i< def->nnets;i++){
++        fprintf(fd, "NIC= [\n");
++   //     if(def->nets[i]->target)
++     //     fprintf(fd,"  target = \"%s\",\n",def->nets[i]->target);
++       // if(def->nets[i]->bridge)
++         // fprintf(fd,"  bridge = \"%s\",\n",def->nets[i]->bridge);
++		fprintf(fd,"  mac=\"%02x:%02x:%02x:%02x:%02x:%02x\" ]\n",def->nets[i]->mac[0],def->nets[i]->mac[1],def->nets[i]->mac[2],def->nets[i]->mac[3],def->nets[i]->mac[4],def->nets[i]->mac[5]);
++	}
++    
++	return 0;
++   
++};
+Index: libvirt-0.5.1/src/one_conf.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libvirt-0.5.1/src/one_conf.h	2009-01-08 22:59:17.875436706 +0100
+@@ -0,0 +1,50 @@
++/*----------------------------------------------------------------------------------*/
++/* Copyright 2002-2008, Distributed Systems Architecture Group, Universidad   
++ * Complutense de Madrid (dsa-research.org)                                   
++ *                                                                            
++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
++ */ 
++/*-----------------------------------------------------------------------------------*/
++
++#ifndef ONE_CONF_H
++#define ONE_CONF_H
++
++#include <config.h>
++
++#include "internal.h"
++#include "domain_conf.h"
++#include "capabilities.h"
++
++typedef struct one_driver one_driver_t;
++struct one_driver {
++    PTHREAD_MUTEX_T(lock);
++
++    virCapsPtr caps;
++    virDomainObjList domains;
++	int nextid;
++    struct OneClient* one;   
++};
++
++
++virCapsPtr oneCapsInit(void);
++int oneSubmitVM(virConnectPtr conn ,one_driver_t* driver, virDomainObjPtr  vm);
++int xmlOneTemplate(virDomainDefPtr def, FILE* fd);
++
++#define oneError(conn, dom, code, fmt...)                                    \
++        virReportErrorHelper(conn, VIR_FROM_ONE, code, __FILE__,           \
++                               __FUNCTION__, __LINE__, fmt)
++
++#endif /* ONE_CONF_H */
++
+Index: libvirt-0.5.1/src/one_driver.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libvirt-0.5.1/src/one_driver.c	2009-01-08 22:59:17.895438969 +0100
+@@ -0,0 +1,724 @@
++/*----------------------------------------------------------------------------------*/
++/* Copyright 2002-2008, Distributed Systems Architecture Group, Universidad   
++ * Complutense de Madrid (dsa-research.org)                                   
++ *                                                                            
++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
++ */ 
++/*-----------------------------------------------------------------------------------*/
++
++#include <config.h>
++
++#include <fcntl.h>
++#include <sched.h>
++#include <sys/utsname.h>
++#include <stdbool.h>
++#include <string.h>
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <sys/un.h>
++#include <sys/poll.h>
++#include <unistd.h>
++#include <wait.h>
++#include <sys/time.h>
++
++#include "virterror_internal.h"
++#include "logging.h"
++#include "datatypes.h"
++#include "one_conf.h"
++#include "one_driver.h"
++#include "memory.h"
++#include "util.h"
++#include "bridge.h"
++#include "veth.h"
++#include "event.h"
++#include "cgroup.h"
++
++static int oneStart(void);
++
++static void oneDriverLock(one_driver_t* driver)
++{
++    pthread_mutex_lock(&driver->lock);
++}
++
++static void oneDriverUnlock(one_driver_t* driver)
++{
++    pthread_mutex_unlock(&driver->lock);
++}
++
++static one_driver_t *one_driver =NULL;
++
++/* Functions */
++
++static virDrvOpenStatus oneOpen(virConnectPtr conn,
++                                virConnectAuthPtr auth ATTRIBUTE_UNUSED,
++                                int flags ATTRIBUTE_UNUSED)
++{
++     /* Verify uri was specified */
++    if (conn->uri == NULL) {
++        conn->uri = xmlParseURI("one:///");
++        if (!conn->uri) {
++            oneError(conn, NULL, VIR_ERR_NO_MEMORY, NULL);
++            return VIR_DRV_OPEN_ERROR;
++        }
++    } else if (conn->uri->scheme == NULL ||
++               STRNEQ(conn->uri->scheme, "one")) {
++        goto declineConnection;
++    }
++	if(oneStart())
++		goto declineConnection;
++    conn->privateData = one_driver;
++    pthread_mutex_init(&one_driver->lock,NULL);
++    return VIR_DRV_OPEN_SUCCESS;
++
++declineConnection:
++    return VIR_DRV_OPEN_DECLINED;
++}
++
++static int oneClose(virConnectPtr conn)
++{	
++    if (one_driver == NULL)
++      return(-1);
++    oneDriverLock(one_driver);
++    virDomainObjListFree(&one_driver->domains);
++    virCapabilitiesFree(one_driver->caps);
++    oneDriverUnlock(one_driver);
++    VIR_FREE(one_driver);
++    conn->privateData = NULL;
++    return 0;
++}
++
++static virDomainPtr oneDomainLookupByID(virConnectPtr conn,
++                                        int id)
++{
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    virDomainPtr dom = NULL;
++    virDomainObjPtr vm = NULL;
++
++    oneDriverLock(driver);
++    vm = virDomainFindByID(&driver->domains, id);
++    oneDriverUnlock(driver);
++
++    if (!vm) {
++        oneError(conn, NULL, VIR_ERR_NO_DOMAIN, NULL);
++        goto return_point;
++    }
++
++    dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
++    if (dom) {
++        dom->id = vm->def->id;
++    }
++
++return_point:
++    if(vm){
++        virDomainObjUnlock(vm);
++        }
++    return dom;
++}
++
++static virDomainPtr oneDomainLookupByUUID(virConnectPtr conn,
++                                          const unsigned char *uuid)
++{
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    virDomainPtr dom = NULL;
++    virDomainObjPtr vm = NULL;
++
++    oneDriverLock(driver);
++    vm = virDomainFindByUUID(&driver->domains, uuid);
++    oneDriverUnlock(driver);
++    if (!vm) {
++        oneError(conn, NULL, VIR_ERR_NO_DOMAIN, NULL);
++        goto return_point;
++    }
++
++    dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
++    if (dom) {
++        dom->id = vm->def->id;
++    }
++
++return_point:
++    if(vm){
++        virDomainObjUnlock(vm);
++        }
++    return dom;
++}
++
++static virDomainPtr oneDomainLookupByName(virConnectPtr conn,
++                                          const char *name)
++{
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    virDomainObjPtr vm = NULL;
++    virDomainPtr dom=NULL;
++
++    oneDriverLock(driver);
++    vm = virDomainFindByName(&driver->domains, name);
++    oneDriverUnlock(driver);
++
++    if (!vm) {
++        oneError(conn, NULL, VIR_ERR_NO_DOMAIN, NULL);
++        goto return_point;
++    }
++
++    dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
++    if (dom) {
++        dom->id = vm->def->id;
++    }
++return_point:
++    if(vm){
++        virDomainObjUnlock(vm);
++         }
++    return dom;
++}
++
++static int oneListDomains(virConnectPtr conn, int *ids, int nids) {
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    int got = 0, i;
++
++    oneDriverLock(driver);
++    for (i = 0 ; i < driver->domains.count && got < nids ; i++){
++        if (virDomainIsActive(driver->domains.objs[i]))
++            ids[got++] = driver->domains.objs[i]->def->id;
++    }
++    oneDriverUnlock(driver);
++
++    return got;
++}
++static int oneNumDomains(virConnectPtr conn) {
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    int n = 0, i;
++
++    oneDriverLock(driver);
++    for (i = 0 ; i < driver->domains.count ; i++)
++        if (virDomainIsActive(driver->domains.objs[i]))
++            n++;
++    oneDriverUnlock(driver);
++
++    return n;
++}
++
++static int oneListDefinedDomains(virConnectPtr conn,
++                                 char **const names, int nnames) {
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    int got = 0, i;
++
++    oneDriverLock(driver);
++    for (i = 0 ; i < driver->domains.count && got < nnames ; i++) {
++        if (!virDomainIsActive(driver->domains.objs[i])) {
++            if (!(names[got++] = strdup(driver->domains.objs[i]->def->name))) {
++                oneError(conn, NULL, VIR_ERR_NO_MEMORY,
++                         "%s", _("failed to allocate space for VM name string"));
++                goto cleanup;
++            }
++        }
++    }
++
++    oneDriverUnlock(driver);
++    return got;
++
++ cleanup:
++    for (i = 0 ; i < got ; i++)
++        VIR_FREE(names[i]);
++    return -1;
++}
++
++
++static int oneNumDefinedDomains(virConnectPtr conn) {
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    int n = 0, i;
++
++    oneDriverLock(driver);
++    for (i = 0 ; i < driver->domains.count ; i++)
++        if (!virDomainIsActive(driver->domains.objs[i]))
++            n++;
++    oneDriverUnlock(driver);
++
++    return n;
++}
++
++
++
++static virDomainPtr oneDomainDefine(virConnectPtr conn, const char *xml){
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    virDomainDefPtr def;
++    virDomainObjPtr vm;
++    virDomainPtr dom=NULL;
++
++    oneDriverLock(driver);
++    if (!(def = virDomainDefParseString(conn, driver->caps, xml)))
++        return NULL;
++
++    vm = virDomainFindByName(&driver->domains, def->name);
++    if (vm) {
++          oneError(conn,NULL, VIR_ERR_OPERATION_FAILED,
++          _("Already an OpenNebula VM active with the id '%s'"),
++          def->name);
++          goto return_point;
++    }
++
++    if (!(vm = virDomainAssignDef(conn, &driver->domains, def))) {
++        virDomainDefFree(def);
++        return NULL;
++    }
++
++    vm->def->id = -1;
++
++    dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
++    if (dom) {
++        dom->id = vm->def->id;
++    }
++
++return_point:
++    virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return dom;
++}
++
++
++static int oneDomainUndefine(virDomainPtr dom)
++{
++    one_driver_t *driver = (one_driver_t *)dom->conn->privateData;
++    virDomainObjPtr vm = NULL;
++    int ret=-1;
++    
++    oneDriverLock(driver);
++    vm =virDomainFindByUUID(&driver->domains, dom->uuid);
++    if (!vm) {
++        oneError(dom->conn, NULL, VIR_ERR_INVALID_DOMAIN,
++                 "%s", _("no domain with matching uuid"));
++        goto return_point;
++    }
++    if (virDomainIsActive(vm)) {
++        oneError(dom->conn, NULL, VIR_ERR_INTERNAL_ERROR,
++                 "%s", _("cannot delete active domain"));
++        goto return_point;
++    }
++    virDomainRemoveInactive(&driver->domains, vm);
++    ret=0;
++
++
++return_point:
++    if(vm)
++        virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return ret;
++}
++
++static int oneDomainGetInfo(virDomainPtr dom,
++                            virDomainInfoPtr info)
++{
++    one_driver_t *driver = (one_driver_t *)dom->conn->privateData;
++    struct timeval tv;
++    virDomainObjPtr vm = NULL;
++    oneDriverLock(driver);
++    vm= virDomainFindByUUID(&driver->domains, dom->uuid);
++    oneDriverUnlock(driver);
++
++    if (!vm) {
++        oneError(dom->conn,NULL, VIR_ERR_INVALID_DOMAIN,
++                 "%s", _("no domain with matching uuid"));
++        return -1;
++    }
++
++    if(gettimeofday(&tv,NULL)<0){
++        oneError(dom->conn,NULL, VIR_ERR_INTERNAL_ERROR,
++                    "%s",_("getting time of day"));
++        virDomainObjUnlock(vm);
++        return -1;
++        }
++
++    if (!virDomainIsActive(vm)) {
++        info->cpuTime = 0;
++    } else {
++	  char vm_info[257];
++      c_oneVmInfo(vm->pid,vm_info,256);
++      //State:
++      char* cptr =strstr(vm_info,"LCM STATE");
++      cptr-=2;
++      int one_state=atoi(cptr);
++      switch(one_state){
++          case 3: if (vm->state!=VIR_DOMAIN_SHUTDOWN) vm->state=VIR_DOMAIN_RUNNING;break;
++          case 5: vm->state=VIR_DOMAIN_PAUSED;break;  /** pause */
++          case 6: vm->state=VIR_DOMAIN_SHUTOFF; /** done  */
++                  vm->def->id=-1;
++                  break;
++          case 7: vm->state=VIR_DOMAIN_CRASHED;break; /** error */
++          default: break;
++          };
++      //Memory:
++      cptr=strstr(vm_info,"MEMORY");  
++      cptr=index(cptr,':');
++      cptr++;
++      vm->def->memory = (atoi(cptr) / 1024 ) * 1000;
++      info->cpuTime = ((tv.tv_sec * 1000ll * 1000ll  * 1000ll) + (tv.tv_usec      * 1000ll));
++
++    }
++    
++    info->state = vm->state;
++    info->maxMem = vm->def->maxmem;
++    info->memory = vm->def->memory;
++    info->nrVirtCpu = 1;
++
++    virDomainObjUnlock(vm);
++    return 0;
++}
++
++static char *oneGetOSType(virDomainPtr dom)
++{
++
++    one_driver_t *driver = (one_driver_t *)dom->conn->privateData;
++    virDomainObjPtr vm = NULL;
++
++    oneDriverLock(driver);
++    vm =virDomainFindByUUID(&driver->domains, dom->uuid);
++    oneDriverUnlock(driver);
++    if (!vm) {
++        oneError(dom->conn, NULL, VIR_ERR_INVALID_DOMAIN,
++                 "%s", _("no domain with matching uuid"));
++        return NULL;
++    }
++
++    virDomainObjUnlock(vm);
++    return strdup(vm->def->os.type);
++}
++
++/**
++ * oneDomainStart:
++ * @dom: domain to start
++ *
++ * Looks up domain and starts it.
++ *
++ * Returns 0 on success or -1 in case of error
++ */
++static int oneDomainStart(virDomainPtr dom)
++{
++    virConnectPtr conn = dom->conn;
++    one_driver_t *driver = (one_driver_t *)(conn->privateData);
++    virDomainObjPtr vm = NULL;
++    int ret = -1;
++    
++    oneDriverLock(driver);
++    vm = virDomainFindByName(&driver->domains, dom->name);
++
++    if (!vm) {
++        oneError(conn, NULL, VIR_ERR_INVALID_DOMAIN,
++                 _("no domain named %s"), dom->name);
++        goto return_point;
++    }
++	int oneid;
++    if((oneid = oneSubmitVM(dom->conn,driver,vm)) <0){
++        goto return_point;
++    }
++    vm->pid=oneid;
++    vm->def->id=driver->nextid++;
++    vm->state=VIR_DOMAIN_BLOCKED;
++    ret=0;
++
++return_point:
++    if(vm)
++        virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return ret;
++
++
++}
++
++/**
++ * oneDomainCreateAndStart:
++ * @conn: pointer to connection
++ * @xml: XML definition of domain
++ * @flags: Unused
++ *
++ * Creates a domain based on xml and starts it
++ *
++ * Returns 0 on success or -1 in case of error
++ */
++static virDomainPtr
++oneDomainCreateAndStart(virConnectPtr conn,
++                        const char *xml,
++                        unsigned int flags ATTRIBUTE_UNUSED) {
++    one_driver_t *driver = (one_driver_t *)conn->privateData;
++    virDomainObjPtr vm=NULL ;
++    virDomainDefPtr def;
++    virDomainPtr dom = NULL;
++	int oneid;
++
++    oneDriverLock(driver);
++    if (!(def = virDomainDefParseString(conn, driver->caps, xml)))
++        goto return_point;
++
++    vm = virDomainFindByName(&driver->domains, def->name);
++    if (vm) {
++            oneError(conn,NULL, VIR_ERR_OPERATION_FAILED,
++           _("Already an OpenNebula VM active with the id '%s'"),
++           def->name);
++        goto return_point;
++    }
++    if (!(vm = virDomainAssignDef(conn, &driver->domains, def))) {
++        virDomainDefFree(def);
++        goto return_point;
++    }
++
++    if ((oneid = oneSubmitVM(conn, driver, vm)) < 0) {
++        virDomainRemoveInactive(&driver->domains, vm);
++        goto return_point;
++    }
++    vm->def->id=driver->nextid++;
++    vm->pid=oneid;
++    vm->state=VIR_DOMAIN_BLOCKED;
++
++    dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
++    if (dom) {
++        dom->id = vm->def->id;
++    }
++return_point:
++    if(vm)
++        virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return dom;
++}
++
++/**
++ * oneDomainShutdown:
++ * @dom: Ptr to domain to shutdown
++ *
++ * Sends SIGINT to container root process to request it to shutdown
++ *
++ * Returns 0 on success or -1 in case of error
++ */
++static int oneDomainShutdown(virDomainPtr dom)
++{
++    one_driver_t *driver = (one_driver_t*)dom->conn->privateData;
++    virDomainObjPtr vm=NULL;
++    int ret=-1;
++
++    oneDriverLock(driver);
++     if((vm=virDomainFindByID(&driver->domains, dom->id))){
++
++		if(!(c_oneShutdown(vm->pid) ) ) {
++        	vm->state=VIR_DOMAIN_SHUTDOWN;
++			ret= 0;
++            goto return_point;
++		  }
++		oneError( dom->conn,NULL, VIR_ERR_OPERATION_FAILED,"Domain Shutdown",NULL);
++		goto return_point;
++	}
++    oneError(dom->conn,NULL, VIR_ERR_INVALID_DOMAIN,
++                 _("no domain with id %d"), dom->id);
++
++return_point:
++    if(vm)
++        virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return ret;
++    
++}
++
++
++/**
++ * oneDomainDestroy:
++ * @dom: Ptr to domain to destroy
++ *
++ * Sends SIGKILL to container root process to terminate the container
++ *
++ * Returns 0 on success or -1 in case of error
++ */
++static int oneDomainDestroy(virDomainPtr dom)
++{
++    one_driver_t *driver = (one_driver_t*)dom->conn->privateData;
++    virDomainObjPtr vm=NULL;
++
++    oneDriverLock(driver);    
++    vm= virDomainFindByID(&driver->domains, dom->id);
++    if (!vm) {
++        oneError(dom->conn, NULL, VIR_ERR_INVALID_DOMAIN,
++                 _("no domain with id %d"), dom->id);
++        oneDriverUnlock(driver);
++        return -1;
++    }
++    virDomainRemoveInactive(&driver->domains, vm);
++    virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return 0;
++}
++static int
++oneDomainSuspend(virDomainPtr dom){
++
++	one_driver_t* driver=dom->conn->privateData;
++	virDomainObjPtr vm=NULL;
++	int ret=-1;
++    
++    oneDriverLock(driver);
++	if ((vm=virDomainFindByID(&driver->domains,dom->id))){
++
++      if (vm->state == VIR_DOMAIN_RUNNING) {
++        if( !(c_oneSuspend(vm->pid) )   ){
++           vm->state=VIR_DOMAIN_PAUSED;
++           ret=0;
++           goto return_point;
++           }    
++        oneError(dom->conn, NULL, VIR_ERR_OPERATION_FAILED,
++                                      "%s", "failed to pause domain");
++        goto return_point;
++        }
++      oneError(dom->conn,NULL,VIR_ERR_OPERATION_FAILED,
++                              "%s", "domain is not running");
++    }
++	else {
++        oneError(dom->conn, NULL, VIR_ERR_INVALID_DOMAIN,
++                         "no domain with matching id %d", dom->id);
++	  }   	
++
++return_point:
++    if(vm)
++        virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return ret;
++
++};
++
++
++static int 
++oneDomainResume(virDomainPtr dom){
++     one_driver_t* driver=dom->conn->privateData;
++     virDomainObjPtr vm=NULL;
++     int ret=-1;
++
++     oneDriverLock(driver);
++     if ((vm=virDomainFindByID(&driver->domains,dom->id))){
++
++        if (vm->state == VIR_DOMAIN_PAUSED) {
++           if( !(c_oneResume(vm->pid) )   ){
++              vm->state=VIR_DOMAIN_RUNNING;
++              ret=0;
++              goto return_point;
++           }                                                                               
++           oneError(dom->conn, NULL, VIR_ERR_OPERATION_FAILED,
++                                       "%s", "failed to resume ");
++           goto return_point;
++        } 
++       oneError(dom->conn,NULL,VIR_ERR_OPERATION_FAILED,
++                                 "%s", " domain is not paused ");
++     }
++     else {
++         oneError(dom->conn, NULL, VIR_ERR_INVALID_DOMAIN,
++                          "no domain with matching id %d", dom->id);
++     }       
++
++return_point:
++    if(vm)
++        virDomainObjUnlock(vm);
++    oneDriverUnlock(driver);
++    return ret;    
++};
++
++
++
++static int oneStart(void)
++{
++    if (VIR_ALLOC(one_driver) < 0) {
++        return -1;
++    }
++  
++    if ((one_driver->caps = oneCapsInit()) == NULL) {
++        VIR_FREE(one_driver);
++        return -1;
++    }
++	one_driver->nextid=1;
++	c_oneStart();
++    return 0;
++}
++
++
++static int oneVersion(virConnectPtr conn ATTRIBUTE_UNUSED , unsigned long *hvVer)
++{
++	*hvVer = 2;
++    return 0;
++}
++
++
++static int oneGetAutostart(virConnectPtr conn ATTRIBUTE_UNUSED)
++{
++    return 0;
++}
++
++/* Function Tables */
++static virDriver oneDriver = {
++    VIR_DRV_ONE, /* the number virDrvNo */
++    "ONE", /* the name of the driver */
++    oneOpen, /* open */
++    oneClose, /* close */
++    NULL, /* supports_feature */
++    NULL, /* type */
++    oneVersion, /* version */
++    NULL, /* getHostname */
++    NULL, /* getURI */
++    NULL, /* getMaxVcpus */
++    NULL, /* nodeGetInfo */
++    NULL, /* getCapabilities */
++    oneListDomains, /* listDomains */
++    oneNumDomains, /* numOfDomains */
++    oneDomainCreateAndStart, /* domainCreateXML */
++    oneDomainLookupByID, /* domainLookupByID */
++    oneDomainLookupByUUID, /* domainLookupByUUID */
++    oneDomainLookupByName, /* domainLookupByName */
++    oneDomainSuspend, /* domainSuspend */
++    oneDomainResume, /* domainResume */
++    oneDomainShutdown, /* domainShutdown */
++    NULL, /* domainReboot */
++    oneDomainDestroy, /* domainDestroy */
++    oneGetOSType, /* domainGetOSType */
++    NULL, /* domainGetMaxMemory */
++    NULL, /* domainSetMaxMemory */
++    NULL, /* domainSetMemory */
++    oneDomainGetInfo, /* domainGetInfo */
++    NULL, /* domainSave */
++    NULL, /* domainRestore */
++    NULL, /* domainCoreDump */
++    NULL, /* domainSetVcpus */
++    NULL, /* domainPinVcpu */
++    NULL, /* domainGetVcpus */
++    NULL, /* domainGetMaxVcpus */
++    NULL, /* domainDumpXML */
++    oneListDefinedDomains, /* listDefinedDomains */
++    oneNumDefinedDomains, /* numOfDefinedDomains */
++    oneDomainStart, /* domainCreate */
++    oneDomainDefine, /* domainDefineXML */
++    oneDomainUndefine, /* domainUndefine */
++    NULL, /* domainAttachDevice */
++    NULL, /* domainDetachDevice */
++    oneGetAutostart, /* domainGetAutostart */
++    NULL, /* domainSetAutostart */
++    NULL, /* domainGetSchedulerType */
++    NULL, /* domainGetSchedulerParameters */
++    NULL, /* domainSetSchedulerParameters */
++    NULL, /* domainMigratePrepare */
++    NULL, /* domainMigratePerform */
++    NULL, /* domainMigrateFinish */
++    NULL, /* domainBlockStats */
++    NULL, /* domainInterfaceStats */
++    NULL, /* domainBlockPeek */
++    NULL, /* domainMemoryPeek */
++    NULL, /* nodeGetCellsFreeMemory */
++    NULL, /* getFreeMemory */
++    NULL, /* domainEventRegister */
++    NULL, /* domainEventDeregister */
++    NULL, /* domainMigratePrepare2 */
++    NULL, /* domainMigrateFinish2 */
++};
++    
++int oneRegister(void)
++{
++    virRegisterDriver(&oneDriver);
++    return 0;
++}
+Index: libvirt-0.5.1/src/one_driver.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libvirt-0.5.1/src/one_driver.h	2009-01-08 22:59:17.919439995 +0100
+@@ -0,0 +1,30 @@
++/*----------------------------------------------------------------------------------*/
++/* Copyright 2002-2008, Distributed Systems Architecture Group, Universidad   
++ * Complutense de Madrid (dsa-research.org)                                   
++ *                                                                            
++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
++ */ 
++/*-----------------------------------------------------------------------------------*/
++
++
++#ifndef ONE_DRIVER_H
++#define ONE_DRIVER_H
++
++#include <config.h>
++
++/* Function declarations */
++int oneRegister(void);
++
++#endif /* ONE_DRIVER_H */
--- libvirt-0.6.1.orig/debian/patches/0003-allow-libvirt-group-to-access-the-socket.patch
+++ libvirt-0.6.1/debian/patches/0003-allow-libvirt-group-to-access-the-socket.patch
@@ -0,0 +1,48 @@
+From: Guido Guenther <agx@sigxcpu.org>
+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(-)
+
+Index: libvirt-0.6.0/qemud/libvirtd.conf
+===================================================================
+--- libvirt-0.6.0.orig/qemud/libvirtd.conf	2009-02-11 16:09:26.197209756 +0100
++++ libvirt-0.6.0/qemud/libvirtd.conf	2009-02-11 16:09:42.789211661 +0100
+@@ -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
+@@ -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"
+ 
+ 
+ 
+@@ -125,7 +125,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
+@@ -134,7 +134,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.6.1.orig/debian/patches/0007-better_default_uri_virsh.patch
+++ libvirt-0.6.1/debian/patches/0007-better_default_uri_virsh.patch
@@ -0,0 +1,29 @@
+Index: libvirt-0.4.2-5ubuntu1/src/virsh.c
+===================================================================
+--- libvirt-0.4.2-5ubuntu1.orig/src/virsh.c	2008-05-01 03:07:34.000000000 +0200
++++ libvirt-0.4.2-5ubuntu1/src/virsh.c	2008-05-01 22:50:36.403798885 +0200
+@@ -63,6 +63,8 @@
+ #define VSH_PROMPT_RW    "virsh # "
+ #define VSH_PROMPT_RO    "virsh > "
+ 
++#include "remote_internal.h"
++
+ #define GETTIMEOFDAY(T) gettimeofday(T, NULL)
+ #define DIFF_MSEC(T, U) \
+         ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \
+@@ -6566,8 +6568,15 @@
+ 
+     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 (!ctl->quiet)
++        fprintf(stderr, _("Connecting to uri: %s\n"), ctl->name);
++
+     if (!vshParseArgv(ctl, argc, argv)) {
+         vshDeinit(ctl);
+         exit(EXIT_FAILURE);
--- libvirt-0.6.1.orig/debian/patches/event-handling-fix-rh499698-lp362288.patch
+++ libvirt-0.6.1/debian/patches/event-handling-fix-rh499698-lp362288.patch
@@ -0,0 +1,443 @@
+Thanks to Bryan McLellan for porting to Ubuntu from upstream.
+See:
+ * https://bugzilla.redhat.com/show_bug.cgi?id=499698
+ * https://bugzilla.redhat.com/attachment.cgi?id=343109
+
+
+Index: libvirt-0.6.1/qemud/event.c
+===================================================================
+--- libvirt-0.6.1.orig/qemud/event.c	2009-07-14 08:45:14.000000000 -0700
++++ libvirt-0.6.1/qemud/event.c	2009-07-14 08:45:22.000000000 -0700
+@@ -30,7 +30,8 @@
+ #include <errno.h>
+ #include <unistd.h>
+ 
+-#include "qemud.h"
++#include "threads.h"
++#include "logging.h"
+ #include "event.h"
+ #include "memory.h"
+ #include "util.h"
+@@ -83,10 +84,10 @@
+ static struct virEventLoop eventLoop;
+ 
+ /* Unique ID for the next FD watch to be registered */
+-static int nextWatch = 0;
++static int nextWatch = 1;
+ 
+ /* Unique ID for the next timer to be registered */
+-static int nextTimer = 0;
++static int nextTimer = 1;
+ 
+ static void virEventLock(void)
+ {
+@@ -142,15 +143,22 @@
+ 
+ void virEventUpdateHandleImpl(int watch, int events) {
+     int i;
++    EVENT_DEBUG("Update handle w=%d e=%d", watch, events);
++
++    if (watch <= 0) {
++        VIR_WARN("Ignoring invalid update watch %d", watch);
++        return;
++    }
++
+     virEventLock();
+     for (i = 0 ; i < eventLoop.handlesCount ; i++) {
+         if (eventLoop.handles[i].watch == watch) {
+             eventLoop.handles[i].events =
+                     virEventHandleTypeToPollEvent(events);
++            virEventInterruptLocked();
+             break;
+         }
+     }
+-    virEventInterruptLocked();
+     virEventUnlock();
+ }
+ 
+@@ -163,6 +171,12 @@
+ int virEventRemoveHandleImpl(int watch) {
+     int i;
+     EVENT_DEBUG("Remove handle %d", watch);
++
++    if (watch <= 0) {
++        VIR_WARN("Ignoring invalid remove watch %d", watch);
++        return -1;
++    }
++
+     virEventLock();
+     for (i = 0 ; i < eventLoop.handlesCount ; i++) {
+         if (eventLoop.handles[i].deleted)
+@@ -171,11 +185,11 @@
+         if (eventLoop.handles[i].watch == watch) {
+             EVENT_DEBUG("mark delete %d %d", i, eventLoop.handles[i].fd);
+             eventLoop.handles[i].deleted = 1;
++            virEventInterruptLocked();
+             virEventUnlock();
+             return 0;
+         }
+     }
+-    virEventInterruptLocked();
+     virEventUnlock();
+     return -1;
+ }
+@@ -231,6 +245,12 @@
+     struct timeval tv;
+     int i;
+     EVENT_DEBUG("Updating timer %d timeout with %d ms freq", timer, frequency);
++
++    if (timer <= 0) {
++        VIR_WARN("Ignoring invalid update timer %d", timer);
++        return;
++    }
++
+     if (gettimeofday(&tv, NULL) < 0) {
+         return;
+     }
+@@ -243,10 +263,10 @@
+                 frequency >= 0 ? frequency +
+                 (((unsigned long long)tv.tv_sec)*1000) +
+                 (((unsigned long long)tv.tv_usec)/1000) : 0;
++            virEventInterruptLocked();
+             break;
+         }
+     }
+-    virEventInterruptLocked();
+     virEventUnlock();
+ }
+ 
+@@ -259,6 +279,12 @@
+ int virEventRemoveTimeoutImpl(int timer) {
+     int i;
+     EVENT_DEBUG("Remove timer %d", timer);
++
++    if (timer <= 0) {
++        VIR_WARN("Ignoring invalid remove timer %d", timer);
++        return -1;
++    }
++
+     virEventLock();
+     for (i = 0 ; i < eventLoop.timeoutsCount ; i++) {
+         if (eventLoop.timeouts[i].deleted)
+@@ -266,11 +292,11 @@
+ 
+         if (eventLoop.timeouts[i].timer == timer) {
+             eventLoop.timeouts[i].deleted = 1;
++            virEventInterruptLocked();
+             virEventUnlock();
+             return 0;
+         }
+     }
+-    virEventInterruptLocked();
+     virEventUnlock();
+     return -1;
+ }
+@@ -287,7 +313,7 @@
+     EVENT_DEBUG("Calculate expiry of %d timers", eventLoop.timeoutsCount);
+     /* Figure out if we need a timeout */
+     for (i = 0 ; i < eventLoop.timeoutsCount ; i++) {
+-        if (eventLoop.timeouts[i].deleted || eventLoop.timeouts[i].frequency < 0)
++        if (eventLoop.timeouts[i].frequency < 0)
+             continue;
+ 
+         EVENT_DEBUG("Got a timeout scheduled for %llu", eventLoop.timeouts[i].expiresAt);
+@@ -324,32 +350,26 @@
+  * file handles. The caller must free the returned data struct
+  * returns: the pollfd array, or NULL on error
+  */
+-static int virEventMakePollFDs(struct pollfd **retfds) {
++static struct pollfd *virEventMakePollFDs(void) {
+     struct pollfd *fds;
+-    int i, nfds = 0;
++    int i;
+ 
+-    for (i = 0 ; i < eventLoop.handlesCount ; i++) {
+-        if (eventLoop.handles[i].deleted)
+-            continue;
+-        nfds++;
+-    }
+-    *retfds = NULL;
+     /* Setup the poll file handle data structs */
+-    if (VIR_ALLOC_N(fds, nfds) < 0)
+-        return -1;
++    if (VIR_ALLOC_N(fds, eventLoop.handlesCount) < 0)
++        return NULL;
+ 
+-    for (i = 0, nfds = 0 ; i < eventLoop.handlesCount ; i++) {
+-        if (eventLoop.handles[i].deleted)
+-            continue;
+-        fds[nfds].fd = eventLoop.handles[i].fd;
+-        fds[nfds].events = eventLoop.handles[i].events;
+-        fds[nfds].revents = 0;
++    for (i = 0 ; i < eventLoop.handlesCount ; i++) {
++        EVENT_DEBUG("Prepare n=%d w=%d, f=%d e=%d", i,
++                    eventLoop.handles[i].watch,
++                    eventLoop.handles[i].fd,
++                    eventLoop.handles[i].events);
++        fds[i].fd = eventLoop.handles[i].fd;
++        fds[i].events = eventLoop.handles[i].events;
++        fds[i].revents = 0;
+         //EVENT_DEBUG("Wait for %d %d", eventLoop.handles[i].fd, eventLoop.handles[i].events);
+-        nfds++;
+     }
+ 
+-    *retfds = fds;
+-    return nfds;
++    return fds;
+ }
+ 
+ 
+@@ -409,26 +429,30 @@
+  * Returns 0 upon success, -1 if an error occurred
+  */
+ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
+-    int i, n;
++    int i;
+ 
+-    for (i = 0, n = 0 ; i < eventLoop.handlesCount && n < nfds ; i++) {
++    /* NB, use nfds not eventLoop.handlesCount, because new
++     * fds might be added on end of list, and they're not
++     * in the fds array we've got */
++    for (i = 0 ; i < nfds ; i++) {
+         if (eventLoop.handles[i].deleted) {
+-            EVENT_DEBUG("Skip deleted %d", eventLoop.handles[i].fd);
++            EVENT_DEBUG("Skip deleted n=%d w=%d f=%d", i,
++                        eventLoop.handles[i].watch, eventLoop.handles[i].fd);
+             continue;
+         }
+ 
+-        if (fds[n].revents) {
++        if (fds[i].revents) {
+             virEventHandleCallback cb = eventLoop.handles[i].cb;
+             void *opaque = eventLoop.handles[i].opaque;
+-            int hEvents = virPollEventToEventHandleType(fds[n].revents);
+-            EVENT_DEBUG("Dispatch %d %d %p", fds[n].fd,
+-                        fds[n].revents, eventLoop.handles[i].opaque);
++            int hEvents = virPollEventToEventHandleType(fds[i].revents);
++            EVENT_DEBUG("Dispatch n=%d f=%d w=%d e=%d %p", i,
++                        fds[i].fd, eventLoop.handles[i].watch,
++                        fds[i].revents, eventLoop.handles[i].opaque);
+             virEventUnlock();
+             (cb)(eventLoop.handles[i].watch,
+-                 fds[n].fd, hEvents, opaque);
++                 fds[i].fd, hEvents, opaque);
+             virEventLock();
+         }
+-        n++;
+     }
+ 
+     return 0;
+@@ -519,22 +543,21 @@
+  * at least one file handle has an event, or a timer expires
+  */
+ int virEventRunOnce(void) {
+-    struct pollfd *fds;
++    struct pollfd *fds = NULL;
+     int ret, timeout, nfds;
+ 
+     virEventLock();
+     eventLoop.running = 1;
+     eventLoop.leader = pthread_self();
+-    if ((nfds = virEventMakePollFDs(&fds)) < 0) {
+-        virEventUnlock();
+-        return -1;
+-    }
+ 
+-    if (virEventCalculateTimeout(&timeout) < 0) {
+-        VIR_FREE(fds);
+-        virEventUnlock();
+-        return -1;
+-    }
++    if (virEventCleanupTimeouts() < 0 ||
++        virEventCleanupHandles() < 0)
++        goto error;
++
++    if (!(fds = virEventMakePollFDs()) ||
++        virEventCalculateTimeout(&timeout) < 0)
++        goto error;
++    nfds = eventLoop.handlesCount;
+ 
+     virEventUnlock();
+ 
+@@ -546,38 +569,31 @@
+         if (errno == EINTR) {
+             goto retry;
+         }
+-        VIR_FREE(fds);
+-        return -1;
++        goto error_unlocked;
+     }
+ 
+     virEventLock();
+-    if (virEventDispatchTimeouts() < 0) {
+-        VIR_FREE(fds);
+-        virEventUnlock();
+-        return -1;
+-    }
++    if (virEventDispatchTimeouts() < 0)
++        goto error;
+ 
+     if (ret > 0 &&
+-        virEventDispatchHandles(nfds, fds) < 0) {
+-        VIR_FREE(fds);
+-        virEventUnlock();
+-        return -1;
+-    }
+-    VIR_FREE(fds);
++        virEventDispatchHandles(nfds, fds) < 0)
++        goto error;
+ 
+-    if (virEventCleanupTimeouts() < 0) {
+-        virEventUnlock();
+-        return -1;
+-    }
+-
+-    if (virEventCleanupHandles() < 0) {
+-        virEventUnlock();
+-        return -1;
+-    }
++    if (virEventCleanupTimeouts() < 0 ||
++        virEventCleanupHandles() < 0)
++        goto error;
+ 
+     eventLoop.running = 0;
+     virEventUnlock();
++    VIR_FREE(fds);
+     return 0;
++
++error:
++    virEventUnlock();
++error_unlocked:
++    VIR_FREE(fds);
++    return -1;
+ }
+ 
+ static void virEventHandleWakeup(int watch ATTRIBUTE_UNUSED,
+@@ -597,10 +613,10 @@
+         return -1;
+ 
+     if (pipe(eventLoop.wakeupfd) < 0 ||
+-        qemudSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
+-        qemudSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
+-        qemudSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
+-        qemudSetCloseExec(eventLoop.wakeupfd[1]) < 0)
++        virSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
++        virSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
++        virSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
++        virSetCloseExec(eventLoop.wakeupfd[1]) < 0)
+         return -1;
+ 
+     if (virEventAddHandleImpl(eventLoop.wakeupfd[0],
+@@ -616,9 +632,12 @@
+     char c = '\0';
+ 
+     if (!eventLoop.running ||
+-        pthread_self() == eventLoop.leader)
++        pthread_self() == eventLoop.leader) {
++        VIR_DEBUG("Skip interrupt, %d %d", eventLoop.running, (int)eventLoop.leader);
+         return 0;
++    }
+ 
++    VIR_DEBUG0("Interrupting");
+     if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
+         return -1;
+     return 0;
+Index: libvirt-0.6.1/qemud/qemud.c
+===================================================================
+--- libvirt-0.6.1.orig/qemud/qemud.c	2009-07-14 08:45:09.000000000 -0700
++++ libvirt-0.6.1/qemud/qemud.c	2009-07-14 08:45:22.000000000 -0700
+@@ -371,32 +371,6 @@
+     virMutexUnlock(&server->lock);
+ }
+ 
+-int qemudSetCloseExec(int fd) {
+-    int flags;
+-    if ((flags = fcntl(fd, F_GETFD)) < 0)
+-        goto error;
+-    flags |= FD_CLOEXEC;
+-    if ((fcntl(fd, F_SETFD, flags)) < 0)
+-        goto error;
+-    return 0;
+- error:
+-    VIR_ERROR0(_("Failed to set close-on-exec file descriptor flag"));
+-    return -1;
+-}
+-
+-
+-int qemudSetNonBlock(int fd) {
+-    int flags;
+-    if ((flags = fcntl(fd, F_GETFL)) < 0)
+-        goto error;
+-    flags |= O_NONBLOCK;
+-    if ((fcntl(fd, F_SETFL, flags)) < 0)
+-        goto error;
+-    return 0;
+- error:
+-    VIR_ERROR0(_("Failed to set non-blocking file descriptor flag"));
+-    return -1;
+-}
+ 
+ static int qemudGoDaemon(void) {
+     int pid = fork();
+@@ -525,8 +499,8 @@
+         goto cleanup;
+     }
+ 
+-    if (qemudSetCloseExec(sock->fd) < 0 ||
+-        qemudSetNonBlock(sock->fd) < 0)
++    if (virSetCloseExec(sock->fd) < 0 ||
++        virSetNonBlock(sock->fd) < 0)
+         goto cleanup;
+ 
+     memset(&addr, 0, sizeof(addr));
+@@ -687,8 +661,8 @@
+         else
+             sock->port = -1;
+ 
+-        if (qemudSetCloseExec(sock->fd) < 0 ||
+-            qemudSetNonBlock(sock->fd) < 0)
++        if (virSetCloseExec(sock->fd) < 0 ||
++            virSetNonBlock(sock->fd) < 0)
+             goto cleanup;
+ 
+         if (listen (sock->fd, 30) < 0) {
+@@ -1273,8 +1247,8 @@
+     setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&no_slow_start,
+                 sizeof no_slow_start);
+ 
+-    if (qemudSetCloseExec(fd) < 0 ||
+-        qemudSetNonBlock(fd) < 0) {
++    if (virSetCloseExec(fd) < 0 ||
++        virSetNonBlock(fd) < 0) {
+         close(fd);
+         return -1;
+     }
+@@ -2849,10 +2823,10 @@
+         goto error1;
+ 
+     if (pipe(sigpipe) < 0 ||
+-        qemudSetNonBlock(sigpipe[0]) < 0 ||
+-        qemudSetNonBlock(sigpipe[1]) < 0 ||
+-        qemudSetCloseExec(sigpipe[0]) < 0 ||
+-        qemudSetCloseExec(sigpipe[1]) < 0) {
++        virSetNonBlock(sigpipe[0]) < 0 ||
++        virSetNonBlock(sigpipe[1]) < 0 ||
++        virSetCloseExec(sigpipe[0]) < 0 ||
++        virSetCloseExec(sigpipe[1]) < 0) {
+         char ebuf[1024];
+         VIR_ERROR(_("Failed to create pipe: %s"),
+                   virStrerror(errno, ebuf, sizeof ebuf));
+Index: libvirt-0.6.1/qemud/qemud.h
+===================================================================
+--- libvirt-0.6.1.orig/qemud/qemud.h	2009-07-14 08:45:11.000000000 -0700
++++ libvirt-0.6.1/qemud/qemud.h	2009-07-14 08:45:22.000000000 -0700
+@@ -198,9 +198,6 @@
+     ATTRIBUTE_FORMAT(printf,2,3);
+ 
+ 
+-int qemudSetCloseExec(int fd);
+-int qemudSetNonBlock(int fd);
+-
+ int
+ remoteDispatchClientRequest (struct qemud_server *server,
+                              struct qemud_client *client,
--- libvirt-0.6.1.orig/debian/patches/series
+++ libvirt-0.6.1/debian/patches/series
@@ -0,0 +1,16 @@
+0001-remove-RHism.diff.patch
+#0002-qemu-disable-network.diff.patch
+0003-allow-libvirt-group-to-access-the-socket.patch
+0005-minimal-workaround-for-qemu-startup-race.patch
+# Ubuntu specific patches:
+0005-delayed_iff_up_bridge.patch
+0006-dont_clobber_existing_bridges.patch
+0007-better_default_uri_virsh.patch
+dynamic_bridge_names.patch
+#opennebula.diff
+0008-increase-logoutput-timeout.patch
+event-loop-hang.diff -p0
+xen-events-handling-fix.diff
+more-flexible-emulator-on-x86.patch -p0
+default-arch.patch
+event-handling-fix-rh499698-lp362288.patch
--- libvirt-0.6.1.orig/debian/patches/0005-delayed_iff_up_bridge.patch
+++ libvirt-0.6.1/debian/patches/0005-delayed_iff_up_bridge.patch
@@ -0,0 +1,24 @@
+--- libvirt-0.4.0.orig/src/bridge.c
++++ libvirt-0.4.0/src/bridge.c
+@@ -254,7 +254,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
+@@ -413,7 +416,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.6.1.orig/debian/patches/more-flexible-emulator-on-x86.patch
+++ libvirt-0.6.1/debian/patches/more-flexible-emulator-on-x86.patch
@@ -0,0 +1,406 @@
+Currently we are pretty strict about what emulator binary we allow for
+QEMU guests on x86 arches. In particular, for arch+domain type combos:
+
+ - i686+qemu must use 'qemu' binary
+ - x86_64+qemu must use 'qemu-system-x86_64' binary
+ - kvm must use 'qemu-kvm' or 'kvm' binaries
+ - i686+kvm on x86_64 host is not allowed
+
+These restrictions are overkill because
+
+ - i686+qemu could use 'qemu-system-x86_64' if '-cpu qemu32' is added
+ - i686+qemu could use 'qemu-kvm' if '-cpu qemu32 -no-kvm' is added
+ - x86_64+qemu could use 'qemu-kvm' if '-no-kvm' is added
+ - i686+kvm on x86_64 host can be used if '-cpu qemu32' is added
+
+This patch makes QEMU driver more flexible in this way when setting up
+its capabilities information. It also makes it aware of the -no-kvm
+and -cpu flag, using them where required by the os type + arch + emulator
+combinations specified in the guest XML.
+
+This should finally remove the confusion where a user in virt-manager
+selectrs 'i686' and then wonders why we've disallowed choice of 'kvm'.
+It also fixes 'virsh version' when only qemu-kvm is installed.
+
+The matrix should now work thus:
+
+1. qemu, qemu-system-x86_64, qemu-kvm all available
+
+     qemu+i686   => qemu
+     qemu+x86_64 => qemu-system-x86_64
+     kvm+i686    => qemu-kvm -cpu qemu32
+     kvm+x86_64  => qemu-kvm
+
+2. qemu, qemu-kvm available
+
+     qemu+i686   => qemu
+     qemu+x86_64 => qemu-kvm -no-kvm
+     kvm+i686    => qemu-kvm -cpu qemu32
+     kvm+x86_64  => qemu-kvm
+
+3. qemu-system-x86_64, qemu-kvm available
+
+     qemu+i686   => qemu-system-x86_64 -cpu qemu32
+     qemu+x86_64 => qemu-system-x86_64
+     kvm+i686    => qemu-kvm -cpu qemu32
+     kvm+x86_64  => qemu-kvm
+
+4. qemu-kvm available
+
+     qemu+i686   => qemu-kvm -no-kvm -cpu qemu32
+     qemu+x86_64 => qemu-kvm -no-kvm
+     kvm+i686    => qemu-kvm -cpu qemu32
+     kvm+x86_64  => qemu-kvm
+
+
+The only real remaining problem is that we don't cope with scenario
+where the KVM enabled binary is called 'qemu-system-x64_64' instead
+of 'qemu-kvm' or 'kvm'.
+
+Regards,
+Daniel
+
+Index: src/qemu_conf.c
+===================================================================
+RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
+retrieving revision 1.138
+diff -u -p -r1.138 qemu_conf.c
+--- src/qemu_conf.c	16 Mar 2009 13:54:26 -0000	1.138
++++ src/qemu_conf.c	16 Mar 2009 17:53:20 -0000
+@@ -211,6 +211,7 @@ struct qemu_arch_info {
+     const char *const *machines;
+     int nmachines;
+     const char *binary;
++    const char *altbinary;
+     const struct qemu_feature_flags *flags;
+     int nflags;
+ };
+@@ -231,24 +232,24 @@ static const struct qemu_feature_flags c
+ /* The archicture tables for supported QEMU archs */
+ static const struct qemu_arch_info const arch_info_hvm[] = {
+     {  "i686", 32, arch_info_hvm_x86_machines, 2,
+-       "/usr/bin/qemu", arch_info_i686_flags, 4 },
++       "/usr/bin/qemu", "/usr/bin/qemu-system-x86_64", arch_info_i686_flags, 4 },
+     {  "x86_64", 64, arch_info_hvm_x86_machines, 2,
+-       "/usr/bin/qemu-system-x86_64", arch_info_x86_64_flags, 2 },
++       "/usr/bin/qemu-system-x86_64", NULL, arch_info_x86_64_flags, 2 },
+     {  "mips", 32, arch_info_hvm_mips_machines, 1,
+-       "/usr/bin/qemu-system-mips", NULL, 0 },
++       "/usr/bin/qemu-system-mips", NULL, NULL, 0 },
+     {  "mipsel", 32, arch_info_hvm_mips_machines, 1,
+-       "/usr/bin/qemu-system-mipsel", NULL, 0 },
++       "/usr/bin/qemu-system-mipsel", NULL, NULL, 0 },
+     {  "sparc", 32, arch_info_hvm_sparc_machines, 1,
+-       "/usr/bin/qemu-system-sparc", NULL, 0 },
++       "/usr/bin/qemu-system-sparc", NULL, NULL, 0 },
+     {  "ppc", 32, arch_info_hvm_ppc_machines, 3,
+-       "/usr/bin/qemu-system-ppc", NULL, 0 },
++       "/usr/bin/qemu-system-ppc", NULL, NULL, 0 },
+ };
+ 
+ static const struct qemu_arch_info const arch_info_xen[] = {
+     {  "i686", 32, arch_info_xen_x86_machines, 1,
+-       "/usr/bin/xenner", arch_info_i686_flags, 4 },
++       "/usr/bin/xenner", NULL, arch_info_i686_flags, 4 },
+     {  "x86_64", 64, arch_info_xen_x86_machines, 1,
+-       "/usr/bin/xenner", arch_info_x86_64_flags, 2 },
++       "/usr/bin/xenner", NULL, arch_info_x86_64_flags, 2 },
+ };
+ 
+ static int
+@@ -257,43 +258,62 @@ qemudCapsInitGuest(virCapsPtr caps,
+                    const struct qemu_arch_info *info,
+                    int hvm) {
+     virCapsGuestPtr guest;
+-    int i, haskvm, hasbase, samearch;
++    int i;
++    int hasbase = 0;
++    int hasaltbase = 0;
++    int haskvm = 0;
++    int haskqemu = 0;
+     const char *kvmbin = NULL;
+ 
+-    /* Check for existance of base emulator */
++    /* Check for existance of base emulator, or alternate base
++     * which can be used with magic cpu choice
++     */
+     hasbase = (access(info->binary, X_OK) == 0);
++    hasaltbase = (access(info->altbinary, X_OK) == 0);
+ 
+-    samearch = STREQ(info->arch, hostmachine);
+-    if (samearch) {
++    /* Can use acceleration for KVM/KQEMU if
++     *  - host & guest arches match
++     * Or
++     *  - hostarch is x86_64 and guest arch is i686
++     * The latter simply needs "-cpu qemu32"
++     */
++    if (STREQ(info->arch, hostmachine) ||
++        (STREQ(hostmachine, "x86_64") && STREQ(info->arch, "i686"))) {
+         const char *const kvmbins[] = { "/usr/bin/qemu-kvm", /* Fedora */
+                                         "/usr/bin/kvm" }; /* Upstream .spec */
+ 
+         for (i = 0; i < ARRAY_CARDINALITY(kvmbins); ++i) {
+-            if ((haskvm = (access(kvmbins[i], X_OK) == 0))) {
++            if (access(kvmbins[i], X_OK) == 0 &&
++                access("/dev/kvm", F_OK) == 0) {
++                haskvm = 1;
+                 kvmbin = kvmbins[i];
+                 break;
+             }
+         }
+-    } else {
+-        haskvm = 0;
++
++        if (access("/dev/kqemu", F_OK) == 0)
++            haskqemu = 1;
+     }
+ 
+-    if (!hasbase && !haskvm)
++
++    if (!hasbase && !hasaltbase && !haskvm)
+         return 0;
+ 
++    /* We register kvm as the base emulator too, since we can
++     * just give -no-kvm to disable acceleration if required */
+     if ((guest = virCapabilitiesAddGuest(caps,
+                                          hvm ? "hvm" : "xen",
+                                          info->arch,
+                                          info->wordsize,
+-                                         info->binary,
++                                         (hasbase ? info->binary :
++                                          (hasaltbase ? info->altbinary : kvmbin)),
+                                          NULL,
+                                          info->nmachines,
+                                          info->machines)) == NULL)
+         return -1;
+ 
+     if (hvm) {
+-        if (hasbase &&
+-            virCapabilitiesAddGuestDomain(guest,
++        if (virCapabilitiesAddGuestDomain(guest,
+                                           "qemu",
+                                           NULL,
+                                           NULL,
+@@ -301,27 +321,23 @@ qemudCapsInitGuest(virCapsPtr caps,
+                                           NULL) == NULL)
+             return -1;
+ 
+-        /* If guest & host match, then we can accelerate */
+-        if (samearch) {
+-            if (access("/dev/kqemu", F_OK) == 0 &&
+-                virCapabilitiesAddGuestDomain(guest,
+-                                              "kqemu",
+-                                              NULL,
+-                                              NULL,
+-                                              0,
+-                                              NULL) == NULL)
+-                return -1;
++        if (haskqemu &&
++            virCapabilitiesAddGuestDomain(guest,
++                                          "kqemu",
++                                          NULL,
++                                          NULL,
++                                          0,
++                                          NULL) == NULL)
++            return -1;
+ 
+-            if (access("/dev/kvm", F_OK) == 0 &&
+-                haskvm &&
+-                virCapabilitiesAddGuestDomain(guest,
+-                                              "kvm",
+-                                              kvmbin,
+-                                              NULL,
+-                                              0,
+-                                              NULL) == NULL)
+-                return -1;
+-        }
++        if (haskvm &&
++            virCapabilitiesAddGuestDomain(guest,
++                                          "kvm",
++                                          kvmbin,
++                                          NULL,
++                                          0,
++                                          NULL) == NULL)
++            return -1;
+     } else {
+         if (virCapabilitiesAddGuestDomain(guest,
+                                           "kvm",
+@@ -363,12 +379,14 @@ virCapsPtr qemudCapsInit(void) {
+     if (virCapsInitNUMA(caps) < 0)
+         goto no_memory;
+ 
++    /* First the pure HVM guests */
+     for (i = 0 ; i < ARRAY_CARDINALITY(arch_info_hvm) ; i++)
+         if (qemudCapsInitGuest(caps,
+                                utsname.machine,
+                                &arch_info_hvm[i], 1) < 0)
+             goto no_memory;
+ 
++    /* Then possibly the Xen paravirt guests (ie Xenner */
+     if (access("/usr/bin/xenner", X_OK) == 0 &&
+         access("/dev/kvm", F_OK) == 0) {
+         for (i = 0 ; i < ARRAY_CARDINALITY(arch_info_xen) ; i++)
+@@ -430,6 +448,8 @@ int qemudExtractVersionInfo(const char *
+ 
+     if (strstr(help, "-no-kqemu"))
+         flags |= QEMUD_CMD_FLAG_KQEMU;
++    if (strstr(help, "-no-kvm"))
++        flags |= QEMUD_CMD_FLAG_KVM;
+     if (strstr(help, "-no-reboot"))
+         flags |= QEMUD_CMD_FLAG_NO_REBOOT;
+     if (strstr(help, "-name"))
+@@ -749,6 +769,7 @@ int qemudBuildCommandLine(virConnectPtr 
+     char boot[VIR_DOMAIN_BOOT_LAST];
+     struct utsname ut;
+     int disableKQEMU = 0;
++    int disableKVM = 0;
+     int qargc = 0, qarga = 0;
+     const char **qargv = NULL;
+     int qenvc = 0, qenva = 0;
+@@ -757,6 +778,7 @@ int qemudBuildCommandLine(virConnectPtr 
+     char uuid[VIR_UUID_STRING_BUFLEN];
+     char domid[50];
+     char *pidfile;
++    const char *cpu = NULL;
+ 
+     uname_normalize(&ut);
+ 
+@@ -789,9 +811,16 @@ int qemudBuildCommandLine(virConnectPtr 
+         }
+     }
+ 
++    emulator = vm->def->emulator;
++    if (!emulator)
++        emulator = virDomainDefDefaultEmulator(conn, vm->def, driver->caps);
++    if (!emulator)
++        return -1;
++
++
+     /* Need to explicitly disable KQEMU if
+      * 1. Arch matches host arch
+-     * 2. Guest is 'qemu'
++     * 2. Guest domain is 'qemu'
+      * 3. The qemu binary has the -no-kqemu flag
+      */
+     if ((qemuCmdFlags & QEMUD_CMD_FLAG_KQEMU) &&
+@@ -799,6 +828,34 @@ int qemudBuildCommandLine(virConnectPtr 
+         vm->def->virtType == VIR_DOMAIN_VIRT_QEMU)
+         disableKQEMU = 1;
+ 
++    /* Need to explicitly disable KVM if
++     * 1. Arch matches host arch
++     * 2. Guest domain is 'qemu'
++     * 3. The qemu binary has the -no-kvm flag
++     */
++    if ((qemuCmdFlags & QEMUD_CMD_FLAG_KVM) &&
++        STREQ(ut.machine, vm->def->os.arch) &&
++        vm->def->virtType == VIR_DOMAIN_VIRT_QEMU)
++        disableKVM = 1;
++
++    /*
++     * Need to force a 32-bit guest CPU type if
++     *
++     *  1. guest OS is i686
++     *  2. host OS is x86_64
++     *  3. emulator is qemu-kvm or kvm
++     *
++     * Or
++     *
++     *  1. guest OS is i686
++     *  2. emulator is qemu-system-x86_64
++     */
++    if (STREQ(vm->def->os.arch, "i686") &&
++        ((STREQ(ut.machine, "x86_64") &&
++          strstr(emulator, "kvm")) ||
++         strstr(emulator, "x86_64")))
++        cpu = "qemu32";
++
+ #define ADD_ARG_SPACE                                                   \
+     do { \
+         if (qargc == qarga) {                                           \
+@@ -887,12 +944,6 @@ int qemudBuildCommandLine(virConnectPtr 
+     ADD_ENV_COPY("LOGNAME");
+     ADD_ENV_COPY("TMPDIR");
+ 
+-    emulator = vm->def->emulator;
+-    if (!emulator)
+-        emulator = virDomainDefDefaultEmulator(conn, vm->def, driver->caps);
+-    if (!emulator)
+-        return -1;
+-
+     ADD_ARG_LIT(emulator);
+     ADD_ARG_LIT("-S");
+ 
+@@ -904,9 +955,15 @@ int qemudBuildCommandLine(virConnectPtr 
+         ADD_ARG_LIT("-M");
+         ADD_ARG_LIT(vm->def->os.machine);
+     }
++    if (cpu) {
++        ADD_ARG_LIT("-cpu");
++        ADD_ARG_LIT(cpu);
++    }
+ 
+     if (disableKQEMU)
+         ADD_ARG_LIT("-no-kqemu");
++    if (disableKVM)
++        ADD_ARG_LIT("-no-kvm");
+     ADD_ARG_LIT("-m");
+     ADD_ARG_LIT(memory);
+     ADD_ARG_LIT("-smp");
+Index: src/qemu_conf.h
+===================================================================
+RCS file: /data/cvs/libvirt/src/qemu_conf.h,v
+retrieving revision 1.58
+diff -u -p -r1.58 qemu_conf.h
+--- src/qemu_conf.h	16 Mar 2009 13:54:26 -0000	1.58
++++ src/qemu_conf.h	16 Mar 2009 17:53:20 -0000
+@@ -55,6 +55,7 @@ enum qemud_cmd_flags {
+     QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP  = (1 << 10), /* New migration syntax after merge to QEMU with TCP transport */
+     QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC = (1 << 11), /* New migration syntax after merge to QEMU with EXEC transport */
+     QEMUD_CMD_FLAG_DRIVE_CACHE_V2    = (1 << 12), /* Is the cache= flag wanting new v2 values */
++    QEMUD_CMD_FLAG_KVM               = (1 << 13), /* Whether KVM is compiled in */
+ };
+ 
+ /* Main driver state */
+Index: src/qemu_driver.c
+===================================================================
+RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
+retrieving revision 1.218
+diff -u -p -r1.218 qemu_driver.c
+--- src/qemu_driver.c	16 Mar 2009 17:16:04 -0000	1.218
++++ src/qemu_driver.c	16 Mar 2009 17:53:20 -0000
+@@ -1733,6 +1733,7 @@ qemudMonitorCommand(const virDomainObjPt
+ static int qemudProbe(void)
+ {
+     if ((virFileExists("/usr/bin/qemu")) ||
++        (virFileExists("/usr/bin/qemu-system-x86_64")) ||
+         (virFileExists("/usr/bin/qemu-kvm")) ||
+         (virFileExists("/usr/bin/kvm")) ||
+         (virFileExists("/usr/bin/xenner")))
+@@ -1749,10 +1750,10 @@ static virDrvOpenStatus qemudOpen(virCon
+     if (qemu_driver == NULL)
+         goto decline;
+ 
+-    if (!qemudProbe())
+-        goto decline;
+-
+     if (conn->uri == NULL) {
++        if (!qemudProbe())
++            goto decline;
++
+         conn->uri = xmlParseURI(uid ? "qemu:///session" : "qemu:///system");
+         if (!conn->uri) {
+             virReportOOMError(conn);
+
+
+-- 
+|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
+|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
+|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
+|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
+
+--
+Libvir-list mailing list
+Libvir-list@redhat.com
+https://www.redhat.com/mailman/listinfo/libvir-list
--- libvirt-0.6.1.orig/debian/patches/0006-dont_clobber_existing_bridges.patch
+++ libvirt-0.6.1/debian/patches/0006-dont_clobber_existing_bridges.patch
@@ -0,0 +1,12 @@
+Index: ubuntu/qemud/default-network.xml
+===================================================================
+--- ubuntu.orig/qemud/default-network.xml	2008-02-12 01:20:09.818288028 +0100
++++ ubuntu/qemud/default-network.xml	2008-02-12 01:20:17.518258142 +0100
+@@ -1,6 +1,6 @@
+ <network>
+   <name>default</name>
+-  <bridge name="virbr0" />
++  <bridge name="virbr%d" />
+   <forward/>
+   <ip address="192.168.122.1" netmask="255.255.255.0">
+     <dhcp>
--- libvirt-0.6.1.orig/debian/patches/dynamic_bridge_names.patch
+++ libvirt-0.6.1/debian/patches/dynamic_bridge_names.patch
@@ -0,0 +1,79 @@
+Index: libvirt-0.6.1/src/network_conf.c
+===================================================================
+--- libvirt-0.6.1.orig/src/network_conf.c	2009-04-16 20:49:28.851655724 +0200
++++ libvirt-0.6.1/src/network_conf.c	2009-04-17 13:11:54.494770980 +0200
+@@ -724,6 +724,7 @@
+     virNetworkDefPtr def = NULL;
+     virNetworkObjPtr net;
+     int autostart;
++    char *tmp;
+ 
+     if ((configFile = virNetworkConfigFile(conn, configDir, name)) == NULL)
+         goto error;
+@@ -747,7 +748,10 @@
+     /* Generate a bridge if none is found, but don't check for collisions
+      * if a bridge is hardcoded, so the network is at least defined
+      */
+-    if (!def->bridge && !(def->bridge = virNetworkAllocateBridge(conn, nets)))
++    if (tmp = virNetworkAllocateBridge(conn, nets, def->bridge)) {
++        VIR_FREE(def->bridge);
++        def->bridge = tmp;
++    } else
+         goto error;
+ 
+     if (!(net = virNetworkAssignDef(conn, nets, def)))
+@@ -875,16 +879,20 @@
+ }
+ 
+ char *virNetworkAllocateBridge(virConnectPtr conn,
+-                               const virNetworkObjListPtr nets)
++                               const virNetworkObjListPtr nets,
++                               const char *template)
+ {
+ 
+     int id = 0;
+     char *newname;
+ 
++	if (!template)
++		template = "virbr%d";
++
+     do {
+         char try[50];
+ 
+-        snprintf(try, sizeof(try), "virbr%d", id);
++        snprintf(try, sizeof(try), template, id);
+ 
+         if (!virNetworkBridgeInUse(nets, try, NULL)) {
+             if (!(newname = strdup(try))) {
+@@ -909,7 +917,7 @@
+ 
+     int ret = -1;
+ 
+-    if (def->bridge) {
++    if (def->bridge && !strstr(def->bridge, "%d")) {
+         if (virNetworkBridgeInUse(nets, def->bridge, def->name)) {
+             networkReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                                _("bridge name '%s' already in use."),
+@@ -918,7 +926,7 @@
+         }
+     } else {
+         /* Allocate a bridge name */
+-        if (!(def->bridge = virNetworkAllocateBridge(conn, nets)))
++        if (!(def->bridge = virNetworkAllocateBridge(conn, nets, def->bridge)))
+             goto error;
+     }
+ 
+Index: libvirt-0.6.1/src/network_conf.h
+===================================================================
+--- libvirt-0.6.1.orig/src/network_conf.h	2009-04-16 20:49:28.899655820 +0200
++++ libvirt-0.6.1/src/network_conf.h	2009-04-17 09:42:33.075084537 +0200
+@@ -174,7 +174,8 @@
+                           const char *skipname);
+ 
+ char *virNetworkAllocateBridge(virConnectPtr conn,
+-                               const virNetworkObjListPtr nets);
++                               const virNetworkObjListPtr nets,
++                               const char *template);
+ 
+ int virNetworkSetBridgeName(virConnectPtr conn,
+                             const virNetworkObjListPtr nets,
--- libvirt-0.6.1.orig/debian/patches/0001-remove-RHism.diff.patch
+++ libvirt-0.6.1/debian/patches/0001-remove-RHism.diff.patch
@@ -0,0 +1,22 @@
+From: Guido Guenther <agx@sigxcpu.org>
+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
+-- 
--- libvirt-0.6.1.orig/debian/patches/default-arch.patch
+++ libvirt-0.6.1/debian/patches/default-arch.patch
@@ -0,0 +1,18 @@
+Index: libvirt-0.6.1/src/capabilities.c
+===================================================================
+--- libvirt-0.6.1.orig/src/capabilities.c	2009-03-18 23:31:31.314020775 +0100
++++ libvirt-0.6.1/src/capabilities.c	2009-03-19 00:11:14.349990289 +0100
+@@ -471,6 +471,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 caps->guests[i]->arch.name;
--- libvirt-0.6.1.orig/debian/patches/0002-qemu-disable-network.diff.patch
+++ libvirt-0.6.1/debian/patches/0002-qemu-disable-network.diff.patch
@@ -0,0 +1,38 @@
+From: Guido Guenther <agx@sigxcpu.org>
+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 a0c161a..0e736d0 100644
+--- a/qemud/Makefile.am
++++ b/qemud/Makefile.am
+@@ -152,9 +152,6 @@ install-data-local: install-init install-data-sasl install-data-polkit \
+ 	test -z "$(UUID)" || \
+ 	  sed -i -e "s,</name>,</name>\n  <uuid>$(UUID)</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 ac4bfdc..5a22dc9 100644
+--- a/qemud/Makefile.in
++++ b/qemud/Makefile.in
+@@ -1291,9 +1291,6 @@ remote_protocol.c: remote_protocol.h
+ @WITH_LIBVIRTD_TRUE@	test -z "$(UUID)" || \
+ @WITH_LIBVIRTD_TRUE@	  sed -i -e "s,</name>,</name>\n  <uuid>$(UUID)</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
+-- 
--- libvirt-0.6.1.orig/debian/patches/xen-events-handling-fix.diff
+++ libvirt-0.6.1/debian/patches/xen-events-handling-fix.diff
@@ -0,0 +1,47 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Wed, 11 Mar 2009 13:43:24 +0000 (+0000)
+Subject: * src/xs_internal.c: fix xen events handling problem (Dan Berrange)
+X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=124cfcbc2bcd1b71b51e720b9bfc7d8e69e8af89
+
+* src/xs_internal.c: fix xen events handling problem (Dan Berrange)
+Daniel
+---
+
+Index: libvirt-0.6.1/ChangeLog
+===================================================================
+--- libvirt-0.6.1.orig/ChangeLog	2009-03-04 14:13:15.000000000 +0100
++++ libvirt-0.6.1/ChangeLog	2009-03-17 23:26:54.216796814 +0100
+@@ -1,3 +1,7 @@
++Wed Mar 11 14:42:24 CET 2009 Daniel Veillard <veilard@redhat.com>
++
++	* src/xs_internal.c: fix xen events handling problem (Dan Berrange)
++
+ Wed Mar  4 14:11:15 CET 2009 Daniel Veillard <veilard@redhat.com>
+ 
+ 	* NEWS configure.in libvirt.spec.in doc/* include/libvirt/libvirt.h:
+Index: libvirt-0.6.1/src/xs_internal.c
+===================================================================
+--- libvirt-0.6.1.orig/src/xs_internal.c	2009-02-16 09:43:41.000000000 +0100
++++ libvirt-0.6.1/src/xs_internal.c	2009-03-17 23:26:17.249798285 +0100
+@@ -1215,7 +1215,7 @@
+ static void
+ xenStoreWatchEvent(int watch ATTRIBUTE_UNUSED,
+                    int fd ATTRIBUTE_UNUSED,
+-                   int events ATTRIBUTE_UNUSED,
++                   int events,
+                    void *data)
+ {
+     char		 **event;
+@@ -1226,8 +1226,12 @@
+ 
+     virConnectPtr        conn = data;
+     xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
++
+     if(!priv) return;
+ 
++    /* only set a watch on read and write events */
++    if (events & (VIR_EVENT_HANDLE_ERROR | VIR_EVENT_HANDLE_HANGUP)) return;
++
+     xenUnifiedLock(priv);
+ 
+     if(!priv->xshandle)
