public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-emulation/xen-tools/files: xencommons.confd xenqemudev.initd xenstored.initd xenstored.confd xenconsoled.initd
@ 2013-12-07  6:49 Ian Delaney (idella4)
  0 siblings, 0 replies; only message in thread
From: Ian Delaney (idella4) @ 2013-12-07  6:49 UTC (permalink / raw
  To: gentoo-commits

idella4     13/12/07 06:49:41

  Modified:             xencommons.confd xenqemudev.initd xenstored.initd
                        xenstored.confd xenconsoled.initd
  Log:
  corrections to previous patch by dlan, tested by him
  
  (Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)

Revision  Changes    Path
1.2                  app-emulation/xen-tools/files/xencommons.confd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.confd?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.confd?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.confd?r1=1.1&r2=1.2

Index: xencommons.confd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xencommons.confd,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xencommons.confd	6 Dec 2013 23:34:11 -0000	1.1
+++ xencommons.confd	7 Dec 2013 06:49:41 -0000	1.2
@@ -1,7 +1,4 @@
-# /etc/conf.d/xenqemudev
+# /etc/conf.d/xencommons
 
-# To enable QEMU file backend, set to 'yes'
-XENQEMUDEV_FILE_BACKEND_ENABLE=""
-
-# Common options for xenqemudev
-XENQEMUDEV_OPTS=""
+# Load xen's kernel modules, and this will override defaults
+XEN_KERNEL_MODULES=""



1.2                  app-emulation/xen-tools/files/xenqemudev.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd?r1=1.1&r2=1.2

Index: xenqemudev.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xenqemudev.initd	6 Dec 2013 23:34:11 -0000	1.1
+++ xenqemudev.initd	7 Dec 2013 06:49:41 -0000	1.2
@@ -1,117 +1,81 @@
 #!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd,v 1.1 2013/12/06 23:34:11 idella4 Exp $
-
-extra_commands="status"
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd,v 1.2 2013/12/07 06:49:41 idella4 Exp $
 
 depend() {
-	need xend
-	after dhcp
+	need xencommons xenstored xenconsoled
 }
 
-get_domname() {
-	local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
-
-	if [ -z ${name_from_file} ] ; then
-		basename "${1}"
-	else
-		echo ${name_from_file}        
-	fi
+is_privileged_domain() {
+	grep -qsE '^control_d$' /proc/xen/capabilities
+	return $?
 }
 
-is_running() {
-	/usr/sbin/xm list "${1}" >/dev/null 2>&1
-}
+xen_setvars() {
+	. /etc/xen/scripts/hotplugpath.sh
 
-using_screen() {
-	[ "${SCREEN}" = "yes" -o "${SCREEN}" = "YES" ]
+	XENQEMUDEV_PIDFILE=/run/xenqemudev.pid
+	XEN_QEMU="${LIBEXEC}/qemu-system-i386"
 }
 
-set_screen_cmd() {
-	screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r ${SCREEN_NAME:=xen} -X"
+xen_qemu_start() {
+	if [ -z "${XENQEMUDEV_FILE_BACKEND_ENABLE}" ]; then
+		ewarn " QEMU disk backend not enabled"
+		ewarn " enable XENQEMUDEV_FILE_BACKEND_ENABLE in /etc/conf.d/xenqemudev"
+		return 1
+	fi
+
+	xen_setvars
+
+	if [ ! -c /dev/xen/gntdev ]; then
+		einfo " Xen gntdev driver not loaded"
+		return 1
+	fi
+
+	if [ -e "${XEN_QEMU}" ]; then
+		einfo " Starting QEMU as disk backend for dom0"
+
+		XENQEMUDEV_DEFAULT_OPTS="-xen-domid 0 -xen-attach -name dom0 \
+			-nographic -M xenpv -daemonize \
+			-monitor /dev/null -serial /dev/null -parallel /dev/null"
+
+		XENQEMUDEV_OPTS=${XENQEMUDEV_OPTS:-${XENQEMUDEV_DEFAULT_OPTS}}
+
+		start-stop-daemon --start --exec ${XEN_QEMU} \
+			--pidfile ${XENQEMUDEV_PIDFILE} \
+			-- -pidfile ${XENQEMUDEV_PIDFILE} \
+			${XENQEMUDEV_OPTS}
+		return $?
+	fi
 }
 
 start() {
-	set_screen_cmd
+	ebegin "Starting xenqemudev daemon"
 
-	einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}"
-	if using_screen ; then
-		ebegin "Creating screen session to hold domain consoles"
-		( screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME} -t dom0 && sleep 3 \
-		&& ${screen_cmd} zombie dr \
-		&& logrotate -f /etc/xen/xen-consoles.logrotate \
-		&& ${screen_cmd} logfile /var/log/xen-consoles/%t.log \
-		&& ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \
-		&& ${screen_cmd} log on \
-		&& ${screen_cmd} deflog on ) >/dev/null
-		if [ $? -ne 0 ] ; then
-			eend 1
-			return 1
-		else
-			eend
-		fi
-	fi
-	# Create all domains with config files in AUTODIR.
-	for dom in $(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort); do
-		name=$(get_domname ${dom})
-		if ! is_running ${name} ; then
-			ebegin " Starting domain ${name}"
-			if using_screen ; then
-				${screen_cmd} screen -t ${name} xm create ${dom} -c
-			else
-				xm create --quiet ${dom}
-			fi
-			eend $?
-		else
-			einfo " Not starting domain ${name} - already running"
-		fi
-	done
-}
-
-stop() {
-	set_screen_cmd
-
-	einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}"
-	# Stop all domains with config files in AUTODIR.
-	DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)"
-
-	if [[ "$PARALLEL_SHUTDOWN" == "yes" ]] ; then
-		for dom in $DOMAINS ; do
-			name=$(get_domname ${dom})
-			if is_running ${name} ; then
-				ebegin " Asking domain ${name} to shutdown in the background..."
-				xm shutdown --wait ${name} >/dev/null &
-			else
-				einfo " Not stopping domain ${name} - not running"
-			fi
-		done
-		einfo " Waiting for shutdown of domains that are still running"
-		wait
-		eend $?
-	else
-		for dom in $DOMAINS ; do
-			name=$(get_domname ${dom})
-			if is_running ${name} ; then
-				ebegin " Waiting for domain ${name} to shutdown"
-				xm shutdown --wait ${name} >/dev/null
-				eend $?
-			else
-				einfo " Not stopping domain ${name} - not running"
-			fi
-		done
+	# not running in Xen dom0 or domU
+	if [ ! -d /proc/xen ]; then
+		eend 1 "Not running in Xen mode"
+		return 1
 	fi
-	if using_screen ; then
-		if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then
-			ebegin "Closing screen session ${SCREEN_NAME}"
-			${screen_cmd} quit
-			eend $?
-		else
-			eend 0
-		fi
+
+	if ! is_privileged_domain; then
+		eend 1 "Not running on a privileged domain. xenqemudev not started"
+		return 1
 	fi
+
+	xen_qemu_start
+
+	eend $? "Failed to start xenqemudev"
 }
 
-status() {
-	/usr/sbin/xm list
-}
\ No newline at end of file
+stop () {
+	ebegin "Stopping xenqemudev"
+
+	xen_setvars
+
+	start-stop-daemon --stop --exec ${XEN_QEMU} \
+		--pidfile ${XENQEMUDEV_PIDFILE}
+
+	eend $? "Stopping xenqemudev, as it cannot be restarted."
+}



1.12                 app-emulation/xen-tools/files/xenstored.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd?rev=1.12&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd?rev=1.12&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd?r1=1.11&r2=1.12

Index: xenstored.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- xenstored.initd	6 Dec 2013 23:34:11 -0000	1.11
+++ xenstored.initd	7 Dec 2013 06:49:41 -0000	1.12
@@ -1,7 +1,6 @@
 #!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd,v 1.11 2013/12/06 23:34:11 idella4 Exp $
 
 depend() {
 	before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
@@ -9,7 +8,7 @@
 }
 
 start() {
-	! [ -x /run/xen ] && mkdir -p /run/xen
+	[ -x /run/xen ] || mkdir -p /run/xen
 	ebegin "Starting xenstored daemon"
 	start-stop-daemon --start --exec /usr/sbin/xenstored \
 		--pidfile /run/xenstored.pid \
@@ -31,3 +30,4 @@
 		--pidfile /run/xenstored.pid
 	eend $?
 }
+



1.3                  app-emulation/xen-tools/files/xenstored.confd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.confd?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.confd?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.confd?r1=1.2&r2=1.3

Index: xenstored.confd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.confd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xenstored.confd	4 Aug 2013 12:22:18 -0000	1.2
+++ xenstored.confd	7 Dec 2013 06:49:41 -0000	1.3
@@ -1,52 +1,2 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-is_privileged_domain() {
-	# [ -e /proc/xen/capabilities ]
-	! [ -z /proc/xen/capabilities ] && return 0
-        return 1
-}
-
-depend() {
-	before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
-}
-
-start() {
-	[ -x /run/xen ] || mkdir -p /run/xen
-	ebegin "Starting xenstored daemon"
-
-	if [ -e /proc/xen/privcmd ] && is_privileged_domain
-	then
-		eend 1 "Not running on a privileged domain. xenstored not started"
-		return 1
-	fi
-
-	start-stop-daemon --start --exec /usr/sbin/xenstored \
-		--pidfile /var/run/xenstored.pid \
-		-- --pid-file=/var/run/xenstored.pid \
-		$XENSTORED_OPTS || return 1
-
-	einfo "Waiting (upto 10 seconds) for xenstore to come up"
-
-	for i in {0..20}; do
-		sleep .5
-		! xenstore-exists / 2> /dev/null || break
-	done
-
-	if ! xenstore-exists / 2> /dev/null; then
-		eend 1 "xenstore not up within 10 seconds"
-	else
-		einfo "Setting domain0 name record"
-		xenstore-write "/local/domain/0/name" "Domain-0"
-		eend $?
-	fi
-}
-
-stop() {
-	ebegin "Stopping xenstored daemon"
-	start-stop-daemon --stop --exec /usr/sbin/xenstored \
-		--pidfile /var/run/xenstored.pid
-	eend $?
-}
-
+# /etc/conf.d/xenstored
+XENSTORED_OPTS=""



1.4                  app-emulation/xen-tools/files/xenconsoled.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd?r1=1.3&r2=1.4

Index: xenconsoled.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xenconsoled.initd	6 Dec 2013 23:34:11 -0000	1.3
+++ xenconsoled.initd	7 Dec 2013 06:49:41 -0000	1.4
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v 1.3 2013/12/06 23:34:11 idella4 Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v 1.4 2013/12/07 06:49:41 idella4 Exp $
 
 depend() {
 	need xenstored
@@ -19,6 +19,6 @@
 stop() {
 	ebegin "Stopping xenconsoled daemon"
 	start-stop-daemon --stop --exec /usr/sbin/xenconsoled \
-		--pidfile run/xenconsoled.pid
+		--pidfile /run/xenconsoled.pid
 	eend $*
 }





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-07  6:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-07  6:49 [gentoo-commits] gentoo-x86 commit in app-emulation/xen-tools/files: xencommons.confd xenqemudev.initd xenstored.initd xenstored.confd xenconsoled.initd Ian Delaney (idella4)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox