On Fri, Oct 05, 2007 at 10:54:17AM +0200, Michael wrote:I use this silly script plus a small C program to open up the the tun devices and pass them to qemu (makes it possible for me to run qemu without root privs). The main trick is getmac() which generates "hopefully" unique mac addresses per port. -- :wq Claudio #!/bin/sh # # stupid script to start multiple qemus on a single box SUDO=/usr/bin/sudo USER=cjeker # qemu args IMAGE=virt.hd MEMORY=64 FLAGS="-snapshot -nographic" NICFLAGS="-net nic,vlan=\$id,macaddr=\$mac -net tap,vlan=\$id,fd=\$fd" usage() { echo "usage: $0 [-n] [-i image] [-f floppy.fs] instance" 1>&2 exit 2 } getmac() { mac="00:bd:`printf %02x $(($RANDOM % 256))`:" mac="$mac`printf %02x $(($RANDOM % 256))`:" mac="$mac`printf %02x $(($1 % 256))`:`printf %02x $(($2 % 255 + 1))`" } start() { for id in 0 1 2 3; do fd=$(($id + 3)) tun=tun$(($1 * 10 + $id)) getmac $1 id eval "nics=\"$nics $NICFLAGS\"" fds="$fds fdpass -n $fd -f /dev/$tun" # make sure a tun interface is available ifconfig $tun > /dev/null 2>&1 if [ $? -ne 0 ]; then ${SUDO} ifconfig $tun link0 fi done ${SUDO} $fds -u cjeker qemu -m ${MEMORY} ${FLAGS} $nics ${IMAGE} } args=`getopt f:i:n $*` if [ $? -ne 0 ]; then usage fi set -- $args while [ $# -gt 0 ]; do case "$1" in -f) shift FLAGS="-fda $1 -boot a -monitor stdio" ;; -i) shift IMAGE="$1" ;; -n) FLAGS="-nographic" echo "DISABLING SNAPSHOT MODE" ;; --) shift; break ;; esac shift done if [ $# -ne 1 ]; then usage fi start $1
| Greg KH | Og dreams of kernels |
| Jens Axboe | [PATCH 31/33] Fusion: sg chaining support |
| Arnd Bergmann | Re: finding your own dead "CONFIG_" variables |
| Mark Brown | [PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset |
| Tony Breeds | [LGUEST] Look in object dir for .config |
git: | |
| Brian Downing | Re: Git in a Nutshell guide |
| John Benes | Re: master has some toys |
| Matthias Lederhofer | [PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree |
| Alexander Sulfrian | [RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set |
| Junio C Hamano | Re: Rss produced by git is not valid xml? |
| Linux Kernel Mailing List | iSeries: fix section mismatch in iseries_veth |
| Linux Kernel Mailing List | ixbge: remove TX lock and redo TX accounting. |
| Linux Kernel Mailing List | ixgbe: fix several counter register errata |
| Linux Kernel Mailing List | b43: fix build with CONFIG_SSB_PCIHOST=n |
| Linux Kernel Mailing List | 9p: block-based virtio client |
