mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00: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:
parent
522a1cdc5b
commit
2ecb09ba7e
@ -1 +1,2 @@
|
||||
-m 768 -M realview-pbx-a9
|
||||
-net nic,model=lan9118,netdev=net0 -netdev user,id=net0
|
||||
|
@ -1 +1,2 @@
|
||||
-machine q35
|
||||
-net nic,model=e1000,netdev=net0 -netdev user,id=net0
|
||||
|
@ -1,6 +1,8 @@
|
||||
-m 2048
|
||||
-global virtio-mmio.force-legacy=false
|
||||
-device virtio-net-device,bus=virtio-mmio-bus.0,netdev=net0
|
||||
-device virtio-mouse-device
|
||||
-device virtio-keyboard-device
|
||||
-netdev user,id=net0
|
||||
arm_v8a: -M virt,virtualization=true,gic-version=3 -cpu cortex-a53 -smp 4
|
||||
arm_v7a: -M virt,virtualization=true -cpu cortex-a15 -smp 2
|
||||
|
@ -155,14 +155,4 @@ append config {
|
||||
append qemu_args " -nographic "
|
||||
append_qemu_nic_args
|
||||
|
||||
# When using with a tap device manually replace append_qemu_nic_args with:
|
||||
#proc qemu_nic_model {} {
|
||||
# if [have_spec x86] { return e1000 }
|
||||
# if [have_board pbxa9] { return lan9118 }
|
||||
# if [have_board zynq_qemu] { return cadence_gem }
|
||||
# return nic_model_missing
|
||||
#}
|
||||
#append qemu_args " -net nic,model=[qemu_nic_model] "
|
||||
#append qemu_args " -net tap,ifname=tap0,downscript=no,script=no "
|
||||
|
||||
# vi: set ft=tcl :
|
||||
|
@ -114,13 +114,4 @@ append config {
|
||||
append qemu_args " -nographic "
|
||||
append_qemu_nic_args
|
||||
|
||||
#proc qemu_nic_model {} {
|
||||
# if [have_spec x86] { return e1000 }
|
||||
# if [have_board pbxa9] { return lan9118 }
|
||||
# if [have_board zynq_qemu] { return cadence_gem }
|
||||
# return nic_model_missing
|
||||
#}
|
||||
#append qemu_args " -net nic,model=[qemu_nic_model] "
|
||||
#append qemu_args " -net tap,ifname=tap0,downscript=no,script=no "
|
||||
|
||||
# vi: set ft=tcl :
|
||||
|
@ -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 "
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user