diff options
author | 2017-08-31 20:55:00 -0500 | |
---|---|---|
committer | 2017-08-31 20:55:28 -0500 | |
commit | 733c3216e3706a24d863260414f0767d66b7ca9e (patch) | |
tree | 608e69e92cb7f0c878f18075190cda9ffdfa65ff /app-emulation/libvirt/files | |
parent | dev-python/libvirt-python: drop vulnerable 3.2.0, 3.4.0, 3.5.0, bug #629462 (diff) | |
download | gentoo-733c3216e3706a24d863260414f0767d66b7ca9e.tar.gz gentoo-733c3216e3706a24d863260414f0767d66b7ca9e.tar.bz2 gentoo-733c3216e3706a24d863260414f0767d66b7ca9e.zip |
app-emulation/libvirt: drop vulnerable 3.2.0, 3.4.0, 3.5.0, bug #629462
Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'app-emulation/libvirt/files')
-rw-r--r-- | app-emulation/libvirt/files/README.gentoo-r1 | 53 | ||||
-rw-r--r-- | app-emulation/libvirt/files/libvirt-guests.init-r1 | 235 | ||||
-rw-r--r-- | app-emulation/libvirt/files/libvirtd.init-r15 | 37 |
3 files changed, 0 insertions, 325 deletions
diff --git a/app-emulation/libvirt/files/README.gentoo-r1 b/app-emulation/libvirt/files/README.gentoo-r1 deleted file mode 100644 index 74d1e77930d8..000000000000 --- a/app-emulation/libvirt/files/README.gentoo-r1 +++ /dev/null @@ -1,53 +0,0 @@ -Important: The openrc libvirtd init script is now broken up into two -separate services: libvirtd, that solely handles the daemon, and -libvirt-guests, that takes care of clients during shutdown/restart of the -host. In order to reenable client handling, edit /etc/conf.d/libvirt-guests -and enable the service and start it: - - $ rc-update add libvirt-guests - $ service libvirt-guests start - - -For the basic networking support (bridged and routed networks) you don't -need any extra software. For more complex network modes including but not -limited to NATed network, you can enable the 'virt-network' USE flag. It -will pull in required runtime dependencies - - -If you are using dnsmasq on your system, you will have to configure -/etc/dnsmasq.conf to enable the following settings: - - bind-interfaces - interface or except-interface - -Otherwise you might have issues with your existing DNS server. - - -For openrc users: - - Please use /etc/conf.d/libvirtd to control the '--listen' parameter for - libvirtd. - - Use /etc/init.d/libvirt-guests to manage clients on restart/shutdown of - the host. The default configuration will suspend and resume running kvm - guests with 'managedsave'. This behavior can be changed under - /etc/conf.d/libvirt-guests - - -For systemd users: - - Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf - to control the '--listen' parameter for libvirtd. - - The configuration for the 'libvirt-guests.service' is found under - /etc/libvirt/libvirt-guests.conf" - - -If you have built libvirt without policykit support (USE=-policykit), you -must change the unix sock group and/or perms in /etc/libvirt/libvirtd.conf -in order to allow normal users to connect to libvirtd. - - -If libvirtd is built with USE=caps, libvirt will now start qemu/kvm VMs -with non-root privileges. Ensure any resources your VMs use are accessible -by qemu:qemu. diff --git a/app-emulation/libvirt/files/libvirt-guests.init-r1 b/app-emulation/libvirt/files/libvirt-guests.init-r1 deleted file mode 100644 index 6d8146926962..000000000000 --- a/app-emulation/libvirt/files/libvirt-guests.init-r1 +++ /dev/null @@ -1,235 +0,0 @@ -#!/sbin/openrc-run - -description="Virtual Machine Management (libvirt) Guests" - -depend() { - need libvirtd -} - -# set the default to QEMU -[ -z "${LIBVIRT_URIS}" ] && LIBVIRT_URIS="qemu:///system" - -# default to suspending the VM via managedsave -case "${LIBVIRT_SHUTDOWN}" in - managedsave|shutdown|destroy) ;; - *) LIBVIRT_SHUTDOWN="managedsave" ;; -esac - -# default to 500 seconds -[ -z ${LIBVIRT_MAXWAIT} ] && LIBVIRT_MAXWAIT=500 - -gueststatefile="/var/lib/libvirt/libvirt-guests.state" -netstatefile="/var/lib/libvirt/libvirt-net.state" - -do_virsh() { - local hvuri=$1 - shift - - # if unset, default to qemu - [ -z ${hvuri} ] && hvuri="qemu:///system" - # if only qemu was supplied then correct the value - [ "xqemu" = x${hvuri} ] && hvuri="qemu:///system" - - # Silence errors because virsh always throws an error about - # not finding the hypervisor version when connecting to libvirtd - # lastly strip the blank line at the end - LC_ALL=C virsh -c ${hvuri} "$@" 2>/dev/null | head -n -1 -} - -libvirtd_dom_list() { - # Only work with domains by their UUIDs - local hvuri=$1 - shift - - do_virsh "${hvuri}" list --uuid $@ -} - -libvirtd_dom_count() { - local hvuri=$1 - shift - - libvirtd_dom_list "${hvuri}" $@ | wc -l -} - -libvirtd_net_list() { - # Only work with networks by their UUIDs - local hvuri=$1 - shift - - do_virsh "${hvuri}" net-list --uuid $@ -} - -libvirtd_net_count() { - local hvuri=$1 - shift - - libvirtd_net_list "${hvuri}" $@ | wc -l -} - -libvirtd_dom_stop() { - # stops all persistent or transient domains for a given URI - # $1 - uri - # $2 - persisent/transient - - local uri=$1 - local persist=$2 - local shutdown_type=${LIBVIRT_SHUTDOWN} - local counter=${LIBVIRT_MAXWAIT} - local dom_name= - local dom_as= - local dom_ids= - local uuid= - local dom_count= - - [ "${persist}" = "--transient" ] && shutdown_type="shutdown" - [ -n "${counter}" ] || counter=500 - - einfo " Shutting down domain(s) ..." - - # grab all persistent or transient domains running - dom_ids=$(libvirtd_dom_list ${uri} ${persist}) - - for uuid in ${dom_ids}; do - # Get the name - dom_name=$(do_virsh ${uri} domname ${uuid}) - einfo " ${dom_name}" - # Get autostart state - dom_as=$(do_virsh ${uri} dominfo ${uuid} | \ - awk '$1 == "Autostart:" { print $2 }') - - if [ "${persist}" = "--persistent" ]; then - # Save our running state only if LIBVIRT_IGNORE_AUTOSTART != yes - if [ "x${LIBVIRT_IGNORE_AUTOSTART}" = "xyes" ] && \ - [ ${dom_as} = "enabled" ]; then - : - else - echo "${uri} ${uuid}" >> ${gueststatefile} - fi - - fi - - # Now let's stop it - do_virsh "${uri}" ${shutdown_type} ${uuid} > /dev/null - - done - - dom_count="$(libvirtd_dom_count ${uri} ${persist})" - while [ ${dom_count} -gt 0 ] && [ ${counter} -gt 0 ] ; do - dom_count="$(libvirtd_dom_count ${uri} ${persist})" - sleep 1 - if [ "${shutdown_type}" = "shutdown" ]; then - counter=$((${counter} - 1)) - fi - echo -n "." - done - - if [ "${shutdown_type}" = "shutdown" ]; then - # grab all domains still running - dom_ids=$(libvirtd_dom_list ${uri} ${persist}) - for uuid in ${dom_ids}; do - dom_name=$(do_virsh ${uri} domname ${uuid}) - eerror " ${dom_name} forcibly stopped" - do_virsh "${uri}" destroy ${uuid} > /dev/null - done - fi -} - -libvirtd_net_stop() { - # stops all persistent or transient domains for a given URI - # $1 - uri - # $2 - persisent/transient - - local uri=$1 - local persist=$2 - local uuid= - local net_name= - - if [ "${LIBVIRT_NET_SHUTDOWN}" != "no" ]; then - - einfo " Shutting down network(s):" - for uuid in $(libvirtd_net_list ${uri} ${persist}); do - net_name=$(do_virsh ${uri} net-name ${uuid}) - einfo " ${net_name}" - - if [ "${persist}" = "--persistent" ]; then - # Save our running state - echo "${uri} ${uuid}" >> ${netstatefile} - - fi - - # Actually stop the network - do_virsh qemu net-destroy ${uuid} > /dev/null - done - - fi -} - -start() { - local uri= - local uuid= - local name= - - for uri in ${LIBVIRT_URIS}; do - do_virsh "${uri}" connect - if [ $? -ne 0 ]; then - eerror "Failed to connect to '${uri}'. Domains may not start." - fi - done - - [ ! -e "${netstatefile}" ] && touch "${netstatefile}" - [ ! -e "${gueststatefile}" ] && touch "${gueststatefile}" - - # if the user didn't want to start any guests up then respect their wish - [ "x${LIBVIRT_START}" = "xno" ] && return 0 - - # start networks - ebegin "Starting libvirt networks" - while read -r uri uuid - do - # ignore trash - [ -z "${uri}" ] || [ -z "${uuid}" ] && continue - - name=$(do_virsh "${uri}" net-name ${uuid}) - einfo " ${name}" - do_virsh "${uri}" net-start ${uuid} > /dev/null - done <"${netstatefile}" - eend 0 - - # start domains - ebegin "Starting libvirt domains" - while read -r uri uuid - do - # ignore trash - [ -z "${uri}" ] || [ -z "${uuid}" ] && continue - - name=$(do_virsh "${uri}" domname ${uuid}) - einfo " ${name}" - do_virsh "${uri}" start ${uuid} > /dev/null - done <"${gueststatefile}" - eend 0 -} - -stop() { - local counter= - local dom_name= - local net_name= - local dom_ids= - local uuid= - local dom_count= - - rm -f "${gueststatefile}" - [ $? -ne 0 ] && eerror "Unable to save domain state" - rm -f "${netstatefile}" - [ $? -ne 0 ] && eerror "Unable to save net state" - - for uri in ${LIBVIRT_URIS}; do - einfo "Stopping libvirt domains and networks for ${uri}" - - libvirtd_dom_stop "${uri}" "--persistent" - libvirtd_dom_stop "${uri}" "--transient" - libvirtd_net_stop "${uri}" "--persistent" - libvirtd_net_stop "${uri}" "--transient" - - einfo "Done stopping domains and networks for ${uri}" - done -} diff --git a/app-emulation/libvirt/files/libvirtd.init-r15 b/app-emulation/libvirt/files/libvirtd.init-r15 deleted file mode 100644 index 25224601d7f6..000000000000 --- a/app-emulation/libvirt/files/libvirtd.init-r15 +++ /dev/null @@ -1,37 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="Virtual Machine Management daemon (libvirt)" - -LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"} -LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"} - -command="/usr/sbin/libvirtd" -command_args="-d ${LIBVIRTD_OPTS}" -start_stop_daemon_args="--env KRB5_KTNAME=/etc/libvirt/krb5.tab" -pidfile="/var/run/libvirtd.pid" -retry="${LIBVIRTD_TERMTIMEOUT}" - -depend() { - USE_FLAG_FIREWALLD - use USE_FLAG_AVAHI USE_FLAG_ISCSI USE_FLAG_RBD dbus virtlockd - after ntp-client ntpd nfs nfsmount portmap rpc.statd iptables ip6tables ebtables corosync sanlock cgconfig xenconsoled -} - -start_pre() { - # Test configuration directories in /etc/libvirt/ to be either not - # present or a directory, i.e. not a regular file, bug #532892 - local has_errors=0 - ebegin "Checking for suitable directories in \"/etc/libvirt\"" - - for dir in lxc nwfilter qemu storage; do - if [ -f /etc/libvirt/$dir ]; then - has_errors=1 - eerror "/etc/libvirt/$dir was created as a regular file. It must be either" - eerror "a directory or not present for libvirtd to start up successfully." - fi - done - - eend ${has_errors} "Please correct the error(s) above" -} |