While working on virtualisation of custom services, I came across ivshmem module in kvm that I am now using to have interrupts and shared memory between host and multiple guests. Setting it up is easy, but available documentation is outdated.

Configuration
Host: Ubuntu 11.10, installed qemu-kvm
Guest: Gentoo, for minimal configuration and maximum customisability

Making it work

  1. Download and compile ivshmem support code from nahanni’s gitorious repo  on host and guest(s):
    git clone https://git.gitorious.org/nahanni/guest-code.git
  2. [Host] Go to ivshmem_server folder in downloaded code, build and run the following:
    ./ivshmem_server -m 512 -s nahanni -p /tmp/nahanni
  3. [Host] Run guest vm(s) using the following command line (or any other arguments):
    kvm -boot d -hda vhost-gentoo.raw -cpu core2duo -m 1G -chardev socket,path=/tmp/nahanni,id=nahanni -device ivshmem,chardev=nahanni,size=512m,ioeventfd=on,vectors=8
  4. [Guest] Go to kernel_module/standard folder in downloaded code, build and run
    insmod kvm_ivshmem.ko
  5. Check the kernel messages, make sure you see ‘MSI-X enabled’. If there is any error, fix the error first.
    dmesg | tail
  6. Check major number allocated to the char device created:
    cat /proc/devices | grep kvm_ivshmem
  7. Use the major number above – it’s ’250′ for my sequence of actions on my configured VM.
    mknod --mode=666 /dev/ivshmem c 250 0
  8. If you have multiple ivshmem devices serving different purposes
    # for each ivshmem device
    mknod --mode=666 /dev/ivshmem<n> c <n>
  9. It works now! Try the test code in tests folder in downloaded support code.

 

And it is a .NET web application in debug mode!

Blackberry store crash

 

This patch is on opencv svn revision 7044 as an interim hack for those who would like to switch to cuda release 4.1 but depend heavily on opencv.

opencv hacky patch to work with cuda 4.1

© 2011 Abhijeet Dev Suffusion theme by Sayontan Sinha