All right, I moved the function to utils_spice and I changed that test  qemu/tests/rv_build_install.py as well as something similar happened for clearx test, now there is a function in utils_spice, I'll change that in the test too and submit with this patchset fairly soon.