vhost + qemu-system-aarch64

/usr/libexec/qemu-kvm -h
$ /path/to/aarch64-softmmu/qemu-system-aarch64 
  -machine virt 
  -cpu cortex-a57 
  -nographic -smp 1 
  -hda /path/to/rootfs.ext3 
  -kernel /path/to/arch/arm64/boot/Image 
  -append "console=ttyAMA0 root=/dev/vda oops=panic panic_on_warn=1 panic=-1 ftrace_dump_on_oops=orig_cpu debug earlyprintk=serial slub_debug=UZ" 
  -m 2048 
  -net user,hostfwd=tcp::10023-:22 -net nic
$ ssh -i /path/to/id_rsa root@localhost -p 10023
 [root@localhost cloud_images]# qemu-system-aarch64  -name vm2 -enable-kvm -M virt -cpu host -smp 2 -m 4096 
> -object memory-backend-file,id=mem,size=4096M,mem-path=/mnt/huge,share=on 
> -numa node,memdev=mem -mem-prealloc -drive file=vhuser-test1.qcow2  
> -chardev socket,path=/tmp/vm2_qga0.sock,server,nowait,id=vm2_qga0 -device virtio-serial 
> -device virtserialport,chardev=vm2_qga0,name=org.qemu.guest_agent.2 -daemonize 
> -monitor unix:/tmp/vm2_monitor.sock,server,nowait -net nic,macaddr=00:00:00:08:e8:aa,addr=1f 
> -net user,hostfwd=tcp:127.0.0.1:6002-:22 
> -chardev socket,id=char0,path=./vhost-net,server 
> -netdev type=vhost-user,id=netdev0,chardev=char0,vhostforce 
> -device virtio-net-pci,netdev=netdev0,mac=52:54:00:00:00:01,mrg_rxbuf=on,rx_queue_size=1024,tx_queue_size=1024 
> -vnc :10
qemu-system-aarch64: -chardev socket,id=char0,path=./vhost-net,server: info: QEMU waiting for connection on: disconnected:unix:./vhost-net,server
qemu-system-aarch64: failed to find romfile "efi-virtio.rom"
[root@localhost cloud_images]# 
[root@localhost vhost]# ./build/vhost-switch -l 0-3 -n 4 --huge-dir /dev/hugepages --socket-mem 1024 --log-level 8 -w 0000:07:00.1 -- --socket-file  /data1/cloud_images/vhost-net   --client -p 0x1 --stats 20
EAL: Detected 128 lcore(s)
EAL: Detected 4 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: No available hugepages reported in hugepages-2048kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
VHOST_PORT: 
Specified port number(1) exceeds total system port number(0)
VHOST_DATA: Procesing on Core 1 started
VHOST_DATA: Procesing on Core 2 started
VHOST_DATA: Procesing on Core 3 started
VHOST_CONFIG: vhost-user client: socket created, fd: 42
VHOST_CONFIG: new device, handle is 0
VHOST_CONFIG: read message VHOST_USER_GET_FEATURES
VHOST_CONFIG: read message VHOST_USER_GET_PROTOCOL_FEATURES
VHOST_CONFIG: read message VHOST_USER_SET_PROTOCOL_FEATURES
VHOST_CONFIG: negotiated Vhost-user protocol features: 0xcb7
VHOST_CONFIG: read message VHOST_USER_GET_QUEUE_NUM
VHOST_CONFIG: read message VHOST_USER_SET_SLAVE_REQ_FD
VHOST_CONFIG: read message VHOST_USER_SET_OWNER
VHOST_CONFIG: read message VHOST_USER_GET_FEATURES
VHOST_CONFIG: read message VHOST_USER_SET_VRING_CALL
VHOST_CONFIG: vring call idx:0 file:46
VHOST_CONFIG: read message VHOST_USER_SET_VRING_CALL
VHOST_CONFIG: vring call idx:1 file:47
VHOST_CONFIG: recvmsg failed
VHOST_CONFIG: vhost peer closed
VHOST_CONFIG: vhost-user client: socket created, fd: 42
VHOST_CONFIG: failed to connect to /data1/cloud_images/vhost-net: Connection refused
VHOST_CONFIG: /data1/cloud_images/vhost-net: reconnecting...
原文地址:https://www.cnblogs.com/dream397/p/13925761.html