* Anthony Liguori (anth...@codemonkey.ws) wrote:
> BTW, using -device, it should be possible to add a very high number of 
> nics because you can specify the PCI address including a function.  If 
> this doesn't Just Work today, we should make it work.

Should work...test...mostly[1], but I don't actually know of any tools that
make use of it.

thanks,
-chris

[1] 40 worked, 48 caused guest kernel stack corruption, didn't dig in to
see why yet.

Here's my simple wrapper to build up the command line:

QEMU=/home/chrisw/git/kvm/qemu-kvm/x86_64-softmmu/qemu-system-x86_64
BIOS=/home/chrisw/git/kvm/qemu-kvm/pc-bios
DISK=/home/chrisw/disk-snap1.img
SCRIPT=/home/chrisw/git/kvm/qemu-kvm/kvm/scripts/qemu-ifup

unset NETARGS
i=0
dev=4
func=0
max_dev=40
while [ $i -lt $max_dev ]
do
  unset MULTIFUNC
  if [ $(($i + 1)) -lt $max_dev -a $func -eq 0 ]; then
    MULTIFUNC=",multifunction=on"
  fi

  NETARGS="${NETARGS} -netdev type=tap,id=netdev$i,script=$SCRIPT -device 
virtio-net-pci,mac=52:54:00:12:34:$(printf "%.2x\n" 
$i),netdev=netdev$i,bus=pci.0,addr=$dev.$func$MULTIFUNC"

  i=$(($i+1))
  func=$(($func+1))
  if [ $func -eq 8 ]; then
    func=0
    dev=$(($dev+1))
  fi
done

$QEMU -L $BIOS -m 1024 -drive file=$DISK,if=virtio,boot=on $NETARGS -vnc :0
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to