Adapt network run scripts for recent Qemu (3.1)

-netdev and -device should work with Qemu versions >= 2.5 at least but
3.0 dropped support for legacy -net completely.
This commit is contained in:
Christian Helmuth 2019-02-11 15:34:30 +01:00 committed by Norman Feske
parent 00fa48a886
commit abdd1d7715
16 changed files with 132 additions and 52 deletions

View File

@ -156,9 +156,14 @@ lappend_if [have_spec gpio] boot_modules [gpio_drv]
build_boot_image $boot_modules
append qemu_args " -net user"
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
run_genode_until forever

View File

@ -161,9 +161,14 @@ build_boot_image $boot_modules
append qemu_args " -m 512 -nographic "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
return nic_model_missing
}
append qemu_args " -net user -redir tcp:5555::22 "
append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:22 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
set lxip_match_string "ipaddr=(\[0-9\]+\.\[0-9\]+\.\[0-9\]+\.\[0-9\]+).*\n"

View File

@ -90,7 +90,7 @@ install_config $config
set boot_modules {
core ld.lib.so init timer
nic_drv
libc.lib.so vfs.lib.so lwip_legacy.lib.so libc_pipe.lib.so
libc.lib.so vfs.lib.so libc_pipe.lib.so
tcp_terminal
test-terminal_echo
vfs_lwip.lib.so
@ -106,12 +106,16 @@ build_boot_image $boot_modules
#
# qemu config
append qemu_args " -nographic "
append qemu_args " -nographic "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
return nic_model_missing
}
append qemu_args " -net user -redir tcp:5555::8888 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:8888 "
run_genode_until forever

View File

@ -126,8 +126,16 @@ lappend_if [have_spec gpio] boot_modules [gpio_drv]
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -nographic -net user"
append qemu_args " -nographic "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
run_genode_until {child "fetchurl" exited with exit value 0} 120

View File

@ -7,7 +7,7 @@
# the HTTP server is up, a HTTP request to the server is performed using
# 'lynx'. The response is validated against a known pattern.
#
# The test uses qemu's "-net user" option, redirecting Genode's port 80 to the
# The test uses qemu's "-netdev user" option, redirecting Genode's port 80 to the
# host's port 5555. Consequently, it cannot be executed on non-qemu test
# environments (i.e., the test won't work with the Linux version of Genode).
#
@ -148,10 +148,15 @@ build_boot_image $boot_modules
# qemu config
append qemu_args " -nographic "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -net user -redir tcp:5555::80 "
append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
run_genode_until {.*lwIP Nic interface up.*\n} 30

View File

@ -109,9 +109,16 @@ lappend_if [have_spec gpio] boot_modules [gpio_drv]
build_boot_image $boot_modules
append qemu_args " -nographic -net user"
append qemu_args " -nographic "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
run_genode_until forever

View File

@ -168,10 +168,15 @@ build_boot_image $boot_modules
append qemu_args " -nographic "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -net user "
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
append done_string {.*?\[server_1 -> lwip] rcv .\[32mETH.\[0m 02:02:02:02:42:00}
append done_string {.*?\[server_2 -> lwip] rcv .\[32mETH.\[0m 02:02:02:02:23:00}

View File

@ -155,11 +155,16 @@ append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -net user "
append qemu_args " -nographic -serial mon:stdio "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
run_genode_until forever

View File

@ -244,10 +244,17 @@ append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -nographic "
append qemu_args " -net user -nographic "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
#########################

View File

@ -150,10 +150,17 @@ append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -nographic "
append qemu_args " -net user -nographic "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
set done_string ".*\"ping_1\" exited with exit value 0.*\n"

View File

@ -266,10 +266,17 @@ append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -nographic "
append qemu_args " -net user -nographic "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
set done_string ""
for {set i 0} {$i < 3} {incr i 1} {

View File

@ -156,9 +156,14 @@ append boot_modules {
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
if [have_spec cadence_gem] { return cadence_gem }
return nic_model_missing
}
append qemu_args " -net user "
append qemu_args " -netdev user,id=net0 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
run_genode_until forever

View File

@ -165,6 +165,7 @@ set boot_modules {
core init timer ld.lib.so
libc.lib.so libm.lib.so posix.lib.so
vfs.lib.so vfs_lwip.lib.so zlib.lib.so
libcrypto.lib.so libssl.lib.so
lighttpd genode_org.tar
}
@ -177,10 +178,14 @@ append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
return nic_model_missing
}
append qemu_args " -net user -redir tcp:5555::80 "
append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
append qemu_args " -nographic -serial mon:stdio "
run_genode_until forever

View File

@ -121,10 +121,14 @@ append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
return nic_model_missing
}
append qemu_args " -net user -redir tcp:5555::80 "
append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:80 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
append qemu_args " -nographic -serial mon:stdio "
append xen_args { sdl=0\; vif=\["model=e1000,mac=02:00:00:00:01:01,bridge=xenbr0"\] }

View File

@ -380,10 +380,14 @@ build_boot_image $boot_modules
# qemu config
append qemu_args " -nographic "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
proc qemu_nic_model {} {
if [have_spec x86] { return e1000 }
if [have_spec lan9118] { return lan9118 }
return nic_model_missing
}
append qemu_args " -net user -redir tcp:12865::12865 -redir tcp:49153::49153 "
append qemu_args " -netdev user,id=net0,hostfwd=tcp::12865-:12865,hostfwd=tcp::49153-:49153 "
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
set force_ports ""
if $use_nic_router {

View File

@ -101,9 +101,6 @@ proc run_power_on { } {
if {[have_spec vpb926]} { append qemu_args " -M versatilepb -m 128 " }
if {[have_spec zynq_qemu]} { append qemu_args " -M xilinx-zynq-a9 -cpu cortex-a9 -m 256 " }
# add devices for specific platforms
if {[have_spec zynq] && [have_spec cadence_gem]} { append qemu_args " -net nic,model=cadence_gem" }
# on x86, we support booting via pxe or iso/disk image
if {[have_spec x86]} {
if {![regexp -- {-m} $qemu_args dummy]} {