[arch-commits] Commit in libvirt/trunk (7 files)

Sergej Pupykin spupykin at nymeria.archlinux.org
Mon May 13 06:53:46 EDT 2013


    Date: Monday, May 13, 2013 @ 12:53:45
  Author: spupykin
Revision: 90610

Added:
  libvirt/trunk/libvirtd-guests.conf.d
  libvirt/trunk/libvirtd.conf.d
Modified:
  libvirt/trunk/PKGBUILD
Deleted:
  libvirt/trunk/libvirtd-guests.conf.d
  libvirt/trunk/libvirtd-guests.rc.d
  libvirt/trunk/libvirtd.conf.d
  libvirt/trunk/libvirtd.rc.d

------------------------+
 PKGBUILD               |    8 --
 libvirtd-guests.conf.d |   22 +++---
 libvirtd-guests.rc.d   |  161 -----------------------------------------------
 libvirtd.conf.d        |    6 -
 libvirtd.rc.d          |   66 -------------------
 5 files changed, 15 insertions(+), 248 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-05-13 10:42:35 UTC (rev 90609)
+++ PKGBUILD	2013-05-13 10:53:45 UTC (rev 90610)
@@ -4,7 +4,7 @@
 
 pkgname=libvirt
 pkgver=1.0.5
-pkgrel=2
+pkgrel=3
 pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
 arch=('i686' 'x86_64')
 url="http://libvirt.org/"
@@ -31,9 +31,7 @@
 	'etc/sasl2/libvirt.conf')
 install="libvirt.install"
 source=("http://libvirt.org/sources/$pkgname-$pkgver.tar.gz"
-	libvirtd.rc.d
 	libvirtd.conf.d
-	libvirtd-guests.rc.d
 	libvirtd-guests.conf.d
 	libvirt.tmpfiles.d)
 md5sums=('91c4145f49bcf92e89470fa3fb28fff6'
@@ -77,17 +75,13 @@
 
   make DESTDIR="$pkgdir" install
 
-  install -D -m755 "$srcdir"/libvirtd.rc.d "$pkgdir"/etc/rc.d/libvirtd
   install -D -m644 "$srcdir"/libvirtd.conf.d "$pkgdir"/etc/conf.d/libvirtd
-
-  install -D -m755 "$srcdir"/libvirtd-guests.rc.d "$pkgdir"/etc/rc.d/libvirtd-guests
   install -D -m644 "$srcdir"/libvirtd-guests.conf.d "$pkgdir"/etc/conf.d/libvirtd-guests
 
   # systemd stuff
   install -D -m644 "$srcdir"/libvirt.tmpfiles.d "$pkgdir"/usr/lib/tmpfiles.d/libvirt.conf
   mv "$pkgdir"/lib/* "$pkgdir"/usr/lib/
 
-
   rm -rf \
 	"$pkgdir"/var/run \
 	"$pkgdir"/etc/sysconfig \

Deleted: libvirtd-guests.conf.d
===================================================================
--- libvirtd-guests.conf.d	2013-05-13 10:42:35 UTC (rev 90609)
+++ libvirtd-guests.conf.d	2013-05-13 10:53:45 UTC (rev 90610)
@@ -1,11 +0,0 @@
-LIBVIRTD_STOP_ACTION=suspend
-
-#LIBVIRTD_URI="-c qemu+ssh://user@host/system"
-LIBVIRTD_URI=""
-
-#LIBVIRTD_BYPASS_CACHE="--bypass-cache"
-LIBVIRTD_BYPASS_CACHE=""
-
-LIBVIRTD_START_DELAY=0
-
-LIBVIRTD_SHUTDOWN_TIMEOUT=60

Added: libvirtd-guests.conf.d
===================================================================
--- libvirtd-guests.conf.d	                        (rev 0)
+++ libvirtd-guests.conf.d	2013-05-13 10:53:45 UTC (rev 90610)
@@ -0,0 +1,11 @@
+LIBVIRTD_STOP_ACTION=suspend
+
+#LIBVIRTD_URI="-c qemu+ssh://user@host/system"
+LIBVIRTD_URI=""
+
+#LIBVIRTD_BYPASS_CACHE="--bypass-cache"
+LIBVIRTD_BYPASS_CACHE=""
+
+LIBVIRTD_START_DELAY=0
+
+LIBVIRTD_SHUTDOWN_TIMEOUT=60

Deleted: libvirtd-guests.rc.d
===================================================================
--- libvirtd-guests.rc.d	2013-05-13 10:42:35 UTC (rev 90609)
+++ libvirtd-guests.rc.d	2013-05-13 10:53:45 UTC (rev 90610)
@@ -1,161 +0,0 @@
-#!/bin/bash
-
-source /etc/conf.d/libvirtd-guests
-[ -f /etc/rc.conf ] && source /etc/rc.conf
-
-if [ -f /etc/rc.d/functions ]; then
-    . /etc/rc.d/functions
-else
-    stat_busy() {
-        echo "$*"
-    }
-
-    stat_fail() {
-        echo "FAIL"
-    }
-
-    stat_done() {
-        echo "DONE"
-    }
-
-    add_daemon() {
-        true
-    }
-
-    rm_daemon() {
-        true
-    }
-fi
-
-
-LIBVIRTD_LISTFILE="/var/state/libvirtd/vm-list"
-
-# get guest state by name
-libvirt_get_guest_state()
-{
-	virsh $LIBVIRTD_URI dominfo "$1" | grep -E '^State:' | awk '{print $2}'
-}
-
-# list IDs of running guests
-libvirt_list()
-{
-
-	list=$(virsh $LIBVIRTD_URI list)
-
-	if [ $? -ne 0 ]; then
-		RETVAL=1
-		return 1
-	fi
-
-	uuids=
-	for id in $(echo "$list" | awk 'NR > 2 {print $1}'); do
-		uuid=$(virsh $LIBVIRTD_UTI dominfo $id | awk '/^UUID:/{print $2}')
-		if [ -z "$uuid" ]; then
-			RETVAL=1
-			return 1
-		fi
-		uuids="$uuids $uuid"
-	done
-
-	echo $uuids
-
-}
-
-libvirt_domname()
-{
-	uuid=$1
-	name=$(virsh $LIBVIRTD_URI dominfo $uuid | awk 'NR == 2 {$1=""; print}')
-
-	echo $name
-}
-
-# suspend guest by name
-libvirt_suspend()
-{
-	virsh $LIBVIRTD_URI $LIBVIRTD_BYPASS_CACHE managedsave "$1" >/dev/null
-	timeout=$LIBVIRTD_SHUTDOWN_TIMEOUT
-	while [ "$timeout" -gt 0 ]; do
-		sleep 1
-		timeout=$((timeout - 1))
-		state=`libvirt_get_guest_state "$1"`
-		[ "x$state" == "xshut" ] && return 0
-	done
-	return 1
-}
-
-# shutdown guest by name
-libvirt_shutdown()
-{
-	virsh $LIBVIRTD_URI shutdown "$1" >/dev/null
-	timeout=$LIBVIRTD_SHUTDOWN_TIMEOUT
-	while [ "$timeout" -gt 0 ]; do
-		sleep 1
-		timeout=$((timeout - 1))
-		state=`libvirt_get_guest_state "$1"`
-		[ "x$state" == "xshut" ] && return 0
-	done
-	return 1
-}
-
-# start guest by name
-libvirt_start()
-{
-	virsh $LIBVIRTD_URI $LIBVIRTD_BYPASS_CACHE start "$1" >/dev/null
-}
-
-# stop all guests
-libvirt_stop_all()
-{
-	mkdir -p `dirname $LIBVIRTD_LISTFILE`
-	echo -n >$LIBVIRTD_LISTFILE
-
-	for i in `libvirt_list`; do
-		name=`libvirt_domname $i`
-		if [ "x$LIBVIRTD_STOP_ACTION" == "xsuspend" ]; then
-			stat_busy "Suspending libvirtd/$name guest"
-			libvirt_suspend "$i"
-		else
-			stat_busy "Shutting libvirtd/$i guest down"
-			libvirt_shutdown "$i"
-		fi
-		[ $? -eq 0 ] && stat_done || stat_fail
-		echo $i >>$LIBVIRTD_LISTFILE
-	done
-}
-
-# start all guests
-libvirt_start_all()
-{
-	if [ -f $LIBVIRTD_LISTFILE ]; then
-		for i in `cat $LIBVIRTD_LISTFILE`; do
-			name=`libvirt_domname $i`
-			stat_busy "Starting/resuming libvirtd/$name guest"
-			libvirt_start "$i"
-			[ $? -eq 0 ] && { sleep $LIBVIRTD_START_DELAY; stat_done; } || stat_fail
-		done
-	fi
-	rm -f $LIBVIRTD_LISTFILE
-}
-
-# main
-LC_ALL=C
-LANG=C
-case "$1" in
-    start)
-		libvirt_start_all
-		add_daemon libvirtd-guests
-	;;
-    stop)
-		libvirt_stop_all
-		rm_daemon libvirtd-guests
-	;;
-    restart)
-	$0 stop
-	sleep 1
-	$0 start
-	;;
-    *)
-	echo $"Usage: $0 {start|stop|restart}"
-	;;
-esac
-exit 0

Deleted: libvirtd.conf.d
===================================================================
--- libvirtd.conf.d	2013-05-13 10:42:35 UTC (rev 90609)
+++ libvirtd.conf.d	2013-05-13 10:53:45 UTC (rev 90610)
@@ -1,3 +0,0 @@
-LIBVIRTD_CONFIG="/etc/libvirt/libvirtd.conf"
-LIBVIRTD_ARGS="-p /var/run/libvirtd.pid"
-KRB5_KTNAME="/etc/libvirt/krb5.tab"

Added: libvirtd.conf.d
===================================================================
--- libvirtd.conf.d	                        (rev 0)
+++ libvirtd.conf.d	2013-05-13 10:53:45 UTC (rev 90610)
@@ -0,0 +1,3 @@
+LIBVIRTD_CONFIG="/etc/libvirt/libvirtd.conf"
+LIBVIRTD_ARGS="-p /var/run/libvirtd.pid"
+KRB5_KTNAME="/etc/libvirt/krb5.tab"

Deleted: libvirtd.rc.d
===================================================================
--- libvirtd.rc.d	2013-05-13 10:42:35 UTC (rev 90609)
+++ libvirtd.rc.d	2013-05-13 10:53:45 UTC (rev 90610)
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/conf.d/libvirtd
-. /etc/rc.d/functions
-
-LIBVIRTD_CONFIG_ARGS=
-if [ -n "$LIBVIRTD_CONFIG" ]
-then
-	LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
-fi
-
-PID=`pidof -o %PPID /usr/sbin/libvirtd`
-case "$1" in
-    start)
-	stat_busy "Starting libvirtd"
-	export RADVD=/usr/sbin/radvd
-	for i in /var/run/libvirt/qemu /var/run/libvirt/lxc /var/run/libvirt/uml /var/run/libvirt/network; do
-		[ -d $i ] || mkdir -p $i
-	done
-	[ -z "$PID" ] && (
-		mkdir -p /var/{cache,run}/libvirt
-		rm -rf /var/cache/libvirt/*
-		KRB5_KTNAME=$KRB5_KTNAME \
-			/usr/sbin/libvirtd --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
-	)
-	if [ $? -gt 0 ]; then
-		stat_fail
-	else
-		add_daemon libvirtd
-		stat_done
-	fi
-	;;
-    stop)
-	stat_busy "Stopping libvirtd"
-	[ ! -z "$PID" ]  && (
-		kill $PID &> /dev/null
-		rm -rf /var/cache/libvirt/*
-		rm -f /var/run/libvirtd.pid
-	)
-	if [ $? -gt 0 ]; then
-		stat_fail
-	else
-		rm_daemon libvirtd
-		stat_done
-	fi
-	;;
-    restart)
-	$0 stop
-	sleep 1
-	$0 start
-	;;
-    reload)
-	stat_busy "Reloading libvirtd configuration"
-	[ ! -z "$PID" ]  && kill -HUP $PID &> /dev/null
-	if [ $? -gt 0 ]; then
-		stat_fail
-	else
-		stat_done
-	fi
-	;;
-    *)
-        echo $"Usage: $0 {start|stop|restart|reload}"
-        ;;
-esac
-exit 0



More information about the arch-commits mailing list