From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id ED8F4138010 for ; Fri, 24 Aug 2012 04:19:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 763DAE0682; Fri, 24 Aug 2012 04:18:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2EF1FE0682 for ; Fri, 24 Aug 2012 04:18:42 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3445933E0A0 for ; Fri, 24 Aug 2012 04:18:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id ADEDBE543D for ; Fri, 24 Aug 2012 04:18:39 +0000 (UTC) From: "Brian Harring" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Harring" Message-ID: <1334438767.6504680272d7437330c628922a02fdad65dc37b0.ferringb@gentoo> Subject: [gentoo-commits] proj/kvm-tools:master commit in: app-emulation/qemu-init-scripts/files/ X-VCS-Repository: proj/kvm-tools X-VCS-Files: app-emulation/qemu-init-scripts/files/qemu-init-script X-VCS-Directories: app-emulation/qemu-init-scripts/files/ X-VCS-Committer: ferringb X-VCS-Committer-Name: Brian Harring X-VCS-Revision: 6504680272d7437330c628922a02fdad65dc37b0 X-VCS-Branch: master Date: Fri, 24 Aug 2012 04:18:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 960313b5-044e-4a99-bc26-d14cf0b2e763 X-Archives-Hash: 131b88fc3bcc8f12883194449a221f13 commit: 6504680272d7437330c628922a02fdad65dc37b0 Author: Brian Harring chromium org> AuthorDate: Sat Apr 14 07:15:18 2012 +0000 Commit: Brian Harring gentoo org> CommitDate: Sat Apr 14 21:26:07 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kvm-tools.git;a=commit;h=65046802 readlink -f DISKIMAGE earlier, and start better using openrc capabilties. --- .../qemu-init-scripts/files/qemu-init-script | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app-emulation/qemu-init-scripts/files/qemu-init-script b/app-emulation/qemu-init-scripts/files/qemu-init-script index ba9aae3..0fbfec4 100644 --- a/app-emulation/qemu-init-scripts/files/qemu-init-script +++ b/app-emulation/qemu-init-scripts/files/qemu-init-script @@ -56,23 +56,24 @@ sanity_check() { eerror "You have to create an init script for each vm:" eerror " ln -s vm /etc/init.d/vm.vmname" return 1 - elif [ ! -f "${DISKIMAGE}" -a ! -b "${DISKIMAGE}" ]; then + fi + DISKIMAGE=$(readlink -f "${DISKIMAGE}") + if [ ! -f "${DISKIMAGE}" -a ! -b "${DISKIMAGE}" ]; then eerror "couldn't find \$DISKIMAGE '$DISKIMAGE'" return 1; fi discern_vm_binary } +start_pre() { + checkpath -d --owner root:root --mode 0644 "${PIDFILE%/*}" \ + "${MONITOR%/*}" +} + + start() { sanity_check || return 1 - img=$(readlink -f "${DISKIMAGE}") - [ -z "$img" ] && { - eerror "couldn't find ${DISKIMAGE}" - return 1; - } - - mkdir -p "${PIDFILE%/*}" "${MONITOR%/*}" ebegin "creating qtap ${QTAP:-(auto allocating one)}" if [ -n "$QTAP" ]; then qtap-manipulate create_specific "${QTAP}" -u "${DROP_USER}" @@ -91,7 +92,7 @@ start() { --pidfile ${PIDFILE} \ -- -daemonize -pidfile ${PIDFILE} -monitor unix:${MONITOR},server,nowait \ -runas ${DROP_USER} -name ${VMNAME} \ - -drive file="$img",if=${DRIVE_MODEL:-virtio},cache=${DRIVE_CACHE:-none} \ + -drive file="$DISKIMAGE",if=${DRIVE_MODEL:-virtio},cache=${DRIVE_CACHE:-none} \ -net nic,model=${NIC_MODEL:-virtio},macaddr=${MACADDR} -net tap,ifname=${QTAP},script=no \ ${DISABLE_KVM:---enable-kvm} \ ${MEMORY:+-m ${MEMORY}} ${SMP:+-smp ${SMP}} ${VNC:+-vnc ${VNC}} ${OTHER_ARGS}