SHA256
1
0
forked from pool/libvirt

Accepting request 147454 from Virtualization

- Update to libvirt 1.0.1
  - Introduce virtlockd daemon
  - parallels: add disk and network device support
  - Add virDomainSendProcessSignal API
  - Introduce virDomainFSTrim() public API
  - add fuse support for libvirt lxc
  - Add Gluster protocol as supported network disk backend
  - various snapshot improvements
- Add upstream patches to fix bugs in 1.0.1
  66ff2ddc-virtlockd-systemd-file-perms.patch,
  462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
  5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
  68e7bc45-libxl-link-fix.patch
- Rework SUSE patches for the various init scripts
  Dropped use-init-script-redhat.patch and added
  libvirtd-init-script.patch, libvirt-guests-init-script.patch,
  and virtlockd-init-script.patch

- Update to libvirt 1.0.0
  - virNodeGetCPUMap: Define public API
  - Add systemd journal support
  - Add a qemu capabilities cache manager
  - USB migration support
  - various improvement and fixes when using QMP QEmu interface
  - Support for Xen 4.2 in legacy xen driver
  - Lot of localization enhancements
  - Drop upstream patches: 371ddc98-xen-sysctl-9.patch,
    416eca18-xenstore-header-fix.patch,
    f644361b-virCommand-env.patch, 2b32735a-virCommand-env.patch,
    9785f2b6-fix-xen-sysctl9.patch

OBS-URL: https://build.opensuse.org/request/show/147454
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=108
This commit is contained in:
Stephan Kulow 2013-01-08 13:32:31 +00:00 committed by Git OBS Bridge
commit a067e1a874
29 changed files with 1334 additions and 766 deletions

View File

@ -1,38 +0,0 @@
commit 2b32735af480055e27400068d27364d521071117
Author: Richard W.M. Jones <rjones@redhat.com>
Date: Mon Sep 24 17:35:47 2012 +0100
command: Change virCommandAddEnv so it replaces existing environment variables.
Index: libvirt-0.10.2/src/util/command.c
===================================================================
--- libvirt-0.10.2.orig/src/util/command.c
+++ libvirt-0.10.2/src/util/command.c
@@ -985,11 +985,26 @@ virCommandNonblockingFDs(virCommandPtr c
}
/* Add an environment variable to the cmd->env list. 'env' is a
- * string like "name=value".
+ * string like "name=value". If the named environment variable is
+ * already set, then it is replaced in the list.
*/
static inline void
virCommandAddEnv(virCommandPtr cmd, char *env)
{
+ size_t namelen;
+ size_t i;
+
+ /* Search for the name in the existing environment. */
+ namelen = strcspn(env, "=");
+ for (i = 0; i < cmd->nenv; ++i) {
+ /* + 1 because we want to match the '=' character too. */
+ if (STREQLEN(cmd->env[i], env, namelen + 1)) {
+ VIR_FREE(cmd->env[i]);
+ cmd->env[i] = env;
+ return;
+ }
+ }
+
/* Arg plus trailing NULL. */
if (VIR_RESIZE_N(cmd->env, cmd->maxenv, cmd->nenv, 1 + 1) < 0) {
VIR_FREE(env);

View File

@ -1,32 +0,0 @@
commit 371ddc98664cbbd8542593e5452115ea7918dae2
Author: Jim Fehlig <jfehlig@suse.com>
Date: Wed Sep 26 10:34:17 2012 -0600
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.
Index: libvirt-0.10.2/src/xen/xen_hypervisor.c
===================================================================
--- libvirt-0.10.2.orig/src/xen/xen_hypervisor.c
+++ libvirt-0.10.2/src/xen/xen_hypervisor.c
@@ -2164,6 +2164,18 @@ xenHypervisorInit(struct xenHypervisorVe
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

View File

@ -1,64 +0,0 @@
commit 416eca189b1934cfa8575ab72d142ec77600fcf9
Author: Jim Fehlig <jfehlig@suse.com>
Date: Wed Sep 26 15:20:35 2012 -0600
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.
Index: libvirt-0.10.2/configure.ac
===================================================================
--- libvirt-0.10.2.orig/configure.ac
+++ libvirt-0.10.2/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
Index: libvirt-0.10.2/src/xen/block_stats.c
===================================================================
--- libvirt-0.10.2.orig/src/xen/block_stats.c
+++ libvirt-0.10.2/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"
Index: libvirt-0.10.2/src/xen/xs_internal.c
===================================================================
--- libvirt-0.10.2.orig/src/xen/xs_internal.c
+++ libvirt-0.10.2/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"

View File

@ -0,0 +1,401 @@
commit 462a69621e232c83990dbe6a711326b671262d47
Author: Eric Blake <eblake@redhat.com>
Date: Fri Jan 4 13:35:04 2013 -0700
build: use common .in replacement mechanism
We had several different styles of .in conversion in our Makefiles:
ALLCAPS, @ALLCAPS@, @lower@, ::lower::
Canonicalize on one form, to make it easier to copy and paste
between .in files.
Also, we were using some non-portable sed constructs: \@ is an
undefined escape sequence (it happens to be @ itself in GNU sed,
but POSIX allows it to mean something else), as well as risky
behavior (failure to consistently quote things means a space
in $(sysconfdir) could throw things off; also, Autoconf recommends
using | rather than , or ! in the s||| operator, because | has to
be quoted in shell and is therefore less likely to appear in file
names than , or !).
Fix all of these uses to follow the same syntax.
* daemon/libvirtd.8.in: Switch to @var@.
* tools/virt-xml-validate.in: Likewise.
* tools/virt-pki-validate.in: Likewise.
* src/locking/virtlockd.init.in: Likewise.
* daemon/Makefile.am: Prefer | over ! in sed.
(libvirtd.8): Prefer consistent substitution.
(libvirtd.init, libvirtd.service): Avoid non-portable sed.
* tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init)
(libvirt-guests.service): Likewise.
(virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup):
Prefer consistent capitalization.
* src/Makefile.am (virtlockd.init, virtlockd.service)
(virtlockd.socket): Prefer consistent substitution.
Index: libvirt-1.0.1/daemon/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/daemon/Makefile.am
+++ libvirt-1.0.1/daemon/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2012 Red Hat, Inc.
+## Copyright (C) 2005-2013 Red Hat, Inc.
## See COPYING.LIB for the License of this software
INCLUDES = \
@@ -84,8 +84,8 @@ CLEANFILES += test_libvirtd.aug
libvirtd.8: $(srcdir)/libvirtd.8.in
$(AM_V_GEN)sed \
- -e 's!SYSCONFDIR!$(sysconfdir)!g' \
- -e 's!LOCALSTATEDIR!$(localstatedir)!g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
@@ -181,7 +181,7 @@ endif
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
$(AM_V_GEN) sed \
- -e 's![@]authaction[@]!$(policyauth)!g' \
+ -e 's|[@]authaction[@]|$(policyauth)|g' \
< $< > $@-t && \
mv $@-t $@
BUILT_SOURCES += libvirtd.policy
@@ -222,25 +222,25 @@ BUILT_SOURCES += $(LOGROTATE_CONFS)
libvirtd.logrotate: libvirtd.logrotate.in
$(AM_V_GEN)sed \
- -e 's![@]localstatedir[@]!$(localstatedir)!g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
$(AM_V_GEN)sed \
- -e 's![@]localstatedir[@]!$(localstatedir)!g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
$(AM_V_GEN)sed \
- -e 's![@]localstatedir[@]!$(localstatedir)!g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
$(AM_V_GEN)sed \
- -e 's![@]localstatedir[@]!$(localstatedir)!g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
@@ -340,21 +340,21 @@ uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e s!\@localstatedir\@!$(localstatedir)!g \
- -e s!\@sbindir\@!$(sbindir)!g \
- -e s!\@sysconfdir\@!$(sysconfdir)!g \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e s!\@localstatedir\@!$(localstatedir)!g \
- -e s!\@sbindir\@!$(sbindir)!g \
- -e s!\@sysconfdir\@!$(sysconfdir)!g \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
Index: libvirt-1.0.1/src/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/src/Makefile.am
+++ libvirt-1.0.1/src/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2012 Red Hat, Inc.
+## Copyright (C) 2005-2013 Red Hat, Inc.
## See COPYING.LIB for the License of this software
# No libraries with the exception of LIBXML should be listed
@@ -1662,12 +1662,12 @@ uninstall-init::
endif
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e "s!::localstatedir::!$(localstatedir)!g" \
- -e "s!::sbindir::!$(sbindir)!g" \
- -e "s!::sysconfdir::!$(sysconfdir)!g" \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
@@ -1703,21 +1703,21 @@ uninstall-systemd:
endif
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e "s!::localstatedir::!$(localstatedir)!g" \
- -e "s!::sbindir::!$(sbindir)!g" \
- -e "s!::sysconfdir::!$(sysconfdir)!g" \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e "s!::localstatedir::!$(localstatedir)!g" \
- -e "s!::sbindir::!$(sbindir)!g" \
- -e "s!::sysconfdir::!$(sysconfdir)!g" \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
Index: libvirt-1.0.1/src/locking/virtlockd.init.in
===================================================================
--- libvirt-1.0.1.orig/src/locking/virtlockd.init.in
+++ libvirt-1.0.1/src/locking/virtlockd.init.in
@@ -20,19 +20,19 @@
# on virtual machine disk images
#
# processname: virtlockd
-# pidfile: ::localstatedir::/run/libvirt/virtlockd.pid
+# pidfile: @localstatedir@/run/libvirt/virtlockd.pid
#
# Source function library.
-. ::sysconfdir::/rc.d/init.d/functions
+. @sysconfdir@/rc.d/init.d/functions
SERVICE=virtlockd
PROCESS=virtlockd
-PIDFILE=::localstatedir::/run/libvirt/lockd/$SERVICE.pid
+PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid
VIRTLOCKD_ARGS=
-test -f ::sysconfdir::/sysconfig/virtlockd && . ::sysconfdir::/sysconfig/virtlockd
+test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd
RETVAL=0
@@ -41,7 +41,7 @@ start() {
daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS
RETVAL=$?
echo
- [ $RETVAL -eq 0 ] && touch ::localstatedir::/lock/subsys/$SERVICE
+ [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
}
stop() {
@@ -51,7 +51,7 @@ stop() {
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
- rm -f ::localstatedir::/lock/subsys/$SERVICE
+ rm -f @localstatedir@/lock/subsys/$SERVICE
rm -f $PIDFILE
fi
}
@@ -83,7 +83,7 @@ case "$1" in
reload
;;
condrestart|try-restart)
- [ -f ::localstatedir::/lock/subsys/$SERVICE ] && restart || :
+ [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
Index: libvirt-1.0.1/tools/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/tools/Makefile.am
+++ libvirt-1.0.1/tools/Makefile.am
@@ -1,4 +1,4 @@
-## Copyright (C) 2005-2012 Red Hat, Inc.
+## Copyright (C) 2005-2013 Red Hat, Inc.
## See COPYING.LIB for the License of this software
INCLUDES = \
@@ -58,7 +58,7 @@ dist_man8_MANS = virt-sanlock-cleanup.8
endif
virt-xml-validate: virt-xml-validate.in Makefile
- $(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
+ $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|' < $< > $@ \
|| (rm $@ && exit 1) && chmod +x $@
virt-xml-validate.1: virt-xml-validate.in
@@ -67,7 +67,7 @@ virt-xml-validate.1: virt-xml-validate.i
rm $(srcdir)/$@; exit 1; fi
virt-pki-validate: virt-pki-validate.in Makefile
- $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
+ $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' < $< > $@ \
|| (rm $@ && exit 1) && chmod +x $@
virt-pki-validate.1: virt-pki-validate.in
@@ -81,8 +81,8 @@ virt-host-validate.1: virt-host-validate
rm $(srcdir)/$@; exit 1; fi
virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
- $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' \
- -e 's,[@]LOCALSTATEDIR@,$(localstatedir),' < $< > $@ \
+ $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \
+ -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \
|| (rm $@ && exit 1) && chmod +x $@
virt-sanlock-cleanup.8: virt-sanlock-cleanup.in
@@ -210,21 +210,21 @@ uninstall-init:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e 's!\@PACKAGE\@!$(PACKAGE)!g' \
- -e 's!\@bindir\@!$(bindir)!g' \
- -e 's!\@localedir\@!$(localedir)!g' \
- -e 's!\@localstatedir\@!$(localstatedir)!g' \
- -e 's!\@sbindir\@!$(sbindir)!g' \
- -e 's!\@sysconfdir\@!$(sysconfdir)!g' \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \
+ -e 's|[@]bindir[@]|$(bindir)|g' \
+ -e 's|[@]localedir[@]|$(localedir)|g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
BUILT_SOURCES += libvirt-guests.sh
libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh
$(AM_V_GEN)sed \
- -e 's!\@libexecdir\@!$(libexecdir)!g' \
+ -e 's|[@]libexecdir[@]|$(libexecdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
@@ -251,16 +251,16 @@ uninstall-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e 's!\@PACKAGE\@!$(PACKAGE)!g' \
- -e 's!\@bindir\@!$(bindir)!g' \
- -e 's!\@localedir\@!$(localedir)!g' \
- -e 's!\@localstatedir\@!$(localstatedir)!g' \
- -e 's!\@sbindir\@!$(sbindir)!g' \
- -e 's!\@sysconfdir\@!$(sysconfdir)!g' \
- -e 's!\@libexecdir\@!$(libexecdir)!g' \
- < $< > $@-t && \
- chmod a+x $@-t && \
+ $(AM_V_GEN)sed \
+ -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \
+ -e 's|[@]bindir[@]|$(bindir)|g' \
+ -e 's|[@]localedir[@]|$(localedir)|g' \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ -e 's|[@]libexecdir[@]|$(libexecdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
mv $@-t $@
Index: libvirt-1.0.1/tools/virt-pki-validate.in
===================================================================
--- libvirt-1.0.1.orig/tools/virt-pki-validate.in
+++ libvirt-1.0.1/tools/virt-pki-validate.in
@@ -25,7 +25,7 @@ echo Found "$CERTOOL"
#
# Check the directory structure
#
-SYSCONFDIR="@SYSCONFDIR@"
+SYSCONFDIR="@sysconfdir@"
PKI="$SYSCONFDIR/pki"
if [ ! -d "$PKI" ]
then
Index: libvirt-1.0.1/tools/virt-sanlock-cleanup.in
===================================================================
--- libvirt-1.0.1.orig/tools/virt-sanlock-cleanup.in
+++ libvirt-1.0.1/tools/virt-sanlock-cleanup.in
@@ -10,9 +10,9 @@ fi
LOCKSPACE="__LIBVIRT__DISKS__"
-LOCKDIR=`augtool print '/files@SYSCONFDIR@/libvirt/qemu-sanlock.conf/disk_lease_dir'`
+LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'`
if test $? != 0 || "x$LOCKDIR" = "x" ; then
- LOCKDIR="@LOCALSTATEDIR@/lib/libvirt/sanlock"
+ LOCKDIR="@localstatedir@/lib/libvirt/sanlock"
fi
notify() {
@@ -80,7 +80,7 @@ Alternatively report bugs to your softwa
=head1 COPYRIGHT
-Copyright (C) 2011 Red Hat, Inc.
+Copyright (C) 2011, 2013 Red Hat, Inc.
=head1 LICENSE
Index: libvirt-1.0.1/tools/virt-xml-validate.in
===================================================================
--- libvirt-1.0.1.orig/tools/virt-xml-validate.in
+++ libvirt-1.0.1/tools/virt-xml-validate.in
@@ -57,7 +57,7 @@ if [ -z "$TYPE" ]; then
esac
fi
-SCHEMA="@SCHEMADIR@/${TYPE}.rng"
+SCHEMA="@schemadir@/${TYPE}.rng"
if [ ! -f "$SCHEMA" ]; then
echo "$0: schema $SCHEMA does not exist"

View File

@ -0,0 +1,57 @@
commit 5ec4b22b777b4505d159c6e8d1631d4d774a7be7
Author: Eric Blake <eblake@redhat.com>
Date: Fri Jan 4 13:50:39 2013 -0700
build: .service files don't need to be executable
See also commit 66ff2dd, where we avoided installing these files
as executables.
* daemon/Makefile.am (libvirtd.service): Drop chmod.
* tools/Makefile.am (libvirt-guests.service): Likewise.
* src/Makefile.am (virtlockd.service, virtlockd.socket):
Likewise.
Index: libvirt-1.0.1/daemon/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/daemon/Makefile.am
+++ libvirt-1.0.1/daemon/Makefile.am
@@ -354,7 +354,6 @@ libvirtd.service: libvirtd.service.in $(
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
- chmod a+x $@-t && \
mv $@-t $@
Index: libvirt-1.0.1/src/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/src/Makefile.am
+++ libvirt-1.0.1/src/Makefile.am
@@ -1706,14 +1706,12 @@ virtlockd.service: locking/virtlockd.ser
$(AM_V_GEN)sed \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
< $< > $@-t && \
- chmod a+x $@-t && \
mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
- chmod a+x $@-t && \
mv $@-t $@
Index: libvirt-1.0.1/tools/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/tools/Makefile.am
+++ libvirt-1.0.1/tools/Makefile.am
@@ -260,7 +260,6 @@ libvirt-guests.service: libvirt-guests.s
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
-e 's|[@]libexecdir[@]|$(libexecdir)|g' \
< $< > $@-t && \
- chmod a+x $@-t && \
mv $@-t $@

View File

@ -0,0 +1,24 @@
commit 66ff2ddc29298da43b3be3b7780683418e2ead76
Author: Guido Günther <agx@sigxcpu.org>
Date: Thu Jan 3 22:39:14 2013 +0100
Install virtlockd.{socket,service} non executable
since they're not scripts but systemd service files.
Index: libvirt-1.0.1/src/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/src/Makefile.am
+++ libvirt-1.0.1/src/Makefile.am
@@ -1684,9 +1684,9 @@ DISTCLEANFILES += virtlockd.service virt
install-systemd: virtlockd.service virtlockd.socket install-sysconfig
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
- $(INSTALL_SCRIPT) virtlockd.service \
+ $(INSTALL_DATA) virtlockd.service \
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/
- $(INSTALL_SCRIPT) virtlockd.socket \
+ $(INSTALL_DATA) virtlockd.socket \
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/
uninstall-systemd: uninstall-sysconfig

View File

@ -0,0 +1,24 @@
commit 68e7bc4561783d742d1e266b7f1f0e3516d5117e
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Jan 7 10:15:56 2013 -0700
build: Add libxenctrl to LIBXL_LIBS
Commit dfa1e1dd removed libxenctrl from LIBXL_LIBS, but the libxl
driver uses a symbol from this library. Explicitly link with
libxenctrl instead of relying on the build system to support
implicit DSO linking.
Index: libvirt-1.0.1/configure.ac
===================================================================
--- libvirt-1.0.1.orig/configure.ac
+++ libvirt-1.0.1/configure.ac
@@ -727,7 +727,7 @@ if test "$with_libxl" != "no" ; then
LIBS="$LIBS $LIBXL_LIBS"
AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
with_libxl=yes
- LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
+ LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenctrl"
],[
if test "$with_libxl" = "yes"; then
fail=1

View File

@ -1,48 +0,0 @@
commit 9785f2b6f203ad5f153e68829b95f0e8c30a1560
Author: Jim Fehlig <jfehlig@suse.com>
Date: Tue Oct 23 11:18:20 2012 -0600
Fix detection of Xen sysctl version 9
In commit 371ddc98, I mistakenly added the check for sysctl
version 9 after setting the hypercall version to 1, which will
fail with
error : xenHypervisorDoV1Op:967 : Unable to issue hypervisor
ioctl 3166208: Function not implemented
This check should be included along with the others that use
hypercall version 2.
Index: libvirt-0.10.2/src/xen/xen_hypervisor.c
===================================================================
--- libvirt-0.10.2.orig/src/xen/xen_hypervisor.c
+++ libvirt-0.10.2/src/xen/xen_hypervisor.c
@@ -2157,13 +2157,6 @@ xenHypervisorInit(struct xenHypervisorVe
}
}
- hv_versions.hypervisor = 1;
- hv_versions.sys_interface = -1;
- if (virXen_getdomaininfo(fd, 0, &info) == 1) {
- VIR_DEBUG("Using hypervisor call v1");
- goto done;
- }
-
/* Xen 4.2
* sysctl version 9 -> xen-unstable c/s 24102:dc8e55c90604
* domctl version 8 -> unchanged from Xen 4.1
@@ -2177,6 +2170,13 @@ xenHypervisorInit(struct xenHypervisorVe
}
}
+ hv_versions.hypervisor = 1;
+ hv_versions.sys_interface = -1;
+ if (virXen_getdomaininfo(fd, 0, &info) == 1) {
+ VIR_DEBUG("Using hypervisor call v1");
+ goto done;
+ }
+
/*
* we failed to make the getdomaininfolist hypercall
*/

View File

@ -1,7 +1,7 @@
Index: libvirt-0.10.2/src/util/virnetdev.c Index: libvirt-1.0.1/src/util/virnetdev.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/util/virnetdev.c --- libvirt-1.0.1.orig/src/util/virnetdev.c
+++ libvirt-0.10.2/src/util/virnetdev.c +++ libvirt-1.0.1/src/util/virnetdev.c
@@ -81,7 +81,7 @@ static int virNetDevSetupControlFull(con @@ -81,7 +81,7 @@ static int virNetDevSetupControlFull(con
static int virNetDevSetupControl(const char *ifname, static int virNetDevSetupControl(const char *ifname,
struct ifreq *ifr) struct ifreq *ifr)
@ -11,10 +11,10 @@ Index: libvirt-0.10.2/src/util/virnetdev.c
} }
#endif #endif
Index: libvirt-0.10.2/src/util/virnetdevbridge.c Index: libvirt-1.0.1/src/util/virnetdevbridge.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/util/virnetdevbridge.c --- libvirt-1.0.1.orig/src/util/virnetdevbridge.c
+++ libvirt-0.10.2/src/util/virnetdevbridge.c +++ libvirt-1.0.1/src/util/virnetdevbridge.c
@@ -84,7 +84,7 @@ static int virNetDevSetupControlFull(con @@ -84,7 +84,7 @@ static int virNetDevSetupControlFull(con
static int virNetDevSetupControl(const char *ifname, static int virNetDevSetupControl(const char *ifname,
struct ifreq *ifr) struct ifreq *ifr)

View File

@ -0,0 +1,58 @@
commit a1fd56cb3057c45cffbf5d41eaf70a26d2116b20
Author: Eric Blake <eblake@redhat.com>
Date: Fri Jan 4 14:21:59 2013 -0700
build: install libvirt sysctl file correctly
https://bugzilla.redhat.com/show_bug.cgi?id=887017 reports that
even though libvirt attempts to set fs.aio-max-nr via sysctl,
the file was installed with the wrong name and gets ignored by
sysctl. Furthermore, 'man systcl.d' recommends that packages
install into hard-coded /usr/lib/sysctl.d (even when libdir is
/usr/lib64), so that sysadmins can use /etc/sysctl.d for overrides.
* daemon/Makefile.am (install-sysctl, uninstall-sysctl): Use
correct location.
* libvirt.spec.in (network_files): Reflect this.
Index: libvirt-1.0.1/daemon/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/daemon/Makefile.am
+++ libvirt-1.0.1/daemon/Makefile.am
@@ -273,14 +273,16 @@ uninstall-sysconfig:
rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
if WITH_SYSCTL
+# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
+# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
install-sysctl:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
+ $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
- $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
+ $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
uninstall-sysctl:
- rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
+ rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
+ rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
else
install-sysctl:
uninstall-sysctl:
Index: libvirt-1.0.1/libvirt.spec.in
===================================================================
--- libvirt-1.0.1.orig/libvirt.spec.in
+++ libvirt-1.0.1/libvirt.spec.in
@@ -1678,9 +1678,9 @@ fi
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
%if 0%{?fedora} >= 14 || 0%{?rhel} >= 6
-%config(noreplace) %{_sysconfdir}/sysctl.d/libvirtd
+%config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf
%else
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
+rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/libvirtd.conf
%endif
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/

View File

@ -0,0 +1,51 @@
commit cb854b8f6128002306c1bc07113cf038a50be8bc
Author: Eric Blake <eblake@redhat.com>
Date: Fri Jan 4 13:48:30 2013 -0700
build: properly substitute virtlockd.socket
virtlockd.service could be installed to a configurable root,
but virtlockd.socket was hardcoded to installation into a
distro.
* src/Makefile.am (virtlockd.service, virtlockd.socket): Drop
unused substitutions.
* src/locking/virtlockd.socket.in (ListenStream): Don't hard-code
/var.
Index: libvirt-1.0.1/src/Makefile.am
===================================================================
--- libvirt-1.0.1.orig/src/Makefile.am
+++ libvirt-1.0.1/src/Makefile.am
@@ -1704,9 +1704,7 @@ endif
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
- -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
- -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
@@ -1714,8 +1712,6 @@ virtlockd.service: locking/virtlockd.ser
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
- -e 's|[@]sbindir[@]|$(sbindir)|g' \
- -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
Index: libvirt-1.0.1/src/locking/virtlockd.socket.in
===================================================================
--- libvirt-1.0.1.orig/src/locking/virtlockd.socket.in
+++ libvirt-1.0.1/src/locking/virtlockd.socket.in
@@ -2,7 +2,7 @@
Description=Virtual machine lock manager socket
[Socket]
-ListenStream=/var/run/libvirt/virtlockd/virtlockd.sock
+ListenStream=@localstatedir@/run/libvirt/virtlockd/virtlockd.sock
[Install]
WantedBy=multi-user.target

View File

@ -2,7 +2,7 @@ Index: src/lxc/lxc_container.c
=================================================================== ===================================================================
--- src/lxc/lxc_container.c.orig --- src/lxc/lxc_container.c.orig
+++ src/lxc/lxc_container.c +++ src/lxc/lxc_container.c
@@ -1932,6 +1932,9 @@ int lxcContainerStart(virDomainDefPtr de @@ -1982,6 +1982,9 @@ int lxcContainerStart(virDomainDefPtr de
ttyPaths, nttyPaths, handshakefd}; ttyPaths, nttyPaths, handshakefd};
/* allocate a stack for the container */ /* allocate a stack for the container */
@ -12,7 +12,7 @@ Index: src/lxc/lxc_container.c
if (VIR_ALLOC_N(stack, stacksize) < 0) { if (VIR_ALLOC_N(stack, stacksize) < 0) {
virReportOOMError(); virReportOOMError();
return -1; return -1;
@@ -1951,7 +1954,11 @@ int lxcContainerStart(virDomainDefPtr de @@ -2001,7 +2004,11 @@ int lxcContainerStart(virDomainDefPtr de
cflags |= CLONE_NEWNET; cflags |= CLONE_NEWNET;
} }
@ -24,7 +24,7 @@ Index: src/lxc/lxc_container.c
VIR_FREE(stack); VIR_FREE(stack);
VIR_DEBUG("clone() completed, new container PID is %d", pid); VIR_DEBUG("clone() completed, new container PID is %d", pid);
@@ -1977,6 +1984,7 @@ int lxcContainerAvailable(int features) @@ -2027,6 +2034,7 @@ int lxcContainerAvailable(int features)
int cpid; int cpid;
char *childStack; char *childStack;
char *stack; char *stack;
@ -32,7 +32,7 @@ Index: src/lxc/lxc_container.c
if (features & LXC_CONTAINER_FEATURE_USER) if (features & LXC_CONTAINER_FEATURE_USER)
flags |= CLONE_NEWUSER; flags |= CLONE_NEWUSER;
@@ -1984,14 +1992,21 @@ int lxcContainerAvailable(int features) @@ -2034,14 +2042,21 @@ int lxcContainerAvailable(int features)
if (features & LXC_CONTAINER_FEATURE_NET) if (features & LXC_CONTAINER_FEATURE_NET)
flags |= CLONE_NEWNET; flags |= CLONE_NEWNET;

View File

@ -1,88 +0,0 @@
commit f644361b1eeb78fd59be4cd7ec85567bbf300506
Author: Richard W.M. Jones <rjones@redhat.com>
Date: Mon Sep 24 17:30:18 2012 +0100
command: Move environ-adding code to common function virCommandAddEnv.
This is just code motion. The semantics of the code should be
identical after this change.
Index: libvirt-0.10.2/src/util/command.c
===================================================================
--- libvirt-0.10.2.orig/src/util/command.c
+++ libvirt-0.10.2/src/util/command.c
@@ -984,6 +984,22 @@ virCommandNonblockingFDs(virCommandPtr c
cmd->flags |= VIR_EXEC_NONBLOCK;
}
+/* Add an environment variable to the cmd->env list. 'env' is a
+ * string like "name=value".
+ */
+static inline void
+virCommandAddEnv(virCommandPtr cmd, char *env)
+{
+ /* Arg plus trailing NULL. */
+ if (VIR_RESIZE_N(cmd->env, cmd->maxenv, cmd->nenv, 1 + 1) < 0) {
+ VIR_FREE(env);
+ cmd->has_error = ENOMEM;
+ return;
+ }
+
+ cmd->env[cmd->nenv++] = env;
+}
+
/**
* virCommandAddEnvFormat:
* @cmd: the command to modify
@@ -1009,14 +1025,7 @@ virCommandAddEnvFormat(virCommandPtr cmd
}
va_end(list);
- /* Arg plus trailing NULL. */
- if (VIR_RESIZE_N(cmd->env, cmd->maxenv, cmd->nenv, 1 + 1) < 0) {
- VIR_FREE(env);
- cmd->has_error = ENOMEM;
- return;
- }
-
- cmd->env[cmd->nenv++] = env;
+ virCommandAddEnv(cmd, env);
}
/**
@@ -1056,14 +1065,7 @@ virCommandAddEnvString(virCommandPtr cmd
return;
}
- /* env plus trailing NULL */
- if (VIR_RESIZE_N(cmd->env, cmd->maxenv, cmd->nenv, 1 + 1) < 0) {
- VIR_FREE(env);
- cmd->has_error = ENOMEM;
- return;
- }
-
- cmd->env[cmd->nenv++] = env;
+ virCommandAddEnv(cmd, env);
}
@@ -1084,9 +1086,7 @@ virCommandAddEnvBuffer(virCommandPtr cmd
return;
}
- /* env plus trailing NULL. */
- if (virBufferError(buf) ||
- VIR_RESIZE_N(cmd->env, cmd->maxenv, cmd->nenv, 1 + 1) < 0) {
+ if (virBufferError(buf)) {
cmd->has_error = ENOMEM;
virBufferFreeAndReset(buf);
return;
@@ -1096,7 +1096,7 @@ virCommandAddEnvBuffer(virCommandPtr cmd
return;
}
- cmd->env[cmd->nenv++] = virBufferContentAndReset(buf);
+ virCommandAddEnv(cmd, virBufferContentAndReset(buf));
}

View File

@ -1,7 +1,7 @@
Index: libvirt-0.10.2/examples/apparmor/Makefile.am Index: libvirt-1.0.1/examples/apparmor/Makefile.am
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/examples/apparmor/Makefile.am --- libvirt-1.0.1.orig/examples/apparmor/Makefile.am
+++ libvirt-0.10.2/examples/apparmor/Makefile.am +++ libvirt-1.0.1/examples/apparmor/Makefile.am
@@ -1,8 +1,39 @@ @@ -1,8 +1,39 @@
## Copyright (C) 2005-2011 Red Hat, Inc. ## Copyright (C) 2005-2011 Red Hat, Inc.
## See COPYING.LIB for the License of this software ## See COPYING.LIB for the License of this software
@ -47,10 +47,10 @@ Index: libvirt-0.10.2/examples/apparmor/Makefile.am
+ rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE + rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE
+ +
+endif +endif
Index: libvirt-0.10.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in Index: libvirt-1.0.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ libvirt-0.10.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in +++ libvirt-1.0.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+# Last Modified: Fri Aug 19 11:21:48 2011 +# Last Modified: Fri Aug 19 11:21:48 2011
+#include <tunables/global> +#include <tunables/global>
@ -92,9 +92,9 @@ Index: libvirt-0.10.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
+ /var/lib/kvm/images/ r, + /var/lib/kvm/images/ r,
+ /var/lib/kvm/images/** r, + /var/lib/kvm/images/** r,
+} +}
Index: libvirt-0.10.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper Index: libvirt-1.0.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper --- libvirt-1.0.1.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper
+++ /dev/null +++ /dev/null
@@ -1,38 +0,0 @@ @@ -1,38 +0,0 @@
-# Last Modified: Mon Apr 5 15:10:27 2010 -# Last Modified: Mon Apr 5 15:10:27 2010
@ -135,9 +135,9 @@ Index: libvirt-0.10.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper
- /var/lib/libvirt/images/ r, - /var/lib/libvirt/images/ r,
- /var/lib/libvirt/images/** r, - /var/lib/libvirt/images/** r,
-} -}
Index: libvirt-0.10.2/examples/apparmor/usr.sbin.libvirtd Index: libvirt-1.0.1/examples/apparmor/usr.sbin.libvirtd
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/examples/apparmor/usr.sbin.libvirtd --- libvirt-1.0.1.orig/examples/apparmor/usr.sbin.libvirtd
+++ /dev/null +++ /dev/null
@@ -1,52 +0,0 @@ @@ -1,52 +0,0 @@
-# Last Modified: Mon Apr 5 15:03:58 2010 -# Last Modified: Mon Apr 5 15:03:58 2010
@ -192,10 +192,10 @@ Index: libvirt-0.10.2/examples/apparmor/usr.sbin.libvirtd
- change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*, - change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
- -
-} -}
Index: libvirt-0.10.2/examples/apparmor/usr.sbin.libvirtd.in Index: libvirt-1.0.1/examples/apparmor/usr.sbin.libvirtd.in
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ libvirt-0.10.2/examples/apparmor/usr.sbin.libvirtd.in +++ libvirt-1.0.1/examples/apparmor/usr.sbin.libvirtd.in
@@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
+# Last Modified: Fri Aug 19 11:20:36 2011 +# Last Modified: Fri Aug 19 11:20:36 2011
+#include <tunables/global> +#include <tunables/global>
@ -254,10 +254,10 @@ Index: libvirt-0.10.2/examples/apparmor/usr.sbin.libvirtd.in
+ change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*, + change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
+ +
+} +}
Index: libvirt-0.10.2/examples/apparmor/libvirt-qemu Index: libvirt-1.0.1/examples/apparmor/libvirt-qemu
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/examples/apparmor/libvirt-qemu --- libvirt-1.0.1.orig/examples/apparmor/libvirt-qemu
+++ libvirt-0.10.2/examples/apparmor/libvirt-qemu +++ libvirt-1.0.1/examples/apparmor/libvirt-qemu
@@ -52,6 +52,7 @@ @@ -52,6 +52,7 @@
# access to firmware's etc # access to firmware's etc
/usr/share/kvm/** r, /usr/share/kvm/** r,

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c155e0805275688128abdcd0f43eb32907dc80c5ea6c5cb485723ddf03d0646
size 15629786

3
libvirt-1.0.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a53542204dbcc252676bc07e24155507924ae67a130aadd3390a04b8a5c27e54
size 16039800

View File

@ -0,0 +1,256 @@
Adjust libvirt-guests init files to conform to SUSE standards
Index: libvirt-1.0.1/tools/libvirt-guests.init.in
===================================================================
--- libvirt-1.0.1.orig/tools/libvirt-guests.init.in
+++ libvirt-1.0.1/tools/libvirt-guests.init.in
@@ -3,15 +3,15 @@
# the following is the LSB init header
#
### BEGIN INIT INFO
-# Provides: libvirt-guests
-# Required-Start: libvirtd
-# Required-Stop: libvirtd
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Provides: libvirt-guests
+# Required-Start: $network $remote_fs libvirtd
+# Required-Stop: $network $remote_fs libvirtd
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 4 6
# Short-Description: suspend/resume libvirt guests on shutdown/boot
-# Description: This is a script for suspending active libvirt guests
-# on shutdown and resuming them on next boot
-# See http://libvirt.org
+# Description: This is a script for suspending active libvirt guests
+# on shutdown and resuming them on next boot
+# See http://libvirt.org
### END INIT INFO
# the following is chkconfig init header
Index: libvirt-1.0.1/tools/libvirt-guests.sh.in
===================================================================
--- libvirt-1.0.1.orig/tools/libvirt-guests.sh.in
+++ libvirt-1.0.1/tools/libvirt-guests.sh.in
@@ -1,13 +1,12 @@
#!/bin/sh
+. /etc/rc.status
+rc_reset
+
sysconfdir="@sysconfdir@"
localstatedir="@localstatedir@"
libvirtd="@sbindir@"/libvirtd
-# Source function library.
-test ! -r "$sysconfdir"/rc.d/init.d/functions ||
- . "$sysconfdir"/rc.d/init.d/functions
-
# Source gettext library.
# Make sure this file is recognized as having translations: _("dummy")
. "@bindir@"/gettext.sh
@@ -26,9 +25,11 @@ test -f "$sysconfdir"/sysconfig/libvirt-
. "$sysconfdir"/sysconfig/libvirt-guests
LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
-VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
-
-RETVAL=0
+if [ -d "$localstatedir"/lock/subsys ]; then
+ VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
+else
+ VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/libvirt-guests
+fi
# retval COMMAND ARGUMENTS...
# run command with arguments and convert non-zero return value to 1 and set
@@ -36,7 +37,7 @@ RETVAL=0
retval() {
"$@"
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
else
return 0
@@ -65,6 +66,25 @@ run_virsh_c() {
( export LC_ALL=C; run_virsh "$@" )
}
+await_daemon_up()
+{
+ uri=$1
+ i=1
+ rets=10
+ run_virsh $uri list > /dev/null 2>&1
+ while [ $? -ne 0 -a $i -lt $rets ]; do
+ sleep 1
+ echo -n .
+ i=$(($i + 1))
+ run_virsh $uri list > /dev/null 2>&1
+ done
+ if [ $i -eq $rets ]; then
+ echo $"libvirt-guests unable to connect to URI: $uri"
+ return 1
+ fi
+ return 0
+}
+
# test_connect URI
# check if URI is reachable
test_connect()
@@ -91,7 +111,7 @@ list_guests() {
list=$(run_virsh_c "$uri" list --uuid $persistent)
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
fi
@@ -117,7 +137,7 @@ guest_is_on() {
guest_running=false
id=$(run_virsh "$uri" domid "$uuid")
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
fi
@@ -165,6 +185,12 @@ start() {
test_connect "$uri" || continue
+ await_daemon_up $uri
+ if [ $? -ne 0 ]; then
+ echo $"Ignoring guests on $uri URI, can't connect"
+ continue
+ fi
+
eval_gettext "Resuming guests on \$uri URI..."; echo
for guest in $list; do
name=$(guest_name "$uri" "$guest")
@@ -377,7 +403,7 @@ shutdown_guests_parallel()
timeout=$(($timeout - 1))
if [ $timeout -le 0 ]; then
eval_gettext "Timeout expired while shutting down domains"; echo
- RETVAL=1
+ rc_failed 1
return
fi
else
@@ -405,7 +431,7 @@ stop() {
if [ $SHUTDOWN_TIMEOUT -lt 0 ]; then
gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0"
echo
- RETVAL=6
+ rc_failed 6
return
fi
fi
@@ -453,14 +479,14 @@ stop() {
if [ $? -ne 0 ]; then
eval_gettext "Failed to list persistent guests on \$uri"
echo
- RETVAL=1
+ rc_failed 1
set +f
return
fi
else
gettext "Failed to list transient guests"
echo
- RETVAL=1
+ rc_failed 1
set +f
return
fi
@@ -519,14 +545,13 @@ gueststatus() {
rh_status() {
if [ -f "$LISTFILE" ]; then
gettext "stopped, with saved guests"; echo
- RETVAL=3
+ rc_failed 3
else
if [ -f "$VAR_SUBSYS_LIBVIRT_GUESTS" ]; then
gettext "started"; echo
else
gettext "stopped, with no saved guests"; echo
fi
- RETVAL=0
fi
}
@@ -570,4 +595,4 @@ case "$1" in
usage
;;
esac
-exit $RETVAL
+rc_exit
Index: libvirt-1.0.1/tools/libvirt-guests.sysconf
===================================================================
--- libvirt-1.0.1.orig/tools/libvirt-guests.sysconf
+++ libvirt-1.0.1/tools/libvirt-guests.sysconf
@@ -1,19 +1,29 @@
+## Path: System/Virtualization/libvirt-guests
+
+## Type: string
+## Default: default
# URIs to check for running guests
# example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
-#URIS=default
+URIS=default
+## Type: string
+## Default: start
# action taken on host boot
# - start all guests which were running on shutdown are started on boot
# regardless on their autostart settings
# - ignore libvirt-guests init script won't start any guest on boot, however,
# guests marked as autostart will still be automatically started by
# libvirtd
-#ON_BOOT=start
+ON_BOOT=start
+## Type: integer
+## Default: 0
# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
-#START_DELAY=0
+START_DELAY=0
+## Type: string
+## Default: suspend
# action taken on host shutdown
# - suspend all running guests are suspended using virsh managedsave
# - shutdown all running guests are asked to shutdown. Please be careful with
@@ -22,12 +32,16 @@
# which just needs a long time to shutdown. When setting
# ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
# value suitable for your guests.
-#ON_SHUTDOWN=suspend
+ON_SHUTDOWN=suspend
+## Type: integer
+## Default: 0
# If set to non-zero, shutdown will suspend guests concurrently. Number of
# guests on shutdown at any time will not exceed number set in this variable.
-#PARALLEL_SHUTDOWN=0
+PARALLEL_SHUTDOWN=0
+## Type: integer
+## Default: 300
# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
@@ -35,7 +49,9 @@
# request). The default value is 300 seconds (5 minutes).
#SHUTDOWN_TIMEOUT=300
+## Type: integer
+## Default: 0
# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
-#BYPASS_CACHE=0
+BYPASS_CACHE=0

View File

@ -1,7 +1,7 @@
Index: libvirt-0.10.2/configure.ac Index: libvirt-1.0.1/configure.ac
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/configure.ac --- libvirt-1.0.1.orig/configure.ac
+++ libvirt-0.10.2/configure.ac +++ libvirt-1.0.1/configure.ac
@@ -102,6 +102,7 @@ AVAHI_REQUIRED="0.6.0" @@ -102,6 +102,7 @@ AVAHI_REQUIRED="0.6.0"
POLKIT_REQUIRED="0.6" POLKIT_REQUIRED="0.6"
PARTED_REQUIRED="1.8.0" PARTED_REQUIRED="1.8.0"
@ -10,7 +10,7 @@ Index: libvirt-0.10.2/configure.ac
UDEV_REQUIRED=145 UDEV_REQUIRED=145
PCIACCESS_REQUIRED=0.10.0 PCIACCESS_REQUIRED=0.10.0
XMLRPC_REQUIRED=1.14.0 XMLRPC_REQUIRED=1.14.0
@@ -1950,6 +1951,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit @@ -2005,6 +2006,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
AC_SUBST([NETCF_CFLAGS]) AC_SUBST([NETCF_CFLAGS])
AC_SUBST([NETCF_LIBS]) AC_SUBST([NETCF_LIBS])
@ -49,7 +49,7 @@ Index: libvirt-0.10.2/configure.ac
AC_ARG_WITH([secrets], AC_ARG_WITH([secrets],
AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes]) AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
@@ -3185,6 +3218,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $ @@ -3253,6 +3286,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
else else
AC_MSG_NOTICE([ netcf: no]) AC_MSG_NOTICE([ netcf: no])
fi fi
@ -61,11 +61,11 @@ Index: libvirt-0.10.2/configure.ac
if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
else else
Index: libvirt-0.10.2/src/Makefile.am Index: libvirt-1.0.1/src/Makefile.am
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/Makefile.am --- libvirt-1.0.1.orig/src/Makefile.am
+++ libvirt-0.10.2/src/Makefile.am +++ libvirt-1.0.1/src/Makefile.am
@@ -1050,6 +1050,24 @@ libvirt_driver_interface_la_LIBADD += .. @@ -1115,6 +1115,24 @@ libvirt_driver_interface_la_LIBADD += ..
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
endif endif
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES) libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
@ -90,25 +90,23 @@ Index: libvirt-0.10.2/src/Makefile.am
endif endif
if WITH_SECRETS if WITH_SECRETS
Index: libvirt-0.10.2/tools/virsh.c Index: libvirt-1.0.1/tools/virsh.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/tools/virsh.c --- libvirt-1.0.1.orig/tools/virsh.c
+++ libvirt-0.10.2/tools/virsh.c +++ libvirt-1.0.1/tools/virsh.c
@@ -2708,6 +2708,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE @@ -2730,6 +2730,8 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
vshPrint(ctl, " Interface");
# if defined(WITH_NETCF)
vshPrint(ctl, " netcf"); vshPrint(ctl, " netcf");
+# else # elif defined(HAVE_UDEV)
+# ifdef WITH_NETCONTROL vshPrint(ctl, " udev");
+ vshPrint(ctl, " Interface"); +# elif defined(WITH_NETCONTROL)
+# endif + vshPrint(ctl, " netcontrol");
# endif # endif
#endif #endif
#ifdef WITH_NWFILTER #ifdef WITH_NWFILTER
Index: libvirt-0.10.2/src/interface/interface_backend_netcf.c Index: libvirt-1.0.1/src/interface/interface_backend_netcf.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/interface/interface_backend_netcf.c --- libvirt-1.0.1.orig/src/interface/interface_backend_netcf.c
+++ libvirt-0.10.2/src/interface/interface_backend_netcf.c +++ libvirt-1.0.1/src/interface/interface_backend_netcf.c
@@ -23,7 +23,12 @@ @@ -23,7 +23,12 @@
#include <config.h> #include <config.h>

View File

@ -1,3 +1,40 @@
-------------------------------------------------------------------
Sat Jan 5 11:39:02 MST 2013 - jfehlig@suse.com
- Update to libvirt 1.0.1
- Introduce virtlockd daemon
- parallels: add disk and network device support
- Add virDomainSendProcessSignal API
- Introduce virDomainFSTrim() public API
- add fuse support for libvirt lxc
- Add Gluster protocol as supported network disk backend
- various snapshot improvements
- Add upstream patches to fix bugs in 1.0.1
66ff2ddc-virtlockd-systemd-file-perms.patch,
462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
68e7bc45-libxl-link-fix.patch
- Rework SUSE patches for the various init scripts
Dropped use-init-script-redhat.patch and added
libvirtd-init-script.patch, libvirt-guests-init-script.patch,
and virtlockd-init-script.patch
-------------------------------------------------------------------
Fri Nov 2 11:19:46 MDT 2012 - jfehlig@suse.com
- Update to libvirt 1.0.0
- virNodeGetCPUMap: Define public API
- Add systemd journal support
- Add a qemu capabilities cache manager
- USB migration support
- various improvement and fixes when using QMP QEmu interface
- Support for Xen 4.2 in legacy xen driver
- Lot of localization enhancements
- Drop upstream patches: 371ddc98-xen-sysctl-9.patch,
416eca18-xenstore-header-fix.patch,
f644361b-virCommand-env.patch, 2b32735a-virCommand-env.patch,
9785f2b6-fix-xen-sysctl9.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Oct 23 14:33:40 MDT 2012 - jfehlig@suse.com Tue Oct 23 14:33:40 MDT 2012 - jfehlig@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package libvirt # spec file for package libvirt
# #
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -36,53 +36,59 @@
%define with_libvirtd 0%{!?_without_libvirtd:%{server_drivers}} %define with_libvirtd 0%{!?_without_libvirtd:%{server_drivers}}
%define with_avahi 0%{!?_without_avahi:%{server_drivers}} %define with_avahi 0%{!?_without_avahi:%{server_drivers}}
# Then the hypervisor drivers that run on local host # Then the hypervisor drivers that run in libvirtd
%define with_xen 0%{!?_without_xen:%{server_drivers}} %define with_xen 0%{!?_without_xen:%{server_drivers}}
%define with_qemu 0%{!?_without_qemu:%{server_drivers}} %define with_qemu 0%{!?_without_qemu:%{server_drivers}}
%define with_openvz 0%{!?_without_openvz:%{server_drivers}}
%define with_lxc 0%{!?_without_lxc:%{server_drivers}} %define with_lxc 0%{!?_without_lxc:%{server_drivers}}
%define with_vbox 0%{!?_without_vbox:%{server_drivers}}
%define with_uml 0%{!?_without_uml:%{server_drivers}} %define with_uml 0%{!?_without_uml:%{server_drivers}}
%define with_libxl 0%{!?_without_libxl:%{server_drivers}} %define with_libxl 0%{!?_without_libxl:%{server_drivers}}
%define with_vmware 0%{!?_without_vmware:%{server_drivers}}
# Then the hypervisor drivers that talk via a native remote protocol # Then the hypervisor drivers that run outside libvirtd, in libvirt.so
%define with_openvz 0%{!?_without_openvz:%{server_drivers}}
%define with_vbox 0%{!?_without_vbox:%{server_drivers}}
%define with_vmware 0%{!?_without_vmware:%{server_drivers}}
%define with_phyp 0%{!?_without_phyp:0} %define with_phyp 0%{!?_without_phyp:0}
%define with_esx 0%{!?_without_esx:1} %define with_esx 0%{!?_without_esx:1}
%define with_xenapi 0%{!?_without_xenapi:1}
%define with_hyperv 0%{!?_without_hyperv:0} %define with_hyperv 0%{!?_without_hyperv:0}
%define with_xenapi 0%{!?_without_xenapi:1}
%define with_parallels 0%{!?_without_parallels:1}
# Then the secondary host drivers # Then the secondary host drivers, which run inside libvirtd
%define with_interface 0%{!?_without_interface:%{server_drivers}}
%define with_network 0%{!?_without_network:%{server_drivers}} %define with_network 0%{!?_without_network:%{server_drivers}}
%define with_storage_fs 0%{!?_without_storage_fs:%{server_drivers}} %define with_storage_fs 0%{!?_without_storage_fs:%{server_drivers}}
%define with_storage_lvm 0%{!?_without_storage_lvm:%{server_drivers}} %define with_storage_lvm 0%{!?_without_storage_lvm:%{server_drivers}}
%define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}} %define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}}
%define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}} %define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}}
%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}} %define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}}
%define with_storage_rbd 0
%define with_storage_sheepdog 0
%define with_numactl 0%{!?_without_numactl:%{server_drivers}} %define with_numactl 0%{!?_without_numactl:%{server_drivers}}
%define with_selinux 0%{!?_without_selinux:%{server_drivers}} %define with_selinux 0%{!?_without_selinux:%{server_drivers}}
%define with_apparmor 0%{!?_without_apparmor:%{server_drivers}} %define with_apparmor 0%{!?_without_apparmor:%{server_drivers}}
# Optional bits on by default # Optional bits on by default
%define with_polkit 0%{!?_without_polkit:1} %define with_polkit 0%{!?_without_polkit:1}
%define with_udev 0%{!?_without_udev:1}
%define with_audit 0%{!?_without_audit:1}
# A few optional bits off by default, we enable later # A few optional bits off by default, we enable later
%define with_capng 0%{!?_without_capng:0} %define with_capng 0%{!?_without_capng:0}
%define with_netcf 0%{!?_without_netcf:0} %define with_netcf 0%{!?_without_netcf:0}
%define with_netcontrol 0%{!?_without_netcontrol:0} %define with_netcontrol 0%{!?_without_netcontrol:0}
%define with_udev 0%{!?_without_udev:0}
%define with_hal 0%{!?_without_hal:0}
%define with_yajl 0%{!?_without_yajl:0} %define with_yajl 0%{!?_without_yajl:0}
%define with_nwfilter 0%{!?_without_nwfilter:0} %define with_nwfilter 0%{!?_without_nwfilter:0}
%define with_libpcap 0%{!?_without_libpcap:0} %define with_libpcap 0%{!?_without_libpcap:0}
%define with_macvtap 0%{!?_without_macvtap:0} %define with_macvtap 0%{!?_without_macvtap:0}
%define with_libnl 0%{!?_without_libnl:0} %define with_libnl 0%{!?_without_libnl:0}
%define with_audit 0%{!?_without_audit:0}
%define with_dtrace 0%{!?_without_dtrace:0} %define with_dtrace 0%{!?_without_dtrace:0}
%define with_cgconfig 0%{!?_without_cgconfig:0} %define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0} %define with_sanlock 0%{!?_without_sanlock:0}
%define with_systemd 0%{!?_without_systemd:0} %define with_systemd 0%{!?_without_systemd:0}
%define with_numad 0%{!?_without_numad:0} %define with_numad 0%{!?_without_numad:0}
%define with_firewalld 0%{!?_without_firewalld:0}
%define with_libssh2_transport 0%{!?_without_libssh2_transport:0}
# Non-server/HV driver defaults which are always enabled # Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1} %define with_python 0%{!?_without_python:1}
%define with_sasl 0%{!?_without_sasl:1} %define with_sasl 0%{!?_without_sasl:1}
@ -95,9 +101,10 @@
%define with_libxl 0 %define with_libxl 0
%endif %endif
# Temporarily disable building the libxl driver since the current # libxl is only compatible with Xen >= 4.2 (i.e. suse_version > 12.2)
# implementation only works with Xen 4.1 %if 0%{?suse_version} <= 1220
%define with_libxl 0 %define with_libxl 0
%endif
# numactl only on x86_64 and ia64 # numactl only on x86_64 and ia64
%ifnarch x86_64 ia64 %ifnarch x86_64 ia64
@ -114,6 +121,7 @@
%define with_vmware 0 %define with_vmware 0
%define with_xenapi 0 %define with_xenapi 0
%define with_hyperv 0 %define with_hyperv 0
%define with_parallels 0
%endif %endif
# Enable phyp driver for IBM Power systems # Enable phyp driver for IBM Power systems
@ -127,13 +135,6 @@
%define with_selinux 0 %define with_selinux 0
%endif %endif
# udev is used to manage host devices in 11.1 or newer
%if 0%{?suse_version} > 1110
%define with_udev 0%{!?_without_udev:%{server_drivers}}
%else
%define with_hal 0%{!?_without_hal:%{server_drivers}}
%endif
# netcontrol is used to manage network interfaces on openSUSE >= 12.1 # netcontrol is used to manage network interfaces on openSUSE >= 12.1
%if 0%{?suse_version} >= 1210 %if 0%{?suse_version} >= 1210
%define with_netcontrol 0%{!?_without_netcontrol:%{server_drivers}} %define with_netcontrol 0%{!?_without_netcontrol:%{server_drivers}}
@ -148,10 +149,7 @@
# Enable yajl library for JSON mode with QEMU # Enable yajl library for JSON mode with QEMU
%define with_yajl 0%{!?_without_yajl:%{server_drivers}} %define with_yajl 0%{!?_without_yajl:%{server_drivers}}
# All supported version of openSUSE/SLE contain audit %if 0%{?suse_version} >= 1210
%define with_audit 0%{!?_without_audit:1}
%if 0%{?suse_version} > 1140
%define with_systemd 0%{!?_without_systemd:1} %define with_systemd 0%{!?_without_systemd:1}
%endif %endif
@ -163,16 +161,18 @@
# Disable some drivers when building without libvirt daemon. # Disable some drivers when building without libvirt daemon.
# The logic is the same as in configure.ac # The logic is the same as in configure.ac
%if ! %{with_libvirtd} %if ! %{with_libvirtd}
%define with_interface 0
%define with_network 0 %define with_network 0
%define with_qemu 0 %define with_qemu 0
%define with_lxc 0 %define with_lxc 0
%define with_uml 0 %define with_uml 0
%define with_hal 0
%define with_udev 0 %define with_udev 0
%define with_storage_fs 0 %define with_storage_fs 0
%define with_storage_lvm 0 %define with_storage_lvm 0
%define with_storage_iscsi 0 %define with_storage_iscsi 0
%define with_storage_mpath 0 %define with_storage_mpath 0
%define with_storage_rbd 0
%define with_storage_sheepdog 0
%define with_storage_disk 0 %define with_storage_disk 0
%endif %endif
@ -195,6 +195,23 @@
%define with_libnl 1 %define with_libnl 1
%endif %endif
# Pull in cgroups config system
%if %{with_qemu} || %{with_lxc}
%define with_cgconfig 0%{!?_without_cgconfig:1}
%endif
%if %{with_udev}
%define with_nodedev 1
%else
%define with_nodedev 0
%endif
%if %{with_storage_fs} || %{with_storage_mpath} || %{with_storage_iscsi} || %{with_storage_lvm} || %{with_storage_disk}
%define with_storage 1
%else
%define with_storage 0
%endif
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
BuildRequires: bridge-utils BuildRequires: bridge-utils
@ -220,9 +237,6 @@ BuildRequires: xen-devel
%if %{with_sasl} %if %{with_sasl}
BuildRequires: cyrus-sasl-devel BuildRequires: cyrus-sasl-devel
%endif %endif
%if %{with_hal}
BuildRequires: hal-devel
%endif
%if %{with_udev} %if %{with_udev}
BuildRequires: libpciaccess0-devel >= 0.10.9 BuildRequires: libpciaccess0-devel >= 0.10.9
BuildRequires: libudev-devel >= 145 BuildRequires: libudev-devel >= 145
@ -312,6 +326,9 @@ BuildRequires: parted-devel
# For Multipath support # For Multipath support
BuildRequires: device-mapper-devel BuildRequires: device-mapper-devel
%endif %endif
%if %{with_storage_rbd}
BuildRequires: ceph-devel
%endif
%if %{with_audit} %if %{with_audit}
BuildRequires: audit-devel BuildRequires: audit-devel
%endif %endif
@ -320,7 +337,7 @@ BuildRequires: audit-devel
BuildRequires: systemtap-sdt-devel BuildRequires: systemtap-sdt-devel
%endif %endif
%if %{with_sanlock} %if %{with_sanlock}
BuildRequires: sanlock-devel >= 1.8 BuildRequires: sanlock-devel >= 2.4
%endif %endif
%if %{with_systemd} %if %{with_systemd}
BuildRequires: systemd BuildRequires: systemd
@ -328,7 +345,7 @@ BuildRequires: systemd
Name: libvirt Name: libvirt
Url: http://libvirt.org/ Url: http://libvirt.org/
Version: 0.10.2 Version: 1.0.1
Release: 0 Release: 0
Summary: A C toolkit to interact with the virtualization capabilities of Linux Summary: A C toolkit to interact with the virtualization capabilities of Linux
License: LGPL-2.1+ License: LGPL-2.1+
@ -359,9 +376,6 @@ Recommends: ebtables
%endif %endif
Recommends: logrotate Recommends: logrotate
Recommends: nfs-client Recommends: nfs-client
%if %{with_hal}
Requires: hal
%endif
%if %{with_udev} %if %{with_udev}
Requires: udev >= 145 Requires: udev >= 145
%endif %endif
@ -411,11 +425,12 @@ Source1: libvirtd.init
Source2: libvirtd-relocation-server.fw Source2: libvirtd-relocation-server.fw
Source99: baselibs.conf Source99: baselibs.conf
# Upstream patches # Upstream patches
Patch0: 371ddc98-xen-sysctl-9.patch Patch0: 66ff2ddc-virtlockd-systemd-file-perms.patch
Patch1: 416eca18-xenstore-header-fix.patch Patch1: 462a6962-script-fixes1.patch
Patch2: f644361b-virCommand-env.patch Patch2: cb854b8f-script-fixes2.patch
Patch3: 2b32735a-virCommand-env.patch Patch3: 5ec4b22b-script-fixes3.patch
Patch4: 9785f2b6-fix-xen-sysctl9.patch Patch4: a1fd56cb-script-fixes4.patch
Patch5: 68e7bc45-libxl-link-fix.patch
# Need to go upstream # Need to go upstream
Patch100: xen-name-for-devid.patch Patch100: xen-name-for-devid.patch
Patch101: clone.patch Patch101: clone.patch
@ -423,9 +438,11 @@ Patch102: xen-pv-cdrom.patch
Patch103: AF_PACKET.patch Patch103: AF_PACKET.patch
# Our patches # Our patches
Patch200: libvirtd-defaults.patch Patch200: libvirtd-defaults.patch
Patch201: use-init-script-redhat.patch Patch201: libvirtd-init-script.patch
Patch202: relax-qemu-usergroup-check.patch Patch202: libvirt-guests-init-script.patch
Patch203: suse-qemu-conf.patch Patch203: virtlockd-init-script.patch
Patch204: relax-qemu-usergroup-check.patch
Patch205: suse-qemu-conf.patch
%if %{with_apparmor} %if %{with_apparmor}
Patch250: install-apparmor-profiles.patch Patch250: install-apparmor-profiles.patch
%endif %endif
@ -461,6 +478,8 @@ Recommends: cyrus-sasl-digestmd5
# So remote clients can access libvirt over SSH tunnel # So remote clients can access libvirt over SSH tunnel
# (client invokes 'nc' against the UNIX socket on the server) # (client invokes 'nc' against the UNIX socket on the server)
Recommends: netcat-openbsd Recommends: netcat-openbsd
# Needed for probing the power management features of the host.
Recommends: pm-utils
%description client %description client
Libvirt is a C toolkit to interact with the virtualization Libvirt is a C toolkit to interact with the virtualization
@ -519,7 +538,7 @@ Authors:
%package lock-sanlock %package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver Summary: Sanlock lock manager plugin for QEMU driver
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: sanlock >= 1.8 Requires: sanlock >= 2.4
#for virt-sanlock-cleanup require augeas #for virt-sanlock-cleanup require augeas
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: augeas Requires: augeas
@ -556,6 +575,7 @@ Authors:
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1
%patch100 -p1 %patch100 -p1
%patch101 %patch101
%patch102 -p1 %patch102 -p1
@ -564,6 +584,8 @@ Authors:
%patch201 -p1 %patch201 -p1
%patch202 -p1 %patch202 -p1
%patch203 -p1 %patch203 -p1
%patch204 -p1
%patch205 -p1
%if %{with_apparmor} %if %{with_apparmor}
%patch250 -p1 %patch250 -p1
%endif %endif
@ -605,6 +627,9 @@ Authors:
%if ! %{with_hyperv} %if ! %{with_hyperv}
%define _without_hyperv --without-hyperv %define _without_hyperv --without-hyperv
%endif %endif
%if ! %{with_parallels}
%define _without_parallels --without-parallels
%endif
%if ! %{with_libxl} %if ! %{with_libxl}
%define _without_libxl --without-libxl %define _without_libxl --without-libxl
%endif %endif
@ -626,6 +651,12 @@ Authors:
%if ! %{with_storage_mpath} %if ! %{with_storage_mpath}
%define _without_storage_mpath --without-storage-mpath %define _without_storage_mpath --without-storage-mpath
%endif %endif
%if ! %{with_storage_rbd}
%define _without_storage_rbd --without-storage-rbd
%endif
%if ! %{with_storage_sheepdog}
%define _without_storage_sheepdog --without-storage-sheepdog
%endif
%if ! %{with_numactl} %if ! %{with_numactl}
%define _without_numactl --without-numactl %define _without_numactl --without-numactl
%endif %endif
@ -647,9 +678,6 @@ Authors:
%if ! %{with_netcontrol} %if ! %{with_netcontrol}
%define _without_netcontrol --without-netcontrol %define _without_netcontrol --without-netcontrol
%endif %endif
%if ! %{with_hal}
%define _without_hal --without-hal
%endif
%if ! %{with_udev} %if ! %{with_udev}
%define _without_udev --without-udev %define _without_udev --without-udev
%endif %endif
@ -668,6 +696,9 @@ Authors:
%if ! %{with_dtrace} %if ! %{with_dtrace}
%define _without_dtrace --without-dtrace %define _without_dtrace --without-dtrace
%endif %endif
%if ! %{with_interface}
%define _without_interface --without-interface
%endif
%if ! %{with_network} %if ! %{with_network}
%define _without_network --without-network %define _without_network --without-network
%endif %endif
@ -687,9 +718,6 @@ Authors:
%define _without_sanlock --without-sanlock %define _without_sanlock --without-sanlock
%endif %endif
%if %{with_systemd} %if %{with_systemd}
# Use 'systemd+redhat' (see patch use-init-script-redhat.patch),
# so if someone installs upstart or legacy init scripts, they can
# still start libvirtd
%define init_scripts --with-init_script=systemd+redhat %define init_scripts --with-init_script=systemd+redhat
%else %else
%define init_scripts --with-init_script=redhat %define init_scripts --with-init_script=redhat
@ -697,6 +725,9 @@ Authors:
%if ! %{with_driver_modules} %if ! %{with_driver_modules}
%define _without_driver_modules --without-driver-modules %define _without_driver_modules --without-driver-modules
%endif %endif
%if %{with_firewalld}
%define _with_firewalld --with-firewalld
%endif
autoreconf -f -i autoreconf -f -i
export CFLAGS="$RPM_OPT_FLAGS" export CFLAGS="$RPM_OPT_FLAGS"
@ -706,40 +737,44 @@ export CFLAGS="$RPM_OPT_FLAGS"
%{?_without_openvz} \ %{?_without_openvz} \
%{?_without_lxc} \ %{?_without_lxc} \
%{?_without_vbox} \ %{?_without_vbox} \
%{?_without_libxl} \
%{?_without_xenapi} \ %{?_without_xenapi} \
%{?_without_sasl} \
%{?_without_avahi} \
%{?_without_polkit} \
%{?_without_python} \
%{?_without_libvirtd} \
%{?_without_uml} \ %{?_without_uml} \
%{?_without_phyp} \ %{?_without_phyp} \
%{?_without_esx} \ %{?_without_esx} \
%{?_without_vmware} \
%{?_without_hyperv} \ %{?_without_hyperv} \
%{?_without_libxl} \ %{?_without_vmware} \
%{?_without_libvirtd} \ %{?_without_parallels} \
%{?_without_interface} \
%{?_without_network} \
%{?_without_storage_fs} \ %{?_without_storage_fs} \
%{?_without_storage_lvm} \ %{?_without_storage_lvm} \
%{?_without_storage_iscsi} \ %{?_without_storage_iscsi} \
%{?_without_storage_disk} \ %{?_without_storage_disk} \
%{?_without_storage_mpath} \ %{?_without_storage_mpath} \
%{?_without_storage_rbd} \
%{?_without_storage_sheepdog} \
%{?_without_numactl} \ %{?_without_numactl} \
%{?_without_numad} \ %{?_without_numad} \
%{?_without_selinux} \
%{?_without_apparmor} \
%{?_without_capng} \ %{?_without_capng} \
%{?_without_netcf} \ %{?_without_netcf} \
%{?_without_netcontrol} \ %{?_without_netcontrol} \
%{?_without_hal} \ %{?_without_selinux} \
%{?_without_apparmor} \
%{?_without_udev} \ %{?_without_udev} \
%{?_without_yajl} \ %{?_without_yajl} \
%{?_without_sanlock} \
%{?_without_libpcap} \
%{?_without_macvtap} \ %{?_without_macvtap} \
%{?_without_polkit} \
%{?_without_audit} \ %{?_without_audit} \
%{?_without_dtrace} \ %{?_without_dtrace} \
%{?_without_network} \
%{?_without_sasl} \
%{?_without_avahi} \
%{?_without_python} \
%{?_without_libpcap} \
%{?_without_sanlock} \
%{?_without_driver_modules} \ %{?_without_driver_modules} \
%{?_with_firewalld} \
--libexecdir=%{_libdir}/%{name} \ --libexecdir=%{_libdir}/%{name} \
--with-qemu-user=%{qemu_user} \ --with-qemu-user=%{qemu_user} \
--with-qemu-group=%{qemu_group} \ --with-qemu-group=%{qemu_group} \
@ -800,12 +835,23 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter
%endif %endif
# init scripts # init scripts
mkdir -p $RPM_BUILD_ROOT/etc/init.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates
%if %{with_libvirtd} %if %{with_libvirtd}
# Currently using our own libvirtd init script
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/libvirtd
install %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/init.d/libvirtd install %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/init.d/libvirtd
ln -s /etc/init.d/libvirtd $RPM_BUILD_ROOT%{_sbindir}/rclibvirtd ln -s /etc/init.d/libvirtd $RPM_BUILD_ROOT%{_sbindir}/rclibvirtd
mv $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/libvirtd $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/sysconfig.libvirtd
rm -f $RPM_BUILD_ROOT/usr/lib/sysctl.d/libvirtd.conf
# For other services, use the in-tree scripts
mv $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/virtlockd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/virtlockd
ln -s /etc/init.d/virtlockd $RPM_BUILD_ROOT%{_sbindir}/rcvirtlockd
mv $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/virtlockd $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/sysconfig.virtlockd
%endif %endif
mv $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sysconfdir}/init.d/libvirt-guests
ln -s /etc/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sbindir}/rclibvirt-guests ln -s /etc/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sbindir}/rclibvirt-guests
mv $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/libvirt-guests $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests
#install firewall definitions format is described here: #install firewall definitions format is described here:
#/usr/share/SuSEfirewall2/services/TEMPLATE #/usr/share/SuSEfirewall2/services/TEMPLATE
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir} mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
@ -818,6 +864,7 @@ rm -rf $RPM_BUILD_ROOT
%pre %pre
%if %{with_systemd} %if %{with_systemd}
%service_add_pre libvirtd.service %service_add_pre libvirtd.service
%service_add_pre virtlockd.service virtlockd.socket
%endif %endif
%{_bindir}/getent group libvirt >/dev/null || \ %{_bindir}/getent group libvirt >/dev/null || \
%{_sbindir}/groupadd -r libvirt 2>/dev/null %{_sbindir}/groupadd -r libvirt 2>/dev/null
@ -836,43 +883,68 @@ then
fi fi
%endif %endif
%if %{with_systemd} %if %{with_systemd}
%service_add_post libvirtd.service libvirt-guests.service %service_add_post libvirtd.service
%service_add_post virtlockd.service virtlockd.socket
%endif %endif
%if 0%{?sles_version} %if 0%{?sles_version}
%{fillup_and_insserv -y libvirtd} %{fillup_and_insserv -y -n libvirtd libvirtd}
%else # ! sles %else # ! sles
%{fillup_only -n libvirtd} %{fillup_only -n libvirtd}
%endif %endif
%{fillup_only -n libvirt-guests} %{fillup_only -n virtlockd}
%endif %endif
%preun %preun
%if %{with_libvirtd} %if %{with_libvirtd}
%if %{with_systemd} %if %{with_systemd}
%service_del_preun libvirtd.service libvirt-guests.service %service_del_preun libvirtd.service
%service_del_preun virtlockd.service virtlockd.socket
%endif %endif
%stop_on_removal libvirtd %stop_on_removal libvirtd
%stop_on_removal virtlockd
%endif %endif
%postun %postun
/sbin/ldconfig /sbin/ldconfig
%if %{with_libvirtd} %if %{with_libvirtd}
%if %{with_systemd} %if %{with_systemd}
%service_del_postun libvirtd.service libvirt-guests.service %service_del_postun libvirtd.service
%service_del_postun virtlockd.service virtlockd.socket
%endif %endif
%restart_on_update libvirtd %restart_on_update libvirtd
%restart_on_update virtlockd
%endif %endif
%insserv_cleanup %insserv_cleanup
%post client -p /sbin/ldconfig %post client
/sbin/ldconfig
%if %{with_systemd}
%service_add_post libvirt-guests.service
%endif
%{fillup_only -n libvirt-guests}
%postun client -p /sbin/ldconfig %preun client
%if %{with_systemd}
%service_del_preun libvirt-guests.service
%endif
%stop_on_removal libvirt-guests
if [ $1 = 0 ]; then
rm -f /var/lib/libvirt/libvirt-guests
fi
%postun client
/sbin/ldconfig
%if %{with_systemd}
%service_del_postun libvirt-guests.service
%endif
%insserv_cleanup
%if %{with_libvirtd} %if %{with_libvirtd}
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%{_sbindir}/libvirtd %{_sbindir}/libvirtd
%{_sbindir}/virtlockd
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
%if %{with_network} %if %{with_network}
@ -889,8 +961,13 @@ fi
%{_localstatedir}/adm/fillup-templates/sysconfig.libvirtd %{_localstatedir}/adm/fillup-templates/sysconfig.libvirtd
%config /etc/init.d/libvirtd %config /etc/init.d/libvirtd
%{_sbindir}/rclibvirtd %{_sbindir}/rclibvirtd
%{_localstatedir}/adm/fillup-templates/sysconfig.virtlockd
%config /etc/init.d/virtlockd
%{_sbindir}/rcvirtlockd
%if %{with_systemd} %if %{with_systemd}
%{_unitdir}/libvirtd.service %{_unitdir}/libvirtd.service
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
%endif %endif
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
@ -899,6 +976,8 @@ fi
%dir %{_datadir}/augeas/lenses/tests %dir %{_datadir}/augeas/lenses/tests
%{_datadir}/augeas/lenses/libvirtd.aug %{_datadir}/augeas/lenses/libvirtd.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug %{_datadir}/augeas/lenses/tests/test_libvirtd.aug
%{_datadir}/augeas/lenses/libvirt_lockd.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
%if %{with_dtrace} %if %{with_dtrace}
%{_datadir}/systemtap/tapset/libvirt_probes.stp %{_datadir}/systemtap/tapset/libvirt_probes.stp
%{_datadir}/systemtap/tapset/libvirt_functions.stp %{_datadir}/systemtap/tapset/libvirt_functions.stp
@ -908,6 +987,8 @@ fi
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/ %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/ %dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
%dir %attr(0755, root, root) %{_libdir}/%{name}/lock-driver
%attr(0755, root, root) %{_libdir}/%{name}/lock-driver/lockd.so
%if %{with_polkit} %if %{with_polkit}
%if 0%{?suse_version} > 1110 %if 0%{?suse_version} > 1110
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.unix.policy
@ -917,6 +998,7 @@ fi
%endif %endif
%if %{with_qemu} %if %{with_qemu}
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/ %dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/ %dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
@ -976,6 +1058,7 @@ fi
%{_bindir}/virt-host-validate %{_bindir}/virt-host-validate
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%{_libdir}/lib*.so.* %{_libdir}/lib*.so.*
%attr(0755, root, root) %{_libdir}/%{name}/libvirt-guests.sh
%{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests %{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests
%config /etc/init.d/libvirt-guests %config /etc/init.d/libvirt-guests
%{_sbindir}/rclibvirt-guests %{_sbindir}/rclibvirt-guests
@ -1022,6 +1105,7 @@ fi
%doc %{_docdir}/%{name}/*.gif %doc %{_docdir}/%{name}/*.gif
%doc %{_docdir}/%{name}/*.css %doc %{_docdir}/%{name}/*.css
%doc %{_docdir}/%{name}/html %doc %{_docdir}/%{name}/html
%doc %{_docdir}/%{name}/internals
%if %{with_sanlock} %if %{with_sanlock}
@ -1040,6 +1124,7 @@ fi
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug %{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
%dir %attr(0700, root, root) %{_localstatedir}/lib/%{name}/sanlock %dir %attr(0700, root, root) %{_localstatedir}/lib/%{name}/sanlock
%{_sbindir}/virt-sanlock-cleanup %{_sbindir}/virt-sanlock-cleanup
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_sanlock_helper
%endif %endif
%if %{with_python} %if %{with_python}

View File

@ -1,7 +1,7 @@
Index: libvirt-0.10.2/daemon/libvirtd.conf Index: libvirt-1.0.1/daemon/libvirtd.conf
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/daemon/libvirtd.conf --- libvirt-1.0.1.orig/daemon/libvirtd.conf
+++ libvirt-0.10.2/daemon/libvirtd.conf +++ libvirt-1.0.1/daemon/libvirtd.conf
@@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
# It is necessary to setup a CA and issue server certificates before # It is necessary to setup a CA and issue server certificates before
# using this capability. # using this capability.
@ -13,10 +13,10 @@ Index: libvirt-0.10.2/daemon/libvirtd.conf
# Listen for unencrypted TCP connections on the public TCP/IP port. # Listen for unencrypted TCP connections on the public TCP/IP port.
# NB, must pass the --listen flag to the libvirtd process for this to # NB, must pass the --listen flag to the libvirtd process for this to
Index: libvirt-0.10.2/daemon/libvirtd-config.c Index: libvirt-1.0.1/daemon/libvirtd-config.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/daemon/libvirtd-config.c --- libvirt-1.0.1.orig/daemon/libvirtd-config.c
+++ libvirt-0.10.2/daemon/libvirtd-config.c +++ libvirt-1.0.1/daemon/libvirtd-config.c
@@ -233,7 +233,7 @@ daemonConfigNew(bool privileged ATTRIBUT @@ -233,7 +233,7 @@ daemonConfigNew(bool privileged ATTRIBUT
return NULL; return NULL;
} }

View File

@ -0,0 +1,46 @@
Adjust libvirtd sysconfig file to conform to SUSE standards
Index: libvirt-1.0.1/daemon/libvirtd.sysconf
===================================================================
--- libvirt-1.0.1.orig/daemon/libvirtd.sysconf
+++ libvirt-1.0.1/daemon/libvirtd.sysconf
@@ -1,16 +1,25 @@
+## Path: System/Virtualization/libvirt
+
+## Type: string
+## Default: /etc/libvirt/libvirtd.conf
# Override the default config file
# NOTE: This setting is no longer honoured if using
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
# in LIBVIRTD_ARGS instead.
-#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
+LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
-# Listen for TCP/IP connections
-# NB. must setup TLS/SSL keys prior to using this
-#LIBVIRTD_ARGS="--listen"
+## Type: string
+## Default: --listen
+# Arguments to pass to libvirtd
+LIBVIRTD_ARGS="--listen"
+## Type: string
+## Default: none
# Override Kerberos service keytab for SASL/GSSAPI
#KRB5_KTNAME=/etc/libvirt/krb5.tab
+## Type: string
+## Default: none
# Override the QEMU/SDL default audio driver probing when
# starting virtual machines using SDL graphics
#
@@ -20,5 +29,7 @@
#
#SDL_AUDIODRIVER=pulse
-# Override the maximum number of opened files
-#LIBVIRTD_NOFILES_LIMIT=2048
+## Type: integer
+## Default: 2048
+## Override the maximum number of opened files
+LIBVIRTD_NOFILES_LIMIT=2048

View File

@ -28,6 +28,13 @@ test -x $LIBVIRTD_BIN || { echo "$LIBVIRD_BIN not installed";
. /etc/rc.status . /etc/rc.status
rc_reset rc_reset
test -f /etc/sysconfig/libvirtd && . /etc/sysconfig/libvirtd
LIBVIRTD_CONFIG_ARGS=
if [ -n "$LIBVIRTD_CONFIG" ]
then
LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
fi
case "$1" in case "$1" in
start) start)
@ -42,11 +49,20 @@ case "$1" in
fi fi
fi fi
echo -n "Starting libvirtd " echo -n "Starting libvirtd "
startproc $LIBVIRTD_BIN -d -l mkdir -p /var/cache/libvirt
rm -rf /var/cache/libvirt/*
# LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
# automatically
if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
fi
startproc $LIBVIRTD_BIN --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
rc_status -v rc_status -v
;; ;;
stop) stop)
echo -n "Shutting down libvirtd " echo -n "Shutting down libvirtd "
rm -f /var/lock/subsys/libvirtd
rm -rf /var/cache/libvirt/*
killproc -TERM $LIBVIRTD_BIN > /dev/null 2>&1 killproc -TERM $LIBVIRTD_BIN > /dev/null 2>&1
rm -f $LIBVIRTD_PIDFILE rm -f $LIBVIRTD_PIDFILE
rc_status -v rc_status -v

View File

@ -7,29 +7,25 @@ drivers as loadable modules instead of built-in to the
daemon. Then the qemu driver would only be loaded when needed, daemon. Then the qemu driver would only be loaded when needed,
which would never be the case on a xen-only configuration. which would never be the case on a xen-only configuration.
Index: libvirt-0.10.2/src/qemu/qemu_conf.c Index: libvirt-1.0.1/src/qemu/qemu_conf.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/qemu/qemu_conf.c --- libvirt-1.0.1.orig/src/qemu/qemu_conf.c
+++ libvirt-0.10.2/src/qemu/qemu_conf.c +++ libvirt-1.0.1/src/qemu/qemu_conf.c
@@ -350,9 +350,7 @@ int qemudLoadDriverConfig(struct qemud_d @@ -252,7 +252,7 @@ int qemuLoadDriverConfig(virQEMUDriverPt
return -1; goto no_memory;
}
if (virGetUserID(user, &driver->user) < 0) { if (virGetUserID(user, &driver->user) < 0)
- VIR_FREE(user); - goto cleanup;
- virConfFree(conf);
- return -1;
+ VIR_WARN("User %s does not exist! Continuing...", user); + VIR_WARN("User %s does not exist! Continuing...", user);
}
VIR_FREE(user);
@@ -365,9 +363,7 @@ int qemudLoadDriverConfig(struct qemud_d p = virConfGetValue(conf, "group");
return -1; CHECK_TYPE("group", VIR_CONF_STRING);
} @@ -260,7 +260,7 @@ int qemuLoadDriverConfig(virQEMUDriverPt
if (virGetGroupID(group, &driver->group) < 0) { goto no_memory;
- VIR_FREE(group);
- virConfFree(conf); if (virGetGroupID(group, &driver->group) < 0)
- return -1; - goto cleanup;
+ VIR_WARN("Group %s does not exist! Continuing...", group); + VIR_WARN("Group %s does not exist! Continuing...", group);
}
VIR_FREE(group); GET_VALUE_LONG("dynamic_ownership", driver->dynamicOwnership);

View File

@ -1,7 +1,7 @@
Index: libvirt-0.10.2/src/qemu/qemu.conf Index: libvirt-1.0.1/src/qemu/qemu.conf
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/qemu/qemu.conf --- libvirt-1.0.1.orig/src/qemu/qemu.conf
+++ libvirt-0.10.2/src/qemu/qemu.conf +++ libvirt-1.0.1/src/qemu/qemu.conf
@@ -169,7 +169,16 @@ @@ -169,7 +169,16 @@
# a special value; security_driver can be set to that value in # a special value; security_driver can be set to that value in
# isolation, but it cannot appear in a list of drivers. # isolation, but it cannot appear in a list of drivers.
@ -14,12 +14,12 @@ Index: libvirt-0.10.2/src/qemu/qemu.conf
+# confinement of qemu instances. +# confinement of qemu instances.
+# +#
#security_driver = "selinux" #security_driver = "selinux"
+#security_driver = "apparmor" +# security_driver = "apparmor"
+security_driver = "none" +security_driver = "none"
# If set to non-zero, then the default security labeling # If set to non-zero, then the default security labeling
# will make guests confined. If set to zero, then guests # will make guests confined. If set to zero, then guests
@@ -342,6 +351,15 @@ @@ -357,6 +366,15 @@
#allow_disk_format_probing = 1 #allow_disk_format_probing = 1

View File

@ -1,336 +0,0 @@
Index: libvirt-0.10.2/tools/Makefile.am
===================================================================
--- libvirt-0.10.2.orig/tools/Makefile.am
+++ libvirt-0.10.2/tools/Makefile.am
@@ -169,24 +169,22 @@ install-data-local: install-init install
uninstall-local: uninstall-init uninstall-systemd
install-sysconfig:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/adm/fillup-templates
$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
+ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirt-guests
uninstall-sysconfig:
- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
- rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
+ rm -f $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirt-guests
EXTRA_DIST += libvirt-guests.init.sh
install-initscript: libvirt-guests.init
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/init.d
$(INSTALL_SCRIPT) libvirt-guests.init \
- $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
+ $(DESTDIR)$(sysconfdir)/init.d/libvirt-guests
uninstall-initscript:
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
- rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d ||:
+ rm -f $(DESTDIR)$(sysconfdir)/init.d/libvirt-guests
if LIBVIRT_INIT_SCRIPT_RED_HAT
Index: libvirt-0.10.2/tools/libvirt-guests.sysconf
===================================================================
--- libvirt-0.10.2.orig/tools/libvirt-guests.sysconf
+++ libvirt-0.10.2/tools/libvirt-guests.sysconf
@@ -1,19 +1,29 @@
+## Path: System/Virtualization/libvirt
+
+## Type: string
+## Default: default
# URIs to check for running guests
# example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
-#URIS=default
+URIS=default
+## Type: string
+## Default: start
# action taken on host boot
# - start all guests which were running on shutdown are started on boot
# regardless on their autostart settings
# - ignore libvirt-guests init script won't start any guest on boot, however,
# guests marked as autostart will still be automatically started by
# libvirtd
-#ON_BOOT=start
+ON_BOOT=start
+## Type: integer
+## Default: 0
# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
-#START_DELAY=0
+START_DELAY=0
+## Type: string
+## Default: suspend
# action taken on host shutdown
# - suspend all running guests are suspended using virsh managedsave
# - shutdown all running guests are asked to shutdown. Please be careful with
@@ -22,20 +32,26 @@
# which just needs a long time to shutdown. When setting
# ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
# value suitable for your guests.
-#ON_SHUTDOWN=suspend
+ON_SHUTDOWN=suspend
+## Type: integer
+## Default: 0
# If set to non-zero, shutdown will suspend guests concurrently. Number of
# guests on shutdown at any time will not exceed number set in this variable.
-#PARALLEL_SHUTDOWN=0
+PARALLEL_SHUTDOWN=0
+## Type: integer
+## Default: 300
# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
# is no time out (use with caution, as guests might not respond to a shutdown
# request). The default value is 300 seconds (5 minutes).
-#SHUTDOWN_TIMEOUT=300
+SHUTDOWN_TIMEOUT=300
+## Type: integer
+## Default: 0
# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
-#BYPASS_CACHE=0
+BYPASS_CACHE=0
Index: libvirt-0.10.2/tools/libvirt-guests.init.sh
===================================================================
--- libvirt-0.10.2.orig/tools/libvirt-guests.init.sh
+++ libvirt-0.10.2/tools/libvirt-guests.init.sh
@@ -4,10 +4,10 @@
#
### BEGIN INIT INFO
# Provides: libvirt-guests
-# Required-Start: libvirtd
-# Required-Stop: libvirtd
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Required-Start: $network $remote_fs libvirtd
+# Required-Stop: $network $remote_fs libvirtd
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 4 6
# Short-Description: suspend/resume libvirt guests on shutdown/boot
# Description: This is a script for suspending active libvirt guests
# on shutdown and resuming them on next boot
@@ -24,14 +24,13 @@
# See http://libvirt.org
#
+. /etc/rc.status
+rc_reset
+
sysconfdir="@sysconfdir@"
localstatedir="@localstatedir@"
libvirtd="@sbindir@"/libvirtd
-# Source function library.
-test ! -r "$sysconfdir"/rc.d/init.d/functions ||
- . "$sysconfdir"/rc.d/init.d/functions
-
# Source gettext library.
# Make sure this file is recognized as having translations: _("dummy")
. "@bindir@"/gettext.sh
@@ -52,15 +51,13 @@ test -f "$sysconfdir"/sysconfig/libvirt-
LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
-RETVAL=0
-
# retval COMMAND ARGUMENTS...
# run command with arguments and convert non-zero return value to 1 and set
# the global return variable
retval() {
"$@"
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
else
return 0
@@ -89,6 +86,25 @@ run_virsh_c() {
( export LC_ALL=C; run_virsh "$@" )
}
+await_daemon_up()
+{
+ uri=$1
+ i=1
+ rets=10
+ run_virsh $uri list > /dev/null 2>&1
+ while [ $? -ne 0 -a $i -lt $rets ]; do
+ sleep 1
+ echo -n .
+ i=$(($i + 1))
+ run_virsh $uri list > /dev/null 2>&1
+ done
+ if [ $i -eq $rets ]; then
+ echo $"libvirt-guests unable to connect to URI: $uri"
+ return 1
+ fi
+ return 0
+}
+
# test_connect URI
# check if URI is reachable
test_connect()
@@ -115,7 +131,7 @@ list_guests() {
list=$(run_virsh_c "$uri" list --uuid $persistent)
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
fi
@@ -141,7 +157,7 @@ guest_is_on() {
guest_running=false
id=$(run_virsh "$uri" domid "$uuid")
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
fi
@@ -189,6 +205,12 @@ start() {
test_connect "$uri" || continue
+ await_daemon_up $uri
+ if [ $? -ne 0 ]; then
+ echo $"Ignoring guests on $uri URI, can't connect"
+ continue
+ fi
+
eval_gettext "Resuming guests on \$uri URI..."; echo
for guest in $list; do
name=$(guest_name "$uri" "$guest")
@@ -401,7 +423,7 @@ shutdown_guests_parallel()
timeout=$(($timeout - 1))
if [ $timeout -le 0 ]; then
eval_gettext "Timeout expired while shutting down domains"; echo
- RETVAL=1
+ rc_failed 1
return
fi
else
@@ -429,7 +451,7 @@ stop() {
if [ $SHUTDOWN_TIMEOUT -lt 0 ]; then
gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0"
echo
- RETVAL=6
+ rc_failed 6
return
fi
fi
@@ -543,14 +565,13 @@ gueststatus() {
rh_status() {
if [ -f "$LISTFILE" ]; then
gettext "stopped, with saved guests"; echo
- RETVAL=3
+ rc_failed 3
else
if [ -f "$VAR_SUBSYS_LIBVIRT_GUESTS" ]; then
gettext "started"; echo
else
gettext "stopped, with no saved guests"; echo
fi
- RETVAL=0
fi
}
@@ -594,4 +615,4 @@ case "$1" in
usage
;;
esac
-exit $RETVAL
+rc_exit
Index: libvirt-0.10.2/daemon/Makefile.am
===================================================================
--- libvirt-0.10.2.orig/daemon/Makefile.am
+++ libvirt-0.10.2/daemon/Makefile.am
@@ -259,39 +259,23 @@ uninstall-logrotate:
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
install-sysconfig:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/adm/fillup-templates
$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
-uninstall-sysconfig:
- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
+ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd
-if WITH_SYSCTL
-install-sysctl:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
- $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
- $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
+uninstall-sysconfig:
+ rm -f $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd
-uninstall-sysctl:
- rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
-else
install-sysctl:
uninstall-sysctl:
-endif
if LIBVIRT_INIT_SCRIPT_RED_HAT
BUILT_SOURCES += libvirtd.init
install-init-redhat: install-sysconfig libvirtd.init
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
- $(INSTALL_SCRIPT) libvirtd.init \
- $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
uninstall-init-redhat: uninstall-sysconfig
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
else
install-init-redhat:
uninstall-init-redhat:
Index: libvirt-0.10.2/daemon/libvirtd.sysconf
===================================================================
--- libvirt-0.10.2.orig/daemon/libvirtd.sysconf
+++ libvirt-0.10.2/daemon/libvirtd.sysconf
@@ -1,16 +1,25 @@
+## Path: System/Virtualization/libvirt
+
+## Type: string
+## Default: /etc/libvirt/libvirtd.conf
# Override the default config file
# NOTE: This setting is no longer honoured if using
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
# in LIBVIRTD_ARGS instead.
-#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
+LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
-# Listen for TCP/IP connections
-# NB. must setup TLS/SSL keys prior to using this
-#LIBVIRTD_ARGS="--listen"
+## Type: string
+## Default: --listen
+# Arguments to pass to libvirtd
+LIBVIRTD_ARGS="--listen"
+## Type: string
+## Default: none
# Override Kerberos service keytab for SASL/GSSAPI
#KRB5_KTNAME=/etc/libvirt/krb5.tab
+## Type: string
+## Default: none
# Override the QEMU/SDL default audio driver probing when
# starting virtual machines using SDL graphics
#

125
virtlockd-init-script.patch Normal file
View File

@ -0,0 +1,125 @@
Adjust virtlockd init files to conform to SUSE standards
Index: libvirt-1.0.1/src/locking/virtlockd.sysconf
===================================================================
--- libvirt-1.0.1.orig/src/locking/virtlockd.sysconf
+++ libvirt-1.0.1/src/locking/virtlockd.sysconf
@@ -1,3 +1,7 @@
+## Path: System/Virtualization/virtlockd
+
+## Type: string
+## Default: ""
#
# Pass extra arguments to virtlockd
#VIRTLOCKD_ARGS=
Index: libvirt-1.0.1/src/locking/virtlockd.init.in
===================================================================
--- libvirt-1.0.1.orig/src/locking/virtlockd.init.in
+++ libvirt-1.0.1/src/locking/virtlockd.init.in
@@ -4,11 +4,13 @@
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
#
### BEGIN INIT INFO
-# Provides: virtlockd
-# Default-Start: 3 4 5
+# Provides: virtlockd
+# Required-Start: $network $remote_fs
+# Default-Start: 3 4 5
+# Required-Stop: $network $remote_fs
# Short-Description: virtual machine lock manager
-# Description: This is a daemon for managing locks
-# on virtual machine disk images
+# Description: This is a daemon for managing locks
+# on virtual machine disk images
### END INIT INFO
# the following is chkconfig init header
@@ -23,35 +25,39 @@
# pidfile: @localstatedir@/run/libvirt/virtlockd.pid
#
-# Source function library.
-. @sysconfdir@/rc.d/init.d/functions
+. @sysconfdir@/rc.status
+rc_reset
SERVICE=virtlockd
-PROCESS=virtlockd
+PROCESS=@sbindir@/virtlockd
PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid
VIRTLOCKD_ARGS=
test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd
-RETVAL=0
+if [ -d @localstatedir@/lock/subsys ]; then
+ VAR_SUBSYS_VIRTLOCKD=@localstatedir@/lock/subsys/$SERVICE
+else
+ VAR_SUBSYS_VIRTLOCKD=@localstatedir@/lock/$SERVICE
+fi
start() {
- echo -n $"Starting $SERVICE daemon: "
- daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS
+ echo -n $"Starting $SERVICE "
+ startproc $PROCESS --daemon $VIRTLOCKD_ARGS
RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
+ rc_status -v
+ [ $RETVAL -eq 0 ] && touch $VAR_SUBSYS_VIRTLOCKD
}
stop() {
- echo -n $"Stopping $SERVICE daemon: "
+ echo -n $"Stopping $SERVICE "
- killproc -p $PIDFILE $PROCESS
+ killproc -p $PIDFILE $PROCESS > /dev/null 2>&1
RETVAL=$?
- echo
+ rc_status -v
if [ $RETVAL -eq 0 ]; then
- rm -f @localstatedir@/lock/subsys/$SERVICE
+ rm -f $VAR_SUBSYS_VIRTLOCKD
rm -f $PIDFILE
fi
}
@@ -65,9 +71,7 @@ reload() {
echo -n $"Reloading $SERVICE configuration: "
killproc -p $PIDFILE $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
+ rc_status
}
# See how we were called.
@@ -76,18 +80,20 @@ case "$1" in
$1
;;
status)
- status -p $PIDFILE $PROCESS
- RETVAL=$?
+ echo -n "Checking status of $SERVICE "
+ checkproc $PROCESS
+ rc_status -v
;;
force-reload)
reload
;;
condrestart|try-restart)
- [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
+ [ -f $VAR_SUBSYS_VIRTLOCKD ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
- exit 2
+ rc_failed 2
+ rc_exit
;;
esac
-exit $RETVAL
+rc_exit

View File

@ -13,10 +13,10 @@ Date: Wed Jan 27 16:11:41 2010 -0700
This approach allows removing a disk when domain is inactive. We This approach allows removing a disk when domain is inactive. We
obviously can't search xenstore when the domain is inactive. obviously can't search xenstore when the domain is inactive.
Index: libvirt-0.10.2/src/xen/xend_internal.c Index: libvirt-1.0.1/src/xen/xend_internal.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/xen/xend_internal.c --- libvirt-1.0.1.orig/src/xen/xend_internal.c
+++ libvirt-0.10.2/src/xen/xend_internal.c +++ libvirt-1.0.1/src/xen/xend_internal.c
@@ -61,6 +61,7 @@ @@ -61,6 +61,7 @@
static int static int

View File

@ -1,8 +1,8 @@
Index: libvirt-0.10.2/src/xenxs/xen_sxpr.c Index: libvirt-1.0.1/src/xenxs/xen_sxpr.c
=================================================================== ===================================================================
--- libvirt-0.10.2.orig/src/xenxs/xen_sxpr.c --- libvirt-1.0.1.orig/src/xenxs/xen_sxpr.c
+++ libvirt-0.10.2/src/xenxs/xen_sxpr.c +++ libvirt-1.0.1/src/xenxs/xen_sxpr.c
@@ -340,7 +340,7 @@ error: @@ -341,7 +341,7 @@ error:
static int static int
xenParseSxprDisks(virDomainDefPtr def, xenParseSxprDisks(virDomainDefPtr def,
const struct sexpr *root, const struct sexpr *root,
@ -11,7 +11,7 @@ Index: libvirt-0.10.2/src/xenxs/xen_sxpr.c
int xendConfigVersion) int xendConfigVersion)
{ {
const struct sexpr *cur, *node; const struct sexpr *cur, *node;
@@ -391,7 +391,6 @@ xenParseSxprDisks(virDomainDefPtr def, @@ -392,7 +392,6 @@ xenParseSxprDisks(virDomainDefPtr def,
/* There is a case without the uname to the CD-ROM device */ /* There is a case without the uname to the CD-ROM device */
offset = strchr(dst, ':'); offset = strchr(dst, ':');
if (!offset || if (!offset ||