summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-emulation/libvirt/ChangeLog9
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.3-kvm-85-argv-detection.patch77
-rw-r--r--app-emulation/libvirt/libvirt-0.6.3.ebuild109
3 files changed, 194 insertions, 1 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog
index 58a9bdd7ef07..e134c319a7b2 100644
--- a/app-emulation/libvirt/ChangeLog
+++ b/app-emulation/libvirt/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-emulation/libvirt
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.22 2009/04/17 15:01:16 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.23 2009/05/21 14:43:36 dev-zero Exp $
+
+*libvirt-0.6.3 (21 May 2009)
+
+ 21 May 2009; Tiziano Müller <dev-zero@gentoo.org> +libvirt-0.6.3.ebuild,
+ +files/libvirt-0.6.3-kvm-85-argv-detection.patch:
+ Version bump (bug #269789), using EAPI-2 now, added patch to make it work
+ with kvm >=85.
*libvirt-0.6.2 (17 Apr 2009)
diff --git a/app-emulation/libvirt/files/libvirt-0.6.3-kvm-85-argv-detection.patch b/app-emulation/libvirt/files/libvirt-0.6.3-kvm-85-argv-detection.patch
new file mode 100644
index 000000000000..23d7ebcf97e4
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.3-kvm-85-argv-detection.patch
@@ -0,0 +1,77 @@
+From: Daniel P. Berrange <berrange@redhat.com>
+Date: Mon, 11 May 2009 15:14:24 +0000 (+0000)
+Subject: Fix QEMU ARGV detection with kvm >= 85
+X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=2b3fcdc378e7bec5c1a78b81632756e92930fd24;hp=07592a3c03771cea7389ae463aa2925748ac970e
+
+Fix QEMU ARGV detection with kvm >= 85
+---
+
+diff --git a/src/qemu_conf.c b/src/qemu_conf.c
+index 9cb71eb..a57d3ab 100644
+--- a/src/qemu_conf.c
++++ b/src/qemu_conf.c
+@@ -431,18 +431,28 @@ int qemudExtractVersionInfo(const char *qemu,
+ return -1;
+
+ char *help = NULL;
+- enum { MAX_HELP_OUTPUT_SIZE = 8192 };
++ enum { MAX_HELP_OUTPUT_SIZE = 1024*64 };
+ int len = virFileReadLimFD(newstdout, MAX_HELP_OUTPUT_SIZE, &help);
+- if (len < 0)
++ if (len < 0) {
++ virReportSystemError(NULL, errno, "%s",
++ _("Unable to read QEMU help output"));
+ goto cleanup2;
++ }
+
+ if (sscanf(help, "QEMU PC emulator version %u.%u.%u (kvm-%u)",
+ &major, &minor, &micro, &kvm_version) != 4)
+ kvm_version = 0;
+
+- if (!kvm_version && sscanf(help, "QEMU PC emulator version %u.%u.%u",
+- &major, &minor, &micro) != 3)
++ if (!kvm_version &&
++ sscanf(help, "QEMU PC emulator version %u.%u.%u",
++ &major, &minor, &micro) != 3) {
++ char *eol = strchr(help, '\n');
++ if (eol) *eol = '\0';
++ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
++ _("cannot parse QEMU version number in '%s'"),
++ help);
+ goto cleanup2;
++ }
+
+ version = (major * 1000 * 1000) + (minor * 1000) + micro;
+
+diff --git a/src/qemu_driver.c b/src/qemu_driver.c
+index 30642d5..bd60b29 100644
+--- a/src/qemu_driver.c
++++ b/src/qemu_driver.c
+@@ -1391,12 +1391,8 @@ static int qemudStartVMDaemon(virConnectPtr conn,
+
+ if (qemudExtractVersionInfo(emulator,
+ NULL,
+- &qemuCmdFlags) < 0) {
+- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+- _("Cannot determine QEMU argv syntax %s"),
+- emulator);
++ &qemuCmdFlags) < 0)
+ goto cleanup;
+- }
+
+ if (qemuPrepareHostDevices(conn, vm->def) < 0)
+ goto cleanup;
+@@ -3715,12 +3711,8 @@ static int qemudDomainChangeEjectableMedia(virConnectPtr conn,
+
+ if (qemudExtractVersionInfo(vm->def->emulator,
+ NULL,
+- &qemuCmdFlags) < 0) {
+- qemudReportError(conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+- _("Cannot determine QEMU argv syntax %s"),
+- vm->def->emulator);
++ &qemuCmdFlags) < 0)
+ return -1;
+- }
+
+ if (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE) {
+ if (!(devname = qemudDiskDeviceName(conn, newdisk)))
diff --git a/app-emulation/libvirt/libvirt-0.6.3.ebuild b/app-emulation/libvirt/libvirt-0.6.3.ebuild
new file mode 100644
index 000000000000..641114431f2a
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-0.6.3.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-0.6.3.ebuild,v 1.1 2009/05/21 14:43:36 dev-zero Exp $
+
+EAPI="2"
+
+inherit eutils autotools
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="avahi iscsi hal kvm lvm +lxc +network openvz policykit parted qemu sasl selinux uml xen"
+# devicekit isn't in portage
+
+RDEPEND="sys-libs/readline
+ sys-libs/ncurses
+ >=dev-libs/libxml2-2.5
+ >=net-libs/gnutls-1.0.25
+ dev-lang/python
+ sys-fs/sysfsutils
+ net-analyzer/netcat
+ avahi? ( >=net-dns/avahi-0.6 )
+ iscsi? ( sys-block/open-iscsi )
+ kvm? ( app-emulation/kvm )
+ lvm? ( sys-fs/lvm2 )
+ network? ( net-misc/bridge-utils net-dns/dnsmasq net-firewall/iptables )
+ openvz? ( sys-kernel/openvz-sources )
+ parted? ( >=sys-apps/parted-1.8 )
+ qemu? ( app-emulation/qemu )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( sys-libs/libselinux )
+ xen? ( app-emulation/xen-tools app-emulation/xen )
+ policykit? ( >=sys-auth/policykit-0.6 )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${PN}-0.4.6-qemu-img-name.patch" \
+ "${FILESDIR}/${PN}-0.6.2-storage-fix.patch" \
+ "${FILESDIR}/${P}-kvm-85-argv-detection.patch"
+ eautoreconf
+}
+
+pkg_setup() {
+ local hasbackend=0
+ local backends="lxc kvm openvz qemu uml xen"
+ local backend
+
+ for backend in $backends ; do
+ use $backend && hasbackend=1
+ done
+
+ if [ "$hasbackend" == 0 ]; then
+ local msg="You must enable one of these USE flags: $backends"
+ eerror "$msg"
+ die "$msg"
+ fi
+}
+
+src_configure() {
+ local my_conf=""
+ if use qemu || use kvm ; then
+ # fix path for kvm-img but use qemu-img if the useflag is set
+ my_conf="--with-qemu \
+ $(use_with !qemu qemu-img-name kvm-img)"
+ else
+ my_conf="--without-qemu"
+ fi
+
+ econf \
+ $(use_with avahi) \
+ $(use_with iscsi storage-iscsi) \
+ $(use_with lvm storage-lvm) \
+ $(use_with lxc) \
+ $(use_with hal) \
+ $(use_with openvz) \
+ $(use_with parted storage-disk) \
+ $(use_with sasl) \
+ $(use_with selinux) \
+ $(use_with uml) \
+ $(use_with xen) \
+ $(use_with network) \
+ $(use_with policykit polkit) \
+ ${my_conf} \
+ --without-devkit \
+ --with-remote \
+ --disable-iptables-lokkit \
+ --localstatedir=/var \
+ --with-remote-pid-file=/var/run/libvirtd.pid
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake instal lfailed"
+ mv "${D}"/usr/share/doc/{${PN}-python*,${P}/python}
+
+ newinitd "${FILESDIR}/libvirtd.init" libvirtd
+ newconfd "${FILESDIR}/libvirtd.confd" libvirtd
+
+ keepdir /var/lib/libvirt/images
+}
+
+pkg_postinst() {
+ elog "To allow normal users to connect to libvirtd you must change the"
+ elog " unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
+}