[libvirt] [PATCH 04/10] Re-factor qemu test machine allocation code