summaryrefslogtreecommitdiff
path: root/app-emulation/xen-tools/files/xenqemudev.initd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 20:56:41 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 20:56:41 +0100
commitd87262dd706fec50cd150aab3e93883b6337466d (patch)
tree246b44c33ad7a57550430b0a60fa0df86a3c9e68 /app-emulation/xen-tools/files/xenqemudev.initd
parent71bc00c87bba1ce31de0dac6c3b7fd1aee6917fc (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-emulation/xen-tools/files/xenqemudev.initd')
-rw-r--r--app-emulation/xen-tools/files/xenqemudev.initd84
1 files changed, 0 insertions, 84 deletions
diff --git a/app-emulation/xen-tools/files/xenqemudev.initd b/app-emulation/xen-tools/files/xenqemudev.initd
deleted file mode 100644
index 9dcbb3f2244e..000000000000
--- a/app-emulation/xen-tools/files/xenqemudev.initd
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
- need xencommons xenstored xenconsoled
-}
-
-is_privileged_domain() {
- grep -qsE '^control_d$' /proc/xen/capabilities
- return $?
-}
-
-xen_setvars() {
- . /etc/xen/scripts/hotplugpath.sh
-
- XENQEMUDEV_PIDFILE=/run/xenqemudev.pid
-
- # xen-4.5 change the path
- XEN_QEMU="${LIBEXEC}/qemu-system-i386"
- [ -e ${XEN_QEMU} ] && return
- XEN_QEMU="${LIBEXEC_BIN}/qemu-system-i386"
-}
-
-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() {
- ebegin "Starting xenqemudev daemon"
-
- # not running in Xen dom0 or domU
- if [ ! -d /proc/xen ]; then
- eend 1 "Not running in Xen mode"
- return 1
- 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"
-}
-
-stop () {
- ebegin "Stopping xenqemudev"
-
- xen_setvars
-
- start-stop-daemon --stop --exec ${XEN_QEMU} \
- --pidfile ${XENQEMUDEV_PIDFILE}
-
- eend $? "Stopping xenqemudev, as it cannot be restarted."
-}