]> code.ossystems Code Review - openembedded-core.git/commit
runqemu: support multiple NICs
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Tue, 17 Mar 2020 15:26:50 +0000 (16:26 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Mar 2020 09:59:56 +0000 (09:59 +0000)
commit59bfdc331c1494c05ab38804b281878a1f571f6d
treebcc3f33da1e483fb9622bb0163f50bd4c692b095
parent61d80b07bcfa4adf5f1feb2904fec0a8d09c89f6
runqemu: support multiple NICs

Emulating more than one network interface with runqemu is a bit tricky,
but possible. For example, the following leads to an emulated device with
eth0 and eth1:

QB_NETWORK_DEVICE_prepend = " \
    -device virtio-net-device,mac=52:54:00:12:34:03 \
"

or

QB_NETWORK_DEVICE_append = " \
    -device virtio-net-pci,mac=52:54:00:12:34:03 \
"

When booting Qemu with two NICs, the kernel does not know which
interface the specified ip=192.168.7.... command line argument
should be applied. This delays the boot process for a very long
time and a guest wihtout IP configuration.

This add two new configuraton parameters to runqemu:
QB_CMDLINE_IP_SLIRP and QB_CMDLINE_IP_TAP to explicitely specify the ip=
kernel command line arguments for tap and slirp mode.

Note: Simply adding "::eth0" broke some builds on the Yocto autobuilder.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/qemuboot.bbclass
scripts/runqemu