Move some common functions to utils_test.libvirt