QEMU tutorial:How to use ivshmem-plain
文章目录
QEMU tutorial: How to use ivshmem-plain。
Notes about ivshmem
1. hotplug ivshmem in QEMU monitor
Use QEMU to launch a VM, enter the monitor mode.1
2
3
4(qemu) object_add memory-backend-file,size=16M,share,mem-path=/dev/shm/shm1,id=shm1
(qemu) device_add ivshmem-plain,memdev=shm1,bus=pci.0,addr=0x10,master=on
(qemu) object_add memory-backend-file,size=8M,share,mem-path=/dev/shm/shm2,id=shm2
(qemu) device_add ivshmem-plain,memdev=shm2,bus=pci.0,addr=0x11,master=on
2. write the signature into shared memory in host
1 | echo "SIGN_01" > /dev/shm/shm1 |
3. read the signature from shared memory in guest
1 | // t.c |
1 | gcc t.c |
参考资料: