qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Attitute and Predisposition of the List & newbie docume


From: Jim C. Brown
Subject: Re: [Qemu-devel] Attitute and Predisposition of the List & newbie documets
Date: Thu, 2 Sep 2004 17:29:48 -0400
User-agent: Mutt/1.4i

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
> address@hidden
> 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 "$@"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]