summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2019-04-25 14:05:24 +0000
committerYousong Zhou <yszhou4tech@gmail.com>2019-04-26 13:09:33 +0000
commitd72687854680af889998c89ebbb40812109a6565 (patch)
tree72fa3316821931cf768597ab841eec66f7c63a66 /scripts
parent647356a3d2c7f7694434482061ee66bd76601f3f (diff)
downloadopenwrt-d72687854680af889998c89ebbb40812109a6565.tar.gz
openwrt-d72687854680af889998c89ebbb40812109a6565.tar.bz2
openwrt-d72687854680af889998c89ebbb40812109a6565.zip
scripts/qemustart: fix network device emulation
We only enabled pcnet driver for malta machine, and x86/legacy target was supposed to only support e1000 model Cc: Petr Štetiar <ynezz@true.cz> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qemustart28
1 files changed, 17 insertions, 11 deletions
diff --git a/scripts/qemustart b/scripts/qemustart
index 8daeac69a8..2d1f476dde 100755
--- a/scripts/qemustart
+++ b/scripts/qemustart
@@ -232,11 +232,9 @@ start_qemu_malta() {
# one will be actually used as the wan, lan network interface inside the
# guest machine
[ -z "$o_network" ] || {
- o_qemu_extra+=( \
- "-netdev" "bridge,id=wan,br=$BR_WAN,helper=$HELPER" "-device" \
- "virtio-net-pci,id=devwan,netdev=wan,mac=$MAC_WAN" \
- "-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \
- "-device" "virtio-net-pci,id=devlan,netdev=lan,mac=$MAC_LAN" \
+ o_qemu_extra+=(
+ -netdev bridge,id=wan,br="$BR_WAN,helper=$HELPER" -device pcnet,netdev=wan,mac="$MAC_WAN"
+ -netdev bridge,id=lan,br="$BR_LAN,helper=$HELPER" -device pcnet,netdev=lan,mac="$MAC_LAN"
)
}
@@ -279,12 +277,20 @@ start_qemu_x86() {
}
[ -z "$o_network" ] || {
- o_qemu_extra+=( \
- "-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \
- "-device" "virtio-net-pci,id=devlan,netdev=lan,mac=$MAC_LAN" \
- "-netdev" "bridge,id=wan,br=$BR_WAN,helper=$HELPER" "-device" \
- "virtio-net-pci,id=devwan,netdev=wan,mac=$MAC_WAN" \
- )
+ case "${o_subtarget%-*}" in
+ legacy)
+ o_qemu_extra+=(
+ -netdev "bridge,id=lan,br=$BR_LAN,helper=$HELPER" -device "e1000,id=devlan,netdev=lan,mac=$MAC_LAN"
+ -netdev "bridge,id=wan,br=$BR_WAN,helper=$HELPER" -device "e1000,id=devwan,netdev=wan,mac=$MAC_WAN"
+ )
+ ;;
+ generic|64)
+ o_qemu_extra+=(
+ -netdev "bridge,id=lan,br=$BR_LAN,helper=$HELPER" -device "virtio-net-pci,id=devlan,netdev=lan,mac=$MAC_LAN"
+ -netdev "bridge,id=wan,br=$BR_WAN,helper=$HELPER" -device "virtio-net-pci,id=devwan,netdev=wan,mac=$MAC_WAN"
+ )
+ ;;
+ esac
}
case "${o_subtarget%-*}" in