From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C2zEo-0008FE-5Z for qemu-devel@nongnu.org; Thu, 02 Sep 2004 17:35:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C2zEn-0008EP-DC for qemu-devel@nongnu.org; Thu, 02 Sep 2004 17:35:21 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2zEn-0008ED-7u for qemu-devel@nongnu.org; Thu, 02 Sep 2004 17:35:21 -0400 Received: from [38.113.3.61] (helo=smtp-out.hotpop.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C2z9a-0007kK-6A for qemu-devel@nongnu.org; Thu, 02 Sep 2004 17:29:58 -0400 Received: from phreaker.net (kubrick.hotpop.com [38.113.3.103]) by smtp-out.hotpop.com (Postfix) with SMTP id 2CF937DFFA6 for ; Thu, 2 Sep 2004 21:29:51 +0000 (UTC) Received: from jbrown.mylinuxbox.org (pcp02982829pcs.midval01.tn.comcast.net [68.85.196.73]) by smtp-1.hotpop.com (Postfix) with ESMTP id AFBF91A009C for ; Thu, 2 Sep 2004 21:29:43 +0000 (UTC) Date: Thu, 2 Sep 2004 17:29:48 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] Attitute and Predisposition of the List & newbie documets Message-ID: <20040902212948.GC21554@jbrown.mylinuxbox.org> References: <3DCC5CF6-FC4C-11D8-8B6F-000A95D874F4@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DCC5CF6-FC4C-11D8-8B6F-000A95D874F4@mac.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 "$@"