From: "Jim C. Brown" <jbrown106@phreaker.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Attitute and Predisposition of the List & newbie documets
Date: Thu, 2 Sep 2004 17:29:48 -0400 [thread overview]
Message-ID: <20040902212948.GC21554@jbrown.mylinuxbox.org> (raw)
In-Reply-To: <3DCC5CF6-FC4C-11D8-8B6F-000A95D874F4@mac.com>
On Wed, Sep 01, 2004 at 03:22:19PM -0400, Kai Cherry wrote:
> We aren't getting dumb questions, but what I see as valid points to at
> least think about.
>
> And now, for a simple, but effective suggestion.
>
> Fabrice, or whomever, can we get a simple key:value config file for the
> commandline switches?
>
I guess the .qmu config files don't work. Attached is the script I use to
give me key=value config files for the command line switches. I've posted
this before but no one took notice then.
I would have said "just search the mail archive for it" but apparently attached
files don't always work ... so in this case it's possible you might have looked
(and even found it) but couldn't download it. I attach it here as text so others
won't have this problem next time.
Since config file support clearly exists for qemu (the bottom of this email
proves it), either accept it/improve it, write your own code to replace it,
or reject it and stop complaining.
> I'd do it, but it would be biased towards xml so it could be easily be
> worked into a .plist for OS X...but I think most folks could be better
> served by a "flat file" key/val scheme.
>
> This way, any/all "useless" GUI's could at least have a common format
> to look for, and write options to.
Agreed.
>
> -K
>
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
#! /bin/sh
# locate the config file
if [ "$1" = "-config" ]; then
conffile=$2
shift 2
else
conffile=./.qemurc
fi
# hard-coded defaults here
qemu=
vde=off
boot=harddisk
megs=32
fda=
fdb=
hda=
hdachs=
hdb=
cdrom=
hdc=
hdd=
audio=off
pci=on
macaddr=
cirrus=off
localtime=off
usernet=off
nics=1
netscript=/etc/qemu-ifup
graphic=on
# if we have a valid config file, load it
if [ -f $conffile ]; then
. $conffile
fi
# sanity check
if [ -z "$boot" ]; then
echo 'Option boot must be set to floppy, harddisk, or cdrom, or'
echo 'the decapriated options a, c, or d!'
exit 1
fi
if [ -z "$megs" ]; then
#TODO: make sure this is a number
echo 'Option megs must be set to a valid number!'
exit 1
fi
if [ -z "$nics" ]; then
#TODO: make sure this is a number
echo 'Option nics must be set to a valid number! (most likely this number will be 1)'
exit 1
fi
if [ -z "$netscript" ]; then
echo 'Warning: option netscript is not set. Will use /etc/qemu-ifup if asked.'
fi
#if [ "$boot" = "floppy" -o "$boot" = "a" ]; then
#if [ -z "$fda" ]; then
#echo 'Option fda must be set to a valid floppy image!'
#exit 1
#fi
#elif [ "$boot" = "harddisk" -o "$boot" = "c" ]; then
#if [ -z "$hda" ]; then
#echo 'Option hda must be set to a valid hard disk image!'
#exit 1
#fi
#elif [ "$boot" = "cdrom" -o "$boot" = "d" ]; then
#if [ -z "$cdrom" ]; then
#echo 'Option cdrom must be set to a valid cdrom iso image!'
#exit 1
#fi
#else
# sanity check
#echo -n "Option boot set to unknown value $boot. "
#echo 'I don't know what to do!'
#exit 1
#fi
# convert recommended values to the one qemu expects
if [ "$boot" = "floppy" ]; then
boot=a
elif [ "$boot" = "harddisk" ]; then
boot=c
elif [ "$boot" = "cdrom" ]; then
boot=d
fi
# isa hack (Note that setting $pci overrides $isa completely)
if [ -z "$pci" ]; then
if [ "$isa" = "on" ]; then
pci = off
else
pci = on
fi
fi
# interpret out configuration
comline=`which qemu`
if [ -n "$qemu" ]; then
comline="$qemu"
fi
if [ "$vde" = "on" ]; then
comline="vdeq $comline"
fi
comline="$comline -boot $boot"
comline="$comline -m $megs"
if [ -n "$fda" ]; then
comline="$comline -fda $fda"
fi
if [ -n "$fdb" ]; then
comline="$comline -fdb $fdb"
fi
if [ -n "$hda" ]; then
comline="$comline -hda $hda"
fi
if [ -n "$hdachs" ]; then
comline="$comline -hdachs $hdachs"
fi
if [ -n "$hdb" ]; then
comline="$comline -hdb $hdb"
fi
if [ -n "$cdrom" ]; then
comline="$comline -cdrom $cdrom"
fi
if [ -n "$hdc" ]; then
comline="$comline -hda $hdc"
fi
if [ -n "$hdd" ]; then
comline="$comline -hda $hdd"
fi
if [ "$audio" = "on" ]; then
comline="$comline -enable-audio"
fi
if [ "$pci" != "on" ]; then
comline="$comline -isa"
fi
if [ -n "$macaddr" ]; then
comline="$comline -macaddr $macaddr"
fi
if [ "$cirrus" != "on" ]; then
#comline="$comline -cirrusvga"
comline="$comline -std-vga"
fi
if [ "$localtime" = "on" ]; then
comline="$comline -localtime"
fi
if [ "$usernet" = "on" ]; then
comline="$comline -user-net"
elif [ "$usernet" = "dummy" ]; then
comline="$comline -dummy-net"
fi
# Don't pass the parameter if it is the qemu default
if [ "$nics" != "1" ]; then
comline="$comline -nics $nics"
fi
if [ -n "$netscript" ]; then
# Don't pass the parameter if it is the qemu default
if [ "$netscript" != "/etc/qemu-ifup" ]; then
comline="$comline -n $netscript"
fi
fi
if [ "$graphic" != "on" ]; then
comline="$comline -nographic"
fi
comline="$comline -monitor stdio -serial pty -no-sdl-grab"
echo $comline "$@"
exec $comline "$@"
next prev parent reply other threads:[~2004-09-02 21:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-01 19:11 [Qemu-devel] Attitute and Predisposition of the List & newbie documets Thomas Munn
2004-09-01 19:22 ` Kai Cherry
2004-09-02 21:29 ` Jim C. Brown [this message]
2004-09-01 19:40 ` Johannes Martin
2004-09-01 19:41 ` Lionel Ulmer
2004-09-01 20:38 ` Magnus Damm
2004-09-01 20:36 ` Kai Cherry
2004-09-01 20:57 ` Derek Fawcus
2004-09-02 6:46 ` Johannes Martin
2004-09-01 23:09 ` Lindsay Mathieson
2004-09-02 0:54 ` Bochnig, Martin
2004-09-02 21:22 ` Jim C. Brown
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=20040902212948.GC21554@jbrown.mylinuxbox.org \
--to=jbrown106@phreaker.net \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).