Testing Libvirt on Arndale A15 and Calxeda Midway

The following documents what is required to bring up a Versatile Express guest with KVM enabled:

Prerequisites / Versions Used

Arndale

  • Linaro hwpack for Arndale (i.e. hwpack_linaro-arndale_20130911-0752_b160_armhf_supported.tar.gz)
    • kernel Linux linaro-server 3.11.0-rc7-linaro-arndale #2 SMP Fri Sep 6 06:16:06 UTC 2013 armv7l armv7l armv7l GNU/Linux or later

  • Linaro image tarball (i.e. linaro-raring-server-20130906-485.tar.gz)

Create SD Card

Create an SD card for Arndale using the hwpack and image (using linaro-media-create --mmc ${MICROSD_DEVICE}  --dev arndale --hwpack ${HWPACK} --hwpack-force --binary ${BINS}).

Midway

Building Libvirt

Install dependencies

  • add the Linaro Tools PPA (ppa:linaro-maintainers/tools)

    • sudo apt-get -y install python-software-properties

    • sudo add-apt-repository ppa:linaro-maintainers/tools

    • sudo apt-get update

  • sudo apt-get -y install libyajl-dev libxml2-dev libtool autoconf build-essential pkg-config xsltproc autopoint libxml2-utils python-dev libdevmapper-dev libpciaccess-dev libnl-dev gettext w3c-dtd-xhtml dnsmasq qemu-system

If running Saucy...

If you attempt to run this on Saucy, it's possible that qemu-system from Linaro will not install correctly. If so, do the following:

  • Edit /etc/apt/sources.list.d/linaro-maintainers-tools-*.list and change 'saucy' to 'raring'.
  • Next you'll need to manually install vde2: sudo apt-get install vde2

  • Download the older libbrlapi0.5 and install it:
    • wget http://launchpadlibrarian.net/134200623/libbrlapi0.5_4.4-8ubuntu4_armhf.deb

    • sudo dpkg -i libbrlapi0.5_4.4-8ubuntu4_armhf.deb

  • I also had to manually remove several non-Linaro qemu-system-* packages that were already installed, likely by one of the package sets I selected during OS installation. Once these were removed, qemu-system installed correctly.

Building

./autogen.sh --system ; make ; make check

(you can also make a debian package by running dh_make, then dpkg-buildpackage)

Running

Install dependencies

  • sudo apt-get install bridge-utils dnsmasq ebtables libnl1 libpciaccess0 pmtools pm-utils qemu-system libyajl2

Installing

make install

Running libvirtd as a daemon

libvirtd --daemon

Libvirt Domain XML

The following libvirt domain XML:

   1 <domain type='kvm'>
   2   <name>vexpress1</name>
   3   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   4   <title>Test versatile express guest</title>
   5   <description>
   6     Test versatile express guest with KVM enabled
   7   </description>
   8   <vcpu>2</vcpu>
   9   <memory unit='MiB'>1024</memory>
  10   <currentMemory unit='MiB'>1024</currentMemory>
  11   <os>
  12     <type arch='armv7l' machine='vexpress-a15'>hvm</type>
  13     <kernel>/opt/zImage</kernel>
  14     <cmdline>root=/dev/mmcblk0p2 rw devtmpfs.mount=0 console=ttyAMA0</cmdline>
  15     <dtb>/opt/vexpress-v2p-ca15-tc1.dtb</dtb>
  16   </os>
  17   <clock offset='utc'/>
  18   <on_poweroff>destroy</on_poweroff>
  19   <on_reboot>restart</on_reboot>
  20   <on_crash>destroy</on_crash>
  21   <devices>
  22     <emulator>/usr/bin/qemu-system-arm</emulator>
  23     <interface type='network'>
  24       <source network='default'/>
  25       <mac address='00:16:3e:1a:b3:4a'/>
  26     </interface>
  27     <disk type='file' device='disk'>
  28       <driver name='qemu' type='qcow2'/> 
  29       <source file='/opt/kvm.qcow2'/>
  30       <target bus='sd' dev='sda'/>
  31     </disk>
  32     <console type='pty'>
  33       <target port='0'/>
  34     </console>
  35   </devices>
  36 </domain>

generates the following qemu command line:

/usr/bin/qemu-system-arm -name vexpress1 -machine vexpress-a15,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 -nographic -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/home/linaro/.config/libvirt/qemu/lib/guest1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -kernel /opt/zImage -append 'root=/dev/mmcblk0p2 rw devtmpfs.mount=0 console=ttyAMA0 earlyprintk' -dtb /opt/vexpress-v2p-ca15-tc1.dtb -usb -drive file=/opt/kvm.qcow2,if=sd,index=0,format=qcow2 -net nic,macaddr=00:00:00:00:00:00,vlan=0,model=lan9118,name=net0 -net tap,vlan=0,name=hostnet0 -serial pty  

Running Test Suite (virt-test)

Install Prerequisites

  • add the virt-test PPA (ppa:lmr/autotest)

    • sudo apt-get -y install python-software-properties

    • sudo add-apt-repository ppa:lmr/autotest

    • sudo apt-get update

  • sudo apt-get install arping autotest p7zip-full

If running Saucy...

If you attempt to run this on Saucy, it's possible that autotest will not install correctly. If so, do the following:

  • Edit /etc/apt/sources.list.d/lmr-autotest-*.list and change 'saucy' to 'raring'.

LEG/Engineering/vertical-computing/LibvirtVexpressOnARM (last modified 2014-02-12 20:10:19)