PR 1186 remake

Re-create PR #1186, so @jzupka needs to only re-create the parts pertinent to tp-qemu in that repo.