Commit 403b4dfb authored by Leonardo Arena's avatar Leonardo Arena

main/libvirt: backport some commits from current git. Split drivers in subpkg. Fixes #1398

parent b667ca51
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org> # Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=libvirt pkgname=libvirt
pkgver=0.10.2 pkgver=0.10.2
pkgrel=0 pkgrel=1
pkgdesc="A virtualization API for several hypervisor and container systems" pkgdesc="A virtualization API for several hypervisor and container systems"
url="http://libvirt.org/" url="http://libvirt.org/"
arch="all" arch="all"
...@@ -13,16 +13,24 @@ makedepends="augeas-dev bridge-utils cyrus-sasl-dev device-mapper ...@@ -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 lvm2-dev lxc-dev gnutls-dev libgcrypt-dev parted-dev perl pkgconfig
udev-dev xen-dev zlib-dev yajl-dev libpcap-dev curl-dev" udev-dev xen-dev zlib-dev yajl-dev libpcap-dev curl-dev"
install= 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 source="http://libvirt.org/sources/$pkgname-$pkgver.tar.gz
libvirt.confd 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 _builddir="$srcdir"/$pkgname-$pkgver
prepare() { prepare() {
cd "$_builddir" cd "$_builddir"
return 0 for patch in $(ls ../*.patch)
do
msg "Applying patch $patch"
patch -p1 < ../$patch || return 1
done
} }
build() { build() {
...@@ -46,6 +54,76 @@ package() { ...@@ -46,6 +54,76 @@ package() {
install -D -m755 $srcdir/$pkgname.confd $pkgdir/etc/conf.d/libvirtd 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 md5sums="a5e50860d9da238ba270b528411c4a0d libvirt-0.10.2.tar.gz
1c84a7baeafe0a7f4e9d7ae5180311b7 libvirt.confd 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"
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"
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment