diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2012-10-04 09:56:09 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2012-10-04 09:56:29 +0000 |
commit | 403b4dfb373e99f9fe5bae9ab5a32baa613cb306 (patch) | |
tree | 8e6963cdbb70f2376a1cd6478f913ec467c6323c | |
parent | b667ca51aa608d3dabfe91c678f1415140d9870c (diff) | |
download | aports-403b4dfb373e99f9fe5bae9ab5a32baa613cb306.tar.bz2 aports-403b4dfb373e99f9fe5bae9ab5a32baa613cb306.tar.xz |
main/libvirt: backport some commits from current git. Split drivers in subpkg. Fixes #1398
-rw-r--r-- | main/libvirt/APKBUILD | 88 | ||||
-rw-r--r-- | main/libvirt/libvirt-0.10.2-legacy-xen-driver.patch | 66 | ||||
-rw-r--r-- | main/libvirt/libvirt-0.10.2-support-xen-sysctl-v9.patch | 34 |
3 files changed, 183 insertions, 5 deletions
diff --git a/main/libvirt/APKBUILD b/main/libvirt/APKBUILD index 29e644f7b1..b4d8f7a02b 100644 --- a/main/libvirt/APKBUILD +++ b/main/libvirt/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Leonardo Arena <rnalrd@alpinelinux.org> pkgname=libvirt pkgver=0.10.2 -pkgrel=0 +pkgrel=1 pkgdesc="A virtualization API for several hypervisor and container systems" url="http://libvirt.org/" arch="all" @@ -13,16 +13,24 @@ makedepends="augeas-dev bridge-utils cyrus-sasl-dev device-mapper lvm2-dev lxc-dev gnutls-dev libgcrypt-dev parted-dev perl pkgconfig udev-dev xen-dev zlib-dev yajl-dev libpcap-dev curl-dev" install= -subpackages="$pkgname-dev $pkgname-doc" +subpackages="$pkgname-client $pkgname-daemon $pkgname-dev $pkgname-doc $pkgname-lang + $pkgname-lxc $pkgname-qemu $pkgname-xen $pkgname-uml" source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz libvirt.confd - libvirt.initd" + libvirt.initd + libvirt-0.10.2-legacy-xen-driver.patch + libvirt-0.10.2-support-xen-sysctl-v9.patch + " _builddir="$srcdir"/$pkgname-$pkgver prepare() { cd "$_builddir" - return 0 + for patch in $(ls ../*.patch) + do + msg "Applying patch $patch" + patch -p1 < ../$patch || return 1 + done } build() { @@ -46,6 +54,76 @@ package() { install -D -m755 $srcdir/$pkgname.confd $pkgdir/etc/conf.d/libvirtd } +daemon() { + cd "$_builddir" + pkgdesc="libvirt daemon package" + depends="libvirt logrotate" + daemon="libvirtd" + replaces="libvirt" + mkdir -p "$subpkgdir"/etc/$pkgname \ + "$subpkgdir"/etc/logrotate.d \ + "$subpkgdir"/usr/sbin + # mkdir -p "$subpkgdir"/usr/sbin + mv "$pkgdir"/etc/init.d "$subpkgdir"/etc + mv "$pkgdir"/etc/conf.d "$subpkgdir"/etc + mv "$pkgdir"/etc/$pkgname/$daemon.conf "$subpkgdir"/etc/libvirt/ + mv "$pkgdir"/usr/sbin/$daemon "$subpkgdir"/usr/sbin/ + mv "$pkgdir"/etc/logrotate.d/libvirtd "$subpkgdir"/etc/logrotate.d/ +} + +client() { + cd "$_builddir" + pkgdesc="libvirt client package" + depends="libvirt" + replaces="libvirt" + mkdir -p "$subpkgdir"/etc/$pkgname "$subpkgdir"/usr/bin + # mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/etc/$pkgname/$pkgname.conf "$subpkgdir"/etc/libvirt/ + mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ +} + +_mv_driver() { + mkdir -p "$subpkgdir"/usr/lib/libvirt/connection-driver \ + "$subpkgdir"/etc/libvirt "$subpkgdir"/etc/logrotate.d + mv "$pkgdir"/usr/lib/libvirt/connection-driver/libvirt_driver_$1.so \ + "$subpkgdir"/usr/lib/libvirt/connection-driver/ + if [ "$1" != "xen" ]; then + mv "$pkgdir"/etc/logrotate.d/libvirtd.$1 \ + "$subpkgdir"/etc/logrotate.d/ + fi +} + +qemu() { + pkgdesc="QEMU driver for libvirt" + depends="libvirt logrotate" + replaces="libvirt" + _mv_driver qemu + mv "$pkgdir"/etc/libvirt/qemu.conf "$subpkgdir"/etc/libvirt/ +} + +xen() { + pkgdesc="XEN driver for libvirt" + depends="libvirt" + replaces="libvirt" + _mv_driver xen +} + +lxc() { + pkgdesc="lxc driver for libvirt" + depends="libvirt logrotate" + replaces="libvirt" + _mv_driver lxc +} + +uml() { + pkgdesc="UML driver for libvirt" + depends="libvirt logrotate" + replaces="libvirt" + _mv_driver uml +} + md5sums="a5e50860d9da238ba270b528411c4a0d libvirt-0.10.2.tar.gz 1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd -7067215010da2d7282d878ba43070c5d libvirt.initd" +7067215010da2d7282d878ba43070c5d libvirt.initd +31c0c6ca4fe85bd1cfc00756ec47ea06 libvirt-0.10.2-legacy-xen-driver.patch +e259b3e5b7257c9301a36186b748195b libvirt-0.10.2-support-xen-sysctl-v9.patch" diff --git a/main/libvirt/libvirt-0.10.2-legacy-xen-driver.patch b/main/libvirt/libvirt-0.10.2-legacy-xen-driver.patch new file mode 100644 index 0000000000..caf17aa793 --- /dev/null +++ b/main/libvirt/libvirt-0.10.2-legacy-xen-driver.patch @@ -0,0 +1,66 @@ +From: Jim Fehlig <jfehlig@suse.com> +Date: Wed, 26 Sep 2012 21:20:35 +0000 (-0600) +Subject: Fix compilation of legacy xen driver with Xen 4.2 +X-Git-Url: http://libvirt.org/git/?p=libvirt.git;a=commitdiff_plain;h=416eca189b1934cfa8575ab72d142ec77600fcf9 + +Fix compilation of legacy xen driver with Xen 4.2 + +In Xen 4.2, xs.h is deprecated in favor of xenstore.h. xs.h now +contains + +#warning xs.h is deprecated use xenstore.h instead +#include <xenstore.h> + +which fails compilation when warnings are treated as errors. + +Introduce a configure-time check for xenstore.h and if found, +use it instead of xs.h. +--- + +diff --git a/configure.ac b/configure.ac +index 38d94d4..ae26de7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -768,6 +768,8 @@ if test "$with_xen" != "no" ; then + fi + + if test "$with_xen" != "no" ; then ++ dnl In Xen 4.2, xs.h is deprecated in favor of xenstore.h. ++ AC_CHECK_HEADERS([xenstore.h]) + AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[ + if test "$with_xen" = "yes"; then + fail=1 +diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c +index f3b756a..5ab1ce4 100644 +--- a/src/xen/block_stats.c ++++ b/src/xen/block_stats.c +@@ -32,7 +32,11 @@ + # include <unistd.h> + # include <regex.h> + +-# include <xs.h> ++# if HAVE_XENSTORE_H ++# include <xenstore.h> ++# else ++# include <xs.h> ++# endif + + # include "virterror_internal.h" + # include "datatypes.h" +diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c +index 12efa0c..a91d409 100644 +--- a/src/xen/xs_internal.c ++++ b/src/xen/xs_internal.c +@@ -35,7 +35,11 @@ + #include <xen/dom0_ops.h> + #include <xen/version.h> + +-#include <xs.h> ++#if HAVE_XENSTORE_H ++# include <xenstore.h> ++#else ++# include <xs.h> ++#endif + + #include "virterror_internal.h" + #include "datatypes.h" diff --git a/main/libvirt/libvirt-0.10.2-support-xen-sysctl-v9.patch b/main/libvirt/libvirt-0.10.2-support-xen-sysctl-v9.patch new file mode 100644 index 0000000000..2270075b5d --- /dev/null +++ b/main/libvirt/libvirt-0.10.2-support-xen-sysctl-v9.patch @@ -0,0 +1,34 @@ +From: Jim Fehlig <jfehlig@suse.com> +Date: Wed, 26 Sep 2012 16:34:17 +0000 (-0600) +Subject: Support Xen sysctl version 9 in Xen 4.2 +X-Git-Url: http://libvirt.org/git/?p=libvirt.git;a=commitdiff_plain;h=371ddc98664cbbd8542593e5452115ea7918dae2 + +Support Xen sysctl version 9 in Xen 4.2 + +Xen upstream c/s 24102:dc8e55c9 bumped the sysctl version to 9. +Support this sysctl version in the xen_hypervisor sub-driver. +--- + +diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c +index fdc3071..3244bbd 100644 +--- a/src/xen/xen_hypervisor.c ++++ b/src/xen/xen_hypervisor.c +@@ -2164,6 +2164,18 @@ xenHypervisorInit(struct xenHypervisorVersions *override_versions) + goto done; + } + ++ /* Xen 4.2 ++ * sysctl version 9 -> xen-unstable c/s 24102:dc8e55c90604 ++ * domctl version 8 -> unchanged from Xen 4.1 ++ */ ++ hv_versions.sys_interface = 9; /* XEN_SYSCTL_INTERFACE_VERSION */ ++ if (virXen_getdomaininfo(fd, 0, &info) == 1) { ++ hv_versions.dom_interface = 8; /* XEN_DOMCTL_INTERFACE_VERSION */ ++ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ ++ VIR_DEBUG("Using hypervisor call v2, sys ver9 dom ver8"); ++ goto done; ++ } ++ } + + /* + * we failed to make the getdomaininfolist hypercall |