Commit cb8d1fa3 authored by Sjoerd Simons's avatar Sjoerd Simons Committed by Paweł Wieczorek
Browse files

boot: qemu: allow host bridge network in docker



To allow qemu devices both inside and outside to operate mosty
identically, especially with respect to netdevice configuration, the
docker network environment should match the host network environment.

To achieve that tell docker to set the network to host and add the
NET_ADMIN capability. On top of that to support the qemu bridge
netdevices add the tun device from the host.

Fixes: #548

Signed-off-by: Sjoerd Simons's avatarSjoerd Simons <sjoerd@collabora.com>

Upstream: https://git.lavasoftware.org/lava/lava/-/merge_requests/1778
parent 41ce81bf
......@@ -377,6 +377,8 @@ class CallQemuAction(Action):
docker.environment("QEMU_AUDIO_DRV", os.environ["QEMU_AUDIO_DRV"])
docker.bind_mount(DISPATCHER_DOWNLOAD_DIR)
docker.add_device("/dev/kvm", skip_missing=True)
docker.add_device("/dev/net/tun", skip_missing=True)
docker.add_docker_run_options("--network=host", "--cap-add=NET_ADMIN")
# Use docker.binary if provided and fallback to the qemu default binary
args = [self.parameters["docker"].get("binary", self.sub_command[0])]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment