summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2009-05-28 16:27:25 +0000
committerDoug Goldstein <cardoe@gentoo.org>2009-05-28 16:27:25 +0000
commita080dc469e83ceeb427759d9207828926526d9b9 (patch)
tree3215f7dc0c7142aef49f55e75d597e674fae0fac
parentalpha/arm/ia64/s390/sh stable wrt #271096 (diff)
downloadgentoo-2-a080dc469e83ceeb427759d9207828926526d9b9.tar.gz
gentoo-2-a080dc469e83ceeb427759d9207828926526d9b9.tar.bz2
gentoo-2-a080dc469e83ceeb427759d9207828926526d9b9.zip
Support NUMA segmentation. Fix VirtualBox depend. Require QEMU 0.10.0 and higher for additional QEMU feature support. Several fixes from upstream.
(Portage version: 2.1.6.13/cvs/Linux x86_64)
-rw-r--r--app-emulation/libvirt/ChangeLog13
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.2-enable-qemu-0-10-migration.patch45
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.2-fix-nosource-label.patch13
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.2-shared-readonly-label.patch76
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.3-hostdev-managed.patch45
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.3-refresh-qemu-caps.patch76
-rw-r--r--app-emulation/libvirt/libvirt-0.6.3-r2.ebuild120
-rw-r--r--app-emulation/libvirt/metadata.xml2
8 files changed, 389 insertions, 1 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog
index dea6cd797ddf..64c2216de478 100644
--- a/app-emulation/libvirt/ChangeLog
+++ b/app-emulation/libvirt/ChangeLog
@@ -1,6 +1,17 @@
# 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.24 2009/05/27 22:34:30 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.25 2009/05/28 16:27:25 cardoe Exp $
+
+*libvirt-0.6.3-r2 (28 May 2009)
+
+ 28 May 2009; Doug Goldstein <cardoe@gentoo.org>
+ +files/libvirt-0.6.2-enable-qemu-0-10-migration.patch,
+ +files/libvirt-0.6.2-fix-nosource-label.patch,
+ +files/libvirt-0.6.2-shared-readonly-label.patch,
+ +libvirt-0.6.3-r2.ebuild, +files/libvirt-0.6.3-hostdev-managed.patch,
+ +files/libvirt-0.6.3-refresh-qemu-caps.patch, metadata.xml:
+ Support NUMA segmentation. Fix VirtualBox depend. Require QEMU 0.10.0 and
+ higher for additional QEMU feature support. Several fixes from upstream.
*libvirt-0.6.3-r1 (27 May 2009)
diff --git a/app-emulation/libvirt/files/libvirt-0.6.2-enable-qemu-0-10-migration.patch b/app-emulation/libvirt/files/libvirt-0.6.2-enable-qemu-0-10-migration.patch
new file mode 100644
index 000000000000..1e1a1c292fdb
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.2-enable-qemu-0-10-migration.patch
@@ -0,0 +1,45 @@
+From: "Daniel P. Berrange" <berrange@redhat.com>
+To: libvir-list@redhat.com
+Date: Thu, 30 Apr 2009 15:09:05 +0100
+Subject: [libvirt] PATCH: Enable migration with QEMU >= 0.10.0
+
+The KVM migration code was added to QEMU for the 0.10.0 release, so we
+should enable this in libvirt now.
+
+Daniel
+
+diff -r be7993675e07 src/qemu_conf.c
+--- a/src/qemu_conf.c Thu Apr 30 14:49:27 2009 +0100
++++ b/src/qemu_conf.c Thu Apr 30 15:08:45 2009 +0100
+@@ -472,16 +472,13 @@ int qemudExtractVersionInfo(const char *
+
+ /*
+ * Handling of -incoming arg with varying features
+- * -incoming tcp (kvm >= 79)
+- * -incoming exec (kvm >= 80)
++ * -incoming tcp (kvm >= 79, qemu >= 0.10.0)
++ * -incoming exec (kvm >= 80, qemu >= 0.10.0)
+ * -incoming stdio (all earlier kvm)
+ *
+ * NB, there was a pre-kvm-79 'tcp' support, but it
+ * was broken, because it blocked the monitor console
+ * while waiting for data, so pretend it doesn't exist
+- *
+- * XXX when next QEMU release after 0.9.1 arrives,
+- * we'll need to add MIGRATE_QEMU_TCP/EXEC here too
+ */
+ if (kvm_version >= 79) {
+ flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP;
+@@ -489,6 +486,9 @@ int qemudExtractVersionInfo(const char *
+ flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC;
+ } else if (kvm_version > 0) {
+ flags |= QEMUD_CMD_FLAG_MIGRATE_KVM_STDIO;
++ } else if (version >= 10000) {
++ flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP;
++ flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC;
+ }
+
+ if (retversion)
+
+
+--
diff --git a/app-emulation/libvirt/files/libvirt-0.6.2-fix-nosource-label.patch b/app-emulation/libvirt/files/libvirt-0.6.2-fix-nosource-label.patch
new file mode 100644
index 000000000000..c0b0498fc40f
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.2-fix-nosource-label.patch
@@ -0,0 +1,13 @@
+diff -rup libvirt-0.6.2/src/security_selinux.c new/src/security_selinux.c
+--- libvirt-0.6.2/src/security_selinux.c 2009-05-10 22:04:25.000000000 -0400
++++ new/src/security_selinux.c 2009-05-10 22:06:09.000000000 -0400
+@@ -338,6 +338,9 @@ SELinuxSetSecurityImageLabel(virConnectP
+ {
+ const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
+
++ if (!disk->src)
++ return 0;
++
+ if (disk->shared) {
+ return SELinuxSetFilecon(conn, disk->src, default_image_context);
+ } else if (disk->readonly) {
diff --git a/app-emulation/libvirt/files/libvirt-0.6.2-shared-readonly-label.patch b/app-emulation/libvirt/files/libvirt-0.6.2-shared-readonly-label.patch
new file mode 100644
index 000000000000..e962d18d0cd6
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.2-shared-readonly-label.patch
@@ -0,0 +1,76 @@
+diff -rup libvirt-0.6.2/src/security_selinux.c libvirt-0.6.2.new/src/security_selinux.c
+--- libvirt-0.6.2/src/security_selinux.c 2009-04-03 15:36:56.000000000 +0100
++++ libvirt-0.6.2.new/src/security_selinux.c 2009-05-05 13:39:42.000000000 +0100
+@@ -24,11 +24,12 @@
+ #include "virterror_internal.h"
+ #include "util.h"
+ #include "memory.h"
+-
++#include "logging.h"
+
+ #define VIR_FROM_THIS VIR_FROM_SECURITY
+
+ static char default_domain_context[1024];
++static char default_content_context[1024];
+ static char default_image_context[1024];
+ #define SECURITY_SELINUX_VOID_DOI "0"
+ #define SECURITY_SELINUX_NAME "selinux"
+@@ -148,8 +149,13 @@ SELinuxInitialize(virConnectPtr conn)
+ close(fd);
+
+ ptr = strchrnul(default_image_context, '\n');
+- *ptr = '\0';
+-
++ if (*ptr == '\n') {
++ *ptr = '\0';
++ strcpy(default_content_context, ptr+1);
++ ptr = strchrnul(default_content_context, '\n');
++ if (*ptr == '\n')
++ *ptr = '\0';
++ }
+ return 0;
+ }
+
+@@ -275,6 +281,8 @@ SELinuxSetFilecon(virConnectPtr conn, co
+ {
+ char ebuf[1024];
+
++ VIR_INFO("Setting SELinux context on '%s' to '%s'", path, tcon);
++
+ if(setfilecon(path, tcon) < 0) {
+ virSecurityReportError(conn, VIR_ERR_ERROR,
+ _("%s: unable to set security context "
+@@ -299,6 +307,8 @@ SELinuxRestoreSecurityImageLabel(virConn
+ char *newpath = NULL;
+ const char *path = disk->src;
+
++ /* Don't restore labels on readoly/shared disks, because
++ * other VMs may still be accessing these */
+ if (disk->readonly || disk->shared)
+ return 0;
+
+@@ -328,8 +338,13 @@ SELinuxSetSecurityImageLabel(virConnectP
+ {
+ const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
+
+- if (secdef->imagelabel)
++ if (disk->shared) {
++ return SELinuxSetFilecon(conn, disk->src, default_image_context);
++ } else if (disk->readonly) {
++ return SELinuxSetFilecon(conn, disk->src, default_content_context);
++ } else if (secdef->imagelabel) {
+ return SELinuxSetFilecon(conn, disk->src, secdef->imagelabel);
++ }
+
+ return 0;
+ }
+@@ -403,9 +418,6 @@ SELinuxSetSecurityLabel(virConnectPtr co
+
+ if (secdef->imagelabel) {
+ for (i = 0 ; i < vm->def->ndisks ; i++) {
+- if (vm->def->disks[i]->readonly ||
+- vm->def->disks[i]->shared) continue;
+-
+ if (SELinuxSetSecurityImageLabel(conn, vm, vm->def->disks[i]) < 0)
+ return -1;
+ }
diff --git a/app-emulation/libvirt/files/libvirt-0.6.3-hostdev-managed.patch b/app-emulation/libvirt/files/libvirt-0.6.3-hostdev-managed.patch
new file mode 100644
index 000000000000..4d62aaadb725
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.3-hostdev-managed.patch
@@ -0,0 +1,45 @@
+From 3d7771e0570e09096ad9391a857dad48b150bc0c Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc@redhat.com>
+Date: Wed, 6 May 2009 16:33:28 +0100
+Subject: [PATCH] Fix qemu driver's interpretation of <hostdev managed='yes'/>
+
+This change:
+
+ Tue Mar 3 08:55:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
+
+ Don't try to detach & reset PCI devices while running test
+ suite for XML-> ARGV conversion.
+ * src/qemu_driver.c: Add qemuPrepareHostDevices() helper to
+ detach and reset PCI devices.
+ * src/qemu_conf.c: Don't detach & reset PCI devices while
+ building the command line argv
+
+accidentally did this:
+
+- if (hostdev->managed) {
++ if (!hostdev->managed) {
+
+Which results in managed='yes' not causing the device to be
+detached when the guest is starting.
+
+Signed-off-by: Mark McLoughlin <markmc@redhat.com>
+---
+ src/qemu_driver.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/qemu_driver.c b/src/qemu_driver.c
+index 5898026..59312c0 100644
+--- a/src/qemu_driver.c
++++ b/src/qemu_driver.c
+@@ -1215,7 +1215,7 @@ static int qemuPrepareHostDevices(virConnectPtr conn,
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
+ continue;
+
+- if (!hostdev->managed) {
++ if (hostdev->managed) {
+ pciDevice *dev = pciGetDevice(conn,
+ hostdev->source.subsys.u.pci.domain,
+ hostdev->source.subsys.u.pci.bus,
+--
+1.6.0.6
+
diff --git a/app-emulation/libvirt/files/libvirt-0.6.3-refresh-qemu-caps.patch b/app-emulation/libvirt/files/libvirt-0.6.3-refresh-qemu-caps.patch
new file mode 100644
index 000000000000..804d54ec1ef5
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.3-refresh-qemu-caps.patch
@@ -0,0 +1,76 @@
+commit 0e51348cb9aeafe5e2fd6469a4bde0baa1eb8720
+Author: Cole Robinson <crobinso@redhat.com>
+Date: Mon May 4 15:06:03 2009 -0400
+
+ Refresh QEMU driver capabilities for each getCapabilities call.
+
+ Also fix up a couple issues where caps are accessed without locking
+ the driver structure.
+
+diff --git a/src/qemu_driver.c b/src/qemu_driver.c
+index 23ea961..790dac6 100644
+--- a/src/qemu_driver.c
++++ b/src/qemu_driver.c
+@@ -1885,10 +1885,12 @@ static int qemudGetNodeInfo(virConnectPtr conn,
+
+ static char *qemudGetCapabilities(virConnectPtr conn) {
+ struct qemud_driver *driver = conn->privateData;
+- char *xml;
++ char *xml = NULL;
+
+ qemuDriverLock(driver);
+- if ((xml = virCapabilitiesFormatXML(driver->caps)) == NULL)
++ virCapabilitiesFree(qemu_driver->caps);
++ if ((qemu_driver->caps = qemudCapsInit()) == NULL ||
++ (xml = virCapabilitiesFormatXML(driver->caps)) == NULL)
+ virReportOOMError(conn);
+ qemuDriverUnlock(driver);
+
+@@ -3169,20 +3171,26 @@ cleanup:
+ return ret;
+ }
+
+-static int qemudNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
++static int qemudNodeGetSecurityModel(virConnectPtr conn,
++ virSecurityModelPtr secmodel)
+ {
+ struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
+ char *p;
++ int ret = 0;
+
+- if (!driver->securityDriver)
+- return -2;
++ qemuDriverLock(driver);
++ if (!driver->securityDriver) {
++ ret = -2;
++ goto cleanup;
++ }
+
+ p = driver->caps->host.secModel.model;
+ if (strlen(p) >= VIR_SECURITY_MODEL_BUFLEN-1) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("security model string exceeds max %d bytes"),
+ VIR_SECURITY_MODEL_BUFLEN-1);
+- return -1;
++ ret = -1;
++ goto cleanup;
+ }
+ strcpy(secmodel->model, p);
+
+@@ -3191,10 +3199,14 @@ static int qemudNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr sec
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("security DOI string exceeds max %d bytes"),
+ VIR_SECURITY_DOI_BUFLEN-1);
+- return -1;
++ ret = -1;
++ goto cleanup;
+ }
+ strcpy(secmodel->doi, p);
+- return 0;
++
++cleanup:
++ qemuDriverUnlock(driver);
++ return ret;
+ }
+
+ /* TODO: check seclabel restore */
diff --git a/app-emulation/libvirt/libvirt-0.6.3-r2.ebuild b/app-emulation/libvirt/libvirt-0.6.3-r2.ebuild
new file mode 100644
index 000000000000..894ebb830dea
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-0.6.3-r2.ebuild
@@ -0,0 +1,120 @@
+# 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-r2.ebuild,v 1.1 2009/05/28 16:27:25 cardoe Exp $
+
+EAPI="2"
+
+inherit eutils autotools confutils
+
+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 nls numa openvz policykit \
+ parted qemu sasl selinux uml virtualbox 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 )
+ numa? ( sys-process/numactl )
+ openvz? ( sys-kernel/openvz-sources )
+ parted? ( >=sys-apps/parted-1.8 )
+ policykit? ( >=sys-auth/policykit-0.6 )
+ qemu? ( >=app-emulation/qemu-0.10.0 )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( sys-libs/libselinux )
+ virtualbox? ( >=app-emulation/virtualbox-bin-2.2.0 )
+ xen? ( app-emulation/xen-tools app-emulation/xen )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+src_prepare() {
+ # Fix argv handling for KVM 85 and newer
+ epatch "${FILESDIR}/${P}-kvm-85-argv-detection.patch"
+ # Patch sent upstream for working with kvm-img
+ epatch "${FILESDIR}/${P}-kvm-img.patch"
+ # upstream patch. fix shared/read-only disk labeling
+ epatch "${FILESDIR}/${PN}-0.6.2-shared-readonly-label.patch"
+ # upstream patch. fix <hostdev managed='yes'>
+ epatch "${FILESDIR}/${P}-hostdev-managed.patch"
+ # upstream patch. refresh qemu caps when getCapabilities is called
+ epatch "${FILESDIR}/${P}-refresh-qemu-caps.patch"
+ # upstream patch. enable migration support which appeared in QEMU 0.10.0
+ epatch "${FILESDIR}/${PN}-0.6.2-enable-qemu-0-10-migration.patch"
+ # upstream patch. don't try to label a disk with no path (empty cdrom)
+ epatch "${FILESDIR}/${PN}-0.6.2-fix-nosource-label.patch"
+
+ eautoreconf
+}
+
+pkg_setup() {
+ confutils_require_any lxc kvm openvz qemu uml virtualbox xen
+}
+
+src_configure() {
+ local my_conf=""
+ if use qemu || use kvm ; then
+ my_conf="--with-qemu"
+ else
+ my_conf="--without-qemu"
+ fi
+
+ econf \
+ $(use_with iscsi storage-iscsi) \
+ $(use_with lvm storage-lvm) \
+ $(use_with parted storage-disk) \
+ $(use_with lxc) \
+ $(use_with openvz) \
+ $(use_with uml) \
+ $(use_with virtualbox vbox) \
+ $(use_with xen) \
+ $(use_with xen xen-inotify) \
+ $(use_with avahi) \
+ $(use_with hal) \
+ $(use_with sasl) \
+ $(use_with network) \
+ $(use_with policykit polkit) \
+ $(use_with selinux) \
+ $(use_enable nls) \
+ $(use_with numa numactl) \
+ ${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"
+ elog
+ ewarn "If you have a DNS server setup on your machine, you will have"
+ ewarn "to configure /etc/dnsmasq.conf to enable the following settings: "
+ ewarn " bind-interfaces"
+ ewarn " interface or except-interface"
+ elog
+ ewarn "Otherwise you might have issues with your existing DNS server."
+}
diff --git a/app-emulation/libvirt/metadata.xml b/app-emulation/libvirt/metadata.xml
index 64cb2c0e11f1..e065e2a19c4a 100644
--- a/app-emulation/libvirt/metadata.xml
+++ b/app-emulation/libvirt/metadata.xml
@@ -31,5 +31,7 @@
<flag name='network'>Enable networking support for guests</flag>
<flag name='virtualbox'>Adds support for VirtualBox based virtual
machines</flag>
+ <flag name='numa'>Use NUMA for memory segmenting via
+ <pkg>sys-process/numactl</pkg></flag>
</use>
</pkgmetadata>