diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-11-28 22:02:05 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:04:00 +0000 |
commit | 7dddd090806914a62d977730440d803e48f44763 (patch) | |
tree | 9e61013e8bd5f73b8344afe6a898340e41a33175 /meta/classes | |
parent | 84b2281595bbdb497daa42640e3ee4658bf0bed8 (diff) | |
download | openembedded-core-7dddd090806914a62d977730440d803e48f44763.tar.gz openembedded-core-7dddd090806914a62d977730440d803e48f44763.tar.bz2 openembedded-core-7dddd090806914a62d977730440d803e48f44763.zip |
runqemu: fixes for slirp, network device and hostfwd
Fixed:
- Add QB_NETWORK_DEVICE to set network device, it will be used by both
slirp and tap.
- Set QB_NETWORK_DEVICE to "-device virtio-net-pci" in qemuboot.bbclass
but runqemu will default to "-device e1000" when QB_NETWORK_DEVICE is
not set, this is because oe-core's qemu targets support
virtio-net-pci, but the one outside of oe-core may not,
"-device e1000" is more common.
- Set hostfwd by default: 2222 -> 22, 2323 -> 23, and it will choose a
usable port when the one like 222 is being used. This can avoid
conflicts when multilib slirp qemus are running. We can forward more
ports by default if needed, and bsp.conf can custom it.
- Use different mac sections for slirp and tap to fix conflicts when
running both of them on the same host.
[YOCTO #7887]
CC: Nathan Rossi <nathan@nathanrossi.com>
CC: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/qemuboot.bbclass | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index a181fa2213..be5d7a4c8f 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -18,11 +18,15 @@ # QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used # when QB_AUDIO_DRV is set. # QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda +# QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@", +# it needs work with QB_TAP_OPT and QB_SLIRP_OPT. +# Note, runqemu will replace @MAC@ with a predefined mac, you can set +# a custom one, but that may cause conflicts when multiple qemus are +# running on the same host. # QB_TAP_OPT: netowrk option for 'tap' mode, e.g., -# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0" +# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" # Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ... -# QB_SLIRP_OPT: network option for SLIRP mode, e.g., -# "-netdev user,id=net0 -device virtio-net-device,netdev=net0" +# QB_SLIRP_OPT: network option for SLIRP mode, e.g., -netdev user,id=net0" # QB_ROOTFS_OPT: used as rootfs, e.g., # "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" # Note, runqemu will replace "@ROOTFS@" with the one which is used, such as core-image-minimal-qemuarm64.ext4. @@ -40,6 +44,7 @@ QB_SERIAL_OPT ?= "-serial mon:stdio -serial null" QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}" QB_DEFAULT_FSTYPE ?= "ext4" QB_OPT_APPEND ?= "-show-cursor" +QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@" # Create qemuboot.conf addtask do_write_qemuboot_conf after do_rootfs before do_image |