qemu: Support passing custom options to setup user mode networking

This can be used to specify things like port forwards, TFTP server,
etc.
This commit is contained in:
Tobias Waldekranz
2022-12-12 16:07:25 +01:00
parent c2c45026d0
commit d56937f9dc
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -61,6 +61,12 @@ config QEMU_NET_BRIDGE_DEV
depends on QEMU_NET_BRIDGE
default "virbr0"
config QEMU_NET_USER_OPTS
string "User mode options"
depends on QEMU_NET_USER
help
Extra -nic user,<OPTIONS>
config QEMU_NET_TAP_N
int "Number of TAPs"
depends on QEMU_NET_TAP
+3 -1
View File
@@ -75,7 +75,9 @@ net_args()
echo -n "-nic tap,ifname=qtap$i,script=no,model=$QEMU_NET_MODEL "
done
elif [ "$QEMU_NET_USER" = "y" ]; then
echo -n "-nic user,model=$QEMU_NET_MODEL "
[ "$QEMU_NET_USER_OPTS" ] && QEMU_NET_USER_OPTS="$QEMU_NET_USER_OPTS,"
echo -n "-nic user,${QEMU_NET_USER_OPTS}model=$QEMU_NET_MODEL "
else
echo -n "-nic none"
fi