From 48089fbb1f6332d4ff5e3a27ae8d8d06429b8c7a Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Sun, 12 Nov 2017 04:07:01 +0000 Subject: [PATCH] Allow specifying a bridge for qemu to use Allow `make qemu` to take an additional parameter `bridge` that specifies the bridge interface to use for the netdev. This allows `make qemu brige=br0` which would create a VM connected to br0. --- mk/qemu.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mk/qemu.mk b/mk/qemu.mk index 928c52f..f17203f 100644 --- a/mk/qemu.mk +++ b/mk/qemu.mk @@ -12,7 +12,11 @@ endif ifeq ($(net),no) QEMUFLAGS+=-net none else - QEMUFLAGS+=-net nic,model=e1000 -net user -net dump,file=build/network.pcap + ifneq ($(bridge),) + QEMUFLAGS+=-netdev bridge,br=$(bridge),id=net0 -device e1000,netdev=net0,id=nic0 + else + QEMUFLAGS+=-net nic,model=e1000 -net user -net dump,file=build/network.pcap + endif ifeq ($(net),redir) QEMUFLAGS+=-redir tcp:8023::8023 -redir tcp:8080::8080 endif