mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
tool/run: move nic model to qemu_args file
Always instantiating a network device with id `net0`, removes the need to call append_qemu_nic_args in run scripts unless we want to add forwarding rules. genodelabs/genode#4311
This commit is contained in:
committed by
Christian Helmuth
parent
522a1cdc5b
commit
2ecb09ba7e
@@ -198,6 +198,12 @@ proc run_power_on { } {
|
||||
if {[regexp -- {-m\s+} $board_qemu_args dummy]} {
|
||||
regsub -all {\-m\s+\S+} $qemu_args "" qemu_args }
|
||||
|
||||
##
|
||||
# let user override any netdev
|
||||
#
|
||||
if {[regexp -- {-netdev\s+user,id=(\w+)} $qemu_args dummy netdev]} {
|
||||
regsub -all "\\-netdev\\s+user,id=$netdev\\S*" $board_qemu_args "" board_qemu_args }
|
||||
|
||||
# append custom board-specific qemu_args
|
||||
append qemu_args " $board_qemu_args"
|
||||
|
||||
|
||||
@@ -14,13 +14,6 @@ proc qemu_args { } {
|
||||
return $qemu_args
|
||||
}
|
||||
|
||||
proc qemu_nic_model {} {
|
||||
if [have_board pbxa9] { return lan9118 }
|
||||
if [have_board zynq_qemu] { return cadence_gem }
|
||||
if [have_board pc] { return e1000 }
|
||||
return nic_model_missing
|
||||
}
|
||||
|
||||
proc append_qemu_nic_args { { extra_netdev_args "" } } {
|
||||
global qemu_args
|
||||
append qemu_args " -netdev user,id=net0"
|
||||
@@ -28,13 +21,6 @@ proc append_qemu_nic_args { { extra_netdev_args "" } } {
|
||||
if { $extra_netdev_args ne "" } {
|
||||
append qemu_args ",$extra_netdev_args"
|
||||
}
|
||||
|
||||
if {[have_board virt_qemu]} {
|
||||
append qemu_args " -global virtio-mmio.force-legacy=false "
|
||||
append qemu_args " -device virtio-net-device,bus=virtio-mmio-bus.0,netdev=net0 "
|
||||
} else {
|
||||
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user