2012-05-31 00:10:42 +02:00
|
|
|
Index: libvirt-0.9.11.3/tools/Makefile.am
|
2011-01-12 00:41:45 +01:00
|
|
|
===================================================================
|
2012-05-31 00:10:42 +02:00
|
|
|
--- libvirt-0.9.11.3.orig/tools/Makefile.am
|
|
|
|
+++ libvirt-0.9.11.3/tools/Makefile.am
|
2012-02-15 20:01:07 +01:00
|
|
|
@@ -182,24 +182,22 @@ install-data-local: install-init install
|
2011-12-15 02:23:04 +01:00
|
|
|
uninstall-local: uninstall-init uninstall-systemd
|
2011-01-12 00:41:45 +01:00
|
|
|
|
2011-12-15 02:23:04 +01:00
|
|
|
install-sysconfig:
|
|
|
|
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
|
|
|
|
+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/adm/fillup-templates
|
2011-01-12 00:41:45 +01:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
|
|
|
|
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
|
2011-12-15 02:23:04 +01:00
|
|
|
+ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirt-guests
|
2011-01-12 00:41:45 +01:00
|
|
|
|
2011-12-15 02:23:04 +01:00
|
|
|
uninstall-sysconfig:
|
|
|
|
- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
|
|
|
|
- rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
|
|
|
|
+ rm -f $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirt-guests
|
2011-01-12 00:41:45 +01:00
|
|
|
|
2011-12-15 02:23:04 +01:00
|
|
|
EXTRA_DIST += libvirt-guests.init.sh
|
2011-01-13 00:13:53 +01:00
|
|
|
|
2011-12-15 02:23:04 +01:00
|
|
|
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
|
2012-05-31 00:10:42 +02:00
|
|
|
Index: libvirt-0.9.11.3/tools/libvirt-guests.sysconf
|
2011-01-12 00:41:45 +01:00
|
|
|
===================================================================
|
2012-05-31 00:10:42 +02:00
|
|
|
--- libvirt-0.9.11.3.orig/tools/libvirt-guests.sysconf
|
|
|
|
+++ libvirt-0.9.11.3/tools/libvirt-guests.sysconf
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -1,19 +1,29 @@
|
2011-01-12 00:41:45 +01:00
|
|
|
+## 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
|
|
|
|
|
2011-05-04 23:55:21 +02:00
|
|
|
+## Type: integer
|
|
|
|
+## Default: 0
|
2012-04-12 23:33:51 +02:00
|
|
|
# Number of seconds to wait between each guest start. Set to 0 to allow
|
|
|
|
# parallel startup.
|
2011-05-04 23:55:21 +02:00
|
|
|
-#START_DELAY=0
|
|
|
|
+START_DELAY=0
|
|
|
|
|
2011-01-12 00:41:45 +01:00
|
|
|
+## 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
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -22,20 +32,26 @@
|
2011-01-12 00:41:45 +01:00
|
|
|
# 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
|
2012-04-12 23:33:51 +02:00
|
|
|
+## 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
|
2011-08-04 19:12:20 +02:00
|
|
|
|
|
|
|
+## 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.
|
2012-04-12 23:33:51 +02:00
|
|
|
-#BYPASS_CACHE=0
|
|
|
|
+BYPASS_CACHE=0
|
2012-05-31 00:10:42 +02:00
|
|
|
Index: libvirt-0.9.11.3/tools/libvirt-guests.init.sh
|
2011-01-12 00:41:45 +01:00
|
|
|
===================================================================
|
2012-05-31 00:10:42 +02:00
|
|
|
--- libvirt-0.9.11.3.orig/tools/libvirt-guests.init.sh
|
|
|
|
+++ libvirt-0.9.11.3/tools/libvirt-guests.init.sh
|
2011-01-12 00:41:45 +01:00
|
|
|
@@ -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
|
|
|
|
+
|
2011-02-11 19:46:10 +01:00
|
|
|
sysconfdir="@sysconfdir@"
|
|
|
|
localstatedir="@localstatedir@"
|
|
|
|
libvirtd="@sbindir@"/libvirtd
|
2011-01-12 00:41:45 +01:00
|
|
|
|
|
|
|
-# Source function library.
|
|
|
|
-test ! -r "$sysconfdir"/rc.d/init.d/functions ||
|
2011-02-11 19:46:10 +01:00
|
|
|
- . "$sysconfdir"/rc.d/init.d/functions
|
2011-01-12 00:41:45 +01:00
|
|
|
-
|
2011-02-11 19:46:10 +01:00
|
|
|
# Source gettext library.
|
|
|
|
# Make sure this file is recognized as having translations: _("dummy")
|
|
|
|
. "@bindir@"/gettext.sh
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -52,15 +51,13 @@ test -f "$sysconfdir"/sysconfig/libvirt-
|
2011-01-12 00:41:45 +01:00
|
|
|
LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
|
|
|
|
VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
|
|
|
|
|
|
|
|
-RETVAL=0
|
|
|
|
-
|
2012-04-12 23:33:51 +02:00
|
|
|
# retval COMMAND ARGUMENTS...
|
|
|
|
# run command with arguments and convert non-zero return value to 1 and set
|
|
|
|
# the global return variable
|
2011-01-12 00:41:45 +01:00
|
|
|
retval() {
|
|
|
|
"$@"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
- RETVAL=1
|
|
|
|
+ rc_failed 1
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
return 0
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -89,6 +86,25 @@ run_virsh_c() {
|
2011-01-12 00:41:45 +01:00
|
|
|
( 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
|
|
|
|
+}
|
|
|
|
+
|
2012-04-12 23:33:51 +02:00
|
|
|
# test_connect URI
|
|
|
|
# check if URI is reachable
|
|
|
|
test_connect()
|
|
|
|
@@ -115,7 +131,7 @@ list_guests() {
|
2011-01-12 00:41:45 +01:00
|
|
|
|
2012-04-12 23:33:51 +02:00
|
|
|
list=$(run_virsh_c "$uri" list --uuid $persistent)
|
2011-01-12 00:41:45 +01:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
- RETVAL=1
|
|
|
|
+ rc_failed 1
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -141,7 +157,7 @@ guest_is_on() {
|
2011-01-12 00:41:45 +01:00
|
|
|
guest_running=false
|
2012-04-12 23:33:51 +02:00
|
|
|
id=$(run_virsh "$uri" domid "$uuid")
|
2011-01-12 00:41:45 +01:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
- RETVAL=1
|
|
|
|
+ rc_failed 1
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -189,6 +205,12 @@ start() {
|
|
|
|
|
|
|
|
test_connect "$uri" || continue
|
2011-01-12 00:41:45 +01:00
|
|
|
|
|
|
|
+ await_daemon_up $uri
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ echo $"Ignoring guests on $uri URI, can't connect"
|
|
|
|
+ continue
|
|
|
|
+ fi
|
|
|
|
+
|
2011-02-11 19:46:10 +01:00
|
|
|
eval_gettext "Resuming guests on \$uri URI..."; echo
|
2011-01-12 00:41:45 +01:00
|
|
|
for guest in $list; do
|
2011-03-31 22:22:32 +02:00
|
|
|
name=$(guest_name "$uri" "$guest")
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -372,7 +394,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
|
|
|
|
fi
|
|
|
|
@@ -394,7 +416,7 @@ stop() {
|
|
|
|
if [ $SHUTDOWN_TIMEOUT -lt 0 ]; then
|
|
|
|
gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0"
|
2011-02-11 19:46:10 +01:00
|
|
|
echo
|
2011-01-12 00:41:45 +01:00
|
|
|
- RETVAL=6
|
|
|
|
+ rc_failed 6
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -504,14 +526,13 @@ gueststatus() {
|
2011-01-12 00:41:45 +01:00
|
|
|
rh_status() {
|
|
|
|
if [ -f "$LISTFILE" ]; then
|
2011-02-11 19:46:10 +01:00
|
|
|
gettext "stopped, with saved guests"; echo
|
2011-01-12 00:41:45 +01:00
|
|
|
- RETVAL=3
|
|
|
|
+ rc_failed 3
|
|
|
|
else
|
|
|
|
if [ -f "$VAR_SUBSYS_LIBVIRT_GUESTS" ]; then
|
2011-02-11 19:46:10 +01:00
|
|
|
gettext "started"; echo
|
2011-01-12 00:41:45 +01:00
|
|
|
else
|
2011-02-11 19:46:10 +01:00
|
|
|
gettext "stopped, with no saved guests"; echo
|
2011-01-12 00:41:45 +01:00
|
|
|
fi
|
|
|
|
- RETVAL=0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-04-12 23:33:51 +02:00
|
|
|
@@ -555,4 +576,4 @@ case "$1" in
|
2011-01-12 00:41:45 +01:00
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
-exit $RETVAL
|
|
|
|
+rc_exit
|
2012-05-31 00:10:42 +02:00
|
|
|
Index: libvirt-0.9.11.3/daemon/Makefile.am
|
2011-04-06 00:31:12 +02:00
|
|
|
===================================================================
|
2012-05-31 00:10:42 +02:00
|
|
|
--- libvirt-0.9.11.3.orig/daemon/Makefile.am
|
|
|
|
+++ libvirt-0.9.11.3/daemon/Makefile.am
|
|
|
|
@@ -249,22 +249,16 @@ uninstall-logrotate:
|
2011-12-15 02:23:04 +01:00
|
|
|
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
|
2011-04-06 00:31:12 +02:00
|
|
|
|
2011-12-15 02:23:04 +01:00
|
|
|
install-sysconfig:
|
|
|
|
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
|
|
|
|
+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/adm/fillup-templates
|
2011-04-06 00:31:12 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
|
|
|
|
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
2011-12-15 02:23:04 +01:00
|
|
|
+ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd
|
2012-05-31 00:10:42 +02:00
|
|
|
+
|
2011-12-15 02:23:04 +01:00
|
|
|
uninstall-sysconfig:
|
|
|
|
- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
|
|
|
- rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
|
|
|
|
+ rm -f $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd
|
|
|
|
|
2012-05-31 00:10:42 +02:00
|
|
|
if WITH_SYSCTL
|
2011-12-15 02:23:04 +01:00
|
|
|
install-sysctl:
|
|
|
|
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
|
2011-11-10 02:55:47 +01:00
|
|
|
- $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
|
|
|
|
- $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
|
2012-05-31 00:10:42 +02:00
|
|
|
-
|
2011-12-15 02:23:04 +01:00
|
|
|
uninstall-sysctl:
|
|
|
|
- rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
|
|
|
|
- rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
|
2012-05-31 00:10:42 +02:00
|
|
|
else
|
|
|
|
install-sysctl:
|
|
|
|
uninstall-sysctl:
|
|
|
|
@@ -275,13 +269,7 @@ if LIBVIRT_INIT_SCRIPT_RED_HAT
|
2011-04-06 00:31:12 +02:00
|
|
|
BUILT_SOURCES += libvirtd.init
|
|
|
|
|
2011-12-15 02:23:04 +01:00
|
|
|
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
|
2012-05-31 00:10:42 +02:00
|
|
|
-
|
2011-12-15 02:23:04 +01:00
|
|
|
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:
|
2012-05-31 00:10:42 +02:00
|
|
|
Index: libvirt-0.9.11.3/daemon/libvirtd.sysconf
|
2012-01-05 00:48:35 +01:00
|
|
|
===================================================================
|
2012-05-31 00:10:42 +02:00
|
|
|
--- libvirt-0.9.11.3.orig/daemon/libvirtd.sysconf
|
|
|
|
+++ libvirt-0.9.11.3/daemon/libvirtd.sysconf
|
2012-01-05 00:48:35 +01:00
|
|
|
@@ -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
|
|
|
|
#
|