[scripts][do-qemux86] add ability to set the network driver
@@ -9,7 +9,8 @@ function HELP {
echo "-m <memory in MB>"
echo "-s <number of cpus>"
echo "-d <disk image> : a virtio block device"
- echo "-n : a virtio network device"
+ echo "-n : user mode networking, defaults to virtio-net-pci device"
+ echo "-N <network driver> : specify network driver (virtio-net-pci, e1000e, etc)"
echo "-g : with graphics"
echo "-k : use KVM"
echo "-h for help"
@@ -24,12 +25,13 @@ DO_KVM=0
DO_DISK=0
DISK_IMAGE=""
DO_NET=0
+NETDEV=e1000e
MEMSIZE=0
SMP=1
SUDO=""
MAKE_VARS=""
-while getopts 6d:gklm:ns:h FLAG; do
+while getopts 6d:gklm:nN:s:h FLAG; do
case $FLAG in
6) DO_64BIT=1;;
d) DO_DISK=1; DISK_IMAGE=$OPTARG;;
@@ -38,10 +40,11 @@ while getopts 6d:gklm:ns:h FLAG; do
l) DO_LEGACY=1;;
m) MEMSIZE=$OPTARG;;
n) DO_NET=1;;
+ N) NETDEV=$OPTARG;;
s) SMP=$OPTARG;;
h) HELP;;
\?)
- echo unrecognized option
+ echo unrecognized option $OPTARG
HELP
esac
done
@@ -104,7 +107,10 @@ if (( $DO_DISK )); then
fi
if (( $DO_NET )); then
if (( ! $DO_LEGACY )); then
- ARGS+=" -netdev user,id=vmnic,hostname=qemu -device virtio-net-pci,netdev=vmnic"
+ ARGS+=" -netdev user,id=vmnic,hostname=qemu -device $NETDEV,netdev=vmnic"
+ #ARGS+=" -netdev tap,id=vmnic,ifname=qemu.tap0,script=no,downscript=no"
+ #ARGS+=" -device e1000e,netdev=vmnic"
+ #SUDO="sudo"
else
echo "implement legacy + network config"
exit 1
