summaryrefslogtreecommitdiff
path: root/app-emulation/ganeti/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-02-10 15:40:27 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-02-10 15:40:27 +0000
commit6bc2e4d7c5906e46a8f275a876ead6ec41aca5bb (patch)
treecee0a97398040001220ece3cd48c3d568bcddb4a /app-emulation/ganeti/files
parent1db00cc6e94b90c08090bb5b8c406622946c4ae5 (diff)
gentoo resync : 10.02.2019
Diffstat (limited to 'app-emulation/ganeti/files')
-rw-r--r--app-emulation/ganeti/files/ganeti-2.15-use-balloon-device.patch13
-rw-r--r--app-emulation/ganeti/files/ganeti.initd-r32
-rw-r--r--app-emulation/ganeti/files/ganeti.initd-r496
3 files changed, 110 insertions, 1 deletions
diff --git a/app-emulation/ganeti/files/ganeti-2.15-use-balloon-device.patch b/app-emulation/ganeti/files/ganeti-2.15-use-balloon-device.patch
new file mode 100644
index 000000000000..ae57a213fc00
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.15-use-balloon-device.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/hypervisor/hv_kvm/__init__.py b/lib/hypervisor/hv_kvm/__init__.py
+index 174621fcc..1f598e7ef 100644
+--- a/lib/hypervisor/hv_kvm/__init__.py
++++ b/lib/hypervisor/hv_kvm/__init__.py
+@@ -1094,7 +1094,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
+ # Add id to ballon and place to the first available slot (3 or 4)
+ addr = utils.GetFreeSlot(pci_reservations, reserve=True)
+ pci_info = ",bus=pci.0,addr=%s" % hex(addr)
+- kvm_cmd.extend(["-balloon", "virtio,id=balloon%s" % pci_info])
++ kvm_cmd.extend(["-device", "virtio-balloon,id=balloon%s" % pci_info])
+ kvm_cmd.extend(["-daemonize"])
+ if not instance.hvparams[constants.HV_ACPI]:
+ kvm_cmd.extend(["-no-acpi"])
diff --git a/app-emulation/ganeti/files/ganeti.initd-r3 b/app-emulation/ganeti/files/ganeti.initd-r3
index 6869f48313db..18b3116a517f 100644
--- a/app-emulation/ganeti/files/ganeti.initd-r3
+++ b/app-emulation/ganeti/files/ganeti.initd-r3
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
extra_commands="forcestart is_master"
diff --git a/app-emulation/ganeti/files/ganeti.initd-r4 b/app-emulation/ganeti/files/ganeti.initd-r4
new file mode 100644
index 000000000000..6393de8e2803
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti.initd-r4
@@ -0,0 +1,96 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="forcestart is_master"
+
+depend() {
+ need localmount logger
+ after bootmisc sshd
+ use net
+}
+
+DAEMON_UTIL="/usr/%LIBDIR%/ganeti/daemon-util"
+
+is_master() {
+ [ -z "${ganeti_master}" ] && ganeti_master="$(gnt-cluster getmaster)"
+ [ -z "${local_hostname}" ] && local_hostname="$(hostname -f)"
+ [ "${ganeti_master}" = "${local_hostname}" ]
+}
+
+# This exists specifically for restarting a 2-node cluster where quorum might
+# not be available.
+forcestart() {
+ ewarn "Forcing non-quorum Ganeti master start"
+ GANETI_WCONFD_OPTS="${GANETI_WCONFD_OPTS} --no-voting --yes-do-it"
+ GANETI_LUXID_OPTS="${GANETI_LUXID_OPTS} --no-voting --yes-do-it"
+ GANETI_MASTERD_OPTS="${GANETI_LUXID_OPTS} --no-voting --yes-do-it"
+ export GANETI_WCONFD_OPTS GANETI_LUXID_OPTS GANETI_MASTERD_OPTS
+ start
+}
+
+start() {
+ if ! [ -e ${DAEMON_UTIL} ]; then
+ eerror "Could not find daemon utility at ${DAEMON_UTIL}"
+ return 1
+ elif ! ${DAEMON_UTIL} check-config ; then
+ eerror "Incomplete configuration, will not run."
+ return 1
+ fi
+
+ local daemon retval=0 optsvar started_daemons daemon_opts
+
+ for daemon in $(${DAEMON_UTIL} list-start-daemons); do
+ optsvar="$(printf "${daemon}_OPTS" | tr - _ | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+
+ case "${daemon#ganeti-}" in
+ masterd|rapi|luxid) is_master || continue;;
+ esac
+
+ eval daemon_opts=\"\$\{${optsvar}\}\"
+
+ ebegin "Starting ${daemon}"
+ eindent
+ veinfo ${DAEMON_UTIL} start ${daemon} ${GANETI_OPTS} ${daemon_opts}
+ ${DAEMON_UTIL} start ${daemon} ${GANETI_OPTS} ${daemon_opts} || retval=${?}
+
+ if [ ${retval} != 0 ] && [ -n "${started_daemons}" ]; then
+ case ${daemon} in
+ *-kvmd) retval=0; ewarn "Failed to start kvmd, continuing anyway";;
+ *)
+ eerror "Stopping already started daemons"
+ eindent
+ eend ${code} "$(${DAEMON_UTIL} check-exitcode ${code})"
+
+ for daemon in ${started_daemons}; do
+ ebegin "Stopping ${daemon}"
+ ${DAEMON_UTIL} stop ${daemon} ${GANETI_OPTS}
+ eend ${?}
+ done
+ eoutdent; eoutdent
+ return ${retval}
+ ;;
+ esac
+ fi
+ eoutdent
+ started_daemons="${started_daemons} ${daemon}"
+ done
+}
+
+stop() {
+ if ! [ -e ${DAEMON_UTIL} ]; then
+ eerror "Could not find daemon utility at ${DAEMON_UTIL}"
+ return 1
+ fi
+
+ local daemon
+
+ for daemon in $(${DAEMON_UTIL} list-stop-daemons) ; do \
+ case "${daemon#ganeti-}" in
+ masterd|rapi|luxid) is_master || continue;;
+ esac
+ ${DAEMON_UTIL} stop ${daemon} ${GANETI_OPTS}
+ done
+}
+
+# vim:ft=gentoo-init-d:ts=4:sts=4:sw=4:noet: