[PATCH openbmc v2 7/7] runqemu-internal: Configure tun/tap network for palmetto-bmc
OpenBMC Patches
openbmc-patches at stwcx.xyz
Mon Apr 18 11:30:33 AEST 2016
From: Andrew Jeffery <andrew at aj.id.au>
The palmetto-bmc QEMU machine can now be invoked with tun/tap network
support through Poky's `runqemu` script:
$ bitbake obmc-phosphor-image
$ runqemu palmetto
Note that this requires root for tun/tap configuration, however the
benefit is full network access with no port-forwarding required to
reach services running inside the VM.
When running in tun/tap mode, the IP address for the VM is 192.168.7.2.
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
yocto-poky/scripts/runqemu-internal | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/yocto-poky/scripts/runqemu-internal b/yocto-poky/scripts/runqemu-internal
index 78b19c1..f0a014d 100755
--- a/yocto-poky/scripts/runqemu-internal
+++ b/yocto-poky/scripts/runqemu-internal
@@ -378,7 +378,16 @@ if [ "$MACHINE" = "palmetto" ]; then
QEMU=qemu-system-arm
MACHINE_SUBTYPE=palmetto-bmc
export QEMU_AUDIO_DRV="none"
- KERNCMDLINE="console=ttyS4"
+ if [ "$SLIRP_ENABLED" != "yes" ]; then
+ KERNEL_NETWORK_CMD=${KERNEL_NETWORK_CMD}"::eth0"
+ fi
+ # In either case, don't use virtio, use the SoC net devices
+ if [ "$VHOST_ACTIVE" = "yes" ]; then
+ QEMU_NETWORK_CMD="-net nic $QEMU_TAP_CMD,vhost=on"
+ else
+ QEMU_NETWORK_CMD="-net nic $QEMU_TAP_CMD"
+ fi
+ KERNCMDLINE="console=ttyS4 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off"
KERNELDTB=${DEPLOY_DIR_IMAGE}/${PALMETTO_DEFAULT_KERNEL}-aspeed-bmc-opp-qemu${MACHINE}.dtb
QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} -dtb $KERNELDTB -initrd $ROOTFS -no-reboot -nographic"
fi
--
2.7.1
More information about the openbmc
mailing list