Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 303503 Details for
Bug 406043
app-emulation/qemu-kvm-init-scripts - New init script with easy instants running
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
init.d script for qemu instances
qemu_init (text/plain), 3.05 KB, created by
master_volkov
on 2012-02-27 15:35:10 UTC
(
hide
)
Description:
init.d script for qemu instances
Filename:
MIME Type:
Creator:
master_volkov
Created:
2012-02-27 15:35:10 UTC
Size:
3.05 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 2012 volkov av ># Distributed under the terms of the GNU General Public License v2 > >extra_commands="create_image first_start" > >INSTANCENAME=${SVCNAME#*-} >CONFINSTNAME=$(shell_var "${INSTANCENAME}") > >QEMU_PID="/var/run/qemu-${INSTANCENAME}.pid" > >depend() { > need net.br0 vde >} > >first_start() { > BOOT_FROM_D=" -boot d " > start >} > > >_load_config() >{ > > source /etc/conf.d/qemu > > # set -- ${config} > # eval domain=\$dns_domain > #eval modset=\$/etc/conf.d/qemu > #echo $modset > > inst_image_dir=${imagedir:-"/home/qemu-image/"} > > eval inst_memory=\$${CONFINSTNAME}_memory > [ -z "${inst_memory}" ] && eval inst_memory=\$memory > if [ -z "${inst_memory}" ] ; then > inst_memory=" -m 512 " > else > inst_memory=" -m ${inst_memory} " > fi > > eval inst_vnc=\$${CONFINSTNAME}_vnc > [ -z "${inst_vnc}" ] && eval inst_vnc=\$vnc > if [ -z "${inst_vnc}" ] ; then > inst_vnc=" " > else > inst_vnc=" -vnc :${inst_vnc} " > fi > > eval inst_net=\$${CONFINSTNAME}_net > if [ -z "${inst_net}" ] ; then > inst_net=" " > else > inst_net=" ${inst_net} " > fi > > eval inst_cpu=\$${CONFINSTNAME}_cpu > [ -z "${inst_cpu}" ] && eval inst_cpu=\$cpu > if [ -z "${inst_cpu}" ] ; then > inst_cpu=" " > else > inst_cpu=" -cpu ${inst_cpu} " > fi > > eval inst_smp=\$${CONFINSTNAME}_smp > [ -z "${inst_smp}" ] && eval inst_smp=\$smp > if [ -z "${inst_smp}" ] ; then > inst_smp=" " > else > inst_smp=" -smp ${inst_smp} " > fi > > eval inst_drive=\$${CONFINSTNAME}_drive > if [ -z "${inst_drive}" ] ; then > inst_drive=" " > else > inst_drive=" ${inst_drive} " > fi > > eval inst_kvm=\$${CONFINSTNAME}_kvm > [ -z "${inst_kvm}" ] && eval inst_kvm=\$kvm > if [ -z "${inst_kvm}" ] ; then > inst_kvm=" " > else > if [ "${inst_kvm}" == "no" ] ; then > inst_kvm=" -no-kvm " > else > inst_kvm=" -enable-kvm " > fi > fi > > eval inst_opt=\$${CONFINSTNAME}_opt > [ -z "${inst_opt}" ] && eval inst_opt=\$opt > if [ -z "${inst_opt}" ] ; then > inst_opt=" " > else > inst_opt=" ${inst_opt} " > fi > > eval inst_qemu=\$${CONFINSTNAME}_qemu > [ -z "${inst_qemu}" ] && eval inst_qemu=\$qemu > if [ -z "${inst_qemu}" ] ; then > inst_qemu="/usr/bin/qemu-kvm" > else > inst_qemu="${inst_qemu}" > fi > QEMU_OPTS="${BOOT_FROM_D}${inst_net}${inst_vnc}${inst_opt}${inst_memory}${inst_smp}${inst_drive}${inst_kvm}${inst_cpu} -daemonize -pidfile $QEMU_PID" >} > >create_image() { > _load_config > ebegin "Creating qemu image for ${INSTANCENAME}" > einfo "Create is: create -f qcow2 ${inst_image_dir}/qemu-img-${CONFINSTNAME}.img 10G" > /usr/bin/qemu-img create -f qcow2 ${inst_image_dir}/qemu-img-${CONFINSTNAME}.img 10G > eend $? "Failed to creating qemu image for ${INSTANCENAME}" >} > > >start() { > ebegin "Start Qemu - ${INSTANCENAME}" > > _load_config > ># start-stop-daemon --start --exec "${EXEC_QEMU}" \ ># --pidfile "${QEMU_PID}" \ ># -- "${QEMU_OPTS}" > start-stop-daemon --start --exec ${inst_qemu} -- ${QEMU_OPTS} ># start-stop-daemon --start --oknodo --exec $EXEC_QEMU -- ${QEMU_OPTS} > > eend $? "Failed to start Qemu - ${INSTANCENAME}" >} > >stop() { > ebegin "Stop Qemu - ${INSTANCENAME}" > > start-stop-daemon --stop --pidfile $QEMU_PID > > eend $? "Failed to stop Qemu - ${INSTANCENAME}" >} > > ># vim:ts=4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 406043
: 303503 |
303505