rewrite qemu.py