Commit 5008c31f authored by Dmitrii Golovanov's avatar Dmitrii Golovanov Committed by Carles Cufi
Browse files

config: qemu: Add QEMU_EXTRA_FLAGS config option



Add QEMU_EXTRA_FLAGS as QEMU board config option.

This allows Twister tests to provide additional device setup
commands to QEMU in prj.conf or testcase.yaml configuration files.

Example use case: to setup TCP or UDP network interfaces
with non-conflicting port numbers in different test suites
to avoid conflicts when Twister run tests in parallel on the
same host.

Signed-off-by: default avatarDmitrii Golovanov <dmitrii.golovanov@intel.com>
parent cbbb1cab
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -111,6 +111,15 @@ config QEMU_GDBSERVER_LISTEN_DEV
	  as the `QEMU_EXTRA_FLAGS` environment variable. Refer to application
	  development doc and/or QEMU invocation doc for more info.

config QEMU_EXTRA_FLAGS
	string "QEMU extra flags"
	depends on QEMU_TARGET
	default ""
	help
	  This option is to pass onto QEMU an extra list of parameters
	  to setup devices, for example to allocate interface for Zephyr
	  GDBstub over serial with `-serial tcp:127.0.0.1:5678,server`

# There might not be any board options, hence the optional source
osource "$(BOARD_DIR)/Kconfig"
endmenu
+7 −0
Original line number Diff line number Diff line
@@ -399,6 +399,13 @@ set(env_qemu $ENV{QEMU_EXTRA_FLAGS})
separate_arguments(env_qemu)
list(APPEND QEMU_EXTRA_FLAGS ${env_qemu})

# Also append QEMU flags from config
if(NOT CONFIG_QEMU_EXTRA_FLAGS STREQUAL "")
  set(config_qemu_flags ${CONFIG_QEMU_EXTRA_FLAGS})
  separate_arguments(config_qemu_flags)
  list(APPEND QEMU_EXTRA_FLAGS "${config_qemu_flags}")
endif()

list(APPEND MORE_FLAGS_FOR_debugserver_qemu -S)

if(NOT CONFIG_QEMU_GDBSERVER_LISTEN_DEV STREQUAL "")