This is the series version of this patch
https://www.redhat.com/archives/libvir-list/2011-July/msg00668.html
Daniel suggested to split it for easier review.
This series includes some small fixes for problem I noticed while
splitting the original patch.
Matthias