KVM buildserver should define and manage its own "storage pool"
./makebuildserver
should create and manage its own libvirt storage pool so that it always has full read/write permissions on the files it creates. By default, libvirt installations seem to use /var/lib/libvirt/images, and then it sets the permissions to:
-rw------- 1 root root /var/lib/libvirt/images/buildserver_default.img
That means ./makebuildserver
cannot make a vagrant box without first using sudo chmod -R a+rX /var/lib/libvirt/images
or by running as root. Neither of these are good. With VirtualBox, the whole process is run without root, so it should be with KVM as well.
Inspired by this answer I managed to get this working manually:
$ virsh --connect qemu:///system pool-destroy default
$ virsh --connect qemu:///system pool-undefine default
$ virsh --connect qemu:///system pool-define-as --name default --type dir --target ~/code/fdroid/fdroidserver/buildserver
$ virsh --connect qemu:///system pool-build default # this might be optional
$ virsh --connect qemu:///system pool-autostart default
$ virsh --connect qemu:///system pool-start default
Even better than deleting and reusing the default pool, ./makebuildserver
should create and manage a storage pool with a name that is unlikely to clash with other projects.
Edited by Hans-Christoph Steiner