1 execute ivshmem_server on host
./home/xzl/Nahanni+/Nahanni/nahanni-guest-code/ivshmem-server/ivshmem_server -m 256 /tmp/ivshmem_socket -n dynamo
-m :the size of shared memory
/tmp/ivshmem_socket : the path to initializing the socket for communicating with the ivshmem_device in virtual machine
2 start virtual machine
sudo /etc/init.d/networking restart
sudo qemu-system-x86_64 -m 1204 -hda /home/xzl/virtual_machine/ubuntu-12.04-amd64-first.img -localtime -net nic,vlan=0,macaddr=52-54-00-12-34-0,model=virtio -net tap,vlan=0,ifname=tap0,script=no -boot c -smp 2 -chardev socket,path=/tmp/ivshmem_socket,id=foo -device ivshmem,chardev=foo,size=256
lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
00:04.0 RAM memory: Red Hat, Inc Device 1110
Look the device for details
ls /sys/bus/pci/devices/0000\:00\:04.0
broken_parity_status consistent_dma_mask_bits enable local_cpulist msi_bus remove resource0 subsystem uevent
class device firmware_node local_cpus numa_node rescan resource1 subsystem_device vendor
config dma_mask_bits irq modalias power resource resource2 subsystem_vendor
vendor the device vendor
3 Install ivhshmem_device drive uio_ivshmem
cd kernel_module/uio
sudo make
sudo make install
make install : equal to "cp uio_ivshmem.ko /lib/modules/$(shell uname -r)/kernel/drivers/uio/ "