Hi,
While trying to bring ethernet interface using tap0 I am getting below errors
qemu-system-ppc64: -netdev tap,id=tap0,script=no,vhost=on: vhost-net support is not compiled in
qemu-system-ppc64: -netdev tap,id=tap0,script=no,vhost=on: vhost-net requested but could not be initialized
qemu-system-ppc64: -netdev tap,id=tap0,script=no,vhost=on: Device 'tap' could not be initialized
The command which I tried to fire is given below
sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -cpu e5500 -nographic -m 256 -M ppce500 -kernel uImage -initrd fsl-image-minimal-t1040rdb-20141223093206.rootfs.ext2.gz -append "root=/dev/ram rw console=ttyS0,115200" -serial tcp::4444,server,telnet -netdev tap,id=tap0,script=no,vhost=on -device virtio-net-pci,netdev=tap0
The system configuration is given below
Build Configuration:
BB_VERSION = "1.22.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "CentOS-7.0.1406"
TARGET_SYS = "powerpc-fsl-linux"
MACHINE = "t1040rdb"
DISTRO = "fsl-networking"
DISTRO_VERSION = "1.6"
TUNE_FEATURES = "m32 fpu-hard e5500"
TARGET_FPU = "hard"
meta
meta-yocto
meta-yocto-bsp = "(detachedfromfsl-sdk-v1.6):0d2ce44c2b0f8cc9699e30cca2c24655be89d58b"
meta-fsl-ppc = "(detachedfromfsl-sdk-v1.6):6cf59d9de63a9fc5f8942c0d10c622898f4315ce"
meta-fsl-ppc-toolchain = "(detachedfromfsl-sdk-v1.6):a546e42f86e7d57de19e27907365d170b13fc18f"
meta-fsl-networking
meta-fsl-networking = "(detachedfrom8dec9c6):8dec9c690188cce5305ef5055f91e5cfa35c63f4"
meta-virtualization
meta-virtualization = "(detachedfromfsl-sdk-v1.6):8044073f63a0d99541a43ac5f2f6d789f94c7c7c"
meta-oe
meta-networking
meta-webserver
meta-ruby
meta-filesystems = "(detachedfromfsl-sdk-v1.6):b86007f742a1b829ccc8d76e485bb3f789cefaa4"
meta-java = "(detachedfromfsl-sdk-v1.6):d01f7d39e513790ddce20e6724723722119a3700"
meta-openstack
meta-openstack-compute-deploy
meta-openstack-controller-deploy
meta-openstack-qemu = "(detachedfromfsl-sdk-v1.6):f627404399a134672e0b5e26a0d9b794a6f8adf4"
So any thoughts how to fix it as I tried even recompling the Kernel as given part of http://www.freescale.com/infocenter/index.jsp?topic=%2FQORIQSDK%2F2888263.html but still I am getting same error.
Thanks,
Abhinav
Finally I am able to solve the issue. Basically I need to create tap0 device manually using below steps. Below are the instruction for CentOs 7. So hopefully same or modified steps can work on other OS.
1. Create a TAP device using below steps. Setting its IP address as 192.168.7.1 (other whatever you want to set it.) The main thing is to set the Gateway as 192.x.x.1 as it will act as gateway device for the QEMU machine.
Hope this will help if some one is looking for interfacing stuff.
-Abhinav
Again, you appear to be running QEMU on an x86 host (based on "sysroots/x86_64-linux" -- if that is not the case, and you're actually trying to run this on the PPC board, please let me know as Yocto is not my area of expertise). vhost_net is for KVM. You can't use KVM when the CPU types don't match.
Hi,
Basically I am trying to emulate PPC64e5500 as will be using T1024QorIQ (t1040rdb is the emulation board) on CentOs7 host. This build host or my development environment is on x86_64 with CentOs7 running on it.
The current SDK version which I am using is QorIQ-SDK-V1.6-PPC64E5500-IMAGE-20140619-yocto.iso for the same.
Now while trying to bring a QEMU based emulation we need to use physical ethernet interface i.e. eth0 for making this machine to talk to outside world. So I was trying to use TUN/TAP interface support which I think qemu-system-ppc is capable of doing so. So while passing the arguments to the commands I get this error. Even I tried to bring up the bridge interface using bridge-helper utility (part of the qemu-system-ppc) but similar error pops up.
Please let me know if you need more information.
Thanks,
Abhinav
Hi,
Below is the output from the QEMU machine
QEMU Machine
root@model:~# cat /proc/cpuinfo
processor : 0
cpu : e5500
clock : 400.000000MHz
revision : 2.0 (pvr 8024 1020)
bogomips : 800.00
total bogomips : 800.00
timebase : 400000000
platform : QEMU e500
model : QEMU ppce500
Memory : 128 MB
Host Machine
[root@mydevbox2 ~]# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)
[root@mydevbox2 ~]# uname -an
Linux mydevbox2 3.10.0-123.13.1.el7.x86_64 #1 SMP Tue Dec 9 23:06:09 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Command to bring up the QEMU machine
sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -cpu e5500 -nographic -m 256 -M ppce500 -kernel uImage -initrd fsl-image-minimal-t1040rdb-20141223093206.rootfs.ext2.gz -append "root=/dev/ram rw console=ttyS0,115200 ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=128M" -serial tcp::4444,server,telnet -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no
QEMU 1.7.0 monitor - type 'help' for more information
(qemu) QEMU waiting for connection on: telnet:0.0.0.0:4444,server
Also observed an bug with the qemu-bridge-helper script as it look for bridge.conf at a hard coded path as same can be verified as below
sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -cpu e5500 -nographic -m 256 -M ppce500 -kernel uImage -initrd fsl-image-minimal-t1040rdb-20141223093206.rootfs.ext2.gz -append "root=/dev/ram rw console=ttyS0,115200 ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=128M" -serial tcp::4444,server,telnet -net nic -net tap,"helper=/home/abhinav/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/lib/qemu/qemu-bridge-helper"
[sudo] password for abhinav:
failed to parse default acl file `/local/workspace/yocto-iso-make/sdk-v1.6.x/t1040rdb-64b/build_t1040rdb-64b_release/tmp/sysroots/x86_64-linux/etc/qemu/bridge.conf'
failed to launch bridge helper
qemu-system-ppc64: -net tap,helper=/home/abhinav/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/lib/qemu/qemu-bridge-helper: Device 'tap' could not be initialized
So when I created a soft links for the files even the bridge-helper didn't bring the ethernet interface as the bridge is configured on my base machine.
>sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -cpu e5500 -nographic -m 256 -M ppce500 -kernel uImage -initrd fsl-image-minimal-t1040rdb-20141223093206.rootfs.ext2.gz -append "root=/dev/ram rw console=ttyS0,115200 ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=128M" -serial tcp::4444,server,telnet -net nic -net tap,"helper=/home/abhinav/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/lib/qemu/qemu-bridge-helper"
failed to create tun device: Operation not permitted
failed to launch bridge helper
qemu-system-ppc64: -net tap,helper=/home/abhinav/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/lib/qemu/qemu-bridge-helper: Device 'tap' could not be initialized
So any thoughts to bring up the interface will be a great help.
Please let me know if you need more information.
Thanks,
Abhinav
Does your host kernel have CONFIG_TUN enabled (or the module loaded)?
Hi,
Please find below output of ipconfig as I am using openvpn for setting up tap device.
>ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.7.200 netmask 255.255.255.0 broadcast 192.168.7.255
inet6 fe80::ec5b:17ff:fe7d:2c13 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:80:74:64 txqueuelen 0 (Ethernet)
RX packets 3671 bytes 181803 (177.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 41 bytes 5155 (5.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno33557248: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500
inet6 fe80::250:56ff:fe80:7464 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:80:74:64 txqueuelen 1000 (Ethernet)
RX packets 34958 bytes 2137667 (2.0 MiB)
RX errors 0 dropped 12 overruns 0 frame 0
TX packets 981 bytes 69175 (67.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tap0: flags=4355<UP,BROADCAST,PROMISC,MULTICAST> mtu 1500
inet6 fe80::9822:63ff:fe67:33eb prefixlen 64 scopeid 0x20<link>
ether 9a:22:63:67:33:eb txqueuelen 100 (Ethernet)
RX packets 42 bytes 3388 (3.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3015 bytes 186074 (181.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>ls -l /dev/net/tun
crw-rw-rw-. 1 root root 10, 200 Dec 24 17:14 /dev/net/tun
So it seems that tap device is up and running without any issue. Please let me know if you need more information.
Thanks,
Abhinav
Note that you should be able to use ordinary virtio (not vhost) with QEMU regardless of KVM.