public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Harring" <ferringb@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/kvm-tools:master commit in: app-emulation/qemu-init-scripts/files/
Date: Fri, 24 Aug 2012 04:18:39 +0000 (UTC)	[thread overview]
Message-ID: <1334438767.6504680272d7437330c628922a02fdad65dc37b0.ferringb@gentoo> (raw)

commit:     6504680272d7437330c628922a02fdad65dc37b0
Author:     Brian Harring <ferringb <AT> chromium <DOT> org>
AuthorDate: Sat Apr 14 07:15:18 2012 +0000
Commit:     Brian Harring <ferringb <AT> gentoo <DOT> 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}


             reply	other threads:[~2012-08-24  4:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24  4:18 Brian Harring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-23 17:55 [gentoo-commits] proj/kvm-tools:master commit in: app-emulation/qemu-init-scripts/files/ Brian Dolbec
2016-03-22 23:38 Brian Dolbec
2016-03-22 23:38 Brian Dolbec
2016-03-22 23:38 Brian Dolbec
2016-03-22 23:38 Brian Dolbec
2016-03-22 23:38 Brian Dolbec
2016-03-22 23:38 Brian Dolbec
2016-02-03 22:27 Rafael Martins
2016-02-03 22:27 Rafael Martins
2013-11-16  4:21 Brian Dolbec
2013-11-16  4:21 Brian Dolbec
2013-11-16  4:21 Brian Dolbec
2013-11-16  4:21 Brian Dolbec
2012-08-24  4:18 Brian Harring
2012-08-24  4:18 Brian Harring
2012-08-24  4:18 Brian Harring
2012-08-24  4:18 Brian Harring
2012-04-14 23:48 [gentoo-commits] proj/kvm-tools:ferringb " Brian Harring
2012-08-24  4:18 ` [gentoo-commits] proj/kvm-tools:master " Brian Harring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334438767.6504680272d7437330c628922a02fdad65dc37b0.ferringb@gentoo \
    --to=ferringb@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox